@rimelight/cms 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/index.d.mts +118 -118
  2. package/dist/index.mjs +47 -47
  3. package/dist/integration.d.mts +3 -4
  4. package/dist/schema/index.d.mts +32 -33
  5. package/dist/schema/sqlite.d.mts +31 -32
  6. package/dist/storage/index.d.mts +12 -13
  7. package/package.json +13 -8
  8. package/src/admin/api/media-file.ts +1 -1
  9. package/src/admin/pages/assets.astro +11 -11
  10. package/src/admin/pages/pages-edit.astro +3 -3
  11. package/src/admin/pages/pages-index.astro +2 -2
  12. package/src/admin/pages/pages-preview.astro +3 -3
  13. package/src/admin/pages/pages-review.astro +2 -2
  14. package/src/admin/pages/templates-edit.astro +1 -1
  15. package/src/admin/pages/templates-index.astro +1 -1
  16. package/src/astro/BlockRenderer.astro +1 -1
  17. package/src/astro/blocks/CalloutBlock.astro +1 -1
  18. package/src/astro/blocks/OrderedListBlock.astro +2 -2
  19. package/src/astro/blocks/ParagraphBlock.astro +1 -1
  20. package/src/astro/blocks/TabsBlock.astro +5 -5
  21. package/src/astro/blocks/UnorderedListBlock.astro +2 -2
  22. package/src/auth/editor-guards.ts +1 -1
  23. package/src/cache/purge.ts +2 -2
  24. package/src/client/components/RimelightBlock.tsx +1 -1
  25. package/src/client/components/RimelightBlockPicker.tsx +1 -1
  26. package/src/client/components/RimelightPreview.tsx +27 -27
  27. package/src/client/components/RimelightPropertiesPanel.tsx +4 -4
  28. package/src/client/components/RimelightTemplateEditor.tsx +9 -5
  29. package/src/client/components/editors/CalloutEditor.tsx +10 -10
  30. package/src/client/components/editors/CardEditor.tsx +5 -5
  31. package/src/client/components/editors/CardsEditor.tsx +2 -2
  32. package/src/client/components/editors/CodeEditor.tsx +5 -5
  33. package/src/client/components/editors/DialogueEditor.tsx +6 -6
  34. package/src/client/components/editors/FileTreeEditor.tsx +1 -1
  35. package/src/client/components/editors/ImageEditor.tsx +9 -9
  36. package/src/client/components/editors/ParagraphEditor.tsx +1 -1
  37. package/src/client/components/editors/SceneEditor.tsx +9 -9
  38. package/src/client/components/editors/ScriptEditor.tsx +8 -8
  39. package/src/client/components/editors/SectionEditor.tsx +3 -3
  40. package/src/client/components/editors/StepItemEditor.tsx +6 -5
  41. package/src/client/components/editors/StepsEditor.tsx +1 -1
  42. package/src/client/components/editors/TabItemEditor.tsx +3 -3
  43. package/src/client/components/editors/TableEditor.tsx +4 -4
  44. package/src/client/components/editors/TabsEditor.tsx +1 -1
  45. package/src/client/state/editor-store.ts +23 -23
  46. package/src/client/utils/sortable.ts +13 -12
  47. package/src/client/utils/tree-sanitizer.ts +1 -1
  48. package/src/core/excerpt.ts +16 -16
  49. package/src/core/page-definitions.ts +2 -2
  50. package/src/docs/agent.ts +1 -1
  51. package/src/docs/routing.ts +2 -2
  52. package/src/loader/live.ts +1 -1
  53. package/src/markdown/serializer.ts +26 -26
