@thebes/cadmus 0.3.0 → 0.4.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.
@@ -1,4 +1,4 @@
1
- import { at as LocalApi } from "../index-BRZrCTsN.cjs";
1
+ import { bt as LocalApi } from "../index-sB3YOadC.cjs";
2
2
  import { Context, Hono } from "hono";
3
3
 
4
4
  //#region src/hono/client.d.ts
@@ -1,4 +1,4 @@
1
- import { at as LocalApi } from "../index-BRZrCTsN.js";
1
+ import { bt as LocalApi } from "../index-sB3YOadC.js";
2
2
  import { Context, Hono } from "hono";
3
3
 
4
4
  //#region src/hono/client.d.ts
@@ -180,6 +180,72 @@ declare class CadmusApiError extends CadmusError {
180
180
  constructor(message: string, status: number, body: unknown);
181
181
  }
182
182
  //#endregion
183
+ //#region src/cms/patch.d.ts
184
+ /**
185
+ * Patch model + field-level diff (issue #14) — adopts Sanity's mutation/patch
186
+ * idea (pattern, not code): represent a content change as a small set of
187
+ * field operations, and compute a field-level diff between two document
188
+ * snapshots. Underpins version-history display (what changed between two
189
+ * versions) and the content-migration runner (#18), which expresses a
190
+ * transform's effect as a {@link Patch} and applies it.
191
+ *
192
+ * Scope: operations are keyed by **top-level field** (a document's own
193
+ * fields), matching "field-level diff" — a changed `blocks` array reads as
194
+ * one changed field, not a deep per-node diff. Deep/array-aware diffing is a
195
+ * deliberate later extension, not built here.
196
+ */
197
+ /** A single field operation. `set` writes a value; `unset` removes the field. */
198
+ type PatchOp = {
199
+ op: "set";
200
+ path: string;
201
+ value: JsonValue;
202
+ } | {
203
+ op: "unset";
204
+ path: string;
205
+ };
206
+ /** An ordered set of field operations transforming one document into another. */
207
+ type Patch = PatchOp[];
208
+ type FieldChangeKind = "added" | "removed" | "changed";
209
+ /** One field's difference between two document snapshots. */
210
+ interface FieldChange {
211
+ /** Top-level field key. */
212
+ path: string;
213
+ kind: FieldChangeKind;
214
+ /** Value in the "before" snapshot (absent for `added`). */
215
+ before?: JsonValue;
216
+ /** Value in the "after" snapshot (absent for `removed`). */
217
+ after?: JsonValue;
218
+ }
219
+ type Doc$1 = Record<string, JsonValue>;
220
+ interface DiffOptions {
221
+ /**
222
+ * Restrict the diff to these field keys. Omit to diff the union of both
223
+ * documents' own keys. Useful for ignoring bookkeeping columns
224
+ * (`id`/`createdAt`/`publishedVersionId`) in a version-history view.
225
+ */
226
+ fields?: readonly string[];
227
+ /** Field keys to skip (e.g. `["id", "createdAt"]`). */
228
+ ignore?: readonly string[];
229
+ }
230
+ /**
231
+ * Field-level diff between two document snapshots — the per-field
232
+ * added/removed/changed list a version-history UI renders. Values are
233
+ * compared structurally (deep-equal), so a field only shows as `changed`
234
+ * when its content actually differs.
235
+ */
236
+ declare function diffDocuments(before: Doc$1, after: Doc$1, options?: DiffOptions): FieldChange[];
237
+ /**
238
+ * The {@link Patch} that transforms `before` into `after`: `set` for each
239
+ * added/changed field, `unset` for each removed field. `applyPatch(before,
240
+ * computePatch(before, after))` deep-equals `after`.
241
+ */
242
+ declare function computePatch(before: Doc$1, after: Doc$1): Patch;
243
+ /**
244
+ * Apply a {@link Patch} to a document, returning a new document (the input is
245
+ * never mutated). Unknown ops are ignored defensively.
246
+ */
247
+ declare function applyPatch(doc: Doc$1, patch: Patch): Doc$1;
248
+ //#endregion
183
249
  //#region src/cms/localApi.d.ts
184
250
  type AnyTable$1 = SQLiteTableWithColumns<any>;
185
251
  /**
@@ -322,6 +388,13 @@ interface VersionedLocalApi<TTable extends AnyTable$1, TVersionsTable extends An
322
388
  publish(context: TContext, versionId: number): Promise<InferSelectModel<TTable>>;
323
389
  /** Clears the main row's published pointer; the row's data is untouched. */
324
390
  unpublish(context: TContext, id: number): Promise<InferSelectModel<TTable>>;
391
+ /**
392
+ * Field-level diff (issue #14) between two version snapshots' `versionData`
393
+ * — the per-field added/removed/changed list a version-history UI renders.
394
+ * Both versions must belong to the same parent. Bookkeeping keys
395
+ * (`id`/`createdAt`/`status`/`publishedVersionId`) are ignored.
396
+ */
397
+ diffVersions(context: TContext, fromVersionId: number, toVersionId: number): Promise<FieldChange[]>;
325
398
  }
326
399
  declare function createVersionedLocalApi<TTable extends AnyTable$1, TVersionsTable extends AnyTable$1, TContext = unknown>(db: BaseSQLiteDatabase<"async", unknown>, table: TTable, versionsTable: TVersionsTable, config: CollectionConfig, registry?: CmsRegistry): VersionedLocalApi<TTable, TVersionsTable, TContext>;
327
400
  //#endregion
@@ -987,6 +1060,62 @@ interface CollectionMeta {
987
1060
  }
988
1061
  declare function getCollectionsMeta(config: CmsConfig): CollectionMeta[];
989
1062
  //#endregion
