@picked/client 0.0.1-dev.1788925875333 → 0.0.1-next.1
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 +8 -0
- package/dist/cjs/index.js +1 -4
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
- package/dist/cjs/plugins/shopify/index.js +1 -0
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +733 -1814
- package/dist/esm/plugins/create-experience/index.js +398 -490
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
- package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
- package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
- package/dist/esm/plugins/shopify/index.js +59 -0
- package/dist/esm/plugins/single-page-app/index.js +35 -31
- package/dist/esm/plugins/window-object/index.js +9 -9
- package/dist/esm/server/index.js +89 -141
- package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
- package/dist/experience-instance-BA0EXYg5.js +712 -0
- package/dist/id-BKIWbSTy.cjs +1 -0
- package/dist/id-BW-g3y32.js +6 -0
- package/dist/logger-BsmHUUw1.cjs +1 -0
- package/dist/logger-C9a75KZn.js +5 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/object-JwZ58NOH.js +28 -0
- package/dist/storage-BPJwmlva.cjs +1 -0
- package/dist/storage-D87xFySf.js +85 -0
- package/dist/supports-BvrzQAVk.js +79 -0
- package/dist/supports-C0y3-V5V.cjs +1 -0
- package/dist/types/client.d.ts +23 -119
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -45
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +99 -152
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +8 -118
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +64 -96
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +7 -32
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +2 -41
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +7 -30
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts +9 -0
- package/dist/types/entities/project/project.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +21 -57
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -22
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +11 -13
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +184 -381
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +10 -0
- package/dist/types/ping.d.ts.map +1 -0
- package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/index.d.ts +2 -0
- package/dist/types/plugins/shopify/index.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts +3 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/shopify.d.ts +28 -0
- package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
- package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/server/index.d.ts +3 -18
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +6 -4
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +38 -83
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +2 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts +1 -2
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -3
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +3 -33
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +16 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/storage.d.ts +11 -374
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +0 -87
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/package.json +49 -182
- package/dist/.tsbuildinfo +0 -1
- package/dist/api-DbMJli3H.js +0 -22
- package/dist/api-qiqq8lgz.cjs +0 -1
- package/dist/cjs/form/index.js +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
- package/dist/cjs/plugins/telemetry/index.js +0 -1
- package/dist/cjs/plugins/web-components/index.js +0 -1
- package/dist/cjs/preview/index.js +0 -1
- package/dist/docs/_root.css +0 -101
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
- package/dist/docs/explanation/content-references.md +0 -99
- package/dist/docs/explanation/feature-flag-allocation.md +0 -218
- package/dist/docs/explanation/how-picked-works.md +0 -124
- package/dist/docs/explanation/how-pickedql-works.md +0 -76
- package/dist/docs/explanation/pages-and-flows.md +0 -64
- package/dist/docs/explanation/the-content-model.md +0 -87
- package/dist/docs/explanation/the-two-apis.md +0 -68
- package/dist/docs/explanation/why-server-side-rendering.md +0 -76
- package/dist/docs/explanation/workspaces-and-versions.md +0 -71
- package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
- package/dist/docs/how-to/analytics/index.md +0 -316
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
- package/dist/docs/how-to/authenticate-the-cli.md +0 -97
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
- package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
- package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
- package/dist/docs/how-to/build-a-flow.md +0 -83
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
- package/dist/docs/how-to/create-a-content-entry.md +0 -48
- package/dist/docs/how-to/create-a-project.md +0 -29
- package/dist/docs/how-to/create-an-experience.md +0 -42
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
- package/dist/docs/how-to/define-a-page-layout.md +0 -46
- package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
- package/dist/docs/how-to/install-the-gtm-template.md +0 -84
- package/dist/docs/how-to/install-the-sdk.md +0 -93
- package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
- package/dist/docs/how-to/invite-and-remove-members.md +0 -34
- package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
- package/dist/docs/how-to/preview-a-workspace.md +0 -28
- package/dist/docs/how-to/publish-a-workspace.md +0 -30
- package/dist/docs/how-to/read-a-feature-flag.md +0 -113
- package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
- package/dist/docs/how-to/register-a-component.md +0 -55
- package/dist/docs/how-to/register-an-action-handler.md +0 -67
- package/dist/docs/how-to/render-a-step-form.md +0 -131
- package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
- package/dist/docs/how-to/reuse-a-section.md +0 -53
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
- package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
- package/dist/docs/how-to/run-an-ab-test.md +0 -49
- package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
- package/dist/docs/how-to/server-render-a-page.md +0 -81
- package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
- package/dist/docs/how-to/set-up-mfa.md +0 -69
- package/dist/docs/how-to/switch-workspaces.md +0 -122
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
- package/dist/docs/how-to/validate-a-field.md +0 -52
- package/dist/docs/how-to/write-a-condition.md +0 -45
- package/dist/docs/how-to/write-a-predicate.md +0 -60
- package/dist/docs/index.md +0 -59
- package/dist/docs/reference/dashboard/actions.mdx +0 -53
- package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
- package/dist/docs/reference/dashboard/conditions.mdx +0 -42
- package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
- package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
- package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
- package/dist/docs/reference/dashboard/content/models.mdx +0 -108
- package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
- package/dist/docs/reference/dashboard/experiences.mdx +0 -51
- package/dist/docs/reference/dashboard/features.mdx +0 -154
- package/dist/docs/reference/dashboard/fields.mdx +0 -106
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
- package/dist/docs/reference/dashboard/projects.mdx +0 -44
- package/dist/docs/reference/dashboard/reports.mdx +0 -43
- package/dist/docs/reference/dashboard/steps.mdx +0 -37
- package/dist/docs/reference/dashboard/team-management.md +0 -29
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
- package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
- package/dist/docs/reference/delivery-api/experience-content.md +0 -152
- package/dist/docs/reference/delivery-api/index.md +0 -45
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
- package/dist/docs/reference/delivery-api/project-config.md +0 -65
- package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
- package/dist/docs/reference/glossary.md +0 -181
- package/dist/docs/reference/management-api/authentication.md +0 -74
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
- package/dist/docs/reference/management-api/error-handling.md +0 -233
- package/dist/docs/reference/management-api/pagination.md +0 -192
- package/dist/docs/reference/pickedql/data-sources.md +0 -174
- package/dist/docs/reference/pickedql/dimensions.md +0 -103
- package/dist/docs/reference/pickedql/filtering.md +0 -64
- package/dist/docs/reference/pickedql/index.md +0 -18
- package/dist/docs/reference/pickedql/schema.md +0 -172
- package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
- package/dist/docs/reference/sdk/actions.md +0 -30
- package/dist/docs/reference/sdk/analytics-events.md +0 -445
- package/dist/docs/reference/sdk/conditions.md +0 -147
- package/dist/docs/reference/sdk/content-security-policy.md +0 -21
- package/dist/docs/reference/sdk/content.md +0 -213
- package/dist/docs/reference/sdk/experiences.md +0 -51
- package/dist/docs/reference/sdk/features.md +0 -256
- package/dist/docs/reference/sdk/fields.md +0 -255
- package/dist/docs/reference/sdk/index.md +0 -68
- package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
- package/dist/docs/reference/sdk/plugins/index.md +0 -29
- package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
- package/dist/docs/reference/sdk/predicates.md +0 -43
- package/dist/docs/reference/sdk/ssr/index.md +0 -33
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
- package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -196
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -146
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -90
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -228
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
- package/dist/docs/tutorials/first-experience.mdx +0 -254
- package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
- package/dist/dom-BqcToNL0.js +0 -82
- package/dist/dom-DlLH3FxV.cjs +0 -1
- package/dist/emit-D-tLiWL1.cjs +0 -1
- package/dist/emit-Ds2EG7CB.js +0 -14
- package/dist/esm/form/index.js +0 -565
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
- package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
- package/dist/esm/plugins/history-browser-storage/index.js +0 -26
- package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
- package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
- package/dist/esm/plugins/telemetry/index.js +0 -100
- package/dist/esm/plugins/web-components/index.js +0 -19
- package/dist/esm/preview/index.js +0 -2
- package/dist/experience-instance-DGk11d8a.js +0 -563
- package/dist/experience-instance-Dej3P1sE.cjs +0 -1
- package/dist/id-Bo4RBeOs.js +0 -4
- package/dist/id-Js-62re-.cjs +0 -1
- package/dist/inert-script-report-B_bMPRzp.js +0 -18
- package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
- package/dist/logger-CSTvAyyB.cjs +0 -1
- package/dist/logger-DMN6TxJJ.js +0 -4
- package/dist/object-BUDGxEqy.js +0 -25
- package/dist/object-CIkt7Fkr.cjs +0 -1
- package/dist/plugin-BcLaCLm1.cjs +0 -1
- package/dist/plugin-De_BJSwE.js +0 -194
- package/dist/preview-channel-CSr96XAo.js +0 -98
- package/dist/preview-channel-Cx0e6fye.cjs +0 -1
- package/dist/protocol-Bb_vpLKE.cjs +0 -1
- package/dist/protocol-C5KkkiZc.js +0 -84
- package/dist/provider-C_9u0yGJ.cjs +0 -1
- package/dist/provider-ovM-CBX_.js +0 -98
- package/dist/registry-C1t8l3t9.cjs +0 -1
- package/dist/registry-CXZv0uLg.js +0 -18
- package/dist/rules-logic-CGZIYgAI.cjs +0 -1
- package/dist/rules-logic-HesIUCu6.js +0 -13
- package/dist/storage-1MW3-_As.js +0 -103
- package/dist/storage-DUw9UJ2h.cjs +0 -1
- package/dist/supports-CO9bJGNl.js +0 -92
- package/dist/supports-DBzjGaWD.cjs +0 -1
- package/dist/types/data-source/api.d.ts +0 -60
- package/dist/types/data-source/api.d.ts.map +0 -1
- package/dist/types/data-source/provider.d.ts +0 -103
- package/dist/types/data-source/provider.d.ts.map +0 -1
- package/dist/types/data-source/registry.d.ts +0 -26
- package/dist/types/data-source/registry.d.ts.map +0 -1
- package/dist/types/data-source/request-observer.d.ts +0 -62
- package/dist/types/data-source/request-observer.d.ts.map +0 -1
- package/dist/types/data-source/virtual-data.d.ts +0 -19
- package/dist/types/data-source/virtual-data.d.ts.map +0 -1
- package/dist/types/entities/action/action.d.ts +0 -85
- package/dist/types/entities/action/action.d.ts.map +0 -1
- package/dist/types/entities/component/lazyComponent.d.ts +0 -11
- package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -29
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/content/content.d.ts +0 -53
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/content/reference.d.ts +0 -101
- package/dist/types/entities/content/reference.d.ts.map +0 -1
- package/dist/types/entities/field/policies.d.ts +0 -35
- package/dist/types/entities/field/policies.d.ts.map +0 -1
- package/dist/types/entities/response/response-validation.d.ts +0 -75
- package/dist/types/entities/response/response-validation.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -46
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -56
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/form/build-responses.d.ts +0 -18
- package/dist/types/form/build-responses.d.ts.map +0 -1
- package/dist/types/form/create-field-evaluator.d.ts +0 -28
- package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
- package/dist/types/form/create-field-validation.d.ts +0 -60
- package/dist/types/form/create-field-validation.d.ts.map +0 -1
- package/dist/types/form/create-form.d.ts +0 -153
- package/dist/types/form/create-form.d.ts.map +0 -1
- package/dist/types/form/create-submit-pipeline.d.ts +0 -116
- package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
- package/dist/types/form/get-step-fields.d.ts +0 -19
- package/dist/types/form/get-step-fields.d.ts.map +0 -1
- package/dist/types/form/index.d.ts +0 -11
- package/dist/types/form/index.d.ts.map +0 -1
- package/dist/types/lifecycle/condition-selection.d.ts +0 -146
- package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -48
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -25
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
- package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/index.d.ts +0 -3
- package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/emit.d.ts +0 -18
- package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/index.d.ts +0 -4
- package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
- package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
- package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
- package/dist/types/plugins/web-components/index.d.ts +0 -2
- package/dist/types/plugins/web-components/index.d.ts.map +0 -1
- package/dist/types/plugins/web-components/plugin.d.ts +0 -4
- package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
- package/dist/types/preview/index.d.ts +0 -18
- package/dist/types/preview/index.d.ts.map +0 -1
- package/dist/types/preview-bridge/index.d.ts +0 -14
- package/dist/types/preview-bridge/index.d.ts.map +0 -1
- package/dist/types/preview-channel.d.ts +0 -16
- package/dist/types/preview-channel.d.ts.map +0 -1
- package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
- package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
- package/dist/types/preview-receiver/index.d.ts +0 -32
- package/dist/types/preview-receiver/index.d.ts.map +0 -1
- package/dist/types/preview-receiver/protocol.d.ts +0 -69
- package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
- package/dist/types/schema-registry.d.ts +0 -206
- package/dist/types/schema-registry.d.ts.map +0 -1
- package/dist/types/server/serialize.d.ts +0 -87
- package/dist/types/server/serialize.d.ts.map +0 -1
- package/dist/types/typed-content.d.ts +0 -17
- package/dist/types/typed-content.d.ts.map +0 -1
- package/dist/types/utils/client-telemetry.d.ts +0 -25
- package/dist/types/utils/client-telemetry.d.ts.map +0 -1
- package/dist/types/utils/content-path.d.ts +0 -37
- package/dist/types/utils/content-path.d.ts.map +0 -1
- package/dist/types/utils/html-asset-value.d.ts +0 -20
- package/dist/types/utils/html-asset-value.d.ts.map +0 -1
- package/dist/types/utils/inert-script-report.d.ts +0 -40
- package/dist/types/utils/inert-script-report.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
- package/dist/types/utils/picked-config.d.ts +0 -39
- package/dist/types/utils/picked-config.d.ts.map +0 -1
- package/dist/types/utils/preview-session.d.ts +0 -12
- package/dist/types/utils/preview-session.d.ts.map +0 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
- package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
- package/dist/types/utils/render-string.d.ts +0 -24
- package/dist/types/utils/render-string.d.ts.map +0 -1
- package/dist/types/utils/user-timing.d.ts +0 -21
- package/dist/types/utils/user-timing.d.ts.map +0 -1
- package/dist/version-BvLZaTMC.cjs +0 -1
- package/dist/version-VvasRUfR.js +0 -256
- /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Authentication
|
|
7
|
-
|
|
8
|
-
The Picked API supports four ways to authenticate. They are a session from an email
|
|
9
|
-
address and a password, an OAuth provider, a magic link, and an API key. This guide
|
|
10
|
-
covers each one. It also covers how to control a session and how to use multi-factor
|
|
11
|
-
authentication (MFA).
|
|
12
|
-
|
|
13
|
-
## Use a session
|
|
14
|
-
|
|
15
|
-
After the caller has a session, it puts the access token in the `Authorization`
|
|
16
|
-
header of every request that needs authentication:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Authorization: Bearer <accessToken>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The `expiresAt` field of the session gives the time at which the access token
|
|
23
|
-
expires. The caller must refresh the session before that time.
|
|
24
|
-
|
|
25
|
-
### Authenticator assurance levels
|
|
26
|
-
|
|
27
|
-
The session holds an `aal` field, and it gives the strength of the authentication:
|
|
28
|
-
|
|
29
|
-
| Level | Meaning |
|
|
30
|
-
|-------|---------|
|
|
31
|
-
| `AAL1` | One factor: an email address and a password, OAuth, or a magic link |
|
|
32
|
-
| `AAL2` | More than one factor: the user completed an MFA challenge |
|
|
33
|
-
|
|
34
|
-
Some operations need `AAL2`. When a caller at `AAL1` tries one of them, the API
|
|
35
|
-
returns an authorization error.
|
|
36
|
-
|
|
37
|
-
## The mutations
|
|
38
|
-
|
|
39
|
-
| Mutation | What it does |
|
|
40
|
-
| --- | --- |
|
|
41
|
-
| `sessionCreate` | Authenticates an email address and a password. Returns a session, or `requiresMfa`. |
|
|
42
|
-
| `sessionRefresh` | Exchanges a refresh token for a new session. Needs no `Authorization` header. |
|
|
43
|
-
| `accountCreate` | Creates an account. `metadata` takes any JSON. |
|
|
44
|
-
| `accountVerifyEmail` | Completes email verification with the token from the email. |
|
|
45
|
-
| `accountResendVerification` | Sends the verification email again. |
|
|
46
|
-
| `oauthAuthorize` | Returns the authorization URL for a provider. Google is supported. |
|
|
47
|
-
| `oauthCallback` | Exchanges an OAuth code for a session. |
|
|
48
|
-
| `magicLinkSend` | Sends a sign-in link to an email address. |
|
|
49
|
-
| `magicLinkVerify` | Exchanges a magic-link token for a session. |
|
|
50
|
-
| `passwordResetSend` | Sends a password reset email. |
|
|
51
|
-
| `passwordReset` | Completes a reset with the token from the email. |
|
|
52
|
-
| `passwordUpdate` | Changes a password. Needs authentication. |
|
|
53
|
-
| `mfaFactorEnroll` | Adds an MFA factor. A new factor is `UNVERIFIED`. |
|
|
54
|
-
| `mfaChallengeSend` | Sends a code to the telephone number of the factor. |
|
|
55
|
-
| `mfaChallengeVerify` | Verifies a challenge. Moves the session to `AAL2`. |
|
|
56
|
-
| `mfaFactorUnenroll` | Removes an MFA factor. |
|
|
57
|
-
| `apiKeyCreate` | Creates an API key. Only a user with a session can call it. |
|
|
58
|
-
| `apiKeyRevoke` | Invalidates a key immediately. |
|
|
59
|
-
|
|
60
|
-
## Credentials
|
|
61
|
-
|
|
62
|
-
| Credential | Header |
|
|
63
|
-
| --- | --- |
|
|
64
|
-
| Session access token | `Authorization: Bearer <accessToken>` |
|
|
65
|
-
| API key | `x-api-key: pk_live_abc123...` |
|
|
66
|
-
|
|
67
|
-
## Related
|
|
68
|
-
|
|
69
|
-
- [How to authenticate with a password](/how-to/authenticate-with-a-password)
|
|
70
|
-
- [How to authenticate with OAuth](/how-to/authenticate-with-oauth)
|
|
71
|
-
- [How to authenticate with a magic link](/how-to/authenticate-with-a-magic-link)
|
|
72
|
-
- [How to set up MFA](/how-to/set-up-mfa)
|
|
73
|
-
- [How to authenticate with an API key](/how-to/authenticate-with-an-api-key)
|
|
74
|
-
- [Authorization and scopes](/reference/management-api/authorization-and-scopes)
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Authorization and scopes
|
|
7
|
-
|
|
8
|
-
The Picked API controls access with scopes. Every authenticated caller carries a set
|
|
9
|
-
of scopes, and those scopes decide which operations the caller can do. A caller is
|
|
10
|
-
either a user with a session or an API key. This guide covers the scopes, the roles,
|
|
11
|
-
and how the API resolves a permission.
|
|
12
|
-
|
|
13
|
-
## The format of a scope name
|
|
14
|
-
|
|
15
|
-
A scope has the form `resource/action`:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
organization/read
|
|
19
|
-
organization_members/create
|
|
20
|
-
organization_projects/delete
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
- **resource** — a lowercase name. It uses an underscore between words, as in
|
|
24
|
-
`organization_members` and `organization_api_keys`.
|
|
25
|
-
- **action** — one of `create`, `read`, `update`, or `delete`.
|
|
26
|
-
|
|
27
|
-
The GraphQL schema holds the scopes in the `Scope` enum. There they are uppercase
|
|
28
|
-
with an underscore between words, as in `ORGANIZATION_READ` and
|
|
29
|
-
`ORGANIZATION_MEMBERS_CREATE`. The two forms name the same scope.
|
|
30
|
-
|
|
31
|
-
## Full scope list
|
|
32
|
-
|
|
33
|
-
These are the scopes:
|
|
34
|
-
|
|
35
|
-
### Organization
|
|
36
|
-
|
|
37
|
-
| Scope | GraphQL Enum | Description |
|
|
38
|
-
|-------|-------------|-------------|
|
|
39
|
-
| `organization/create` | `ORGANIZATION_CREATE` | Create an organization |
|
|
40
|
-
| `organization/read` | `ORGANIZATION_READ` | Read the detail of an organization |
|
|
41
|
-
| `organization/update` | `ORGANIZATION_UPDATE` | Update the name, the slug, and the settings of an organization |
|
|
42
|
-
| `organization/delete` | `ORGANIZATION_DELETE` | Delete an organization |
|
|
43
|
-
|
|
44
|
-
### Organization members
|
|
45
|
-
|
|
46
|
-
| Scope | GraphQL Enum | Description |
|
|
47
|
-
|-------|-------------|-------------|
|
|
48
|
-
| `organization_members/create` | `ORGANIZATION_MEMBERS_CREATE` | Add a member to an organization |
|
|
49
|
-
| `organization_members/read` | `ORGANIZATION_MEMBERS_READ` | Read the member list of an organization |
|
|
50
|
-
| `organization_members/update` | `ORGANIZATION_MEMBERS_UPDATE` | Update the role of a member |
|
|
51
|
-
| `organization_members/delete` | `ORGANIZATION_MEMBERS_DELETE` | Remove a member from an organization |
|
|
52
|
-
|
|
53
|
-
### Organization invitations
|
|
54
|
-
|
|
55
|
-
| Scope | GraphQL Enum | Description |
|
|
56
|
-
|-------|-------------|-------------|
|
|
57
|
-
| `organization_invitations/create` | `ORGANIZATION_INVITATIONS_CREATE` | Send an invitation to join an organization |
|
|
58
|
-
| `organization_invitations/read` | `ORGANIZATION_INVITATIONS_READ` | Read the invitations that wait for an answer |
|
|
59
|
-
| `organization_invitations/delete` | `ORGANIZATION_INVITATIONS_DELETE` | Revoke an invitation that waits for an answer |
|
|
60
|
-
|
|
61
|
-
### Organization projects
|
|
62
|
-
|
|
63
|
-
| Scope | GraphQL Enum | Description |
|
|
64
|
-
|-------|-------------|-------------|
|
|
65
|
-
| `organization_projects/create` | `ORGANIZATION_PROJECTS_CREATE` | Create a project |
|
|
66
|
-
| `organization_projects/read` | `ORGANIZATION_PROJECTS_READ` | Read the detail of a project |
|
|
67
|
-
| `organization_projects/update` | `ORGANIZATION_PROJECTS_UPDATE` | Update the settings of a project |
|
|
68
|
-
| `organization_projects/delete` | `ORGANIZATION_PROJECTS_DELETE` | Delete a project |
|
|
69
|
-
|
|
70
|
-
### Organization API keys
|
|
71
|
-
|
|
72
|
-
| Scope | GraphQL Enum | Description |
|
|
73
|
-
|-------|-------------|-------------|
|
|
74
|
-
| `organization_api_keys/create` | `ORGANIZATION_API_KEYS_CREATE` | Create an API key |
|
|
75
|
-
| `organization_api_keys/read` | `ORGANIZATION_API_KEYS_READ` | Read the API keys. This gives the prefix only, and not the full key. |
|
|
76
|
-
| `organization_api_keys/delete` | `ORGANIZATION_API_KEYS_DELETE` | Revoke an API key |
|
|
77
|
-
|
|
78
|
-
### Organization integrations
|
|
79
|
-
|
|
80
|
-
| Scope | GraphQL Enum | Description |
|
|
81
|
-
|-------|-------------|-------------|
|
|
82
|
-
| `organization_integrations/create` | `ORGANIZATION_INTEGRATIONS_CREATE` | Set up an integration |
|
|
83
|
-
| `organization_integrations/read` | `ORGANIZATION_INTEGRATIONS_READ` | Read the options of an integration |
|
|
84
|
-
| `organization_integrations/update` | `ORGANIZATION_INTEGRATIONS_UPDATE` | Change the settings of an integration |
|
|
85
|
-
| `organization_integrations/delete` | `ORGANIZATION_INTEGRATIONS_DELETE` | Remove an integration |
|
|
86
|
-
|
|
87
|
-
### Organization reports
|
|
88
|
-
|
|
89
|
-
| Scope | GraphQL Enum | Description |
|
|
90
|
-
|-------|-------------|-------------|
|
|
91
|
-
| `organization_reports/create` | `ORGANIZATION_REPORTS_CREATE` | Create a report |
|
|
92
|
-
| `organization_reports/read` | `ORGANIZATION_REPORTS_READ` | Read a report |
|
|
93
|
-
| `organization_reports/update` | `ORGANIZATION_REPORTS_UPDATE` | Update the settings of a report |
|
|
94
|
-
| `organization_reports/delete` | `ORGANIZATION_REPORTS_DELETE` | Delete a report |
|
|
95
|
-
|
|
96
|
-
## Roles
|
|
97
|
-
|
|
98
|
-
Each member of an organization holds one of two roles:
|
|
99
|
-
|
|
100
|
-
### Owner
|
|
101
|
-
|
|
102
|
-
An owner has full control inside the organization. These are the default scopes of an
|
|
103
|
-
owner:
|
|
104
|
-
|
|
105
|
-
- All `organization/*` scopes (`read`, `update`, `delete`)
|
|
106
|
-
- All `organization_members/*` scopes
|
|
107
|
-
- All `organization_invitations/*` scopes
|
|
108
|
-
- `organization_projects/read`, `organization_projects/update`, `organization_projects/delete`
|
|
109
|
-
- All `organization_api_keys/*` scopes
|
|
110
|
-
- All `organization_integrations/*` scopes
|
|
111
|
-
- `organization_reports/read`
|
|
112
|
-
|
|
113
|
-
### Member
|
|
114
|
-
|
|
115
|
-
A member can reach most things, but cannot delete the organization and cannot control
|
|
116
|
-
another member. These are the default scopes of a member:
|
|
117
|
-
|
|
118
|
-
- `organization/read`, `organization/update`
|
|
119
|
-
- `organization_members/read`
|
|
120
|
-
- `organization_invitations/read`
|
|
121
|
-
- `organization_projects/read`, `organization_projects/update`, `organization_projects/delete`
|
|
122
|
-
- All `organization_api_keys/*` scopes
|
|
123
|
-
- All `organization_integrations/*` scopes
|
|
124
|
-
- `organization_reports/read`
|
|
125
|
-
|
|
126
|
-
These are the differences between an owner and a member:
|
|
127
|
-
|
|
128
|
-
| Capability | Owner | Member |
|
|
129
|
-
|-----------|-------|--------|
|
|
130
|
-
| Delete the organization | Yes | No |
|
|
131
|
-
| Invite new members | Yes | No |
|
|
132
|
-
| Remove members | Yes | No |
|
|
133
|
-
| Update member roles | Yes | No |
|
|
134
|
-
| Revoke invitations | Yes | No |
|
|
135
|
-
| Control projects and integrations | Yes | Yes |
|
|
136
|
-
| Control API keys | Yes | Yes |
|
|
137
|
-
| Read reports | Yes | Yes |
|
|
138
|
-
|
|
139
|
-
## How scopes are resolved
|
|
140
|
-
|
|
141
|
-
When an authenticated request reaches the API, the API resolves the scopes like this:
|
|
142
|
-
|
|
143
|
-
1. **A user with a session** — the API finds the role of that caller in the target
|
|
144
|
-
organization. It then gives the caller the default scopes of that role.
|
|
145
|
-
2. **A request with an API key** — the API uses the scopes that the key received when
|
|
146
|
-
somebody created it. Those scopes are always scopes of the user who created the
|
|
147
|
-
key.
|
|
148
|
-
|
|
149
|
-
Most queries and mutations point at one organization. For those, the caller must hold
|
|
150
|
-
the scope inside that organization. For a root-level operation such as
|
|
151
|
-
`organizationCreate`, the API resolves the scope at the account level.
|
|
152
|
-
|
|
153
|
-
When the caller does not hold the scope that an operation needs, the API returns an
|
|
154
|
-
authorization error with the code `FORBIDDEN`. See [Errors](/reference/management-api/error-handling).
|
|
155
|
-
|
|
156
|
-
## Operations and required scopes
|
|
157
|
-
|
|
158
|
-
This table gives the scope that each common operation needs:
|
|
159
|
-
|
|
160
|
-
### Queries
|
|
161
|
-
|
|
162
|
-
| Query | Required Scope |
|
|
163
|
-
|-------|---------------|
|
|
164
|
-
| `organization` | `organization/read` |
|
|
165
|
-
| `organizations` | `organization/read` |
|
|
166
|
-
| `project` | `organization_projects/read` |
|
|
167
|
-
| `apiKeys` | `organization_api_keys/read` |
|
|
168
|
-
| `shopifyWebhooks` | `organization_integrations/read` |
|
|
169
|
-
| `shopifyMetafieldConfigs` | `organization_integrations/read` |
|
|
170
|
-
| `shopifyProduct` / `shopifyProducts` | `organization_integrations/read` |
|
|
171
|
-
| `report` | `organization_reports/read` |
|
|
172
|
-
|
|
173
|
-
### Mutations
|
|
174
|
-
|
|
175
|
-
| Mutation | Required Scope |
|
|
176
|
-
|----------|---------------|
|
|
177
|
-
| `organizationCreate` | `organization/create` |
|
|
178
|
-
| `organizationUpdate` | `organization/update` |
|
|
179
|
-
| `organizationDelete` | `organization/delete` |
|
|
180
|
-
| `organizationMemberInvite` | `organization_invitations/create` |
|
|
181
|
-
| `organizationInvitationRevoke` | `organization_invitations/delete` |
|
|
182
|
-
| `organizationMemberRemove` | `organization_members/delete` |
|
|
183
|
-
| `organizationMemberRoleUpdate` | `organization_members/update` |
|
|
184
|
-
| `projectCreate` | `organization_projects/create` |
|
|
185
|
-
| `apiKeyCreate` | `organization_api_keys/create` |
|
|
186
|
-
| `apiKeyRevoke` | `organization_api_keys/delete` |
|
|
187
|
-
| `shopifyWebhookCreate` | `organization_integrations/create` |
|
|
188
|
-
| `shopifyWebhookUpdate` | `organization_integrations/update` |
|
|
189
|
-
| `shopifyWebhookDelete` | `organization_integrations/delete` |
|
|
190
|
-
| `shopifyMetafieldConfigCreate` | `organization_integrations/create` |
|
|
191
|
-
| `shopifyMetafieldConfigUpdate` | `organization_integrations/update` |
|
|
192
|
-
| `shopifyMetafieldConfigDelete` | `organization_integrations/delete` |
|
|
193
|
-
| `reportCreate` | `organization_reports/create` |
|
|
194
|
-
| `reportUpdate` | `organization_reports/update` |
|
|
195
|
-
| `reportDelete` | `organization_reports/delete` |
|
|
196
|
-
|
|
197
|
-
Some mutations do not require organization-level scopes because they operate on the caller's own data:
|
|
198
|
-
|
|
199
|
-
| Mutation | Requirement |
|
|
200
|
-
|----------|------------|
|
|
201
|
-
| `sessionCreate` / `sessionRefresh` | No authentication required |
|
|
202
|
-
| `accountCreate` / `accountVerifyEmail` | No authentication required |
|
|
203
|
-
| `oauthAuthorize` / `oauthCallback` | No authentication required |
|
|
204
|
-
| `magicLinkSend` / `magicLinkVerify` | No authentication required |
|
|
205
|
-
| `passwordResetSend` / `passwordReset` | No authentication required |
|
|
206
|
-
| `passwordUpdate` | Authenticated session (no specific scope) |
|
|
207
|
-
| `organizationInvitationAccept` / `organizationInvitationDecline` | Authenticated session (no specific scope) |
|
|
208
|
-
| `mfaFactorEnroll` / `mfaChallengeSend` / `mfaChallengeVerify` / `mfaFactorUnenroll` | Authenticated session (no specific scope) |
|
|
209
|
-
|
|
210
|
-
## Read your scopes
|
|
211
|
-
|
|
212
|
-
### Root-level scopes
|
|
213
|
-
|
|
214
|
-
The `viewerScopes` query returns the root-level scopes for the authenticated caller:
|
|
215
|
-
|
|
216
|
-
```graphql
|
|
217
|
-
query {
|
|
218
|
-
viewerScopes
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Response:
|
|
223
|
-
|
|
224
|
-
```json
|
|
225
|
-
{
|
|
226
|
-
"data": {
|
|
227
|
-
"viewerScopes": [
|
|
228
|
-
"ORGANIZATION_CREATE"
|
|
229
|
-
]
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Organization-level scopes
|
|
235
|
-
|
|
236
|
-
Each `Organization` object exposes a `viewerScopes` field that returns the scopes the caller has within that specific organization:
|
|
237
|
-
|
|
238
|
-
```graphql
|
|
239
|
-
query {
|
|
240
|
-
organization(input: { slug: "my-company" }) {
|
|
241
|
-
id
|
|
242
|
-
name
|
|
243
|
-
viewerScopes
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
Response:
|
|
249
|
-
|
|
250
|
-
```json
|
|
251
|
-
{
|
|
252
|
-
"data": {
|
|
253
|
-
"organization": {
|
|
254
|
-
"id": "org_abc123",
|
|
255
|
-
"name": "My Company",
|
|
256
|
-
"viewerScopes": [
|
|
257
|
-
"ORGANIZATION_READ",
|
|
258
|
-
"ORGANIZATION_UPDATE",
|
|
259
|
-
"ORGANIZATION_MEMBERS_READ",
|
|
260
|
-
"ORGANIZATION_PROJECTS_READ",
|
|
261
|
-
"ORGANIZATION_PROJECTS_UPDATE",
|
|
262
|
-
"ORGANIZATION_PROJECTS_DELETE",
|
|
263
|
-
"ORGANIZATION_API_KEYS_CREATE",
|
|
264
|
-
"ORGANIZATION_API_KEYS_READ",
|
|
265
|
-
"ORGANIZATION_API_KEYS_DELETE",
|
|
266
|
-
"ORGANIZATION_INTEGRATIONS_CREATE",
|
|
267
|
-
"ORGANIZATION_INTEGRATIONS_READ",
|
|
268
|
-
"ORGANIZATION_INTEGRATIONS_UPDATE",
|
|
269
|
-
"ORGANIZATION_INTEGRATIONS_DELETE",
|
|
270
|
-
"ORGANIZATION_REPORTS_READ"
|
|
271
|
-
]
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
Use this to build a UI that changes with the permissions of the caller. An example is
|
|
278
|
-
a **Delete Organization** button that the UI hides when the caller does not hold
|
|
279
|
-
`ORGANIZATION_DELETE`.
|
|
280
|
-
|
|
281
|
-
## Related
|
|
282
|
-
|
|
283
|
-
- [Authentication](/reference/management-api/authentication)
|
|
284
|
-
- [How to authenticate with an API key](/how-to/authenticate-with-an-api-key)
|
|
285
|
-
- [API keys](/reference/dashboard/api-keys) — the dashboard surface.
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Errors
|
|
7
|
-
|
|
8
|
-
The Picked API returns an error in the standard GraphQL format. This guide covers the
|
|
9
|
-
shape of an error response, every error code, and what your code must do with each
|
|
10
|
-
one.
|
|
11
|
-
|
|
12
|
-
## Error response shape
|
|
13
|
-
|
|
14
|
-
When an operation fails, the API returns an `errors` array in the response body. Each
|
|
15
|
-
error object holds these fields:
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"data": null,
|
|
20
|
-
"errors": [
|
|
21
|
-
{
|
|
22
|
-
"message": "A human-readable description of the error",
|
|
23
|
-
"path": ["mutationName"],
|
|
24
|
-
"extensions": {
|
|
25
|
-
"code": "ERROR_CODE"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
| Field | Description |
|
|
33
|
-
|-------|-------------|
|
|
34
|
-
| `message` | A description of the error that a person can read. Put it in your log. Do not write code against it. |
|
|
35
|
-
| `path` | The path to the field in the query that made the error. |
|
|
36
|
-
| `extensions.code` | An error code that a machine can read. Write your code against this field. |
|
|
37
|
-
|
|
38
|
-
One response can hold more than one error. The `data` field is `null` when the whole
|
|
39
|
-
operation failed. It holds part of the data when only some fields failed.
|
|
40
|
-
|
|
41
|
-
## Authentication error codes
|
|
42
|
-
|
|
43
|
-
These errors come from a session, an account, OAuth, a magic link, a password
|
|
44
|
-
operation, or MFA. They match the `AuthErrorCode` enum in the schema.
|
|
45
|
-
|
|
46
|
-
| Code | Description |
|
|
47
|
-
|------|-------------|
|
|
48
|
-
| `INVALID_CREDENTIALS` | The email address and the password do not match. |
|
|
49
|
-
| `EMAIL_NOT_CONFIRMED` | The account is there, but nobody verified the email address. See [Authentication](/reference/management-api/authentication#the-mutations). |
|
|
50
|
-
| `USER_NOT_FOUND` | There is no account with that email address. |
|
|
51
|
-
| `USER_ALREADY_EXISTS` | An account with that email address is there already. The API returns this when you create an account. |
|
|
52
|
-
| `WEAK_PASSWORD` | The password is not strong enough. |
|
|
53
|
-
| `INVALID_TOKEN` | The token is invalid or malformed. This covers a verification token, a reset token, and a magic link token. |
|
|
54
|
-
| `TOKEN_EXPIRED` | The token expired. Ask for a new one. |
|
|
55
|
-
| `MFA_CHALLENGE_FAILED` | The MFA verification code is not correct. |
|
|
56
|
-
| `MFA_FACTOR_NOT_FOUND` | That MFA factor is not there, or it belongs to another caller. |
|
|
57
|
-
| `OAUTH_PROVIDER_ERROR` | The exchange with the OAuth provider, such as Google, failed. |
|
|
58
|
-
| `RATE_LIMITED` | Too many requests in a short period. Wait, then try again. |
|
|
59
|
-
|
|
60
|
-
### Example: invalid credentials
|
|
61
|
-
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"data": {
|
|
65
|
-
"sessionCreate": {
|
|
66
|
-
"session": null,
|
|
67
|
-
"requiresMfa": false,
|
|
68
|
-
"mfaFactors": null
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"errors": [
|
|
72
|
-
{
|
|
73
|
-
"message": "Invalid credentials",
|
|
74
|
-
"path": ["sessionCreate"],
|
|
75
|
-
"extensions": {
|
|
76
|
-
"code": "INVALID_CREDENTIALS"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Authorization error codes
|
|
84
|
-
|
|
85
|
-
An authorization error happens when the caller does not hold the
|
|
86
|
-
[scope](/reference/management-api/authorization-and-scopes) that an operation needs.
|
|
87
|
-
|
|
88
|
-
| Code | Description |
|
|
89
|
-
|------|-------------|
|
|
90
|
-
| `UNAUTHORIZED` | The request carries no valid authentication. It has no `Authorization` header and no `x-api-key` header, or the token is invalid. |
|
|
91
|
-
| `FORBIDDEN` | The caller is authenticated, but it does not hold the scope that the operation needs. |
|
|
92
|
-
|
|
93
|
-
### Example: the scope is not enough
|
|
94
|
-
|
|
95
|
-
A caller that holds `organization/read` only tries to delete an organization. It
|
|
96
|
-
receives this:
|
|
97
|
-
|
|
98
|
-
```json
|
|
99
|
-
{
|
|
100
|
-
"data": {
|
|
101
|
-
"organizationDelete": null
|
|
102
|
-
},
|
|
103
|
-
"errors": [
|
|
104
|
-
{
|
|
105
|
-
"message": "Insufficient permissions",
|
|
106
|
-
"path": ["organizationDelete"],
|
|
107
|
-
"extensions": {
|
|
108
|
-
"code": "FORBIDDEN"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Organization, member, and invitation error codes
|
|
116
|
-
|
|
117
|
-
These errors come from an organization, a member operation, or an invitation. They
|
|
118
|
-
match the `ErrorCode` enum in the schema.
|
|
119
|
-
|
|
120
|
-
### Organization errors
|
|
121
|
-
|
|
122
|
-
| Code | Description |
|
|
123
|
-
|------|-------------|
|
|
124
|
-
| `ORGANIZATION_NOT_FOUND` | That organization is not there, or the caller cannot reach it. |
|
|
125
|
-
| `ORGANIZATION_ALREADY_EXISTS` | An organization with that name is there already. |
|
|
126
|
-
| `SLUG_ALREADY_EXISTS` | Another organization uses that slug already. |
|
|
127
|
-
| `INVALID_SLUG` | The slug holds an invalid character. A slug takes lowercase letters, digits, and hyphens only. |
|
|
128
|
-
|
|
129
|
-
### Member errors
|
|
130
|
-
|
|
131
|
-
| Code | Description |
|
|
132
|
-
|------|-------------|
|
|
133
|
-
| `MEMBER_NOT_FOUND` | That user is not a member of the organization. |
|
|
134
|
-
| `MEMBER_ALREADY_EXISTS` | The user is a member of the organization already. |
|
|
135
|
-
| `CANNOT_REMOVE_PRIMARY_OWNER` | You cannot remove the primary owner of an organization. |
|
|
136
|
-
| `CANNOT_CHANGE_OWN_ROLE` | A member cannot change the role of that same member. Another owner must do it. |
|
|
137
|
-
|
|
138
|
-
### Invitation errors
|
|
139
|
-
|
|
140
|
-
| Code | Description |
|
|
141
|
-
|------|-------------|
|
|
142
|
-
| `INVITATION_NOT_FOUND` | That invitation is not there. |
|
|
143
|
-
| `INVITATION_EXPIRED` | The invitation expired. Nobody can accept it now. |
|
|
144
|
-
| `INVITATION_ALREADY_ACCEPTED` | Somebody accepted the invitation already. |
|
|
145
|
-
|
|
146
|
-
### Project errors
|
|
147
|
-
|
|
148
|
-
| Code | Description |
|
|
149
|
-
|------|-------------|
|
|
150
|
-
| `PROJECT_NOT_FOUND` | That project is not there, or the caller cannot reach it. |
|
|
151
|
-
|
|
152
|
-
### General errors
|
|
153
|
-
|
|
154
|
-
| Code | Description |
|
|
155
|
-
|------|-------------|
|
|
156
|
-
| `VALIDATION_ERROR` | The input failed a validation rule. Read the `message` field to learn which field is invalid. |
|
|
157
|
-
| `INTERNAL_ERROR` | The server met an unexpected error. Try the request again. Contact support when the error continues. |
|
|
158
|
-
|
|
159
|
-
## What your code must do
|
|
160
|
-
|
|
161
|
-
### Look for an error first
|
|
162
|
-
|
|
163
|
-
Check every response for an `errors` array before you read `data`:
|
|
164
|
-
|
|
165
|
-
```javascript
|
|
166
|
-
const response = await fetch('/graphql', {
|
|
167
|
-
method: 'POST',
|
|
168
|
-
headers: {
|
|
169
|
-
'Content-Type': 'application/json',
|
|
170
|
-
'Authorization': `Bearer ${accessToken}`,
|
|
171
|
-
},
|
|
172
|
-
body: JSON.stringify({ query, variables }),
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
const result = await response.json();
|
|
176
|
-
|
|
177
|
-
if (result.errors) {
|
|
178
|
-
for (const error of result.errors) {
|
|
179
|
-
const code = error.extensions?.code;
|
|
180
|
-
|
|
181
|
-
switch (code) {
|
|
182
|
-
case 'UNAUTHORIZED':
|
|
183
|
-
// Send the user to the sign-in page.
|
|
184
|
-
break;
|
|
185
|
-
case 'FORBIDDEN':
|
|
186
|
-
// Show a permissions error.
|
|
187
|
-
break;
|
|
188
|
-
case 'RATE_LIMITED':
|
|
189
|
-
// Wait, then try again.
|
|
190
|
-
break;
|
|
191
|
-
default:
|
|
192
|
-
// Put the message in the log, or show it.
|
|
193
|
-
console.error(error.message);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Refresh a token that expired
|
|
200
|
-
|
|
201
|
-
A request can return `UNAUTHORIZED` while the caller holds a refresh token. Try a
|
|
202
|
-
[session refresh](/reference/management-api/authentication#the-mutations) first. Do not treat it as a
|
|
203
|
-
failure to sign in:
|
|
204
|
-
|
|
205
|
-
```javascript
|
|
206
|
-
if (code === 'UNAUTHORIZED' && refreshToken) {
|
|
207
|
-
const refreshResult = await sessionRefresh(refreshToken);
|
|
208
|
-
if (refreshResult.session) {
|
|
209
|
-
// Try the first request again with the new access token.
|
|
210
|
-
} else {
|
|
211
|
-
// Send the user to the sign-in page.
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### Read data that is only part complete
|
|
217
|
-
|
|
218
|
-
GraphQL can return part of the data together with an error. Take a query that reads
|
|
219
|
-
an organization and its members. It can succeed for the organization and fail for the
|
|
220
|
-
members, when the caller does not hold `organization_members/read`. The response then
|
|
221
|
-
holds `data` with the organization, and `errors` for the members field. Always read
|
|
222
|
-
both.
|
|
223
|
-
|
|
224
|
-
### Try again after a transient failure
|
|
225
|
-
|
|
226
|
-
`INTERNAL_ERROR` and `RATE_LIMITED` are both transient. For `RATE_LIMITED`, use an
|
|
227
|
-
exponential backoff before you try again. For `INTERNAL_ERROR`, one more try is
|
|
228
|
-
usually enough.
|
|
229
|
-
|
|
230
|
-
## Related
|
|
231
|
-
|
|
232
|
-
- [Authentication](/reference/management-api/authentication)
|
|
233
|
-
- [Your first API call](/tutorials/first-api-call)
|