@picked/delivery-api-client 0.0.1-dev.1789541668638 → 0.0.1-dev.1793756239746
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/LICENSE +1 -0
- package/README.md +25 -15
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +165 -37
- package/dist/types/action-response.d.ts +71 -0
- package/dist/types/action-response.d.ts.map +1 -0
- package/dist/types/actions.d.ts +67 -0
- package/dist/types/actions.d.ts.map +1 -0
- package/dist/types/fetch-utils-internal.d.ts.map +1 -1
- package/dist/types/http.d.ts +17 -1
- package/dist/types/http.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/project-config.d.ts +27 -5
- package/dist/types/project-config.d.ts.map +1 -1
- package/dist/types/types.d.ts +7 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +9 -3
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright (c) Picked. All rights reserved. Contact Picked for a usage licence.
|
package/README.md
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
# @picked/delivery-api-client
|
|
2
2
|
|
|
3
|
-
Typed fetch
|
|
3
|
+
Typed fetch functions for the Picked Delivery API, which serves a project's published
|
|
4
|
+
configuration and content.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @picked/delivery-api-client
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
6
13
|
|
|
7
14
|
```typescript
|
|
8
|
-
import {
|
|
9
|
-
createClientHeaders,
|
|
10
|
-
fetchExperienceContent,
|
|
11
|
-
fetchProject,
|
|
12
|
-
fetchSchema,
|
|
13
|
-
} from '@picked/delivery-api-client'
|
|
15
|
+
import { fetchExperienceContent, fetchProject, fetchSchema } from '@picked/delivery-api-client'
|
|
14
16
|
|
|
15
17
|
const config = await fetchProject('https://api.picked.app', 'your-project-id')
|
|
16
18
|
const content = await fetchExperienceContent(
|
|
17
19
|
'https://api.picked.app',
|
|
18
20
|
'your-project-id',
|
|
19
|
-
'experience-id',
|
|
21
|
+
'your-experience-id',
|
|
20
22
|
)
|
|
21
23
|
const schema = await fetchSchema('https://api.picked.app', 'your-project-id')
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
| Function | Returns |
|
|
27
|
+
| ------------------------------------------------------------------- | ----------------------------------- |
|
|
28
|
+
| `fetchProject(apiUrl, projectId, options?)` | The published project configuration |
|
|
29
|
+
| `fetchExperienceContent(apiUrl, projectId, experienceId, options?)` | The content of one experience |
|
|
30
|
+
| `fetchSchema(apiUrl, projectId, options?)` | The workspace schema |
|
|
31
|
+
| `runAction(apiUrl, payload, options?)` | Starts a server-side action run |
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
Options take `previewToken` (read a workspace draft), `headers` and `signal`; the fetch
|
|
34
|
+
functions also take `onWarn`. A fetch function returns `null` on failure and reports the
|
|
35
|
+
reason to `onWarn`; `runAction` throws. Each request times out after 10 seconds.
|
|
27
36
|
|
|
28
|
-
|
|
37
|
+
## Docs
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
- **Web:** [Delivery API client](https://docs.picked.app/reference/tools/delivery-api-client)
|
|
40
|
+
- **Local:** `node_modules/picked/docs/reference/tools/delivery-api-client.md`. The `picked` package carries every page under `node_modules/picked/docs/`.
|
|
41
|
+
- **CLI:** `npx picked docs read /reference/tools/delivery-api-client`. `npx picked docs list [words]` lists the pages.
|
|
42
|
+
- **MCP:** call `read_picked_doc` with `{ "path": "/reference/tools/delivery-api-client" }`; `list_picked_docs` lists the pages. Add the server with `claude mcp add --transport http picked https://api.picked.app/mcp`, or see [How to connect the MCP server](https://docs.picked.app/how-to/connect-the-mcp-server) for other tools.
|