@andesine/sdk 0.1.0 → 0.5.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.
@@ -0,0 +1,1596 @@
1
+ import { N as ContentSchemaMetadata, R as EntryFragment, _n as operations, gn as components, mt as PublishedCollection, yt as PublishedEntryContent, z as EntryProperty } from "./schema-CrquN_J6.js";
2
+ //#region src/workspace.d.ts
3
+ /**
4
+ * Type-only description of one workspace and content source.
5
+ * It does not select a workspace, bind a snapshot, or validate a server response.
6
+ * Generated collection/entry keys can include IDs, canonical paths, and slug paths. Unknown keys retain general SDK types.
7
+ */
8
+ interface WorkspaceTypeMap {
9
+ workspaceID?: string;
10
+ source: {
11
+ kind: "current" | "published";
12
+ channel?: string;
13
+ snapshotID?: string;
14
+ };
15
+ collections: Readonly<Record<string, WorkspaceCollection>>;
16
+ schemas: Readonly<Record<string, WorkspaceSchema>>;
17
+ /** Optional exact entry bindings. Omit ID or name/slug path keys when their generation is disabled. */
18
+ entries?: Readonly<Record<string, WorkspaceEntry>>;
19
+ /** Optional published trees keyed by collection selector. Does not affect current reads. */
20
+ tree?: Readonly<Record<string, PublishedCollection>>;
21
+ }
22
+ /** One collection's content variants and known descendant collection selectors. */
23
+ interface WorkspaceCollection {
24
+ id: string | null;
25
+ path: string;
26
+ slugPath: string;
27
+ /** Exact recorded revision IDs; null is schema-free content. An empty tuple uses general content. */
28
+ schemaRevisionIDs: ReadonlyArray<string | null>;
29
+ /** All descendants, not only direct children. Omit when unknown; use [] for a known leaf. */
30
+ descendants?: readonly string[];
31
+ }
32
+ /** Effective fields for one recorded schema revision, including inherited fields. */
33
+ interface WorkspaceSchema {
34
+ hash: string;
35
+ properties: Readonly<Record<string, EntryProperty | undefined>>;
36
+ fragments: Readonly<Record<string, EntryFragment | undefined>>;
37
+ }
38
+ /** An exact entry binding; its revision can be narrower than its collection's revision union. */
39
+ interface WorkspaceEntry {
40
+ collection: string;
41
+ schemaRevisionID: string | null;
42
+ }
43
+ interface ContentShape {
44
+ schema: ContentSchemaMetadata | null;
45
+ properties: Readonly<Record<string, EntryProperty | undefined>>;
46
+ fragments: Readonly<Record<string, EntryFragment | undefined>>;
47
+ }
48
+ type GeneralContent = Pick<PublishedEntryContent, "schema" | "properties" | "fragments">;
49
+ /** Content fields for named revision types. Preserves revision unions and schema-free branches. */
50
+ type SchemaContent<Workspace extends WorkspaceTypeMap, RevisionID extends string | null> = [RevisionID] extends [never] ? GeneralContent : RevisionID extends null ? GeneralContent & {
51
+ schema: null;
52
+ } : RevisionID extends keyof Workspace["schemas"] ? {
53
+ schema: {
54
+ revisionID: RevisionID;
55
+ hash: Workspace["schemas"][RevisionID]["hash"];
56
+ };
57
+ properties: Workspace["schemas"][RevisionID]["properties"];
58
+ fragments: Workspace["schemas"][RevisionID]["fragments"];
59
+ } : GeneralContent;
60
+ //#endregion
61
+ //#region src/workspace-output.d.ts
62
+ type Lookup<Map, Key> = Key extends string ? string extends Key ? undefined : Key extends keyof Map ? Map[Key] : undefined : undefined;
63
+ type Selector$1<Input, Keys extends string> = Input extends unknown ? [Extract<Keys, keyof Input>] extends [never] ? undefined : Input[Extract<Keys, keyof Input>] : never;
64
+ type EntryMap<Workspace> = Workspace extends {
65
+ entries: infer Entries;
66
+ } ? Entries : Record<never, never>;
67
+ type TreeMap<Workspace> = Workspace extends {
68
+ tree: infer Tree;
69
+ } ? Tree : Record<never, never>;
70
+ type ApplyContent<Base, Shape> = Shape extends ContentShape ? Omit<Base, keyof ContentShape> & Shape : Base;
71
+ type CollectionIdentity<Collection> = Collection extends WorkspaceCollection ? {
72
+ collectionID: Collection["id"];
73
+ } : Record<never, never>;
74
+ type EntryContent<Base, Workspace extends WorkspaceTypeMap, Binding> = Binding extends WorkspaceEntry ? ApplyContent<Base, SchemaContent<Workspace, Binding["schemaRevisionID"]>> & (Workspace["source"] extends {
75
+ kind: "published";
76
+ } ? CollectionIdentity<Lookup<Workspace["collections"], Binding["collection"]>> : Record<never, never>) : Base;
77
+ type EntryOutput<Base, Workspace extends WorkspaceTypeMap, Input, ID extends string> = EntryContent<Base, Workspace, Lookup<EntryMap<Workspace>, Selector$1<Input, ID | "path" | "slugPath">>>;
78
+ type Descendants<Workspace extends WorkspaceTypeMap, Collection> = Collection extends {
79
+ descendants: readonly string[];
80
+ } ? Lookup<Workspace["collections"], Collection["descendants"][number]> : undefined;
81
+ type ListCollections<Workspace extends WorkspaceTypeMap, Input, Collection> = "descendants" extends keyof Input ? Input extends {
82
+ descendants?: false | undefined;
83
+ } ? Collection : Collection | Descendants<Workspace, Collection> : Collection;
84
+ type CollectionContent<Base, Workspace extends WorkspaceTypeMap, Collection> = Collection extends WorkspaceCollection ? ApplyContent<Base, SchemaContent<Workspace, Collection["schemaRevisionIDs"][number]>> & {
85
+ collectionID: Collection["id"];
86
+ } : Base;
87
+ /** Apply known collection shapes only to published list content; summaries stay unchanged. */
88
+ type WorkspaceListContent<Base, Workspace extends WorkspaceTypeMap, Input> = Workspace["source"] extends {
89
+ kind: "published";
90
+ } ? CollectionContent<Base, Workspace, ListCollections<Workspace, Input, Lookup<Workspace["collections"], Selector$1<Input, "collectionID" | "collectionPath" | "collectionSlugPath">>>> : Base;
91
+ type TreeOutput<Base, Tree> = Tree extends PublishedCollection ? Omit<Base, "collection"> & {
92
+ collection: Tree;
93
+ } : Base;
94
+ type SchemaOutput<Base, Shape> = Shape extends {
95
+ schema: infer Schema;
96
+ } ? Schema extends null ? null : Omit<NonNullable<Base>, "revisionID" | "hash"> & Schema : Base;
97
+ type EntrySchemaOutput<Base, Workspace extends WorkspaceTypeMap, Binding> = Binding extends WorkspaceEntry ? SchemaOutput<Base, SchemaContent<Workspace, Binding["schemaRevisionID"]>> : Base;
98
+ /** Specialize reads for their matching source; unrelated operations retain their generated types. */
99
+ type WorkspaceOperationOutput<Operation extends string, Base, Workspace extends WorkspaceTypeMap, Input> = Operation extends "entries.get" ? Workspace["source"] extends {
100
+ kind: "current";
101
+ } ? EntryOutput<Base, Workspace, Input, "id"> : Base : Workspace["source"] extends {
102
+ kind: "published";
103
+ } ? Operation extends "content.get" ? EntryOutput<Base, Workspace, Input, "entryID"> : Operation extends "content.getSchema" ? EntrySchemaOutput<Base, Workspace, Lookup<EntryMap<Workspace>, Selector$1<Input, "entryID" | "path" | "slugPath">>> : Operation extends "content.getTree" ? TreeOutput<Base, Lookup<TreeMap<Workspace>, Selector$1<Input, "collectionID" | "collectionPath" | "collectionSlugPath">>> : Base : Base;
104
+ //#endregion
105
+ //#region src/content-list.d.ts
106
+ interface ContentListOperation<Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> {
107
+ <const Input extends OperationInput<"content.listEntries"> = Record<string, never>>(input: Input, options: RequestOptions & {
108
+ response: "full";
109
+ }): Promise<APIResponse<ContentListOutput<Input, Workspace>> | NotModifiedResponse>;
110
+ <const Input extends OperationInput<"content.listEntries"> = Record<string, never>>(input?: Input, options?: RequestOptions & {
111
+ response?: "data";
112
+ }): Promise<ContentListOutput<Input, Workspace>>;
113
+ }
114
+ type FullContent<Input, Workspace extends WorkspaceTypeMap> = WorkspaceListContent<components["schemas"]["PublishedEntryContent"], Workspace, Input>;
115
+ type ContentListOutput<Input, Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> = Omit<RawOperationOutput<"content.listEntries">, "data"> & {
116
+ data: Array<Input extends {
117
+ includeContent: true;
118
+ } ? FullContent<Input, Workspace> : "includeContent" extends keyof Input ? Input extends {
119
+ includeContent?: false | undefined;
120
+ } ? components["schemas"]["PublishedEntrySummary"] : FullContent<Input, Workspace> | components["schemas"]["PublishedEntrySummary"] : components["schemas"]["PublishedEntrySummary"]>;
121
+ };
122
+ //#endregion
123
+ //#region src/selectors.d.ts
124
+ type SelectorValue<T, Key extends string> = Key extends keyof T ? NonNullable<T[Key]> : never;
125
+ type SelectorBranch<T, Keys extends string, Key extends Keys = Keys> = Key extends Keys ? { [Selected in Key]: SelectorValue<T, Selected>; } & { [Other in Exclude<Keys, Key>]?: never; } : never;
126
+ type Selector<T, Keys extends string, Optional extends boolean = false> = T & (SelectorBranch<T, Keys> | (Optional extends true ? { [Key in Keys]?: never; } : never));
127
+ type WithSelectors<Operation extends string, Input> = Operation extends "entries.get" ? Selector<Input, "id" | "path" | "slugPath"> : Operation extends "content.get" | "content.getSchema" ? Selector<Input, "entryID" | "path" | "slugPath"> : "collectionPath" extends keyof Input ? Selector<Input, "collectionID" | "collectionPath" | "collectionSlugPath", Operation extends "content.getTree" | "schemas.get" ? false : true> : Input;
128
+ //#endregion
129
+ //#region src/operation.d.ts
130
+ interface RequestOptions {
131
+ /** Cancel the request or stream, preserving the signal's abort reason. */
132
+ signal?: AbortSignal;
133
+ /** Override the client timeout in milliseconds; 0 disables it. Includes stream consumption. */
134
+ timeout?: number;
135
+ /** Override GET retry attempts. Defaults to the client setting; other methods never retry. */
136
+ retries?: number;
137
+ /** Headers merged over client headers. The configured credential supplies Authorization. */
138
+ headers?: HeadersInit;
139
+ /** Return data by default, or status/headers/data with "full". Required for possible 304s. */
140
+ response?: "data" | "full";
141
+ }
142
+ interface APIResponse<T> {
143
+ status: number;
144
+ headers: Headers;
145
+ data: T;
146
+ notModified: false;
147
+ }
148
+ interface NotModifiedResponse {
149
+ status: 304;
150
+ headers: Headers;
151
+ data: undefined;
152
+ notModified: true;
153
+ }
154
+ interface StandardOperation<K extends keyof operations, Workspace extends WorkspaceTypeMap> {
155
+ <const Input extends OperationInput<K>>(input: Input, options: RequestOptions & {
156
+ response: "full";
157
+ }): Promise<APIResponse<OperationOutput<K, Workspace, Input>> | NotModifiedResponse>;
158
+ <const Input extends OperationInput<K> = OperationInput<K>>(...args: Record<string, never> extends OperationInput<K> ? [input?: Input, options?: RequestOptions & {
159
+ response?: "data";
160
+ }] : [input: Input, options?: RequestOptions & {
161
+ response?: "data";
162
+ }]): Promise<OperationOutput<K, Workspace, Input>>;
163
+ }
164
+ interface StreamOperation<K extends keyof operations> {
165
+ (input: OperationInput<K>, options: RequestOptions & {
166
+ response: "full";
167
+ }): Promise<APIResponse<OperationOutput<K>>>;
168
+ (input: OperationInput<K>, options?: RequestOptions & {
169
+ response?: "data";
170
+ }): Promise<OperationOutput<K>>;
171
+ }
172
+ type StreamContent<K extends keyof operations> = Responses<K>[Extract<keyof Responses<K>, 200>] extends {
173
+ content: {
174
+ "text/event-stream": infer Frames;
175
+ };
176
+ } ? Frames : never;
177
+ type StreamEvent<K extends keyof operations> = Extract<StreamContent<K>, {
178
+ event: "message";
179
+ }> extends {
180
+ data: infer Event;
181
+ } ? Event : never;
182
+ type Operation<K extends keyof operations, Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> = [StreamContent<K>] extends [never] ? K extends "content.listEntries" ? ContentListOperation<Workspace> : StandardOperation<K, Workspace> : StreamOperation<K>;
183
+ type Content<T> = T extends {
184
+ content: infer C;
185
+ } ? C[keyof C] : never;
186
+ type Parameters<T, K extends string> = T extends {
187
+ parameters: infer P;
188
+ } ? K extends keyof P ? [NonNullable<P[K]>] extends [never] ? unknown : NonNullable<P[K]> : unknown : unknown;
189
+ type Body<T> = T extends {
190
+ requestBody?: infer B;
191
+ } ? [Content<NonNullable<B>>] extends [never] ? unknown : Content<NonNullable<B>> : unknown;
192
+ type OperationInput<K extends keyof operations> = WithSelectors<K, Parameters<operations[K], "path"> & Parameters<operations[K], "query"> & Body<operations[K]>>;
193
+ type Responses<K extends keyof operations> = operations[K]["responses"];
194
+ type SuccessContent<K extends keyof operations> = Content<Responses<K>[Extract<keyof Responses<K>, 200 | 201 | 202 | 203 | 206>]>;
195
+ type OperationError<K extends keyof operations> = K extends keyof operations ? Extract<Content<Responses<K>[keyof Responses<K>]>, {
196
+ defined: true;
197
+ code: string;
198
+ }> : never;
199
+ type APIErrorBody = OperationError<keyof operations>;
200
+ type APIErrorCode = APIErrorBody["code"];
201
+ type APIErrorData<C extends APIErrorCode> = Extract<APIErrorBody, {
202
+ code: C;
203
+ }>["data"];
204
+ type RawOperationOutput<K extends keyof operations> = [StreamContent<K>] extends [never] ? [SuccessContent<K>] extends [never] ? void : SuccessContent<K> : AsyncIterableIterator<StreamEvent<K>>;
205
+ type OperationOutput<K extends keyof operations, Workspace extends WorkspaceTypeMap = WorkspaceTypeMap, Input = OperationInput<K>> = K extends "content.listEntries" ? ContentListOutput<Input, Workspace> : WorkspaceOperationOutput<K, RawOperationOutput<K>, Workspace, Input>;
206
+ //#endregion
207
+ //#region src/generated/resources.d.ts
208
+ interface APIResources<Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> {
209
+ assets: {
210
+ /**
211
+ * Search assets
212
+ *
213
+ * Finds workspace images by text or SHA-256 checksum. Semantic search defaults to true and uses 1 AI credit for a text query. Returns up to 50 results.
214
+ *
215
+ * Required API key permissions: read:entries, read:collections. Write permissions also grant read access for the same resource.
216
+ *
217
+ * @example
218
+ * await client.assets.search({
219
+ * "query": "mountains",
220
+ * "limit": 10
221
+ * });
222
+ */
223
+ search: Operation<"assets.search", Workspace>;
224
+ /**
225
+ * Import an image URL
226
+ *
227
+ * Downloads a remote image and starts processing it for the entry. With checkDuplicates, can return an existing image instead. Use assets.get to check processing status.
228
+ *
229
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
230
+ *
231
+ * @example
232
+ * await client.assets.importURL({
233
+ * "assetID": "ast_example",
234
+ * "entryID": "ent_example",
235
+ * "url": "https://example.com/image.png",
236
+ * "checkDuplicates": true
237
+ * });
238
+ */
239
+ importURL: Operation<"assets.importURL", Workspace>;
240
+ /**
241
+ * Attach an asset
242
+ *
243
+ * Attaches a ready image to an entry. This does not insert an image node into the document.
244
+ *
245
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
246
+ *
247
+ * @example
248
+ * await client.assets.attach({
249
+ * "assetID": "ast_example",
250
+ * "entryID": "ent_example"
251
+ * });
252
+ */
253
+ attach: Operation<"assets.attach", Workspace>;
254
+ /**
255
+ * Register an image upload
256
+ *
257
+ * Reserves an image upload for an entry. Supply the byte count and lowercase SHA-256 checksum of the file. Call assets.upload before expiresAt, then use assets.get to check processing status.
258
+ *
259
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
260
+ *
261
+ * @example
262
+ * await client.assets.register({
263
+ * "assetID": "ast_example",
264
+ * "entryID": "ent_example",
265
+ * "filename": "image.png",
266
+ * "byteSize": 1024,
267
+ * "checksum": "0000000000000000000000000000000000000000000000000000000000000000"
268
+ * });
269
+ */
270
+ register: Operation<"assets.register", Workspace>;
271
+ /**
272
+ * Upload registered image bytes
273
+ *
274
+ * Uploads a file for a registered asset with multipart/form-data. The bytes must match the registered size and checksum. Processing continues after the upload; use assets.get to check status.
275
+ *
276
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
277
+ *
278
+ * @example
279
+ * await client.assets.upload({
280
+ * "assetID": "ast_example",
281
+ * "file": new Blob([imageBytes], { type: "image/png" })
282
+ * });
283
+ */
284
+ upload: Operation<"assets.upload", Workspace>;
285
+ /**
286
+ * Get asset status and details
287
+ *
288
+ * Returns image metadata, processing status, and available files. Supply entryID when checking access through an entry.
289
+ *
290
+ * @example
291
+ * await client.assets.get({
292
+ * "assetID": "ast_example",
293
+ * "entryID": "ent_example"
294
+ * });
295
+ */
296
+ get: Operation<"assets.get", Workspace>;
297
+ };
298
+ auth: {
299
+ /**
300
+ * Get credential identity
301
+ *
302
+ * Returns the authenticated user for OAuth or browser credentials, or the key and workspace IDs for an API key. Does not require a workspace selection and does not count toward API usage.
303
+ */
304
+ getIdentity: Operation<"auth.getIdentity", Workspace>;
305
+ };
306
+ instance: {
307
+ /**
308
+ * Get instance capabilities and limits
309
+ *
310
+ * Returns configured features and effective limits for the authenticated workspace. These values do not grant permissions or report live service health. No discovery request is made automatically by the SDK.
311
+ *
312
+ * @example
313
+ * await client.instance.get({});
314
+ */
315
+ get: Operation<"instance.get", Workspace>;
316
+ };
317
+ entries: {
318
+ /**
319
+ * Create an entry
320
+ *
321
+ * Creates an entry and its initial document. The name defaults to Untitled. Creation selects an available sibling name with a numeric suffix when needed. Names are trimmed and NFC-normalized. Derived URL slugs must be unique across sibling entries and collections, including case and punctuation variants. Names cannot contain a slash or equal a single dot or two dots. A collection schema can set the initial content.
322
+ *
323
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
324
+ *
325
+ * @example
326
+ * await client.entries.create({
327
+ * "name": "Getting started",
328
+ * "collectionID": "coll_example"
329
+ * });
330
+ */
331
+ create: Operation<"entries.create", Workspace>;
332
+ /**
333
+ * Delete entries
334
+ *
335
+ * Soft-deletes the selected entries and clears current-entry selections for affected members. An active schema migration can block this action.
336
+ *
337
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
338
+ *
339
+ * @example
340
+ * await client.entries.bulkDelete({
341
+ * "ids": [
342
+ * "ent_example"
343
+ * ]
344
+ * });
345
+ */
346
+ bulkDelete: Operation<"entries.bulkDelete", Workspace>;
347
+ /**
348
+ * Delete an entry
349
+ *
350
+ * Soft-deletes the entry and clears current-entry selections for affected members. An active schema migration can block this action.
351
+ *
352
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
353
+ *
354
+ * @example
355
+ * await client.entries.delete({
356
+ * "id": "ent_example"
357
+ * });
358
+ */
359
+ delete: Operation<"entries.delete", Workspace>;
360
+ /**
361
+ * Rename an entry
362
+ *
363
+ * Updates the entry name. Rejects names already used by a sibling entry or collection. An active schema migration can block this action.
364
+ *
365
+ * Required API key permissions: entries. Write permissions also grant read access for the same resource.
366
+ *
367
+ * @example
368
+ * await client.entries.update({
369
+ * "id": "ent_example",
370
+ * "name": "Installation"
371
+ * });
372
+ */
373
+ update: Operation<"entries.update", Workspace>;
374
+ /**
375
+ * Get an entry
376
+ *
377
+ * Returns current entry details, fragments, properties, and recorded schema metadata. Validates content without changing it. expectedSchemaHash must match the recorded schema; schema-less content cannot match it. Use content.get to read published content.
378
+ *
379
+ * Required API key permissions: read:entries. Write permissions also grant read access for the same resource.
380
+ *
381
+ * @example
382
+ * await client.entries.get({
383
+ * "id": "ent_example"
384
+ * });
385
+ */
386
+ get: Operation<"entries.get", Workspace>;
387
+ /**
388
+ * List entries
389
+ *
390
+ * Lists entries in the selected collection, or all accessible entries when collectionID is omitted. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100 and defaults to 50.
391
+ *
392
+ * Required API key permissions: read:entries. Write permissions also grant read access for the same resource.
393
+ *
394
+ * @example
395
+ * await client.entries.list({
396
+ * "collectionID": "coll_example",
397
+ * "limit": 20
398
+ * });
399
+ */
400
+ list: Operation<"entries.list", Workspace>;
401
+ };
402
+ extensions: {
403
+ /**
404
+ * Get the extension
405
+ *
406
+ * Returns the installed extension that the token's subject names, including disabled and uninstalled extensions.
407
+ */
408
+ getSelf: Operation<"extensions.getSelf", Workspace>;
409
+ /**
410
+ * Verify a session token
411
+ *
412
+ * Verifies a session token from the extension frontend and returns its member. Tokens of other extensions, expired tokens, and tokens of an earlier extension generation fail with NOT_FOUND.
413
+ */
414
+ verifySession: Operation<"extensions.verifySession", Workspace>;
415
+ /**
416
+ * List installations
417
+ *
418
+ * Lists the installations of the extension on this instance. Requires an app-level token: an extension JWT without a subject.
419
+ */
420
+ listInstallations: Operation<"extensions.listInstallations", Workspace>;
421
+ /**
422
+ * Get a delivery
423
+ *
424
+ * Returns the event of a delivery to one of the extension's webhooks. Disabled and uninstalled extensions can read only lifecycle deliveries.
425
+ */
426
+ getSelfDelivery: Operation<"extensions.getSelfDelivery", Workspace>;
427
+ /**
428
+ * Get the configuration
429
+ *
430
+ * Returns the extension's configuration, including secret fields, and its revision. Unset fields use their defaults.
431
+ */
432
+ getSelfConfiguration: Operation<"extensions.getSelfConfiguration", Workspace>;
433
+ /**
434
+ * Get a storage entry
435
+ *
436
+ * Returns an entry of the extension's storage, or NOT_FOUND.
437
+ */
438
+ getSelfStorageEntry: Operation<"extensions.getSelfStorageEntry", Workspace>;
439
+ /**
440
+ * Set a storage entry
441
+ *
442
+ * Creates or replaces an entry of the extension's storage. Values are JSON up to 128 KiB; the storage holds up to 10,000 entries and 10 MiB.
443
+ */
444
+ setSelfStorageEntry: Operation<"extensions.setSelfStorageEntry", Workspace>;
445
+ /**
446
+ * Delete a storage entry
447
+ *
448
+ * Deletes an entry of the extension's storage, if it exists.
449
+ */
450
+ deleteSelfStorageEntry: Operation<"extensions.deleteSelfStorageEntry", Workspace>;
451
+ /**
452
+ * List storage entries
453
+ *
454
+ * Lists the extension's storage entries in key order, optionally with a key prefix. A page ends early when its values reach 192 KiB.
455
+ */
456
+ listSelfStorageEntries: Operation<"extensions.listSelfStorageEntries", Workspace>;
457
+ };
458
+ collections: {
459
+ /**
460
+ * Create a collection
461
+ *
462
+ * Creates a child collection. Without parentID, uses the workspace root. The name defaults to Untitled. Creation selects an available sibling name with a numeric suffix when needed. Names are trimmed and NFC-normalized. Derived URL slugs must be unique across sibling entries and collections, including case and punctuation variants. Names cannot contain a slash or equal a single dot or two dots. Restricted collections require a session with restricted_collections permission and the Pro plan; API keys cannot create them.
463
+ *
464
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
465
+ *
466
+ * @example
467
+ * await client.collections.create({
468
+ * "name": "Documentation",
469
+ * "parentID": "coll_example"
470
+ * });
471
+ */
472
+ create: Operation<"collections.create", Workspace>;
473
+ /**
474
+ * Delete collection trees
475
+ *
476
+ * Soft-deletes the selected collections, their descendants, and their entries. The workspace root cannot be deleted. An active schema migration can block this action.
477
+ *
478
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
479
+ *
480
+ * @example
481
+ * await client.collections.bulkDelete({
482
+ * "ids": [
483
+ * "coll_example"
484
+ * ]
485
+ * });
486
+ */
487
+ bulkDelete: Operation<"collections.bulkDelete", Workspace>;
488
+ /**
489
+ * Delete a collection tree
490
+ *
491
+ * Soft-deletes the collection, its descendants, and their entries. The workspace root cannot be deleted. An active schema migration can block this action.
492
+ *
493
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
494
+ *
495
+ * @example
496
+ * await client.collections.delete({
497
+ * "id": "coll_example"
498
+ * });
499
+ */
500
+ delete: Operation<"collections.delete", Workspace>;
501
+ /**
502
+ * Rename a collection
503
+ *
504
+ * Updates the collection name. Rejects names already used by a sibling entry or collection. An active schema migration can block this action.
505
+ *
506
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
507
+ *
508
+ * @example
509
+ * await client.collections.update({
510
+ * "id": "coll_example",
511
+ * "name": "Guides"
512
+ * });
513
+ */
514
+ update: Operation<"collections.update", Workspace>;
515
+ /**
516
+ * List collections
517
+ *
518
+ * Lists collections under the selected ancestor. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.
519
+ *
520
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
521
+ *
522
+ * @example
523
+ * await client.collections.list({
524
+ * "collectionID": "coll_example",
525
+ * "limit": 20
526
+ * });
527
+ */
528
+ list: Operation<"collections.list", Workspace>;
529
+ };
530
+ content: {
531
+ /**
532
+ * List published collections
533
+ *
534
+ * Returns a flat page of collections from a publication snapshot. The default channel is published. On later pages, pass the returned snapshotID and pagination.nextCursor, and omit channel. Optionally select direct children using collectionID, collectionPath, or collectionSlugPath. Results are ordered by ID, not display order.
535
+ *
536
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
537
+ *
538
+ * @example
539
+ * await client.content.listCollections({
540
+ * "channel": "published",
541
+ * "limit": 20
542
+ * });
543
+ */
544
+ listCollections: Operation<"content.listCollections", Workspace>;
545
+ /**
546
+ * List published entries
547
+ *
548
+ * Returns a flat page of entries from a publication snapshot. The default channel is published. On later pages, pass the returned snapshotID and pagination.nextCursor, and omit channel. Select direct children using collectionID, collectionPath, or collectionSlugPath, or include nested entries with descendants: true. descendants requires a collection scope. All property filters must match the assigned version. includeContent: true returns validated full content, properties, fragments, assets, and recorded schema metadata. An invalid full item fails the page. Keep the same scope and filters across pages. Results are ordered by ID, not display order.
549
+ *
550
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
551
+ *
552
+ * @example
553
+ * await client.content.listEntries({
554
+ * "channel": "published",
555
+ * "limit": 20
556
+ * });
557
+ */
558
+ listEntries: Operation<"content.listEntries", Workspace>;
559
+ /**
560
+ * Get a published entry schema
561
+ *
562
+ * Returns the exact recorded effective schema, or null for schema-less content. Uses the same publication access as content.get. Pass its snapshotID for a consistent read; use channel or snapshotID, not both.
563
+ *
564
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
565
+ *
566
+ * @example
567
+ * await client.content.getSchema({
568
+ * "entryID": "ent_example",
569
+ * "channel": "published"
570
+ * });
571
+ */
572
+ getSchema: Operation<"content.getSchema", Workspace>;
573
+ /**
574
+ * Download a published asset
575
+ *
576
+ * Returns binary image data from a publication snapshot. No API key is required. The asset must belong to the entry in that available snapshot. Use the asset URLs returned with published content.
577
+ *
578
+ * @example
579
+ * await client.content.getAsset({
580
+ * "workspaceID": "ws_example",
581
+ * "snapshotID": "snp_example",
582
+ * "entryID": "ent_example",
583
+ * "assetID": "ast_example",
584
+ * "variant": "display"
585
+ * });
586
+ */
587
+ getAsset: Operation<"content.getAsset", Workspace>;
588
+ /**
589
+ * Get published entry content
590
+ *
591
+ * Returns content from a publishing channel or a specific available snapshot. Use channel or snapshotID, never both. The default channel is published. Validates saved content against its recorded schema and returns schema metadata. expectedSchemaHash must match that revision; schema-less content cannot match it. Validation and hash checks run before ETag handling. Supports ETag and If-None-Match; a match returns 304 without a body.
592
+ *
593
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
594
+ *
595
+ * @example
596
+ * await client.content.get({
597
+ * "entryID": "ent_example",
598
+ * "channel": "published"
599
+ * });
600
+ */
601
+ get: Operation<"content.get", Workspace>;
602
+ /**
603
+ * Get a published collection tree
604
+ *
605
+ * Returns a published collection tree and its snapshot ID. Use channel or snapshotID, never both. The default channel is published. Reuse the snapshot ID for consistent content reads. Supports ETag and If-None-Match; a match returns 304 without a body.
606
+ *
607
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
608
+ *
609
+ * @example
610
+ * await client.content.getTree({
611
+ * "collectionID": "coll_example",
612
+ * "channel": "published"
613
+ * });
614
+ */
615
+ getTree: Operation<"content.getTree", Workspace>;
616
+ };
617
+ webhooks: {
618
+ /**
619
+ * List webhooks
620
+ *
621
+ * Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.
622
+ */
623
+ list: Operation<"webhooks.list", Workspace>;
624
+ /**
625
+ * Create a webhook
626
+ *
627
+ * Creates an enabled webhook unless `enabled` is false and returns the signing secret once. The caller must be able to read every resource type its events send, and restricted content when included.
628
+ *
629
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
630
+ */
631
+ create: Operation<"webhooks.create", Workspace>;
632
+ /**
633
+ * Get a webhook
634
+ *
635
+ * Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.
636
+ */
637
+ get: Operation<"webhooks.get", Workspace>;
638
+ /**
639
+ * Update a webhook
640
+ *
641
+ * Checks expectedRevision and validates the merged configuration. A URL change cancels pending deliveries and returns a replacement secret once. Scope changes require authority over the previous and new scope.
642
+ *
643
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
644
+ */
645
+ update: Operation<"webhooks.update", Workspace>;
646
+ /**
647
+ * Delete a webhook
648
+ *
649
+ * Cancels pending deliveries and destroys signing keys. Retains history until its original expiry; a deleted endpoint cannot be replayed.
650
+ *
651
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
652
+ */
653
+ delete: Operation<"webhooks.delete", Workspace>;
654
+ /**
655
+ * Enable or disable webhooks
656
+ *
657
+ * Applies the state to every listed webhook in one transaction, checking each expectedRevision. Enabling checks the scope authority and destination of each webhook. Webhooks already in the state are unchanged.
658
+ *
659
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
660
+ */
661
+ bulkSetEnabled: Operation<"webhooks.bulkSetEnabled", Workspace>;
662
+ /**
663
+ * Delete webhooks
664
+ *
665
+ * Deletes every listed webhook in one transaction, checking each expectedRevision. Each deletion cancels pending deliveries and destroys signing keys; history stays until its original expiry.
666
+ *
667
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
668
+ */
669
+ bulkDelete: Operation<"webhooks.bulkDelete", Workspace>;
670
+ /**
671
+ * Rotate a webhook secret
672
+ *
673
+ * Returns a new secret once. Overlap keeps the old secret valid for 24 hours. Immediate rotation retires it at once. Normal rotation conflicts while a previous overlap remains active.
674
+ *
675
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
676
+ */
677
+ rotateSecret: Operation<"webhooks.rotateSecret", Workspace>;
678
+ /**
679
+ * Send a webhook test
680
+ *
681
+ * Schedules one signed synthetic attempt for this endpoint, including when disabled. The event must be selected by the endpoint. It does not enable the endpoint or change content.
682
+ *
683
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
684
+ */
685
+ sendTest: Operation<"webhooks.sendTest", Workspace>;
686
+ /**
687
+ * List webhook deliveries
688
+ *
689
+ * Returns unexpired history, including for a deleted endpoint. Metadata does not include event payloads.
690
+ *
691
+ * Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.
692
+ */
693
+ listDeliveries: Operation<"webhooks.listDeliveries", Workspace>;
694
+ /**
695
+ * Get a webhook delivery
696
+ *
697
+ * Returns retained delivery metadata and, with content authority, the immutable event payload. Expired deliveries return not found even before physical cleanup.
698
+ *
699
+ * Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.
700
+ */
701
+ getDelivery: Operation<"webhooks.getDelivery", Workspace>;
702
+ /**
703
+ * List delivery runs
704
+ *
705
+ * Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.
706
+ */
707
+ listRuns: Operation<"webhooks.listRuns", Workspace>;
708
+ /**
709
+ * List delivery attempts
710
+ *
711
+ * Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.
712
+ */
713
+ listAttempts: Operation<"webhooks.listAttempts", Workspace>;
714
+ /**
715
+ * Redeliver a webhook event
716
+ *
717
+ * Checks the reviewed destination revision and current scope authority. Reuses the original event ID, payload, and expiry. Returns a conflict if a run is active, or the endpoint is disabled or deleted.
718
+ *
719
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
720
+ */
721
+ redeliver: Operation<"webhooks.redeliver", Workspace>;
722
+ /**
723
+ * Redeliver webhook events
724
+ *
725
+ * Replays every listed delivery in one transaction with the same checks as a single redelivery. Any ineligible delivery fails the whole request. Counts as one request for rate limiting.
726
+ *
727
+ * Required API key permissions: webhooks. Write permissions also grant read access for the same resource.
728
+ */
729
+ bulkRedeliver: Operation<"webhooks.bulkRedeliver", Workspace>;
730
+ };
731
+ roles: {
732
+ /**
733
+ * List roles
734
+ *
735
+ * Returns workspace roles and their permissions.
736
+ *
737
+ * Required API key permissions: read:roles. Write permissions also grant read access for the same resource.
738
+ *
739
+ * @example
740
+ * await client.roles.list({});
741
+ */
742
+ list: Operation<"roles.list", Workspace>;
743
+ /**
744
+ * Create a role
745
+ *
746
+ * Creates a workspace role. Names are unique without regard to case and must contain 1 to 50 characters after trimming. Requires the Pro plan and permission to delegate the selected permissions.
747
+ *
748
+ * Required API key permissions: roles. Write permissions also grant read access for the same resource.
749
+ *
750
+ * @example
751
+ * await client.roles.create({
752
+ * "name": "Editor",
753
+ * "permissions": [
754
+ * "content"
755
+ * ]
756
+ * });
757
+ */
758
+ create: Operation<"roles.create", Workspace>;
759
+ /**
760
+ * Update a role
761
+ *
762
+ * Changes a role name or permissions. Names are unique without regard to case. Requires the Pro plan and permission to delegate the selected permissions. Built-in roles have additional restrictions.
763
+ *
764
+ * Required API key permissions: roles. Write permissions also grant read access for the same resource.
765
+ *
766
+ * @example
767
+ * await client.roles.update({
768
+ * "id": "rl_example",
769
+ * "name": "Content editor"
770
+ * });
771
+ */
772
+ update: Operation<"roles.update", Workspace>;
773
+ /**
774
+ * Delete a role
775
+ *
776
+ * Deletes a custom role and updates its assignments. Built-in roles cannot be deleted. Requires the Pro plan.
777
+ *
778
+ * Required API key permissions: roles. Write permissions also grant read access for the same resource.
779
+ *
780
+ * @example
781
+ * await client.roles.delete({
782
+ * "id": "rl_example"
783
+ * });
784
+ */
785
+ delete: Operation<"roles.delete", Workspace>;
786
+ };
787
+ search: {
788
+ /**
789
+ * Search current content
790
+ *
791
+ * Searches current entry content by text and optional property filters. Up to 20 filters and 50 results are allowed. Semantic search is optional, uses 1 AI credit, and has a separate rate limit.
792
+ *
793
+ * Required API key permissions: read:entries, read:collections. Write permissions also grant read access for the same resource.
794
+ *
795
+ * @example
796
+ * await client.search.current({
797
+ * "query": "installation",
798
+ * "limit": 10
799
+ * });
800
+ */
801
+ current: Operation<"search.current", Workspace>;
802
+ /**
803
+ * Search published content
804
+ *
805
+ * Searches content published to the required channel. Up to 20 filters and 50 results are allowed. Semantic search is optional, uses 1 AI credit, and has a separate rate limit.
806
+ *
807
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
808
+ *
809
+ * @example
810
+ * await client.search.published({
811
+ * "query": "installation",
812
+ * "channel": "published",
813
+ * "limit": 10
814
+ * });
815
+ */
816
+ published: Operation<"search.published", Workspace>;
817
+ /**
818
+ * Ask AI about current content
819
+ *
820
+ * Returns a complete answer with numbered sources. Requires explicit ai-answers permission in addition to content read permissions. Accepts up to 1,000 question characters, 10 history messages of up to 4,000 characters each, and 20 property filters. Uses 3 AI credits and the Ask AI rate limit. Use a secret key on your server, or a publishable key for published content.
821
+ *
822
+ * Required API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.
823
+ *
824
+ * @example
825
+ * await client.search.askCurrent({
826
+ * "question": "How do I install Andesine?"
827
+ * });
828
+ */
829
+ askCurrent: Operation<"search.askCurrent", Workspace>;
830
+ /**
831
+ * Ask AI about published content
832
+ *
833
+ * Returns a complete answer with numbered sources. Requires explicit ai-answers permission in addition to content read permissions. Accepts up to 1,000 question characters, 10 history messages of up to 4,000 characters each, and 20 property filters. Uses 3 AI credits and the Ask AI rate limit. Use a secret key on your server, or a publishable key for published content.
834
+ *
835
+ * Required API key permissions: ai-answers, read:publishing. Write permissions also grant read access for the same resource.
836
+ *
837
+ * @example
838
+ * await client.search.askPublished({
839
+ * "question": "How do I install Andesine?",
840
+ * "channel": "published"
841
+ * });
842
+ */
843
+ askPublished: Operation<"search.askPublished", Workspace>;
844
+ /**
845
+ * Stream an AI answer about current content
846
+ *
847
+ * Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.
848
+ *
849
+ * Required API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.
850
+ */
851
+ askCurrentStream: Operation<"search.askCurrentStream", Workspace>;
852
+ /**
853
+ * Stream an AI answer about published content
854
+ *
855
+ * Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.
856
+ *
857
+ * Required API key permissions: ai-answers, read:publishing. Write permissions also grant read access for the same resource.
858
+ */
859
+ askPublishedStream: Operation<"search.askPublishedStream", Workspace>;
860
+ };
861
+ schemas: {
862
+ /**
863
+ * Create a local collection schema
864
+ *
865
+ * Creates a local schema draft for the collection. Use schemas.get to inspect local and effective schemas.
866
+ *
867
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
868
+ *
869
+ * @example
870
+ * await client.schemas.create({
871
+ * "collectionID": "coll_example"
872
+ * });
873
+ */
874
+ create: Operation<"schemas.create", Workspace>;
875
+ /**
876
+ * Delete a local schema
877
+ *
878
+ * Removes the local schema and recalculates inherited schemas. This can start a content migration. Review possible content removal before setting confirmedDataLoss. Use schemaMigrations.get with a returned migrationID.
879
+ *
880
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
881
+ *
882
+ * @example
883
+ * await client.schemas.delete({
884
+ * "schemaID": "sch_example",
885
+ * "confirmedDataLoss": false
886
+ * });
887
+ */
888
+ delete: Operation<"schemas.delete", Workspace>;
889
+ /**
890
+ * Get an exact schema revision
891
+ *
892
+ * Returns the recorded effective definition, including inherited fields. Requires read access to the revision's collection. The definition is independent of the currently active schema.
893
+ *
894
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
895
+ *
896
+ * @example
897
+ * await client.schemas.getRevision({
898
+ * "revisionID": "schr_example"
899
+ * });
900
+ */
901
+ getRevision: Operation<"schemas.getRevision", Workspace>;
902
+ /**
903
+ * Get collection schemas
904
+ *
905
+ * Returns local and effective schema details for the collection, including inheritance.
906
+ *
907
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
908
+ *
909
+ * @example
910
+ * await client.schemas.get({
911
+ * "collectionID": "coll_example"
912
+ * });
913
+ */
914
+ get: Operation<"schemas.get", Workspace>;
915
+ /**
916
+ * Apply a schema draft
917
+ *
918
+ * Creates a schema version from the draft and starts any required migration of affected entry content. Review possible content removal before calling: confirmedDataLoss must be true. Use schemaMigrations.get to follow a returned migrationID.
919
+ *
920
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
921
+ *
922
+ * @example
923
+ * await client.schemas.apply({
924
+ * "schemaID": "sch_example",
925
+ * "confirmedDataLoss": true,
926
+ * "name": "Reviewed schema"
927
+ * });
928
+ */
929
+ apply: Operation<"schemas.apply", Workspace>;
930
+ };
931
+ schemaMigrations: {
932
+ /**
933
+ * List entries with migration content loss
934
+ *
935
+ * Lists accessible, non-deleted entries that lost content in a completed migration. Returns an empty page until completion. Use pagination.nextCursor to continue.
936
+ *
937
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
938
+ *
939
+ * @example
940
+ * await client.schemaMigrations.listContentLossEntries({
941
+ * "id": "smg_example",
942
+ * "limit": 20
943
+ * });
944
+ */
945
+ listContentLossEntries: Operation<"schemaMigrations.listContentLossEntries", Workspace>;
946
+ /**
947
+ * Get the active schema migration
948
+ *
949
+ * Returns the active migration for a collection, or null when none is active.
950
+ *
951
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
952
+ *
953
+ * @example
954
+ * await client.schemaMigrations.getActive({
955
+ * "collectionID": "coll_example"
956
+ * });
957
+ */
958
+ getActive: Operation<"schemaMigrations.getActive", Workspace>;
959
+ /**
960
+ * Get schema migration status
961
+ *
962
+ * Returns bounded migration progress and status. Use schemaMigrations.listContentLossEntries for per-entry content loss details. Check status before repeating an operation blocked by this migration.
963
+ *
964
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
965
+ *
966
+ * @example
967
+ * await client.schemaMigrations.get({
968
+ * "id": "smg_example"
969
+ * });
970
+ */
971
+ get: Operation<"schemaMigrations.get", Workspace>;
972
+ };
973
+ schemaVersions: {
974
+ /**
975
+ * List schema versions
976
+ *
977
+ * Lists versions of a local collection schema. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.
978
+ *
979
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
980
+ *
981
+ * @example
982
+ * await client.schemaVersions.list({
983
+ * "schemaID": "sch_example",
984
+ * "limit": 20
985
+ * });
986
+ */
987
+ list: Operation<"schemaVersions.list", Workspace>;
988
+ /**
989
+ * Get a schema version
990
+ *
991
+ * Returns a saved schema version and its definition.
992
+ *
993
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
994
+ *
995
+ * @example
996
+ * await client.schemaVersions.get({
997
+ * "id": "schv_example"
998
+ * });
999
+ */
1000
+ get: Operation<"schemaVersions.get", Workspace>;
1001
+ /**
1002
+ * Rename a schema version
1003
+ *
1004
+ * Changes the saved version name. Set name to null to remove the name.
1005
+ *
1006
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
1007
+ *
1008
+ * @example
1009
+ * await client.schemaVersions.update({
1010
+ * "id": "schv_example",
1011
+ * "name": "Reviewed schema"
1012
+ * });
1013
+ */
1014
+ update: Operation<"schemaVersions.update", Workspace>;
1015
+ /**
1016
+ * Restore a schema version
1017
+ *
1018
+ * Restores the selected definition and starts any required content migration. Review possible content removal before calling: confirmedDataLoss must be true. Use schemaMigrations.get to follow a returned migrationID.
1019
+ *
1020
+ * Required API key permissions: collections. Write permissions also grant read access for the same resource.
1021
+ *
1022
+ * @example
1023
+ * await client.schemaVersions.revert({
1024
+ * "id": "schv_example",
1025
+ * "confirmedDataLoss": true
1026
+ * });
1027
+ */
1028
+ revert: Operation<"schemaVersions.revert", Workspace>;
1029
+ };
1030
+ memberships: {
1031
+ /**
1032
+ * List workspace members
1033
+ *
1034
+ * Lists workspace memberships with role and user details. Use pagination.nextCursor to continue with the same filters; concurrent changes can affect later pages.
1035
+ *
1036
+ * Required API key permissions: read:memberships. Write permissions also grant read access for the same resource.
1037
+ *
1038
+ * @example
1039
+ * await client.memberships.list({});
1040
+ */
1041
+ list: Operation<"memberships.list", Workspace>;
1042
+ /**
1043
+ * Invite a workspace member
1044
+ *
1045
+ * Creates an invitation and attempts email delivery. Check emailDelivery in the result. Requires the Pro plan and permission to delegate the selected role. Existing membership or pending invitation returns a conflict.
1046
+ *
1047
+ * Required API key permissions: memberships. Write permissions also grant read access for the same resource.
1048
+ *
1049
+ * @example
1050
+ * await client.memberships.invite({
1051
+ * "email": "editor@example.com",
1052
+ * "roleID": "rl_example"
1053
+ * });
1054
+ */
1055
+ invite: Operation<"memberships.invite", Workspace>;
1056
+ /**
1057
+ * Change a member role
1058
+ *
1059
+ * Assigns a new role to a member. Requires the Pro plan and permission to delegate that role. Administrator assignments have additional restrictions.
1060
+ *
1061
+ * Required API key permissions: memberships. Write permissions also grant read access for the same resource.
1062
+ *
1063
+ * @example
1064
+ * await client.memberships.update({
1065
+ * "id": "ms_example",
1066
+ * "roleID": "rl_example"
1067
+ * });
1068
+ */
1069
+ update: Operation<"memberships.update", Workspace>;
1070
+ /**
1071
+ * Remove a workspace member
1072
+ *
1073
+ * Removes the membership and its workspace access. Administrator memberships have additional restrictions.
1074
+ *
1075
+ * Required API key permissions: memberships. Write permissions also grant read access for the same resource.
1076
+ *
1077
+ * @example
1078
+ * await client.memberships.remove({
1079
+ * "id": "ms_example"
1080
+ * });
1081
+ */
1082
+ remove: Operation<"memberships.remove", Workspace>;
1083
+ /**
1084
+ * List invitations
1085
+ *
1086
+ * Lists pending, unexpired workspace invitations. Use pagination.nextCursor to continue. Requires the Pro plan.
1087
+ *
1088
+ * Required API key permissions: memberships. Write permissions also grant read access for the same resource.
1089
+ *
1090
+ * @example
1091
+ * await client.memberships.listInvites({});
1092
+ */
1093
+ listInvites: Operation<"memberships.listInvites", Workspace>;
1094
+ /**
1095
+ * Resend an invitation
1096
+ *
1097
+ * Attempts email delivery again for a pending invitation. Check emailDelivery in the result. Requires the Pro plan.
1098
+ *
1099
+ * Required API key permissions: memberships. Write permissions also grant read access for the same resource.
1100
+ *
1101
+ * @example
1102
+ * await client.memberships.resendInvite({
1103
+ * "id": "inv_example"
1104
+ * });
1105
+ */
1106
+ resendInvite: Operation<"memberships.resendInvite", Workspace>;
1107
+ /**
1108
+ * Revoke an invitation
1109
+ *
1110
+ * Revokes a pending invitation so it can no longer be accepted. Requires the Pro plan.
1111
+ *
1112
+ * Required API key permissions: memberships. Write permissions also grant read access for the same resource.
1113
+ *
1114
+ * @example
1115
+ * await client.memberships.revokeInvite({
1116
+ * "id": "inv_example"
1117
+ * });
1118
+ */
1119
+ revokeInvite: Operation<"memberships.revokeInvite", Workspace>;
1120
+ };
1121
+ publishing: {
1122
+ /**
1123
+ * Configure collection publishing
1124
+ *
1125
+ * Enables publishing for a collection, or disables it and unpublishes its tree from all channels. When enabling, publish can also publish the latest entry versions.
1126
+ *
1127
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1128
+ *
1129
+ * @example
1130
+ * await client.publishing.setCollection({
1131
+ * "collectionID": "coll_example",
1132
+ * "enabled": true,
1133
+ * "publish": false
1134
+ * });
1135
+ */
1136
+ setCollection: Operation<"publishing.setCollection", Workspace>;
1137
+ /**
1138
+ * Publish a collection tree
1139
+ *
1140
+ * Publishes the latest entry versions in a publishing-enabled collection tree to the channel. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1141
+ *
1142
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1143
+ *
1144
+ * @example
1145
+ * await client.publishing.publishCollection({
1146
+ * "collectionID": "coll_example",
1147
+ * "channel": "published"
1148
+ * });
1149
+ */
1150
+ publishCollection: Operation<"publishing.publishCollection", Workspace>;
1151
+ /**
1152
+ * Unpublish a collection tree
1153
+ *
1154
+ * Removes publication assignments for a collection tree from the channel. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1155
+ *
1156
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1157
+ *
1158
+ * @example
1159
+ * await client.publishing.unpublishCollection({
1160
+ * "collectionID": "coll_example",
1161
+ * "channel": "published"
1162
+ * });
1163
+ */
1164
+ unpublishCollection: Operation<"publishing.unpublishCollection", Workspace>;
1165
+ /**
1166
+ * Configure publishing for collections
1167
+ *
1168
+ * Enables publishing for the selected collections, or disables it and unpublishes their trees from all channels. When enabling, publish can also publish the latest entry versions.
1169
+ *
1170
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1171
+ *
1172
+ * @example
1173
+ * await client.publishing.bulkSetCollections({
1174
+ * "ids": [
1175
+ * "coll_example"
1176
+ * ],
1177
+ * "enabled": true,
1178
+ * "publish": false
1179
+ * });
1180
+ */
1181
+ bulkSetCollections: Operation<"publishing.bulkSetCollections", Workspace>;
1182
+ /**
1183
+ * Publish collection trees
1184
+ *
1185
+ * Publishes the latest entry versions in the selected publishing-enabled collection trees. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1186
+ *
1187
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1188
+ *
1189
+ * @example
1190
+ * await client.publishing.bulkPublishCollections({
1191
+ * "ids": [
1192
+ * "coll_example"
1193
+ * ],
1194
+ * "channel": "published"
1195
+ * });
1196
+ */
1197
+ bulkPublishCollections: Operation<"publishing.bulkPublishCollections", Workspace>;
1198
+ /**
1199
+ * Unpublish collection trees
1200
+ *
1201
+ * Removes publication assignments for the selected collection trees from the channel. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1202
+ *
1203
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1204
+ *
1205
+ * @example
1206
+ * await client.publishing.bulkUnpublishCollections({
1207
+ * "ids": [
1208
+ * "coll_example"
1209
+ * ],
1210
+ * "channel": "published"
1211
+ * });
1212
+ */
1213
+ bulkUnpublishCollections: Operation<"publishing.bulkUnpublishCollections", Workspace>;
1214
+ /**
1215
+ * Publish an entry
1216
+ *
1217
+ * Publishes an existing version, or the latest entry content if versionID is omitted. The entry must be in a publishing-enabled collection. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1218
+ *
1219
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1220
+ *
1221
+ * @example
1222
+ * await client.publishing.publishEntry({
1223
+ * "entryID": "ent_example",
1224
+ * "channel": "published"
1225
+ * });
1226
+ */
1227
+ publishEntry: Operation<"publishing.publishEntry", Workspace>;
1228
+ /**
1229
+ * Unpublish an entry
1230
+ *
1231
+ * Removes the entry publication from the channel. Supply versionID to require that version to be assigned; a changed assignment returns a conflict. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1232
+ *
1233
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1234
+ *
1235
+ * @example
1236
+ * await client.publishing.unpublishEntry({
1237
+ * "entryID": "ent_example",
1238
+ * "channel": "published",
1239
+ * "versionID": "ver_example"
1240
+ * });
1241
+ */
1242
+ unpublishEntry: Operation<"publishing.unpublishEntry", Workspace>;
1243
+ /**
1244
+ * Publish entries
1245
+ *
1246
+ * Publishes the selected entries with optional version IDs. Entries must be in publishing-enabled collections. At least one entry is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1247
+ *
1248
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1249
+ *
1250
+ * @example
1251
+ * await client.publishing.bulkPublishEntries({
1252
+ * "entries": [
1253
+ * {
1254
+ * "entryID": "ent_example"
1255
+ * }
1256
+ * ],
1257
+ * "channel": "published"
1258
+ * });
1259
+ */
1260
+ bulkPublishEntries: Operation<"publishing.bulkPublishEntries", Workspace>;
1261
+ /**
1262
+ * Unpublish entries
1263
+ *
1264
+ * Removes publication assignments for the selected entries from the channel. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.
1265
+ *
1266
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1267
+ *
1268
+ * @example
1269
+ * await client.publishing.bulkUnpublishEntries({
1270
+ * "ids": [
1271
+ * "ent_example"
1272
+ * ],
1273
+ * "channel": "published"
1274
+ * });
1275
+ */
1276
+ bulkUnpublishEntries: Operation<"publishing.bulkUnpublishEntries", Workspace>;
1277
+ /**
1278
+ * Revert pending publishing changes
1279
+ *
1280
+ * Restores selected drafts to the reviewed publication snapshot. This can remove unpublished items and replace draft content. First review publishing.getChannelContent and pass its snapshotID. Use all: true or specific collectionIDs/entryIDs, never both. Requires write access to affected resources in addition to read:publishing.
1281
+ *
1282
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
1283
+ *
1284
+ * @example
1285
+ * await client.publishing.revertChanges({
1286
+ * "collectionID": "coll_example",
1287
+ * "snapshotID": "snp_example",
1288
+ * "entryIDs": [
1289
+ * "ent_example"
1290
+ * ],
1291
+ * "channel": "published"
1292
+ * });
1293
+ */
1294
+ revertChanges: Operation<"publishing.revertChanges", Workspace>;
1295
+ /**
1296
+ * Get a published entry version
1297
+ *
1298
+ * Returns the entry version assigned to a channel, or to an explicit available snapshot, with its recorded schema metadata. Validates content against that revision. expectedSchemaHash must match it; schema-less content cannot match it. The default channel is published.
1299
+ *
1300
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
1301
+ *
1302
+ * @example
1303
+ * await client.publishing.getEntryVersion({
1304
+ * "entryID": "ent_example",
1305
+ * "channel": "published"
1306
+ * });
1307
+ */
1308
+ getEntryVersion: Operation<"publishing.getEntryVersion", Workspace>;
1309
+ /**
1310
+ * List entry publications
1311
+ *
1312
+ * Returns the entry publication assignments across channels.
1313
+ *
1314
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
1315
+ *
1316
+ * @example
1317
+ * await client.publishing.listEntryPublications({
1318
+ * "entryID": "ent_example"
1319
+ * });
1320
+ */
1321
+ listEntryPublications: Operation<"publishing.listEntryPublications", Workspace>;
1322
+ /**
1323
+ * List publishing channels
1324
+ *
1325
+ * Returns workspace publishing channels. Set includeAssignmentCount to include entry assignment counts.
1326
+ *
1327
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
1328
+ *
1329
+ * @example
1330
+ * await client.publishing.listChannels({
1331
+ * "includeAssignmentCount": true
1332
+ * });
1333
+ */
1334
+ listChannels: Operation<"publishing.listChannels", Workspace>;
1335
+ /**
1336
+ * Create a publishing channel
1337
+ *
1338
+ * Creates a publishing channel from its display name and returns the generated channel code.
1339
+ *
1340
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1341
+ *
1342
+ * @example
1343
+ * await client.publishing.createChannel({
1344
+ * "name": "Preview"
1345
+ * });
1346
+ */
1347
+ createChannel: Operation<"publishing.createChannel", Workspace>;
1348
+ /**
1349
+ * Get channel content and pending changes
1350
+ *
1351
+ * Returns publication state and pending changes for a publishing root, with the snapshot ID needed to review and revert changes.
1352
+ *
1353
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
1354
+ *
1355
+ * @example
1356
+ * await client.publishing.getChannelContent({
1357
+ * "channel": "published",
1358
+ * "collectionID": "coll_example"
1359
+ * });
1360
+ */
1361
+ getChannelContent: Operation<"publishing.getChannelContent", Workspace>;
1362
+ /**
1363
+ * Delete a publishing channel
1364
+ *
1365
+ * Deletes a custom channel and its publication assignments. The default published channel cannot be deleted.
1366
+ *
1367
+ * Required API key permissions: publishing. Write permissions also grant read access for the same resource.
1368
+ *
1369
+ * @example
1370
+ * await client.publishing.deleteChannel({
1371
+ * "code": "preview"
1372
+ * });
1373
+ */
1374
+ deleteChannel: Operation<"publishing.deleteChannel", Workspace>;
1375
+ };
1376
+ workspaces: {
1377
+ /**
1378
+ * List available workspaces
1379
+ *
1380
+ * Lists workspaces available to the OAuth user, with current role permissions and plan access. Browser sessions can list workspaces across signed-in accounts. Does not require workspace selection and does not count toward API usage.
1381
+ */
1382
+ list: Operation<"workspaces.list", Workspace>;
1383
+ };
1384
+ versions: {
1385
+ /**
1386
+ * Create an entry version
1387
+ *
1388
+ * Saves a version of the current entry content. Optionally assigns a name.
1389
+ *
1390
+ * Required API key permissions: versions. Write permissions also grant read access for the same resource.
1391
+ *
1392
+ * @example
1393
+ * await client.versions.create({
1394
+ * "entryID": "ent_example",
1395
+ * "name": "Before release"
1396
+ * });
1397
+ */
1398
+ create: Operation<"versions.create", Workspace>;
1399
+ /**
1400
+ * List entry versions
1401
+ *
1402
+ * Lists saved entry versions. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.
1403
+ *
1404
+ * Required API key permissions: read:versions. Write permissions also grant read access for the same resource.
1405
+ *
1406
+ * @example
1407
+ * await client.versions.list({
1408
+ * "entryID": "ent_example",
1409
+ * "limit": 20
1410
+ * });
1411
+ */
1412
+ list: Operation<"versions.list", Workspace>;
1413
+ /**
1414
+ * Get an entry version
1415
+ *
1416
+ * Returns the saved content and recorded schema metadata of an entry version. Validates against its recorded revision, including historical versions. expectedSchemaHash must match that revision; schema-less content cannot match it.
1417
+ *
1418
+ * Required API key permissions: read:versions. Write permissions also grant read access for the same resource.
1419
+ *
1420
+ * @example
1421
+ * await client.versions.get({
1422
+ * "id": "ver_example"
1423
+ * });
1424
+ */
1425
+ get: Operation<"versions.get", Workspace>;
1426
+ /**
1427
+ * Rename an entry version
1428
+ *
1429
+ * Changes the saved version name. Set name to null to remove the name.
1430
+ *
1431
+ * Required API key permissions: versions. Write permissions also grant read access for the same resource.
1432
+ *
1433
+ * @example
1434
+ * await client.versions.update({
1435
+ * "id": "ver_example",
1436
+ * "name": "Release candidate"
1437
+ * });
1438
+ */
1439
+ update: Operation<"versions.update", Workspace>;
1440
+ /**
1441
+ * Restore an entry version
1442
+ *
1443
+ * Restores saved content to the current entry and returns the resulting version. An active schema migration can block this action.
1444
+ *
1445
+ * Required API key permissions: versions. Write permissions also grant read access for the same resource.
1446
+ *
1447
+ * @example
1448
+ * await client.versions.revert({
1449
+ * "id": "ver_example"
1450
+ * });
1451
+ */
1452
+ revert: Operation<"versions.revert", Workspace>;
1453
+ };
1454
+ typeMetadata: {
1455
+ /**
1456
+ * Get current content type metadata
1457
+ *
1458
+ * Read-only bulk metadata for type generation. Returns one consistent database snapshot of accessible collections and their active effective schemas, including inheritance. Optional entry/tree data requires read:entries in addition to read:collections. Explicit unavailable collection selectors fail. Active schema migrations in the selected collections return a conflict. No entry content is loaded. Schema-free collections use general types without warnings.
1459
+ *
1460
+ * Required API key permissions: read:collections. Write permissions also grant read access for the same resource.
1461
+ *
1462
+ * @example
1463
+ * await client.typeMetadata.getCurrent({
1464
+ * "collections": [
1465
+ * "/Tutorials"
1466
+ * ],
1467
+ * "includeEntries": false
1468
+ * });
1469
+ */
1470
+ getCurrent: Operation<"typeMetadata.getCurrent", Workspace>;
1471
+ /**
1472
+ * Get published content type metadata
1473
+ *
1474
+ * Read-only bulk metadata for type generation. Resolves a channel once (published by default), or reads a retained snapshot. Uses publication paths, names, and exact entry-version schema revisions; never substitutes current schemas. Supports mixed revisions and schema-free entries. Empty collections use general types without warnings. Includes selected subtrees; no selectors means all published collections and root entries. Publication-access rules match content.get. No entry content is loaded. Reuse source.snapshotID for related reads. The fingerprint changes only when returned type metadata changes, not when content-only publication creates a new snapshot.
1475
+ *
1476
+ * Required API key permissions: read:publishing. Write permissions also grant read access for the same resource.
1477
+ *
1478
+ * @example
1479
+ * await client.typeMetadata.getPublished({
1480
+ * "channel": "published",
1481
+ * "collections": [
1482
+ * "/Tutorials"
1483
+ * ]
1484
+ * });
1485
+ */
1486
+ getPublished: Operation<"typeMetadata.getPublished", Workspace>;
1487
+ };
1488
+ }
1489
+ //#endregion
1490
+ //#region src/content-client.d.ts
1491
+ interface ContentClient<Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> extends ContentResources<Workspace> {
1492
+ /**
1493
+ * Iterate published entries, automatically keeping the first page's snapshot.
1494
+ *
1495
+ * @param input - List scope, filters, and page size. Set includeContent to true for full entries.
1496
+ * To resume, supply both cursor and snapshotID, or use a client from atSnapshot().
1497
+ * @param options - Options for each request. The timeout applies to each page separately.
1498
+ * @returns A lazy iterator in API order. Breaking the loop prevents further requests.
1499
+ * @throws API errors without switching to a newer snapshot, including expired snapshots.
1500
+ * @example
1501
+ * for await (const entry of client.content.paginateEntries({
1502
+ * collectionPath: "/Tutorials", includeContent: true
1503
+ * })) console.log(entry.properties);
1504
+ */
1505
+ paginateEntries<const Input extends EntryListInput = Record<string, never>>(input?: Input, options?: ContentPaginationOptions): AsyncGenerator<ContentListOutput<Input, Workspace>["data"][number]>;
1506
+ /**
1507
+ * Iterate entry pages while retaining snapshot metadata and resume cursors.
1508
+ *
1509
+ * The first response selects the snapshot; later requests omit channel and reuse that snapshot.
1510
+ * Scope and filters are reused for every page. An existing atSnapshot() binding is respected.
1511
+ * @param input - List options. Resuming requires cursor and its snapshot, with the same filters.
1512
+ * @param options - Per-page request options, including cancellation and timeout.
1513
+ * @returns Lazy pages with includeContent-dependent item types and snapshot metadata.
1514
+ * @throws API errors or an error for a missing/repeated cursor or changed response snapshot.
1515
+ */
1516
+ paginateEntryPages<const Input extends EntryListInput = Record<string, never>>(input?: Input, options?: ContentPaginationOptions): AsyncGenerator<ContentListOutput<Input, Workspace>>;
1517
+ /**
1518
+ * Iterate published collections using the first page's snapshot for all later pages.
1519
+ *
1520
+ * @param input - Collection scope and page size. To resume, supply cursor and its snapshot.
1521
+ * @param options - Per-page request options. Break the loop to stop requesting pages.
1522
+ * @returns A lazy iterator of collection summaries in API order.
1523
+ * @throws API and pagination errors; unavailable snapshots are never replaced automatically.
1524
+ */
1525
+ paginateCollections(input?: OperationInput<"content.listCollections">, options?: ContentPaginationOptions): AsyncGenerator<OperationOutput<"content.listCollections">["data"][number]>;
1526
+ /**
1527
+ * Iterate collection pages with snapshot metadata and resume cursors.
1528
+ *
1529
+ * @param input - List options. Use the same scope and snapshot when resuming a cursor.
1530
+ * @param options - Options applied to each request, including cancellation and timeout.
1531
+ * @returns Lazy pages pinned to the first response's snapshot or the atSnapshot() binding.
1532
+ * @throws API errors or an error for a missing/repeated cursor or changed response snapshot.
1533
+ */
1534
+ paginateCollectionPages(input?: OperationInput<"content.listCollections">, options?: ContentPaginationOptions): AsyncGenerator<OperationOutput<"content.listCollections">>;
1535
+ }
1536
+ type ContentResources<Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> = APIResources<Workspace>["content"];
1537
+ type EntryListInput = OperationInput<"content.listEntries">;
1538
+ type ContentPaginationOptions = RequestOptions & {
1539
+ response?: "data";
1540
+ };
1541
+ //#endregion
1542
+ //#region src/client.d.ts
1543
+ interface AndesineClient<Workspace extends WorkspaceTypeMap = WorkspaceTypeMap> extends APIResources<Workspace> {
1544
+ content: ContentClient<Workspace>;
1545
+ /**
1546
+ * Bind published-content reads and pagination to an existing snapshot.
1547
+ * @param snapshotID - Snapshot ID returned by a published-content response.
1548
+ * @returns Content methods, including snapshot-aware entry and collection iterators.
1549
+ * No request is made until a method is called or an iterator is consumed.
1550
+ * @throws TypeError if a later request supplies a channel or a different snapshot ID.
1551
+ */
1552
+ atSnapshot(snapshotID: string): ContentClient<Workspace>;
1553
+ }
1554
+ interface ClientOptions {
1555
+ /** HTTP(S) API root, including any deployment prefix. Defaults to https://api.andesine.app. */
1556
+ baseURL?: string;
1557
+ /**
1558
+ * Bearer API key. Defaults to process.env.ANDESINE_API_KEY when available, read at creation.
1559
+ * Pass an empty string to disable this fallback. Keep private keys on your server;
1560
+ * the key is omitted on anonymous operations.
1561
+ */
1562
+ apiKey?: string;
1563
+ /** OAuth access token. Disables the API-key environment fallback. Cannot be combined with apiKey.
1564
+ * Supply x-workspace-id through headers for workspace operations. The SDK does not refresh tokens.
1565
+ */
1566
+ accessToken?: string;
1567
+ /** Fetch implementation to use instead of globalThis.fetch. */
1568
+ fetch?: typeof fetch;
1569
+ /** Default headers. Request headers override these; the configured credential supplies Authorization. */
1570
+ headers?: HeadersInit;
1571
+ /** Timeout in milliseconds, including stream consumption. Defaults to 30,000; 0 disables it. */
1572
+ timeout?: number;
1573
+ /** Extra attempts for eligible GET failures. Defaults to 0. Other methods are never retried. */
1574
+ retries?: number;
1575
+ }
1576
+ /**
1577
+ * Create a typed API client for a hosted or self-hosted Andesine instance.
1578
+ *
1579
+ * Methods return response data by default. Use response: "full" for status and headers,
1580
+ * including conditional reads that can return 304. Creation does not make a request.
1581
+ * An optional Workspace type map narrows known content selectors at compile time only.
1582
+ * It does not choose credentials, a workspace, a channel, or a snapshot, or check response schemas.
1583
+ * @param config - Optional API root, credentials, transport, and request defaults.
1584
+ * Defaults to https://api.andesine.app and process.env.ANDESINE_API_KEY when available.
1585
+ * Runtimes without process.env use no default key. No environment files are loaded.
1586
+ * @returns API resources and helpers for published-content snapshots and pagination.
1587
+ * @throws TypeError if both credential options are set, or if baseURL is not HTTP(S) or includes credentials, a query, or a fragment.
1588
+ * Request failures throw AndesineAPIError; abort and timeout reasons are preserved.
1589
+ * @example
1590
+ * const client = createClient();
1591
+ * const page = await client.content.get({ path: "/Docs/Welcome" });
1592
+ */
1593
+ declare const createClient: <Workspace extends WorkspaceTypeMap = WorkspaceTypeMap>(config?: ClientOptions) => AndesineClient<Workspace>;
1594
+ //#endregion
1595
+ export { WorkspaceCollection as _, ContentPaginationOptions as a, WorkspaceTypeMap as b, APIErrorData as c, OperationError as d, OperationInput as f, SchemaContent as g, ContentListOutput as h, ContentClient as i, APIResponse as l, RequestOptions as m, ClientOptions as n, APIErrorBody as o, OperationOutput as p, createClient as r, APIErrorCode as s, AndesineClient as t, NotModifiedResponse as u, WorkspaceEntry as v, WorkspaceSchema as y };
1596
+ //# sourceMappingURL=client-C8wt7f3o.d.ts.map