@dyrected/knowledge 0.2.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,1573 @@
1
+ [
2
+ {
3
+ "id": "@dyrected/core:AdminConfig",
4
+ "name": "AdminConfig",
5
+ "kind": "interface",
6
+ "category": "configuration",
7
+ "sourcePackage": "@dyrected/core",
8
+ "description": "Branding and metadata options for the Dyrected Admin UI.",
9
+ "signature": "export interface AdminConfig {\n /** Custom component slots around the built-in dashboard. */\n components?: AdminDashboardComponentSlots;\n branding?: {\n /** Full logo image shown in the expanded sidebar. URL or imported image asset. */\n logo?: string;\n /** Compact logo mark used in the collapsed sidebar state. */\n logoMark?: string;\n /** Text alternative or addition to the logo image. */\n logoText?: string;\n /**\n * Primary accent colour as any CSS colour value.\n * @example '#6366f1'\n * @example 'hsl(240 50% 60%)'\n */\n primaryColor?: string;\n /** Browser tab favicon URL. */\n favicon?: string;\n /** Font family for body and UI text. Must be loaded separately. */\n fontSans?: string;\n /** Font family for headings. Must be loaded separately. */\n fontSerif?: string;\n };\n meta?: {\n /**\n * String appended to every Admin page's `<title>`.\n * @default '- Dyrected'\n */\n titleSuffix?: string;\n };\n}",
10
+ "members": [
11
+ {
12
+ "name": "components",
13
+ "signature": "components?: AdminDashboardComponentSlots",
14
+ "description": "Custom component slots around the built-in dashboard."
15
+ },
16
+ {
17
+ "name": "branding",
18
+ "signature": "branding?: {\n /** Full logo image shown in the expanded sidebar. URL or imported image asset. */\n logo?: string;\n /** Compact logo mark used in the collapsed sidebar state. */\n logoMark?: string;\n /** Text alternative or addition to the logo image. */\n logoText?: string;\n /**\n * Primary accent colour as any CSS colour value.\n * @example '#6366f1'\n * @example 'hsl(240 50% 60%)'\n */\n primaryColor?: string;\n /** Browser tab favicon URL. */\n favicon?: string;\n /** Font family for body and UI text. Must be loaded separately. */\n fontSans?: string;\n /** Font family for headings. Must be loaded separately. */\n fontSerif?: string;\n }",
19
+ "description": ""
20
+ },
21
+ {
22
+ "name": "meta",
23
+ "signature": "meta?: {\n /**\n * String appended to every Admin page's `<title>`.\n * @default '- Dyrected'\n */\n titleSuffix?: string;\n }",
24
+ "description": ""
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "id": "@dyrected/core:AuthDocFields",
30
+ "name": "AuthDocFields",
31
+ "kind": "type",
32
+ "category": "fields",
33
+ "sourcePackage": "@dyrected/core",
34
+ "description": "Fields automatically injected into collections with `auth: true`.\n`password` is part of the schema but is stripped from API read responses.",
35
+ "signature": "export type AuthDocFields = {\n email: string;\n password?: string;\n roles?: string[];\n};",
36
+ "members": []
37
+ },
38
+ {
39
+ "id": "@dyrected/core:AuthenticatedUser",
40
+ "name": "AuthenticatedUser",
41
+ "kind": "interface",
42
+ "category": "hooks",
43
+ "sourcePackage": "@dyrected/core",
44
+ "description": "Base shape of an authenticated user as decoded from the JWT.\n\nThe actual shape will include every field on your auth collection — this\ninterface only guarantees the properties that Dyrected always stamps on the\ntoken. Extend it in your own codebase for stronger typing:",
45
+ "signature": "export interface AuthenticatedUser {\n /** The user's document ID in the database. */\n sub: string;\n /** The user's email address. */\n email?: string;\n /** Slug of the collection this user was authenticated against. */\n collection: string;\n /** Array of role strings, if your auth collection has a `roles` field. */\n roles?: string[];\n /** Any additional fields from the auth collection document. */\n [key: string]: unknown;\n}",
46
+ "members": [
47
+ {
48
+ "name": "sub",
49
+ "signature": "sub: string",
50
+ "description": "The user's document ID in the database."
51
+ },
52
+ {
53
+ "name": "email",
54
+ "signature": "email?: string",
55
+ "description": "The user's email address."
56
+ },
57
+ {
58
+ "name": "collection",
59
+ "signature": "collection: string",
60
+ "description": "Slug of the collection this user was authenticated against."
61
+ },
62
+ {
63
+ "name": "roles",
64
+ "signature": "roles?: string[]",
65
+ "description": "Array of role strings, if your auth collection has a `roles` field."
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "id": "@dyrected/core:availableWorkflowTransitions",
71
+ "name": "availableWorkflowTransitions",
72
+ "kind": "function",
73
+ "category": "workflows",
74
+ "sourcePackage": "@dyrected/core",
75
+ "description": "",
76
+ "signature": "export function availableWorkflowTransitions(\n workflow: WorkflowConfig,\n state: string,\n user?: AuthenticatedUser,\n): WorkflowTransition[]",
77
+ "members": []
78
+ },
79
+ {
80
+ "id": "@dyrected/core:canViewWorkflowDraft",
81
+ "name": "canViewWorkflowDraft",
82
+ "kind": "function",
83
+ "category": "workflows",
84
+ "sourcePackage": "@dyrected/core",
85
+ "description": "",
86
+ "signature": "export function canViewWorkflowDraft(workflow: WorkflowConfig, user?: AuthenticatedUser): boolean",
87
+ "members": []
88
+ },
89
+ {
90
+ "id": "@dyrected/core:CollectionAfterChangeHook",
91
+ "name": "CollectionAfterChangeHook",
92
+ "kind": "type",
93
+ "category": "hooks",
94
+ "sourcePackage": "@dyrected/core",
95
+ "description": "Runs **after** a document is created or updated in the database.\n\n**Isolation**: errors thrown inside this hook are caught by the framework,\nlogged to the console, and then discarded. The HTTP response returns the\nsaved document as if nothing went wrong — because from the database's\nperspective, nothing did. This means a transient email failure or webhook\ntimeout will never turn a successful write into a 500 for the caller.\n\nThe return value is ignored — this hook is for side-effects only (emails,\nwebhooks, cache revalidation, search index updates, etc.).\n\n**Awaiting vs fire-and-forget**: `await`ing inside this hook is fine for\nfast, reliable calls. For slow or unreliable external services prefer\nfire-and-forget with your own `.catch()` so the response doesn't block:\n\n```ts\n// ✓ fast & reliable — safe to await\nafterChange: [async ({ doc }) => {\n await revalidatePath(`/posts/${doc.slug}`)\n}]\n\n// ✓ slow or unreliable — fire-and-forget\nafterChange: [({ doc }) => {\n sendEmail({ to: doc.email, ... }).catch(console.error)\n}]\n```",
96
+ "signature": "export type CollectionAfterChangeHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The document as it was written to the database. */\n doc: TDoc;\n /**\n * Snapshot of the document before the write. Only present on `'update'`\n * operations; `undefined` on `'create'`.\n */\n previousDoc?: TDoc;\n /** The HTTP request context. */\n req: HookRequestContext;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /** Whether this was a new document or an update. */\n operation: \"create\" | \"update\";\n /**\n * Database adapter with full read/write access. The DB write for this\n * operation has already committed — safe for side-effect writes.\n */\n db: DatabaseAdapter;\n}) => void | Promise<void>;",
97
+ "members": []
98
+ },
99
+ {
100
+ "id": "@dyrected/core:CollectionAfterDeleteHook",
101
+ "name": "CollectionAfterDeleteHook",
102
+ "kind": "type",
103
+ "category": "hooks",
104
+ "sourcePackage": "@dyrected/core",
105
+ "description": "",
106
+ "signature": "export type CollectionAfterDeleteHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The ID of the deleted document. */\n id: string;\n /** The document as it was just before deletion. */\n doc: TDoc;\n /** The HTTP request context. */\n req: HookRequestContext;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /**\n * Database adapter with full read/write access. The deletion has already\n * committed — safe for cascade deletes or cleanup writes.\n */\n db: DatabaseAdapter;\n}) => void | Promise<void>;",
107
+ "members": []
108
+ },
109
+ {
110
+ "id": "@dyrected/core:CollectionAfterReadHook",
111
+ "name": "CollectionAfterReadHook",
112
+ "kind": "type",
113
+ "category": "hooks",
114
+ "sourcePackage": "@dyrected/core",
115
+ "description": "Runs after a document (or list of documents) is fetched from the database,\nbefore the response is sent to the client.\n\nReturn a modified document to send instead. Useful for adding computed\nvirtual fields or transforming the shape of the response.",
116
+ "signature": "export type CollectionAfterReadHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The document as fetched from the database (with defaults applied). */\n doc: TDoc;\n /** The HTTP request context. */\n req: HookRequestContext;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange`/`afterDelete` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => TDoc | Promise<TDoc>;",
117
+ "members": []
118
+ },
119
+ {
120
+ "id": "@dyrected/core:CollectionAfterTransitionHook",
121
+ "name": "CollectionAfterTransitionHook",
122
+ "kind": "type",
123
+ "category": "hooks",
124
+ "sourcePackage": "@dyrected/core",
125
+ "description": "",
126
+ "signature": "export type CollectionAfterTransitionHook<\n TDoc extends object = Record<string, unknown>,\n> = (\n args: WorkflowTransitionContext<TDoc> & { event: LifecycleEvent },\n) => void | Promise<void>;",
127
+ "members": []
128
+ },
129
+ {
130
+ "id": "@dyrected/core:CollectionBeforeChangeHook",
131
+ "name": "CollectionBeforeChangeHook",
132
+ "kind": "type",
133
+ "category": "hooks",
134
+ "sourcePackage": "@dyrected/core",
135
+ "description": "Runs **before** a document is created or updated in the database.\n\nReturn a modified data object to write instead of the original. This is the\nright place for data transformation, normalisation, slug generation, and\nvalidation (throw to abort the write).",
136
+ "signature": "export type CollectionBeforeChangeHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The incoming data payload being written. */\n data: Partial<TDoc>;\n /**\n * The existing document before this update. Only present on `'update'`\n * operations; `undefined` on `'create'`.\n */\n doc?: TDoc;\n /** The HTTP request context. */\n req: HookRequestContext;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /** Whether this is a new document or an update to an existing one. */\n operation: \"create\" | \"update\";\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange`/`afterDelete` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => Partial<TDoc> | void | Promise<Partial<TDoc> | void>;",
137
+ "members": []
138
+ },
139
+ {
140
+ "id": "@dyrected/core:CollectionBeforeDeleteHook",
141
+ "name": "CollectionBeforeDeleteHook",
142
+ "kind": "type",
143
+ "category": "hooks",
144
+ "sourcePackage": "@dyrected/core",
145
+ "description": "Runs **before** a document is deleted from the database.\n\nThrow an error to cancel the deletion — the document will not be removed\nand the API will return a `500` with your error message.",
146
+ "signature": "export type CollectionBeforeDeleteHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The ID of the document about to be deleted. */\n id: string;\n /** The full document about to be deleted. */\n doc: TDoc;\n /** The HTTP request context. */\n req: HookRequestContext;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterDelete` for post-deletion writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => void | Promise<void>;",
147
+ "members": []
148
+ },
149
+ {
150
+ "id": "@dyrected/core:CollectionBeforeReadHook",
151
+ "name": "CollectionBeforeReadHook",
152
+ "kind": "type",
153
+ "category": "hooks",
154
+ "sourcePackage": "@dyrected/core",
155
+ "description": "Runs before Dyrected queries the database for a list or single-document fetch.\n\nReturn a new `where` query object to override or extend the current filter.\nReturn `undefined` (or nothing) to leave the query unchanged.",
156
+ "signature": "export type CollectionBeforeReadHook = (args: {\n /** The HTTP request context. */\n req: HookRequestContext;\n /** The current `where` query filter. Modify and return to override. */\n query?: Record<string, unknown>;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange`/`afterDelete` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => Record<string, unknown> | void | Promise<Record<string, unknown> | void>;",
157
+ "members": []
158
+ },
159
+ {
160
+ "id": "@dyrected/core:CollectionBeforeTransitionHook",
161
+ "name": "CollectionBeforeTransitionHook",
162
+ "kind": "type",
163
+ "category": "hooks",
164
+ "sourcePackage": "@dyrected/core",
165
+ "description": "",
166
+ "signature": "export type CollectionBeforeTransitionHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: WorkflowTransitionContext<TDoc>) => void | Promise<void>;",
167
+ "members": []
168
+ },
169
+ {
170
+ "id": "@dyrected/core:CollectionConfig",
171
+ "name": "CollectionConfig",
172
+ "kind": "interface",
173
+ "category": "configuration",
174
+ "sourcePackage": "@dyrected/core",
175
+ "description": "Defines a Dyrected collection — a named set of documents with a shared schema.\n\nPass your document's TypeScript type as the generic parameter `TDoc` to get\nfully typed hooks and access functions:\n\n```ts\ninterface Post {\n id: string\n title: string\n slug: string\n status: 'draft' | 'published'\n publishedAt?: string\n}\n\nexport const Posts = defineCollection<Post>({\n slug: 'posts',\n hooks: {\n beforeChange: [({ data, operation }) => {\n // `data` is typed as Partial<Post>\n if (operation === 'create') return { ...data, status: 'draft' }\n return data\n }],\n afterChange: [({ doc, previousDoc }) => {\n // `doc` and `previousDoc` are typed as Post\n if (doc.status !== previousDoc?.status) notifySubscribers(doc)\n }],\n },\n fields: [...],\n})\n```",
176
+ "signature": "export interface CollectionConfig<\n TDoc extends object = Record<string, unknown>,\n> {\n /**\n * Unique identifier for this collection.\n * Used as the URL segment (`/api/collections/:slug`) and the database table/collection name.\n * Use kebab-case, e.g. `'blog-posts'`.\n */\n slug: string;\n\n /**\n * Restricts this collection to a specific site in a multi-tenant deployment.\n * When set, only requests bearing a matching `X-Site-Id` header can access it.\n */\n siteId?: string;\n\n /**\n * If `true`, this collection is shared across all sites in a multi-tenant\n * deployment and accessible regardless of the `X-Site-Id` header.\n */\n shared?: boolean;\n\n /** Human-readable names for documents in this collection, shown in the Admin UI. */\n labels?: {\n singular: string;\n plural: string;\n };\n\n /**\n * If `true`, this collection is an **auth collection** — it gains\n * `POST /api/collections/:slug/login` and `POST /api/collections/:slug/logout`\n * endpoints, and documents are expected to have a `password` field.\n */\n auth?: boolean;\n\n /**\n * If `true` (or a config object), this collection supports **file uploads**.\n * Documents gain file-related fields (`url`, `filename`, `mimeType`, etc.)\n * and the create endpoint accepts `multipart/form-data`.\n */\n upload?: boolean | UploadConfig;\n\n /** Field definitions that make up the document schema for this collection. */\n fields: Field[];\n\n /**\n * If `true`, Dyrected automatically adds `createdAt` and `updatedAt`\n * timestamp fields to every document. Defaults to `true`.\n */\n timestamps?: boolean;\n\n /**\n * Initial documents to seed into this collection the first time it is\n * fetched and found to be empty (e.g. for demo data or defaults).\n */\n initialData?: Partial<TDoc>[];\n\n /**\n * If `true`, every create, update, and delete operation on this collection\n * is logged to the `__audit` collection with before/after snapshots and the\n * acting user's identity.\n */\n audit?: boolean;\n\n /**\n * Optional state-machine workflow for this collection. Workflow-enabled\n * entries keep an editable working revision and an independent public\n * snapshot, so editing published content never changes the live response.\n */\n workflow?: WorkflowConfig<TDoc>;\n\n /**\n * Collection-level access control.\n *\n * Each key is an operation; the value is a function (or Jexl string) that\n * returns `true` to allow or `false` to deny. Returning a `where`-style\n * object grants access only to matching documents.\n *\n * @example\n * access: {\n * read: () => true, // public read\n * create: ({ user }) => !!user, // logged-in users only\n * update: ({ user }) => user?.roles?.includes('editor') ?? false,\n * delete: ({ user }) => user?.roles?.includes('admin') ?? false,\n * }\n */\n access?: {\n read?: AccessFunction<TDoc> | string;\n create?: AccessFunction<TDoc> | string;\n update?: AccessFunction<TDoc> | string;\n delete?: AccessFunction<TDoc> | string;\n };\n\n /**\n * Collection-level lifecycle hooks.\n *\n * Hooks run in the order they appear in the array. The return value of each\n * hook is passed as the input to the next. Throwing inside any hook aborts\n * the operation and returns a `500` error.\n *\n * See the [Hooks reference](/docs/concepts/hooks) for the full lifecycle diagram.\n */\n hooks?: {\n /**\n * Runs before the database is queried. Return a modified `where` object\n * to override the query filter.\n */\n beforeRead?: CollectionBeforeReadHook[];\n\n /**\n * Runs after documents are fetched. Return a modified doc to change what\n * the client receives. Runs on every document in a list response.\n */\n afterRead?: CollectionAfterReadHook<TDoc>[];\n\n /**\n * Runs before create or update. Return modified data to change what is\n * written to the database. Throw to abort the write entirely.\n */\n beforeChange?: CollectionBeforeChangeHook<TDoc>[];\n\n /**\n * Runs after create or update is committed. For side-effects only —\n * webhooks, cache busting, notifications. Return value is ignored.\n *\n * Errors are **isolated**: caught, logged, and discarded so a failing\n * side-effect never turns a successful write into an HTTP 500.\n * See {@link CollectionAfterChangeHook} for the await-vs-fire-and-forget guidance.\n */\n afterChange?: CollectionAfterChangeHook<TDoc>[];\n\n /**\n * Runs before a document is deleted. Throw to cancel the deletion.\n */\n beforeDelete?: CollectionBeforeDeleteHook<TDoc>[];\n\n /**\n * Runs after a document has been deleted. For cleanup side-effects only.\n *\n * Errors are **isolated**: caught, logged, and discarded — the deletion is\n * already committed and will not be undone.\n */\n afterDelete?: CollectionAfterDeleteHook<TDoc>[];\n };\n\n /** Admin UI configuration for this collection. */\n admin?: {\n /**\n * Lucide icon displayed beside this collection in the Admin sidebar.\n * Uses Lucide component names, e.g. `'Newspaper'` or `'ShoppingBag'`.\n */\n icon?: AdminIconName;\n\n /** Custom component slots for this collection's list view. */\n components?: CollectionListComponentSlots;\n\n /**\n * The field name used as the document's display title in the Admin list\n * view and breadcrumbs. Defaults to `'title'` if the field exists.\n */\n useAsTitle?: string;\n\n /**\n * Field names to show as columns in the Admin list view.\n * Defaults to a sensible set of the first few non-structural fields.\n */\n defaultColumns?: string[];\n\n /**\n * Groups this collection under a named section in the Admin sidebar.\n * Collections with the same `group` are visually grouped together.\n */\n group?: string;\n\n /** If `true`, this collection is not shown in the Admin UI sidebar. */\n hidden?: boolean;\n\n /** If `false`, disables the filter UI entirely for this collection. Defaults to `true`. */\n filterable?: boolean;\n\n /**\n * URL to open in the Live Preview pane when editing a document.\n * Pass a function to derive the URL from the document's fields.\n *\n * @example\n * previewUrl: (doc) => `https://mysite.com/blog/${doc.slug}`\n */\n previewUrl?:\n | string\n | ((doc: TDoc, opts: { locale?: string }) => string | null);\n\n /**\n * How the Live Preview pane communicates with the frontend.\n * - `'postMessage'` (default) — sends a `postMessage` with the current doc data.\n * - `'token'` — passes a short-lived preview token as a query parameter.\n */\n previewMode?: \"postMessage\" | \"token\";\n\n /**\n * Frontend URL pattern for this collection, used by `url` fields to\n * resolve internal links. Use `{fieldName}` placeholders.\n *\n * @example\n * urlPattern: '/blog/{slug}' // → /blog/my-post\n * urlPattern: '/{slug}' // → /about\n */\n urlPattern?: string;\n };\n}",
177
+ "members": [
178
+ {
179
+ "name": "slug",
180
+ "signature": "slug: string",
181
+ "description": "Unique identifier for this collection.\nUsed as the URL segment (`/api/collections/:slug`) and the database table/collection name.\nUse kebab-case, e.g. `'blog-posts'`."
182
+ },
183
+ {
184
+ "name": "siteId",
185
+ "signature": "siteId?: string",
186
+ "description": "Restricts this collection to a specific site in a multi-tenant deployment.\nWhen set, only requests bearing a matching `X-Site-Id` header can access it."
187
+ },
188
+ {
189
+ "name": "shared",
190
+ "signature": "shared?: boolean",
191
+ "description": "If `true`, this collection is shared across all sites in a multi-tenant\ndeployment and accessible regardless of the `X-Site-Id` header."
192
+ },
193
+ {
194
+ "name": "labels",
195
+ "signature": "labels?: {\n singular: string;\n plural: string;\n }",
196
+ "description": "Human-readable names for documents in this collection, shown in the Admin UI."
197
+ },
198
+ {
199
+ "name": "auth",
200
+ "signature": "auth?: boolean",
201
+ "description": "If `true`, this collection is an **auth collection** — it gains\n`POST /api/collections/:slug/login` and `POST /api/collections/:slug/logout`\nendpoints, and documents are expected to have a `password` field."
202
+ },
203
+ {
204
+ "name": "upload",
205
+ "signature": "upload?: boolean | UploadConfig",
206
+ "description": "If `true` (or a config object), this collection supports **file uploads**.\nDocuments gain file-related fields (`url`, `filename`, `mimeType`, etc.)\nand the create endpoint accepts `multipart/form-data`."
207
+ },
208
+ {
209
+ "name": "fields",
210
+ "signature": "fields: Field[]",
211
+ "description": "Field definitions that make up the document schema for this collection."
212
+ },
213
+ {
214
+ "name": "timestamps",
215
+ "signature": "timestamps?: boolean",
216
+ "description": "If `true`, Dyrected automatically adds `createdAt` and `updatedAt`\ntimestamp fields to every document. Defaults to `true`."
217
+ },
218
+ {
219
+ "name": "initialData",
220
+ "signature": "initialData?: Partial<TDoc>[]",
221
+ "description": "Initial documents to seed into this collection the first time it is\nfetched and found to be empty (e.g. for demo data or defaults)."
222
+ },
223
+ {
224
+ "name": "audit",
225
+ "signature": "audit?: boolean",
226
+ "description": "If `true`, every create, update, and delete operation on this collection\nis logged to the `__audit` collection with before/after snapshots and the\nacting user's identity."
227
+ },
228
+ {
229
+ "name": "workflow",
230
+ "signature": "workflow?: WorkflowConfig<TDoc>",
231
+ "description": "Optional state-machine workflow for this collection. Workflow-enabled\nentries keep an editable working revision and an independent public\nsnapshot, so editing published content never changes the live response."
232
+ },
233
+ {
234
+ "name": "access",
235
+ "signature": "access?: {\n read?: AccessFunction<TDoc> | string;\n create?: AccessFunction<TDoc> | string;\n update?: AccessFunction<TDoc> | string;\n delete?: AccessFunction<TDoc> | string;\n }",
236
+ "description": "Collection-level access control.\n\nEach key is an operation; the value is a function (or Jexl string) that\nreturns `true` to allow or `false` to deny. Returning a `where`-style\nobject grants access only to matching documents."
237
+ },
238
+ {
239
+ "name": "hooks",
240
+ "signature": "hooks?: {\n /**\n * Runs before the database is queried. Return a modified `where` object\n * to override the query filter.\n */\n beforeRead?: CollectionBeforeReadHook[];\n\n /**\n * Runs after documents are fetched. Return a modified doc to change what\n * the client receives. Runs on every document in a list response.\n */\n afterRead?: CollectionAfterReadHook<TDoc>[];\n\n /**\n * Runs before create or update. Return modified data to change what is\n * written to the database. Throw to abort the write entirely.\n */\n beforeChange?: CollectionBeforeChangeHook<TDoc>[];\n\n /**\n * Runs after create or update is committed. For side-effects only —\n * webhooks, cache busting, notifications. Return value is ignored.\n *\n * Errors are **isolated**: caught, logged, and discarded so a failing\n * side-effect never turns a successful write into an HTTP 500.\n * See {@link CollectionAfterChangeHook} for the await-vs-fire-and-forget guidance.\n */\n afterChange?: CollectionAfterChangeHook<TDoc>[];\n\n /**\n * Runs before a document is deleted. Throw to cancel the deletion.\n */\n beforeDelete?: CollectionBeforeDeleteHook<TDoc>[];\n\n /**\n * Runs after a document has been deleted. For cleanup side-effects only.\n *\n * Errors are **isolated**: caught, logged, and discarded — the deletion is\n * already committed and will not be undone.\n */\n afterDelete?: CollectionAfterDeleteHook<TDoc>[];\n }",
241
+ "description": "Collection-level lifecycle hooks.\n\nHooks run in the order they appear in the array. The return value of each\nhook is passed as the input to the next. Throwing inside any hook aborts\nthe operation and returns a `500` error.\n\nSee the [Hooks reference](/docs/concepts/hooks) for the full lifecycle diagram."
242
+ },
243
+ {
244
+ "name": "admin",
245
+ "signature": "admin?: {\n /**\n * Lucide icon displayed beside this collection in the Admin sidebar.\n * Uses Lucide component names, e.g. `'Newspaper'` or `'ShoppingBag'`.\n */\n icon?: AdminIconName;\n\n /** Custom component slots for this collection's list view. */\n components?: CollectionListComponentSlots;\n\n /**\n * The field name used as the document's display title in the Admin list\n * view and breadcrumbs. Defaults to `'title'` if the field exists.\n */\n useAsTitle?: string;\n\n /**\n * Field names to show as columns in the Admin list view.\n * Defaults to a sensible set of the first few non-structural fields.\n */\n defaultColumns?: string[];\n\n /**\n * Groups this collection under a named section in the Admin sidebar.\n * Collections with the same `group` are visually grouped together.\n */\n group?: string;\n\n /** If `true`, this collection is not shown in the Admin UI sidebar. */\n hidden?: boolean;\n\n /** If `false`, disables the filter UI entirely for this collection. Defaults to `true`. */\n filterable?: boolean;\n\n /**\n * URL to open in the Live Preview pane when editing a document.\n * Pass a function to derive the URL from the document's fields.\n *\n * @example\n * previewUrl: (doc) => `https://mysite.com/blog/${doc.slug}`\n */\n previewUrl?:\n | string\n | ((doc: TDoc, opts: { locale?: string }) => string | null);\n\n /**\n * How the Live Preview pane communicates with the frontend.\n * - `'postMessage'` (default) — sends a `postMessage` with the current doc data.\n * - `'token'` — passes a short-lived preview token as a query parameter.\n */\n previewMode?: \"postMessage\" | \"token\";\n\n /**\n * Frontend URL pattern for this collection, used by `url` fields to\n * resolve internal links. Use `{fieldName}` placeholders.\n *\n * @example\n * urlPattern: '/blog/{slug}' // → /blog/my-post\n * urlPattern: '/{slug}' // → /about\n */\n urlPattern?: string;\n }",
246
+ "description": "Admin UI configuration for this collection."
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "id": "@dyrected/core:createLifecycleEvent",
252
+ "name": "createLifecycleEvent",
253
+ "kind": "function",
254
+ "category": "workflows",
255
+ "sourcePackage": "@dyrected/core",
256
+ "description": "",
257
+ "signature": "export function createLifecycleEvent(args: {\n name: LifecycleEventName;\n collection: string;\n documentId: string;\n actorId?: string;\n payload: Record<string, unknown>;\n}): LifecycleEvent",
258
+ "members": []
259
+ },
260
+ {
261
+ "id": "@dyrected/core:createWorkflowDocument",
262
+ "name": "createWorkflowDocument",
263
+ "kind": "function",
264
+ "category": "workflows",
265
+ "sourcePackage": "@dyrected/core",
266
+ "description": "",
267
+ "signature": "export async function createWorkflowDocument(args: {\n config: DyrectedConfig;\n collection: CollectionConfig;\n data: Record<string, unknown>;\n user?: AuthenticatedUser;\n}): Promise<{ doc: BaseDocument; event: LifecycleEvent }>",
268
+ "members": []
269
+ },
270
+ {
271
+ "id": "@dyrected/core:DatabaseAdapter",
272
+ "name": "DatabaseAdapter",
273
+ "kind": "interface",
274
+ "category": "adapters",
275
+ "sourcePackage": "@dyrected/core",
276
+ "description": "The interface every database adapter must implement.\n\nDyrected ships adapters for PostgreSQL, MySQL, SQLite, and MongoDB.\nImplement this interface to connect any other database.",
277
+ "signature": "export interface DatabaseAdapter {\n /** Find a paginated list of documents in a collection. */\n find(args: {\n collection: string;\n where?: Record<string, unknown>;\n limit?: number;\n page?: number;\n sort?: string;\n }): Promise<PaginatedResult>;\n\n /** Find a single document by its ID. Returns `null` if not found. */\n findOne(args: {\n collection: string;\n id: string;\n }): Promise<BaseDocument | null>;\n\n /** Insert a new document and return it with its generated `id`. */\n create(args: {\n collection: string;\n data: Record<string, unknown>;\n }): Promise<BaseDocument>;\n\n /** Update a document by ID and return the updated document. */\n update(args: {\n collection: string;\n id: string;\n data: Record<string, unknown>;\n }): Promise<BaseDocument>;\n\n /** Delete a document by ID. Return value is intentionally untyped — callers do not use it. */\n delete(args: { collection: string; id: string }): Promise<unknown>;\n\n /** Fetch the singleton document for a global. Returns an empty object if not yet initialised. */\n getGlobal(args: { slug: string }): Promise<Record<string, unknown>>;\n\n /** Create or replace the singleton document for a global. */\n updateGlobal(args: {\n slug: string;\n data: Record<string, unknown>;\n }): Promise<Record<string, unknown>>;\n\n /**\n * Sync the database schema with the current collection and global configs.\n * Called on startup to create tables/collections that don't exist yet.\n * Not all adapters implement this (e.g. MongoDB is schema-less).\n */\n sync?(\n collections: CollectionConfig[],\n globals: GlobalConfig[],\n ): Promise<void>;\n\n /**\n * Execute a raw SQL query or database command.\n * Optional — not all adapters support raw access.\n */\n execute?(query: string, params?: unknown[]): Promise<unknown>;\n\n /**\n * Run all adapter operations in `callback` as one atomic transaction.\n * Shipped adapters implement this; workflow transitions require it.\n */\n transaction?<T>(callback: (db: DatabaseAdapter) => Promise<T>): Promise<T>;\n}",
278
+ "members": [
279
+ {
280
+ "name": "find",
281
+ "signature": "find(args: {\n collection: string;\n where?: Record<string, unknown>;\n limit?: number;\n page?: number;\n sort?: string;\n }): Promise<PaginatedResult>",
282
+ "description": "Find a paginated list of documents in a collection."
283
+ },
284
+ {
285
+ "name": "findOne",
286
+ "signature": "findOne(args: {\n collection: string;\n id: string;\n }): Promise<BaseDocument | null>",
287
+ "description": "Find a single document by its ID. Returns `null` if not found."
288
+ },
289
+ {
290
+ "name": "create",
291
+ "signature": "create(args: {\n collection: string;\n data: Record<string, unknown>;\n }): Promise<BaseDocument>",
292
+ "description": "Insert a new document and return it with its generated `id`."
293
+ },
294
+ {
295
+ "name": "update",
296
+ "signature": "update(args: {\n collection: string;\n id: string;\n data: Record<string, unknown>;\n }): Promise<BaseDocument>",
297
+ "description": "Update a document by ID and return the updated document."
298
+ },
299
+ {
300
+ "name": "delete",
301
+ "signature": "delete(args: { collection: string; id: string }): Promise<unknown>",
302
+ "description": "Delete a document by ID. Return value is intentionally untyped — callers do not use it."
303
+ },
304
+ {
305
+ "name": "getGlobal",
306
+ "signature": "getGlobal(args: { slug: string }): Promise<Record<string, unknown>>",
307
+ "description": "Fetch the singleton document for a global. Returns an empty object if not yet initialised."
308
+ },
309
+ {
310
+ "name": "updateGlobal",
311
+ "signature": "updateGlobal(args: {\n slug: string;\n data: Record<string, unknown>;\n }): Promise<Record<string, unknown>>",
312
+ "description": "Create or replace the singleton document for a global."
313
+ },
314
+ {
315
+ "name": "sync",
316
+ "signature": "sync(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>",
317
+ "description": "Sync the database schema with the current collection and global configs.\nCalled on startup to create tables/collections that don't exist yet.\nNot all adapters implement this (e.g. MongoDB is schema-less)."
318
+ },
319
+ {
320
+ "name": "execute",
321
+ "signature": "execute(query: string, params?: unknown[]): Promise<unknown>",
322
+ "description": "Execute a raw SQL query or database command.\nOptional — not all adapters support raw access."
323
+ },
324
+ {
325
+ "name": "transaction",
326
+ "signature": "transaction<T>(callback: (db: DatabaseAdapter) => Promise<T>): Promise<T>",
327
+ "description": "Run all adapter operations in `callback` as one atomic transaction.\nShipped adapters implement this; workflow transitions require it."
328
+ }
329
+ ]
330
+ },
331
+ {
332
+ "id": "@dyrected/core:dispatchLifecycleEvent",
333
+ "name": "dispatchLifecycleEvent",
334
+ "kind": "function",
335
+ "category": "workflows",
336
+ "sourcePackage": "@dyrected/core",
337
+ "description": "",
338
+ "signature": "export async function dispatchLifecycleEvent(config: DyrectedConfig, event: LifecycleEvent): Promise<void>",
339
+ "members": []
340
+ },
341
+ {
342
+ "id": "@dyrected/core:dispatchPendingLifecycleEvents",
343
+ "name": "dispatchPendingLifecycleEvents",
344
+ "kind": "function",
345
+ "category": "workflows",
346
+ "sourcePackage": "@dyrected/core",
347
+ "description": "",
348
+ "signature": "export async function dispatchPendingLifecycleEvents(config: DyrectedConfig, limit = 50): Promise<number>",
349
+ "members": []
350
+ },
351
+ {
352
+ "id": "@dyrected/core:DyrectedConfig",
353
+ "name": "DyrectedConfig",
354
+ "kind": "interface",
355
+ "category": "configuration",
356
+ "sourcePackage": "@dyrected/core",
357
+ "description": "The root configuration object passed to `createDyrectedApp`.\n\nThis is the single source of truth for your entire Dyrected instance —\ncollections, globals, database adapter, storage, email, and more.",
358
+ "signature": "export interface DyrectedConfig {\n /** Collection definitions. Each collection maps to a database table/collection. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n collections: CollectionConfig<any>[];\n\n /** Global (singleton) definitions. Each global maps to a single document. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n globals: GlobalConfig<any>[];\n\n /**\n * The database adapter. Required for all data operations.\n * @see {@link DatabaseAdapter}\n */\n db?: DatabaseAdapter;\n\n /**\n * The storage adapter for file uploads.\n * Required when any collection has `upload: true`.\n * @see {@link StorageAdapter}\n */\n storage?: StorageAdapter;\n\n /**\n * The image processing service. Required when any upload collection\n * defines `imageSizes`.\n * @see {@link ImageService}\n */\n image?: ImageService;\n\n /** Admin UI branding and metadata. */\n admin?: AdminConfig;\n\n /**\n * Email transport configuration. Required for welcome emails, password\n * resets, and invite links.\n *\n * @example\n * email: {\n * from: 'no-reply@myapp.com',\n * send: async ({ to, subject, html }) => {\n * await resend.emails.send({ from, to, subject, html })\n * },\n * }\n */\n email?: {\n /** The `From` address for all outbound emails. */\n from: string;\n /** The send function. Wire in any email provider (Resend, SendGrid, SES, etc.). */\n send: (args: {\n to: string;\n subject: string;\n html: string;\n }) => Promise<void>;\n /** Override the default email templates. */\n templates?: {\n welcome?: (args: { email: string }) => { subject?: string; html: string };\n invite?: (args: { token: string; invitedByEmail?: string }) => {\n subject?: string;\n html: string;\n };\n resetPassword?: (args: { token: string; url?: string }) => {\n subject?: string;\n html: string;\n };\n passwordChanged?: (args: { email: string }) => {\n subject?: string;\n html: string;\n };\n };\n };\n\n /**\n * Redis connection URL. Required for distributed caching of dynamic option\n * resolvers and other server-side caches in multi-instance deployments.\n *\n * @example\n * redis: { url: process.env.REDIS_URL }\n */\n redis?: {\n url: string;\n };\n\n /** Durable lifecycle-event delivery configuration. */\n events?: {\n handlers: LifecycleEventHandler[];\n /** Maximum delivery attempts before an event remains failed. Defaults to 8. */\n maxAttempts?: number;\n /** Initial exponential-backoff delay in milliseconds. Defaults to 1000. */\n retryDelayMs?: number;\n };\n\n /**\n * Cross-Origin Resource Sharing (CORS) configuration.\n * List all origins that are allowed to call the Dyrected API.\n *\n * @example\n * cors: { origins: ['https://myapp.com', 'https://www.myapp.com'] }\n */\n cors?: {\n origins: string[];\n };\n\n /**\n * Callback to dynamically fetch additional collections and globals for a\n * given site ID at request time. Used in multi-tenant deployments where each\n * site has its own schema stored in the database.\n *\n * @param siteId The `X-Site-Id` header value from the incoming request.\n * @returns Extra collections and globals to merge into the config for this request.\n *\n * @example\n * onSchemaFetch: async (siteId) => {\n * const site = await db.findOne({ collection: 'sites', id: siteId })\n * return buildSchemaFromSiteConfig(site)\n * }\n */\n onSchemaFetch?: (\n siteId: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) => Promise<{\n collections?: CollectionConfig<any>[];\n globals?: GlobalConfig<any>[];\n }>;\n}",
359
+ "members": [
360
+ {
361
+ "name": "collections",
362
+ "signature": "collections: CollectionConfig<any>[]",
363
+ "description": "Collection definitions. Each collection maps to a database table/collection."
364
+ },
365
+ {
366
+ "name": "globals",
367
+ "signature": "globals: GlobalConfig<any>[]",
368
+ "description": "Global (singleton) definitions. Each global maps to a single document."
369
+ },
370
+ {
371
+ "name": "db",
372
+ "signature": "db?: DatabaseAdapter",
373
+ "description": "The database adapter. Required for all data operations."
374
+ },
375
+ {
376
+ "name": "storage",
377
+ "signature": "storage?: StorageAdapter",
378
+ "description": "The storage adapter for file uploads.\nRequired when any collection has `upload: true`."
379
+ },
380
+ {
381
+ "name": "image",
382
+ "signature": "image?: ImageService",
383
+ "description": "The image processing service. Required when any upload collection\ndefines `imageSizes`."
384
+ },
385
+ {
386
+ "name": "admin",
387
+ "signature": "admin?: AdminConfig",
388
+ "description": "Admin UI branding and metadata."
389
+ },
390
+ {
391
+ "name": "email",
392
+ "signature": "email?: {\n /** The `From` address for all outbound emails. */\n from: string;\n /** The send function. Wire in any email provider (Resend, SendGrid, SES, etc.). */\n send: (args: {\n to: string;\n subject: string;\n html: string;\n }) => Promise<void>;\n /** Override the default email templates. */\n templates?: {\n welcome?: (args: { email: string }) => { subject?: string; html: string };\n invite?: (args: { token: string; invitedByEmail?: string }) => {\n subject?: string;\n html: string;\n };\n resetPassword?: (args: { token: string; url?: string }) => {\n subject?: string;\n html: string;\n };\n passwordChanged?: (args: { email: string }) => {\n subject?: string;\n html: string;\n };\n };\n }",
393
+ "description": "Email transport configuration. Required for welcome emails, password\nresets, and invite links."
394
+ },
395
+ {
396
+ "name": "redis",
397
+ "signature": "redis?: {\n url: string;\n }",
398
+ "description": "Redis connection URL. Required for distributed caching of dynamic option\nresolvers and other server-side caches in multi-instance deployments."
399
+ },
400
+ {
401
+ "name": "events",
402
+ "signature": "events?: {\n handlers: LifecycleEventHandler[];\n /** Maximum delivery attempts before an event remains failed. Defaults to 8. */\n maxAttempts?: number;\n /** Initial exponential-backoff delay in milliseconds. Defaults to 1000. */\n retryDelayMs?: number;\n }",
403
+ "description": "Durable lifecycle-event delivery configuration."
404
+ },
405
+ {
406
+ "name": "cors",
407
+ "signature": "cors?: {\n origins: string[];\n }",
408
+ "description": "Cross-Origin Resource Sharing (CORS) configuration.\nList all origins that are allowed to call the Dyrected API."
409
+ },
410
+ {
411
+ "name": "onSchemaFetch",
412
+ "signature": "onSchemaFetch?: (\n siteId: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) => Promise<{\n collections?: CollectionConfig<any>[];\n globals?: GlobalConfig<any>[];\n }>",
413
+ "description": "Callback to dynamically fetch additional collections and globals for a\ngiven site ID at request time. Used in multi-tenant deployments where each\nsite has its own schema stored in the database."
414
+ }
415
+ ]
416
+ },
417
+ {
418
+ "id": "@dyrected/core:Field",
419
+ "name": "Field",
420
+ "kind": "type",
421
+ "category": "fields",
422
+ "sourcePackage": "@dyrected/core",
423
+ "description": "Defines a single field on a collection or global.\n\n## Typed `value` in hook callbacks\n\nThree hook callbacks automatically receive a `value` typed to the field's\nown value type — no manual annotations needed:\n\n| Hook | When it runs |\n|------|-------------|\n| `hooks.beforeChange` | Server — before the value is written to the DB |\n| `hooks.afterRead` | Server — after the value is read, before the API response |\n| `admin.hooks.onChange` | Browser — whenever a sibling field changes in the Admin UI |\n\nType mapping by `type` property:\n- `text / textarea / email / url / icon / date / select / radio` → `string`\n- `number` → `number`\n- `boolean` → `boolean`\n- `multiSelect` → `string[]`\n- `relationship / image` → `string | string[]`\n- `richText / json` → `Record<string, unknown>`\n- `object / array / blocks` → `unknown`\n\n```ts\n{\n name: 'slug', type: 'text',\n hooks: {\n beforeChange: [({ value }) => value.toLowerCase()], // value: string ✓\n afterRead: [({ value }) => value.trim()], // value: string ✓\n },\n admin: {\n hooks: {\n onChange: ({ value, siblingData }) => // value: string ✓\n (siblingData.title as string ?? '').toLowerCase().replace(/\\s+/g, '-'),\n },\n },\n}\n```\n\n**Important**: write `type` as a plain string literal — do **not** use `as const`.\nTypeScript's `const` generic inference already preserves literal types, and\nadding `as const` to the discriminant property prevents the contextual type\nfrom flowing into the hook callbacks.\n\n```ts\n// ✓ correct\n{ name: 'slug', type: 'text', hooks: { beforeChange: [({ value }) => value.toLowerCase()] } }\n\n// ✗ breaks value typing\n{ name: 'slug', type: 'text' as const, hooks: { beforeChange: [({ value }) => value.toLowerCase()] } }\n```",
424
+ "signature": "export type Field = FieldBase &\n (\n | ({\n type:\n | \"text\"\n | \"textarea\"\n | \"email\"\n | \"url\"\n | \"icon\"\n | \"date\"\n | \"datetime\"\n | \"time\"\n | \"select\"\n | \"radio\";\n } & FieldHooks<string> &\n FieldAdminHooks<string>)\n | ({ type: \"number\" } & FieldHooks<number> & FieldAdminHooks<number>)\n | ({ type: \"boolean\" } & FieldHooks<boolean> & FieldAdminHooks<boolean>)\n | ({ type: \"multiSelect\" } & FieldHooks<string[]> &\n FieldAdminHooks<string[]>)\n | ({ type: \"relationship\" | \"image\" } & FieldHooks<string | string[]> &\n FieldAdminHooks<string | string[]>)\n | ({ type: \"richText\" | \"json\" } & FieldHooks<Record<string, unknown>> &\n FieldAdminHooks<Record<string, unknown>>)\n | ({\n type: \"object\" | \"array\" | \"blocks\" | \"join\" | \"row\";\n } & FieldHooks<unknown> &\n FieldAdminHooks<unknown>)\n );",
425
+ "members": []
426
+ },
427
+ {
428
+ "id": "@dyrected/core:FieldAfterReadHook",
429
+ "name": "FieldAfterReadHook",
430
+ "kind": "type",
431
+ "category": "hooks",
432
+ "sourcePackage": "@dyrected/core",
433
+ "description": "A hook that runs **after a field value is read** from the database, before\nthe response is sent to the client.\n\nReturn the transformed value to return to the client. Use this for masking,\nformatting, or adding computed properties.",
434
+ "signature": "export type FieldAfterReadHook<\n TValue = unknown,\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The raw field value as stored in the database. */\n value: TValue;\n /** The full document being returned (with defaults applied). */\n doc: TDoc;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange`/`afterDelete` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => TValue | undefined | Promise<TValue | undefined>;",
435
+ "members": []
436
+ },
437
+ {
438
+ "id": "@dyrected/core:FieldBeforeChangeHook",
439
+ "name": "FieldBeforeChangeHook",
440
+ "kind": "type",
441
+ "category": "hooks",
442
+ "sourcePackage": "@dyrected/core",
443
+ "description": "A hook that runs **before a field value is saved** to the database.\n\nReturn the transformed value to persist. Return `undefined` to leave the\nvalue unchanged (same as returning the original `value`).\n\nField `beforeChange` hooks run recursively inside `array`, `object`, and\n`blocks` fields — every nested item is processed automatically.",
444
+ "signature": "export type FieldBeforeChangeHook<\n TValue = unknown,\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n /** The current value of this field (after any previous hooks in the chain). */\n value: TValue;\n /** The full document as it existed before this update. `undefined` on create. */\n originalDoc?: TDoc;\n /** The full incoming data payload being written. */\n data: Partial<TDoc>;\n /** The authenticated user, or `undefined` for unauthenticated requests. */\n user?: AuthenticatedUser;\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange`/`afterDelete` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => TValue | undefined | Promise<TValue | undefined>;",
445
+ "members": []
446
+ },
447
+ {
448
+ "id": "@dyrected/core:FieldHook",
449
+ "name": "FieldHook",
450
+ "kind": "type",
451
+ "category": "hooks",
452
+ "sourcePackage": "@dyrected/core",
453
+ "description": "",
454
+ "signature": "export type FieldHook<\n TDoc extends object = Record<string, unknown>,\n TValue = unknown,\n> = FieldBeforeChangeHook<TValue, TDoc>;",
455
+ "members": []
456
+ },
457
+ {
458
+ "id": "@dyrected/core:FieldType",
459
+ "name": "FieldType",
460
+ "kind": "type",
461
+ "category": "fields",
462
+ "sourcePackage": "@dyrected/core",
463
+ "description": "Every field type supported by Dyrected.\n\n- Text group: `text`, `textarea`, `richText`, `email`, `url`, `icon`\n- Number/Bool: `number`, `boolean`\n- Date: `date`, `datetime`, `time`\n- Selection: `select`, `multiSelect`, `radio`\n- Relationship: `relationship`, `join`\n- Structural: `array`, `object`, `blocks`, `json`\n- Layout: `row`\n- Media: `image`",
464
+ "signature": "export type FieldType =\n | \"text\"\n | \"textarea\"\n | \"richText\"\n | \"number\"\n | \"boolean\"\n | \"date\"\n | \"datetime\"\n | \"time\"\n | \"select\"\n | \"multiSelect\"\n | \"radio\"\n | \"relationship\"\n | \"array\"\n | \"object\"\n | \"json\"\n | \"blocks\"\n | \"image\"\n | \"email\"\n | \"url\"\n | \"icon\"\n | \"join\"\n | \"row\";",
465
+ "members": []
466
+ },
467
+ {
468
+ "id": "@dyrected/core:FileData",
469
+ "name": "FileData",
470
+ "kind": "interface",
471
+ "category": "adapters",
472
+ "sourcePackage": "@dyrected/core",
473
+ "description": "Metadata returned after a file is uploaded and stored.\nStored on the document in upload collections.",
474
+ "signature": "export interface FileData {\n filename: string;\n filesize?: number;\n mimeType: string;\n /** Public URL of the stored file. */\n url: string;\n width?: number;\n height?: number;\n focalPoint?: { x: number; y: number };\n /** Base64-encoded BlurHash string for progressive image loading. */\n blurhash?: string;\n /** `'upload'` for server-stored files; `'external'` for provider-managed files. */\n type?: \"upload\" | \"external\";\n provider?: string;\n provider_metadata?: unknown;\n [key: string]: unknown;\n}",
475
+ "members": [
476
+ {
477
+ "name": "filename",
478
+ "signature": "filename: string",
479
+ "description": ""
480
+ },
481
+ {
482
+ "name": "filesize",
483
+ "signature": "filesize?: number",
484
+ "description": ""
485
+ },
486
+ {
487
+ "name": "mimeType",
488
+ "signature": "mimeType: string",
489
+ "description": ""
490
+ },
491
+ {
492
+ "name": "url",
493
+ "signature": "url: string",
494
+ "description": "Public URL of the stored file."
495
+ },
496
+ {
497
+ "name": "width",
498
+ "signature": "width?: number",
499
+ "description": ""
500
+ },
501
+ {
502
+ "name": "height",
503
+ "signature": "height?: number",
504
+ "description": ""
505
+ },
506
+ {
507
+ "name": "focalPoint",
508
+ "signature": "focalPoint?: { x: number; y: number }",
509
+ "description": ""
510
+ },
511
+ {
512
+ "name": "blurhash",
513
+ "signature": "blurhash?: string",
514
+ "description": "Base64-encoded BlurHash string for progressive image loading."
515
+ },
516
+ {
517
+ "name": "type",
518
+ "signature": "type?: \"upload\" | \"external\"",
519
+ "description": "`'upload'` for server-stored files; `'external'` for provider-managed files."
520
+ },
521
+ {
522
+ "name": "provider",
523
+ "signature": "provider?: string",
524
+ "description": ""
525
+ },
526
+ {
527
+ "name": "provider_metadata",
528
+ "signature": "provider_metadata?: unknown",
529
+ "description": ""
530
+ }
531
+ ]
532
+ },
533
+ {
534
+ "id": "@dyrected/core:GlobalAfterChangeHook",
535
+ "name": "GlobalAfterChangeHook",
536
+ "kind": "type",
537
+ "category": "hooks",
538
+ "sourcePackage": "@dyrected/core",
539
+ "description": "",
540
+ "signature": "export type GlobalAfterChangeHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n doc: TDoc;\n previousDoc?: TDoc;\n req: HookRequestContext;\n user?: AuthenticatedUser;\n operation: \"update\";\n /**\n * Database adapter with full read/write access. The DB write for this\n * operation has already committed — safe for side-effect writes.\n */\n db: DatabaseAdapter;\n}) => void | Promise<void>;",
541
+ "members": []
542
+ },
543
+ {
544
+ "id": "@dyrected/core:GlobalAfterReadHook",
545
+ "name": "GlobalAfterReadHook",
546
+ "kind": "type",
547
+ "category": "hooks",
548
+ "sourcePackage": "@dyrected/core",
549
+ "description": "Runs after the global document is fetched, before the response is sent.",
550
+ "signature": "export type GlobalAfterReadHook<TDoc extends object = Record<string, unknown>> =\n (args: {\n doc: TDoc;\n req: HookRequestContext;\n user?: AuthenticatedUser;\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n }) => TDoc | Promise<TDoc>;",
551
+ "members": []
552
+ },
553
+ {
554
+ "id": "@dyrected/core:GlobalBeforeChangeHook",
555
+ "name": "GlobalBeforeChangeHook",
556
+ "kind": "type",
557
+ "category": "hooks",
558
+ "sourcePackage": "@dyrected/core",
559
+ "description": "Runs before the global document is updated.\nOperation is always `'update'` (globals cannot be created or deleted).",
560
+ "signature": "export type GlobalBeforeChangeHook<\n TDoc extends object = Record<string, unknown>,\n> = (args: {\n data: Partial<TDoc>;\n doc?: TDoc;\n req: HookRequestContext;\n user?: AuthenticatedUser;\n operation: \"update\";\n /**\n * Database adapter for cross-collection reads. Write operations (create,\n * update, delete) will throw — use `afterChange` for writes.\n */\n db: ReadonlyDatabaseAdapter;\n}) => Partial<TDoc> | void | Promise<Partial<TDoc> | void>;",
561
+ "members": []
562
+ },
563
+ {
564
+ "id": "@dyrected/core:GlobalBeforeReadHook",
565
+ "name": "GlobalBeforeReadHook",
566
+ "kind": "type",
567
+ "category": "hooks",
568
+ "sourcePackage": "@dyrected/core",
569
+ "description": "",
570
+ "signature": "export type GlobalBeforeReadHook = CollectionBeforeReadHook;",
571
+ "members": []
572
+ },
573
+ {
574
+ "id": "@dyrected/core:GlobalConfig",
575
+ "name": "GlobalConfig",
576
+ "kind": "interface",
577
+ "category": "configuration",
578
+ "sourcePackage": "@dyrected/core",
579
+ "description": "Defines a Dyrected global — a singleton document without pagination or IDs.\n\nGlobals are ideal for site-wide settings, feature flags, or any data where\nthere is always exactly one record (e.g. `site-settings`, `navigation`, `theme`).\n\nPass your document's TypeScript type as the generic parameter `TDoc` to get\nfully typed hooks:\n\n```ts\ninterface SiteSettings {\n siteName: string\n tagline: string\n maintenanceMode: boolean\n}\n\nexport const Settings = defineGlobal<SiteSettings>({\n slug: 'site-settings',\n hooks: {\n afterChange: [({ doc }) => {\n // `doc` is typed as SiteSettings\n if (doc.maintenanceMode) alertOnCall()\n }],\n },\n fields: [...],\n})\n```",
580
+ "signature": "export interface GlobalConfig<TDoc extends object = Record<string, unknown>> {\n /**\n * Unique identifier for this global.\n * Used as the URL segment (`/api/globals/:slug`) and the storage key.\n */\n slug: string;\n\n /** Restricts this global to a specific site in a multi-tenant deployment. */\n siteId?: string;\n\n /**\n * If `true`, this global is shared across all sites in a multi-tenant\n * deployment.\n */\n shared?: boolean;\n\n /** Human-readable label shown in the Admin UI sidebar. */\n label?: string;\n\n /** Field definitions for this global's document schema. */\n fields: Field[];\n\n /** Access control for reading and updating this global. */\n access?: {\n read?: AccessFunction<TDoc>;\n update?: AccessFunction<TDoc>;\n };\n\n /**\n * Global-level lifecycle hooks.\n * Globals support `beforeRead`, `afterRead`, `beforeChange`, and `afterChange`.\n * There are no delete hooks since globals cannot be deleted.\n */\n hooks?: {\n beforeRead?: GlobalBeforeReadHook[];\n afterRead?: GlobalAfterReadHook<TDoc>[];\n beforeChange?: GlobalBeforeChangeHook<TDoc>[];\n afterChange?: GlobalAfterChangeHook<TDoc>[];\n };\n\n /** Admin UI configuration for this global. */\n admin?: {\n /**\n * Lucide icon displayed beside this global in the Admin sidebar.\n * Uses Lucide component names, e.g. `'Settings2'` or `'Palette'`.\n */\n icon?: AdminIconName;\n /** Groups this global under a named section in the Admin sidebar. */\n group?: string;\n /** If `true`, this global is not shown in the Admin UI sidebar. */\n hidden?: boolean;\n };\n\n /**\n * Initial data to seed this global with the first time it is fetched and\n * found to be empty.\n */\n initialData?: Partial<TDoc>;\n}",
581
+ "members": [
582
+ {
583
+ "name": "slug",
584
+ "signature": "slug: string",
585
+ "description": "Unique identifier for this global.\nUsed as the URL segment (`/api/globals/:slug`) and the storage key."
586
+ },
587
+ {
588
+ "name": "siteId",
589
+ "signature": "siteId?: string",
590
+ "description": "Restricts this global to a specific site in a multi-tenant deployment."
591
+ },
592
+ {
593
+ "name": "shared",
594
+ "signature": "shared?: boolean",
595
+ "description": "If `true`, this global is shared across all sites in a multi-tenant\ndeployment."
596
+ },
597
+ {
598
+ "name": "label",
599
+ "signature": "label?: string",
600
+ "description": "Human-readable label shown in the Admin UI sidebar."
601
+ },
602
+ {
603
+ "name": "fields",
604
+ "signature": "fields: Field[]",
605
+ "description": "Field definitions for this global's document schema."
606
+ },
607
+ {
608
+ "name": "access",
609
+ "signature": "access?: {\n read?: AccessFunction<TDoc>;\n update?: AccessFunction<TDoc>;\n }",
610
+ "description": "Access control for reading and updating this global."
611
+ },
612
+ {
613
+ "name": "hooks",
614
+ "signature": "hooks?: {\n beforeRead?: GlobalBeforeReadHook[];\n afterRead?: GlobalAfterReadHook<TDoc>[];\n beforeChange?: GlobalBeforeChangeHook<TDoc>[];\n afterChange?: GlobalAfterChangeHook<TDoc>[];\n }",
615
+ "description": "Global-level lifecycle hooks.\nGlobals support `beforeRead`, `afterRead`, `beforeChange`, and `afterChange`.\nThere are no delete hooks since globals cannot be deleted."
616
+ },
617
+ {
618
+ "name": "admin",
619
+ "signature": "admin?: {\n /**\n * Lucide icon displayed beside this global in the Admin sidebar.\n * Uses Lucide component names, e.g. `'Settings2'` or `'Palette'`.\n */\n icon?: AdminIconName;\n /** Groups this global under a named section in the Admin sidebar. */\n group?: string;\n /** If `true`, this global is not shown in the Admin UI sidebar. */\n hidden?: boolean;\n }",
620
+ "description": "Admin UI configuration for this global."
621
+ },
622
+ {
623
+ "name": "initialData",
624
+ "signature": "initialData?: Partial<TDoc>",
625
+ "description": "Initial data to seed this global with the first time it is fetched and\nfound to be empty."
626
+ }
627
+ ]
628
+ },
629
+ {
630
+ "id": "@dyrected/core:HookFunction",
631
+ "name": "HookFunction",
632
+ "kind": "type",
633
+ "category": "hooks",
634
+ "sourcePackage": "@dyrected/core",
635
+ "description": "",
636
+ "signature": "export type HookFunction<TDoc extends object = Record<string, unknown>> =\n (args: {\n data?: Partial<TDoc>;\n doc?: TDoc;\n user?: AuthenticatedUser;\n req?: HookRequestContext;\n operation?: \"create\" | \"update\" | \"delete\";\n db?: DatabaseAdapter;\n [key: string]: unknown;\n }) => unknown | Promise<unknown>;",
637
+ "members": []
638
+ },
639
+ {
640
+ "id": "@dyrected/core:HookRequestContext",
641
+ "name": "HookRequestContext",
642
+ "kind": "interface",
643
+ "category": "hooks",
644
+ "sourcePackage": "@dyrected/core",
645
+ "description": "Minimum HTTP request context passed to every server-side hook and resolver.\n\nThe full Web Standard `Request` is available as `raw` when you need it, but\nmost hooks only need `query` (URL search parameters).",
646
+ "signature": "export interface HookRequestContext {\n /** Parsed URL query-string parameters, e.g. `{ page: '2', search: 'hello' }`. */\n query: Record<string, string>;\n /** Incoming HTTP headers, lowercased. */\n headers: Record<string, string>;\n /** The raw Web Standard `Request` object. Useful for streaming or advanced header inspection. */\n raw?: Request;\n}",
647
+ "members": [
648
+ {
649
+ "name": "query",
650
+ "signature": "query: Record<string, string>",
651
+ "description": "Parsed URL query-string parameters, e.g. `{ page: '2', search: 'hello' }`."
652
+ },
653
+ {
654
+ "name": "headers",
655
+ "signature": "headers: Record<string, string>",
656
+ "description": "Incoming HTTP headers, lowercased."
657
+ },
658
+ {
659
+ "name": "raw",
660
+ "signature": "raw?: Request",
661
+ "description": "The raw Web Standard `Request` object. Useful for streaming or advanced header inspection."
662
+ }
663
+ ]
664
+ },
665
+ {
666
+ "id": "@dyrected/core:ImageService",
667
+ "name": "ImageService",
668
+ "kind": "interface",
669
+ "category": "adapters",
670
+ "sourcePackage": "@dyrected/core",
671
+ "description": "Processes uploaded images — generates metadata (dimensions, BlurHash) and\nproduces resized variants defined in `UploadConfig.imageSizes`.",
672
+ "signature": "export interface ImageService {\n process(args: {\n buffer: Uint8Array;\n mimeType: string;\n config?: CollectionConfig[\"upload\"];\n focalPoint?: { x: number; y: number };\n }): Promise<{\n metadata: {\n width?: number;\n height?: number;\n /** Base64-encoded BlurHash for progressive loading. */\n blurhash?: string;\n };\n /** Generated image sizes keyed by their `name`. */\n sizes?: Record<\n string,\n { buffer: Uint8Array; width: number; height: number; filename: string }\n >;\n }>;\n}",
673
+ "members": [
674
+ {
675
+ "name": "process",
676
+ "signature": "process(args: {\n buffer: Uint8Array;\n mimeType: string;\n config?: CollectionConfig[\"upload\"];\n focalPoint?: { x: number; y: number };\n }): Promise<{\n metadata: {\n width?: number;\n height?: number;\n /** Base64-encoded BlurHash for progressive loading. */\n blurhash?: string;\n };\n /** Generated image sizes keyed by their `name`. */\n sizes?: Record<\n string,\n { buffer: Uint8Array; width: number; height: number; filename: string }\n >;\n }>",
677
+ "description": ""
678
+ }
679
+ ]
680
+ },
681
+ {
682
+ "id": "@dyrected/core:InferDocShape",
683
+ "name": "InferDocShape",
684
+ "kind": "type",
685
+ "category": "fields",
686
+ "sourcePackage": "@dyrected/core",
687
+ "description": "",
688
+ "signature": "export type InferDocShape<Fields extends readonly Field[]> =\n Fields extends readonly []\n ? Record<never, never>\n : Fields extends readonly [\n infer Head extends Field,\n ...infer Tail extends readonly Field[],\n ]\n ? InferFieldEntry<Head> & InferDocShape<Tail>\n : Record<string, unknown>;",
689
+ "members": []
690
+ },
691
+ {
692
+ "id": "@dyrected/core:initializeWorkflowDocument",
693
+ "name": "initializeWorkflowDocument",
694
+ "kind": "function",
695
+ "category": "workflows",
696
+ "sourcePackage": "@dyrected/core",
697
+ "description": "",
698
+ "signature": "export function initializeWorkflowDocument(data: Record<string, unknown>, workflow: WorkflowConfig)",
699
+ "members": []
700
+ },
701
+ {
702
+ "id": "@dyrected/core:LIFECYCLE_EVENTS_COLLECTION",
703
+ "name": "LIFECYCLE_EVENTS_COLLECTION",
704
+ "kind": "constant",
705
+ "category": "workflows",
706
+ "sourcePackage": "@dyrected/core",
707
+ "description": "",
708
+ "signature": "export const LIFECYCLE_EVENTS_COLLECTION = \"__lifecycle_events\";",
709
+ "members": []
710
+ },
711
+ {
712
+ "id": "@dyrected/core:LifecycleEvent",
713
+ "name": "LifecycleEvent",
714
+ "kind": "interface",
715
+ "category": "workflows",
716
+ "sourcePackage": "@dyrected/core",
717
+ "description": "",
718
+ "signature": "export interface LifecycleEvent<TPayload = Record<string, unknown>> {\n id: string;\n name: LifecycleEventName;\n collection: string;\n documentId: string;\n occurredAt: string;\n actorId?: string;\n payload: TPayload;\n attempts: number;\n status: \"pending\" | \"processing\" | \"delivered\" | \"failed\";\n nextAttemptAt?: string;\n deliveredAt?: string;\n lastError?: string;\n}",
719
+ "members": [
720
+ {
721
+ "name": "id",
722
+ "signature": "id: string",
723
+ "description": ""
724
+ },
725
+ {
726
+ "name": "name",
727
+ "signature": "name: LifecycleEventName",
728
+ "description": ""
729
+ },
730
+ {
731
+ "name": "collection",
732
+ "signature": "collection: string",
733
+ "description": ""
734
+ },
735
+ {
736
+ "name": "documentId",
737
+ "signature": "documentId: string",
738
+ "description": ""
739
+ },
740
+ {
741
+ "name": "occurredAt",
742
+ "signature": "occurredAt: string",
743
+ "description": ""
744
+ },
745
+ {
746
+ "name": "actorId",
747
+ "signature": "actorId?: string",
748
+ "description": ""
749
+ },
750
+ {
751
+ "name": "payload",
752
+ "signature": "payload: TPayload",
753
+ "description": ""
754
+ },
755
+ {
756
+ "name": "attempts",
757
+ "signature": "attempts: number",
758
+ "description": ""
759
+ },
760
+ {
761
+ "name": "status",
762
+ "signature": "status: \"pending\" | \"processing\" | \"delivered\" | \"failed\"",
763
+ "description": ""
764
+ },
765
+ {
766
+ "name": "nextAttemptAt",
767
+ "signature": "nextAttemptAt?: string",
768
+ "description": ""
769
+ },
770
+ {
771
+ "name": "deliveredAt",
772
+ "signature": "deliveredAt?: string",
773
+ "description": ""
774
+ },
775
+ {
776
+ "name": "lastError",
777
+ "signature": "lastError?: string",
778
+ "description": ""
779
+ }
780
+ ]
781
+ },
782
+ {
783
+ "id": "@dyrected/core:LifecycleEventHandler",
784
+ "name": "LifecycleEventHandler",
785
+ "kind": "type",
786
+ "category": "workflows",
787
+ "sourcePackage": "@dyrected/core",
788
+ "description": "",
789
+ "signature": "export type LifecycleEventHandler = (\n event: LifecycleEvent,\n) => void | Promise<void>;",
790
+ "members": []
791
+ },
792
+ {
793
+ "id": "@dyrected/core:LifecycleEventName",
794
+ "name": "LifecycleEventName",
795
+ "kind": "type",
796
+ "category": "workflows",
797
+ "sourcePackage": "@dyrected/core",
798
+ "description": "",
799
+ "signature": "export type LifecycleEventName = (typeof LIFECYCLE_EVENT_NAMES)[number];",
800
+ "members": []
801
+ },
802
+ {
803
+ "id": "@dyrected/core:materializeWorkflowDocument",
804
+ "name": "materializeWorkflowDocument",
805
+ "kind": "function",
806
+ "category": "workflows",
807
+ "sourcePackage": "@dyrected/core",
808
+ "description": "",
809
+ "signature": "export function materializeWorkflowDocument(\n doc: BaseDocument,\n workflow: WorkflowConfig,\n user?: AuthenticatedUser,\n): BaseDocument | null",
810
+ "members": []
811
+ },
812
+ {
813
+ "id": "@dyrected/core:PaginatedResult",
814
+ "name": "PaginatedResult",
815
+ "kind": "interface",
816
+ "category": "adapters",
817
+ "sourcePackage": "@dyrected/core",
818
+ "description": "The envelope returned by collection list endpoints (`GET /api/collections/:slug`).",
819
+ "signature": "export interface PaginatedResult<T = Record<string, any>> {\n /** The documents on the current page. */\n docs: T[];\n /** Total number of documents matching the query (across all pages). */\n total: number;\n /** Maximum number of documents per page as requested. */\n limit: number;\n /** The current page number (1-indexed). */\n page: number;\n /** Total number of pages given the current `limit`. */\n totalPages: number;\n /** Whether a next page exists. */\n hasNextPage: boolean;\n /** Whether a previous page exists. */\n hasPrevPage: boolean;\n}",
820
+ "members": [
821
+ {
822
+ "name": "docs",
823
+ "signature": "docs: T[]",
824
+ "description": "The documents on the current page."
825
+ },
826
+ {
827
+ "name": "total",
828
+ "signature": "total: number",
829
+ "description": "Total number of documents matching the query (across all pages)."
830
+ },
831
+ {
832
+ "name": "limit",
833
+ "signature": "limit: number",
834
+ "description": "Maximum number of documents per page as requested."
835
+ },
836
+ {
837
+ "name": "page",
838
+ "signature": "page: number",
839
+ "description": "The current page number (1-indexed)."
840
+ },
841
+ {
842
+ "name": "totalPages",
843
+ "signature": "totalPages: number",
844
+ "description": "Total number of pages given the current `limit`."
845
+ },
846
+ {
847
+ "name": "hasNextPage",
848
+ "signature": "hasNextPage: boolean",
849
+ "description": "Whether a next page exists."
850
+ },
851
+ {
852
+ "name": "hasPrevPage",
853
+ "signature": "hasPrevPage: boolean",
854
+ "description": "Whether a previous page exists."
855
+ }
856
+ ]
857
+ },
858
+ {
859
+ "id": "@dyrected/core:publishingWorkflow",
860
+ "name": "publishingWorkflow",
861
+ "kind": "function",
862
+ "category": "workflows",
863
+ "sourcePackage": "@dyrected/core",
864
+ "description": "",
865
+ "signature": "export function publishingWorkflow(): WorkflowConfig",
866
+ "members": []
867
+ },
868
+ {
869
+ "id": "@dyrected/core:ReadonlyDatabaseAdapter",
870
+ "name": "ReadonlyDatabaseAdapter",
871
+ "kind": "type",
872
+ "category": "adapters",
873
+ "sourcePackage": "@dyrected/core",
874
+ "description": "",
875
+ "signature": "export type ReadonlyDatabaseAdapter = Pick<\n DatabaseAdapter,\n \"find\" | \"findOne\" | \"getGlobal\"\n>;",
876
+ "members": []
877
+ },
878
+ {
879
+ "id": "@dyrected/core:saveWorkflowDraft",
880
+ "name": "saveWorkflowDraft",
881
+ "kind": "function",
882
+ "category": "workflows",
883
+ "sourcePackage": "@dyrected/core",
884
+ "description": "",
885
+ "signature": "export async function saveWorkflowDraft(args: {\n config: DyrectedConfig;\n collection: CollectionConfig;\n id: string;\n originalDoc: BaseDocument;\n data: Record<string, unknown>;\n user?: AuthenticatedUser;\n}): Promise<{ doc: BaseDocument; event: LifecycleEvent }>",
886
+ "members": []
887
+ },
888
+ {
889
+ "id": "@dyrected/core:StorageAdapter",
890
+ "name": "StorageAdapter",
891
+ "kind": "interface",
892
+ "category": "adapters",
893
+ "sourcePackage": "@dyrected/core",
894
+ "description": "The interface every storage adapter must implement.\n\nDyrected ships adapters for local disk, S3, Cloudflare R2, Cloudinary, and\nBackblaze B2. Implement this interface to use any other storage provider.",
895
+ "signature": "export interface StorageAdapter {\n /**\n * Upload a file and return its metadata (URL, dimensions, etc.).\n * The `prefix` is a path prefix used for multi-tenant setups.\n */\n upload(args: {\n filename: string;\n buffer: Uint8Array;\n mimeType: string;\n prefix?: string;\n }): Promise<FileData>;\n\n /** Delete a file by its stored filename. */\n delete(args: { filename: string }): Promise<void>;\n\n /** Return the public URL for a stored file. */\n getURL(args: { filename: string }): string;\n\n /**\n * Retrieve the file's raw bytes and MIME type for serving via the API.\n * Only needed by adapters that serve files through the Dyrected API\n * (e.g. `LocalStorage`). Cloud adapters return `null` here and rely on\n * direct CDN URLs instead.\n */\n resolve?(args: {\n filename: string;\n }): Promise<{ buffer: Uint8Array; mimeType: string } | null>;\n}",
896
+ "members": [
897
+ {
898
+ "name": "upload",
899
+ "signature": "upload(args: {\n filename: string;\n buffer: Uint8Array;\n mimeType: string;\n prefix?: string;\n }): Promise<FileData>",
900
+ "description": "Upload a file and return its metadata (URL, dimensions, etc.).\nThe `prefix` is a path prefix used for multi-tenant setups."
901
+ },
902
+ {
903
+ "name": "delete",
904
+ "signature": "delete(args: { filename: string }): Promise<void>",
905
+ "description": "Delete a file by its stored filename."
906
+ },
907
+ {
908
+ "name": "getURL",
909
+ "signature": "getURL(args: { filename: string }): string",
910
+ "description": "Return the public URL for a stored file."
911
+ },
912
+ {
913
+ "name": "resolve",
914
+ "signature": "resolve(args: {\n filename: string;\n }): Promise<{ buffer: Uint8Array; mimeType: string } | null>",
915
+ "description": "Retrieve the file's raw bytes and MIME type for serving via the API.\nOnly needed by adapters that serve files through the Dyrected API\n(e.g. `LocalStorage`). Cloud adapters return `null` here and rely on\ndirect CDN URLs instead."
916
+ }
917
+ ]
918
+ },
919
+ {
920
+ "id": "@dyrected/core:SystemDocFields",
921
+ "name": "SystemDocFields",
922
+ "kind": "type",
923
+ "category": "fields",
924
+ "sourcePackage": "@dyrected/core",
925
+ "description": "Audit fields automatically injected into every collection document at runtime.\nThey are always present in API responses but hidden in the Admin UI by default.",
926
+ "signature": "export type SystemDocFields = {\n createdAt?: string;\n updatedAt?: string;\n /** ID of the user who created the document. */\n createdBy?: string;\n /** ID of the user who last updated the document. */\n updatedBy?: string;\n};",
927
+ "members": []
928
+ },
929
+ {
930
+ "id": "@dyrected/core:transitionWorkflow",
931
+ "name": "transitionWorkflow",
932
+ "kind": "function",
933
+ "category": "workflows",
934
+ "sourcePackage": "@dyrected/core",
935
+ "description": "",
936
+ "signature": "export async function transitionWorkflow(args: {\n config: DyrectedConfig;\n collection: CollectionConfig;\n id: string;\n transitionName: string;\n expectedRevision?: number;\n comment?: string;\n user?: AuthenticatedUser;\n req: HookRequestContext;\n}): Promise<BaseDocument>",
937
+ "members": []
938
+ },
939
+ {
940
+ "id": "@dyrected/core:UploadConfig",
941
+ "name": "UploadConfig",
942
+ "kind": "interface",
943
+ "category": "configuration",
944
+ "sourcePackage": "@dyrected/core",
945
+ "description": "Upload configuration for collections that store files.\nSet `upload: true` on the collection to use all defaults, or pass this\nobject to customise allowed types, size limits, and image processing.",
946
+ "signature": "export interface UploadConfig {\n /**\n * Allowed MIME types. Requests with other MIME types are rejected with `400`.\n * @example ['image/jpeg', 'image/png', 'image/webp', 'application/pdf']\n */\n allowedMimeTypes?: string[];\n\n /**\n * Maximum file size in **bytes**.\n * @example 10 * 1024 * 1024 // 10 MB\n */\n maxFileSize?: number;\n\n /**\n * Local filesystem path where files are stored.\n * Only used by the `LocalStorage` adapter.\n */\n staticDir?: string;\n\n /**\n * Public URL prefix prepended to filenames when generating download URLs.\n * Only used by the `LocalStorage` adapter.\n * @example '/uploads'\n */\n staticURL?: string;\n\n /**\n * The `imageSizes` entry name to use as the thumbnail in the Admin media grid.\n * @example 'thumbnail'\n */\n adminThumbnail?: string;\n\n /**\n * Additional image sizes to generate when an image is uploaded.\n * Requires an `ImageService` to be configured (e.g. `@dyrected/image-sharp`).\n *\n * @example\n * imageSizes: [\n * { name: 'thumbnail', width: 300, height: 300, fit: 'cover' },\n * { name: 'card', width: 800 },\n * ]\n */\n imageSizes?: {\n /** Identifier used to access this size, e.g. `doc.sizes.thumbnail`. */\n name: string;\n /** Target width in pixels. */\n width?: number;\n /** Target height in pixels. */\n height?: number;\n /** sharp crop strategy (`'entropy'`, `'attention'`, etc.). */\n crop?: string;\n /**\n * sharp fit strategy.\n * @see https://sharp.pixelplumbing.com/api-resize#parameters\n */\n fit?: string;\n /**\n * If `true`, images smaller than the target size are not upscaled.\n * @default true\n */\n withoutEnlargement?: boolean;\n /** Additional sharp format options forwarded to the output pipeline. */\n formatOptions?: Record<string, unknown>;\n }[];\n}",
947
+ "members": [
948
+ {
949
+ "name": "allowedMimeTypes",
950
+ "signature": "allowedMimeTypes?: string[]",
951
+ "description": "Allowed MIME types. Requests with other MIME types are rejected with `400`."
952
+ },
953
+ {
954
+ "name": "maxFileSize",
955
+ "signature": "maxFileSize?: number",
956
+ "description": "Maximum file size in **bytes**."
957
+ },
958
+ {
959
+ "name": "staticDir",
960
+ "signature": "staticDir?: string",
961
+ "description": "Local filesystem path where files are stored.\nOnly used by the `LocalStorage` adapter."
962
+ },
963
+ {
964
+ "name": "staticURL",
965
+ "signature": "staticURL?: string",
966
+ "description": "Public URL prefix prepended to filenames when generating download URLs.\nOnly used by the `LocalStorage` adapter."
967
+ },
968
+ {
969
+ "name": "adminThumbnail",
970
+ "signature": "adminThumbnail?: string",
971
+ "description": "The `imageSizes` entry name to use as the thumbnail in the Admin media grid."
972
+ },
973
+ {
974
+ "name": "imageSizes",
975
+ "signature": "imageSizes?: {\n /** Identifier used to access this size, e.g. `doc.sizes.thumbnail`. */\n name: string;\n /** Target width in pixels. */\n width?: number;\n /** Target height in pixels. */\n height?: number;\n /** sharp crop strategy (`'entropy'`, `'attention'`, etc.). */\n crop?: string;\n /**\n * sharp fit strategy.\n * @see https://sharp.pixelplumbing.com/api-resize#parameters\n */\n fit?: string;\n /**\n * If `true`, images smaller than the target size are not upscaled.\n * @default true\n */\n withoutEnlargement?: boolean;\n /** Additional sharp format options forwarded to the output pipeline. */\n formatOptions?: Record<string, unknown>;\n }[]",
976
+ "description": "Additional image sizes to generate when an image is uploaded.\nRequires an `ImageService` to be configured (e.g. `@dyrected/image-sharp`)."
977
+ }
978
+ ]
979
+ },
980
+ {
981
+ "id": "@dyrected/core:UploadDocFields",
982
+ "name": "UploadDocFields",
983
+ "kind": "type",
984
+ "category": "fields",
985
+ "sourcePackage": "@dyrected/core",
986
+ "description": "Fields automatically added to upload/media collection documents.\nThese mirror the `FileData` interface returned by storage adapters.",
987
+ "signature": "export type UploadDocFields = {\n filename: string;\n filesize?: number;\n mimeType: string;\n /** Public URL of the stored file. */\n url: string;\n width?: number;\n height?: number;\n focalPoint?: { x: number; y: number };\n /** Base64 BlurHash for progressive image loading. */\n blurhash?: string;\n sizes?: Record<\n string,\n { filename?: string; url?: string; width?: number; height?: number }\n >;\n};",
988
+ "members": []
989
+ },
990
+ {
991
+ "id": "@dyrected/core:WORKFLOW_HISTORY_COLLECTION",
992
+ "name": "WORKFLOW_HISTORY_COLLECTION",
993
+ "kind": "constant",
994
+ "category": "workflows",
995
+ "sourcePackage": "@dyrected/core",
996
+ "description": "",
997
+ "signature": "export const WORKFLOW_HISTORY_COLLECTION = \"__workflow_history\";",
998
+ "members": []
999
+ },
1000
+ {
1001
+ "id": "@dyrected/core:workflowCapabilities",
1002
+ "name": "workflowCapabilities",
1003
+ "kind": "function",
1004
+ "category": "workflows",
1005
+ "sourcePackage": "@dyrected/core",
1006
+ "description": "",
1007
+ "signature": "export function workflowCapabilities(workflow: WorkflowConfig, user?: AuthenticatedUser): Set<string>",
1008
+ "members": []
1009
+ },
1010
+ {
1011
+ "id": "@dyrected/core:WorkflowConfig",
1012
+ "name": "WorkflowConfig",
1013
+ "kind": "interface",
1014
+ "category": "workflows",
1015
+ "sourcePackage": "@dyrected/core",
1016
+ "description": "",
1017
+ "signature": "export interface WorkflowConfig<TDoc extends object = Record<string, unknown>> {\n initialState: string;\n /** State used for a new working revision created from published content. */\n draftState?: string;\n states: WorkflowState[];\n transitions: WorkflowTransition[];\n /** Maps values in `user.roles` to workflow capabilities. */\n roles?: WorkflowRole[];\n hooks?: {\n beforeTransition?: CollectionBeforeTransitionHook<TDoc>[];\n afterTransition?: CollectionAfterTransitionHook<TDoc>[];\n };\n}",
1018
+ "members": [
1019
+ {
1020
+ "name": "initialState",
1021
+ "signature": "initialState: string",
1022
+ "description": ""
1023
+ },
1024
+ {
1025
+ "name": "draftState",
1026
+ "signature": "draftState?: string",
1027
+ "description": "State used for a new working revision created from published content."
1028
+ },
1029
+ {
1030
+ "name": "states",
1031
+ "signature": "states: WorkflowState[]",
1032
+ "description": ""
1033
+ },
1034
+ {
1035
+ "name": "transitions",
1036
+ "signature": "transitions: WorkflowTransition[]",
1037
+ "description": ""
1038
+ },
1039
+ {
1040
+ "name": "roles",
1041
+ "signature": "roles?: WorkflowRole[]",
1042
+ "description": "Maps values in `user.roles` to workflow capabilities."
1043
+ },
1044
+ {
1045
+ "name": "hooks",
1046
+ "signature": "hooks?: {\n beforeTransition?: CollectionBeforeTransitionHook<TDoc>[];\n afterTransition?: CollectionAfterTransitionHook<TDoc>[];\n }",
1047
+ "description": ""
1048
+ }
1049
+ ]
1050
+ },
1051
+ {
1052
+ "id": "@dyrected/core:WorkflowMetadata",
1053
+ "name": "WorkflowMetadata",
1054
+ "kind": "interface",
1055
+ "category": "workflows",
1056
+ "sourcePackage": "@dyrected/core",
1057
+ "description": "",
1058
+ "signature": "export interface WorkflowMetadata {\n state: string;\n revision: number;\n publishedRevision?: number;\n publishedAt?: string;\n publishedBy?: string;\n /** Transitions currently allowed for the requesting user. Response-only. */\n availableTransitions?: string[];\n}",
1059
+ "members": [
1060
+ {
1061
+ "name": "state",
1062
+ "signature": "state: string",
1063
+ "description": ""
1064
+ },
1065
+ {
1066
+ "name": "revision",
1067
+ "signature": "revision: number",
1068
+ "description": ""
1069
+ },
1070
+ {
1071
+ "name": "publishedRevision",
1072
+ "signature": "publishedRevision?: number",
1073
+ "description": ""
1074
+ },
1075
+ {
1076
+ "name": "publishedAt",
1077
+ "signature": "publishedAt?: string",
1078
+ "description": ""
1079
+ },
1080
+ {
1081
+ "name": "publishedBy",
1082
+ "signature": "publishedBy?: string",
1083
+ "description": ""
1084
+ },
1085
+ {
1086
+ "name": "availableTransitions",
1087
+ "signature": "availableTransitions?: string[]",
1088
+ "description": "Transitions currently allowed for the requesting user. Response-only."
1089
+ }
1090
+ ]
1091
+ },
1092
+ {
1093
+ "id": "@dyrected/core:WorkflowRole",
1094
+ "name": "WorkflowRole",
1095
+ "kind": "interface",
1096
+ "category": "workflows",
1097
+ "sourcePackage": "@dyrected/core",
1098
+ "description": "",
1099
+ "signature": "export interface WorkflowRole {\n /** Existing user role value, for example `editor` or `publisher`. */\n role: string;\n capabilities: string[];\n}",
1100
+ "members": [
1101
+ {
1102
+ "name": "role",
1103
+ "signature": "role: string",
1104
+ "description": "Existing user role value, for example `editor` or `publisher`."
1105
+ },
1106
+ {
1107
+ "name": "capabilities",
1108
+ "signature": "capabilities: string[]",
1109
+ "description": ""
1110
+ }
1111
+ ]
1112
+ },
1113
+ {
1114
+ "id": "@dyrected/core:WorkflowState",
1115
+ "name": "WorkflowState",
1116
+ "kind": "interface",
1117
+ "category": "workflows",
1118
+ "sourcePackage": "@dyrected/core",
1119
+ "description": "",
1120
+ "signature": "export interface WorkflowState {\n /** Stable machine-readable state key. */\n name: string;\n /** Label rendered in the Admin UI. */\n label: string;\n /** Marks the state whose revision is visible to public readers. */\n published?: boolean;\n /** Optional visual tone used by the Admin UI. */\n color?: \"neutral\" | \"warning\" | \"success\" | \"danger\" | \"info\";\n}",
1121
+ "members": [
1122
+ {
1123
+ "name": "name",
1124
+ "signature": "name: string",
1125
+ "description": "Stable machine-readable state key."
1126
+ },
1127
+ {
1128
+ "name": "label",
1129
+ "signature": "label: string",
1130
+ "description": "Label rendered in the Admin UI."
1131
+ },
1132
+ {
1133
+ "name": "published",
1134
+ "signature": "published?: boolean",
1135
+ "description": "Marks the state whose revision is visible to public readers."
1136
+ },
1137
+ {
1138
+ "name": "color",
1139
+ "signature": "color?: \"neutral\" | \"warning\" | \"success\" | \"danger\" | \"info\"",
1140
+ "description": "Optional visual tone used by the Admin UI."
1141
+ }
1142
+ ]
1143
+ },
1144
+ {
1145
+ "id": "@dyrected/core:WorkflowTransition",
1146
+ "name": "WorkflowTransition",
1147
+ "kind": "interface",
1148
+ "category": "workflows",
1149
+ "sourcePackage": "@dyrected/core",
1150
+ "description": "",
1151
+ "signature": "export interface WorkflowTransition {\n /** Stable transition key used by the REST and SDK APIs. */\n name: string;\n label: string;\n from: string | string[];\n to: string;\n /** Every listed capability is required. */\n requiredCapabilities?: string[];\n /** Require a non-empty comment when performing the transition. */\n requireComment?: boolean;\n /** Remove the public snapshot after this transition commits. */\n unpublish?: boolean;\n}",
1152
+ "members": [
1153
+ {
1154
+ "name": "name",
1155
+ "signature": "name: string",
1156
+ "description": "Stable transition key used by the REST and SDK APIs."
1157
+ },
1158
+ {
1159
+ "name": "label",
1160
+ "signature": "label: string",
1161
+ "description": ""
1162
+ },
1163
+ {
1164
+ "name": "from",
1165
+ "signature": "from: string | string[]",
1166
+ "description": ""
1167
+ },
1168
+ {
1169
+ "name": "to",
1170
+ "signature": "to: string",
1171
+ "description": ""
1172
+ },
1173
+ {
1174
+ "name": "requiredCapabilities",
1175
+ "signature": "requiredCapabilities?: string[]",
1176
+ "description": "Every listed capability is required."
1177
+ },
1178
+ {
1179
+ "name": "requireComment",
1180
+ "signature": "requireComment?: boolean",
1181
+ "description": "Require a non-empty comment when performing the transition."
1182
+ },
1183
+ {
1184
+ "name": "unpublish",
1185
+ "signature": "unpublish?: boolean",
1186
+ "description": "Remove the public snapshot after this transition commits."
1187
+ }
1188
+ ]
1189
+ },
1190
+ {
1191
+ "id": "@dyrected/core:WorkflowTransitionContext",
1192
+ "name": "WorkflowTransitionContext",
1193
+ "kind": "interface",
1194
+ "category": "workflows",
1195
+ "sourcePackage": "@dyrected/core",
1196
+ "description": "",
1197
+ "signature": "export interface WorkflowTransitionContext<\n TDoc extends object = Record<string, unknown>,\n> {\n transition: WorkflowTransition;\n from: string;\n to: string;\n doc: TDoc;\n user?: AuthenticatedUser;\n comment?: string;\n req: HookRequestContext;\n db: DatabaseAdapter;\n}",
1198
+ "members": [
1199
+ {
1200
+ "name": "transition",
1201
+ "signature": "transition: WorkflowTransition",
1202
+ "description": ""
1203
+ },
1204
+ {
1205
+ "name": "from",
1206
+ "signature": "from: string",
1207
+ "description": ""
1208
+ },
1209
+ {
1210
+ "name": "to",
1211
+ "signature": "to: string",
1212
+ "description": ""
1213
+ },
1214
+ {
1215
+ "name": "doc",
1216
+ "signature": "doc: TDoc",
1217
+ "description": ""
1218
+ },
1219
+ {
1220
+ "name": "user",
1221
+ "signature": "user?: AuthenticatedUser",
1222
+ "description": ""
1223
+ },
1224
+ {
1225
+ "name": "comment",
1226
+ "signature": "comment?: string",
1227
+ "description": ""
1228
+ },
1229
+ {
1230
+ "name": "req",
1231
+ "signature": "req: HookRequestContext",
1232
+ "description": ""
1233
+ },
1234
+ {
1235
+ "name": "db",
1236
+ "signature": "db: DatabaseAdapter",
1237
+ "description": ""
1238
+ }
1239
+ ]
1240
+ },
1241
+ {
1242
+ "id": "@dyrected/sdk:BaseSchema",
1243
+ "name": "BaseSchema",
1244
+ "kind": "interface",
1245
+ "category": "sdk",
1246
+ "sourcePackage": "@dyrected/sdk",
1247
+ "description": "",
1248
+ "signature": "export interface BaseSchema {\n collections: Record<string, any>;\n globals: Record<string, any>;\n}",
1249
+ "members": [
1250
+ {
1251
+ "name": "collections",
1252
+ "signature": "collections: Record<string, any>",
1253
+ "description": ""
1254
+ },
1255
+ {
1256
+ "name": "globals",
1257
+ "signature": "globals: Record<string, any>",
1258
+ "description": ""
1259
+ }
1260
+ ]
1261
+ },
1262
+ {
1263
+ "id": "@dyrected/sdk:createClient",
1264
+ "name": "createClient",
1265
+ "kind": "function",
1266
+ "category": "sdk",
1267
+ "sourcePackage": "@dyrected/sdk",
1268
+ "description": "",
1269
+ "signature": "export function createClient<\n TSchema extends { collections: any; globals: any } = any,\n>(config: DyrectedClientConfig): DyrectedClient<TSchema>",
1270
+ "members": []
1271
+ },
1272
+ {
1273
+ "id": "@dyrected/sdk:DyrectedClient",
1274
+ "name": "DyrectedClient",
1275
+ "kind": "class",
1276
+ "category": "sdk",
1277
+ "sourcePackage": "@dyrected/sdk",
1278
+ "description": "",
1279
+ "signature": "export class DyrectedClient<TSchema extends BaseSchema = any> {\n}",
1280
+ "members": [
1281
+ {
1282
+ "name": "setToken",
1283
+ "signature": "setToken(token: string): void",
1284
+ "description": "Update the Authorization header with a Bearer token.\nCall this after a successful login."
1285
+ },
1286
+ {
1287
+ "name": "clearToken",
1288
+ "signature": "clearToken(): void",
1289
+ "description": "Remove the Authorization header.\nCall this after logout."
1290
+ },
1291
+ {
1292
+ "name": "getAuthHeaders",
1293
+ "signature": "getAuthHeaders(): Record<string, string>",
1294
+ "description": "Returns the headers needed to authenticate raw `fetch()` calls made outside\nthe SDK client (e.g. streaming endpoints, dynamic options). Includes the\nAuthorization bearer token (if set), x-api-key, and x-site-id."
1295
+ },
1296
+ {
1297
+ "name": "getBaseUrl",
1298
+ "signature": "getBaseUrl()",
1299
+ "description": ""
1300
+ },
1301
+ {
1302
+ "name": "getSchemas",
1303
+ "signature": "getSchemas(): Promise<{ collections: any[]; globals: any[] }>",
1304
+ "description": ""
1305
+ },
1306
+ {
1307
+ "name": "getPreference",
1308
+ "signature": "getPreference<T = unknown>(key: string): Promise<{ key: string; value: T | null }>",
1309
+ "description": ""
1310
+ },
1311
+ {
1312
+ "name": "setPreference",
1313
+ "signature": "setPreference<T = unknown>(key: string, value: T): Promise<{ key: string; value: T }>",
1314
+ "description": ""
1315
+ },
1316
+ {
1317
+ "name": "getPreviewData",
1318
+ "signature": "getPreviewData(token: string): Promise<any>",
1319
+ "description": "Fetch draft data for a specific preview token.\nUsed in \"token\" preview mode."
1320
+ },
1321
+ {
1322
+ "name": "find",
1323
+ "signature": "find<K extends keyof TSchema[\"collections\"]>(collection: K & string, args: QueryArgs = {}): Promise<PaginatedResult<TSchema[\"collections\"][K]>>",
1324
+ "description": ""
1325
+ },
1326
+ {
1327
+ "name": "collection",
1328
+ "signature": "collection<K extends keyof TSchema[\"collections\"]>(slug: K & string)",
1329
+ "description": "Returns a fluent query builder for a collection."
1330
+ },
1331
+ {
1332
+ "name": "global",
1333
+ "signature": "global<K extends keyof TSchema[\"globals\"]>(slug: K & string)",
1334
+ "description": "Access a global by its slug with a fluent builder."
1335
+ },
1336
+ {
1337
+ "name": "findOne",
1338
+ "signature": "findOne<T = any>(collection: string, id: string, args: { depth?: number; initialData?: T } = {}): Promise<T>",
1339
+ "description": ""
1340
+ },
1341
+ {
1342
+ "name": "create",
1343
+ "signature": "create<T = any>(collection: string, data: any): Promise<T>",
1344
+ "description": ""
1345
+ },
1346
+ {
1347
+ "name": "update",
1348
+ "signature": "update<T = any>(collection: string, id: string, data: any): Promise<T>",
1349
+ "description": ""
1350
+ },
1351
+ {
1352
+ "name": "delete",
1353
+ "signature": "delete(collection: string, id: string): Promise<{ message: string }>",
1354
+ "description": ""
1355
+ },
1356
+ {
1357
+ "name": "transition",
1358
+ "signature": "transition<T = WorkflowDocument>(collection: string, id: string, transitionName: string, opts: TransitionOptions = {}): Promise<T>",
1359
+ "description": "Perform a workflow transition on a document.\n\nSends `POST /api/collections/:collection/:id/transitions/:transition`.\nRequires the client to have a valid bearer token set via `setToken()`."
1360
+ },
1361
+ {
1362
+ "name": "workflowHistory",
1363
+ "signature": "workflowHistory(collection: string, id: string, args: { limit?: number } = {}): Promise<PaginatedResult<WorkflowHistoryEntry>>",
1364
+ "description": "Fetch the workflow history for a document.\n\nSends `GET /api/collections/:collection/:id/workflow-history`."
1365
+ },
1366
+ {
1367
+ "name": "deleteMany",
1368
+ "signature": "deleteMany(collection: string, ids: string[]): Promise<{ message: string }>",
1369
+ "description": ""
1370
+ },
1371
+ {
1372
+ "name": "getGlobal",
1373
+ "signature": "getGlobal<T = any>(slug: string, args: { depth?: number; initialData?: T } = {}): Promise<T>",
1374
+ "description": ""
1375
+ },
1376
+ {
1377
+ "name": "updateGlobal",
1378
+ "signature": "updateGlobal<T = any>(slug: string, data: any): Promise<T>",
1379
+ "description": ""
1380
+ },
1381
+ {
1382
+ "name": "listMedia",
1383
+ "signature": "listMedia(args: QueryArgs = {}, collection: string = \"media\"): Promise<PaginatedResult<Media>>",
1384
+ "description": ""
1385
+ },
1386
+ {
1387
+ "name": "uploadMedia",
1388
+ "signature": "uploadMedia(file: File, collection: string = \"media\"): Promise<Media>",
1389
+ "description": ""
1390
+ },
1391
+ {
1392
+ "name": "deleteMedia",
1393
+ "signature": "deleteMedia(id: string, collection: string = \"media\"): Promise<{ message: string }>",
1394
+ "description": ""
1395
+ }
1396
+ ]
1397
+ },
1398
+ {
1399
+ "id": "@dyrected/sdk:DyrectedClientConfig",
1400
+ "name": "DyrectedClientConfig",
1401
+ "kind": "interface",
1402
+ "category": "sdk",
1403
+ "sourcePackage": "@dyrected/sdk",
1404
+ "description": "",
1405
+ "signature": "export interface DyrectedClientConfig {\n baseUrl: string;\n apiKey?: string;\n siteId?: string;\n headers?: Record<string, string>;\n fetch?: typeof fetch;\n /** Default depth for relationship population. Applied to every request unless overridden per-call. */\n defaultDepth?: number;\n}",
1406
+ "members": [
1407
+ {
1408
+ "name": "baseUrl",
1409
+ "signature": "baseUrl: string",
1410
+ "description": ""
1411
+ },
1412
+ {
1413
+ "name": "apiKey",
1414
+ "signature": "apiKey?: string",
1415
+ "description": ""
1416
+ },
1417
+ {
1418
+ "name": "siteId",
1419
+ "signature": "siteId?: string",
1420
+ "description": ""
1421
+ },
1422
+ {
1423
+ "name": "headers",
1424
+ "signature": "headers?: Record<string, string>",
1425
+ "description": ""
1426
+ },
1427
+ {
1428
+ "name": "fetch",
1429
+ "signature": "fetch?: typeof fetch",
1430
+ "description": ""
1431
+ },
1432
+ {
1433
+ "name": "defaultDepth",
1434
+ "signature": "defaultDepth?: number",
1435
+ "description": "Default depth for relationship population. Applied to every request unless overridden per-call."
1436
+ }
1437
+ ]
1438
+ },
1439
+ {
1440
+ "id": "@dyrected/sdk:DyrectedError",
1441
+ "name": "DyrectedError",
1442
+ "kind": "class",
1443
+ "category": "sdk",
1444
+ "sourcePackage": "@dyrected/sdk",
1445
+ "description": "Structured error thrown by the SDK when the server returns a non-2xx response.",
1446
+ "signature": "export class DyrectedError extends Error {\n}",
1447
+ "members": [
1448
+ {
1449
+ "name": "statusCode",
1450
+ "signature": "readonly statusCode: number",
1451
+ "description": ""
1452
+ },
1453
+ {
1454
+ "name": "errors",
1455
+ "signature": "readonly errors: { field?: string; message: string }[]",
1456
+ "description": ""
1457
+ }
1458
+ ]
1459
+ },
1460
+ {
1461
+ "id": "@dyrected/sdk:InferSchema",
1462
+ "name": "InferSchema",
1463
+ "kind": "type",
1464
+ "category": "sdk",
1465
+ "sourcePackage": "@dyrected/sdk",
1466
+ "description": "Derives a typed `TSchema` from your exported collection and global config constants.\n\nPass it to `createClient<Schema>()` so every `find`, `findOne`, `create`,\n`update`, `global().get()` call returns the inferred document shape — no\nmanual interfaces required.",
1467
+ "signature": "export type InferSchema<\n TCollections extends Record<string, CollectionConfig<any>>,\n TGlobals extends Record<string, GlobalConfig<any>> = Record<never, never>,\n> = {\n collections: { [K in keyof TCollections]: ExtractDoc<TCollections[K]> };\n globals: { [K in keyof TGlobals]: ExtractDoc<TGlobals[K]> };\n};",
1468
+ "members": []
1469
+ },
1470
+ {
1471
+ "id": "@dyrected/sdk:TransitionOptions",
1472
+ "name": "TransitionOptions",
1473
+ "kind": "interface",
1474
+ "category": "sdk",
1475
+ "sourcePackage": "@dyrected/sdk",
1476
+ "description": "Options accepted by `client.transition()`.",
1477
+ "signature": "export interface TransitionOptions {\n /**\n * The revision number currently shown to the user. When provided, the server\n * rejects the transition if the document has changed since it was loaded,\n * preventing lost-update races.\n */\n expectedRevision?: number;\n /** Required for transitions that have `requireComment: true` (e.g. `reject`). */\n comment?: string;\n}",
1478
+ "members": [
1479
+ {
1480
+ "name": "expectedRevision",
1481
+ "signature": "expectedRevision?: number",
1482
+ "description": "The revision number currently shown to the user. When provided, the server\nrejects the transition if the document has changed since it was loaded,\npreventing lost-update races."
1483
+ },
1484
+ {
1485
+ "name": "comment",
1486
+ "signature": "comment?: string",
1487
+ "description": "Required for transitions that have `requireComment: true` (e.g. `reject`)."
1488
+ }
1489
+ ]
1490
+ },
1491
+ {
1492
+ "id": "@dyrected/sdk:WorkflowDocument",
1493
+ "name": "WorkflowDocument",
1494
+ "kind": "interface",
1495
+ "category": "sdk",
1496
+ "sourcePackage": "@dyrected/sdk",
1497
+ "description": "Shape of a document returned from a workflow-enabled collection.",
1498
+ "signature": "export interface WorkflowDocument {\n id: string;\n _workflow: WorkflowMetadata;\n [key: string]: unknown;\n}",
1499
+ "members": [
1500
+ {
1501
+ "name": "id",
1502
+ "signature": "id: string",
1503
+ "description": ""
1504
+ },
1505
+ {
1506
+ "name": "_workflow",
1507
+ "signature": "_workflow: WorkflowMetadata",
1508
+ "description": ""
1509
+ }
1510
+ ]
1511
+ },
1512
+ {
1513
+ "id": "@dyrected/sdk:WorkflowHistoryEntry",
1514
+ "name": "WorkflowHistoryEntry",
1515
+ "kind": "interface",
1516
+ "category": "sdk",
1517
+ "sourcePackage": "@dyrected/sdk",
1518
+ "description": "A single workflow history entry returned by `client.workflowHistory()`.",
1519
+ "signature": "export interface WorkflowHistoryEntry {\n id: string;\n collection: string;\n documentId: string;\n transition: string;\n from: string;\n to: string;\n revision: number;\n comment: string | null;\n actorId: string | null;\n createdAt: string;\n}",
1520
+ "members": [
1521
+ {
1522
+ "name": "id",
1523
+ "signature": "id: string",
1524
+ "description": ""
1525
+ },
1526
+ {
1527
+ "name": "collection",
1528
+ "signature": "collection: string",
1529
+ "description": ""
1530
+ },
1531
+ {
1532
+ "name": "documentId",
1533
+ "signature": "documentId: string",
1534
+ "description": ""
1535
+ },
1536
+ {
1537
+ "name": "transition",
1538
+ "signature": "transition: string",
1539
+ "description": ""
1540
+ },
1541
+ {
1542
+ "name": "from",
1543
+ "signature": "from: string",
1544
+ "description": ""
1545
+ },
1546
+ {
1547
+ "name": "to",
1548
+ "signature": "to: string",
1549
+ "description": ""
1550
+ },
1551
+ {
1552
+ "name": "revision",
1553
+ "signature": "revision: number",
1554
+ "description": ""
1555
+ },
1556
+ {
1557
+ "name": "comment",
1558
+ "signature": "comment: string | null",
1559
+ "description": ""
1560
+ },
1561
+ {
1562
+ "name": "actorId",
1563
+ "signature": "actorId: string | null",
1564
+ "description": ""
1565
+ },
1566
+ {
1567
+ "name": "createdAt",
1568
+ "signature": "createdAt: string",
1569
+ "description": ""
1570
+ }
1571
+ ]
1572
+ }
1573
+ ]