picked 0.0.101-next.2 → 0.0.101
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/README.md +27 -12
- package/docs/explanation/conditions-and-the-logic-engine.md +94 -0
- package/docs/explanation/content-references.md +99 -0
- package/docs/explanation/feature-flag-allocation.md +218 -0
- package/docs/explanation/how-picked-works.md +124 -0
- package/docs/explanation/how-pickedql-works.md +76 -0
- package/docs/explanation/pages-and-flows.md +64 -0
- package/docs/explanation/the-content-model.md +87 -0
- package/docs/explanation/the-two-apis.md +68 -0
- package/docs/explanation/why-server-side-rendering.md +76 -0
- package/docs/explanation/workspaces-and-versions.md +71 -0
- package/docs/how-to/add-a-step-field-or-action.md +56 -0
- package/docs/how-to/analytics/index.md +324 -0
- package/docs/how-to/archive-or-delete-a-workspace.md +59 -0
- package/docs/how-to/authenticate-the-cli.md +101 -0
- package/docs/how-to/authenticate-with-a-magic-link.md +56 -0
- package/docs/how-to/authenticate-with-a-password.md +68 -0
- package/docs/how-to/authenticate-with-an-api-key.md +60 -0
- package/docs/how-to/authenticate-with-oauth.md +49 -0
- package/docs/how-to/build-a-flow.md +106 -0
- package/docs/how-to/call-an-external-api-from-a-workflow.md +116 -0
- package/docs/how-to/connect-the-mcp-server.md +46 -0
- package/docs/how-to/create-a-content-entry.md +58 -0
- package/docs/how-to/create-a-project.md +40 -0
- package/docs/how-to/create-an-experience.md +51 -0
- package/docs/how-to/create-and-revoke-an-api-key.md +54 -0
- package/docs/how-to/debug-with-the-chrome-extension.md +57 -0
- package/docs/how-to/define-a-page-layout.md +54 -0
- package/docs/how-to/fill-and-publish-a-page.md +82 -0
- package/docs/how-to/install-the-gtm-template.md +84 -0
- package/docs/how-to/install-the-sdk.md +93 -0
- package/docs/how-to/install-the-vite-plugin.md +69 -0
- package/docs/how-to/invite-and-remove-members.md +45 -0
- package/docs/how-to/point-one-entry-at-another.md +75 -0
- package/docs/how-to/preview-a-workspace.md +39 -0
- package/docs/how-to/publish-a-workspace.md +42 -0
- package/docs/how-to/read-a-feature-flag.md +113 -0
- package/docs/how-to/read-a-referenced-entry.md +109 -0
- package/docs/how-to/register-a-component.md +55 -0
- package/docs/how-to/register-an-action-handler.md +85 -0
- package/docs/how-to/register-an-api-that-uses-oauth2.md +107 -0
- package/docs/how-to/render-a-step-form.md +131 -0
- package/docs/how-to/render-an-unpublished-preview.md +41 -0
- package/docs/how-to/retry-a-failed-call-with-a-loop.md +81 -0
- package/docs/how-to/reuse-a-section.md +64 -0
- package/docs/how-to/reuse-a-step-field-or-action.md +39 -0
- package/docs/how-to/roll-back-a-published-version.md +39 -0
- package/docs/how-to/run-an-ab-test.md +59 -0
- package/docs/how-to/run-code-on-a-form-submission.md +125 -0
- package/docs/how-to/server-render-a-page.md +81 -0
- package/docs/how-to/set-a-content-security-policy.md +32 -0
- package/docs/how-to/set-up-mfa.md +126 -0
- package/docs/how-to/switch-workspaces.md +122 -0
- package/docs/how-to/upload-and-use-an-asset.mdx +87 -0
- package/docs/how-to/validate-a-field.md +52 -0
- package/docs/how-to/wait-for-an-action-response.md +182 -0
- package/docs/how-to/write-a-condition.md +57 -0
- package/docs/how-to/write-a-predicate.md +60 -0
- package/docs/index.md +59 -0
- package/docs/reference/dashboard/actions.mdx +65 -0
- package/docs/reference/dashboard/api-keys.mdx +47 -0
- package/docs/reference/dashboard/conditions.mdx +51 -0
- package/docs/reference/dashboard/content/asset-library.mdx +74 -0
- package/docs/reference/dashboard/content/blocks.mdx +66 -0
- package/docs/reference/dashboard/content/content-entries.mdx +109 -0
- package/docs/reference/dashboard/content/models.mdx +119 -0
- package/docs/reference/dashboard/content/pages.mdx +72 -0
- package/docs/reference/dashboard/experiences.mdx +61 -0
- package/docs/reference/dashboard/external-apis.md +182 -0
- package/docs/reference/dashboard/features.mdx +165 -0
- package/docs/reference/dashboard/fields.mdx +120 -0
- package/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
- package/docs/reference/dashboard/flow-builder/condition-builder.md +69 -0
- package/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
- package/docs/reference/dashboard/flow-builder/nodes.md +74 -0
- package/docs/reference/dashboard/labels.md +321 -0
- package/docs/reference/dashboard/lead-search.md +235 -0
- package/docs/reference/dashboard/projects.mdx +53 -0
- package/docs/reference/dashboard/reports.mdx +53 -0
- package/docs/reference/dashboard/steps.mdx +47 -0
- package/docs/reference/dashboard/team-management.md +38 -0
- package/docs/reference/dashboard/workflow-runs.md +157 -0
- package/docs/reference/dashboard/workflow-templates.md +182 -0
- package/docs/reference/dashboard/workflow-test-runs.md +85 -0
- package/docs/reference/dashboard/workspace-versioning.mdx +42 -0
- package/docs/reference/dashboard/workspaces.mdx +91 -0
- package/docs/reference/delivery-api/experience-content.md +152 -0
- package/docs/reference/delivery-api/index.md +45 -0
- package/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
- package/docs/reference/delivery-api/project-config.md +65 -0
- package/docs/reference/delivery-api/workspace-schema.md +107 -0
- package/docs/reference/glossary.md +201 -0
- package/docs/reference/management-api/authentication.md +87 -0
- package/docs/reference/management-api/authorization-and-scopes.md +291 -0
- package/docs/reference/management-api/error-handling.md +232 -0
- package/docs/reference/management-api/pagination.md +192 -0
- package/docs/reference/management-api/schema/action.md +261 -0
- package/docs/reference/management-api/schema/analytics-session.md +363 -0
- package/docs/reference/management-api/schema/analytics.md +73 -0
- package/docs/reference/management-api/schema/api-key.md +170 -0
- package/docs/reference/management-api/schema/auth.md +1177 -0
- package/docs/reference/management-api/schema/cms-fields.md +954 -0
- package/docs/reference/management-api/schema/cms-models.md +1155 -0
- package/docs/reference/management-api/schema/common.md +362 -0
- package/docs/reference/management-api/schema/condition.md +254 -0
- package/docs/reference/management-api/schema/design-system.md +199 -0
- package/docs/reference/management-api/schema/experience.md +1098 -0
- package/docs/reference/management-api/schema/external-api.md +637 -0
- package/docs/reference/management-api/schema/feature.md +350 -0
- package/docs/reference/management-api/schema/feedback.md +103 -0
- package/docs/reference/management-api/schema/field.md +400 -0
- package/docs/reference/management-api/schema/index.md +243 -0
- package/docs/reference/management-api/schema/integration.md +272 -0
- package/docs/reference/management-api/schema/label.md +349 -0
- package/docs/reference/management-api/schema/lead.md +340 -0
- package/docs/reference/management-api/schema/mcp-server.md +299 -0
- package/docs/reference/management-api/schema/metric.md +223 -0
- package/docs/reference/management-api/schema/operation.md +96 -0
- package/docs/reference/management-api/schema/organization.md +749 -0
- package/docs/reference/management-api/schema/project.md +607 -0
- package/docs/reference/management-api/schema/report.md +243 -0
- package/docs/reference/management-api/schema/saved-view.md +288 -0
- package/docs/reference/management-api/schema/shopify.md +795 -0
- package/docs/reference/management-api/schema/step.md +273 -0
- package/docs/reference/management-api/schema/tenant-branding.md +185 -0
- package/docs/reference/management-api/schema/workbench.md +246 -0
- package/docs/reference/management-api/schema/workflow-run.md +263 -0
- package/docs/reference/management-api/schema/workflow.md +1110 -0
- package/docs/reference/management-api/schema/workspace-version.md +823 -0
- package/docs/reference/management-api/schema/workspace.md +917 -0
- package/docs/reference/pickedql/data-sources.md +174 -0
- package/docs/reference/pickedql/dimensions.md +103 -0
- package/docs/reference/pickedql/filtering.md +64 -0
- package/docs/reference/pickedql/index.md +18 -0
- package/docs/reference/pickedql/schema.md +172 -0
- package/docs/reference/pickedql/virtual-functions.md +248 -0
- package/docs/reference/sdk/actions.md +154 -0
- package/docs/reference/sdk/analytics-events.md +453 -0
- package/docs/reference/sdk/conditions.md +147 -0
- package/docs/reference/sdk/content-security-policy.md +21 -0
- package/docs/reference/sdk/content.md +253 -0
- package/docs/reference/sdk/experiences.md +51 -0
- package/docs/reference/sdk/features.md +256 -0
- package/docs/reference/sdk/fields.md +255 -0
- package/docs/reference/sdk/index.md +68 -0
- package/docs/reference/sdk/plugins/create-experience.md +123 -0
- package/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
- package/docs/reference/sdk/plugins/fingerprintjs.md +39 -0
- package/docs/reference/sdk/plugins/hotjar.md +60 -0
- package/docs/reference/sdk/plugins/index.md +33 -0
- package/docs/reference/sdk/plugins/sentry.md +51 -0
- package/docs/reference/sdk/plugins/shopify.md +109 -0
- package/docs/reference/sdk/plugins/window-object.md +25 -0
- package/docs/reference/sdk/predicates.md +43 -0
- package/docs/reference/sdk/react.md +61 -0
- package/docs/reference/sdk/ssr/index.md +33 -0
- package/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
- package/docs/reference/sdk/ssr/serialize.md +80 -0
- package/docs/reference/sdk/ssr/slots-and-placements.md +113 -0
- package/docs/reference/sdk/steps.md +86 -0
- package/docs/reference/sdk/svelte.md +74 -0
- package/docs/reference/sdk/type-generation.md +265 -0
- package/docs/reference/tools/admin-api-client.md +89 -0
- package/docs/reference/tools/chrome-extension.md +16 -0
- package/docs/reference/tools/cli.md +319 -0
- package/docs/reference/tools/delivery-api-client.md +60 -0
- package/docs/reference/tools/image-optimisation-service.md +104 -0
- package/docs/reference/tools/mcp-run.md +121 -0
- package/docs/reference/tools/mcp.md +391 -0
- package/docs/reference/tools/vite-plugin.md +163 -0
- package/docs/tutorials/first-api-call.md +253 -0
- package/docs/tutorials/first-experience-in-the-dashboard.mdx +160 -0
- package/docs/tutorials/first-experience.mdx +254 -0
- package/docs/tutorials/first-server-rendered-page.mdx +186 -0
- package/package.json +8 -7
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
generated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Common schema
|
|
8
|
+
|
|
9
|
+
The operations and types that `common.graphql` adds to the Management API. See [Management API schema](/reference/management-api/schema) for every domain, the endpoint and authentication.
|
|
10
|
+
|
|
11
|
+
## Queries
|
|
12
|
+
|
|
13
|
+
### `ping`
|
|
14
|
+
|
|
15
|
+
Liveness probe used by infrastructure to confirm the GraphQL endpoint is up. Unauthenticated.
|
|
16
|
+
|
|
17
|
+
```graphql
|
|
18
|
+
ping: String!
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Types
|
|
22
|
+
|
|
23
|
+
### `JSON`
|
|
24
|
+
|
|
25
|
+
```graphql
|
|
26
|
+
"""
|
|
27
|
+
Arbitrary JSON value. Encoded as a JSON document; decoded as a JavaScript
|
|
28
|
+
value (object, array, number, string, boolean, or null).
|
|
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.
|
|
33
|
+
"""
|
|
34
|
+
scalar JSON
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### `DateTime`
|
|
38
|
+
|
|
39
|
+
```graphql
|
|
40
|
+
"""
|
|
41
|
+
ISO 8601 date-time string in UTC, e.g. `2026-05-14T08:30:00.000Z`. Always
|
|
42
|
+
encoded with millisecond precision and a `Z` suffix; the server never
|
|
43
|
+
emits a local offset.
|
|
44
|
+
"""
|
|
45
|
+
scalar DateTime
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `IsoDate`
|
|
49
|
+
|
|
50
|
+
```graphql
|
|
51
|
+
"""
|
|
52
|
+
ISO 8601 date (`YYYY-MM-DD`) or date-time value used by CMS `DATE` fields.
|
|
53
|
+
Unlike `DateTime`, a bare date without a time component is accepted, matching
|
|
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.
|
|
56
|
+
"""
|
|
57
|
+
scalar IsoDate
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `AuthType`
|
|
61
|
+
|
|
62
|
+
```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
|
+
"""
|
|
68
|
+
enum AuthType {
|
|
69
|
+
"""A Supabase JWT (the `Authorization: Bearer <token>` header)."""
|
|
70
|
+
USER
|
|
71
|
+
"""An API key (the `X-API-Key` header)."""
|
|
72
|
+
API_KEY
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `AuthMfaPolicy`
|
|
77
|
+
|
|
78
|
+
```graphql
|
|
79
|
+
"""
|
|
80
|
+
Whether a field holds a signed-in user to the multi-factor authentication
|
|
81
|
+
policy. Every `@auth` field enforces it unless it says otherwise.
|
|
82
|
+
"""
|
|
83
|
+
enum AuthMfaPolicy {
|
|
84
|
+
"""
|
|
85
|
+
Refuse a user who must hold a verified second factor and whose session is `AAL1` with `MFA_REQUIRED`.
|
|
86
|
+
"""
|
|
87
|
+
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
|
+
"""
|
|
92
|
+
EXEMPT
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### `auth`
|
|
97
|
+
|
|
98
|
+
```graphql
|
|
99
|
+
"""
|
|
100
|
+
Authenticates the request using a Supabase JWT (`USER`) or an API key
|
|
101
|
+
(`API_KEY`). By default, both auth types are accepted; use `only` to
|
|
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`.
|
|
106
|
+
|
|
107
|
+
A user session is then held to the multi-factor authentication policy: a
|
|
108
|
+
super admin, a client manager, or a member of an organisation that requires
|
|
109
|
+
two-factor authentication is refused with `MFA_REQUIRED` when the session is
|
|
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.
|
|
113
|
+
|
|
114
|
+
The auth result is memoised per-request, so multiple `@auth` fields in
|
|
115
|
+
the same operation share a single verify call.
|
|
116
|
+
"""
|
|
117
|
+
directive @auth(only: AuthType, mfa: AuthMfaPolicy = ENFORCE) on FIELD_DEFINITION
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `cache`
|
|
121
|
+
|
|
122
|
+
```graphql
|
|
123
|
+
"""
|
|
124
|
+
HTTP `Cache-Control` policy applied to a field's response. The directive
|
|
125
|
+
stores the policy on the GraphQL context during field resolution; a yoga
|
|
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.
|
|
139
|
+
"""
|
|
140
|
+
directive @cache(policy: String!) on FIELD_DEFINITION
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `Scope`
|
|
144
|
+
|
|
145
|
+
```graphql
|
|
146
|
+
"""
|
|
147
|
+
Authorisation scopes following the `{entity}/{action}` convention. Used
|
|
148
|
+
for fine-grained access control at the entity level — the dashboard and
|
|
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).
|
|
155
|
+
"""
|
|
156
|
+
enum Scope {
|
|
157
|
+
"""Create new organisations."""
|
|
158
|
+
ORGANIZATION_CREATE
|
|
159
|
+
"""Read organisation details."""
|
|
160
|
+
ORGANIZATION_READ
|
|
161
|
+
"""Update organisation settings (name, slug)."""
|
|
162
|
+
ORGANIZATION_UPDATE
|
|
163
|
+
"""Delete an organisation."""
|
|
164
|
+
ORGANIZATION_DELETE
|
|
165
|
+
"""Invite new organisation members."""
|
|
166
|
+
ORGANIZATION_MEMBERS_CREATE
|
|
167
|
+
"""View organisation members."""
|
|
168
|
+
ORGANIZATION_MEMBERS_READ
|
|
169
|
+
"""Update organisation member roles."""
|
|
170
|
+
ORGANIZATION_MEMBERS_UPDATE
|
|
171
|
+
"""Remove organisation members."""
|
|
172
|
+
ORGANIZATION_MEMBERS_DELETE
|
|
173
|
+
"""Grant and revoke the scopes held by organisation members."""
|
|
174
|
+
ORGANIZATION_MEMBERS_MANAGE_SCOPES
|
|
175
|
+
"""Create organisation invitations."""
|
|
176
|
+
ORGANIZATION_INVITATIONS_CREATE
|
|
177
|
+
"""View organisation invitations."""
|
|
178
|
+
ORGANIZATION_INVITATIONS_READ
|
|
179
|
+
"""Revoke organisation invitations."""
|
|
180
|
+
ORGANIZATION_INVITATIONS_DELETE
|
|
181
|
+
"""Create projects within an organisation."""
|
|
182
|
+
ORGANIZATION_PROJECTS_CREATE
|
|
183
|
+
"""View organisation projects."""
|
|
184
|
+
ORGANIZATION_PROJECTS_READ
|
|
185
|
+
"""Update organisation projects."""
|
|
186
|
+
ORGANIZATION_PROJECTS_UPDATE
|
|
187
|
+
"""Delete organisation projects."""
|
|
188
|
+
ORGANIZATION_PROJECTS_DELETE
|
|
189
|
+
"""Create API keys for an organisation."""
|
|
190
|
+
ORGANIZATION_API_KEYS_CREATE
|
|
191
|
+
"""View organisation API keys."""
|
|
192
|
+
ORGANIZATION_API_KEYS_READ
|
|
193
|
+
"""Revoke organisation API keys."""
|
|
194
|
+
ORGANIZATION_API_KEYS_DELETE
|
|
195
|
+
"""Create organisation integrations."""
|
|
196
|
+
ORGANIZATION_INTEGRATIONS_CREATE
|
|
197
|
+
"""View organisation integrations."""
|
|
198
|
+
ORGANIZATION_INTEGRATIONS_READ
|
|
199
|
+
"""Update organisation integrations."""
|
|
200
|
+
ORGANIZATION_INTEGRATIONS_UPDATE
|
|
201
|
+
"""Delete organisation integrations."""
|
|
202
|
+
ORGANIZATION_INTEGRATIONS_DELETE
|
|
203
|
+
"""Create organisation reports."""
|
|
204
|
+
ORGANIZATION_REPORTS_CREATE
|
|
205
|
+
"""View organisation reports."""
|
|
206
|
+
ORGANIZATION_REPORTS_READ
|
|
207
|
+
"""Update organisation reports."""
|
|
208
|
+
ORGANIZATION_REPORTS_UPDATE
|
|
209
|
+
"""Delete organisation reports."""
|
|
210
|
+
ORGANIZATION_REPORTS_DELETE
|
|
211
|
+
"""View the content a project's workspaces hold."""
|
|
212
|
+
ORGANIZATION_WORKSPACE_READ
|
|
213
|
+
"""Create, change and remove the content a project's workspaces hold."""
|
|
214
|
+
ORGANIZATION_WORKSPACE_UPDATE
|
|
215
|
+
"""Create leads for an organisation's projects."""
|
|
216
|
+
ORGANIZATION_LEADS_CREATE
|
|
217
|
+
"""View leads captured by an organisation's projects."""
|
|
218
|
+
ORGANIZATION_LEADS_READ
|
|
219
|
+
"""Update leads and their labels."""
|
|
220
|
+
ORGANIZATION_LEADS_UPDATE
|
|
221
|
+
"""Delete leads and their labels."""
|
|
222
|
+
ORGANIZATION_LEADS_DELETE
|
|
223
|
+
"""Read the action run a workflow was started by."""
|
|
224
|
+
ORGANIZATION_ACTION_RUNS_READ
|
|
225
|
+
"""Record a response against an action run."""
|
|
226
|
+
ORGANIZATION_ACTION_RUNS_UPDATE
|
|
227
|
+
"""Call an external API registered to the project."""
|
|
228
|
+
ORGANIZATION_EXTERNAL_APIS_CALL
|
|
229
|
+
"""View staff-level data (system-level, not organisation-scoped)."""
|
|
230
|
+
STAFF_READ
|
|
231
|
+
"""Invite admin users (system-level)."""
|
|
232
|
+
STAFF_INVITE_ADMIN
|
|
233
|
+
"""Invite client managers (system-level)."""
|
|
234
|
+
STAFF_INVITE_CLIENT_MANAGER
|
|
235
|
+
"""Create feature flags (system-level)."""
|
|
236
|
+
FLAGS_CREATE
|
|
237
|
+
"""Update feature flags (system-level)."""
|
|
238
|
+
FLAGS_UPDATE
|
|
239
|
+
"""Delete feature flags (system-level)."""
|
|
240
|
+
FLAGS_DELETE
|
|
241
|
+
"""
|
|
242
|
+
Reset a user's two-factor authentication: delete their factors and revoke their sessions (system-level, super admins only).
|
|
243
|
+
"""
|
|
244
|
+
USERS_RESET_MFA
|
|
245
|
+
"""Read live workspace versions (preview tokens, organisation members)."""
|
|
246
|
+
ORGANIZATION_WORKSPACE_VERSION_READ
|
|
247
|
+
"""Read published workspace versions (anonymous public access)."""
|
|
248
|
+
ORGANIZATION_WORKSPACE_VERSION_READ_PUBLIC
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### `ErrorCode`
|
|
253
|
+
|
|
254
|
+
```graphql
|
|
255
|
+
"""
|
|
256
|
+
General-purpose error codes returned in the standard GraphQL `errors`
|
|
257
|
+
array's `extensions.code`. Auth-specific codes live on `AuthErrorCode` —
|
|
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`.
|
|
264
|
+
"""
|
|
265
|
+
enum ErrorCode {
|
|
266
|
+
"""The provided credentials are invalid."""
|
|
267
|
+
INVALID_CREDENTIALS
|
|
268
|
+
"""The request is not authorised (the caller is unauthenticated)."""
|
|
269
|
+
UNAUTHORIZED
|
|
270
|
+
"""
|
|
271
|
+
The request is forbidden (the caller is authenticated but lacks scope).
|
|
272
|
+
"""
|
|
273
|
+
FORBIDDEN
|
|
274
|
+
"""The specified organisation was not found."""
|
|
275
|
+
ORGANIZATION_NOT_FOUND
|
|
276
|
+
"""An organisation with the provided name already exists."""
|
|
277
|
+
ORGANIZATION_ALREADY_EXISTS
|
|
278
|
+
"""The provided slug is already in use."""
|
|
279
|
+
SLUG_ALREADY_EXISTS
|
|
280
|
+
"""
|
|
281
|
+
The provided slug is invalid (allowed: lowercase letters, digits, hyphens).
|
|
282
|
+
"""
|
|
283
|
+
INVALID_SLUG
|
|
284
|
+
"""The specified member was not found."""
|
|
285
|
+
MEMBER_NOT_FOUND
|
|
286
|
+
"""The user is already a member of this organisation."""
|
|
287
|
+
MEMBER_ALREADY_EXISTS
|
|
288
|
+
"""The primary owner cannot be removed from the organisation."""
|
|
289
|
+
CANNOT_REMOVE_PRIMARY_OWNER
|
|
290
|
+
"""The specified invitation was not found."""
|
|
291
|
+
INVITATION_NOT_FOUND
|
|
292
|
+
"""The invitation has expired."""
|
|
293
|
+
INVITATION_EXPIRED
|
|
294
|
+
"""The invitation has already been accepted."""
|
|
295
|
+
INVITATION_ALREADY_ACCEPTED
|
|
296
|
+
"""The specified project was not found."""
|
|
297
|
+
PROJECT_NOT_FOUND
|
|
298
|
+
"""The specified user was not found."""
|
|
299
|
+
USER_NOT_FOUND
|
|
300
|
+
"""The role has already been granted to this user."""
|
|
301
|
+
ROLE_ALREADY_GRANTED
|
|
302
|
+
"""The role has not been granted to this user."""
|
|
303
|
+
ROLE_NOT_GRANTED
|
|
304
|
+
"""
|
|
305
|
+
A validation error occurred. Inspect `extensions.fields` for affected paths.
|
|
306
|
+
"""
|
|
307
|
+
VALIDATION_ERROR
|
|
308
|
+
"""An internal server error occurred."""
|
|
309
|
+
INTERNAL_ERROR
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### `PageInfo`
|
|
314
|
+
|
|
315
|
+
```graphql
|
|
316
|
+
"""
|
|
317
|
+
Relay-style page metadata returned by every cursor-paginated `*Connection`
|
|
318
|
+
type. Cursors are opaque, base64-encoded strings; treat them as opaque
|
|
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`.
|
|
324
|
+
"""
|
|
325
|
+
type PageInfo {
|
|
326
|
+
"""Whether there are more items after the last edge in this page."""
|
|
327
|
+
hasNextPage: Boolean!
|
|
328
|
+
"""Whether there are more items before the first edge in this page."""
|
|
329
|
+
hasPreviousPage: Boolean!
|
|
330
|
+
"""Cursor of the first edge in the page (null if the page is empty)."""
|
|
331
|
+
startCursor: String
|
|
332
|
+
"""Cursor of the last edge in the page (null if the page is empty)."""
|
|
333
|
+
endCursor: String
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### `UserError`
|
|
338
|
+
|
|
339
|
+
```graphql
|
|
340
|
+
"""
|
|
341
|
+
A user-facing validation error attached to a mutation payload's
|
|
342
|
+
`userErrors` array. Distinct from thrown domain errors (which surface in
|
|
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`.
|
|
353
|
+
"""
|
|
354
|
+
type UserError {
|
|
355
|
+
"""Path to the field that caused the error."""
|
|
356
|
+
field: [String!]
|
|
357
|
+
"""Human-readable error message."""
|
|
358
|
+
message: String!
|
|
359
|
+
"""Machine-readable error code."""
|
|
360
|
+
code: String
|
|
361
|
+
}
|
|
362
|
+
```
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
generated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Condition schema
|
|
8
|
+
|
|
9
|
+
The operations and types that `condition.graphql` adds to the Management API. See [Management API schema](/reference/management-api/schema) for every domain, the endpoint and authentication.
|
|
10
|
+
|
|
11
|
+
## Queries
|
|
12
|
+
|
|
13
|
+
### `condition`
|
|
14
|
+
|
|
15
|
+
Get a condition by ID within a workspace.
|
|
16
|
+
|
|
17
|
+
```graphql
|
|
18
|
+
condition(id: ID!, workspaceId: ID!): Condition @auth
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### `conditions`
|
|
22
|
+
|
|
23
|
+
List conditions in a workspace. Filter by name with `search` (case-insensitive
|
|
24
|
+
substring) and order with `sortKey` (default `NAME`) plus `reverse`.
|
|
25
|
+
|
|
26
|
+
```graphql
|
|
27
|
+
conditions(first: Int, after: String, last: Int, before: String, workspaceId: ID!, search: String, sortKey: ConditionSortKeys = NAME, reverse: Boolean = false): ConditionConnection! @auth
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Mutations
|
|
31
|
+
|
|
32
|
+
### `conditionCreate`
|
|
33
|
+
|
|
34
|
+
Create a new condition. Requires scope: `ORGANIZATION_PROJECTS_UPDATE`.
|
|
35
|
+
|
|
36
|
+
```graphql
|
|
37
|
+
conditionCreate(input: ConditionCreateInput!): ConditionCreatePayload! @auth
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### `conditionUpdate`
|
|
41
|
+
|
|
42
|
+
Update a condition. Requires scope: `ORGANIZATION_PROJECTS_UPDATE`.
|
|
43
|
+
|
|
44
|
+
```graphql
|
|
45
|
+
conditionUpdate(input: ConditionUpdateInput!): ConditionUpdatePayload! @auth
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `conditionDelete`
|
|
49
|
+
|
|
50
|
+
Delete a condition. Requires scope: `ORGANIZATION_PROJECTS_UPDATE`.
|
|
51
|
+
|
|
52
|
+
```graphql
|
|
53
|
+
conditionDelete(input: ConditionDeleteInput!): ConditionDeletePayload! @auth
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Types
|
|
57
|
+
|
|
58
|
+
### `Condition`
|
|
59
|
+
|
|
60
|
+
```graphql
|
|
61
|
+
"""
|
|
62
|
+
Branching logic in an experience flow. The condition is evaluated by the
|
|
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.
|
|
67
|
+
"""
|
|
68
|
+
type Condition {
|
|
69
|
+
"""Unique condition identifier."""
|
|
70
|
+
id: ID!
|
|
71
|
+
"""Display name of the condition."""
|
|
72
|
+
name: String!
|
|
73
|
+
"""Stable, human-readable key for SDK consumers."""
|
|
74
|
+
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
|
+
"""
|
|
79
|
+
logic: JSON!
|
|
80
|
+
"""When this condition was created."""
|
|
81
|
+
createdAt: DateTime!
|
|
82
|
+
"""When this condition was last updated."""
|
|
83
|
+
updatedAt: DateTime!
|
|
84
|
+
"""The workspace this condition belongs to."""
|
|
85
|
+
workspace: Workspace!
|
|
86
|
+
"""
|
|
87
|
+
The workspace ID this condition belongs to (denormalised for query convenience).
|
|
88
|
+
"""
|
|
89
|
+
workspaceId: ID
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `ConditionConnection`
|
|
94
|
+
|
|
95
|
+
```graphql
|
|
96
|
+
"""
|
|
97
|
+
Relay-style connection of conditions, with both an `edges` list and a flat `nodes` accessor.
|
|
98
|
+
"""
|
|
99
|
+
type ConditionConnection {
|
|
100
|
+
"""List of condition edges."""
|
|
101
|
+
edges: [ConditionEdge!]!
|
|
102
|
+
"""
|
|
103
|
+
Flat list of conditions, equivalent to `edges[].node`. Convenience accessor.
|
|
104
|
+
"""
|
|
105
|
+
nodes: [Condition!]!
|
|
106
|
+
"""Pagination metadata."""
|
|
107
|
+
pageInfo: PageInfo!
|
|
108
|
+
"""Total number of conditions."""
|
|
109
|
+
totalCount: Int!
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### `ConditionEdge`
|
|
114
|
+
|
|
115
|
+
```graphql
|
|
116
|
+
"""Edge type for `ConditionConnection`."""
|
|
117
|
+
type ConditionEdge {
|
|
118
|
+
"""Pagination cursor for this edge."""
|
|
119
|
+
cursor: String!
|
|
120
|
+
"""The condition."""
|
|
121
|
+
node: Condition!
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `ConditionCreateInput`
|
|
126
|
+
|
|
127
|
+
```graphql
|
|
128
|
+
"""Input for `conditionCreate`."""
|
|
129
|
+
input ConditionCreateInput {
|
|
130
|
+
"""Workspace ID to create the condition in."""
|
|
131
|
+
workspaceId: ID!
|
|
132
|
+
"""Display name for the condition."""
|
|
133
|
+
name: String!
|
|
134
|
+
"""Unique key identifier for the condition."""
|
|
135
|
+
key: String!
|
|
136
|
+
"""
|
|
137
|
+
JSON Logic expression string for condition evaluation. Server parses and validates the JSON before persisting.
|
|
138
|
+
"""
|
|
139
|
+
logicString: String!
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `ConditionCreatePayload`
|
|
144
|
+
|
|
145
|
+
```graphql
|
|
146
|
+
"""Payload returned by `conditionCreate`."""
|
|
147
|
+
type ConditionCreatePayload {
|
|
148
|
+
"""The created condition."""
|
|
149
|
+
condition: Condition
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### `ConditionUpdateInput`
|
|
154
|
+
|
|
155
|
+
```graphql
|
|
156
|
+
"""Input for `conditionUpdate`. Omit a field to leave it unchanged."""
|
|
157
|
+
input ConditionUpdateInput {
|
|
158
|
+
"""Condition ID."""
|
|
159
|
+
id: ID!
|
|
160
|
+
"""Workspace ID the condition belongs to."""
|
|
161
|
+
workspaceId: ID!
|
|
162
|
+
"""New display name."""
|
|
163
|
+
name: String
|
|
164
|
+
"""
|
|
165
|
+
New JSON Logic expression string. Server parses and validates the JSON before persisting.
|
|
166
|
+
"""
|
|
167
|
+
logicString: String
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `ConditionUpdatePayload`
|
|
172
|
+
|
|
173
|
+
```graphql
|
|
174
|
+
"""Payload returned by `conditionUpdate`."""
|
|
175
|
+
type ConditionUpdatePayload {
|
|
176
|
+
"""The updated condition."""
|
|
177
|
+
condition: Condition
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### `ConditionDeleteInput`
|
|
182
|
+
|
|
183
|
+
```graphql
|
|
184
|
+
"""Input for `conditionDelete`."""
|
|
185
|
+
input ConditionDeleteInput {
|
|
186
|
+
"""Condition ID."""
|
|
187
|
+
id: ID!
|
|
188
|
+
"""Workspace ID the condition belongs to."""
|
|
189
|
+
workspaceId: ID!
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### `ConditionDeletePayload`
|
|
194
|
+
|
|
195
|
+
```graphql
|
|
196
|
+
"""
|
|
197
|
+
Payload returned by `conditionDelete`. Returns `userErrors` when the condition is in use.
|
|
198
|
+
"""
|
|
199
|
+
type ConditionDeletePayload {
|
|
200
|
+
"""ID of the deleted condition (null when `userErrors` is non-empty)."""
|
|
201
|
+
deletedConditionId: ID
|
|
202
|
+
"""Validation errors. Empty array indicates success."""
|
|
203
|
+
userErrors: [ConditionDeleteUserError!]!
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### `ConditionDeleteUserErrorCode`
|
|
208
|
+
|
|
209
|
+
```graphql
|
|
210
|
+
"""Machine-readable error codes for `conditionDelete`."""
|
|
211
|
+
enum ConditionDeleteUserErrorCode {
|
|
212
|
+
"""
|
|
213
|
+
The condition is referenced by one or more experiences and cannot be deleted.
|
|
214
|
+
"""
|
|
215
|
+
IN_USE
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### `ConditionDeleteUserError`
|
|
220
|
+
|
|
221
|
+
```graphql
|
|
222
|
+
"""
|
|
223
|
+
A user error from `conditionDelete`. Carries the experiences that block the delete when `code` is `IN_USE`.
|
|
224
|
+
"""
|
|
225
|
+
type ConditionDeleteUserError {
|
|
226
|
+
"""Path to the input field that caused the error."""
|
|
227
|
+
field: [String!]
|
|
228
|
+
"""Human-readable error message."""
|
|
229
|
+
message: String!
|
|
230
|
+
"""Machine-readable error code."""
|
|
231
|
+
code: ConditionDeleteUserErrorCode!
|
|
232
|
+
"""
|
|
233
|
+
Experiences that reference this condition (present when `code` is `IN_USE`).
|
|
234
|
+
"""
|
|
235
|
+
referencingExperiences: [ReferencingExperience!]
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### `ConditionSortKeys`
|
|
240
|
+
|
|
241
|
+
```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
|
+
"""
|
|
246
|
+
enum ConditionSortKeys {
|
|
247
|
+
"""Sort by `name` (alphabetical)."""
|
|
248
|
+
NAME
|
|
249
|
+
"""Sort by `createdAt`."""
|
|
250
|
+
CREATED_AT
|
|
251
|
+
"""Sort by `updatedAt`."""
|
|
252
|
+
UPDATED_AT
|
|
253
|
+
}
|
|
254
|
+
```
|