dineway 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +89 -0
  3. package/dist/adapters-BlzWJG82.d.mts +106 -0
  4. package/dist/apply-CAPvMfoU.mjs +1339 -0
  5. package/dist/astro/index.d.mts +50 -0
  6. package/dist/astro/index.mjs +1326 -0
  7. package/dist/astro/middleware/auth.d.mts +30 -0
  8. package/dist/astro/middleware/auth.mjs +708 -0
  9. package/dist/astro/middleware/redirect.d.mts +21 -0
  10. package/dist/astro/middleware/redirect.mjs +62 -0
  11. package/dist/astro/middleware/request-context.d.mts +17 -0
  12. package/dist/astro/middleware/request-context.mjs +1371 -0
  13. package/dist/astro/middleware/setup.d.mts +19 -0
  14. package/dist/astro/middleware/setup.mjs +46 -0
  15. package/dist/astro/middleware.d.mts +12 -0
  16. package/dist/astro/middleware.mjs +1716 -0
  17. package/dist/astro/types.d.mts +269 -0
  18. package/dist/astro/types.mjs +1 -0
  19. package/dist/base64-F8-DUraK.mjs +58 -0
  20. package/dist/byline-DeWCMU_i.mjs +234 -0
  21. package/dist/bylines-DyqBV9EQ.mjs +137 -0
  22. package/dist/chunk-ClPoSABd.mjs +21 -0
  23. package/dist/cli/index.d.mts +1 -0
  24. package/dist/cli/index.mjs +3987 -0
  25. package/dist/client/external-auth-headers.d.mts +38 -0
  26. package/dist/client/external-auth-headers.mjs +101 -0
  27. package/dist/client/index.d.mts +397 -0
  28. package/dist/client/index.mjs +345 -0
  29. package/dist/config-Cq8H0SfX.mjs +46 -0
  30. package/dist/connection-C9pxzuag.mjs +52 -0
  31. package/dist/content-zSgdNmnt.mjs +836 -0
  32. package/dist/db/index.d.mts +4 -0
  33. package/dist/db/index.mjs +62 -0
  34. package/dist/db/libsql.d.mts +10 -0
  35. package/dist/db/libsql.mjs +21 -0
  36. package/dist/db/postgres.d.mts +10 -0
  37. package/dist/db/postgres.mjs +29 -0
  38. package/dist/db/sqlite.d.mts +10 -0
  39. package/dist/db/sqlite.mjs +15 -0
  40. package/dist/default-WYlzADZL.mjs +80 -0
  41. package/dist/dialect-helpers-B9uSp2GJ.mjs +89 -0
  42. package/dist/error-DrxtnGPg.mjs +26 -0
  43. package/dist/index-C-jx21qs.d.mts +4771 -0
  44. package/dist/index.d.mts +16 -0
  45. package/dist/index.mjs +30 -0
  46. package/dist/load-C6FCD1FU.mjs +27 -0
  47. package/dist/loader-qKmo0wAY.mjs +446 -0
  48. package/dist/manifest-schema-CTSEyIJ3.mjs +186 -0
  49. package/dist/media/index.d.mts +25 -0
  50. package/dist/media/index.mjs +54 -0
  51. package/dist/media/local-runtime.d.mts +38 -0
  52. package/dist/media/local-runtime.mjs +132 -0
  53. package/dist/media-DMTr80Gv.mjs +199 -0
  54. package/dist/mode-BlyYtIFO.mjs +22 -0
  55. package/dist/page/index.d.mts +148 -0
  56. package/dist/page/index.mjs +419 -0
  57. package/dist/placeholder-B3knXwNc.mjs +267 -0
  58. package/dist/placeholder-bOx1xCTY.d.mts +283 -0
  59. package/dist/plugin-utils.d.mts +57 -0
  60. package/dist/plugin-utils.mjs +77 -0
  61. package/dist/plugins/adapt-sandbox-entry.d.mts +21 -0
  62. package/dist/plugins/adapt-sandbox-entry.mjs +112 -0
  63. package/dist/query-BiaPl_g2.mjs +459 -0
  64. package/dist/redirect-JPqLAbxa.mjs +328 -0
  65. package/dist/registry-DSd1GWB8.mjs +851 -0
  66. package/dist/request-context.d.mts +49 -0
  67. package/dist/request-context.mjs +42 -0
  68. package/dist/runner-B5l1JfOj.d.mts +26 -0
  69. package/dist/runner-BGUGywgG.mjs +1529 -0
  70. package/dist/runtime.d.mts +25 -0
  71. package/dist/runtime.mjs +41 -0
  72. package/dist/search-BNruJHDL.mjs +11054 -0
  73. package/dist/seed/index.d.mts +3 -0
  74. package/dist/seed/index.mjs +15 -0
  75. package/dist/seo/index.d.mts +69 -0
  76. package/dist/seo/index.mjs +69 -0
  77. package/dist/storage/local.d.mts +38 -0
  78. package/dist/storage/local.mjs +165 -0
  79. package/dist/storage/s3.d.mts +31 -0
  80. package/dist/storage/s3.mjs +174 -0
  81. package/dist/tokens-4vgYuXsZ.mjs +170 -0
  82. package/dist/transport-C5FYnid7.mjs +417 -0
  83. package/dist/transport-gIL-e43D.d.mts +41 -0
  84. package/dist/types-BawVha09.mjs +30 -0
  85. package/dist/types-BgQeVaPj.d.mts +192 -0
  86. package/dist/types-CLLdsG3g.d.mts +103 -0
  87. package/dist/types-D38djUXv.d.mts +1196 -0
  88. package/dist/types-DShnjzb6.mjs +15 -0
  89. package/dist/types-DkvMXalq.d.mts +425 -0
  90. package/dist/types-DuNbGKjF.mjs +74 -0
  91. package/dist/types-ju-_ORz7.d.mts +182 -0
  92. package/dist/validate-CXnRKfJK.mjs +327 -0
  93. package/dist/validate-CqRJb_xU.mjs +96 -0
  94. package/dist/validate-DVKJJ-M_.d.mts +377 -0
  95. package/locals.d.ts +47 -0
  96. package/package.json +313 -0
