@nohead/sdk 0.4.0 → 0.6.0
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/CHANGELOG.md +56 -0
- package/README.md +63 -21
- package/dist/client.d.ts +2 -1
- package/dist/client.js +3 -1
- package/dist/core.d.ts +4 -1
- package/dist/generated/operations.gen.d.ts +24 -16
- package/dist/generated/operations.gen.js +3 -2
- package/dist/generated/schemas.gen.d.ts +1 -1
- package/dist/generated/types.gen.d.ts +188 -81
- package/dist/images.d.ts +75 -0
- package/dist/images.js +113 -0
- package/dist/resources/assets.d.ts +11 -6
- package/dist/resources/assets.js +19 -7
- package/dist/resources/drafts.d.ts +3 -4
- package/dist/resources/drafts.js +4 -15
- package/dist/resources/records.d.ts +14 -3
- package/dist/resources/records.js +15 -2
- package/dist/resources/schema.d.ts +10 -9
- package/dist/resources/schema.js +4 -4
- package/dist/types.d.ts +12 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,62 @@ Changes to `@nohead/sdk` that you can notice. Versions follow
|
|
|
5
5
|
releases; a change that could break your code is a major one. Each release's
|
|
6
6
|
section is its GitHub release's notes.
|
|
7
7
|
|
|
8
|
+
## 0.6.0
|
|
9
|
+
|
|
10
|
+
- API keys now start `nohead_sk_`, or `nohead_pk_` for published-only keys;
|
|
11
|
+
keys in the old `sk_live_` format no longer work. The SDK sends whatever key
|
|
12
|
+
it's given, so only the docs and examples change.
|
|
13
|
+
|
|
14
|
+
- `assets.update(asset, { filename?, alt? })` renames an asset and sets its
|
|
15
|
+
alt text (`PATCH /v1/assets/{asset_id}`). `Asset` has `alt` (a string or
|
|
16
|
+
`null`), and webhooks can subscribe to `asset.updated`.
|
|
17
|
+
|
|
18
|
+
- Image URLs are open. `Asset` has `image_url`, the whole image, and
|
|
19
|
+
`imageUrl` from the new `@nohead/sdk/images` (no dependencies) writes any of
|
|
20
|
+
imgproxy's processing options into it, without a request. It also has
|
|
21
|
+
loaders for Next.js (`nextImageLoader`), Astro (`astroImageService`) and
|
|
22
|
+
Nuxt Image (`nuxtImageProvider`, or `getImage` on Nuxt Image 1), which leave
|
|
23
|
+
other images as they are.
|
|
24
|
+
|
|
25
|
+
- **Breaking:** `assets.imageUrl` is gone, with the API's
|
|
26
|
+
`GET /v1/assets/{asset_id}/image-url`: use `imageUrl` from
|
|
27
|
+
`@nohead/sdk/images`, which needs no request.
|
|
28
|
+
|
|
29
|
+
- **Breaking:** `Collection` has no `search_enabled`, and `SearchIndex` no
|
|
30
|
+
`enabled`: API keys search every collection they can read.
|
|
31
|
+
|
|
32
|
+
- `revisions.get(revision)` reads a revision by its own `rev_` ID, as
|
|
33
|
+
webhooks and the activity log name it (`GET /v1/revisions/{revision_id}`).
|
|
34
|
+
|
|
35
|
+
- `records.create` takes `upsert_on`, a unique field's key: the record
|
|
36
|
+
holding that value is updated instead, if one exists, and `ifMatch`
|
|
37
|
+
applies to that update.
|
|
38
|
+
|
|
39
|
+
- Collections have `public_search`: whether the project's search tokens find
|
|
40
|
+
their published records. Off by default; `collections.create` and
|
|
41
|
+
`collections.update` take it. A collection's search index has `index`, the
|
|
42
|
+
name a token searches it by.
|
|
43
|
+
|
|
44
|
+
## 0.5.0
|
|
45
|
+
|
|
46
|
+
- **Breaking:** field migrations are created under their collection:
|
|
47
|
+
`migrations.create(collection, { field_id, ...changes, dry_run? })`
|
|
48
|
+
(`POST /v1/collections/{collection_id}/migrations`) replaces
|
|
49
|
+
`fields.migrate(field, ...)`. It returns a preview for a dry run and the
|
|
50
|
+
`FieldMigration` otherwise, as before. `FieldMigrateParams` is
|
|
51
|
+
`MigrationCreateParams`, with `field_id`.
|
|
52
|
+
- **Breaking:** `drafts.list` no longer takes `record_id`; a record's drafts
|
|
53
|
+
are `records.drafts(record)`.
|
|
54
|
+
- **Breaking:** `assets.list`'s `content_type` is one MIME type or `type/*`
|
|
55
|
+
wildcard as a string, or several as a list (sent as
|
|
56
|
+
`filter[content_type][in]`). A comma-separated string no longer lists
|
|
57
|
+
several types: pass a list.
|
|
58
|
+
- **Breaking:** `auditEvents.list` sorts by `created_at` or `-created_at`
|
|
59
|
+
(the default), not `id`, and records no longer sort by `id`.
|
|
60
|
+
- Webhook events always carry `actor` and `via` (now required in
|
|
61
|
+
`WebhookEventPayload`), and `Via` no longer has `import` or `migration`,
|
|
62
|
+
which were never sent.
|
|
63
|
+
|
|
8
64
|
## 0.4.0
|
|
9
65
|
|
|
10
66
|
- **Breaking:** a field's `api_key` is its `key` (in fields, their aliases,
|
package/README.md
CHANGED
|
@@ -51,17 +51,17 @@ const nohead = new Nohead({
|
|
|
51
51
|
})
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
| Option | Default |
|
|
55
|
-
| ------------ | ---------------------------------------------- |
|
|
56
|
-
| `apiKey` | `NOHEAD_API_KEY` | A project API key (`
|
|
57
|
-
| `baseUrl` | `NOHEAD_API_URL`, else `https://api.nohead.io` |
|
|
58
|
-
| `projectId` | the key's project | Looked up once with `GET /v1/me` when omitted.
|
|
59
|
-
| `maxRetries` | `2` | See [retries](#retries-and-idempotency).
|
|
60
|
-
| `timeout` | `60000` | Milliseconds per attempt.
|
|
61
|
-
| `fetch` | `globalThis.fetch` | For proxies, instrumentation and tests.
|
|
62
|
-
| `headers` | `{}` | Added to every request.
|
|
63
|
-
| `warnings` | `true` | Logs deprecation and plan usage warnings, once each.
|
|
64
|
-
| `onRetry` | | Called before each retry. See [retries](#retries-and-idempotency).
|
|
54
|
+
| Option | Default | |
|
|
55
|
+
| ------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
56
|
+
| `apiKey` | `NOHEAD_API_KEY` | A project API key (`nohead_sk_…`, or `nohead_pk_…` when published-only). Required. |
|
|
57
|
+
| `baseUrl` | `NOHEAD_API_URL`, else `https://api.nohead.io` | |
|
|
58
|
+
| `projectId` | the key's project | Looked up once with `GET /v1/me` when omitted. |
|
|
59
|
+
| `maxRetries` | `2` | See [retries](#retries-and-idempotency). |
|
|
60
|
+
| `timeout` | `60000` | Milliseconds per attempt. |
|
|
61
|
+
| `fetch` | `globalThis.fetch` | For proxies, instrumentation and tests. |
|
|
62
|
+
| `headers` | `{}` | Added to every request. |
|
|
63
|
+
| `warnings` | `true` | Logs deprecation and plan usage warnings, once each. |
|
|
64
|
+
| `onRetry` | | Called before each retry. See [retries](#retries-and-idempotency). |
|
|
65
65
|
|
|
66
66
|
API keys belong to a project, so methods like `collections.list()` need no project ID. Collections can be named by ID or slug everywhere.
|
|
67
67
|
|
|
@@ -81,6 +81,15 @@ await nohead.records.delete(post.id) // soft delete; records.restore() undoes it
|
|
|
81
81
|
|
|
82
82
|
`schedule` sets the whole schedule: a time left out is cleared, so `{ unpublish_at }` alone drops a pending publish.
|
|
83
83
|
|
|
84
|
+
**Upserts.** With `upsert_on`, the key of a `unique` field, `create` updates the record holding that value instead, if one exists, so a content sync can run again without duplicates:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
await nohead.records.create("products", {
|
|
88
|
+
data: { sku: "TEE-01", title: "Tee" },
|
|
89
|
+
upsert_on: "sku",
|
|
90
|
+
})
|
|
91
|
+
```
|
|
92
|
+
|
|
84
93
|
Methods return the resource and throw on failure. Field names stay as the API sends them (`published_at`, `data`), so the API reference applies as-is.
|
|
85
94
|
|
|
86
95
|
**Typed data.** Describe a collection's fields and pass the type:
|
|
@@ -97,7 +106,7 @@ await nohead.records.update<Post>(id, { data: { title: null } }) // null clears
|
|
|
97
106
|
|
|
98
107
|
The type is a promise you make; nothing is checked at runtime. The record type itself is `Nohead.Record<Post>` (also exported as `NoheadRecord`).
|
|
99
108
|
|
|
100
|
-
**More:** `count`, `bulk` (up to 100 records at once), `diff`, `revisions.list`, `revisions.get` and `revisions.revert` (with `{ dry_run: true }` for a preview).
|
|
109
|
+
**More:** `count`, `bulk` (up to 100 records at once), `diff`, `revisions.list`, `revisions.get` and `revisions.revert` (with `{ dry_run: true }` for a preview). A revision by its own ID, as webhooks and the activity log name it: `nohead.revisions.get("rev_…")`.
|
|
101
110
|
|
|
102
111
|
## Drafts
|
|
103
112
|
|
|
@@ -118,7 +127,7 @@ await nohead.drafts.merge(draft.id) // or drafts.schedule(draft.id, { merge_at }
|
|
|
118
127
|
|
|
119
128
|
- A record has at most one draft; starting a second is a `ConflictError` (detail code `draft_exists`, with its `draft_id`).
|
|
120
129
|
- A merge changes content only: a live record stays live, an unpublished one unpublished. Publishing a live record with a pending draft is a `ConflictError` (`draft_pending`).
|
|
121
|
-
- `records.drafts(id)` lists a record's draft, and `drafts.list(collection
|
|
130
|
+
- `records.drafts(id)` lists a record's draft, and `drafts.list(collection)` a collection's.
|
|
122
131
|
- `drafts.discard` deletes one for good.
|
|
123
132
|
- Drafts take the type of their data as records do: `drafts.get<Post>(id)` is a `Nohead.Draft<Post>` (also exported as `NoheadDraft`).
|
|
124
133
|
|
|
@@ -258,13 +267,33 @@ const asset = await nohead.assets.upload(await openAsBlob("cover.jpg"), {
|
|
|
258
267
|
filename: "cover.jpg",
|
|
259
268
|
})
|
|
260
269
|
await nohead.records.update(id, { data: { cover: asset.id } })
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Images.** Image URLs are open: an image's `image_url` serves the whole image, and any of [imgproxy's processing options](https://docs.imgproxy.net/usage/processing) written into it transform it. `@nohead/sdk/images` builds them without a request, and has no dependencies, so it suits browser bundles:
|
|
261
273
|
|
|
262
|
-
|
|
274
|
+
```ts
|
|
275
|
+
import { imageUrl } from "@nohead/sdk/images"
|
|
276
|
+
|
|
277
|
+
imageUrl(asset, {
|
|
263
278
|
width: 1200,
|
|
279
|
+
height: 630,
|
|
280
|
+
fit: "cover",
|
|
281
|
+
gravity: "sm",
|
|
264
282
|
format: "webp",
|
|
265
283
|
})
|
|
284
|
+
imageUrl(asset.image_url!, { width: 400, dpr: 2, options: ["bl:2"] })
|
|
266
285
|
```
|
|
267
286
|
|
|
287
|
+
Frameworks' image components, with `srcset` and all, take a loader from it:
|
|
288
|
+
|
|
289
|
+
- **Next.js:** a file named by `images.loaderFile` in next.config: `export { nextImageLoader as default } from "@nohead/sdk/images"`, then `<Image src={asset.image_url} … />`.
|
|
290
|
+
- **Astro:** a module named by `image.service.entrypoint` in astro.config: `export { astroImageService as default } from "@nohead/sdk/images"`.
|
|
291
|
+
- **Nuxt Image:** a custom provider file in nuxt.config's `image.providers`: `export { nuxtImageProvider as default } from "@nohead/sdk/images"` (Nuxt Image 1: `export { getImage } from "@nohead/sdk/images"`).
|
|
292
|
+
|
|
293
|
+
The loaders leave other images, the site's own, as they are.
|
|
294
|
+
|
|
295
|
+
Thumbnails: an image's `preview_url` fits in 640×640, as WebP.
|
|
296
|
+
|
|
268
297
|
**What `upload` accepts:** a `Blob`, `File`, `ArrayBuffer`, `Uint8Array`, or a `ReadableStream` with `byte_size`.
|
|
269
298
|
|
|
270
299
|
**What it does:**
|
|
@@ -279,6 +308,14 @@ const { url } = await nohead.assets.imageUrl(asset.id, {
|
|
|
279
308
|
|
|
280
309
|
**Uploading from a browser:** create the upload on your server with `createUpload`, `PUT` the file from the browser, then `complete` it.
|
|
281
310
|
|
|
311
|
+
**Renaming and alt text:** `update` changes an asset's `filename` and `alt` text, the default wherever the asset is used (`expand` returns it with the asset). The file itself never changes.
|
|
312
|
+
|
|
313
|
+
```ts
|
|
314
|
+
await nohead.assets.update(asset.id, {
|
|
315
|
+
alt: "The spring menu, on a chalkboard",
|
|
316
|
+
})
|
|
317
|
+
```
|
|
318
|
+
|
|
282
319
|
**Deleting:** `delete` keeps a deleted asset until its `purge_after` (30 days), and `restore` brings it back. To remove it for good now, `purge` it after the delete. Records that use it keep an ID that no longer resolves, so check `usage` first:
|
|
283
320
|
|
|
284
321
|
```ts
|
|
@@ -298,7 +335,7 @@ const results = await nohead.search("content model", { collections: ["posts", "p
|
|
|
298
335
|
results.meta.total_estimate
|
|
299
336
|
```
|
|
300
337
|
|
|
301
|
-
Search needs `
|
|
338
|
+
Search needs the `search:read` scope and covers every collection the key can read, matching their `searchable` fields. It pages through the first 1,000 hits. For search straight from a site's browser, without the API, use a search token from the web app with Meilisearch's own clients or InstantSearch.
|
|
302
339
|
|
|
303
340
|
## Schema
|
|
304
341
|
|
|
@@ -315,11 +352,15 @@ await nohead.fields.create("posts", {
|
|
|
315
352
|
})
|
|
316
353
|
|
|
317
354
|
// Changes that rewrite records go through a migration; preview first
|
|
318
|
-
const preview = await nohead.
|
|
355
|
+
const preview = await nohead.migrations.create("posts", {
|
|
356
|
+
field_id: "fld_…",
|
|
319
357
|
type: "long_text",
|
|
320
358
|
dry_run: true,
|
|
321
359
|
})
|
|
322
|
-
const migration = await nohead.
|
|
360
|
+
const migration = await nohead.migrations.create("posts", {
|
|
361
|
+
field_id: "fld_…",
|
|
362
|
+
type: "long_text",
|
|
363
|
+
})
|
|
323
364
|
await nohead.migrations.get(migration.id)
|
|
324
365
|
```
|
|
325
366
|
|
|
@@ -366,13 +407,14 @@ response.headers.get("RateLimit-Remaining")
|
|
|
366
407
|
| `records` | `list`, `get`, `create`, `update`, `delete`, `restore`, `publish`, `unpublish`, `publication`, `getSchedule`, `schedule`, `unschedule`, `scheduledChanges`, `drafts`, `count`, `bulk`, `diff`, `search` |
|
|
367
408
|
| `drafts` | `create`, `list`, `get`, `update`, `discard`, `merge`, `schedule`, `unschedule` |
|
|
368
409
|
| `records.revisions` | `list`, `get`, `revert` |
|
|
410
|
+
| `revisions` | `get` (by its own `rev_` ID, as webhooks and the activity log name it) |
|
|
369
411
|
| `search` | across the project |
|
|
370
412
|
| `collections` | `list`, `get`, `create`, `update`, `delete`, `restore`, `schema` |
|
|
371
413
|
| `collections.schemaChanges` | `list`, `get` |
|
|
372
414
|
| `collections.searchIndex` | `get`, `rebuild` |
|
|
373
|
-
| `fields` | `list`, `get`, `create`, `update`, `delete`, `restore`, `order`, `reorder`, `removeAlias
|
|
374
|
-
| `migrations` | `list`, `get`, `cancel`
|
|
375
|
-
| `assets` | `upload`, `createUpload`, `complete`, `list`, `get`, `delete`, `restore`, `purge`, `usage`, `
|
|
415
|
+
| `fields` | `list`, `get`, `create`, `update`, `delete`, `restore`, `order`, `reorder`, `removeAlias` |
|
|
416
|
+
| `migrations` | `create`, `list`, `get`, `cancel` |
|
|
417
|
+
| `assets` | `upload`, `createUpload`, `complete`, `list`, `get`, `update`, `delete`, `restore`, `purge`, `usage`, `downloadUrl` |
|
|
376
418
|
| `webhooks` | `list`, `get`, `create`, `update`, `delete`, `restore`, `rotateSecret`, `test`, `unwrap` |
|
|
377
419
|
| `webhooks.secrets` | `list`, `retire` |
|
|
378
420
|
| `webhooks.deliveries` | `list`, `get`, `retry` |
|
|
@@ -391,7 +433,7 @@ npm test # unit and contract tests
|
|
|
391
433
|
npm run lint && npm run typecheck && npm run format:check
|
|
392
434
|
npm run generate # after updating openapi.json
|
|
393
435
|
npm run samples # after changing test/calls.ts (the docs' code samples)
|
|
394
|
-
NOHEAD_API_URL=http://localhost:3000 NOHEAD_API_KEY=
|
|
436
|
+
NOHEAD_API_URL=http://localhost:3000 NOHEAD_API_KEY=nohead_sk_… npm run smoke
|
|
395
437
|
```
|
|
396
438
|
|
|
397
439
|
**How the code is organized:**
|
package/dist/client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type * as G from "./generated/types.gen.ts";
|
|
|
4
4
|
import { Assets } from "./resources/assets.ts";
|
|
5
5
|
import { Drafts } from "./resources/drafts.ts";
|
|
6
6
|
import { AuditEvents, FeatureFlags, Health, Me } from "./resources/other.ts";
|
|
7
|
-
import { Records } from "./resources/records.ts";
|
|
7
|
+
import { Records, RevisionsById } from "./resources/records.ts";
|
|
8
8
|
import { Collections, Fields, Migrations } from "./resources/schema.ts";
|
|
9
9
|
import { Webhooks } from "./resources/webhooks.ts";
|
|
10
10
|
import type { NoheadDraft, NoheadRecord, ProjectSearchParams, RecordData, SearchMeta } from "./types.ts";
|
|
@@ -19,6 +19,7 @@ import type { NoheadDraft, NoheadRecord, ProjectSearchParams, RecordData, Search
|
|
|
19
19
|
export declare class Nohead {
|
|
20
20
|
#private;
|
|
21
21
|
readonly records: Records;
|
|
22
|
+
readonly revisions: RevisionsById;
|
|
22
23
|
readonly drafts: Drafts;
|
|
23
24
|
readonly collections: Collections;
|
|
24
25
|
readonly fields: Fields;
|
package/dist/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Core } from "./core.js";
|
|
|
2
2
|
import { Assets } from "./resources/assets.js";
|
|
3
3
|
import { Drafts } from "./resources/drafts.js";
|
|
4
4
|
import { AuditEvents, FeatureFlags, Health, Me } from "./resources/other.js";
|
|
5
|
-
import { Records } from "./resources/records.js";
|
|
5
|
+
import { Records, RevisionsById } from "./resources/records.js";
|
|
6
6
|
import { Collections, Fields, Migrations } from "./resources/schema.js";
|
|
7
7
|
import { Webhooks } from "./resources/webhooks.js";
|
|
8
8
|
/**
|
|
@@ -15,6 +15,7 @@ import { Webhooks } from "./resources/webhooks.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export class Nohead {
|
|
17
17
|
records;
|
|
18
|
+
revisions;
|
|
18
19
|
drafts;
|
|
19
20
|
collections;
|
|
20
21
|
fields;
|
|
@@ -30,6 +31,7 @@ export class Nohead {
|
|
|
30
31
|
const core = new Core(options);
|
|
31
32
|
this.#core = core;
|
|
32
33
|
this.records = new Records(core);
|
|
34
|
+
this.revisions = new RevisionsById(core);
|
|
33
35
|
this.drafts = new Drafts(core);
|
|
34
36
|
this.collections = new Collections(core);
|
|
35
37
|
this.fields = new Fields(core);
|
package/dist/core.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ import { type OperationId, type Operations } from "./generated/operations.gen.ts
|
|
|
4
4
|
import type { ListMeta } from "./generated/types.gen.ts";
|
|
5
5
|
export declare const DEFAULT_BASE_URL = "https://api.nohead.io";
|
|
6
6
|
export interface ClientOptions {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* A project API key (`nohead_sk_…`, or `nohead_pk_…` when published-only).
|
|
9
|
+
* Defaults to `NOHEAD_API_KEY`.
|
|
10
|
+
*/
|
|
8
11
|
apiKey?: string;
|
|
9
12
|
/** Defaults to `NOHEAD_API_URL`, else `https://api.nohead.io`. */
|
|
10
13
|
baseUrl?: string;
|
|
@@ -16,10 +16,6 @@ export declare const OPERATIONS: {
|
|
|
16
16
|
readonly method: "GET";
|
|
17
17
|
readonly path: "/v1/assets/{asset_id}";
|
|
18
18
|
};
|
|
19
|
-
readonly assets_image_url: {
|
|
20
|
-
readonly method: "GET";
|
|
21
|
-
readonly path: "/v1/assets/{asset_id}/image-url";
|
|
22
|
-
};
|
|
23
19
|
readonly assets_list: {
|
|
24
20
|
readonly method: "GET";
|
|
25
21
|
readonly path: "/v1/projects/{project_id}/assets";
|
|
@@ -32,6 +28,10 @@ export declare const OPERATIONS: {
|
|
|
32
28
|
readonly method: "POST";
|
|
33
29
|
readonly path: "/v1/assets/{asset_id}/restore";
|
|
34
30
|
};
|
|
31
|
+
readonly assets_update: {
|
|
32
|
+
readonly method: "PATCH";
|
|
33
|
+
readonly path: "/v1/assets/{asset_id}";
|
|
34
|
+
};
|
|
35
35
|
readonly assets_upload: {
|
|
36
36
|
readonly method: "POST";
|
|
37
37
|
readonly path: "/v1/projects/{project_id}/assets";
|
|
@@ -132,10 +132,6 @@ export declare const OPERATIONS: {
|
|
|
132
132
|
readonly method: "GET";
|
|
133
133
|
readonly path: "/v1/collections/{collection_id}/fields";
|
|
134
134
|
};
|
|
135
|
-
readonly fields_migrate: {
|
|
136
|
-
readonly method: "POST";
|
|
137
|
-
readonly path: "/v1/fields/{field_id}/migrations";
|
|
138
|
-
};
|
|
139
135
|
readonly fields_remove_alias: {
|
|
140
136
|
readonly method: "DELETE";
|
|
141
137
|
readonly path: "/v1/fields/{field_id}/aliases/{alias}";
|
|
@@ -164,6 +160,10 @@ export declare const OPERATIONS: {
|
|
|
164
160
|
readonly method: "POST";
|
|
165
161
|
readonly path: "/v1/migrations/{migration_id}/cancel";
|
|
166
162
|
};
|
|
163
|
+
readonly migrations_create: {
|
|
164
|
+
readonly method: "POST";
|
|
165
|
+
readonly path: "/v1/collections/{collection_id}/migrations";
|
|
166
|
+
};
|
|
167
167
|
readonly migrations_get: {
|
|
168
168
|
readonly method: "GET";
|
|
169
169
|
readonly path: "/v1/migrations/{migration_id}";
|
|
@@ -252,6 +252,10 @@ export declare const OPERATIONS: {
|
|
|
252
252
|
readonly method: "PATCH";
|
|
253
253
|
readonly path: "/v1/records/{record_id}";
|
|
254
254
|
};
|
|
255
|
+
readonly revisions_get: {
|
|
256
|
+
readonly method: "GET";
|
|
257
|
+
readonly path: "/v1/revisions/{revision_id}";
|
|
258
|
+
};
|
|
255
259
|
readonly scheduled_changes_list: {
|
|
256
260
|
readonly method: "GET";
|
|
257
261
|
readonly path: "/v1/collections/{collection_id}/scheduled-changes";
|
|
@@ -343,10 +347,6 @@ export interface Operations {
|
|
|
343
347
|
data: T.AssetsGetData;
|
|
344
348
|
response: T.AssetsGetResponse;
|
|
345
349
|
};
|
|
346
|
-
assets_image_url: {
|
|
347
|
-
data: T.AssetsImageUrlData;
|
|
348
|
-
response: T.AssetsImageUrlResponse;
|
|
349
|
-
};
|
|
350
350
|
assets_list: {
|
|
351
351
|
data: T.AssetsListData;
|
|
352
352
|
response: T.AssetsListResponse;
|
|
@@ -359,6 +359,10 @@ export interface Operations {
|
|
|
359
359
|
data: T.AssetsRestoreData;
|
|
360
360
|
response: T.AssetsRestoreResponse;
|
|
361
361
|
};
|
|
362
|
+
assets_update: {
|
|
363
|
+
data: T.AssetsUpdateData;
|
|
364
|
+
response: T.AssetsUpdateResponse;
|
|
365
|
+
};
|
|
362
366
|
assets_upload: {
|
|
363
367
|
data: T.AssetsUploadData;
|
|
364
368
|
response: T.AssetsUploadResponse;
|
|
@@ -459,10 +463,6 @@ export interface Operations {
|
|
|
459
463
|
data: T.FieldsListData;
|
|
460
464
|
response: T.FieldsListResponse;
|
|
461
465
|
};
|
|
462
|
-
fields_migrate: {
|
|
463
|
-
data: T.FieldsMigrateData;
|
|
464
|
-
response: T.FieldsMigrateResponse;
|
|
465
|
-
};
|
|
466
466
|
fields_remove_alias: {
|
|
467
467
|
data: T.FieldsRemoveAliasData;
|
|
468
468
|
response: T.FieldsRemoveAliasResponse;
|
|
@@ -491,6 +491,10 @@ export interface Operations {
|
|
|
491
491
|
data: T.MigrationsCancelData;
|
|
492
492
|
response: T.MigrationsCancelResponse;
|
|
493
493
|
};
|
|
494
|
+
migrations_create: {
|
|
495
|
+
data: T.MigrationsCreateData;
|
|
496
|
+
response: T.MigrationsCreateResponse;
|
|
497
|
+
};
|
|
494
498
|
migrations_get: {
|
|
495
499
|
data: T.MigrationsGetData;
|
|
496
500
|
response: T.MigrationsGetResponse;
|
|
@@ -579,6 +583,10 @@ export interface Operations {
|
|
|
579
583
|
data: T.RecordsUpdateData;
|
|
580
584
|
response: T.RecordsUpdateResponse;
|
|
581
585
|
};
|
|
586
|
+
revisions_get: {
|
|
587
|
+
data: T.RevisionsGetData;
|
|
588
|
+
response: T.RevisionsGetResponse;
|
|
589
|
+
};
|
|
582
590
|
scheduled_changes_list: {
|
|
583
591
|
data: T.ScheduledChangesListData;
|
|
584
592
|
response: T.ScheduledChangesListResponse;
|
|
@@ -3,10 +3,10 @@ export const OPERATIONS = {
|
|
|
3
3
|
assets_delete: { method: "DELETE", path: "/v1/assets/{asset_id}" },
|
|
4
4
|
assets_download_url: { method: "GET", path: "/v1/assets/{asset_id}/download-url" },
|
|
5
5
|
assets_get: { method: "GET", path: "/v1/assets/{asset_id}" },
|
|
6
|
-
assets_image_url: { method: "GET", path: "/v1/assets/{asset_id}/image-url" },
|
|
7
6
|
assets_list: { method: "GET", path: "/v1/projects/{project_id}/assets" },
|
|
8
7
|
assets_purge: { method: "POST", path: "/v1/assets/{asset_id}/purge" },
|
|
9
8
|
assets_restore: { method: "POST", path: "/v1/assets/{asset_id}/restore" },
|
|
9
|
+
assets_update: { method: "PATCH", path: "/v1/assets/{asset_id}" },
|
|
10
10
|
assets_upload: { method: "POST", path: "/v1/projects/{project_id}/assets" },
|
|
11
11
|
assets_usage: { method: "GET", path: "/v1/assets/{asset_id}/usage" },
|
|
12
12
|
audit_events_list: { method: "GET", path: "/v1/projects/{project_id}/audit-events" },
|
|
@@ -32,7 +32,6 @@ export const OPERATIONS = {
|
|
|
32
32
|
fields_get: { method: "GET", path: "/v1/fields/{field_id}" },
|
|
33
33
|
fields_get_order: { method: "GET", path: "/v1/collections/{collection_id}/field-order" },
|
|
34
34
|
fields_list: { method: "GET", path: "/v1/collections/{collection_id}/fields" },
|
|
35
|
-
fields_migrate: { method: "POST", path: "/v1/fields/{field_id}/migrations" },
|
|
36
35
|
fields_remove_alias: { method: "DELETE", path: "/v1/fields/{field_id}/aliases/{alias}" },
|
|
37
36
|
fields_reorder: { method: "PUT", path: "/v1/collections/{collection_id}/field-order" },
|
|
38
37
|
fields_restore: { method: "POST", path: "/v1/fields/{field_id}/restore" },
|
|
@@ -40,6 +39,7 @@ export const OPERATIONS = {
|
|
|
40
39
|
health_check: { method: "GET", path: "/v1/health" },
|
|
41
40
|
me_get: { method: "GET", path: "/v1/me" },
|
|
42
41
|
migrations_cancel: { method: "POST", path: "/v1/migrations/{migration_id}/cancel" },
|
|
42
|
+
migrations_create: { method: "POST", path: "/v1/collections/{collection_id}/migrations" },
|
|
43
43
|
migrations_get: { method: "GET", path: "/v1/migrations/{migration_id}" },
|
|
44
44
|
migrations_list: { method: "GET", path: "/v1/collections/{collection_id}/migrations" },
|
|
45
45
|
projects_search: { method: "GET", path: "/v1/projects/{project_id}/search" },
|
|
@@ -62,6 +62,7 @@ export const OPERATIONS = {
|
|
|
62
62
|
records_unpublish: { method: "DELETE", path: "/v1/records/{record_id}/publication" },
|
|
63
63
|
records_unschedule: { method: "DELETE", path: "/v1/records/{record_id}/schedule" },
|
|
64
64
|
records_update: { method: "PATCH", path: "/v1/records/{record_id}" },
|
|
65
|
+
revisions_get: { method: "GET", path: "/v1/revisions/{revision_id}" },
|
|
65
66
|
scheduled_changes_list: { method: "GET", path: "/v1/collections/{collection_id}/scheduled-changes" },
|
|
66
67
|
schema_changes_get: { method: "GET", path: "/v1/schema-changes/{schema_change_id}" },
|
|
67
68
|
schema_changes_list: { method: "GET", path: "/v1/collections/{collection_id}/schema-changes" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Actor, ApiKeyScope, Asset, AssetEventData, AssetField, AssetFieldConfiguration, AssetFieldCreate, AssetList, AssetProperties, AssetUploadCreate, AssetUploadTarget, AssetUsage, AssetWithUpload, AuditEvent, AuditEventList, BooleanField, BooleanFieldConfiguration, BooleanFieldCreate, Change, Collection, CollectionCreate, CollectionList, CollectionUpdate, DateField, DateFieldConfiguration, DateFieldCreate, DecimalField, DecimalFieldConfiguration, DecimalFieldCreate, DownloadUrl, Draft, DraftCreate, DraftEventData, DraftList, DraftSchedule, DraftScheduleUpdate, EnumField, EnumFieldConfiguration, EnumFieldCreate, Error, ErrorDetail, ErrorType, FeatureFlags, Field, FieldAliasEventData, FieldConfiguration, FieldCreate, FieldCreateProperties, FieldDefinition, FieldList, FieldMigration, FieldMigrationCounts, FieldMigrationList, FieldMigrationPreview, FieldMigrationRequest, FieldOrder, FieldProperties, FieldType, FieldUpdate, Health,
|
|
1
|
+
export type { Actor, ApiKeyScope, Asset, AssetEventData, AssetField, AssetFieldConfiguration, AssetFieldCreate, AssetList, AssetProperties, AssetUpdate, AssetUploadCreate, AssetUploadTarget, AssetUsage, AssetWithUpload, AuditEvent, AuditEventList, BooleanField, BooleanFieldConfiguration, BooleanFieldCreate, Change, Collection, CollectionCreate, CollectionList, CollectionUpdate, DateField, DateFieldConfiguration, DateFieldCreate, DecimalField, DecimalFieldConfiguration, DecimalFieldCreate, DownloadUrl, Draft, DraftCreate, DraftEventData, DraftList, DraftSchedule, DraftScheduleUpdate, EnumField, EnumFieldConfiguration, EnumFieldCreate, Error, ErrorDetail, ErrorType, FeatureFlags, Field, FieldAliasEventData, FieldConfiguration, FieldCreate, FieldCreateProperties, FieldDefinition, FieldList, FieldMigration, FieldMigrationCounts, FieldMigrationList, FieldMigrationPreview, FieldMigrationRequest, FieldOrder, FieldProperties, FieldType, FieldUpdate, Health, IntegerField, IntegerFieldConfiguration, IntegerFieldCreate, JsonField, JsonFieldConfiguration, JsonFieldCreate, ListMeta, LongTextField, LongTextFieldConfiguration, LongTextFieldCreate, MergedDraft, NullableTimestamp, Principal, PublishedOnly, RecordBatch, RecordBatchRequest, RecordCount, RecordCreate, RecordData, RecordDiff, RecordEventData, RecordFilterValue, RecordList, RecordPublication, RecordRevision, RecordRevisionDetail, RecordRevisionList, RecordRevisionOperation, RecordRevisionProperties, RecordSchedule, RecordScheduleUpdate, RecordWrite, RelationField, RelationFieldConfiguration, RelationFieldCreate, RequestId, RevertPreview, RichTextField, RichTextFieldConfiguration, RichTextFieldCreate, ScheduledChange, ScheduledChangeList, Schema, SchemaChange, SchemaChangeDetail, SchemaChangeList, SchemaChangeProperties, SchemaDefinition, SchemaEventData, SearchIndex, SearchResults, TextField, TextFieldConfiguration, TextFieldCreate, TimeFilter, Timestamp, Via, Webhook, WebhookCreate, WebhookDelivery, WebhookDeliveryDetail, WebhookDeliveryList, WebhookDeliveryProperties, WebhookEventPayload, WebhookEventType, WebhookList, WebhookProperties, WebhookSecret, WebhookSecretList, WebhookSecretProperties, WebhookSecretWithValue, WebhookSubscription, WebhookTestEventData, WebhookUpdate, WebhookWithSecret, } from "./types.gen.ts";
|