File size: 3,671 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
extend type IntegrationKey {
  """
  config returns the configuration for the key.
  """
  config: KeyConfig! @experimental(flagName: "univ-keys")

  """
  tokenInfo returns information about the access tokens for the key.
  """
  tokenInfo: TokenInfo! @experimental(flagName: "univ-keys")
}

type TokenInfo {
  """
  primaryHint is a hint for the primary token. It is empty if the primary token is not set.
  """
  primaryHint: String!

  """
  secondaryHint is a hint for the secondary token. It is empty if the secondary token is not set.
  """
  secondaryHint: String!
}

extend type Mutation {
  updateKeyConfig(input: UpdateKeyConfigInput!): Boolean!
    @experimental(flagName: "univ-keys")

  """
  promoteSecondaryToken promotes the secondary token to the primary token.
  """
  promoteSecondaryToken(id: ID!): Boolean! @experimental(flagName: "univ-keys")

  """
  deleteSecondaryToken deletes the secondary token.
  """
  deleteSecondaryToken(id: ID!): Boolean! @experimental(flagName: "univ-keys")

  """
  generateKeyToken generates a new token for an integration key.

  If the integration key already has a primary token, the new token will be the secondary token.

  If the integration key does not have a primary token, the new token will be the primary token.

  If the integration key already has a secondary token, an error will be returned.
  """
  generateKeyToken(id: ID!): String! @experimental(flagName: "univ-keys")
}

extend type Query {
  actionInputValidate(input: ActionInput!): Boolean!
    @experimental(flagName: "univ-keys")
}

type KeyConfig {
  rules: [KeyRule!]!

  """
  Get a single rule by ID.
  """
  oneRule(id: ID!): KeyRule @goField(forceResolver: true)

  """
  defaultAction is the action to take if no rules match the request.
  """
  defaultActions: [Action!]!
}

type KeyRule {
  id: ID!

  name: String!
  description: String!

  """
  An expression that must evaluate to true for the rule to match.
  """
  conditionExpr: ExprBooleanExpression!

  actions: [Action!]!

  """
  Continue evaluating rules after this rule matches.
  """
  continueAfterMatch: Boolean!
}

input UpdateKeyConfigInput {
  keyID: ID!

  rules: [KeyRuleInput!]

  """
  setRule allows you to set a single rule. If ID is provided, the rule with that ID will be updated. If ID is not provided, a new rule will be created and appended to the list of rules.
  """
  setRule: KeyRuleInput

  """
  setRuleActions allows you to set the actions for a single rule by ID.
  """
  setRuleActions: KeyRuleActionsInput

  """
  setRuleOrder allows you to reorder rules by ID.
  """
  setRuleOrder: [ID!]

  """
  deleteRule allows you to delete a single rule by ID.
  """
  deleteRule: ID

  """
  defaultAction is the action to take if no rules match the request.
  """
  defaultActions: [ActionInput!]
}

input KeyRuleActionsInput {
  """
  The ID of an existing rule being updated.
  """
  id: ID!
  actions: [ActionInput!]!
}

input KeyRuleInput {
  """
  The ID of an existing rule being updated.
  """
  id: ID

  name: String!
  description: String!

  """
  An expression that must evaluate to true for the rule to match.
  """
  conditionExpr: ExprBooleanExpression!

  actions: [ActionInput!]!

  """
  Continue evaluating rules after this rule matches.

  If this is set to false (default), no further rules will be evaluated after this rule matches.
  """
  continueAfterMatch: Boolean!
}

"""
ExprStringMap is a map of string expressions.

Example:
{ "paramID": "expr expression" }
"""
scalar ExprStringMap

input ActionInput {
  dest: DestinationInput!
  params: ExprStringMap!
}

type Action {
  dest: Destination!
  params: ExprStringMap!
}