@@ -0,0 +1,38 @@
1
+ import { t as Interceptor } from "../transport-gIL-e43D.mjs";
2
+
3
+ //#region src/client/external-auth-headers.d.ts
4
+ /**
5
+ * Parse headers from the DINEWAY_HEADERS env var.
6
+ * Format: newline-separated "Name: Value" pairs.
7
+ * Blank lines and malformed entries are silently skipped.
8
+ */
9
+ declare function parseHeadersFromEnv(): Record<string, string>;
10
+ /**
11
+ * Parse an array of "Name: Value" strings into a headers record.
12
+ * Malformed entries are silently skipped. Later values override earlier ones.
13
+ */
14
+ declare function parseHeaderStrings(headers: string[]): Record<string, string>;
15
+ /**
16
+ * Collect all --header flag values from process.argv.
17
+ *
18
+ * citty doesn't support repeatable string args, so argv is parsed directly.
19
+ * Handles both `--header "Name: Value"` and `--header="Name: Value"`.
20
+ */
21
+ declare function parseHeadersFromArgv(): string[];
22
+ /**
23
+ * Resolve custom headers from all sources.
24
+ * Priority: env var < CLI flags (later wins).
25
+ */
26
+ declare function resolveCustomHeaders(): Record<string, string>;
27
+ /**
28
+ * Creates a transport interceptor that injects custom headers on every request.
29
+ */
30
+ declare function customHeadersInterceptor(headers: Record<string, string>): Interceptor;
31
+ /**
32
+ * Creates a fetch wrapper that injects custom headers.
33
+ * Used by the CLI for raw fetch calls before the client is created.
34
+ */
35
+ declare function createHeaderAwareFetch(headers: Record<string, string>): typeof fetch;
36
+ declare function isRedirectResponse(response: Response): boolean;
37
+ //#endregion
38
+ export { createHeaderAwareFetch, customHeadersInterceptor, isRedirectResponse, parseHeaderStrings, parseHeadersFromArgv, parseHeadersFromEnv, resolveCustomHeaders };
@@ -0,0 +1,101 @@
1
+ //#region src/client/external-auth-headers.ts
2
+ /**
3
+ * Parse a single "Name: Value" header string. Returns null if malformed.
4
+ */
5
+ function parseHeaderLine(line) {
6
+ const idx = line.indexOf(":");
7
+ if (idx === -1) return null;
8
+ const name = line.slice(0, idx).trim();
9
+ const value = line.slice(idx + 1).trim();
10
+ if (!name) return null;
11
+ return [name, value];
12
+ }
13
+ /**
14
+ * Parse headers from the DINEWAY_HEADERS env var.
15
+ * Format: newline-separated "Name: Value" pairs.
16
+ * Blank lines and malformed entries are silently skipped.
17
+ */
18
+ function parseHeadersFromEnv() {
19
+ const raw = process.env["DINEWAY_HEADERS"];
20
+ if (!raw) return {};
21
+ return parseHeaderStrings(raw.split("\n"));
22
+ }
23
+ /**
24
+ * Parse an array of "Name: Value" strings into a headers record.
25
+ * Malformed entries are silently skipped. Later values override earlier ones.
26
+ */
27
+ function parseHeaderStrings(headers) {
28
+ const result = {};
29
+ for (const header of headers) {
30
+ const parsed = parseHeaderLine(header);
31
+ if (parsed) result[parsed[0]] = parsed[1];
32
+ }
33
+ return result;
34
+ }
35
+ /**
36
+ * Collect all --header flag values from process.argv.
37
+ *
38
+ * citty doesn't support repeatable string args, so argv is parsed directly.
39
+ * Handles both `--header "Name: Value"` and `--header="Name: Value"`.
40
+ */
41
+ function parseHeadersFromArgv() {
42
+ const headers = [];
43
+ const argv = process.argv;
44
+ for (let i = 0; i < argv.length; i++) {
45
+ const arg = argv[i];
46
+ if (arg === "--header" || arg === "-H") {
47
+ const next = argv[i + 1];
48
+ if (next && !next.startsWith("-")) {
49
+ headers.push(next);
50
+ i++;
51
+ }
52
+ } else if (arg.startsWith("--header=")) headers.push(arg.slice(9));
53
+ else if (arg.startsWith("-H=")) headers.push(arg.slice(3));
54
+ }
55
+ return headers;
56
+ }
57
+ /**
58
+ * Resolve custom headers from all sources.
59
+ * Priority: env var < CLI flags (later wins).
60
+ */
61
+ function resolveCustomHeaders() {
62
+ const envHeaders = parseHeadersFromEnv();
63
+ const cliHeaders = parseHeaderStrings(parseHeadersFromArgv());
64
+ return {
65
+ ...envHeaders,
66
+ ...cliHeaders
67
+ };
68
+ }
69
+ /**
70
+ * Creates a transport interceptor that injects custom headers on every request.
71
+ */
72
+ function customHeadersInterceptor(headers) {
73
+ const entries = Object.entries(headers);
74
+ if (entries.length === 0) return (request, next) => next(request);
75
+ return (request, next) => {
76
+ const nextHeaders = new Headers(request.headers);
77
+ for (const [name, value] of entries) nextHeaders.set(name, value);
78
+ return next(new Request(request, { headers: nextHeaders }));
79
+ };
80
+ }
81
+ /**
82
+ * Creates a fetch wrapper that injects custom headers.
83
+ * Used by the CLI for raw fetch calls before the client is created.
84
+ */
85
+ function createHeaderAwareFetch(headers) {
86
+ if (Object.keys(headers).length === 0) return globalThis.fetch.bind(globalThis);
87
+ return (input, init) => {
88
+ const nextHeaders = new Headers(init?.headers);
89
+ for (const [name, value] of Object.entries(headers)) nextHeaders.set(name, value);
90
+ return globalThis.fetch(input, {
91
+ ...init,
92
+ headers: nextHeaders
93
+ });
94
+ };
95
+ }
96
+ function isRedirectResponse(response) {
97
+ return response.status >= 300 && response.status < 400 && response.headers.has("location");
98
+ }
99
+
100
+ //#endregion
101
+ export { createHeaderAwareFetch, customHeadersInterceptor, isRedirectResponse, parseHeaderStrings, parseHeadersFromArgv, parseHeadersFromEnv, resolveCustomHeaders };
@@ -0,0 +1,397 @@
1
+ import { a as tokenInterceptor, i as devBypassInterceptor, n as createTransport, r as csrfInterceptor, t as Interceptor } from "../transport-gIL-e43D.mjs";
2
+
3
+ //#region src/client/portable-text.d.ts
4
+ /**
5
+ * Portable Text <-> Markdown conversion layer.
6
+ *
7
+ * Three tiers of block handling:
8
+ * Tier 1: Standard PT blocks <-> standard Markdown (headings, paragraphs, lists, etc.)
9
+ * Tier 2: Dineway custom blocks <-> Markdown directives (future)
10
+ * Tier 3: Unknown blocks <-> opaque HTML comment fences (preserved, not editable)
11
+ */
12
+ /** Minimal Portable Text block shape */
13
+ interface PortableTextBlock {
14
+ _type: string;
15
+ _key?: string;
16
+ style?: string;
17
+ level?: number;
18
+ listItem?: string;
19
+ markDefs?: MarkDef[];
20
+ children?: PortableTextSpan[];
21
+ [key: string]: unknown;
22
+ }
23
+ interface PortableTextSpan {
24
+ _type: string;
25
+ _key?: string;
26
+ text?: string;
27
+ marks?: string[];
28
+ [key: string]: unknown;
29
+ }
30
+ interface MarkDef {
31
+ _key: string;
32
+ _type: string;
33
+ href?: string;
34
+ [key: string]: unknown;
35
+ }
36
+ /**
37
+ * Convert Portable Text blocks to Markdown.
38
+ * Unknown block types are serialized as opaque fences.
39
+ */
40
+ declare function portableTextToMarkdown(blocks: PortableTextBlock[]): string;
41
+ /**
42
+ * Convert Markdown to Portable Text blocks.
43
+ * Opaque fences (<!--ec:block ... -->) are deserialized and spliced back in.
44
+ */
45
+ declare function markdownToPortableText(markdown: string): PortableTextBlock[];
46
+ //#endregion
47
+ //#region src/client/index.d.ts
48
+ interface DinewayClientOptions {
49
+ /** Base URL of the Dineway instance */
50
+ baseUrl: string;
51
+ /** API token (ec_pat_...) or OAuth token (ec_oat_...) */
52
+ token?: string;
53
+ /** OAuth refresh token for auto-refresh on 401 */
54
+ refreshToken?: string;
55
+ /** Called when a token is refreshed (for persisting new access token) */
56
+ onTokenRefresh?: (accessToken: string, expiresIn: number) => void;
57
+ /** Use dev-bypass authentication (localhost only) */
58
+ devBypass?: boolean;
59
+ /** Additional request interceptors */
60
+ interceptors?: Interceptor[];
61
+ }
62
+ /** Standard API error shape */
63
+ interface ApiError {
64
+ code: string;
65
+ message: string;
66
+ details?: Record<string, unknown>;
67
+ }
68
+ /** Standard API response wrapper */
69
+ interface ClientResponse<T> {
70
+ success: true;
71
+ data: T;
72
+ }
73
+ /** Paginated list response */
74
+ interface ListResult<T> {
75
+ items: T[];
76
+ nextCursor?: string;
77
+ }
78
+ /** Content item as returned by the API */
79
+ interface ContentItem {
80
+ id: string;
81
+ type: string;
82
+ slug: string | null;
83
+ status: string;
84
+ data: Record<string, unknown>;
85
+ authorId: string | null;
86
+ createdAt: string;
87
+ updatedAt: string;
88
+ publishedAt: string | null;
89
+ scheduledAt: string | null;
90
+ liveRevisionId: string | null;
91
+ draftRevisionId: string | null;
92
+ locale: string | null;
93
+ translationGroup: string | null;
94
+ _rev?: string;
95
+ }
96
+ /** Collection metadata */
97
+ interface Collection {
98
+ slug: string;
99
+ label: string;
100
+ labelSingular: string;
101
+ description?: string;
102
+ icon?: string;
103
+ supports: string[];
104
+ }
105
+ /** Collection with fields */
106
+ interface CollectionWithFields extends Collection {
107
+ fields: Field[];
108
+ }
109
+ /** Field metadata */
110
+ interface Field {
111
+ slug: string;
112
+ label: string;
113
+ type: string;
114
+ required: boolean;
115
+ unique: boolean;
116
+ defaultValue?: unknown;
117
+ validation?: unknown;
118
+ widget?: string;
119
+ options?: unknown;
120
+ sortOrder?: number;
121
+ }
122
+ /** Media item */
123
+ interface MediaItem {
124
+ id: string;
125
+ filename: string;
126
+ key: string;
127
+ mimeType: string;
128
+ size: number;
129
+ width?: number;
130
+ height?: number;
131
+ alt?: string;
132
+ caption?: string;
133
+ createdAt: string;
134
+ updatedAt: string;
135
+ }
136
+ /** Search result */
137
+ interface SearchResult {
138
+ id: string;
139
+ collection: string;
140
+ title: string;
141
+ excerpt?: string;
142
+ score: number;
143
+ }
144
+ /** Taxonomy */
145
+ interface Taxonomy {
146
+ name: string;
147
+ label: string;
148
+ hierarchical: boolean;
149
+ }
150
+ /** Taxonomy term */
151
+ interface Term {
152
+ id: string;
153
+ slug: string;
154
+ label: string;
155
+ parentId?: string | null;
156
+ description?: string;
157
+ count?: number;
158
+ }
159
+ /** Menu */
160
+ interface Menu {
161
+ name: string;
162
+ label: string;
163
+ }
164
+ /** Menu with items */
165
+ interface MenuWithItems extends Menu {
166
+ items: MenuItem[];
167
+ }
168
+ /** Menu item */
169
+ interface MenuItem {
170
+ id: string;
171
+ type: string;
172
+ label: string;
173
+ customUrl?: string;
174
+ referenceCollection?: string;
175
+ referenceId?: string;
176
+ target?: string;
177
+ parentId?: string | null;
178
+ sortOrder: number;
179
+ }
180
+ /** Full schema export (returned by /api/schema) */
181
+ interface SchemaExport {
182
+ collections: Array<{
183
+ slug: string;
184
+ label: string;
185
+ labelSingular: string;
186
+ description?: string;
187
+ icon?: string;
188
+ supports: string[];
189
+ fields: Array<{
190
+ slug: string;
191
+ label: string;
192
+ type: string;
193
+ required: boolean;
194
+ unique: boolean;
195
+ defaultValue?: unknown;
196
+ validation?: unknown;
197
+ widget?: string;
198
+ options?: unknown;
199
+ }>;
200
+ }>;
201
+ version: string;
202
+ }
203
+ /** Manifest — full schema + field descriptors */
204
+ interface Manifest {
205
+ version: string;
206
+ hash: string;
207
+ collections: Record<string, {
208
+ label: string;
209
+ labelSingular: string;
210
+ supports: string[];
211
+ fields: Record<string, {
212
+ kind: string;
213
+ label?: string;
214
+ required?: boolean;
215
+ }>;
216
+ }>;
217
+ }
218
+ declare class DinewayApiError extends Error {
219
+ readonly status: number;
220
+ readonly code: string;
221
+ readonly details?: Record<string, unknown> | undefined;
222
+ constructor(status: number, code: string, message: string, details?: Record<string, unknown> | undefined);
223
+ }
224
+ declare class DinewayClientError extends Error {
225
+ constructor(message: string);
226
+ }
227
+ declare class DinewayClient {
228
+ private readonly baseUrl;
229
+ private readonly transport;
230
+ /** Cached field schemas per collection for PT conversion */
231
+ private fieldSchemaCache;
232
+ constructor(options: DinewayClientOptions);
233
+ /** List all collections */
234
+ collections(): Promise<Collection[]>;
235
+ /** Get a single collection with its fields */
236
+ collection(slug: string): Promise<CollectionWithFields>;
237
+ /** Create a collection */
238
+ createCollection(input: {
239
+ slug: string;
240
+ label: string;
241
+ labelSingular?: string;
242
+ description?: string;
243
+ icon?: string;
244
+ supports?: string[];
245
+ }): Promise<Collection>;
246
+ /** Delete a collection */
247
+ deleteCollection(slug: string): Promise<void>;
248
+ /** Create a field on a collection */
249
+ createField(collection: string, input: {
250
+ slug: string;
251
+ type: string;
252
+ label: string;
253
+ required?: boolean;
254
+ unique?: boolean;
255
+ defaultValue?: unknown;
256
+ validation?: unknown;
257
+ widget?: string;
258
+ options?: unknown;
259
+ sortOrder?: number;
260
+ }): Promise<Field>;
261
+ /** Delete a field from a collection */
262
+ deleteField(collection: string, fieldSlug: string): Promise<void>;
263
+ /** Get full manifest (schema + field descriptors + features) */
264
+ manifest(): Promise<Manifest>;
265
+ /** Export full schema as JSON (used by `dineway types`) */
266
+ schemaExport(): Promise<SchemaExport>;
267
+ /** Export schema as TypeScript type definitions (used by `dineway types`) */
268
+ schemaTypes(): Promise<string>;
269
+ /** List content in a collection */
270
+ list(collection: string, options?: {
271
+ status?: string;
272
+ limit?: number;
273
+ cursor?: string;
274
+ orderBy?: string;
275
+ order?: "asc" | "desc";
276
+ locale?: string;
277
+ }): Promise<ListResult<ContentItem>>;
278
+ /** Async iterator that auto-follows cursors */
279
+ listAll(collection: string, options?: {
280
+ status?: string;
281
+ limit?: number;
282
+ orderBy?: string;
283
+ order?: "asc" | "desc";
284
+ locale?: string;
285
+ }): AsyncGenerator<ContentItem>;
286
+ /**
287
+ * Get a single content item. Returns the item with a `_rev` token
288
+ * that can be passed to update() for optimistic concurrency.
289
+ */
290
+ get(collection: string, id: string, options?: {
291
+ raw?: boolean;
292
+ locale?: string;
293
+ }): Promise<ContentItem>;
294
+ /** Create a new content item */
295
+ create(collection: string, input: {
296
+ data: Record<string, unknown>;
297
+ slug?: string;
298
+ status?: string;
299
+ locale?: string;
300
+ translationOf?: string;
301
+ }): Promise<ContentItem>;
302
+ /**
303
+ * Update a content item. Pass `_rev` from a prior get() for optimistic
304
+ * concurrency — the server returns 409 if the item has changed.
305
+ * Omit `_rev` for a blind write (no conflict detection).
306
+ */
307
+ update(collection: string, id: string, input: {
308
+ data?: Record<string, unknown>;
309
+ slug?: string;
310
+ status?: string;
311
+ _rev?: string;
312
+ }): Promise<ContentItem>;
313
+ /** Delete (soft) a content item */
314
+ delete(collection: string, id: string): Promise<void>;
315
+ /** Publish a content item */
316
+ publish(collection: string, id: string): Promise<void>;
317
+ /** Unpublish a content item */
318
+ unpublish(collection: string, id: string): Promise<void>;
319
+ /** Schedule publishing */
320
+ schedule(collection: string, id: string, options: {
321
+ at: string;
322
+ }): Promise<void>;
323
+ /** Restore a trashed content item */
324
+ restore(collection: string, id: string): Promise<void>;
325
+ /** Compare live and draft revisions */
326
+ compare(collection: string, id: string): Promise<{
327
+ hasChanges: boolean;
328
+ live: Record<string, unknown> | null;
329
+ draft: Record<string, unknown> | null;
330
+ }>;
331
+ /** Discard draft revision, reverting to the published version */
332
+ discardDraft(collection: string, id: string): Promise<void>;
333
+ /**
334
+ * Get all translations of a content item.
335
+ * Returns the translation group ID and a summary of each locale version.
336
+ */
337
+ translations(collection: string, id: string): Promise<{
338
+ translationGroup: string;
339
+ translations: Array<{
340
+ id: string;
341
+ locale: string | null;
342
+ slug: string | null;
343
+ status: string;
344
+ updatedAt: string;
345
+ }>;
346
+ }>;
347
+ /** List media items */
348
+ mediaList(options?: {
349
+ mimeType?: string;
350
+ limit?: number;
351
+ cursor?: string;
352
+ }): Promise<ListResult<MediaItem>>;
353
+ /** Get a single media item */
354
+ mediaGet(id: string): Promise<MediaItem>;
355
+ /** Upload a media file */
356
+ mediaUpload(file: Uint8Array | Blob, filename: string, options?: {
357
+ alt?: string;
358
+ caption?: string;
359
+ contentType?: string;
360
+ }): Promise<MediaItem>;
361
+ /** Delete a media item */
362
+ mediaDelete(id: string): Promise<void>;
363
+ /** Full-text search */
364
+ search(query: string, options?: {
365
+ collection?: string;
366
+ locale?: string;
367
+ limit?: number;
368
+ }): Promise<SearchResult[]>;
369
+ /** List taxonomies */
370
+ taxonomies(): Promise<Taxonomy[]>;
371
+ /** List terms in a taxonomy */
372
+ terms(taxonomy: string, options?: {
373
+ limit?: number;
374
+ cursor?: string;
375
+ }): Promise<ListResult<Term>>;
376
+ /** Create a taxonomy term */
377
+ createTerm(taxonomy: string, input: {
378
+ slug: string;
379
+ label: string;
380
+ parentId?: string;
381
+ description?: string;
382
+ }): Promise<Term>;
383
+ /** List menus */
384
+ menus(): Promise<Menu[]>;
385
+ /** Get a menu with its items */
386
+ menu(name: string): Promise<MenuWithItems>;
387
+ /** Make a typed JSON request to the API */
388
+ private request;
389
+ /** Make a raw request — caller handles response */
390
+ private requestRaw;
391
+ /** Assert a response is OK, throw typed error if not */
392
+ private assertOk;
393
+ /** Get cached field schemas for a collection, fetching if needed */
394
+ private getFieldSchemas;
395
+ }
396
+ //#endregion
397
+ export { ApiError, ClientResponse, Collection, CollectionWithFields, ContentItem, DinewayApiError, DinewayClient, DinewayClientError, DinewayClientOptions, Field, type Interceptor, ListResult, Manifest, MediaItem, Menu, MenuItem, MenuWithItems, type PortableTextBlock, SchemaExport, SearchResult, Taxonomy, Term, createTransport, csrfInterceptor, devBypassInterceptor, markdownToPortableText, portableTextToMarkdown, tokenInterceptor };