1063
+ //#region src/cms/migrate.d.ts
1064
+ /**
1065
+ * Content-migration runner (issue #18) — adopts Sanity's `sanity/migrate`
1066
+ * idea (pattern, not code): a versioned, repeatable transform over a
1067
+ * collection's stored documents, for reshaping content when a block/field
1068
+ * type changes (distinct from Drizzle *schema* migrations, which only touch
1069
+ * columns — this reshapes the JSON content inside them).
1070
+ *
1071
+ * A migration declares a per-document `document(doc)` transform; the runner
1072
+ * streams every document, computes the {@link Patch} from old→new (reusing
1073
+ * #14's patch model), and either reports it (`dryRun`) or applies it via the
1074
+ * collection's Local API. Idempotent by construction: a transform that's
1075
+ * already been applied produces an empty patch, so re-running changes
1076
+ * nothing.
1077
+ */
1078
+ type Doc = Record<string, JsonValue>;
1079
+ interface Migration<TDoc extends Doc = Doc> {
1080
+ /** Stable identifier — name the checked-in migration file after this. */
1081
+ name: string;
1082
+ /**
1083
+ * Transform one document. Return the reshaped document, or `undefined`
1084
+ * (or the unchanged doc) to leave it as-is. Must be pure and idempotent —
1085
+ * applying it twice yields the same result as once.
1086
+ */
1087
+ document: (doc: TDoc) => TDoc | undefined | Promise<TDoc | undefined>;
1088
+ }
1089
+ /** Identity helper — gives a migration definition its type + a greppable call site. */
1090
+ declare function defineMigration<TDoc extends Doc = Doc>(migration: Migration<TDoc>): Migration<TDoc>;
1091
+ interface MigrationChange {
1092
+ id: number;
1093
+ patch: Patch;
1094
+ }
1095
+ interface MigrationResult {
1096
+ migration: string;
1097
+ dryRun: boolean;
1098
+ scanned: number;
1099
+ changed: number;
1100
+ /** Per-document patches (always populated — the dry-run report). */
1101
+ changes: MigrationChange[];
1102
+ errors: string[];
1103
+ }
1104
+ interface RunMigrationOptions<TContext> {
1105
+ api: LocalApi<any, TContext>;
1106
+ /** Context passed to the Local API's read/update (access + hooks). */
1107
+ context: TContext;
1108
+ /** When true, compute + report patches but write nothing. Default false. */
1109
+ dryRun?: boolean;
1110
+ }
1111
+ /**
1112
+ * Run a migration over every document in a collection. Reads all documents
1113
+ * through `api.find`, applies `migration.document`, and (unless `dryRun`)
1114
+ * writes the resulting patch through `api.update`. Returns a report of what
1115
+ * changed — run it `dryRun` first, then apply.
1116
+ */
1117
+ declare function runMigration<TContext>(migration: Migration, options: RunMigrationOptions<TContext>): Promise<MigrationResult>;
1118
+ //#endregion
990
1119
  //#region src/cms/schema-gen.d.ts
991
1120
  declare function generateSchemaSource(config: CmsConfig): string;
992
1121
  //#endregion
