@picked/client 0.0.101-next.2 → 0.0.101-next.3
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 +34 -158
- package/dist/{api-AaQeg3Ij.cjs → api-9o_emCM5.cjs} +1 -1
- package/dist/{api-BlRFU0Fi.js → api-BbQt8aW3.js} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/server/index.js +2 -2
- package/dist/{plugin-CVD2TnRC.cjs → plugin-I8_6ncy_.cjs} +1 -1
- package/dist/{plugin-DhznDG-h.js → plugin-uZJ45vK6.js} +2 -2
- package/dist/{preview-unavailable-xWLCr93y.cjs → preview-unavailable-BUNxTYLe.cjs} +1 -1
- package/dist/{preview-unavailable-mW4Pj3Ph.js → preview-unavailable-BYFD2a58.js} +1 -1
- package/dist/{provider-zag5m5GH.cjs → provider-Bzi_Kb-n.cjs} +1 -1
- package/dist/{provider-COb_V-yq.js → provider-CQKp0iUJ.js} +1 -1
- package/package.json +5 -5
- 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 -101
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -47
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -59
- 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 -93
- package/dist/docs/how-to/call-an-external-api-from-a-workflow.md +0 -102
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -46
- 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 -35
- 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 -85
- package/dist/docs/how-to/register-an-api-that-uses-oauth2.md +0 -107
- 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/retry-a-failed-call-with-a-loop.md +0 -81
- 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 -113
- 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/wait-for-an-action-response.md +0 -182
- 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 -56
- 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/external-apis.md +0 -169
- 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/labels.md +0 -321
- package/dist/docs/reference/dashboard/lead-search.md +0 -224
- 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/workflow-runs.md +0 -142
- package/dist/docs/reference/dashboard/workflow-templates.md +0 -182
- package/dist/docs/reference/dashboard/workflow-test-runs.md +0 -77
- 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 -107
- package/dist/docs/reference/glossary.md +0 -201
- package/dist/docs/reference/management-api/authentication.md +0 -87
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -291
- package/dist/docs/reference/management-api/error-handling.md +0 -232
- 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 -154
- package/dist/docs/reference/sdk/analytics-events.md +0 -453
- 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 -253
- 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 -113
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -265
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -292
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -136
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -235
- 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
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# CLI
|
|
7
|
-
|
|
8
|
-
`picked` is the command-line tool for local Picked development. It generates TypeScript
|
|
9
|
-
types from your workspace schema and lets you switch which project or workspace your local
|
|
10
|
-
tooling loads — without hand-editing `picked.config.ts`. It also copies the content of a
|
|
11
|
-
workspace from one project to a different project.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
The [`picked`](/reference/sdk) package holds this command, the client, and the
|
|
16
|
-
`picked.config` helpers:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install picked
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The command reads `picked.config.ts` from the current directory, so run it from your
|
|
23
|
-
project root. See [How to authenticate the CLI](/how-to/authenticate-the-cli) to sign in.
|
|
24
|
-
|
|
25
|
-
`@picked/cli` holds the command on its own, for a project that wants no other part of the
|
|
26
|
-
package.
|
|
27
|
-
|
|
28
|
-
## Commands
|
|
29
|
-
|
|
30
|
-
| Command | Description |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| `picked login` | Sign in with your browser (OAuth) to the API origin of the current directory. Stores a session under `~/.picked/auth/`. |
|
|
33
|
-
| `picked logout` | Clear the stored session for the current directory's API origin. |
|
|
34
|
-
| `picked whoami` | Print the identity signed in to the API origin of the current directory. |
|
|
35
|
-
| `picked status` | Print the resolved selection and the committed `picked.config` default. |
|
|
36
|
-
| `picked workspace list` | List each org, project, and workspace that you can read. Alias `ls`. `--json` gives machine output. |
|
|
37
|
-
| `picked workspace use` | Set the active project or workspace. Alias `picked use`. Interactive, or `--project` and `--workspace`. |
|
|
38
|
-
| `picked workspace export` | Write a workspace, or the published version of a project, to a bundle directory. |
|
|
39
|
-
| `picked workspace import` | Create a new draft workspace in a project from a bundle directory. `--publish` also publishes it. |
|
|
40
|
-
| `picked generate types` | Read the workspace schema and write `picked-env.d.ts`. `--check` verifies and writes nothing. |
|
|
41
|
-
|
|
42
|
-
### `picked generate types`
|
|
43
|
-
|
|
44
|
-
Writes the typed schema declaration. See [Type generation](/reference/sdk/type-generation)
|
|
45
|
-
for the `picked.config.ts` reference and the generated output.
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
picked generate types
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
In CI, `--check` writes nothing and fails when the committed types are stale:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
picked generate types --check
|
|
55
|
-
# → "Types are up to date (`…/src/picked-env.d.ts`)." (status 0)
|
|
56
|
-
# → "Types are out of date: `…/src/picked-env.d.ts`" (status 1)
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### `picked workspace list`
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
picked workspace list
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
Acme Corp. (acme-corporation)
|
|
67
|
-
Storefront [proj_a1b2]
|
|
68
|
-
Default Storefront [LIVE] (live)
|
|
69
|
-
Checkout rework [DRAFT]
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
`--json` gives a machine-readable tree. Each prompt and heading goes to `stderr`, so the
|
|
73
|
-
`stdout` of `--json` stays clean when you send it to another command.
|
|
74
|
-
|
|
75
|
-
### `picked workspace use`
|
|
76
|
-
|
|
77
|
-
Sets the active selection, then regenerates types. See
|
|
78
|
-
[How to switch workspaces](/how-to/switch-workspaces) for the full set of steps.
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
picked workspace use # interactive picker
|
|
82
|
-
picked workspace use --project proj_a1b2 # the project's published (live) version
|
|
83
|
-
picked workspace use --project proj_a1b2 --workspace ws_id # preview a specific workspace via its token
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
Active workspace: Checkout rework [DRAFT] in project proj_a1b2 (source: preview)
|
|
88
|
-
Generated types at /app/src/picked-env.d.ts
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
`--no-generate` sets the selection and leaves the types as they are.
|
|
92
|
-
|
|
93
|
-
:::warning
|
|
94
|
-
`picked workspace use` regenerates types by default. Types that no longer match the
|
|
95
|
-
workspace give no error, and a developer can fail to see the problem for a long time. Use
|
|
96
|
-
`--no-generate` only when you regenerate the types yourself.
|
|
97
|
-
:::
|
|
98
|
-
|
|
99
|
-
### `picked workspace export`
|
|
100
|
-
|
|
101
|
-
Writes one workspace of a project to a bundle directory. The bundle holds every part of the
|
|
102
|
-
workspace: features, steps, fields, actions, conditions, experiences, workflows, page
|
|
103
|
-
layouts, sections, and content entries. It also holds a copy of each asset that the content
|
|
104
|
-
entries use.
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
picked workspace export --project proj_a1b2 --live --out ./bundle
|
|
108
|
-
picked workspace export --project proj_a1b2 --workspace ws_id --out ./bundle
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
Exported workspace "Snapshot of Default Storefront" with 12 assets to /app/bundle
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
| Flag | Description |
|
|
116
|
-
| --- | --- |
|
|
117
|
-
| `--project <id>` | The project that holds the workspace. Required. |
|
|
118
|
-
| `--live` | Write the version that the project serves now. The bundle does not include draft changes that you made after you published that version. |
|
|
119
|
-
| `--workspace <id>` | Write this workspace, with its draft changes. The command stops with status 1 when you use `--live` and `--workspace` together. |
|
|
120
|
-
| `--out <dir>` | The bundle directory. It must be in the current directory, and be empty or not exist. Required. |
|
|
121
|
-
|
|
122
|
-
The command stops with status 1 when:
|
|
123
|
-
|
|
124
|
-
- `--live` is used and the project has no published version.
|
|
125
|
-
- The workspace is not in `--project`.
|
|
126
|
-
- The API rejects the request. The message shows the error code and one line for each
|
|
127
|
-
problem.
|
|
128
|
-
- The size of a downloaded asset, or its `sha256` hash, is different from the value in the
|
|
129
|
-
bundle manifest.
|
|
130
|
-
|
|
131
|
-
The error code `UNRESOLVED_REFERENCE` shows that a part of the workspace refers to a part that
|
|
132
|
-
the workspace does not have. For example, a content entry uses a deleted section, a flow
|
|
133
|
-
goes to a deleted experience, or a workflow starts from a deleted action. Each line names the
|
|
134
|
-
part, its key or name if it has one, the location of the reference in the part, and the
|
|
135
|
-
missing id:
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
Export of workspace ws_id failed:
|
|
139
|
-
UNRESOLVED_REFERENCE: Cannot export experience 'exp_1' (key 'home'): flow node references experience 'exp_gone', which does not belong to the workspace, at flow_json.nodes.1.targetExperienceId (workspaceId)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Remove or change each reference, then run the command again.
|
|
143
|
-
|
|
144
|
-
The credential needs the `organization_workspace/read` scope on the project. With `--live`,
|
|
145
|
-
it also needs the `organization_projects/read` scope.
|
|
146
|
-
|
|
147
|
-
#### Bundle directory
|
|
148
|
-
|
|
149
|
-
| Path | Contents |
|
|
150
|
-
| --- | --- |
|
|
151
|
-
| `bundle.json` | The workspace. `formatVersion` is `1`. `assets` lists each asset version with its `fileName`, `mimeType`, `sizeBytes`, and `sha256` hash. |
|
|
152
|
-
| `assets/<sha256>` | The bytes of one asset. The file name is the `sha256` hash of the bytes, in lowercase. |
|
|
153
|
-
|
|
154
|
-
The command writes the bundle into a temporary directory next to `--out`, and writes
|
|
155
|
-
`bundle.json` last. When the bundle is complete, the command moves it to `--out`. When the
|
|
156
|
-
command fails, it removes the temporary directory, and you can run the same command again.
|
|
157
|
-
|
|
158
|
-
Each request body and response body of the Picked API can be at most 4.5 MB. For a very
|
|
159
|
-
large workspace, `picked workspace export` and `picked workspace import` fail when its
|
|
160
|
-
`bundle.json` is larger than this limit. Asset files do not count, because the command
|
|
161
|
-
downloads and uploads them directly.
|
|
162
|
-
|
|
163
|
-
### `picked workspace import`
|
|
164
|
-
|
|
165
|
-
Creates a new draft workspace in a project from a bundle directory, then prints the id of
|
|
166
|
-
the new workspace. The command does not change the other workspaces of the project. It
|
|
167
|
-
changes the published version only when you use `--publish`.
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
picked workspace import --project proj_c3d4 --in ./bundle --name "Copy of storefront" --publish
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
```
|
|
174
|
-
Imported workspace "Copy of storefront" as ws_new into project proj_c3d4 (assets: 12 uploaded, 0 already in the project).
|
|
175
|
-
Published workspace ws_new.
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
| Flag | Description |
|
|
179
|
-
| --- | --- |
|
|
180
|
-
| `--project <id>` | The project to import into. It can be in a different organization or a different API deployment. Required. |
|
|
181
|
-
| `--in <dir>` | The bundle directory that `picked workspace export` wrote. It must be in the current directory. Required. |
|
|
182
|
-
| `--name <name>` | The name of the new workspace. The default is the workspace name in the bundle. |
|
|
183
|
-
| `--publish` | Publish the new workspace after the command creates it. |
|
|
184
|
-
|
|
185
|
-
The command sends the `sha256` hash of each asset to the API before it uploads the asset.
|
|
186
|
-
When the project already has an asset with the same bytes, the new workspace uses that
|
|
187
|
-
asset. The command does not upload the bytes again. When you import the same bundle into
|
|
188
|
-
the same project two times, the second command uploads no assets. Each command creates a
|
|
189
|
-
new workspace.
|
|
190
|
-
|
|
191
|
-
Every part of the workspace gets a new id in the target project. The key of an experience
|
|
192
|
-
does not change. The nodes of a workflow keep their ids, and a workflow that starts from an
|
|
193
|
-
action starts from the new copy of that action.
|
|
194
|
-
|
|
195
|
-
The API calculates the scopes of each workflow from the tools that the workflow uses. For
|
|
196
|
-
each tool scope that a workflow does not get by default, the credential must have that
|
|
197
|
-
scope. If it does not, the API rejects the bundle with the error code
|
|
198
|
-
`WORKFLOW_SCOPES_NOT_HELD`, and the message names the workflow, the tool and the scope.
|
|
199
|
-
|
|
200
|
-
The command stops with status 1 when:
|
|
201
|
-
|
|
202
|
-
- An asset file does not exist, or its size or `sha256` hash is different from the bundle
|
|
203
|
-
manifest. The command makes no API request in this case.
|
|
204
|
-
- An asset upload fails.
|
|
205
|
-
- The API rejects the bundle. The message shows the error code, for example
|
|
206
|
-
`UNSUPPORTED_FORMAT_VERSION`, `UNRESOLVED_REFERENCE` or `WORKFLOW_SCOPES_NOT_HELD`.
|
|
207
|
-
- The API rejects the import request with a GraphQL error, for example because the
|
|
208
|
-
credential does not have the necessary scopes.
|
|
209
|
-
- The import request fails on the API with a different GraphQL error, for example
|
|
210
|
-
`INFRASTRUCTURE_ERROR`.
|
|
211
|
-
- The import request gets no GraphQL answer from the API, for example because of a network
|
|
212
|
-
failure, a timeout or an HTTP error. The import request has a longer timeout than the
|
|
213
|
-
other requests.
|
|
214
|
-
- `--publish` is used and the API does not publish the workspace. The message shows the id
|
|
215
|
-
of the new draft workspace.
|
|
216
|
-
|
|
217
|
-
When the API rejects the import request, the GraphQL error code is `FORBIDDEN`,
|
|
218
|
-
`UNAUTHENTICATED`, `BAD_USER_INPUT` or `GRAPHQL_VALIDATION_FAILED`. When an asset upload
|
|
219
|
-
fails or the API rejects the bundle or the import request, the API does not create a
|
|
220
|
-
workspace. The command deletes the assets that it uploaded, and the message names them.
|
|
221
|
-
Assets that were already in the project stay.
|
|
222
|
-
|
|
223
|
-
When the import request fails with a different GraphQL error or gets no GraphQL answer,
|
|
224
|
-
the new workspace can exist in the project. The command keeps the assets that it uploaded,
|
|
225
|
-
and the message names them. When the project has no new workspace, no workspace uses these
|
|
226
|
-
assets.
|
|
227
|
-
|
|
228
|
-
The credential needs the `organization_projects/read`, `organization_projects/update` and
|
|
229
|
-
`organization_workspace/update` scopes on the project. For a bundle with workflows, it also
|
|
230
|
-
needs the scopes of their tools, as described above.
|
|
231
|
-
|
|
232
|
-
## Authentication
|
|
233
|
-
|
|
234
|
-
`picked login` signs in through the browser. It uses an authorization-code flow with PKCE
|
|
235
|
-
against the Picked OAuth server. `picked whoami` prints the identity for the current origin.
|
|
236
|
-
`picked logout` clears it.
|
|
237
|
-
|
|
238
|
-
The CLI holds one auth config file for each API origin, outside each repository. Every
|
|
239
|
-
command reads and writes only the origin that the current directory resolves to, and never
|
|
240
|
-
a session for another API.
|
|
241
|
-
|
|
242
|
-
| File | Contents |
|
|
243
|
-
| --- | --- |
|
|
244
|
-
| `~/.picked/auth/<origin>.json` | The OAuth session for one API origin — access token, refresh token, expiry — with the CLI's registered client id for that origin. File mode `600`. Refreshed as it nears expiry. |
|
|
245
|
-
|
|
246
|
-
An API deployment with no OAuth client registration rejects `picked login`, and has no
|
|
247
|
-
other flow.
|
|
248
|
-
|
|
249
|
-
A CLI session is a developer credential. It is not
|
|
250
|
-
[dashboard sign-in](/reference/management-api/authentication).
|
|
251
|
-
|
|
252
|
-
### API key
|
|
253
|
-
|
|
254
|
-
When `PICKED_API_KEY` is set, each command that calls the API sends the key in the
|
|
255
|
-
`X-API-Key` header. The CLI does not read the stored session. An
|
|
256
|
-
[API key](/reference/dashboard/api-keys) lets a run that has no browser, for example a CI
|
|
257
|
-
job, call the API. An API key for one project can read and write only that project.
|
|
258
|
-
|
|
259
|
-
An API key does not identify a user. When `PICKED_API_KEY` is set, `picked login`,
|
|
260
|
-
`picked whoami`, and `picked workspace list` stop with status 1.
|
|
261
|
-
|
|
262
|
-
## Environment variables
|
|
263
|
-
|
|
264
|
-
| Variable | Effect |
|
|
265
|
-
| --- | --- |
|
|
266
|
-
| `PICKED_API_URL` | The API origin that the CLI reads. Supersedes `picked.config` `apiUrl` and the `https://api.picked.app` default. |
|
|
267
|
-
| `PICKED_API_KEY` | An API key. When set, the CLI sends it as `X-API-Key` in place of the stored session. |
|
|
268
|
-
| `PICKED_PROJECT_ID` | Supersedes the resolved project id, above the active selection and the committed configuration. |
|
|
269
|
-
| `PICKED_PREVIEW_TOKEN` | Supersedes the preview token. Applies only when the resolved source is `preview`. |
|
|
270
|
-
|
|
271
|
-
### How the selection resolves
|
|
272
|
-
|
|
273
|
-
Tooling — `picked generate types` and the
|
|
274
|
-
[Vite plugin](/reference/tools/vite-plugin) — resolves the configuration in this order. Each
|
|
275
|
-
layer supersedes the layer before it:
|
|
276
|
-
|
|
277
|
-
1. **`picked.config.ts`** — the committed default: `projectId`, `source`, and
|
|
278
|
-
`previewToken`.
|
|
279
|
-
2. **`.picked/settings.json`** — the per-developer active selection that
|
|
280
|
-
`picked workspace use` writes. It supersedes `projectId` and `source`, and Git ignores it.
|
|
281
|
-
3. **Environment variables** — `PICKED_PROJECT_ID` and `PICKED_PREVIEW_TOKEN` supersede
|
|
282
|
-
both, for a CI or headless run.
|
|
283
|
-
|
|
284
|
-
`picked status` prints the resolved result.
|
|
285
|
-
|
|
286
|
-
## Related
|
|
287
|
-
|
|
288
|
-
- [How to authenticate the CLI](/how-to/authenticate-the-cli) — install and sign in.
|
|
289
|
-
- [How to switch workspaces](/how-to/switch-workspaces) — the draft-preview workflow.
|
|
290
|
-
- [Type generation](/reference/sdk/type-generation) — `picked.config.ts` and the generated types.
|
|
291
|
-
- [Vite plugin](/reference/tools/vite-plugin) — reads the same selection in development and in a build.
|
|
292
|
-
- [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling) — how a preview token behaves.
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Image optimisation service
|
|
7
|
-
|
|
8
|
-
The Picked service for image optimisation is a hosted endpoint at
|
|
9
|
-
`https://img.picked-content.com`. It reads an image from an allowed source domain and
|
|
10
|
-
resizes it. It then encodes the image again to a modern format, WebP or AVIF, and
|
|
11
|
-
caches the result.
|
|
12
|
-
|
|
13
|
-
## Endpoint
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
GET https://img.picked-content.com/_next/image?url={source}&w={width}&q={quality}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
| Parameter | Description |
|
|
20
|
-
|-----------|-------------|
|
|
21
|
-
| `url` | The URL of the source image, URL-encoded. It must point at an allowed source domain. See below. |
|
|
22
|
-
| `w` | The width in pixels. It must be one of the supported widths. |
|
|
23
|
-
| `q` | The quality: `25`, `50`, `75`, or `100`. |
|
|
24
|
-
|
|
25
|
-
The service chooses the response format. When the browser advertises `image/avif` or
|
|
26
|
-
`image/webp` in its `Accept` header, the response uses that format. If it does not,
|
|
27
|
-
the response uses the source format.
|
|
28
|
-
|
|
29
|
-
## Allowed source domains
|
|
30
|
-
|
|
31
|
-
The service reads only from these hostnames:
|
|
32
|
-
|
|
33
|
-
- `**.picked.app`
|
|
34
|
-
|
|
35
|
-
A request with a `url` parameter for any other hostname returns `400 Bad Request`.
|
|
36
|
-
|
|
37
|
-
## Supported widths
|
|
38
|
-
|
|
39
|
-
Device sizes, for a responsive image that spans the width of the viewport:
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
640, 750, 828, 1080, 1200, 1920, 2048, 3840
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Image sizes, for a UI element of fixed size such as an icon, an avatar, or a
|
|
46
|
-
thumbnail:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
16, 32, 48, 64, 96, 128, 256, 384
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
A request with any other width returns `400 Bad Request`. Choose the smallest width
|
|
53
|
-
that covers the size you render at the device pixel ratio of the visitor.
|
|
54
|
-
|
|
55
|
-
## Supported qualities
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
25, 50, 75, 100
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
A lower value reduces the bandwidth by a large amount. `75` is a good default for
|
|
62
|
-
most images. Use `25` or `50` for a thumbnail on a slow network.
|
|
63
|
-
|
|
64
|
-
## Responsive images
|
|
65
|
-
|
|
66
|
-
Use the endpoint together with the standard `srcset` attribute. The browser then
|
|
67
|
-
picks the correct width for each viewport:
|
|
68
|
-
|
|
69
|
-
```html
|
|
70
|
-
<img
|
|
71
|
-
src="https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=1080&q=75"
|
|
72
|
-
srcset="
|
|
73
|
-
https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=640&q=75 640w,
|
|
74
|
-
https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=1080&q=75 1080w,
|
|
75
|
-
https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=1920&q=75 1920w
|
|
76
|
-
"
|
|
77
|
-
sizes="(max-width: 768px) 100vw, 720px"
|
|
78
|
-
alt="..."
|
|
79
|
-
/>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Cache
|
|
83
|
-
|
|
84
|
-
The upstream CDN caches each optimised response. The smallest cache TTL is 60
|
|
85
|
-
seconds. The real lifetime depends on the eviction policy of the CDN. When you change
|
|
86
|
-
the source image at the same URL, the optimised copy stays in the cache for at least
|
|
87
|
-
that time.
|
|
88
|
-
|
|
89
|
-
## Security
|
|
90
|
-
|
|
91
|
-
- The service does not optimise an SVG source. A request for an SVG returns the
|
|
92
|
-
original bytes when the source is allowed. The service never runs an embedded
|
|
93
|
-
script.
|
|
94
|
-
- Each optimised response carries a strict `Content-Security-Policy`
|
|
95
|
-
(`default-src *; script-src 'none'; sandbox;`). A compromised source therefore
|
|
96
|
-
cannot run a script in the browser that shows the image.
|
|
97
|
-
- The response uses `Content-Disposition: inline`, and never `attachment`.
|
|
98
|
-
|
|
99
|
-
## Related
|
|
100
|
-
|
|
101
|
-
- [Asset library](/reference/dashboard/content/asset-library) — where the images come
|
|
102
|
-
from.
|
|
103
|
-
- [Content Security Policy](/reference/sdk/content-security-policy) — the `img-src`
|
|
104
|
-
entry this service needs.
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# MCP server
|
|
7
|
-
|
|
8
|
-
Control your Picked workspace from an AI tool that writes code, with the Model
|
|
9
|
-
Context Protocol (MCP).
|
|
10
|
-
|
|
11
|
-
## Tools
|
|
12
|
-
|
|
13
|
-
### Discovery
|
|
14
|
-
|
|
15
|
-
| Tool | Description |
|
|
16
|
-
| ------------------------ | -------------------------------------------------------------- |
|
|
17
|
-
| `list_projects` | Lists your organizations and projects |
|
|
18
|
-
| `list_workspaces` | Lists the workspaces in a project |
|
|
19
|
-
| `get_workspace_overview` | Reads the live version and the workspace draft |
|
|
20
|
-
| `get_schema_info` | Reads the documentation for Picked concepts and the data model |
|
|
21
|
-
| `list_picked_docs` | Lists every Picked documentation page with its URL |
|
|
22
|
-
| `read_picked_doc` | Reads one documentation page, or one section of it |
|
|
23
|
-
|
|
24
|
-
### Experiences
|
|
25
|
-
|
|
26
|
-
| Tool | Description |
|
|
27
|
-
| ------------------------ | -------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| `create_experience` | Creates an experience |
|
|
29
|
-
| `get_experience` | Reads an experience, with its flow graph |
|
|
30
|
-
| `list_experiences` | Lists your experiences |
|
|
31
|
-
| `update_experience_flow` | Creates, updates, or deletes steps, conditions, actions, fields, nodes, and edges as one operation |
|
|
32
|
-
|
|
33
|
-
### Steps, fields, conditions, and actions
|
|
34
|
-
|
|
35
|
-
| Tool | Description |
|
|
36
|
-
| ----------------------------------- | ---------------------------------------------------------------- |
|
|
37
|
-
| `get_step` / `list_steps` | Read steps |
|
|
38
|
-
| `update_step` | Renames a step, or binds it to the content entry that it renders |
|
|
39
|
-
| `get_field` / `list_fields` | Read fields |
|
|
40
|
-
| `get_condition` / `list_conditions` | Read conditions |
|
|
41
|
-
| `get_action` / `list_actions` | Read actions |
|
|
42
|
-
|
|
43
|
-
### Feature flags
|
|
44
|
-
|
|
45
|
-
| Tool | Description |
|
|
46
|
-
| ---------------- | ----------------------------------------------- |
|
|
47
|
-
| `create_feature` | Creates a feature flag |
|
|
48
|
-
| `get_feature` | Reads a feature flag |
|
|
49
|
-
| `list_features` | Lists your feature flags |
|
|
50
|
-
| `update_feature` | Updates the name, description, state, or weight |
|
|
51
|
-
|
|
52
|
-
### Workflows
|
|
53
|
-
|
|
54
|
-
A workflow runs a graph of nodes when its trigger occurs. The trigger is a domain
|
|
55
|
-
event or one action.
|
|
56
|
-
|
|
57
|
-
| Tool | Description |
|
|
58
|
-
| ------------------------- | ------------------------------------------------------------------------------------- |
|
|
59
|
-
| `list_workflows` | Lists the workflows in a workspace, with search and sort |
|
|
60
|
-
| `get_workflow` | Reads a workflow, with its trigger, graph, warnings, and the paths that its nodes use |
|
|
61
|
-
| `list_workflow_tools` | Lists the tools that a tool node can run, with the arguments of each tool |
|
|
62
|
-
| `create_workflow` | Creates a workflow with its trigger. You cannot change the trigger after this step |
|
|
63
|
-
| `update_workflow` | Renames a workflow, and sets its visit cap |
|
|
64
|
-
| `update_workflow_graph` | Creates, updates, or deletes nodes and edges as one operation |
|
|
65
|
-
| `guide_delete_workflow` | Gives the link to the workflow in the dashboard, where you delete it |
|
|
66
|
-
| `list_workflow_runs` | Lists the runs of a workflow, with the newest run first |
|
|
67
|
-
| `get_workflow_run` | Reads the status of a run and the reason for a failure |
|
|
68
|
-
| `list_workflow_run_tasks` | Lists the nodes that a run started, and the leads and labels that each node changed |
|
|
69
|
-
| `test_run_workflow` | Runs the draft of a workflow one time as a test, and shows what each node did |
|
|
70
|
-
|
|
71
|
-
If `update_workflow_graph` refuses a change, it saves nothing. The result names each
|
|
72
|
-
node or edge that has a problem. If the origin node does not connect to a node, the
|
|
73
|
-
change is saved, and the result gives a warning for that node.
|
|
74
|
-
|
|
75
|
-
A workflow run uses the published version of the workflow. Publish the workspace to
|
|
76
|
-
apply a change.
|
|
77
|
-
|
|
78
|
-
`test_run_workflow` runs the draft, so you can test a change before you publish it. Give
|
|
79
|
-
the `responses` of the action, or the `entity_id` of the event. The result shows the
|
|
80
|
-
input, the output, the status, and the branch of each node.
|
|
81
|
-
|
|
82
|
-
A tool that reads, such as `search_leads` or an `http` `GET`, runs. A tool that writes
|
|
83
|
-
does not run: the result shows what it would send. A wait node does not wait. The test
|
|
84
|
-
run saves nothing. You must have each scope that the workflow uses.
|
|
85
|
-
|
|
86
|
-
### Analytics
|
|
87
|
-
|
|
88
|
-
| Tool | Description |
|
|
89
|
-
| ---------------- | --------------------------------------------------------------- |
|
|
90
|
-
| `query_pickedql` | Runs a PickedQL analytics query and returns the rows as a table |
|
|
91
|
-
|
|
92
|
-
Call `get_schema_info` with the topic `pickedql` to see the tables, the virtual
|
|
93
|
-
functions, and the dimension columns before you write a query.
|
|
94
|
-
|
|
95
|
-
### Publish
|
|
96
|
-
|
|
97
|
-
| Tool | Description |
|
|
98
|
-
| ---------------------------- | ---------------------------------------------------------------------- |
|
|
99
|
-
| `get_preview_url` | Makes a preview URL for your unpublished work |
|
|
100
|
-
| `guide_publish_workspace` | Gives the link to publish the workspace in the dashboard |
|
|
101
|
-
| `list_workspace_versions` | Lists the published versions of a project, and shows the live one |
|
|
102
|
-
| `compare_workspace_versions` | Shows the differences between the live version, a version, and a draft |
|
|
103
|
-
|
|
104
|
-
The `list_*` and `get_*` tools read the workspace draft. The draft can be
|
|
105
|
-
different from the live version that visitors see. Use
|
|
106
|
-
`compare_workspace_versions` to see what is live and what changes when you publish.
|
|
107
|
-
|
|
108
|
-
## Example prompts
|
|
109
|
-
|
|
110
|
-
- "List my Picked projects and show me the options on each one"
|
|
111
|
-
- "Create a feature flag called 'new-checkout' at 50% traffic"
|
|
112
|
-
- "Create an experience with a step that collects an email address"
|
|
113
|
-
- "Show me control and variant users by the device type for the last 30 days"
|
|
114
|
-
- "Make a preview URL for my workspace on `https://example.com`"
|
|
115
|
-
- "Create a workflow that adds the label `plan.pro` to each lead from the sign-up action"
|
|
116
|
-
- "Show me why the last run of my workflow failed"
|
|
117
|
-
- "Test my sign-up workflow with the email `a@example.com` and show me what each node does"
|
|
118
|
-
|
|
119
|
-
## Tips
|
|
120
|
-
|
|
121
|
-
- Ask your agent for a list of your projects first. Then ask it to read your
|
|
122
|
-
workspace and report the options on each record.
|
|
123
|
-
- For a large experience, ask your agent about flow graphs and JSON Logic. The agent
|
|
124
|
-
can read the documentation for you.
|
|
125
|
-
- An update to an experience flow is atomic. Your agent can create steps, fields,
|
|
126
|
-
nodes, and edges in one operation.
|
|
127
|
-
- See a preview of your work on your site before you publish, to check that each page
|
|
128
|
-
is correct.
|
|
129
|
-
- The `create_workflow` prompt tells your agent how to build a workflow. The resource
|
|
130
|
-
`picked://workflow/{workflowId}/graph` gives the graph of a workflow as JSON.
|
|
131
|
-
- Ask your agent to run a PickedQL query on your analytics data. The agent can read
|
|
132
|
-
the schema, write the SQL, and explain the rows.
|
|
133
|
-
|
|
134
|
-
## Related
|
|
135
|
-
|
|
136
|
-
- [How to connect the MCP server](/how-to/connect-the-mcp-server)
|