picked 0.0.101 → 0.0.102-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/reference/dashboard/workflow-test-runs.md +40 -17
- package/docs/reference/management-api/schema/action.md +67 -79
- package/docs/reference/management-api/schema/analytics-session.md +77 -94
- package/docs/reference/management-api/schema/analytics.md +16 -14
- package/docs/reference/management-api/schema/api-key.md +43 -51
- package/docs/reference/management-api/schema/auth.md +271 -404
- package/docs/reference/management-api/schema/cms-fields.md +348 -245
- package/docs/reference/management-api/schema/cms-models.md +369 -378
- package/docs/reference/management-api/schema/common.md +69 -130
- package/docs/reference/management-api/schema/condition.md +63 -74
- package/docs/reference/management-api/schema/design-system.md +59 -51
- package/docs/reference/management-api/schema/experience.md +388 -364
- package/docs/reference/management-api/schema/external-api.md +153 -171
- package/docs/reference/management-api/schema/feature.md +85 -103
- package/docs/reference/management-api/schema/feedback.md +27 -31
- package/docs/reference/management-api/schema/field.md +117 -135
- package/docs/reference/management-api/schema/index.md +184 -184
- package/docs/reference/management-api/schema/integration.md +72 -78
- package/docs/reference/management-api/schema/label.md +81 -137
- package/docs/reference/management-api/schema/lead.md +80 -119
- package/docs/reference/management-api/schema/mcp-server.md +73 -71
- package/docs/reference/management-api/schema/metric.md +6 -9
- package/docs/reference/management-api/schema/operation.md +17 -26
- package/docs/reference/management-api/schema/organization.md +198 -220
- package/docs/reference/management-api/schema/project.md +177 -186
- package/docs/reference/management-api/schema/report.md +69 -65
- package/docs/reference/management-api/schema/saved-view.md +71 -71
- package/docs/reference/management-api/schema/shopify.md +331 -204
- package/docs/reference/management-api/schema/step.md +72 -80
- package/docs/reference/management-api/schema/tenant-branding.md +48 -70
- package/docs/reference/management-api/schema/workbench.md +54 -66
- package/docs/reference/management-api/schema/workflow-run.md +66 -79
- package/docs/reference/management-api/schema/workflow.md +310 -353
- package/docs/reference/management-api/schema/workspace-version.md +212 -261
- package/docs/reference/management-api/schema/workspace.md +275 -328
- package/package.json +4 -4
|
@@ -6,13 +6,13 @@ generated: true
|
|
|
6
6
|
|
|
7
7
|
# Common schema
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
See [Management API schema](/reference/management-api/schema) for every domain, the endpoint and authentication.
|
|
10
10
|
|
|
11
11
|
## Queries
|
|
12
12
|
|
|
13
13
|
### `ping`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Checks that the API is up. Answers `pong`.
|
|
16
16
|
|
|
17
17
|
```graphql
|
|
18
18
|
ping: String!
|
|
@@ -24,12 +24,8 @@ ping: String!
|
|
|
24
24
|
|
|
25
25
|
```graphql
|
|
26
26
|
"""
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Used as an escape hatch when the underlying shape is dynamic (workspace
|
|
31
|
-
flow graphs, condition logic, validation rules, project settings, CMS
|
|
32
|
-
field values). When a typed alternative exists, prefer that.
|
|
27
|
+
Any JSON value: an object, an array, a number, a string, a boolean or null. Carries data whose
|
|
28
|
+
shape varies, such as flow graphs, condition logic and content entry values.
|
|
33
29
|
"""
|
|
34
30
|
scalar JSON
|
|
35
31
|
```
|
|
@@ -38,9 +34,7 @@ scalar JSON
|
|
|
38
34
|
|
|
39
35
|
```graphql
|
|
40
36
|
"""
|
|
41
|
-
|
|
42
|
-
encoded with millisecond precision and a `Z` suffix; the server never
|
|
43
|
-
emits a local offset.
|
|
37
|
+
A date-time in UTC with millisecond precision, such as `2026-05-14T08:30:00.000Z`.
|
|
44
38
|
"""
|
|
45
39
|
scalar DateTime
|
|
46
40
|
```
|
|
@@ -49,10 +43,8 @@ scalar DateTime
|
|
|
49
43
|
|
|
50
44
|
```graphql
|
|
51
45
|
"""
|
|
52
|
-
ISO 8601 date (`YYYY-MM-DD`) or date-time
|
|
53
|
-
|
|
54
|
-
a `DATE` field whose `includeTime` flag is `false`. Values are round-tripped
|
|
55
|
-
verbatim, so a date-only field never gains a spurious time-of-day.
|
|
46
|
+
An ISO 8601 date (`YYYY-MM-DD`) or date-time, as a content entry's `DATE` field holds it. The
|
|
47
|
+
value comes back exactly as it was written, so a date never gains a time of day.
|
|
56
48
|
"""
|
|
57
49
|
scalar IsoDate
|
|
58
50
|
```
|
|
@@ -60,15 +52,11 @@ scalar IsoDate
|
|
|
60
52
|
### `AuthType`
|
|
61
53
|
|
|
62
54
|
```graphql
|
|
63
|
-
"""
|
|
64
|
-
Restricts which authentication kind is accepted by an `@auth` directive.
|
|
65
|
-
Most fields accept either credential; pass `only` to lock a field down to
|
|
66
|
-
one transport.
|
|
67
|
-
"""
|
|
55
|
+
"""The kind of credential an `@auth` field accepts."""
|
|
68
56
|
enum AuthType {
|
|
69
|
-
"""A
|
|
57
|
+
"""A user access token, sent as `Authorization: Bearer <token>`."""
|
|
70
58
|
USER
|
|
71
|
-
"""An API key
|
|
59
|
+
"""An API key, sent as `X-API-Key`."""
|
|
72
60
|
API_KEY
|
|
73
61
|
}
|
|
74
62
|
```
|
|
@@ -77,18 +65,14 @@ enum AuthType {
|
|
|
77
65
|
|
|
78
66
|
```graphql
|
|
79
67
|
"""
|
|
80
|
-
Whether
|
|
81
|
-
policy. Every `@auth` field enforces it unless it says otherwise.
|
|
68
|
+
Whether an `@auth` field holds a user to the two-factor authentication policy.
|
|
82
69
|
"""
|
|
83
70
|
enum AuthMfaPolicy {
|
|
84
71
|
"""
|
|
85
|
-
Refuse a user who
|
|
72
|
+
Refuse a user who owes a second factor with `MFA_REQUIRED` until their session is `AAL2`.
|
|
86
73
|
"""
|
|
87
74
|
ENFORCE
|
|
88
|
-
"""
|
|
89
|
-
Serve the field at `AAL1`. Reserved for what a user needs to reach `AAL2` (`user` and
|
|
90
|
-
the MFA mutations) and for `passwordUpdate`, which checks the caller's factors itself.
|
|
91
|
-
"""
|
|
75
|
+
"""Serve the field to a user whose session is `AAL1`."""
|
|
92
76
|
EXEMPT
|
|
93
77
|
}
|
|
94
78
|
```
|
|
@@ -97,22 +81,17 @@ enum AuthMfaPolicy {
|
|
|
97
81
|
|
|
98
82
|
```graphql
|
|
99
83
|
"""
|
|
100
|
-
Authenticates the request
|
|
101
|
-
(`
|
|
102
|
-
restrict to a specific type.
|
|
103
|
-
|
|
104
|
-
Throws `UNAUTHENTICATED` if no credential is present, the credential is
|
|
105
|
-
malformed, or the credential's type is not allowed by `only`.
|
|
84
|
+
Authenticates the request before the field resolves. A request carries a user access token
|
|
85
|
+
(`Authorization: Bearer <token>`) or an API key (`X-API-Key`).
|
|
106
86
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
`AAL1`, unless the field is `mfa: EXEMPT`. Tokens minted by the OAuth 2.1
|
|
111
|
-
server satisfy the policy, because consent is only given from an `AAL2`
|
|
112
|
-
session. API keys are never evaluated.
|
|
87
|
+
Without `only`, the field accepts either credential. `only: USER` accepts a user access token and
|
|
88
|
+
refuses an API key. `only: API_KEY` accepts an API key and refuses a user access token. A missing,
|
|
89
|
+
invalid or refused credential fails with `UNAUTHENTICATED`.
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
`mfa` applies to user access tokens only. With `mfa: ENFORCE`, the default, a super admin, a client
|
|
92
|
+
manager or a member of an organisation that requires two-factor authentication is refused with
|
|
93
|
+
`MFA_REQUIRED` while their session is `AAL1`; a token issued through OAuth counts as `AAL2`.
|
|
94
|
+
`mfa: EXEMPT` serves the field at `AAL1`, so such a user can enrol or verify a second factor.
|
|
116
95
|
"""
|
|
117
96
|
directive @auth(only: AuthType, mfa: AuthMfaPolicy = ENFORCE) on FIELD_DEFINITION
|
|
118
97
|
```
|
|
@@ -121,21 +100,8 @@ directive @auth(only: AuthType, mfa: AuthMfaPolicy = ENFORCE) on FIELD_DEFINITIO
|
|
|
121
100
|
|
|
122
101
|
```graphql
|
|
123
102
|
"""
|
|
124
|
-
HTTP `Cache-Control`
|
|
125
|
-
|
|
126
|
-
plugin reads it and emits a `Cache-Control` response header. Responses
|
|
127
|
-
that contain GraphQL errors never receive the header.
|
|
128
|
-
|
|
129
|
-
WARNING: `@cache` MUST NOT be selected in the same operation as any `@auth`
|
|
130
|
-
field. The cache header attaches to the entire response, so a public
|
|
131
|
-
`Cache-Control` on a payload containing authenticated data leaks that data
|
|
132
|
-
to shared caches. This is enforced by convention only — there is no
|
|
133
|
-
runtime check. Keep cached fields in their own operations.
|
|
134
|
-
|
|
135
|
-
WARNING: `policy` is opaque. Whatever string is passed is emitted verbatim
|
|
136
|
-
as `Cache-Control`; there is no runtime validation. Use a hardcoded
|
|
137
|
-
literal (e.g. `policy: "public, max-age=300"`). NEVER derive `policy` from
|
|
138
|
-
user input.
|
|
103
|
+
Sets the response's HTTP `Cache-Control` header to `policy`, verbatim. A response that has errors,
|
|
104
|
+
or in which an `@auth` field ran, gets no header.
|
|
139
105
|
"""
|
|
140
106
|
directive @cache(policy: String!) on FIELD_DEFINITION
|
|
141
107
|
```
|
|
@@ -144,21 +110,15 @@ directive @cache(policy: String!) on FIELD_DEFINITION
|
|
|
144
110
|
|
|
145
111
|
```graphql
|
|
146
112
|
"""
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
the SDKs both check scopes via `Organization.viewerScopes` and the
|
|
150
|
-
authenticated user's root-level `viewerScopes`.
|
|
151
|
-
|
|
152
|
-
Scopes prefixed with `ORGANIZATION_` are organisation-scoped (granted via
|
|
153
|
-
an organisation membership). Scopes prefixed with `STAFF_` and `FLAGS_`
|
|
154
|
-
are system-level (granted via the staff role on the user record).
|
|
113
|
+
A permission that an operation checks. `ORGANIZATION_` scopes come from an organisation membership
|
|
114
|
+
or an API key. `STAFF_`, `FLAGS_` and `USERS_` scopes are system-level and held by Picked staff.
|
|
155
115
|
"""
|
|
156
116
|
enum Scope {
|
|
157
117
|
"""Create new organisations."""
|
|
158
118
|
ORGANIZATION_CREATE
|
|
159
119
|
"""Read organisation details."""
|
|
160
120
|
ORGANIZATION_READ
|
|
161
|
-
"""Update organisation settings
|
|
121
|
+
"""Update organisation settings."""
|
|
162
122
|
ORGANIZATION_UPDATE
|
|
163
123
|
"""Delete an organisation."""
|
|
164
124
|
ORGANIZATION_DELETE
|
|
@@ -226,25 +186,25 @@ enum Scope {
|
|
|
226
186
|
ORGANIZATION_ACTION_RUNS_UPDATE
|
|
227
187
|
"""Call an external API registered to the project."""
|
|
228
188
|
ORGANIZATION_EXTERNAL_APIS_CALL
|
|
229
|
-
"""View staff-level data
|
|
189
|
+
"""View staff-level data."""
|
|
230
190
|
STAFF_READ
|
|
231
|
-
"""Invite
|
|
191
|
+
"""Invite super admins."""
|
|
232
192
|
STAFF_INVITE_ADMIN
|
|
233
|
-
"""Invite client managers
|
|
193
|
+
"""Invite client managers."""
|
|
234
194
|
STAFF_INVITE_CLIENT_MANAGER
|
|
235
|
-
"""Create feature flags
|
|
195
|
+
"""Create platform feature flags."""
|
|
236
196
|
FLAGS_CREATE
|
|
237
|
-
"""Update feature flags
|
|
197
|
+
"""Update platform feature flags."""
|
|
238
198
|
FLAGS_UPDATE
|
|
239
|
-
"""Delete feature flags
|
|
199
|
+
"""Delete platform feature flags."""
|
|
240
200
|
FLAGS_DELETE
|
|
241
201
|
"""
|
|
242
|
-
Reset a user's two-factor authentication: delete their factors and revoke their sessions
|
|
202
|
+
Reset a user's two-factor authentication: delete their factors and revoke their sessions.
|
|
243
203
|
"""
|
|
244
204
|
USERS_RESET_MFA
|
|
245
|
-
"""Read
|
|
205
|
+
"""Read a workspace's preview configuration."""
|
|
246
206
|
ORGANIZATION_WORKSPACE_VERSION_READ
|
|
247
|
-
"""Read
|
|
207
|
+
"""Read what a project serves to visitors, and run its actions."""
|
|
248
208
|
ORGANIZATION_WORKSPACE_VERSION_READ_PUBLIC
|
|
249
209
|
}
|
|
250
210
|
```
|
|
@@ -253,59 +213,49 @@ enum Scope {
|
|
|
253
213
|
|
|
254
214
|
```graphql
|
|
255
215
|
"""
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
this enum covers the rest of the API (organisations, projects, members,
|
|
259
|
-
invitations, validation, internal errors).
|
|
260
|
-
|
|
261
|
-
Each code maps to an HTTP status code in the response envelope. Use
|
|
262
|
-
this enum when handling errors programmatically; do not parse the
|
|
263
|
-
human-readable `message`.
|
|
216
|
+
The codes an entry in the GraphQL `errors` array carries in `extensions.code`. Branch on the code,
|
|
217
|
+
not on `message`.
|
|
264
218
|
"""
|
|
265
219
|
enum ErrorCode {
|
|
266
|
-
"""The
|
|
220
|
+
"""The credentials are invalid."""
|
|
267
221
|
INVALID_CREDENTIALS
|
|
268
|
-
"""The
|
|
222
|
+
"""The operation needs a signed-in user."""
|
|
269
223
|
UNAUTHORIZED
|
|
270
|
-
"""
|
|
271
|
-
The request is forbidden (the caller is authenticated but lacks scope).
|
|
272
|
-
"""
|
|
224
|
+
"""The caller is authenticated but lacks the scope."""
|
|
273
225
|
FORBIDDEN
|
|
274
|
-
"""The
|
|
226
|
+
"""The organisation does not exist."""
|
|
275
227
|
ORGANIZATION_NOT_FOUND
|
|
276
|
-
"""An organisation with
|
|
228
|
+
"""An organisation with this name already exists."""
|
|
277
229
|
ORGANIZATION_ALREADY_EXISTS
|
|
278
|
-
"""The
|
|
230
|
+
"""The slug is already in use."""
|
|
279
231
|
SLUG_ALREADY_EXISTS
|
|
280
232
|
"""
|
|
281
|
-
The
|
|
233
|
+
The slug holds characters other than lowercase letters, digits and hyphens.
|
|
282
234
|
"""
|
|
283
235
|
INVALID_SLUG
|
|
284
|
-
"""The
|
|
236
|
+
"""The member does not exist."""
|
|
285
237
|
MEMBER_NOT_FOUND
|
|
286
|
-
"""The user is already a member of
|
|
238
|
+
"""The user is already a member of the organisation."""
|
|
287
239
|
MEMBER_ALREADY_EXISTS
|
|
288
240
|
"""The primary owner cannot be removed from the organisation."""
|
|
289
241
|
CANNOT_REMOVE_PRIMARY_OWNER
|
|
290
|
-
"""The
|
|
242
|
+
"""The invitation does not exist."""
|
|
291
243
|
INVITATION_NOT_FOUND
|
|
292
244
|
"""The invitation has expired."""
|
|
293
245
|
INVITATION_EXPIRED
|
|
294
246
|
"""The invitation has already been accepted."""
|
|
295
247
|
INVITATION_ALREADY_ACCEPTED
|
|
296
|
-
"""The
|
|
248
|
+
"""The project does not exist."""
|
|
297
249
|
PROJECT_NOT_FOUND
|
|
298
|
-
"""The
|
|
250
|
+
"""The user does not exist."""
|
|
299
251
|
USER_NOT_FOUND
|
|
300
|
-
"""The
|
|
252
|
+
"""The user already holds the role."""
|
|
301
253
|
ROLE_ALREADY_GRANTED
|
|
302
|
-
"""The
|
|
254
|
+
"""The user does not hold the role."""
|
|
303
255
|
ROLE_NOT_GRANTED
|
|
304
|
-
"""
|
|
305
|
-
A validation error occurred. Inspect `extensions.fields` for affected paths.
|
|
306
|
-
"""
|
|
256
|
+
"""The input is invalid. `extensions.fields` names the paths at fault."""
|
|
307
257
|
VALIDATION_ERROR
|
|
308
|
-
"""An
|
|
258
|
+
"""An unexpected server error."""
|
|
309
259
|
INTERNAL_ERROR
|
|
310
260
|
}
|
|
311
261
|
```
|
|
@@ -314,22 +264,19 @@ enum ErrorCode {
|
|
|
314
264
|
|
|
315
265
|
```graphql
|
|
316
266
|
"""
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
identifiers and do not parse or modify them.
|
|
320
|
-
|
|
321
|
-
When `hasNextPage` is true, pass `endCursor` as the next `after` argument
|
|
322
|
-
to fetch the next page. When `hasPreviousPage` is true and the connection
|
|
323
|
-
supports backward pagination, pass `startCursor` as `before`.
|
|
267
|
+
Where a page sits in a list. Cursors are opaque: pass `endCursor` as `after` to read the next
|
|
268
|
+
page, and `startCursor` as `before` to read the previous one.
|
|
324
269
|
"""
|
|
325
270
|
type PageInfo {
|
|
326
|
-
"""Whether
|
|
271
|
+
"""Whether items follow this page."""
|
|
327
272
|
hasNextPage: Boolean!
|
|
328
|
-
"""Whether
|
|
273
|
+
"""Whether items precede this page."""
|
|
329
274
|
hasPreviousPage: Boolean!
|
|
330
|
-
"""
|
|
275
|
+
"""
|
|
276
|
+
The cursor of the first item in this page. Null when the page is empty.
|
|
277
|
+
"""
|
|
331
278
|
startCursor: String
|
|
332
|
-
"""
|
|
279
|
+
"""The cursor of the last item in this page. Null when the page is empty."""
|
|
333
280
|
endCursor: String
|
|
334
281
|
}
|
|
335
282
|
```
|
|
@@ -338,25 +285,17 @@ type PageInfo {
|
|
|
338
285
|
|
|
339
286
|
```graphql
|
|
340
287
|
"""
|
|
341
|
-
A
|
|
342
|
-
`userErrors
|
|
343
|
-
the standard GraphQL `errors` array): `userErrors` represent business-
|
|
344
|
-
logic constraints the client should surface to the user, often with
|
|
345
|
-
structured context.
|
|
346
|
-
|
|
347
|
-
`field` is a dotted path into the operation's input; `code` is the
|
|
348
|
-
machine-readable error code (mutation-specific, defined alongside the
|
|
349
|
-
payload); `message` is human-readable and should be shown to the user.
|
|
350
|
-
|
|
351
|
-
Some mutations return a typed subclass of `UserError` (e.g.
|
|
352
|
-
`ActionDeleteUserError`) with extra fields like `referencingExperiences`.
|
|
288
|
+
A problem with a mutation's input that stopped the mutation, returned in its payload's
|
|
289
|
+
`userErrors`. Some mutations return their own error type with a typed `code`.
|
|
353
290
|
"""
|
|
354
291
|
type UserError {
|
|
355
|
-
"""
|
|
292
|
+
"""
|
|
293
|
+
The path to the input field at fault. Null when no single field is at fault.
|
|
294
|
+
"""
|
|
356
295
|
field: [String!]
|
|
357
|
-
"""
|
|
296
|
+
"""A message to show the user."""
|
|
358
297
|
message: String!
|
|
359
|
-
"""
|
|
298
|
+
"""A machine-readable code. Null when the mutation defines none."""
|
|
360
299
|
code: String
|
|
361
300
|
}
|
|
362
301
|
```
|
|
@@ -6,13 +6,14 @@ generated: true
|
|
|
6
6
|
|
|
7
7
|
# Condition schema
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
See [Management API schema](/reference/management-api/schema) for every domain, the endpoint and authentication.
|
|
10
10
|
|
|
11
11
|
## Queries
|
|
12
12
|
|
|
13
13
|
### `condition`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Reads a condition.
|
|
16
|
+
Scope: `ORGANIZATION_WORKSPACE_READ`.
|
|
16
17
|
|
|
17
18
|
```graphql
|
|
18
19
|
condition(id: ID!, workspaceId: ID!): Condition @auth
|
|
@@ -20,8 +21,9 @@ condition(id: ID!, workspaceId: ID!): Condition @auth
|
|
|
20
21
|
|
|
21
22
|
### `conditions`
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
Lists the conditions in a workspace. `search` matches a case-insensitive substring of the name;
|
|
25
|
+
`sortKey` and `reverse` set the order.
|
|
26
|
+
Scope: `ORGANIZATION_WORKSPACE_READ`.
|
|
25
27
|
|
|
26
28
|
```graphql
|
|
27
29
|
conditions(first: Int, after: String, last: Int, before: String, workspaceId: ID!, search: String, sortKey: ConditionSortKeys = NAME, reverse: Boolean = false): ConditionConnection! @auth
|
|
@@ -31,7 +33,8 @@ conditions(first: Int, after: String, last: Int, before: String, workspaceId: ID
|
|
|
31
33
|
|
|
32
34
|
### `conditionCreate`
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
Creates a condition in a workspace.
|
|
37
|
+
Scope: `ORGANIZATION_WORKSPACE_UPDATE`.
|
|
35
38
|
|
|
36
39
|
```graphql
|
|
37
40
|
conditionCreate(input: ConditionCreateInput!): ConditionCreatePayload! @auth
|
|
@@ -39,7 +42,8 @@ conditionCreate(input: ConditionCreateInput!): ConditionCreatePayload! @auth
|
|
|
39
42
|
|
|
40
43
|
### `conditionUpdate`
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
Updates a condition.
|
|
46
|
+
Scope: `ORGANIZATION_WORKSPACE_UPDATE`.
|
|
43
47
|
|
|
44
48
|
```graphql
|
|
45
49
|
conditionUpdate(input: ConditionUpdateInput!): ConditionUpdatePayload! @auth
|
|
@@ -47,7 +51,9 @@ conditionUpdate(input: ConditionUpdateInput!): ConditionUpdatePayload! @auth
|
|
|
47
51
|
|
|
48
52
|
### `conditionDelete`
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
Deletes a condition. A condition that an experience or another condition references is not
|
|
55
|
+
deleted, and comes back as an `IN_USE` user error.
|
|
56
|
+
Scope: `ORGANIZATION_WORKSPACE_UPDATE`.
|
|
51
57
|
|
|
52
58
|
```graphql
|
|
53
59
|
conditionDelete(input: ConditionDeleteInput!): ConditionDeletePayload! @auth
|
|
@@ -59,33 +65,24 @@ conditionDelete(input: ConditionDeleteInput!): ConditionDeletePayload! @auth
|
|
|
59
65
|
|
|
60
66
|
```graphql
|
|
61
67
|
"""
|
|
62
|
-
|
|
63
|
-
SDK using the JSON-Logic format; `logic` is the AST.
|
|
64
|
-
|
|
65
|
-
When attached to a `ConditionNode`, the result selects which outgoing
|
|
66
|
-
edge (`sourceHandle: TRUE` / `FALSE`) the flow follows.
|
|
68
|
+
A rule that decides whether a visitor sees something, or which branch a flow takes.
|
|
67
69
|
"""
|
|
68
70
|
type Condition {
|
|
69
|
-
"""
|
|
71
|
+
"""The ID of the condition."""
|
|
70
72
|
id: ID!
|
|
71
|
-
"""
|
|
73
|
+
"""The name of the condition."""
|
|
72
74
|
name: String!
|
|
73
|
-
"""
|
|
75
|
+
"""The stable identifier of the condition, unique within its workspace."""
|
|
74
76
|
key: String!
|
|
75
|
-
"""
|
|
76
|
-
JSON Logic expression. See https://jsonlogic.com for the grammar — the
|
|
77
|
-
shape is a recursive tagged-tree e.g. `{ "and": [{ "==": [{ "var": "country" }, "US"] }, ...] }`.
|
|
78
|
-
"""
|
|
77
|
+
"""The rule, as a JSON Logic expression (https://jsonlogic.com)."""
|
|
79
78
|
logic: JSON!
|
|
80
|
-
"""When
|
|
79
|
+
"""When the condition was created."""
|
|
81
80
|
createdAt: DateTime!
|
|
82
|
-
"""When
|
|
81
|
+
"""When the condition last changed."""
|
|
83
82
|
updatedAt: DateTime!
|
|
84
|
-
"""The workspace
|
|
83
|
+
"""The workspace the condition belongs to."""
|
|
85
84
|
workspace: Workspace!
|
|
86
|
-
"""
|
|
87
|
-
The workspace ID this condition belongs to (denormalised for query convenience).
|
|
88
|
-
"""
|
|
85
|
+
"""The ID of the workspace the condition belongs to."""
|
|
89
86
|
workspaceId: ID
|
|
90
87
|
}
|
|
91
88
|
```
|
|
@@ -93,19 +90,15 @@ type Condition {
|
|
|
93
90
|
### `ConditionConnection`
|
|
94
91
|
|
|
95
92
|
```graphql
|
|
96
|
-
"""
|
|
97
|
-
Relay-style connection of conditions, with both an `edges` list and a flat `nodes` accessor.
|
|
98
|
-
"""
|
|
93
|
+
"""A page of conditions."""
|
|
99
94
|
type ConditionConnection {
|
|
100
|
-
"""
|
|
95
|
+
"""The edges in this page."""
|
|
101
96
|
edges: [ConditionEdge!]!
|
|
102
|
-
"""
|
|
103
|
-
Flat list of conditions, equivalent to `edges[].node`. Convenience accessor.
|
|
104
|
-
"""
|
|
97
|
+
"""The conditions in this page."""
|
|
105
98
|
nodes: [Condition!]!
|
|
106
|
-
"""
|
|
99
|
+
"""Where this page sits in the list."""
|
|
107
100
|
pageInfo: PageInfo!
|
|
108
|
-
"""
|
|
101
|
+
"""The number of conditions across all pages, ignoring `search`."""
|
|
109
102
|
totalCount: Int!
|
|
110
103
|
}
|
|
111
104
|
```
|
|
@@ -113,9 +106,9 @@ type ConditionConnection {
|
|
|
113
106
|
### `ConditionEdge`
|
|
114
107
|
|
|
115
108
|
```graphql
|
|
116
|
-
"""
|
|
109
|
+
"""A condition in a page of results."""
|
|
117
110
|
type ConditionEdge {
|
|
118
|
-
"""
|
|
111
|
+
"""The cursor of this edge."""
|
|
119
112
|
cursor: String!
|
|
120
113
|
"""The condition."""
|
|
121
114
|
node: Condition!
|
|
@@ -125,16 +118,19 @@ type ConditionEdge {
|
|
|
125
118
|
### `ConditionCreateInput`
|
|
126
119
|
|
|
127
120
|
```graphql
|
|
128
|
-
"""
|
|
121
|
+
"""The input of `conditionCreate`."""
|
|
129
122
|
input ConditionCreateInput {
|
|
130
|
-
"""
|
|
123
|
+
"""The ID of the workspace to create the condition in."""
|
|
131
124
|
workspaceId: ID!
|
|
132
|
-
"""
|
|
125
|
+
"""The name of the condition."""
|
|
133
126
|
name: String!
|
|
134
|
-
"""
|
|
127
|
+
"""
|
|
128
|
+
The stable identifier of the condition, unique within the workspace. It cannot change later.
|
|
129
|
+
"""
|
|
135
130
|
key: String!
|
|
136
131
|
"""
|
|
137
|
-
JSON Logic expression
|
|
132
|
+
The rule, as a JSON Logic expression in a JSON string. It can call another condition with
|
|
133
|
+
`{ "invoke": [{ "var": "conditions.<key>" }] }`; an unknown key or a cycle is rejected.
|
|
138
134
|
"""
|
|
139
135
|
logicString: String!
|
|
140
136
|
}
|
|
@@ -143,7 +139,7 @@ input ConditionCreateInput {
|
|
|
143
139
|
### `ConditionCreatePayload`
|
|
144
140
|
|
|
145
141
|
```graphql
|
|
146
|
-
"""
|
|
142
|
+
"""The result of `conditionCreate`."""
|
|
147
143
|
type ConditionCreatePayload {
|
|
148
144
|
"""The created condition."""
|
|
149
145
|
condition: Condition
|
|
@@ -153,16 +149,16 @@ type ConditionCreatePayload {
|
|
|
153
149
|
### `ConditionUpdateInput`
|
|
154
150
|
|
|
155
151
|
```graphql
|
|
156
|
-
"""
|
|
152
|
+
"""The input of `conditionUpdate`. Omit a field to keep its value."""
|
|
157
153
|
input ConditionUpdateInput {
|
|
158
|
-
"""
|
|
154
|
+
"""The ID of the condition."""
|
|
159
155
|
id: ID!
|
|
160
|
-
"""
|
|
156
|
+
"""The ID of the workspace the condition belongs to."""
|
|
161
157
|
workspaceId: ID!
|
|
162
|
-
"""
|
|
158
|
+
"""The name of the condition."""
|
|
163
159
|
name: String
|
|
164
160
|
"""
|
|
165
|
-
|
|
161
|
+
The rule, as a JSON Logic expression in a JSON string. An unknown condition key or a cycle is rejected.
|
|
166
162
|
"""
|
|
167
163
|
logicString: String
|
|
168
164
|
}
|
|
@@ -171,7 +167,7 @@ input ConditionUpdateInput {
|
|
|
171
167
|
### `ConditionUpdatePayload`
|
|
172
168
|
|
|
173
169
|
```graphql
|
|
174
|
-
"""
|
|
170
|
+
"""The result of `conditionUpdate`."""
|
|
175
171
|
type ConditionUpdatePayload {
|
|
176
172
|
"""The updated condition."""
|
|
177
173
|
condition: Condition
|
|
@@ -181,11 +177,11 @@ type ConditionUpdatePayload {
|
|
|
181
177
|
### `ConditionDeleteInput`
|
|
182
178
|
|
|
183
179
|
```graphql
|
|
184
|
-
"""
|
|
180
|
+
"""The input of `conditionDelete`."""
|
|
185
181
|
input ConditionDeleteInput {
|
|
186
|
-
"""
|
|
182
|
+
"""The ID of the condition."""
|
|
187
183
|
id: ID!
|
|
188
|
-
"""
|
|
184
|
+
"""The ID of the workspace the condition belongs to."""
|
|
189
185
|
workspaceId: ID!
|
|
190
186
|
}
|
|
191
187
|
```
|
|
@@ -193,13 +189,11 @@ input ConditionDeleteInput {
|
|
|
193
189
|
### `ConditionDeletePayload`
|
|
194
190
|
|
|
195
191
|
```graphql
|
|
196
|
-
"""
|
|
197
|
-
Payload returned by `conditionDelete`. Returns `userErrors` when the condition is in use.
|
|
198
|
-
"""
|
|
192
|
+
"""The result of `conditionDelete`."""
|
|
199
193
|
type ConditionDeletePayload {
|
|
200
|
-
"""ID of the deleted condition
|
|
194
|
+
"""The ID of the deleted condition. Null when `userErrors` is not empty."""
|
|
201
195
|
deletedConditionId: ID
|
|
202
|
-
"""
|
|
196
|
+
"""The reasons the condition was not deleted. Empty on success."""
|
|
203
197
|
userErrors: [ConditionDeleteUserError!]!
|
|
204
198
|
}
|
|
205
199
|
```
|
|
@@ -207,11 +201,9 @@ type ConditionDeletePayload {
|
|
|
207
201
|
### `ConditionDeleteUserErrorCode`
|
|
208
202
|
|
|
209
203
|
```graphql
|
|
210
|
-
"""
|
|
204
|
+
"""The reasons `conditionDelete` refuses a delete."""
|
|
211
205
|
enum ConditionDeleteUserErrorCode {
|
|
212
|
-
"""
|
|
213
|
-
The condition is referenced by one or more experiences and cannot be deleted.
|
|
214
|
-
"""
|
|
206
|
+
"""An experience or another condition references the condition."""
|
|
215
207
|
IN_USE
|
|
216
208
|
}
|
|
217
209
|
```
|
|
@@ -219,18 +211,18 @@ enum ConditionDeleteUserErrorCode {
|
|
|
219
211
|
### `ConditionDeleteUserError`
|
|
220
212
|
|
|
221
213
|
```graphql
|
|
222
|
-
"""
|
|
223
|
-
A user error from `conditionDelete`. Carries the experiences that block the delete when `code` is `IN_USE`.
|
|
224
|
-
"""
|
|
214
|
+
"""A reason `conditionDelete` did not delete a condition."""
|
|
225
215
|
type ConditionDeleteUserError {
|
|
226
|
-
"""
|
|
216
|
+
"""
|
|
217
|
+
The path to the input field at fault. Null when no single field is at fault.
|
|
218
|
+
"""
|
|
227
219
|
field: [String!]
|
|
228
|
-
"""
|
|
220
|
+
"""A message to show the user."""
|
|
229
221
|
message: String!
|
|
230
|
-
"""
|
|
222
|
+
"""A machine-readable code."""
|
|
231
223
|
code: ConditionDeleteUserErrorCode!
|
|
232
224
|
"""
|
|
233
|
-
|
|
225
|
+
The experiences that reference the condition. Null unless `code` is `IN_USE`.
|
|
234
226
|
"""
|
|
235
227
|
referencingExperiences: [ReferencingExperience!]
|
|
236
228
|
}
|
|
@@ -239,16 +231,13 @@ type ConditionDeleteUserError {
|
|
|
239
231
|
### `ConditionSortKeys`
|
|
240
232
|
|
|
241
233
|
```graphql
|
|
242
|
-
"""
|
|
243
|
-
Sort keys for `conditions(...)`. Pair with `reverse: true` to flip the order
|
|
244
|
-
(`NAME` + `reverse: false` sorts A→Z; `CREATED_AT` + `reverse: true` is newest-first).
|
|
245
|
-
"""
|
|
234
|
+
"""The orders `conditions` can sort by. `reverse: true` flips each."""
|
|
246
235
|
enum ConditionSortKeys {
|
|
247
|
-
"""
|
|
236
|
+
"""By name, A to Z."""
|
|
248
237
|
NAME
|
|
249
|
-
"""
|
|
238
|
+
"""By creation time, oldest first."""
|
|
250
239
|
CREATED_AT
|
|
251
|
-
"""
|
|
240
|
+
"""By last change, oldest first."""
|
|
252
241
|
UPDATED_AT
|
|
253
242
|
}
|
|
254
243
|
```
|