@@ -1070,6 +1199,69 @@ interface BuildStudioStructureOptions {
1070
1199
  */
1071
1200
  declare function buildStudioStructure(config: CmsConfig, options?: BuildStudioStructureOptions): StudioStructureGroup[];
1072
1201
  //#endregion
1202
+ //#region src/cms/visual-editing.d.ts
1203
+ /**
1204
+ * Visual editing / click-to-edit (issue #15) — adopts Sanity's
1205
+ * Presentation/visual-editing idea (pattern, not code): the rendered page
1206
+ * (in a preview context) tags editable regions with the source field they
1207
+ * came from, and an overlay turns those regions into click targets that tell
1208
+ * the studio which field to focus.
1209
+ *
1210
+ * This module ships the two reusable, framework-agnostic primitives:
1211
+ * 1. **Encoding** — `editAttr({ collection, id, field })` produces a data
1212
+ * attribute the server renderer spreads onto an element; `decodeEditRef`
1213
+ * reads it back. Pure, testable.
1214
+ * 2. **Overlay** — `mountVisualEditing()` (browser-only; references `document`
1215
+ * lazily, so importing it server-side is harmless) highlights tagged
1216
+ * elements on hover and, on click, calls `onSelect` and `postMessage`s the
1217
+ * ref to the parent window (the studio shell hosting the preview iframe).
1218
+ *
1219
+ * The studio side listens for that message and navigates to
1220
+ * `/admin/<collection>/<id>` (and may focus `<field>`); that wiring is
1221
+ * consumer-side and not prescribed here.
1222
+ */
1223
+ /** A reference from a rendered region back to the field that produced it. */
1224
+ interface EditRef {
1225
+ collection: string;
1226
+ id: number;
1227
+ field: string;
1228
+ }
1229
+ /** The data attribute editable regions are tagged with. */
1230
+ declare const EDIT_ATTR = "data-cadmus-edit";
1231
+ /** `postMessage` payload type for a click-to-edit selection. */
1232
+ declare const VISUAL_EDIT_MESSAGE = "cadmus:visual-edit";
1233
+ declare function encodeEditRef(ref: EditRef): string;
1234
+ /** Parse an {@link EditRef} string, or null if malformed. */
1235
+ declare function decodeEditRef(value: string): EditRef | null;
1236
+ /**
1237
+ * Attribute object to spread onto a rendered element so the overlay can map
1238
+ * it back to its source field, e.g. `<h1 {...editAttr({collection:'pages',
1239
+ * id, field:'title'})}>`.
1240
+ */
1241
+ declare function editAttr(ref: EditRef): Record<string, string>;
1242
+ interface VisualEditingMessage {
1243
+ type: typeof VISUAL_EDIT_MESSAGE;
1244
+ ref: EditRef;
1245
+ }
1246
+ interface VisualEditingOptions {
1247
+ /** Called with the decoded ref when an editable region is clicked. */
1248
+ onSelect?: (ref: EditRef, element: Element) => void;
1249
+ /**
1250
+ * Origin to `postMessage` the selection to the parent window. Default
1251
+ * `"*"`. Set to the studio origin in production.
1252
+ */
1253
+ targetOrigin?: string;
1254
+ /** Outline color for the hover highlight. Default a teal accent. */
1255
+ highlightColor?: string;
1256
+ }
1257
+ /**
1258
+ * Mount the click-to-edit overlay. Browser-only — call from a preview page's
1259
+ * client script. Highlights `[data-cadmus-edit]` elements on hover and, on
1260
+ * click, calls `onSelect` and posts a {@link VisualEditingMessage} to the
1261
+ * parent window. Returns a cleanup function that removes the listeners.
1262
+ */
1263
+ declare function mountVisualEditing(options?: VisualEditingOptions): () => void;
1264
+ //#endregion
1073
1265
  //#region src/cms/webhooks.d.ts
1074
1266
  interface WebhookConfig {
1075
1267
  /** Endpoint this webhook POSTs to on every matching event. */
@@ -1108,5 +1300,5 @@ declare function createWebhookHook(queue: Queue<WebhookMessage>, config: Webhook
1108
1300
  */
1109
1301
  declare function deliverWebhookMessage(message: WebhookMessage): Promise<void>;
1110
1302
  //#endregion
1111
- export { ValidationSeverity as $, CollectionConfig as A, RichTextFieldConfig as B, ArrayFieldConfig as C, CadmusValidationError as Ct, CmsConfig as D, StringBlockRenderer as Dt, CheckboxFieldConfig as E, PortableBlockLike as Et, JsonFieldConfig as F, flattenFields as G, TextFieldConfig as H, JsonValue as I, CustomValidatorResult as J, nestDoc as K, NumberFieldConfig as L, DateFieldConfig as M, FieldConfig as N, CollectionAccess as O, createBlockRegistry as Ot, GroupFieldConfig as P, ValidationFieldContext as Q, RelationshipDepth as R, AccessFn as S, CadmusStorageError as St, CadmeaPlugin as T, BlockRegistry as Tt, UploadFieldConfig as U, SelectFieldConfig as V, flattenDoc as W, ValidateDocumentOptions as X, Rule as Y, ValidationBuilder as Z, collectionSearchTableSQL as _, CadmusEmailError as _t, BuildStudioStructureOptions as a, LocalApi as at, extractSearchText as b, CadmusRateLimitError as bt, StudioStructureItem as c, createLocalApi as ct, CollectionMeta as d, CadmusAccessDeniedError as dt, assertValid as et, getCollectionsMeta as f, CadmusApiError as ft, collectionSearchTableName as g, CadmusDbError as gt, cmsConfigToSchema as h, CadmusCmsError as ht, deliverWebhookMessage as i, CmsRegistry as it, CollectionHooks as j, CollectionAdminConfig as k, renderBlocksToString as kt, buildStudioStructure as l, createVersionedLocalApi as lt, defineCollection as m, CadmusCacheError as mt, WebhookMessage as n, rule as nt, DEFAULT_STUDIO_GROUP as o, VersionedLocalApi as ot, defineCmsConfig as p, CadmusAuthError as pt, CustomValidator as q, createWebhookHook as r, validateDocument as rt, StudioStructureGroup as s, can as st, WebhookConfig as t, defineField as tt, generateSchemaSource as u, getRegisteredApi as ut, collectionToTable as v, CadmusError as vt, BaseFieldConfig as w, ValidationViolation as wt, relationshipJoinTables as x, CadmusSessionError as xt, collectionVersionsTable as y, CadmusQueueError as yt, RelationshipFieldConfig as z };
1112
- //# sourceMappingURL=index-BRZrCTsN.d.ts.map
1303
+ export { RelationshipDepth as $, cmsConfigToSchema as A, PatchOp as At, CadmeaPlugin as B, CadmusEmailError as Bt, RunMigrationOptions as C, createLocalApi as Ct, getCollectionsMeta as D, FieldChange as Dt, CollectionMeta as E, DiffOptions as Et, extractSearchText as F, CadmusApiError as Ft, CollectionConfig as G, CadmusStorageError as Gt, CmsConfig as H, CadmusQueueError as Ht, relationshipJoinTables as I, CadmusAuthError as It, FieldConfig as J, BlockRegistry as Jt, CollectionHooks as K, CadmusValidationError as Kt, AccessFn as L, CadmusCacheError as Lt, collectionSearchTableSQL as M, computePatch as Mt, collectionToTable as N, diffDocuments as Nt, defineCmsConfig as O, FieldChangeKind as Ot, collectionVersionsTable as P, CadmusAccessDeniedError as Pt, NumberFieldConfig as Q, renderBlocksToString as Qt, ArrayFieldConfig as R, CadmusCmsError as Rt, MigrationResult as S, can as St, runMigration as T, getRegisteredApi as Tt, CollectionAccess as U, CadmusRateLimitError as Ut, CheckboxFieldConfig as V, CadmusError as Vt, CollectionAdminConfig as W, CadmusSessionError as Wt, JsonFieldConfig as X, StringBlockRenderer as Xt, GroupFieldConfig as Y, PortableBlockLike as Yt, JsonValue as Z, createBlockRegistry as Zt, StudioStructureItem as _, rule as _t, EDIT_ATTR as a, flattenDoc as at, Migration as b, LocalApi as bt, VisualEditingMessage as c, CustomValidator as ct, editAttr as d, ValidateDocumentOptions as dt, RelationshipFieldConfig as et, encodeEditRef as f, ValidationBuilder as ft, StudioStructureGroup as g, defineField as gt, DEFAULT_STUDIO_GROUP as h, assertValid as ht, deliverWebhookMessage as i, UploadFieldConfig as it, collectionSearchTableName as j, applyPatch as jt, defineCollection as k, Patch as kt, VisualEditingOptions as l, CustomValidatorResult as lt, BuildStudioStructureOptions as m, ValidationSeverity as mt, WebhookMessage as n, SelectFieldConfig as nt, EditRef as o, flattenFields as ot, mountVisualEditing as p, ValidationFieldContext as pt, DateFieldConfig as q, ValidationViolation as qt, createWebhookHook as r, TextFieldConfig as rt, VISUAL_EDIT_MESSAGE as s, nestDoc as st, WebhookConfig as t, RichTextFieldConfig as tt, decodeEditRef as u, Rule as ut, buildStudioStructure as v, validateDocument as vt, defineMigration as w, createVersionedLocalApi as wt, MigrationChange as x, VersionedLocalApi as xt, generateSchemaSource as y, CmsRegistry as yt, BaseFieldConfig as z, CadmusDbError as zt };
1304
+ //# sourceMappingURL=index-sB3YOadC.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-sB3YOadC.d.cts","names":[],"sources":["../src/cms/blocks.ts","../src/errors.ts","../src/cms/patch.ts","../src/cms/localApi.ts","../src/cms/validation.ts","../src/cms/types.ts","../src/cms/codegen.ts","../src/cms/defineCollection.ts","../src/cms/meta.ts","../src/cms/migrate.ts","../src/cms/schema-gen.ts","../src/cms/structure.ts","../src/cms/visual-editing.ts","../src/cms/webhooks.ts"],"mappings":";;;;;;;;AAuBA;;;;AACM;AAGN;;;;;;;;;;UAJiB,iBAAA;EACf,IAAI;AAAA;AAAA,UAGW,aAAA;EAcQ;EAZvB,QAAA,CAAS,IAAA,UAAc,QAAA,EAAU,SAAA,GAAY,aAAA,CAAc,SAAA;EAY3B;EAVhC,YAAA,CAAa,SAAA,EAAW,MAAA,SAAe,SAAA,IAAa,aAAA,CAAc,SAAA;EAFlE;EAIA,GAAA,CAAI,IAAA,WAAe,SAAA;EAJc;EAMjC,GAAA,CAAI,IAAA;EANyC;EAQ7C,KAAA;EANA;EAQA,WAAA,CAAY,QAAA,EAAU,SAAA,GAAY,aAAA,CAAc,SAAA;EART;EAUvC,OAAA,CAAQ,IAAA,WAAe,SAAA;AAAA;;;;;;;;;;;;;iBAeT,mBAAA,YACd,OAAA,GAAS,MAAA,SAAe,SAAA,GACxB,OAAA;EAAW,QAAA,GAAW,SAAA;AAAA,IACrB,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AA;;cAIW,SAAA;;cAGA,mBAAA;AAAA,iBAEG,aAAA,CAAc,GAAY,EAAP,OAAO;;iBAK1B,aAAA,CAAc,KAAA,WAAgB,OAAO;;;;;;iBAcrC,QAAA,CAAS,GAAA,EAAK,OAAA,GAAU,MAAM;AAAA,UAI7B,oBAAA;EACf,IAAA,SAAa,mBAAA;EACb,GAAA,EAAK,OAAO;AAAA;AAAA,UAGG,oBAAA;EZ5Bf;EY8BA,QAAA,IAAY,GAAA,EAAK,OAAA,EAAS,OAAA,EAAS,OAAO;EZ5BpB;;;;EYiCtB,YAAA;EZ/BQ;EYiCR,cAAA;AAAA;AZjCgC;AAelC;;;;;AAfkC,iBY0ClB,kBAAA,CACd,OAAkC,GAAzB,oBAAyB;;;UCpEnB,aAAA;;EAEf,GAAA;EbKe;EaHf,MAAA,GAAS,KAAK;;;AbIV;AAGN;;EaDE,MAAA;AAAA;;UAIe,cAAA;EACf,GAAA;EACA,MAAA;EACA,KAAA;EACA,GAAA,EAAK,MAAM;EbDQ;EaGnB,SAAA;AAAA;;;;;;;;iBAUc,iBAAA,CACd,KAAA,EAAO,KAAA,CAAM,cAAA,GACb,MAAA,EAAQ,aAAA,GACP,WAAA,CAAY,eAAA;;;;;;;iBA0EO,qBAAA,CACpB,OAAA,EAAS,cAAA,GACR,OAAO"}
@@ -180,6 +180,72 @@ declare class CadmusApiError extends CadmusError {
180
180
  constructor(message: string, status: number, body: unknown);
181
181
  }
182
182
  //#endregion
183
+ //#region src/cms/patch.d.ts
184
+ /**
185
+ * Patch model + field-level diff (issue #14) — adopts Sanity's mutation/patch
186
+ * idea (pattern, not code): represent a content change as a small set of
187
+ * field operations, and compute a field-level diff between two document
188
+ * snapshots. Underpins version-history display (what changed between two
189
+ * versions) and the content-migration runner (#18), which expresses a
190
+ * transform's effect as a {@link Patch} and applies it.
191
+ *
192
+ * Scope: operations are keyed by **top-level field** (a document's own
193
+ * fields), matching "field-level diff" — a changed `blocks` array reads as
194
+ * one changed field, not a deep per-node diff. Deep/array-aware diffing is a
195
+ * deliberate later extension, not built here.
196
+ */
197
+ /** A single field operation. `set` writes a value; `unset` removes the field. */
198
+ type PatchOp = {
199
+ op: "set";
200
+ path: string;
201
+ value: JsonValue;
202
+ } | {
203
+ op: "unset";
204
+ path: string;
205
+ };
206
+ /** An ordered set of field operations transforming one document into another. */
207
+ type Patch = PatchOp[];
208
+ type FieldChangeKind = "added" | "removed" | "changed";
209
+ /** One field's difference between two document snapshots. */
210
+ interface FieldChange {
211
+ /** Top-level field key. */
212
+ path: string;
213
+ kind: FieldChangeKind;
214
+ /** Value in the "before" snapshot (absent for `added`). */
215
+ before?: JsonValue;
216
+ /** Value in the "after" snapshot (absent for `removed`). */
217
+ after?: JsonValue;
218
+ }
219
+ type Doc$1 = Record<string, JsonValue>;
220
+ interface DiffOptions {
221
+ /**
222
+ * Restrict the diff to these field keys. Omit to diff the union of both
223
+ * documents' own keys. Useful for ignoring bookkeeping columns
224
+ * (`id`/`createdAt`/`publishedVersionId`) in a version-history view.
225
+ */
226
+ fields?: readonly string[];
227
+ /** Field keys to skip (e.g. `["id", "createdAt"]`). */
228
+ ignore?: readonly string[];
229
+ }
230
+ /**
231
+ * Field-level diff between two document snapshots — the per-field
232
+ * added/removed/changed list a version-history UI renders. Values are
233
+ * compared structurally (deep-equal), so a field only shows as `changed`
234
+ * when its content actually differs.
235
+ */
236
+ declare function diffDocuments(before: Doc$1, after: Doc$1, options?: DiffOptions): FieldChange[];
237
+ /**
238
+ * The {@link Patch} that transforms `before` into `after`: `set` for each
239
+ * added/changed field, `unset` for each removed field. `applyPatch(before,
240
+ * computePatch(before, after))` deep-equals `after`.
241
+ */
242
+ declare function computePatch(before: Doc$1, after: Doc$1): Patch;
243
+ /**
244
+ * Apply a {@link Patch} to a document, returning a new document (the input is
245
+ * never mutated). Unknown ops are ignored defensively.
246
+ */
247
+ declare function applyPatch(doc: Doc$1, patch: Patch): Doc$1;
248
+ //#endregion
183
249
  //#region src/cms/localApi.d.ts
184
250
  type AnyTable$1 = SQLiteTableWithColumns<any>;
185
251
  /**
@@ -322,6 +388,13 @@ interface VersionedLocalApi<TTable extends AnyTable$1, TVersionsTable extends An
322
388
  publish(context: TContext, versionId: number): Promise<InferSelectModel<TTable>>;
323
389
  /** Clears the main row's published pointer; the row's data is untouched. */
324
390
  unpublish(context: TContext, id: number): Promise<InferSelectModel<TTable>>;
391
+ /**
392
+ * Field-level diff (issue #14) between two version snapshots' `versionData`
393
+ * — the per-field added/removed/changed list a version-history UI renders.
394
+ * Both versions must belong to the same parent. Bookkeeping keys
395
+ * (`id`/`createdAt`/`status`/`publishedVersionId`) are ignored.
396
+ */
397
+ diffVersions(context: TContext, fromVersionId: number, toVersionId: number): Promise<FieldChange[]>;
325
398
  }
326
399
  declare function createVersionedLocalApi<TTable extends AnyTable$1, TVersionsTable extends AnyTable$1, TContext = unknown>(db: BaseSQLiteDatabase<"async", unknown>, table: TTable, versionsTable: TVersionsTable, config: CollectionConfig, registry?: CmsRegistry): VersionedLocalApi<TTable, TVersionsTable, TContext>;
327
400
  //#endregion
@@ -987,6 +1060,62 @@ interface CollectionMeta {
987
1060
  }
988
1061
  declare function getCollectionsMeta(config: CmsConfig): CollectionMeta[];
989
1062
  //#endregion
1063
+ //#region src/cms/migrate.d.ts
1064
+ /**
1065
+ * Content-migration runner (issue #18) — adopts Sanity's `sanity/migrate`
1066
+ * idea (pattern, not code): a versioned, repeatable transform over a
1067
+ * collection's stored documents, for reshaping content when a block/field
1068
+ * type changes (distinct from Drizzle *schema* migrations, which only touch
1069
+ * columns — this reshapes the JSON content inside them).
1070
+ *
1071
+ * A migration declares a per-document `document(doc)` transform; the runner
1072
+ * streams every document, computes the {@link Patch} from old→new (reusing
1073
+ * #14's patch model), and either reports it (`dryRun`) or applies it via the
1074
+ * collection's Local API. Idempotent by construction: a transform that's
1075
+ * already been applied produces an empty patch, so re-running changes
1076
+ * nothing.
1077
+ */
1078
+ type Doc = Record<string, JsonValue>;
1079
+ interface Migration<TDoc extends Doc = Doc> {
1080
+ /** Stable identifier — name the checked-in migration file after this. */
1081
+ name: string;
1082
+ /**
1083
+ * Transform one document. Return the reshaped document, or `undefined`
1084
+ * (or the unchanged doc) to leave it as-is. Must be pure and idempotent —
1085
+ * applying it twice yields the same result as once.
1086
+ */
1087
+ document: (doc: TDoc) => TDoc | undefined | Promise<TDoc | undefined>;
1088
+ }
1089
+ /** Identity helper — gives a migration definition its type + a greppable call site. */
1090
+ declare function defineMigration<TDoc extends Doc = Doc>(migration: Migration<TDoc>): Migration<TDoc>;
1091
+ interface MigrationChange {
1092
+ id: number;
1093
+ patch: Patch;
1094
+ }
1095
+ interface MigrationResult {
1096
+ migration: string;
1097
+ dryRun: boolean;
1098
+ scanned: number;
1099
+ changed: number;
1100
+ /** Per-document patches (always populated — the dry-run report). */
1101
+ changes: MigrationChange[];
1102
+ errors: string[];
1103
+ }
1104
+ interface RunMigrationOptions<TContext> {
1105
+ api: LocalApi<any, TContext>;
1106
+ /** Context passed to the Local API's read/update (access + hooks). */
1107
+ context: TContext;
1108
+ /** When true, compute + report patches but write nothing. Default false. */
1109
+ dryRun?: boolean;
1110
+ }
1111
+ /**
1112
+ * Run a migration over every document in a collection. Reads all documents
1113
+ * through `api.find`, applies `migration.document`, and (unless `dryRun`)
1114
+ * writes the resulting patch through `api.update`. Returns a report of what
1115
+ * changed — run it `dryRun` first, then apply.
1116
+ */
1117
+ declare function runMigration<TContext>(migration: Migration, options: RunMigrationOptions<TContext>): Promise<MigrationResult>;
1118
+ //#endregion
990
1119
  //#region src/cms/schema-gen.d.ts
991
1120
  declare function generateSchemaSource(config: CmsConfig): string;
992
1121
  //#endregion
@@ -1070,6 +1199,69 @@ interface BuildStudioStructureOptions {
1070
1199
  */
1071
1200
  declare function buildStudioStructure(config: CmsConfig, options?: BuildStudioStructureOptions): StudioStructureGroup[];
1072
1201
  //#endregion
1202
+ //#region src/cms/visual-editing.d.ts
1203
+ /**
1204
+ * Visual editing / click-to-edit (issue #15) — adopts Sanity's
1205
+ * Presentation/visual-editing idea (pattern, not code): the rendered page
1206
+ * (in a preview context) tags editable regions with the source field they
1207
+ * came from, and an overlay turns those regions into click targets that tell
1208
+ * the studio which field to focus.
1209
+ *
1210
+ * This module ships the two reusable, framework-agnostic primitives:
1211
+ * 1. **Encoding** — `editAttr({ collection, id, field })` produces a data
1212
+ * attribute the server renderer spreads onto an element; `decodeEditRef`
1213
+ * reads it back. Pure, testable.
1214
+ * 2. **Overlay** — `mountVisualEditing()` (browser-only; references `document`
1215
+ * lazily, so importing it server-side is harmless) highlights tagged
1216
+ * elements on hover and, on click, calls `onSelect` and `postMessage`s the
1217
+ * ref to the parent window (the studio shell hosting the preview iframe).
1218
+ *
1219
+ * The studio side listens for that message and navigates to
1220
+ * `/admin/<collection>/<id>` (and may focus `<field>`); that wiring is
1221
+ * consumer-side and not prescribed here.
1222
+ */
1223
+ /** A reference from a rendered region back to the field that produced it. */
1224
+ interface EditRef {
1225
+ collection: string;
1226
+ id: number;
1227
+ field: string;
1228
+ }
1229
+ /** The data attribute editable regions are tagged with. */
1230
+ declare const EDIT_ATTR = "data-cadmus-edit";
1231
+ /** `postMessage` payload type for a click-to-edit selection. */
1232
+ declare const VISUAL_EDIT_MESSAGE = "cadmus:visual-edit";
1233
+ declare function encodeEditRef(ref: EditRef): string;
1234
+ /** Parse an {@link EditRef} string, or null if malformed. */
1235
+ declare function decodeEditRef(value: string): EditRef | null;
1236
+ /**
1237
+ * Attribute object to spread onto a rendered element so the overlay can map
1238
+ * it back to its source field, e.g. `<h1 {...editAttr({collection:'pages',
1239
+ * id, field:'title'})}>`.
1240
+ */
1241
+ declare function editAttr(ref: EditRef): Record<string, string>;
1242
+ interface VisualEditingMessage {
1243
+ type: typeof VISUAL_EDIT_MESSAGE;
1244
+ ref: EditRef;
1245
+ }
1246
+ interface VisualEditingOptions {
1247
+ /** Called with the decoded ref when an editable region is clicked. */
1248
+ onSelect?: (ref: EditRef, element: Element) => void;
1249
+ /**
1250
+ * Origin to `postMessage` the selection to the parent window. Default
1251
+ * `"*"`. Set to the studio origin in production.
1252
+ */
1253
+ targetOrigin?: string;
1254
+ /** Outline color for the hover highlight. Default a teal accent. */
1255
+ highlightColor?: string;
1256
+ }
1257
+ /**
1258
+ * Mount the click-to-edit overlay. Browser-only — call from a preview page's
1259
+ * client script. Highlights `[data-cadmus-edit]` elements on hover and, on
1260
+ * click, calls `onSelect` and posts a {@link VisualEditingMessage} to the
1261
+ * parent window. Returns a cleanup function that removes the listeners.
1262
+ */
1263
+ declare function mountVisualEditing(options?: VisualEditingOptions): () => void;
1264
+ //#endregion
1073
1265
  //#region src/cms/webhooks.d.ts
1074
1266
  interface WebhookConfig {
1075
1267
  /** Endpoint this webhook POSTs to on every matching event. */
@@ -1108,5 +1300,5 @@ declare function createWebhookHook(queue: Queue<WebhookMessage>, config: Webhook
1108
1300
  */
1109
1301
  declare function deliverWebhookMessage(message: WebhookMessage): Promise<void>;
1110
1302
  //#endregion
1111
- export { ValidationSeverity as $, CollectionConfig as A, RichTextFieldConfig as B, ArrayFieldConfig as C, CadmusValidationError as Ct, CmsConfig as D, StringBlockRenderer as Dt, CheckboxFieldConfig as E, PortableBlockLike as Et, JsonFieldConfig as F, flattenFields as G, TextFieldConfig as H, JsonValue as I, CustomValidatorResult as J, nestDoc as K, NumberFieldConfig as L, DateFieldConfig as M, FieldConfig as N, CollectionAccess as O, createBlockRegistry as Ot, GroupFieldConfig as P, ValidationFieldContext as Q, RelationshipDepth as R, AccessFn as S, CadmusStorageError as St, CadmeaPlugin as T, BlockRegistry as Tt, UploadFieldConfig as U, SelectFieldConfig as V, flattenDoc as W, ValidateDocumentOptions as X, Rule as Y, ValidationBuilder as Z, collectionSearchTableSQL as _, CadmusEmailError as _t, BuildStudioStructureOptions as a, LocalApi as at, extractSearchText as b, CadmusRateLimitError as bt, StudioStructureItem as c, createLocalApi as ct, CollectionMeta as d, CadmusAccessDeniedError as dt, assertValid as et, getCollectionsMeta as f, CadmusApiError as ft, collectionSearchTableName as g, CadmusDbError as gt, cmsConfigToSchema as h, CadmusCmsError as ht, deliverWebhookMessage as i, CmsRegistry as it, CollectionHooks as j, CollectionAdminConfig as k, renderBlocksToString as kt, buildStudioStructure as l, createVersionedLocalApi as lt, defineCollection as m, CadmusCacheError as mt, WebhookMessage as n, rule as nt, DEFAULT_STUDIO_GROUP as o, VersionedLocalApi as ot, defineCmsConfig as p, CadmusAuthError as pt, CustomValidator as q, createWebhookHook as r, validateDocument as rt, StudioStructureGroup as s, can as st, WebhookConfig as t, defineField as tt, generateSchemaSource as u, getRegisteredApi as ut, collectionToTable as v, CadmusError as vt, BaseFieldConfig as w, ValidationViolation as wt, relationshipJoinTables as x, CadmusSessionError as xt, collectionVersionsTable as y, CadmusQueueError as yt, RelationshipFieldConfig as z };
1112
- //# sourceMappingURL=index-BRZrCTsN.d.cts.map
1303
+ export { RelationshipDepth as $, cmsConfigToSchema as A, PatchOp as At, CadmeaPlugin as B, CadmusEmailError as Bt, RunMigrationOptions as C, createLocalApi as Ct, getCollectionsMeta as D, FieldChange as Dt, CollectionMeta as E, DiffOptions as Et, extractSearchText as F, CadmusApiError as Ft, CollectionConfig as G, CadmusStorageError as Gt, CmsConfig as H, CadmusQueueError as Ht, relationshipJoinTables as I, CadmusAuthError as It, FieldConfig as J, BlockRegistry as Jt, CollectionHooks as K, CadmusValidationError as Kt, AccessFn as L, CadmusCacheError as Lt, collectionSearchTableSQL as M, computePatch as Mt, collectionToTable as N, diffDocuments as Nt, defineCmsConfig as O, FieldChangeKind as Ot, collectionVersionsTable as P, CadmusAccessDeniedError as Pt, NumberFieldConfig as Q, renderBlocksToString as Qt, ArrayFieldConfig as R, CadmusCmsError as Rt, MigrationResult as S, can as St, runMigration as T, getRegisteredApi as Tt, CollectionAccess as U, CadmusRateLimitError as Ut, CheckboxFieldConfig as V, CadmusError as Vt, CollectionAdminConfig as W, CadmusSessionError as Wt, JsonFieldConfig as X, StringBlockRenderer as Xt, GroupFieldConfig as Y, PortableBlockLike as Yt, JsonValue as Z, createBlockRegistry as Zt, StudioStructureItem as _, rule as _t, EDIT_ATTR as a, flattenDoc as at, Migration as b, LocalApi as bt, VisualEditingMessage as c, CustomValidator as ct, editAttr as d, ValidateDocumentOptions as dt, RelationshipFieldConfig as et, encodeEditRef as f, ValidationBuilder as ft, StudioStructureGroup as g, defineField as gt, DEFAULT_STUDIO_GROUP as h, assertValid as ht, deliverWebhookMessage as i, UploadFieldConfig as it, collectionSearchTableName as j, applyPatch as jt, defineCollection as k, Patch as kt, VisualEditingOptions as l, CustomValidatorResult as lt, BuildStudioStructureOptions as m, ValidationSeverity as mt, WebhookMessage as n, SelectFieldConfig as nt, EditRef as o, flattenFields as ot, mountVisualEditing as p, ValidationFieldContext as pt, DateFieldConfig as q, ValidationViolation as qt, createWebhookHook as r, TextFieldConfig as rt, VISUAL_EDIT_MESSAGE as s, nestDoc as st, WebhookConfig as t, RichTextFieldConfig as tt, decodeEditRef as u, Rule as ut, buildStudioStructure as v, validateDocument as vt, defineMigration as w, createVersionedLocalApi as wt, MigrationChange as x, VersionedLocalApi as xt, generateSchemaSource as y, CmsRegistry as yt, BaseFieldConfig as z, CadmusDbError as zt };
1304
+ //# sourceMappingURL=index-sB3YOadC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-sB3YOadC.d.ts","names":[],"sources":["../src/cms/blocks.ts","../src/errors.ts","../src/cms/patch.ts","../src/cms/localApi.ts","../src/cms/validation.ts","../src/cms/types.ts","../src/cms/codegen.ts","../src/cms/defineCollection.ts","../src/cms/meta.ts","../src/cms/migrate.ts","../src/cms/schema-gen.ts","../src/cms/structure.ts","../src/cms/visual-editing.ts","../src/cms/webhooks.ts"],"mappings":";;;;;;;;AAuBA;;;;AACM;AAGN;;;;;;;;;;UAJiB,iBAAA;EACf,IAAI;AAAA;AAAA,UAGW,aAAA;EAcQ;EAZvB,QAAA,CAAS,IAAA,UAAc,QAAA,EAAU,SAAA,GAAY,aAAA,CAAc,SA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s CHANGED
@@ -23,9 +23,12 @@ exports.CadmusSessionError = require_errors.CadmusSessionError;
23
23
  exports.CadmusStorageError = require_errors.CadmusStorageError;
24
24
  exports.CadmusValidationError = require_errors.CadmusValidationError;
25
25
  exports.DEFAULT_STUDIO_GROUP = require_cms_index.DEFAULT_STUDIO_GROUP;
26
+ exports.EDIT_ATTR = require_cms_index.EDIT_ATTR;
26
27
  exports.IMAGE_MIME_WHITELIST = require_storage_index.IMAGE_MIME_WHITELIST;
27
28
  exports.MAX_IMAGE_UPLOAD_BYTES = require_storage_index.MAX_IMAGE_UPLOAD_BYTES;
28
29
  exports.Rule = require_cms_index.Rule;
30
+ exports.VISUAL_EDIT_MESSAGE = require_cms_index.VISUAL_EDIT_MESSAGE;
31
+ exports.applyPatch = require_cms_index.applyPatch;
29
32
  exports.assertValid = require_cms_index.assertValid;
30
33
  exports.buildStudioStructure = require_cms_index.buildStudioStructure;
31
34
  exports.can = require_cms_index.can;
@@ -35,17 +38,23 @@ exports.collectionSearchTableName = require_cms_index.collectionSearchTableName;
35
38
  exports.collectionSearchTableSQL = require_cms_index.collectionSearchTableSQL;
36
39
  exports.collectionToTable = require_cms_index.collectionToTable;
37
40
  exports.collectionVersionsTable = require_cms_index.collectionVersionsTable;
41
+ exports.computePatch = require_cms_index.computePatch;
38
42
  exports.createBlockRegistry = require_cms_index.createBlockRegistry;
39
43
  exports.createLocalApi = require_cms_index.createLocalApi;
40
44
  exports.createSession = require_session_index.createSession;
41
45
  exports.createVersionedLocalApi = require_cms_index.createVersionedLocalApi;
42
46
  exports.createWebhookHook = require_cms_index.createWebhookHook;
43
47
  exports.db = require_db_index.db;
48
+ exports.decodeEditRef = require_cms_index.decodeEditRef;
44
49
  exports.defineCmsConfig = require_cms_index.defineCmsConfig;
45
50
  exports.defineCollection = require_cms_index.defineCollection;
46
51
  exports.defineField = require_cms_index.defineField;
52
+ exports.defineMigration = require_cms_index.defineMigration;
47
53
  exports.deleteSession = require_session_index.deleteSession;
48
54
  exports.deliverWebhookMessage = require_cms_index.deliverWebhookMessage;
55
+ exports.diffDocuments = require_cms_index.diffDocuments;
56
+ exports.editAttr = require_cms_index.editAttr;
57
+ exports.encodeEditRef = require_cms_index.encodeEditRef;
49
58
  exports.enqueue = require_queues_index.enqueue;
50
59
  exports.extractSearchText = require_cms_index.extractSearchText;
51
60
  exports.flattenDoc = require_cms_index.flattenDoc;
@@ -57,12 +66,14 @@ exports.getCollectionsMeta = require_cms_index.getCollectionsMeta;
57
66
  exports.getRegisteredApi = require_cms_index.getRegisteredApi;
58
67
  exports.getSession = require_session_index.getSession;
59
68
  exports.hashToken = require_auth_index.hashToken;
69
+ exports.mountVisualEditing = require_cms_index.mountVisualEditing;
60
70
  exports.nestDoc = require_cms_index.nestDoc;
61
71
  exports.processBatch = require_queues_index.processBatch;
62
72
  exports.purgeCache = require_cache_index.purgeCache;
63
73
  exports.relationshipJoinTables = require_cms_index.relationshipJoinTables;
64
74
  exports.renderBlocksToString = require_cms_index.renderBlocksToString;
65
75
  exports.rule = require_cms_index.rule;
76
+ exports.runMigration = require_cms_index.runMigration;
66
77
  exports.sendEmail = require_email_index.sendEmail;
67
78
  exports.signSession = require_auth_index.signSession;
68
79
  exports.validateDocument = require_cms_index.validateDocument;
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { generateSessionId, generateToken, hashToken, signSession, verifySession } from "./auth/index.cjs";
2
2
  import { purgeCache } from "./cache/index.cjs";
3
- import { $ as ValidationSeverity, A as CollectionConfig, B as RichTextFieldConfig, C as ArrayFieldConfig, Ct as CadmusValidationError, D as CmsConfig, Dt as StringBlockRenderer, E as CheckboxFieldConfig, Et as PortableBlockLike, F as JsonFieldConfig, G as flattenFields, H as TextFieldConfig, I as JsonValue, J as CustomValidatorResult, K as nestDoc, L as NumberFieldConfig, M as DateFieldConfig, N as FieldConfig, O as CollectionAccess, Ot as createBlockRegistry, P as GroupFieldConfig, Q as ValidationFieldContext, R as RelationshipDepth, S as AccessFn, St as CadmusStorageError, T as CadmeaPlugin, Tt as BlockRegistry, U as UploadFieldConfig, V as SelectFieldConfig, W as flattenDoc, X as ValidateDocumentOptions, Y as Rule, Z as ValidationBuilder, _ as collectionSearchTableSQL, _t as CadmusEmailError, a as BuildStudioStructureOptions, at as LocalApi, b as extractSearchText, bt as CadmusRateLimitError, c as StudioStructureItem, ct as createLocalApi, d as CollectionMeta, dt as CadmusAccessDeniedError, et as assertValid, f as getCollectionsMeta, ft as CadmusApiError, g as collectionSearchTableName, gt as CadmusDbError, h as cmsConfigToSchema, ht as CadmusCmsError, i as deliverWebhookMessage, it as CmsRegistry, j as CollectionHooks, k as CollectionAdminConfig, kt as renderBlocksToString, l as buildStudioStructure, lt as createVersionedLocalApi, m as defineCollection, mt as CadmusCacheError, n as WebhookMessage, nt as rule, o as DEFAULT_STUDIO_GROUP, ot as VersionedLocalApi, p as defineCmsConfig, pt as CadmusAuthError, q as CustomValidator, r as createWebhookHook, rt as validateDocument, s as StudioStructureGroup, st as can, t as WebhookConfig, tt as defineField, u as generateSchemaSource, ut as getRegisteredApi, v as collectionToTable, vt as CadmusError, w as BaseFieldConfig, wt as ValidationViolation, x as relationshipJoinTables, xt as CadmusSessionError, y as collectionVersionsTable, yt as CadmusQueueError, z as RelationshipFieldConfig } from "./index-BRZrCTsN.cjs";
3
+ import { $ as RelationshipDepth, A as cmsConfigToSchema, At as PatchOp, B as CadmeaPlugin, Bt as CadmusEmailError, C as RunMigrationOptions, Ct as createLocalApi, D as getCollectionsMeta, Dt as FieldChange, E as CollectionMeta, Et as DiffOptions, F as extractSearchText, Ft as CadmusApiError, G as CollectionConfig, Gt as CadmusStorageError, H as CmsConfig, Ht as CadmusQueueError, I as relationshipJoinTables, It as CadmusAuthError, J as FieldConfig, Jt as BlockRegistry, K as CollectionHooks, Kt as CadmusValidationError, L as AccessFn, Lt as CadmusCacheError, M as collectionSearchTableSQL, Mt as computePatch, N as collectionToTable, Nt as diffDocuments, O as defineCmsConfig, Ot as FieldChangeKind, P as collectionVersionsTable, Pt as CadmusAccessDeniedError, Q as NumberFieldConfig, Qt as renderBlocksToString, R as ArrayFieldConfig, Rt as CadmusCmsError, S as MigrationResult, St as can, T as runMigration, Tt as getRegisteredApi, U as CollectionAccess, Ut as CadmusRateLimitError, V as CheckboxFieldConfig, Vt as CadmusError, W as CollectionAdminConfig, Wt as CadmusSessionError, X as JsonFieldConfig, Xt as StringBlockRenderer, Y as GroupFieldConfig, Yt as PortableBlockLike, Z as JsonValue, Zt as createBlockRegistry, _ as StudioStructureItem, _t as rule, a as EDIT_ATTR, at as flattenDoc, b as Migration, bt as LocalApi, c as VisualEditingMessage, ct as CustomValidator, d as editAttr, dt as ValidateDocumentOptions, et as RelationshipFieldConfig, f as encodeEditRef, ft as ValidationBuilder, g as StudioStructureGroup, gt as defineField, h as DEFAULT_STUDIO_GROUP, ht as assertValid, i as deliverWebhookMessage, it as UploadFieldConfig, j as collectionSearchTableName, jt as applyPatch, k as defineCollection, kt as Patch, l as VisualEditingOptions, lt as CustomValidatorResult, m as BuildStudioStructureOptions, mt as ValidationSeverity, n as WebhookMessage, nt as SelectFieldConfig, o as EditRef, ot as flattenFields, p as mountVisualEditing, pt as ValidationFieldContext, q as DateFieldConfig, qt as ValidationViolation, r as createWebhookHook, rt as TextFieldConfig, s as VISUAL_EDIT_MESSAGE, st as nestDoc, t as WebhookConfig, tt as RichTextFieldConfig, u as decodeEditRef, ut as Rule, v as buildStudioStructure, vt as validateDocument, w as defineMigration, wt as createVersionedLocalApi, x as MigrationChange, xt as VersionedLocalApi, y as generateSchemaSource, yt as CmsRegistry, z as BaseFieldConfig, zt as CadmusDbError } from "./index-sB3YOadC.cjs";
4
4
  import { db } from "./db/index.cjs";
5
5
  import { SendEmailInput, sendEmail } from "./email/index.cjs";
6
6
  import { QueueMessageHandler, enqueue, processBatch } from "./queues/index.cjs";
7
7
  import { RateLimitResult, checkRateLimit } from "./rate-limit/index.cjs";
8
8
  import { createSession, deleteSession, getSession } from "./session/index.cjs";
9
- import { IMAGE_MIME_WHITELIST, ImageService, MAX_IMAGE_UPLOAD_BYTES, RenderedImage, validateImageFile } from "./storage/index.cjs";
9
+ import { IMAGE_MIME_WHITELIST, ImageCrop, ImageHotspot, ImageService, MAX_IMAGE_UPLOAD_BYTES, RenderedImage, validateImageFile } from "./storage/index.cjs";
10
10
 
11
11
  //#region src/index.d.ts
12
12
  interface CadmusEnv {
@@ -17,5 +17,5 @@ interface CadmusEnv {
17
17
  SESSION_SECRET: string;
18
18
  }
19
19
  //#endregion
20
- export { AccessFn, ArrayFieldConfig, BaseFieldConfig, BlockRegistry, BuildStudioStructureOptions, CadmeaPlugin, CadmusAccessDeniedError, CadmusApiError, CadmusAuthError, CadmusCacheError, CadmusCmsError, CadmusDbError, CadmusEmailError, CadmusEnv, CadmusError, CadmusQueueError, CadmusRateLimitError, CadmusSessionError, CadmusStorageError, CadmusValidationError, CheckboxFieldConfig, CmsConfig, CmsRegistry, CollectionAccess, CollectionAdminConfig, CollectionConfig, CollectionHooks, CollectionMeta, CustomValidator, CustomValidatorResult, DEFAULT_STUDIO_GROUP, DateFieldConfig, FieldConfig, GroupFieldConfig, IMAGE_MIME_WHITELIST, ImageService, JsonFieldConfig, JsonValue, LocalApi, MAX_IMAGE_UPLOAD_BYTES, NumberFieldConfig, PortableBlockLike, QueueMessageHandler, RateLimitResult, RelationshipDepth, RelationshipFieldConfig, RenderedImage, RichTextFieldConfig, Rule, SelectFieldConfig, SendEmailInput, StringBlockRenderer, StudioStructureGroup, StudioStructureItem, TextFieldConfig, UploadFieldConfig, ValidateDocumentOptions, ValidationBuilder, ValidationFieldContext, ValidationSeverity, ValidationViolation, VersionedLocalApi, WebhookConfig, WebhookMessage, assertValid, buildStudioStructure, can, checkRateLimit, cmsConfigToSchema, collectionSearchTableName, collectionSearchTableSQL, collectionToTable, collectionVersionsTable, createBlockRegistry, createLocalApi, createSession, createVersionedLocalApi, createWebhookHook, db, defineCmsConfig, defineCollection, defineField, deleteSession, deliverWebhookMessage, enqueue, extractSearchText, flattenDoc, flattenFields, generateSchemaSource, generateSessionId, generateToken, getCollectionsMeta, getRegisteredApi, getSession, hashToken, nestDoc, processBatch, purgeCache, relationshipJoinTables, renderBlocksToString, rule, sendEmail, signSession, validateDocument, validateImageFile, verifySession };
20
+ export { AccessFn, ArrayFieldConfig, BaseFieldConfig, BlockRegistry, BuildStudioStructureOptions, CadmeaPlugin, CadmusAccessDeniedError, CadmusApiError, CadmusAuthError, CadmusCacheError, CadmusCmsError, CadmusDbError, CadmusEmailError, CadmusEnv, CadmusError, CadmusQueueError, CadmusRateLimitError, CadmusSessionError, CadmusStorageError, CadmusValidationError, CheckboxFieldConfig, CmsConfig, CmsRegistry, CollectionAccess, CollectionAdminConfig, CollectionConfig, CollectionHooks, CollectionMeta, CustomValidator, CustomValidatorResult, DEFAULT_STUDIO_GROUP, DateFieldConfig, DiffOptions, EDIT_ATTR, EditRef, FieldChange, FieldChangeKind, FieldConfig, GroupFieldConfig, IMAGE_MIME_WHITELIST, ImageCrop, ImageHotspot, ImageService, JsonFieldConfig, JsonValue, LocalApi, MAX_IMAGE_UPLOAD_BYTES, Migration, MigrationChange, MigrationResult, NumberFieldConfig, Patch, PatchOp, PortableBlockLike, QueueMessageHandler, RateLimitResult, RelationshipDepth, RelationshipFieldConfig, RenderedImage, RichTextFieldConfig, Rule, RunMigrationOptions, SelectFieldConfig, SendEmailInput, StringBlockRenderer, StudioStructureGroup, StudioStructureItem, TextFieldConfig, UploadFieldConfig, VISUAL_EDIT_MESSAGE, ValidateDocumentOptions, ValidationBuilder, ValidationFieldContext, ValidationSeverity, ValidationViolation, VersionedLocalApi, VisualEditingMessage, VisualEditingOptions, WebhookConfig, WebhookMessage, applyPatch, assertValid, buildStudioStructure, can, checkRateLimit, cmsConfigToSchema, collectionSearchTableName, collectionSearchTableSQL, collectionToTable, collectionVersionsTable, computePatch, createBlockRegistry, createLocalApi, createSession, createVersionedLocalApi, createWebhookHook, db, decodeEditRef, defineCmsConfig, defineCollection, defineField, defineMigration, deleteSession, deliverWebhookMessage, diffDocuments, editAttr, encodeEditRef, enqueue, extractSearchText, flattenDoc, flattenFields, generateSchemaSource, generateSessionId, generateToken, getCollectionsMeta, getRegisteredApi, getSession, hashToken, mountVisualEditing, nestDoc, processBatch, purgeCache, relationshipJoinTables, renderBlocksToString, rule, runMigration, sendEmail, signSession, validateDocument, validateImageFile, verifySession };
21
21
  //# sourceMappingURL=index.d.cts.map