@picked/client 0.0.1-dev.1785305085063 → 0.0.1-dev.1785908062293
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/dist/.tsbuildinfo +1 -0
- package/dist/api-03c5jvVk.js +38 -0
- package/dist/api-CQxCVIrm.cjs +1 -0
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dom-observer/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
- package/dist/docs/explanation/feature-flag-allocation.md +176 -0
- package/dist/docs/explanation/how-picked-works.md +124 -0
- package/dist/docs/explanation/how-pickedql-works.md +76 -0
- package/dist/docs/explanation/pages-and-flows.md +64 -0
- package/dist/docs/explanation/the-content-model.md +77 -0
- package/dist/docs/explanation/the-two-apis.md +68 -0
- package/dist/docs/explanation/why-server-side-rendering.md +76 -0
- package/dist/docs/explanation/workspaces-and-versions.md +71 -0
- package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
- package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +53 -28
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
- package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
- package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
- package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
- package/dist/docs/how-to/build-a-flow.md +83 -0
- package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
- package/dist/docs/how-to/create-a-project.md +29 -0
- package/dist/docs/how-to/create-an-experience.md +42 -0
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
- package/dist/docs/how-to/define-a-page-layout.md +39 -0
- package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
- package/dist/docs/how-to/install-the-gtm-template.md +84 -0
- package/dist/docs/how-to/install-the-sdk.md +68 -0
- package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
- package/dist/docs/how-to/invite-and-remove-members.md +34 -0
- package/dist/docs/how-to/preview-a-workspace.md +28 -0
- package/dist/docs/how-to/publish-a-workspace.md +30 -0
- package/dist/docs/how-to/read-a-feature-flag.md +101 -0
- package/dist/docs/how-to/register-a-component.md +55 -0
- package/dist/docs/how-to/register-an-action-handler.md +67 -0
- package/dist/docs/how-to/render-a-step-form.md +132 -0
- package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
- package/dist/docs/how-to/reuse-a-section.md +37 -0
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
- package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
- package/dist/docs/how-to/run-an-ab-test.md +49 -0
- package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
- package/dist/docs/how-to/server-render-a-page.md +81 -0
- package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
- package/dist/docs/how-to/set-up-mfa.md +69 -0
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
- package/dist/docs/how-to/validate-a-field.md +52 -0
- package/dist/docs/how-to/write-a-condition.md +45 -0
- package/dist/docs/how-to/write-a-predicate.md +60 -0
- package/dist/docs/index.md +41 -59
- package/dist/docs/reference/dashboard/actions.mdx +53 -0
- package/dist/docs/reference/dashboard/api-keys.mdx +37 -0
- package/dist/docs/reference/dashboard/conditions.mdx +42 -0
- package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
- package/dist/docs/reference/dashboard/content/content-entries.mdx +44 -0
- package/dist/docs/reference/dashboard/content/layouts.mdx +62 -0
- package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
- package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
- package/dist/docs/reference/dashboard/experiences.mdx +51 -0
- package/dist/docs/reference/dashboard/features.mdx +114 -0
- package/dist/docs/reference/dashboard/fields.mdx +100 -0
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +57 -0
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +63 -0
- package/dist/docs/reference/dashboard/projects.mdx +44 -0
- package/dist/docs/reference/dashboard/reports.mdx +43 -0
- package/dist/docs/reference/dashboard/steps.mdx +37 -0
- package/dist/docs/reference/dashboard/team-management.md +29 -0
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +30 -0
- package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +17 -5
- package/dist/docs/reference/delivery-api/index.md +45 -0
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +15 -6
- package/dist/docs/reference/glossary.md +173 -0
- package/dist/docs/reference/management-api/authentication.md +74 -0
- package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +70 -47
- package/dist/docs/reference/management-api/error-handling.md +233 -0
- package/dist/docs/{api → reference/management-api}/pagination.md +36 -20
- package/dist/docs/reference/pickedql/data-sources.md +174 -0
- package/dist/docs/reference/pickedql/dimensions.md +87 -0
- package/dist/docs/{pickedql → reference/pickedql}/filtering.md +17 -6
- package/dist/docs/reference/pickedql/index.md +18 -0
- package/dist/docs/reference/pickedql/schema.md +172 -0
- package/dist/docs/reference/pickedql/virtual-functions.md +237 -0
- package/dist/docs/reference/sdk/actions.md +30 -0
- package/dist/docs/{sdk → reference/sdk}/conditions.md +15 -5
- package/dist/docs/reference/sdk/content-security-policy.md +21 -0
- package/dist/docs/reference/sdk/experiences.md +51 -0
- package/dist/docs/reference/sdk/features.md +233 -0
- package/dist/docs/reference/sdk/fields.md +209 -0
- package/dist/docs/reference/sdk/index.md +68 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +25 -34
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
- package/dist/docs/reference/sdk/plugins/index.md +29 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
- package/dist/docs/reference/sdk/predicates.md +43 -0
- package/dist/docs/reference/sdk/ssr/index.md +33 -0
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
- package/dist/docs/reference/sdk/ssr/serialize.md +77 -0
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +59 -0
- package/dist/docs/reference/sdk/steps.md +87 -0
- package/dist/docs/reference/tools/chrome-extension.md +16 -0
- package/dist/docs/reference/tools/image-optimisation-service.md +104 -0
- package/dist/docs/reference/tools/mcp.md +88 -0
- package/dist/docs/reference/tools/vite-plugin.md +88 -0
- package/dist/docs/tutorials/first-api-call.md +228 -0
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
- package/dist/docs/tutorials/first-experience.mdx +255 -0
- package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
- package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
- package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
- package/dist/esm/form/index.js +2 -4
- package/dist/esm/index.js +225 -186
- package/dist/esm/plugins/dom-observer/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
- package/dist/esm/preview/index.js +1 -1
- package/dist/esm/server/index.js +33 -31
- package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
- package/dist/experience-instance-Dej3P1sE.cjs +1 -0
- package/dist/plugin-CHOVsx7Z.js +287 -0
- package/dist/plugin-DsaGXQHx.cjs +1 -0
- package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
- package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
- package/dist/types/client.d.ts +7 -6
- package/dist/types/data-source/api.d.ts +60 -0
- package/dist/types/data-source/api.d.ts.map +1 -0
- package/dist/types/data-source/provider.d.ts +97 -0
- package/dist/types/data-source/provider.d.ts.map +1 -0
- package/dist/types/entities/action/action.d.ts +5 -4
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -5
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +5 -5
- package/dist/types/entities/content/content.d.ts +4 -3
- package/dist/types/entities/experience/experience.d.ts +11 -10
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
- package/dist/types/entities/feature/feature.d.ts +19 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +7 -6
- package/dist/types/entities/framework/framework.d.ts +7 -6
- 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/plugin/plugin.d.ts +3 -2
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +4 -3
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +3 -2
- package/dist/types/entities/response/response.d.ts +12 -11
- package/dist/types/entities/session/session.d.ts +2 -1
- package/dist/types/entities/step/step.d.ts +6 -5
- package/dist/types/exports.d.ts +2 -1
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +2 -1
- package/dist/types/form/create-field-evaluator.d.ts +4 -3
- package/dist/types/form/create-field-validation.d.ts +5 -4
- package/dist/types/form/create-form.d.ts +7 -6
- package/dist/types/form/create-submit-pipeline.d.ts +7 -6
- package/dist/types/form/get-step-fields.d.ts +3 -2
- package/dist/types/lifecycle/condition-selection.d.ts +14 -4
- package/dist/types/lifecycle/lifecycle.d.ts +4 -3
- package/dist/types/lifecycle/rules-logic.d.ts +4 -3
- package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
- package/dist/types/picked.d.ts +79 -62
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +1 -1
- package/dist/types/ping.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
- 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/dom-observer/plugin.d.ts +1 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +4 -36
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +42 -11
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts +2 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/preview-channel.d.ts +5 -1
- package/dist/types/preview-receiver/index.d.ts +18 -1
- package/dist/types/preview-receiver/protocol.d.ts +10 -1
- package/dist/types/server/index.d.ts +3 -3
- package/dist/types/server/serialize.d.ts +8 -2
- package/dist/types/server/serialize.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +2 -1
- package/dist/types/utils/events.d.ts +6 -6
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +1 -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/logger.d.ts +2 -1
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
- 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 +1 -1
- package/dist/types/utils/picked-config.d.ts +2 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
- package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +6 -2
- package/dist/types/utils/storage.d.ts +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +22 -23
- package/dist/api-CPL40b7A.js +0 -40
- package/dist/api-Dz5rgRgQ.cjs +0 -1
- package/dist/docs/actions.mdx +0 -78
- package/dist/docs/api/authentication.md +0 -376
- package/dist/docs/api/error-handling.md +0 -211
- package/dist/docs/api/index.md +0 -197
- package/dist/docs/api-keys.mdx +0 -40
- package/dist/docs/chrome-extension.md +0 -51
- package/dist/docs/conditions.mdx +0 -59
- package/dist/docs/content/asset-library.mdx +0 -93
- package/dist/docs/content/content-entries.mdx +0 -30
- package/dist/docs/content/layouts.mdx +0 -70
- package/dist/docs/content/pages.mdx +0 -67
- package/dist/docs/content/sections.mdx +0 -33
- package/dist/docs/delivery-api/index.md +0 -46
- package/dist/docs/delivery-api/preview-caching-crawling.md +0 -59
- package/dist/docs/experiences.mdx +0 -42
- package/dist/docs/features.mdx +0 -58
- package/dist/docs/fields.mdx +0 -79
- package/dist/docs/flow-builder/building-flows.md +0 -61
- package/dist/docs/flow-builder/condition-builder.md +0 -54
- package/dist/docs/flow-builder/keyboard-shortcuts.md +0 -66
- package/dist/docs/flow-builder/nodes.md +0 -43
- package/dist/docs/flow-builder/overview.mdx +0 -50
- package/dist/docs/gtm-template.md +0 -69
- package/dist/docs/guides/build-a-personalized-page.mdx +0 -143
- package/dist/docs/image-optimisation-service.md +0 -80
- package/dist/docs/mcp.md +0 -120
- package/dist/docs/pickedql/data-sources.md +0 -145
- package/dist/docs/pickedql/dimensions.md +0 -65
- package/dist/docs/pickedql/index.md +0 -36
- package/dist/docs/pickedql/schema.md +0 -156
- package/dist/docs/pickedql/virtual-functions.md +0 -204
- package/dist/docs/projects.mdx +0 -37
- package/dist/docs/reports.mdx +0 -18
- package/dist/docs/sdk/actions.md +0 -66
- package/dist/docs/sdk/content-security-policy.md +0 -32
- package/dist/docs/sdk/experiences.md +0 -46
- package/dist/docs/sdk/features.md +0 -212
- package/dist/docs/sdk/fields.md +0 -263
- package/dist/docs/sdk/index.md +0 -83
- package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -58
- package/dist/docs/sdk/plugins/index.md +0 -9
- package/dist/docs/sdk/predicates.md +0 -112
- package/dist/docs/sdk/ssr/index.md +0 -62
- package/dist/docs/sdk/ssr/rendering-and-hydration.md +0 -141
- package/dist/docs/sdk/ssr/serialize.md +0 -86
- package/dist/docs/sdk/ssr/slots-and-placements.md +0 -35
- package/dist/docs/sdk/steps.md +0 -434
- package/dist/docs/steps.mdx +0 -44
- package/dist/docs/team-management.md +0 -40
- package/dist/docs/vite-plugin.md +0 -82
- package/dist/docs/workspace-versioning.mdx +0 -28
- package/dist/docs/workspaces.mdx +0 -102
- package/dist/experience-instance-DurC3pE-.cjs +0 -1
- package/dist/plugin-CFXwbXeM.js +0 -247
- package/dist/plugin-m4qekgtA.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/client",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1785908062293",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@withease/factories": "^1.0.5"
|
|
6
6
|
},
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@repo/eslint-config": "workspace:*",
|
|
9
9
|
"@repo/typescript-config": "workspace:*",
|
|
10
|
-
"@rollup/plugin-replace": "^6.0.
|
|
11
|
-
"@size-limit/preset-small-lib": "^12.
|
|
12
|
-
"@testing-library/dom": "^10.4.
|
|
13
|
-
"@vitest/browser": "^4.1.
|
|
14
|
-
"@vitest/coverage-v8": "^4.1.
|
|
15
|
-
"effector": "^23.
|
|
16
|
-
"happy-dom": "^20.
|
|
17
|
-
"size-limit": "^12.
|
|
10
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
11
|
+
"@size-limit/preset-small-lib": "^12.1.0",
|
|
12
|
+
"@testing-library/dom": "^10.4.1",
|
|
13
|
+
"@vitest/browser": "^4.1.10",
|
|
14
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
15
|
+
"effector": "^23.4.4",
|
|
16
|
+
"happy-dom": "^20.11.1",
|
|
17
|
+
"size-limit": "^12.1.0",
|
|
18
18
|
"tslib": "^2.8.1",
|
|
19
|
-
"typedoc": "^0.28.
|
|
20
|
-
"typedoc-plugin-markdown": "^4.
|
|
21
|
-
"vite": "^8.0
|
|
22
|
-
"
|
|
23
|
-
"vitest": "^4.1.8"
|
|
19
|
+
"typedoc": "^0.28.20",
|
|
20
|
+
"typedoc-plugin-markdown": "^4.12.0",
|
|
21
|
+
"vite": "^8.2.0",
|
|
22
|
+
"vitest": "^4.1.10"
|
|
24
23
|
},
|
|
25
24
|
"exports": {
|
|
26
25
|
".": {
|
|
@@ -117,11 +116,11 @@
|
|
|
117
116
|
"eslint.config.js"
|
|
118
117
|
],
|
|
119
118
|
"ignoreBinaries": [
|
|
120
|
-
"
|
|
121
|
-
"jscpd",
|
|
119
|
+
"attw",
|
|
122
120
|
"eslint",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
121
|
+
"jscpd",
|
|
122
|
+
"knip",
|
|
123
|
+
"tsgo"
|
|
125
124
|
],
|
|
126
125
|
"exclude": [
|
|
127
126
|
"duplicates"
|
|
@@ -148,20 +147,20 @@
|
|
|
148
147
|
"main": "./dist/cjs/index.js",
|
|
149
148
|
"module": "./dist/esm/index.js",
|
|
150
149
|
"peerDependencies": {
|
|
151
|
-
"effector": "^23.
|
|
150
|
+
"effector": "^23.4.4"
|
|
152
151
|
},
|
|
153
152
|
"private": false,
|
|
154
153
|
"scripts": {
|
|
155
|
-
"build": "vite build && node scripts/copy-docs.js",
|
|
154
|
+
"build": "vite build && tsgo -p tsconfig.build.json && node scripts/copy-docs.js",
|
|
156
155
|
"build:docs": "pnpm typedoc",
|
|
157
156
|
"check": "pnpm type-check && pnpm lint && pnpm knip && pnpm jscpd",
|
|
158
|
-
"dev": "
|
|
157
|
+
"dev": "node ../../scripts/sdk-watch-build.mjs -- node scripts/copy-docs.js",
|
|
159
158
|
"jscpd": "jscpd src",
|
|
160
159
|
"knip": "knip",
|
|
161
|
-
"lint": "if [ \"$AGENT\" = \"true\" ]; then echo \"[AGENT HINT] Prefer running lint on specific files from the repo root: node scripts/lint-files.js <files>\"; fi && eslint .",
|
|
160
|
+
"lint": "if [ \"$AGENT\" = \"true\" ]; then echo \"[AGENT HINT] Prefer running lint on specific files from the repo root: node scripts/lint-files.js <files>\"; fi && eslint . --cache --cache-location node_modules/.cache/eslint",
|
|
162
161
|
"lint-files": "eslint",
|
|
163
162
|
"lint:format": "eslint . --fix",
|
|
164
|
-
"lint:report": "eslint . -o './.reports/eslint.json' -f json || [ -f './.reports/eslint.json' ]",
|
|
163
|
+
"lint:report": "eslint . --cache --cache-location node_modules/.cache/eslint -o './.reports/eslint.json' -f json || [ -f './.reports/eslint.json' ]",
|
|
165
164
|
"size": "size-limit",
|
|
166
165
|
"test": "vitest run",
|
|
167
166
|
"test:coverage": "../../scripts/vitest-coverage.sh",
|
package/dist/api-CPL40b7A.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//#region src/utils/client-headers.ts
|
|
2
|
-
var e = "Picked-Client", t = "Picked-Version";
|
|
3
|
-
function n(n, r) {
|
|
4
|
-
return {
|
|
5
|
-
[e]: n,
|
|
6
|
-
[t]: r
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/utils/version.ts
|
|
11
|
-
var r = () => "0.0.1-dev.1785305085063", i = "v1";
|
|
12
|
-
function a(e, t) {
|
|
13
|
-
return new URL(`/api/${i}/${t}`, e).toString();
|
|
14
|
-
}
|
|
15
|
-
function o(e) {
|
|
16
|
-
return {
|
|
17
|
-
...n("sdk", r()),
|
|
18
|
-
...e
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
async function s(e, t, n, r) {
|
|
22
|
-
let i = a(e, t);
|
|
23
|
-
return fetch(i, {
|
|
24
|
-
headers: o(n),
|
|
25
|
-
signal: r
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
async function c(e, t, n, r) {
|
|
29
|
-
let i = a(e, t);
|
|
30
|
-
return fetch(i, {
|
|
31
|
-
method: "POST",
|
|
32
|
-
headers: {
|
|
33
|
-
"Content-Type": "application/json",
|
|
34
|
-
...o(r)
|
|
35
|
-
},
|
|
36
|
-
body: JSON.stringify(n)
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
export { n as i, c as n, r, s as t };
|
package/dist/api-Dz5rgRgQ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`Picked-Client`,t=`Picked-Version`;function n(n,r){return{[e]:n,[t]:r}}var r=()=>`0.0.1-dev.1785305085063`,i=`v1`;function a(e,t){return new URL(`/api/${i}/${t}`,e).toString()}function o(e){return{...n(`sdk`,r()),...e}}async function s(e,t,n,r){let i=a(e,t);return fetch(i,{headers:o(n),signal:r})}async function c(e,t,n,r){let i=a(e,t);return fetch(i,{method:`POST`,headers:{"Content-Type":`application/json`,...o(r)},body:JSON.stringify(n)})}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
package/dist/docs/actions.mdx
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
import { Screenshot } from '../../components/Screenshot'
|
|
6
|
-
|
|
7
|
-
# Actions
|
|
8
|
-
|
|
9
|
-
An action is a side effect that triggers when the flow reaches it. Use actions for tasks like tracking events, sending data to external services, or triggering webhooks.
|
|
10
|
-
|
|
11
|
-
<Screenshot
|
|
12
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/actions"
|
|
13
|
-
alt="The actions list for a workspace on the Picked dashboard"
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
## Create an action
|
|
17
|
-
|
|
18
|
-
1. Open your project.
|
|
19
|
-
2. Click **Actions** in the sidebar.
|
|
20
|
-
3. Click **New Action**.
|
|
21
|
-
4. Enter a name and key.
|
|
22
|
-
5. Click **Create**.
|
|
23
|
-
|
|
24
|
-
The key is a unique identifier used in your application. It's set once and can't be changed later.
|
|
25
|
-
|
|
26
|
-
## Configure an action
|
|
27
|
-
|
|
28
|
-
**Name**: The display name shown in the dashboard. Not visible to visitors.
|
|
29
|
-
|
|
30
|
-
**Key**: The programmatic identifier your application uses to reference this action. Not visible to visitors.
|
|
31
|
-
|
|
32
|
-
## Register in your application
|
|
33
|
-
|
|
34
|
-
Actions must be registered when creating the Picked client. Pass an `actions` object where each key matches an action key from the dashboard:
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import { createClient } from '@picked/client'
|
|
38
|
-
|
|
39
|
-
const picked = createClient({
|
|
40
|
-
projectId: 'your-project-id',
|
|
41
|
-
actions: {
|
|
42
|
-
'track-signup': () => {
|
|
43
|
-
analytics.track('signup_completed')
|
|
44
|
-
},
|
|
45
|
-
'notify': (params) => {
|
|
46
|
-
sendNotification(params)
|
|
47
|
-
},
|
|
48
|
-
'check-eligibility': async () => {
|
|
49
|
-
const response = await fetch('/api/eligibility')
|
|
50
|
-
// Throw only when the request itself fails — that takes the failure branch.
|
|
51
|
-
if (!response.ok) throw new Error('Eligibility request failed')
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
})
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Each action is a function that receives optional parameters and usually runs a side effect. When the flow reaches an action node, the SDK calls the matching function and branches on whether it succeeds or throws — see [Success and failure branching](#success-and-failure-branching).
|
|
58
|
-
|
|
59
|
-
See [SDK Actions](/sdk/actions) for more details.
|
|
60
|
-
|
|
61
|
-
## Use actions in flows
|
|
62
|
-
|
|
63
|
-
In the flow builder, drag an action from the entity browser onto the canvas. Connect it to the point in the flow where you want it to trigger.
|
|
64
|
-
|
|
65
|
-
Actions execute when the flow reaches their node. They don't interrupt the visitor's experience — by default the flow continues to the next connected node.
|
|
66
|
-
|
|
67
|
-
### Success and failure branching
|
|
68
|
-
|
|
69
|
-
An action node can have two outgoing branches: **success** and **failure**. The SDK chooses the branch from the action's outcome:
|
|
70
|
-
|
|
71
|
-
- **Failure** — the action throws (or its promise rejects). The flow follows the failure branch.
|
|
72
|
-
- **Success** — the action resolves to any value: nothing, `true`, `false`, or a string. A returned `false` is a valid response, not a failure. The flow follows the success branch.
|
|
73
|
-
|
|
74
|
-
Reserve the failure branch for genuine errors — throw on the failure case, for example `if (!response.ok) throw new Error(...)`. A valid negative result is _not_ a failure: an API that returns `200` with, say, `{ serviced: false }` should record that value as a response and branch on it with a condition rather than throw. If an action node has only a single plain connection (no explicit success or failure branch), the flow continues through it on either outcome.
|
|
75
|
-
|
|
76
|
-
## Reuse actions
|
|
77
|
-
|
|
78
|
-
Actions are project-level entities. Use the same action in multiple experience flows. Changes to an action's configuration apply everywhere it's used.
|
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Authentication
|
|
6
|
-
|
|
7
|
-
The Picked API supports multiple authentication methods: email/password sessions, OAuth providers, magic links, and API keys. This guide covers each method and explains how to manage sessions and multi-factor authentication (MFA).
|
|
8
|
-
|
|
9
|
-
## Email and password login
|
|
10
|
-
|
|
11
|
-
The `sessionCreate` mutation authenticates a user with email and password and returns a session.
|
|
12
|
-
|
|
13
|
-
```graphql
|
|
14
|
-
mutation {
|
|
15
|
-
sessionCreate(input: {
|
|
16
|
-
email: "user@example.com"
|
|
17
|
-
password: "secure-password"
|
|
18
|
-
}) {
|
|
19
|
-
session {
|
|
20
|
-
accessToken
|
|
21
|
-
refreshToken
|
|
22
|
-
expiresAt
|
|
23
|
-
user {
|
|
24
|
-
id
|
|
25
|
-
email
|
|
26
|
-
}
|
|
27
|
-
aal
|
|
28
|
-
}
|
|
29
|
-
requiresMfa
|
|
30
|
-
mfaFactors {
|
|
31
|
-
id
|
|
32
|
-
factorType
|
|
33
|
-
status
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
If the user has MFA enabled, the response sets `requiresMfa` to `true` and returns the enrolled `mfaFactors`. The caller must complete an MFA challenge before receiving a fully authenticated session. See the [MFA](#multi-factor-authentication-mfa) section below.
|
|
40
|
-
|
|
41
|
-
If MFA is not enabled, the response includes a `session` with an `accessToken`, a `refreshToken`, and an `expiresAt` timestamp.
|
|
42
|
-
|
|
43
|
-
## Account creation
|
|
44
|
-
|
|
45
|
-
New accounts are created with the `accountCreate` mutation:
|
|
46
|
-
|
|
47
|
-
```graphql
|
|
48
|
-
mutation {
|
|
49
|
-
accountCreate(input: {
|
|
50
|
-
email: "newuser@example.com"
|
|
51
|
-
password: "secure-password"
|
|
52
|
-
metadata: { firstName: "Jane", lastName: "Doe" }
|
|
53
|
-
}) {
|
|
54
|
-
user {
|
|
55
|
-
id
|
|
56
|
-
email
|
|
57
|
-
}
|
|
58
|
-
session {
|
|
59
|
-
accessToken
|
|
60
|
-
refreshToken
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
The `metadata` field is optional and accepts arbitrary JSON for storing profile information. When email verification is required, the returned session is `null` until the email is verified.
|
|
67
|
-
|
|
68
|
-
## Email verification
|
|
69
|
-
|
|
70
|
-
After account creation, the user receives a verification email containing a token. The `accountVerifyEmail` mutation completes verification:
|
|
71
|
-
|
|
72
|
-
```graphql
|
|
73
|
-
mutation {
|
|
74
|
-
accountVerifyEmail(input: {
|
|
75
|
-
email: "newuser@example.com"
|
|
76
|
-
token: "verification-token-from-email"
|
|
77
|
-
}) {
|
|
78
|
-
session {
|
|
79
|
-
accessToken
|
|
80
|
-
refreshToken
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
If the verification email needs to be resent:
|
|
87
|
-
|
|
88
|
-
```graphql
|
|
89
|
-
mutation {
|
|
90
|
-
accountResendVerification(input: {
|
|
91
|
-
email: "newuser@example.com"
|
|
92
|
-
}) {
|
|
93
|
-
success
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## OAuth flow (Google)
|
|
99
|
-
|
|
100
|
-
The API supports Google as an OAuth provider. The flow has two steps.
|
|
101
|
-
|
|
102
|
-
### Step 1: Get the authorization URL
|
|
103
|
-
|
|
104
|
-
```graphql
|
|
105
|
-
mutation {
|
|
106
|
-
oauthAuthorize(input: {
|
|
107
|
-
provider: GOOGLE
|
|
108
|
-
redirectUrl: "https://app.example.com/auth/callback"
|
|
109
|
-
scopes: ["openid", "email", "profile"]
|
|
110
|
-
}) {
|
|
111
|
-
url
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
The caller redirects the user to the returned `url`. After the user authenticates with Google, they are redirected back to a URL on the same dashboard deployment with a `code` parameter, where the caller exchanges it for a session.
|
|
117
|
-
|
|
118
|
-
### Step 2: Exchange the code for a session
|
|
119
|
-
|
|
120
|
-
```graphql
|
|
121
|
-
mutation {
|
|
122
|
-
oauthCallback(input: {
|
|
123
|
-
provider: GOOGLE
|
|
124
|
-
code: "auth-code-from-google"
|
|
125
|
-
}) {
|
|
126
|
-
session {
|
|
127
|
-
accessToken
|
|
128
|
-
refreshToken
|
|
129
|
-
expiresAt
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Magic links
|
|
136
|
-
|
|
137
|
-
Magic links allow passwordless authentication via email.
|
|
138
|
-
|
|
139
|
-
### Send a magic link
|
|
140
|
-
|
|
141
|
-
```graphql
|
|
142
|
-
mutation {
|
|
143
|
-
magicLinkSend(input: {
|
|
144
|
-
email: "user@example.com"
|
|
145
|
-
redirectUrl: "https://app.example.com/auth/verify"
|
|
146
|
-
}) {
|
|
147
|
-
success
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
The user receives an email containing a link with a token.
|
|
153
|
-
|
|
154
|
-
### Verify the magic link
|
|
155
|
-
|
|
156
|
-
```graphql
|
|
157
|
-
mutation {
|
|
158
|
-
magicLinkVerify(input: {
|
|
159
|
-
email: "user@example.com"
|
|
160
|
-
token: "token-from-magic-link"
|
|
161
|
-
}) {
|
|
162
|
-
session {
|
|
163
|
-
accessToken
|
|
164
|
-
refreshToken
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## Password management
|
|
171
|
-
|
|
172
|
-
### Reset a forgotten password
|
|
173
|
-
|
|
174
|
-
Send a password reset email:
|
|
175
|
-
|
|
176
|
-
```graphql
|
|
177
|
-
mutation {
|
|
178
|
-
passwordResetSend(input: {
|
|
179
|
-
email: "user@example.com"
|
|
180
|
-
redirectUrl: "https://app.example.com/reset-password"
|
|
181
|
-
}) {
|
|
182
|
-
success
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Complete the reset with the token from the email:
|
|
188
|
-
|
|
189
|
-
```graphql
|
|
190
|
-
mutation {
|
|
191
|
-
passwordReset(input: {
|
|
192
|
-
email: "user@example.com"
|
|
193
|
-
token: "reset-token-from-email"
|
|
194
|
-
newPassword: "new-secure-password"
|
|
195
|
-
}) {
|
|
196
|
-
session {
|
|
197
|
-
accessToken
|
|
198
|
-
refreshToken
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Update an existing password
|
|
205
|
-
|
|
206
|
-
This mutation requires authentication:
|
|
207
|
-
|
|
208
|
-
```graphql
|
|
209
|
-
mutation {
|
|
210
|
-
passwordUpdate(input: {
|
|
211
|
-
currentPassword: "old-password"
|
|
212
|
-
newPassword: "new-secure-password"
|
|
213
|
-
}) {
|
|
214
|
-
success
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Multi-factor authentication (MFA)
|
|
220
|
-
|
|
221
|
-
MFA adds a second layer of security using phone-based verification. The API supports enrolling, challenging, verifying, and unenrolling MFA factors. All MFA mutations require authentication.
|
|
222
|
-
|
|
223
|
-
### Enroll a factor
|
|
224
|
-
|
|
225
|
-
```graphql
|
|
226
|
-
mutation {
|
|
227
|
-
mfaFactorEnroll(input: {
|
|
228
|
-
factorType: PHONE
|
|
229
|
-
phone: "+15551234567"
|
|
230
|
-
friendlyName: "My Phone"
|
|
231
|
-
}) {
|
|
232
|
-
factor {
|
|
233
|
-
id
|
|
234
|
-
factorType
|
|
235
|
-
status
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
A newly enrolled factor has a status of `UNVERIFIED` until confirmed via a challenge.
|
|
242
|
-
|
|
243
|
-
### Send a challenge
|
|
244
|
-
|
|
245
|
-
```graphql
|
|
246
|
-
mutation {
|
|
247
|
-
mfaChallengeSend(input: {
|
|
248
|
-
factorId: "factor-id"
|
|
249
|
-
}) {
|
|
250
|
-
challengeId
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
This sends a verification code to the enrolled phone number.
|
|
256
|
-
|
|
257
|
-
### Verify the challenge
|
|
258
|
-
|
|
259
|
-
```graphql
|
|
260
|
-
mutation {
|
|
261
|
-
mfaChallengeVerify(input: {
|
|
262
|
-
factorId: "factor-id"
|
|
263
|
-
challengeId: "challenge-id"
|
|
264
|
-
code: "123456"
|
|
265
|
-
}) {
|
|
266
|
-
session {
|
|
267
|
-
accessToken
|
|
268
|
-
refreshToken
|
|
269
|
-
aal
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
On success, the session is upgraded to Authenticator Assurance Level `AAL2`. The factor status changes to `VERIFIED`.
|
|
276
|
-
|
|
277
|
-
### Unenroll a factor
|
|
278
|
-
|
|
279
|
-
```graphql
|
|
280
|
-
mutation {
|
|
281
|
-
mfaFactorUnenroll(input: {
|
|
282
|
-
factorId: "factor-id"
|
|
283
|
-
}) {
|
|
284
|
-
success
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
## Using a session
|
|
290
|
-
|
|
291
|
-
After obtaining a session, the caller includes the access token in the `Authorization` header of every authenticated request:
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
Authorization: Bearer <accessToken>
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
The `expiresAt` field on the session indicates when the access token expires. The caller should refresh the session before the token expires.
|
|
298
|
-
|
|
299
|
-
### Authenticator assurance levels
|
|
300
|
-
|
|
301
|
-
The session includes an `aal` field indicating the authentication strength:
|
|
302
|
-
|
|
303
|
-
| Level | Meaning |
|
|
304
|
-
|-------|---------|
|
|
305
|
-
| `AAL1` | Single-factor authentication (email/password, OAuth, or magic link) |
|
|
306
|
-
| `AAL2` | Multi-factor authentication (MFA challenge completed) |
|
|
307
|
-
|
|
308
|
-
Some operations may require `AAL2`. If a caller with `AAL1` attempts such an operation, the API returns an authorization error.
|
|
309
|
-
|
|
310
|
-
## Session refresh
|
|
311
|
-
|
|
312
|
-
Access tokens are short-lived. The `sessionRefresh` mutation exchanges a refresh token for a new session:
|
|
313
|
-
|
|
314
|
-
```graphql
|
|
315
|
-
mutation {
|
|
316
|
-
sessionRefresh(input: {
|
|
317
|
-
refreshToken: "v1.refresh-token..."
|
|
318
|
-
}) {
|
|
319
|
-
session {
|
|
320
|
-
accessToken
|
|
321
|
-
refreshToken
|
|
322
|
-
expiresAt
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
The response includes a new `accessToken` and a new `refreshToken`. The previous refresh token is invalidated. This mutation does not require the `Authorization` header.
|
|
329
|
-
|
|
330
|
-
## API key authentication
|
|
331
|
-
|
|
332
|
-
API keys provide long-lived, scoped access to the API. They are typically used for server-to-server integrations and automated workflows.
|
|
333
|
-
|
|
334
|
-
To authenticate with an API key, include it in the `x-api-key` header:
|
|
335
|
-
|
|
336
|
-
```
|
|
337
|
-
x-api-key: pk_live_abc123...
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
API keys are scoped to an organization and optionally to a specific project. They carry a defined set of [authorization scopes](./authorization-and-scopes.md) that determine which operations the key can perform.
|
|
341
|
-
|
|
342
|
-
See [API Keys](/api-keys) for managing keys from the dashboard UI.
|
|
343
|
-
|
|
344
|
-
### Creating an API key
|
|
345
|
-
|
|
346
|
-
The `apiKeyCreate` mutation creates a new API key. This mutation is only available to session-authenticated users (not other API keys):
|
|
347
|
-
|
|
348
|
-
```graphql
|
|
349
|
-
mutation {
|
|
350
|
-
apiKeyCreate(input: {
|
|
351
|
-
organizationId: "org-id"
|
|
352
|
-
name: "CI/CD Pipeline Key"
|
|
353
|
-
projectId: "project-id"
|
|
354
|
-
scopes: [ORGANIZATION_READ, ORGANIZATION_PROJECTS_READ]
|
|
355
|
-
}) {
|
|
356
|
-
apiKey
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
The full API key string is returned only once in the response. Store it securely; it cannot be retrieved again.
|
|
362
|
-
|
|
363
|
-
The requested scopes must be a subset of the creating user's scopes. See [Authorization and Scopes](./authorization-and-scopes.md) for more details.
|
|
364
|
-
|
|
365
|
-
### Revoking an API key
|
|
366
|
-
|
|
367
|
-
```graphql
|
|
368
|
-
mutation {
|
|
369
|
-
apiKeyRevoke(input: {
|
|
370
|
-
keyId: "key-id"
|
|
371
|
-
organizationId: "org-id"
|
|
372
|
-
})
|
|
373
|
-
}
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
Revoked keys are immediately invalidated and cannot be used for further requests.
|