package/dist/index.d.mts CHANGED
@@ -8,8 +8,8 @@ import { Toast, ToastInput, ToastItem, addToast, clearToasts, removeToast, showE
8
8
  import { SidebarItem, SidebarScope } from "@rimelight/ui/components/sidebar/sidebar.ts";
9
9
  import { BadgeProps } from "@rimelight/ui/components/badge/badge.ts";
10
10
  //#region src/core/page-definitions.d.ts
11
- type FieldType = "text" | "number" | "enum" | "text-array" | "page" | "page-array";
12
- interface FieldDefinition {
11
+ export type FieldType = "text" | "number" | "enum" | "text-array" | "page" | "page-array";
12
+ export interface FieldDefinition {
13
13
  type: FieldType;
14
14
  label: {
15
15
  en: string;
@@ -20,14 +20,14 @@ interface FieldDefinition {
20
20
  }[];
21
21
  allowedPageTypes?: string[];
22
22
  }
23
- interface PropertyGroup {
23
+ export interface PropertyGroup {
24
24
  label: {
25
25
  en: string;
26
26
  };
27
27
  defaultOpen: boolean;
28
28
  fields: Record<string, FieldDefinition>;
29
29
  }
30
- interface PageDefinition {
30
+ export interface PageDefinition {
31
31
  typeLabelKey: string;
32
32
  properties: Record<string, PropertyGroup>;
33
33
  /**
@@ -35,60 +35,60 @@ interface PageDefinition {
35
35
  */
36
36
  initialBlocks?: () => BaseBlock[];
37
37
  }
38
- declare function definePageDefinition(def: PageDefinition): PageDefinition;
39
- declare const DOCUMENT_DEFINITION: PageDefinition;
40
- declare const BLOG_POST_DEFINITION: PageDefinition;
41
- declare const PATCH_NOTE_DEFINITION: PageDefinition;
42
- declare const LOCATION_DEFINITION: PageDefinition;
43
- declare const SPECIES_DEFINITION: PageDefinition;
44
- declare const CHARACTER_DEFINITION: PageDefinition;
45
- declare const SKILL_DEFINITION: PageDefinition;
46
- declare const ITEM_DEFINITION: PageDefinition;
47
- declare const OBJECT_DEFINITION: PageDefinition;
48
- declare const GROUP_DEFINITION: PageDefinition;
49
- declare const HERO_DEFINITION: PageDefinition;
50
- declare const CARD_DEFINITION: PageDefinition;
51
- declare const SERIES_DEFINITION: PageDefinition;
52
- declare const PAGE_MAP: Record<string, PageDefinition>;
53
- declare function getPageDefinition(type: string): PageDefinition;
38
+ export declare function definePageDefinition(def: PageDefinition): PageDefinition;
39
+ export declare const DOCUMENT_DEFINITION: PageDefinition;
40
+ export declare const BLOG_POST_DEFINITION: PageDefinition;
41
+ export declare const PATCH_NOTE_DEFINITION: PageDefinition;
42
+ export declare const LOCATION_DEFINITION: PageDefinition;
43
+ export declare const SPECIES_DEFINITION: PageDefinition;
44
+ export declare const CHARACTER_DEFINITION: PageDefinition;
45
+ export declare const SKILL_DEFINITION: PageDefinition;
46
+ export declare const ITEM_DEFINITION: PageDefinition;
47
+ export declare const OBJECT_DEFINITION: PageDefinition;
48
+ export declare const GROUP_DEFINITION: PageDefinition;
49
+ export declare const HERO_DEFINITION: PageDefinition;
50
+ export declare const CARD_DEFINITION: PageDefinition;
51
+ export declare const SERIES_DEFINITION: PageDefinition;
52
+ export declare const PAGE_MAP: Record<string, PageDefinition>;
53
+ export declare function getPageDefinition(type: string): PageDefinition;
54
54
  //#endregion
55
55
  //#region src/markdown/serializer.d.ts
56
- declare function inlinesToMarkdown(inlines: InlineNode[] | {
56
+ export declare function inlinesToMarkdown(inlines: InlineNode[] | {
57
57
  en?: string;
58
58
  } | string | undefined): string;
59
- declare function blocksToMarkdown(blocks?: BaseBlock[], options?: {
59
+ export declare function blocksToMarkdown(blocks?: BaseBlock[], options?: {
60
60
  sectionLevel?: number;
61
61
  }): string;
62
62
  //#endregion
63
63
  //#region src/core/registry.d.ts
64
- interface BlockDefinition {
64
+ export interface BlockDefinition {
65
65
  type: string;
66
66
  label: string;
67
67
  description?: string;
68
68
  defaultProps: Record<string, any>;
69
69
  allowChildren?: boolean;
70
70
  }
71
- declare const BlockRegistry: {
71
+ export declare const BlockRegistry: {
72
72
  register(def: BlockDefinition): void;
73
73
  get(type: string): BlockDefinition | undefined;
74
74
  getAll(): BlockDefinition[];
75
75
  };
76
76
  //#endregion
77
77
  //#region src/core/validator.d.ts
78
- declare function isValidUUID(uuid: string): boolean;
79
- declare function validateBlockAST(blocks: BaseBlock[]): {
78
+ export declare function isValidUUID(uuid: string): boolean;
79
+ export declare function validateBlockAST(blocks: BaseBlock[]): {
80
80
  valid: boolean;
81
81
  errors: string[];
82
82
  };
83
83
  //#endregion
84
84
  //#region src/auth/permissions.d.ts
85
- declare const cmsStatements: {
85
+ export declare const cmsStatements: {
86
86
  readonly page: readonly ["create", "read", "update", "delete", "publish", "approve"];
87
87
  readonly template: readonly ["create", "read", "update", "delete", "instantiate"];
88
88
  readonly draft: readonly ["checkout", "edit", "release", "force_unlock"];
89
89
  readonly version: readonly ["create", "review", "approve", "publish"];
90
90
  };
91
- declare const cmsAc: {
91
+ export declare const cmsAc: {
92
92
  readonly page: {
93
93
  readonly read: readonly ["admin", "editor"];
94
94
  readonly update: readonly ["admin", "editor"];
@@ -125,54 +125,54 @@ interface UserSessionContext$1 {
125
125
  /**
126
126
  * Pure immutable function for Astro SSR Reader. Returns new array; never mutates input AST
127
127
  */
128
- declare function filterBlocksForReader(blocks: BaseBlock[], session?: UserSessionContext$1): BaseBlock[];
128
+ export declare function filterBlocksForReader(blocks: BaseBlock[], session?: UserSessionContext$1): BaseBlock[];
129
129
  //#endregion
130
130
  //#region src/auth/editor-guards.d.ts
131
131
  /**
132
132
  * Checks if a user has edit rights over a specific block
133
133
  */
134
- declare function canUserEditBlock(block: BaseBlock, session?: UserSessionContext$1): boolean;
134
+ export declare function canUserEditBlock(block: BaseBlock, session?: UserSessionContext$1): boolean;
135
135
  /**
136
136
  * Recursively checks if a block or ANY of its descendants are locked or un-editable
137
137
  */
138
- declare function hasLockedDescendants(block: BaseBlock, session?: UserSessionContext$1): boolean;
138
+ export declare function hasLockedDescendants(block: BaseBlock, session?: UserSessionContext$1): boolean;
139
139
  /**
140
140
  * Server-Side Guard: Validates that an incoming edited block tree obeys templated & authorization
141
141
  * invariants
142
142
  */
143
- declare function validateServerBlockPayload(existingTree: BaseBlock[], incomingTree: BaseBlock[], session?: UserSessionContext$1): {
143
+ export declare function validateServerBlockPayload(existingTree: BaseBlock[], incomingTree: BaseBlock[], session?: UserSessionContext$1): {
144
144
  valid: boolean;
145
145
  reason?: string;
146
146
  };
147
147
  //#endregion
148
148
  //#region src/auth/filter-templates.d.ts
149
- declare function canUserCreateFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
150
- declare function canUserEditFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
151
- declare function canUserReviewFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
152
- declare function canUserViewFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
153
- declare function canUserInstantiateTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
154
- declare function filterTemplatesForUser(templates: PageTemplate[], session?: UserSessionContext$1): PageTemplate[];
149
+ export declare function canUserCreateFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
150
+ export declare function canUserEditFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
151
+ export declare function canUserReviewFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
152
+ export declare function canUserViewFromTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
153
+ export declare function canUserInstantiateTemplate(template: PageTemplate, session?: UserSessionContext$1): boolean;
154
+ export declare function filterTemplatesForUser(templates: PageTemplate[], session?: UserSessionContext$1): PageTemplate[];
155
155
  //#endregion
156
156
  //#region src/cache/purge.d.ts
157
- interface CachePurgeOptions {
157
+ export interface CachePurgeOptions {
158
158
  slug: string;
159
159
  locales: string[];
160
160
  domain?: string;
161
161
  basePath?: string;
162
162
  isEnterpriseCloudflare?: boolean;
163
163
  }
164
- declare function invalidatePageCache(options: CachePurgeOptions): Promise<boolean>;
164
+ export declare function invalidatePageCache(options: CachePurgeOptions): Promise<boolean>;
165
165
  //#endregion
166
166
  //#region src/search/query.d.ts
167
- declare const POSTGRES_SEARCH_CONFIGS: Record<string, string>;
168
- declare function getPostgresSearchConfig(locale: string): string;
167
+ export declare const POSTGRES_SEARCH_CONFIGS: Record<string, string>;
168
+ export declare function getPostgresSearchConfig(locale: string): string;
169
169
  //#endregion
170
170
  //#region src/core/excerpt.d.ts
171
171
  /**
172
172
  * Recursively extracts plain text from an array of CMS blocks.
173
173
  */
174
- declare function extractTextFromBlocks(blocks: BaseBlock[] | undefined | null, locale?: string): string;
175
- interface ExcerptOptions {
174
+ export declare function extractTextFromBlocks(blocks: BaseBlock[] | undefined | null, locale?: string): string;
175
+ export interface ExcerptOptions {
176
176
  maxLength?: number;
177
177
  locale?: string;
178
178
  fallback?: string;
@@ -180,26 +180,26 @@ interface ExcerptOptions {
180
180
  /**
181
181
  * Generates an SEO / RSS safe plain text excerpt from a CMS page or block payload.
182
182
  */
183
- declare function createPageExcerpt(page: {
183
+ export declare function createPageExcerpt(page: {
184
184
  description?: unknown;
185
185
  content?: unknown;
186
186
  title?: unknown;
187
187
  } | null | undefined, options?: ExcerptOptions): string;
188
188
  //#endregion
189
189
  //#region src/services/site-settings.d.ts
190
- declare const DEFAULT_SITE_SETTINGS: InsertSiteSettings;
190
+ export declare const DEFAULT_SITE_SETTINGS: InsertSiteSettings;
191
191
  /**
192
192
  * Retrieves the dynamic site settings from the database. If no settings are found, seeds the
193
193
  * default record and returns it.
194
194
  */
195
- declare function getSiteSettings(db: any, fallbackDefaults?: Partial<InsertSiteSettings>): Promise<SiteSettings>;
195
+ export declare function getSiteSettings(db: any, fallbackDefaults?: Partial<InsertSiteSettings>): Promise<SiteSettings>;
196
196
  /**
197
197
  * Updates dynamic site settings in the database.
198
198
  */
199
- declare function updateSiteSettings(db: any, updates: Partial<InsertSiteSettings>, id?: string): Promise<SiteSettings>;
199
+ export declare function updateSiteSettings(db: any, updates: Partial<InsertSiteSettings>, id?: string): Promise<SiteSettings>;
200
200
  //#endregion
201
201
  //#region src/loader/live.d.ts
202
- interface CmsLoaderOptions {
202
+ export interface CmsLoaderOptions {
203
203
  type?: PageType | undefined;
204
204
  db?: any;
205
205
  locale?: string | undefined;
@@ -211,7 +211,7 @@ interface CmsLoaderOptions {
211
211
  [key: string]: string | undefined;
212
212
  } | undefined;
213
213
  }
214
- interface CmsPageData {
214
+ export interface CmsPageData {
215
215
  id: string;
216
216
  slug: string;
217
217
  type: PageType;
@@ -229,11 +229,11 @@ interface CmsPageData {
229
229
  createdAt: Date;
230
230
  updatedAt: Date | null;
231
231
  }
232
- interface CmsEntry {
232
+ export interface CmsEntry {
233
233
  id: string;
234
234
  data: CmsPageData;
235
235
  }
236
- interface CacheHint {
236
+ export interface CacheHint {
237
237
  tags?: string[];
238
238
  lastModified?: Date;
239
239
  maxAge?: number;
@@ -241,7 +241,7 @@ interface CacheHint {
241
241
  /**
242
242
  * Direct querying helper for CMS collections.
243
243
  */
244
- declare function getCmsCollection(db: any, options?: CmsLoaderOptions & {
244
+ export declare function getCmsCollection(db: any, options?: CmsLoaderOptions & {
245
245
  limit?: number | undefined;
246
246
  offset?: number | undefined;
247
247
  where?: SQL | undefined;
@@ -252,7 +252,7 @@ declare function getCmsCollection(db: any, options?: CmsLoaderOptions & {
252
252
  /**
253
253
  * Direct querying helper for a single CMS entry by slug or id.
254
254
  */
255
- declare function getCmsEntry(db: any, slugOrId: string, options?: CmsLoaderOptions): Promise<{
255
+ export declare function getCmsEntry(db: any, slugOrId: string, options?: CmsLoaderOptions): Promise<{
256
256
  entry: CmsEntry | null;
257
257
  cacheHint: CacheHint;
258
258
  }>;
@@ -260,7 +260,7 @@ declare function getCmsEntry(db: any, slugOrId: string, options?: CmsLoaderOptio
260
260
  * Astro Live Loader for CMS collections. Use inside src/live.config.ts with defineLiveCollection({
261
261
  * loader: rimelightCmsLoader({ type: 'blog' }) })
262
262
  */
263
- declare function rimelightCmsLoader(loaderOptions?: CmsLoaderOptions): {
263
+ export declare function rimelightCmsLoader(loaderOptions?: CmsLoaderOptions): {
264
264
  name: string;
265
265
  loadCollection: (context: {
266
266
  filter?: {
@@ -285,7 +285,7 @@ declare function rimelightCmsLoader(loaderOptions?: CmsLoaderOptions): {
285
285
  };
286
286
  //#endregion
287
287
  //#region src/cron/scheduled.d.ts
288
- interface CmsCronResult {
288
+ export interface CmsCronResult {
289
289
  expiredLocksCleaned: number;
290
290
  scheduledPagesActive: number;
291
291
  timestamp: string;
@@ -296,10 +296,10 @@ interface CmsCronResult {
296
296
  * - Cleans up expired page draft locks
297
297
  * - Checks for active scheduled pages
298
298
  */
299
- declare function handleCmsCron(_event: any, _env: any, _ctx: any, db: any): Promise<CmsCronResult>;
299
+ export declare function handleCmsCron(_event: any, _env: any, _ctx: any, db: any): Promise<CmsCronResult>;
300
300
  //#endregion
301
301
  //#region src/mcp/index.d.ts
302
- declare const CMS_MCP_TOOLS: ({
302
+ export declare const CMS_MCP_TOOLS: ({
303
303
  name: string;
304
304
  description: string;
305
305
  inputSchema: {
@@ -337,13 +337,13 @@ declare const CMS_MCP_TOOLS: ({
337
337
  inputSchema: {
338
338
  type: string;
339
339
  properties: {
340
- type?: never;
341
- includeDrafts?: never;
342
- limit?: never;
343
340
  slugOrId: {
344
341
  type: string;
345
342
  description: string;
346
343
  };
344
+ type?: never;
345
+ includeDrafts?: never;
346
+ limit?: never;
347
347
  pageId?: never;
348
348
  userId?: never;
349
349
  blocks?: never;
@@ -363,10 +363,6 @@ declare const CMS_MCP_TOOLS: ({
363
363
  inputSchema: {
364
364
  type: string;
365
365
  properties: {
366
- type?: never;
367
- includeDrafts?: never;
368
- limit?: never;
369
- slugOrId?: never;
370
366
  pageId: {
371
367
  type: string;
372
368
  description: string;
@@ -383,6 +379,10 @@ declare const CMS_MCP_TOOLS: ({
383
379
  type: string;
384
380
  description: string;
385
381
  };
382
+ type?: never;
383
+ includeDrafts?: never;
384
+ limit?: never;
385
+ slugOrId?: never;
386
386
  name?: never;
387
387
  description?: never;
388
388
  author?: never;
@@ -396,7 +396,6 @@ declare const CMS_MCP_TOOLS: ({
396
396
  name: string;
397
397
  description: string;
398
398
  inputSchema: {
399
- required?: never;
400
399
  type: string;
401
400
  properties: {
402
401
  type?: never;
@@ -414,22 +413,14 @@ declare const CMS_MCP_TOOLS: ({
414
413
  branding?: never;
415
414
  seo?: never;
416
415
  };
416
+ required?: never;
417
417
  };
418
418
  } | {
419
419
  name: string;
420
420
  description: string;
421
421
  inputSchema: {
422
- required?: never;
423
422
  type: string;
424
423
  properties: {
425
- type?: never;
426
- includeDrafts?: never;
427
- limit?: never;
428
- slugOrId?: never;
429
- pageId?: never;
430
- userId?: never;
431
- blocks?: never;
432
- properties?: never;
433
424
  name: {
434
425
  type: string;
435
426
  };
@@ -448,13 +439,22 @@ declare const CMS_MCP_TOOLS: ({
448
439
  seo: {
449
440
  type: string;
450
441
  };
442
+ type?: never;
443
+ includeDrafts?: never;
444
+ limit?: never;
445
+ slugOrId?: never;
446
+ pageId?: never;
447
+ userId?: never;
448
+ blocks?: never;
449
+ properties?: never;
451
450
  };
451
+ required?: never;
452
452
  };
453
453
  })[];
454
454
  /**
455
455
  * Handles Model Context Protocol (MCP) JSON-RPC requests for CMS tools.
456
456
  */
457
- declare function handleCmsMcpRequest(body: {
457
+ export declare function handleCmsMcpRequest(body: {
458
458
  jsonrpc?: string;
459
459
  id?: string | number;
460
460
  method: string;
@@ -465,23 +465,23 @@ declare function handleCmsMcpRequest(body: {
465
465
  /**
466
466
  * Returns all active (non-deleted) bylines.
467
467
  */
468
- declare function getBylines(db: any): Promise<Byline[]>;
468
+ export declare function getBylines(db: any): Promise<Byline[]>;
469
469
  /**
470
470
  * Retrieves a single byline by ID or slug.
471
471
  */
472
- declare function getByline(db: any, idOrSlug: string): Promise<Byline | null>;
472
+ export declare function getByline(db: any, idOrSlug: string): Promise<Byline | null>;
473
473
  /**
474
474
  * Creates a new byline.
475
475
  */
476
- declare function createByline(db: any, data: NewByline): Promise<Byline>;
476
+ export declare function createByline(db: any, data: NewByline): Promise<Byline>;
477
477
  /**
478
478
  * Updates an existing byline.
479
479
  */
480
- declare function updateByline(db: any, id: string, data: Partial<NewByline>): Promise<Byline | null>;
480
+ export declare function updateByline(db: any, id: string, data: Partial<NewByline>): Promise<Byline | null>;
481
481
  /**
482
482
  * Soft deletes a byline.
483
483
  */
484
- declare function deleteByline(db: any, id: string): Promise<boolean>;
484
+ export declare function deleteByline(db: any, id: string): Promise<boolean>;
485
485
  //#endregion
486
486
  //#region src/core/preview.d.ts
487
487
  /**
@@ -490,18 +490,18 @@ declare function deleteByline(db: any, id: string): Promise<boolean>;
490
490
  /**
491
491
  * Generates a signed token for a page ID valid for ttlSeconds (default 24h).
492
492
  */
493
- declare function generatePreviewToken(pageId: string, secret: string, ttlSeconds?: number): Promise<{
493
+ export declare function generatePreviewToken(pageId: string, secret: string, ttlSeconds?: number): Promise<{
494
494
  token: string;
495
495
  expiresAt: number;
496
496
  }>;
497
497
  /**
498
498
  * Verifies a signed preview token against a pageId and secret.
499
499
  */
500
- declare function verifyPreviewToken(pageId: string, token: string, secret: string): Promise<boolean>;
500
+ export declare function verifyPreviewToken(pageId: string, token: string, secret: string): Promise<boolean>;
501
501
  //#endregion
502
502
  //#region src/core/diff.d.ts
503
- type DiffChangeType = "added" | "removed" | "modified" | "unchanged";
504
- interface BlockDiff {
503
+ export type DiffChangeType = "added" | "removed" | "modified" | "unchanged";
504
+ export interface BlockDiff {
505
505
  blockId: string;
506
506
  type: string;
507
507
  status: DiffChangeType;
@@ -513,7 +513,7 @@ interface BlockDiff {
513
513
  newValue: any;
514
514
  }[];
515
515
  }
516
- interface PageVersionDiff {
516
+ export interface PageVersionDiff {
517
517
  blocks: BlockDiff[];
518
518
  metaChanges: {
519
519
  field: string;
@@ -530,21 +530,21 @@ interface PageVersionDiff {
530
530
  /**
531
531
  * Calculates a detailed diff between an old list of blocks and a new list of blocks.
532
532
  */
533
- declare function diffBlocks(oldBlocks?: BaseBlock[], newBlocks?: BaseBlock[]): BlockDiff[];
533
+ export declare function diffBlocks(oldBlocks?: BaseBlock[], newBlocks?: BaseBlock[]): BlockDiff[];
534
534
  /**
535
535
  * Compares two page snapshots (metadata + content blocks).
536
536
  */
537
- declare function diffPageSnapshots(oldSnapshot: any, newSnapshot: any): PageVersionDiff;
537
+ export declare function diffPageSnapshots(oldSnapshot: any, newSnapshot: any): PageVersionDiff;
538
538
  //#endregion
539
539
  //#region src/services/search-indexer.d.ts
540
- declare function indexPageForSearch(db: any, page: {
540
+ export declare function indexPageForSearch(db: any, page: {
541
541
  id: string;
542
542
  title: any;
543
543
  content: any;
544
544
  }, locales?: string[]): Promise<void>;
545
545
  //#endregion
546
546
  //#region src/core/types/taxonomies.d.ts
547
- interface TaxonomyTerm {
547
+ export interface TaxonomyTerm {
548
548
  id: string;
549
549
  taxonomy: string;
550
550
  slug: string;
@@ -557,7 +557,7 @@ interface TaxonomyTerm {
557
557
  createdAt?: Date;
558
558
  updatedAt?: Date;
559
559
  }
560
- interface TaxonomyQueryOptions {
560
+ export interface TaxonomyQueryOptions {
561
561
  includeCounts?: boolean;
562
562
  locale?: string;
563
563
  }
@@ -567,19 +567,19 @@ interface TaxonomyQueryOptions {
567
567
  * Retrieves all terms for a given taxonomy. If hierarchical, returns a tree structure with
568
568
  * `children: TaxonomyTerm[]`.
569
569
  */
570
- declare function getTaxonomyTerms(db: any, taxonomy: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm[]>;
570
+ export declare function getTaxonomyTerms(db: any, taxonomy: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm[]>;
571
571
  /**
572
572
  * Retrieves a single term by taxonomy and slug.
573
573
  */
574
- declare function getTerm(db: any, taxonomy: string, slug: string): Promise<TaxonomyTerm | null>;
574
+ export declare function getTerm(db: any, taxonomy: string, slug: string): Promise<TaxonomyTerm | null>;
575
575
  /**
576
576
  * Retrieves all terms assigned to a specific page entry.
577
577
  */
578
- declare function getEntryTerms(db: any, pageId: string, taxonomy?: string): Promise<TaxonomyTerm[]>;
578
+ export declare function getEntryTerms(db: any, pageId: string, taxonomy?: string): Promise<TaxonomyTerm[]>;
579
579
  /**
580
580
  * Retrieves pages tagged with a given taxonomy term.
581
581
  */
582
- declare function getEntriesByTerm(db: any, taxonomy: string, slug: string, options?: {
582
+ export declare function getEntriesByTerm(db: any, taxonomy: string, slug: string, options?: {
583
583
  limit?: number;
584
584
  offset?: number;
585
585
  type?: string;
@@ -595,11 +595,11 @@ declare function getEntriesByTerm(db: any, taxonomy: string, slug: string, optio
595
595
  /**
596
596
  * Sets/syncs the assigned terms for a page within a specific taxonomy.
597
597
  */
598
- declare function assignEntryTerms(db: any, pageId: string, taxonomy: string, termIds: string[]): Promise<void>;
598
+ export declare function assignEntryTerms(db: any, pageId: string, taxonomy: string, termIds: string[]): Promise<void>;
599
599
  /**
600
600
  * Creates a new taxonomy term.
601
601
  */
602
- declare function createTerm(db: any, data: {
602
+ export declare function createTerm(db: any, data: {
603
603
  taxonomy: string;
604
604
  slug: string;
605
605
  label: any;
@@ -610,7 +610,7 @@ declare function createTerm(db: any, data: {
610
610
  /**
611
611
  * Updates an existing taxonomy term.
612
612
  */
613
- declare function updateTerm(db: any, id: string, updates: Partial<{
613
+ export declare function updateTerm(db: any, id: string, updates: Partial<{
614
614
  slug: string;
615
615
  label: any;
616
616
  description: any;
@@ -620,19 +620,19 @@ declare function updateTerm(db: any, id: string, updates: Partial<{
620
620
  /**
621
621
  * Deletes a taxonomy term.
622
622
  */
623
- declare function deleteTerm(db: any, id: string): Promise<{
623
+ export declare function deleteTerm(db: any, id: string): Promise<{
624
624
  success: boolean;
625
625
  }>;
626
626
  //#endregion
627
627
  //#region src/docs/config.d.ts
628
- interface EditLinkConfig {
628
+ export interface EditLinkConfig {
629
629
  baseUrl: string;
630
630
  }
631
- interface TableOfContentsConfig {
631
+ export interface TableOfContentsConfig {
632
632
  minHeadingLevel?: number;
633
633
  maxHeadingLevel?: number;
634
634
  }
635
- interface DocsConfig {
635
+ export interface DocsConfig {
636
636
  basePath?: string;
637
637
  sidebar: (SidebarItem | SidebarScope)[] | {
638
638
  scopes: SidebarScope[];
@@ -640,10 +640,10 @@ interface DocsConfig {
640
640
  editLink?: EditLinkConfig;
641
641
  tableOfContents?: false | TableOfContentsConfig;
642
642
  }
643
- declare const defineDocsConfig: <const T extends DocsConfig>(config: T) => T;
643
+ export declare const defineDocsConfig: <const T extends DocsConfig>(config: T) => T;
644
644
  //#endregion
645
645
  //#region src/docs/sidebar.d.ts
646
- interface ResolvedSidebarItem {
646
+ export interface ResolvedSidebarItem {
647
647
  label: string;
648
648
  href?: string | undefined;
649
649
  icon?: string | undefined;
@@ -652,19 +652,19 @@ interface ResolvedSidebarItem {
652
652
  children?: ResolvedSidebarItem[] | undefined;
653
653
  collapsed?: boolean | undefined;
654
654
  }
655
- interface ResolvedScope {
655
+ export interface ResolvedScope {
656
656
  id: string;
657
657
  label: string;
658
658
  href: string;
659
659
  icon?: string | undefined;
660
660
  active?: boolean | undefined;
661
661
  }
662
- declare function getDocsSidebar(config: DocsConfig, locale: string, currentPath: string, activeVersion?: string, includeVersionInUrl?: boolean): Promise<{
662
+ export declare function getDocsSidebar(config: DocsConfig, locale: string, currentPath: string, activeVersion?: string, includeVersionInUrl?: boolean): Promise<{
663
663
  items: ResolvedSidebarItem[];
664
664
  scopes: ResolvedScope[];
665
665
  activeScope?: ResolvedScope | undefined;
666
666
  }>;
667
- declare function getSurroundItems(sidebar: ResolvedSidebarItem[], currentPath: string): {
667
+ export declare function getSurroundItems(sidebar: ResolvedSidebarItem[], currentPath: string): {
668
668
  prev: {
669
669
  label: string;
670
670
  href: string;
@@ -676,32 +676,32 @@ declare function getSurroundItems(sidebar: ResolvedSidebarItem[], currentPath: s
676
676
  };
677
677
  //#endregion
678
678
  //#region src/docs/routing.d.ts
679
- interface DocEntry {
679
+ export interface DocEntry {
680
680
  id?: string;
681
681
  slug?: string;
682
682
  version?: string;
683
683
  properties?: Record<string, any>;
684
684
  [key: string]: any;
685
685
  }
686
- declare function getDocsVersions(entries: (DocEntry | string)[], locale?: string): string[];
687
- declare function parseDocsSlug(slug: string | undefined, versions: string[]): {
686
+ export declare function getDocsVersions(entries: (DocEntry | string)[], locale?: string): string[];
687
+ export declare function parseDocsSlug(slug: string | undefined, versions: string[]): {
688
688
  activeVersion: string | undefined;
689
689
  contentPath: string;
690
690
  includeVersionInUrl: boolean;
691
691
  };
692
- declare function formatDocsUrl(href: string, locale: string, activeVersion?: string, includeVersionInUrl?: boolean): string;
692
+ export declare function formatDocsUrl(href: string, locale: string, activeVersion?: string, includeVersionInUrl?: boolean): string;
693
693
  //#endregion
694
694
  //#region src/docs/toc.d.ts
695
- interface TableOfContentsHeading {
695
+ export interface TableOfContentsHeading {
696
696
  depth: number;
697
697
  slug: string;
698
698
  text: string;
699
699
  }
700
- declare function slugifyHeading(text: string): string;
701
- declare function extractHeadingsFromBlocks(blocks?: any[], currentDepth?: number): TableOfContentsHeading[];
700
+ export declare function slugifyHeading(text: string): string;
701
+ export declare function extractHeadingsFromBlocks(blocks?: any[], currentDepth?: number): TableOfContentsHeading[];
702
702
  //#endregion
703
703
  //#region src/docs/agent.d.ts
704
- interface AgentMarkdownOptions {
704
+ export interface AgentMarkdownOptions {
705
705
  siteUrl?: string;
706
706
  llmsUrl?: string;
707
707
  sourceUrl?: string;
@@ -709,11 +709,11 @@ interface AgentMarkdownOptions {
709
709
  /**
710
710
  * Renders a CMS page record into clean, agent-ready Markdown with YAML frontmatter.
711
711
  */
712
- declare function renderPageAsMarkdown(page: any, locale?: string, options?: AgentMarkdownOptions): string;
712
+ export declare function renderPageAsMarkdown(page: any, locale?: string, options?: AgentMarkdownOptions): string;
713
713
  /**
714
714
  * Collate all published pages of a given type into a single corpus markdown document.
715
715
  */
716
- declare function renderCorpusMarkdown(db: any, options?: {
716
+ export declare function renderCorpusMarkdown(db: any, options?: {
717
717
  type?: string;
718
718
  locale?: string;
719
719
  siteUrl?: string;
@@ -721,4 +721,4 @@ declare function renderCorpusMarkdown(db: any, options?: {
721
721
  description?: string;
722
722
  }): Promise<string>;
723
723
  //#endregion
724
- export { ALLOWED_CHILDREN_MAP, AgentMarkdownOptions, ApiDocumentationBlock, ApiDocumentationBlockProps, type AuthAdapter, BLOG_POST_DEFINITION, type BadgeProps, BaseBlock, BlockDefinition, BlockDiff, BlockRegistry, BlockType, Byline, BylineCredit, BylineRole, CARD_DEFINITION, CHARACTER_DEFINITION, CMS_MCP_TOOLS, CacheHint, CachePurgeOptions, CalloutBlock, CalloutBlockProps, CalloutVariant, CardBlock, CardBlockProps, CardsBlock, CardsBlockProps, type CmsAuthAdapter, CmsCronResult, CmsEntry, CmsLoaderOptions, CmsPageData, CodeBlock, CodeBlockProps, ComponentShowcaseBlock, ComponentShowcaseBlockProps, DEFAULT_SITE_SETTINGS, DOCUMENT_DEFINITION, DialogueBlock, DialogueBlockProps, DiffChangeType, DocEntry, DocsConfig, EditLinkConfig, ExcerptOptions, FieldDefinition, FieldType, FileTreeBlock, FileTreeBlockProps, FileTreeNode, GROUP_DEFINITION, HERO_DEFINITION, HeadingLevel, ITEM_DEFINITION, ImageBlock, ImageBlockProps, InlineNode, InlineNodeType, InsertSiteSettings, LOCATION_DEFINITION, LinkInlineNode, LivePreviewBlock, LivePreviewBlockProps, Localized, MAX_SECTION_DEPTH, MAX_SECTION_HEADING_LEVEL, MIN_SECTION_HEADING_LEVEL, MediaValue, NewByline, OBJECT_DEFINITION, PAGE_MAP, PATCH_NOTE_DEFINITION, POSTGRES_SEARCH_CONFIGS, PageContent, PageDefinition, PageMentionNode, PageMetadata, PageTemplate, PageType, PageVersion, PageVersionApproval, PageVersionComment, PageVersionDiff, PageVersionStatus, ParagraphBlock, ParagraphBlockProps, PropertyGroup, R2StorageOptions, RegisterPageTypes, ResolvedScope, ResolvedSidebarItem, type RimelightCmsOptions, SERIES_DEFINITION, SKILL_DEFINITION, SPECIES_DEFINITION, SceneBlock, SceneBlockProps, ScriptBlock, ScriptBlockProps, SectionBlock, SectionBlockProps, Setting, type SidebarItem, type SidebarScope, SiteSettings, SiteSettingsBranding, SiteSettingsSeo, StepItemBlock, StepItemBlockProps, StepsBlock, StepsBlockProps, StorageConfig, StorageFile, StorageListOptions, StorageListResult, StorageUploadOptions, TabItemBlock, TabItemBlockProps, TableBlock, TableBlockProps, TableColumnDef, TableOfContentsConfig, TableOfContentsHeading, TabsBlock, TabsBlockProps, TaxonomyQueryOptions, TaxonomyTerm, TemplateApprovalRules, TemplateRolePermissions, TextInlineNode, TimeOfDay, type Toast, type ToastInput, type ToastItem, Transition, TypedBlock, TypedSceneBlockProps, TypedScriptBlockProps, UserSessionContext, type UserType, addToast, assignEntryTerms, auth0Auth, blocksToMarkdown, bylines, calculateHeadingLevel, canUserCreateFromTemplate, canUserEditBlock, canUserEditFromTemplate, canUserInstantiateTemplate, canUserReviewFromTemplate, canUserViewFromTemplate, cfAccessAuth, clearToasts, cmsAc, cmsStatements, contentSearchIndex, createByline, createPageExcerpt, createTerm, defineDocsConfig, definePageDefinition, deleteByline, deleteR2File, deleteTerm, diffBlocks, diffPageSnapshots, evaluateAccess, extractHeadingsFromBlocks, extractTextFromBlocks, filterBlocksForReader, filterTemplatesForUser, formatDocsUrl, generatePreviewToken, getByline, getBylines, getCmsCollection, getCmsEntry, getDocsSidebar, getDocsVersions, getEntriesByTerm, getEntryTerms, getPageDefinition, getPostgresSearchConfig, getR2Bucket, getSiteSettings, getSurroundItems, getTaxonomyTerms, getTerm, handleCmsCron, handleCmsMcpRequest, hasLockedDescendants, hasPermission, hasRole, indexPageForSearch, inlinesToMarkdown, invalidatePageCache, isValidUUID, listR2Files, mockAuth, pageDraftLocks, pageDrafts, pageTaxonomyTerms, pageTemplates, pageVersionApprovals, pageVersionComments, pageVersions, pages, parseDocsSlug, r2, removeToast, renderCorpusMarkdown, renderPageAsMarkdown, rimelightCms, rimelightCmsLoader, showErrorToast, showSuccessToast, siteSettings, slugifyHeading, taxonomyTerms, toast, toasts, updateByline, updateSiteSettings, updateTerm, uploadR2File, validateBlockAST, validateServerBlockPayload, verifyPreviewToken };
724
+ export { ALLOWED_CHILDREN_MAP, ApiDocumentationBlock, ApiDocumentationBlockProps, type AuthAdapter, type BadgeProps, BaseBlock, BlockType, Byline, BylineCredit, BylineRole, CalloutBlock, CalloutBlockProps, CalloutVariant, CardBlock, CardBlockProps, CardsBlock, CardsBlockProps, type CmsAuthAdapter, CodeBlock, CodeBlockProps, ComponentShowcaseBlock, ComponentShowcaseBlockProps, DialogueBlock, DialogueBlockProps, FileTreeBlock, FileTreeBlockProps, FileTreeNode, HeadingLevel, ImageBlock, ImageBlockProps, InlineNode, InlineNodeType, InsertSiteSettings, LinkInlineNode, LivePreviewBlock, LivePreviewBlockProps, Localized, MAX_SECTION_DEPTH, MAX_SECTION_HEADING_LEVEL, MIN_SECTION_HEADING_LEVEL, MediaValue, NewByline, PageContent, PageMentionNode, PageMetadata, PageTemplate, PageType, PageVersion, PageVersionApproval, PageVersionComment, PageVersionStatus, ParagraphBlock, ParagraphBlockProps, R2StorageOptions, RegisterPageTypes, type RimelightCmsOptions, SceneBlock, SceneBlockProps, ScriptBlock, ScriptBlockProps, SectionBlock, SectionBlockProps, Setting, type SidebarItem, type SidebarScope, SiteSettings, SiteSettingsBranding, SiteSettingsSeo, StepItemBlock, StepItemBlockProps, StepsBlock, StepsBlockProps, StorageConfig, StorageFile, StorageListOptions, StorageListResult, StorageUploadOptions, TabItemBlock, TabItemBlockProps, TableBlock, TableBlockProps, TableColumnDef, TabsBlock, TabsBlockProps, TemplateApprovalRules, TemplateRolePermissions, TextInlineNode, TimeOfDay, type Toast, type ToastInput, type ToastItem, Transition, TypedBlock, TypedSceneBlockProps, TypedScriptBlockProps, UserSessionContext, type UserType, addToast, auth0Auth, bylines, calculateHeadingLevel, cfAccessAuth, clearToasts, contentSearchIndex, deleteR2File, evaluateAccess, getR2Bucket, hasPermission, hasRole, listR2Files, mockAuth, pageDraftLocks, pageDrafts, pageTaxonomyTerms, pageTemplates, pageVersionApprovals, pageVersionComments, pageVersions, pages, r2, removeToast, rimelightCms, showErrorToast, showSuccessToast, siteSettings, taxonomyTerms, toast, toasts, uploadR2File };