@conloca/content-api 0.1.15 → 0.1.16

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 (187) hide show
  1. package/dist/asset-manifest.d.ts +23 -0
  2. package/dist/asset-manifest.d.ts.map +1 -0
  3. package/dist/asset-manifest.js +73 -0
  4. package/dist/asset-operations.d.ts +159 -0
  5. package/dist/asset-operations.d.ts.map +1 -0
  6. package/dist/asset-operations.js +736 -0
  7. package/dist/asset-types.d.ts +56 -0
  8. package/dist/asset-types.d.ts.map +1 -0
  9. package/dist/asset-types.js +7 -0
  10. package/dist/base-content-index.d.ts +57 -0
  11. package/dist/base-content-index.d.ts.map +1 -0
  12. package/dist/base-content-index.js +179 -0
  13. package/dist/block-index.d.ts +9 -0
  14. package/dist/block-index.d.ts.map +1 -0
  15. package/dist/block-index.js +11 -0
  16. package/dist/blocks.d.ts +16 -0
  17. package/dist/blocks.d.ts.map +1 -0
  18. package/dist/blocks.js +103 -0
  19. package/dist/cf-access.d.ts +31 -0
  20. package/dist/cf-access.d.ts.map +1 -0
  21. package/dist/cf-access.js +66 -0
  22. package/dist/component-registry.d.ts +50 -0
  23. package/dist/component-registry.d.ts.map +1 -0
  24. package/dist/component-registry.js +120 -0
  25. package/dist/{component-registry.types-CBGONnYn.d.mts → component-registry.types-C0ctF9nh.d.mts} +1 -1
  26. package/dist/component-registry.types-C0ctF9nh.d.mts.map +1 -0
  27. package/dist/component-registry.types.d.ts +11 -0
  28. package/dist/component-registry.types.d.ts.map +1 -0
  29. package/dist/component-registry.types.js +1 -0
  30. package/dist/content-api.interface.d.ts +64 -0
  31. package/dist/content-api.interface.d.ts.map +1 -0
  32. package/dist/content-api.interface.js +1 -0
  33. package/dist/content-filters.d.ts +31 -0
  34. package/dist/content-filters.d.ts.map +1 -0
  35. package/dist/content-filters.js +246 -0
  36. package/dist/content-index-D092_vk1.mjs +629 -0
  37. package/dist/content-index-D092_vk1.mjs.map +1 -0
  38. package/dist/content-index-D6IVMmAB.d.mts +127 -0
  39. package/dist/content-index-D6IVMmAB.d.mts.map +1 -0
  40. package/dist/content-index.d.ts +126 -0
  41. package/dist/content-index.d.ts.map +1 -0
  42. package/dist/content-index.js +418 -0
  43. package/dist/content-operations-DIbsxG5A.d.mts +354 -0
  44. package/dist/content-operations-DIbsxG5A.d.mts.map +1 -0
  45. package/dist/content-operations.d.ts +93 -0
  46. package/dist/content-operations.d.ts.map +1 -0
  47. package/dist/content-operations.js +275 -0
  48. package/dist/content-reader.d.ts +10 -0
  49. package/dist/content-reader.d.ts.map +1 -0
  50. package/dist/content-reader.js +13 -0
  51. package/dist/content-utils-fWNHTrPy.mjs +280 -0
  52. package/dist/content-utils-fWNHTrPy.mjs.map +1 -0
  53. package/dist/content-utils.d.ts +132 -0
  54. package/dist/content-utils.d.ts.map +1 -0
  55. package/dist/content-utils.js +352 -0
  56. package/dist/content-watcher.d.ts +43 -0
  57. package/dist/content-watcher.d.ts.map +1 -0
  58. package/dist/content-watcher.js +83 -0
  59. package/dist/{data-Db1Iv9T0.mjs → data-DquNIEnQ.mjs} +4 -2
  60. package/dist/{data-Db1Iv9T0.mjs.map → data-DquNIEnQ.mjs.map} +1 -1
  61. package/dist/data-index.d.ts +8 -0
  62. package/dist/data-index.d.ts.map +1 -0
  63. package/dist/data-index.js +7 -0
  64. package/dist/data.d.ts +43 -0
  65. package/dist/data.d.ts.map +1 -0
  66. package/dist/data.js +103 -0
  67. package/dist/etag-utils.d.ts +77 -0
  68. package/dist/etag-utils.d.ts.map +1 -0
  69. package/dist/etag-utils.js +160 -0
  70. package/dist/filesystem-content-api-B1KIQJfk.mjs +2 -0
  71. package/dist/{filesystem-content-api-kxKY5IUw.mjs → filesystem-content-api-C0HIhqZi.mjs} +172 -1230
  72. package/dist/filesystem-content-api-C0HIhqZi.mjs.map +1 -0
  73. package/dist/{filesystem-content-api-C1TM0GLo.d.mts → filesystem-content-api-DCdNi-co.d.mts} +19 -4
  74. package/dist/filesystem-content-api-DCdNi-co.d.mts.map +1 -0
  75. package/dist/filesystem-content-api.d.ts +135 -0
  76. package/dist/filesystem-content-api.d.ts.map +1 -0
  77. package/dist/filesystem-content-api.js +2181 -0
  78. package/dist/git-operations.d.ts +49 -0
  79. package/dist/git-operations.d.ts.map +1 -0
  80. package/dist/git-operations.js +252 -0
  81. package/dist/header-parser.d.ts +37 -0
  82. package/dist/header-parser.d.ts.map +1 -0
  83. package/dist/header-parser.js +286 -0
  84. package/dist/in-memory-content-api.d.ts +35 -0
  85. package/dist/in-memory-content-api.d.ts.map +1 -0
  86. package/dist/in-memory-content-api.js +591 -0
  87. package/dist/index-DxVTFK66.d.mts +105 -0
  88. package/dist/index-DxVTFK66.d.mts.map +1 -0
  89. package/dist/index.d.mts +6 -5
  90. package/dist/index.d.mts.map +1 -1
  91. package/dist/index.d.ts +19 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +16 -0
  94. package/dist/index.mjs +37 -6
  95. package/dist/index.mjs.map +1 -1
  96. package/dist/indexing.d.mts +152 -0
  97. package/dist/indexing.d.mts.map +1 -0
  98. package/dist/indexing.d.ts +5 -0
  99. package/dist/indexing.d.ts.map +1 -0
  100. package/dist/indexing.js +7 -0
  101. package/dist/indexing.mjs +255 -0
  102. package/dist/indexing.mjs.map +1 -0
  103. package/dist/json-whitespace-view.d.ts +32 -0
  104. package/dist/json-whitespace-view.d.ts.map +1 -0
  105. package/dist/json-whitespace-view.js +152 -0
  106. package/dist/middleware.d.ts +20 -0
  107. package/dist/middleware.d.ts.map +1 -0
  108. package/dist/middleware.js +1031 -0
  109. package/dist/node.d.mts +10 -15
  110. package/dist/node.d.mts.map +1 -1
  111. package/dist/node.d.ts +25 -0
  112. package/dist/node.d.ts.map +1 -0
  113. package/dist/node.js +24 -0
  114. package/dist/node.mjs +89 -135
  115. package/dist/node.mjs.map +1 -1
  116. package/dist/reader.d.mts +5 -8
  117. package/dist/reader.d.mts.map +1 -1
  118. package/dist/reader.d.ts +15 -0
  119. package/dist/reader.d.ts.map +1 -0
  120. package/dist/reader.js +13 -0
  121. package/dist/reader.mjs +8 -8
  122. package/dist/reader.mjs.map +1 -1
  123. package/dist/schemas/index.d.mts +2 -90
  124. package/dist/schemas/index.d.ts +102 -0
  125. package/dist/schemas/index.d.ts.map +1 -0
  126. package/dist/schemas/index.js +87 -0
  127. package/dist/schemas/index.mjs +2 -70
  128. package/dist/schemas-CFRD0FIQ.mjs +84 -0
  129. package/dist/schemas-CFRD0FIQ.mjs.map +1 -0
  130. package/dist/{site-vNtJ5jCh.mjs → site-8oaj1Q60.mjs} +21 -193
  131. package/dist/site-8oaj1Q60.mjs.map +1 -0
  132. package/dist/site-index-B_254bCc.d.mts +136 -0
  133. package/dist/site-index-B_254bCc.d.mts.map +1 -0
  134. package/dist/site-index.d.ts +60 -0
  135. package/dist/site-index.d.ts.map +1 -0
  136. package/dist/site-index.js +287 -0
  137. package/dist/site.d.ts +21 -0
  138. package/dist/site.d.ts.map +1 -0
  139. package/dist/site.js +168 -0
  140. package/dist/{types-DWt912tu.mjs → types-DOdldbfD.mjs} +3 -2
  141. package/dist/types-DOdldbfD.mjs.map +1 -0
  142. package/dist/types-DjfhS272.d.mts +456 -0
  143. package/dist/types-DjfhS272.d.mts.map +1 -0
  144. package/dist/types.d.ts +453 -0
  145. package/dist/types.d.ts.map +1 -0
  146. package/dist/types.js +36 -0
  147. package/dist/url-safe-base64.d.ts +12 -0
  148. package/dist/url-safe-base64.d.ts.map +1 -0
  149. package/dist/url-safe-base64.js +40 -0
  150. package/dist/url-validation.d.ts +14 -0
  151. package/dist/url-validation.d.ts.map +1 -0
  152. package/dist/url-validation.js +81 -0
  153. package/dist/utils/atomic-write.d.ts +6 -0
  154. package/dist/utils/atomic-write.d.ts.map +1 -0
  155. package/dist/utils/atomic-write.js +20 -0
  156. package/dist/utils.d.ts +46 -0
  157. package/dist/utils.d.ts.map +1 -0
  158. package/dist/utils.js +70 -0
  159. package/dist/vite-plugin.d.ts +12 -0
  160. package/dist/vite-plugin.d.ts.map +1 -0
  161. package/dist/vite-plugin.js +29 -0
  162. package/dist/vxjson-qHrgLGip.mjs +555 -0
  163. package/dist/vxjson-qHrgLGip.mjs.map +1 -0
  164. package/dist/vxjson-serialize-geF6qvpn.mjs +34 -0
  165. package/dist/vxjson-serialize-geF6qvpn.mjs.map +1 -0
  166. package/dist/vxjson-serialize.d.mts +17 -0
  167. package/dist/vxjson-serialize.d.mts.map +1 -0
  168. package/dist/vxjson-serialize.d.ts +14 -0
  169. package/dist/vxjson-serialize.d.ts.map +1 -0
  170. package/dist/vxjson-serialize.js +50 -0
  171. package/dist/vxjson-serialize.mjs +2 -0
  172. package/dist/vxjson.d.ts +112 -0
  173. package/dist/vxjson.d.ts.map +1 -0
  174. package/dist/vxjson.js +391 -0
  175. package/dist/xxhash.d.ts +10 -0
  176. package/dist/xxhash.d.ts.map +1 -0
  177. package/dist/xxhash.js +31 -0
  178. package/package.json +79 -17
  179. package/dist/component-registry.types-CBGONnYn.d.mts.map +0 -1
  180. package/dist/content-operations-Dv67amz3.d.mts +0 -852
  181. package/dist/content-operations-Dv67amz3.d.mts.map +0 -1
  182. package/dist/filesystem-content-api-C1TM0GLo.d.mts.map +0 -1
  183. package/dist/filesystem-content-api-kxKY5IUw.mjs.map +0 -1
  184. package/dist/schemas/index.d.mts.map +0 -1
  185. package/dist/schemas/index.mjs.map +0 -1
  186. package/dist/site-vNtJ5jCh.mjs.map +0 -1
  187. package/dist/types-DWt912tu.mjs.map +0 -1
package/dist/reader.d.mts CHANGED
@@ -1,11 +1,8 @@
1
- import { $ as ErrorCode, A as Site, B as ContentListResult, C as mapSiteNames, D as serializeMdxWithFrontmatter, E as resolvePublishDate, F as BlockFilters, G as CreateBlockInput, H as ContentMeta, I as ContentAPIOptions, J as CreateResult, K as CreateContentInput, L as ContentData, M as APIError, N as BatchOperationResult, O as Blocks, P as BatchResult, Q as DeleteResult, R as ContentEntry, S as mapLocales, T as parseDate, U as ContentProp, V as ContentManifest, W as ContentType, X as DataContext, Y as DataCollectionEntry, Z as DeleteLocaleInput, _ as isContentPublished, _t as VXJSONFile, a as analyzeUpdateScope, at as LocaleUpdateData, b as isValidPathname, c as shouldUpdateModifiedTimestamp, ct as LocalizedManifest, d as validateCreateContent, dt as MoveResult, et as ErrorCodes, f as extractBlockName, ft as PageReference, g as getMetadataSize, gt as UpdateResult, h as getCurrentISODate, ht as UpdateLocaleInput, i as ValidationResult, it as LocalePathData, j as Data, k as ContentAPI, l as updatePublishDates, lt as MDXCompileResponse, m as generateContentId, mt as SitesConfig, n as UPDATE_SCOPE, nt as GlobalFilters, o as buildLocaleVersion, ot as LocaleVersion, p as formatFileSize, pt as SiteFilters, q as CreatePageInput, r as UpdateScope, rt as LocaleFileData, s as buildPathnameHistory, st as LocalizedEntry, t as CreateValidationResult, tt as FindOptions, u as validateAndPrepareMetadata, ut as MDXFrontmatter, v as isMetadataTooLarge, vt as WriteResult, w as normalizePathname, x as localesOf, y as isValidBlockName, z as ContentIdentity } from "./content-operations-Dv67amz3.mjs";
2
- import { t as FileSystemContentAPI } from "./filesystem-content-api-C1TM0GLo.mjs";
3
-
1
+ import { A as LocalizedEntry, B as VXJSONFile, C as ErrorCodes, D as LocalePathData, E as LocaleFileData, F as PageReference, I as SiteFilters, L as SitesConfig, M as MDXCompileResponse, N as MDXFrontmatter, O as LocaleUpdateData, P as MoveResult, R as UpdateLocaleInput, S as ErrorCode, T as GlobalFilters, V as WriteResult, _ as CreateResult, a as ContentAPIOptions, b as DeleteLocaleInput, c as ContentIdentity, d as ContentMeta, f as ContentProp, g as CreatePageInput, h as CreateContentInput, i as BlockFilters, j as LocalizedManifest, k as LocaleVersion, l as ContentListResult, m as CreateBlockInput, n as BatchOperationResult, o as ContentData, p as ContentType, r as BatchResult, s as ContentEntry, t as APIError, u as ContentManifest, v as DataCollectionEntry, w as FindOptions, x as DeleteResult, y as DataContext, z as UpdateResult } from "./types-DjfhS272.mjs";
2
+ import { A as serializeMdxWithFrontmatter, C as localesOf, D as normalizePathname, E as normalizeAndValidatePathname, M as ContentAPI, N as Site, O as parseDate, P as Data, S as isValidPathname, T as mapSiteNames, _ as getCurrentISODate, a as analyzeUpdateScope, b as isMetadataTooLarge, c as shouldUpdateModifiedTimestamp, d as validateCreateContent, f as PathnameValidationReason, g as generateContentId, h as formatFileSize, i as ValidationResult, j as Blocks, k as resolvePublishDate, l as updatePublishDates, m as extractBlockName, n as UPDATE_SCOPE, o as buildLocaleVersion, p as PathnameValidationResult, r as UpdateScope, s as buildPathnameHistory, t as CreateValidationResult, u as validateAndPrepareMetadata, v as getMetadataSize, w as mapLocales, x as isValidBlockName, y as isContentPublished } from "./content-operations-DIbsxG5A.mjs";
3
+ import { t as FileSystemContentAPI } from "./filesystem-content-api-DCdNi-co.mjs";
4
4
  //#region src/content-reader.d.ts
5
- interface ContentReaderOptions {
6
- contentRoot: string;
7
- canvasDir?: string;
8
- }
5
+ type ContentReaderOptions = ContentAPIOptions;
9
6
  /**
10
7
  * Creates a read-oriented content API instance for build-time consumers.
11
8
  *
@@ -14,5 +11,5 @@ interface ContentReaderOptions {
14
11
  */
15
12
  declare function createContentAPI(options: ContentReaderOptions): Promise<FileSystemContentAPI>;
16
13
  //#endregion
17
- export { APIError, BatchOperationResult, BatchResult, BlockFilters, Blocks, type ContentAPI, ContentAPIOptions, ContentData, ContentEntry, ContentIdentity, ContentListResult, ContentManifest, ContentMeta, ContentProp, ContentType, CreateBlockInput, CreateContentInput, CreatePageInput, CreateResult, CreateValidationResult, Data, DataCollectionEntry, DataContext, DeleteLocaleInput, DeleteResult, ErrorCode, ErrorCodes, FindOptions, GlobalFilters, LocaleFileData, LocalePathData, LocaleUpdateData, LocaleVersion, LocalizedEntry, LocalizedManifest, MDXCompileResponse, MDXFrontmatter, MoveResult, PageReference, Site, SiteFilters, SitesConfig, UPDATE_SCOPE, UpdateLocaleInput, UpdateResult, UpdateScope, VXJSONFile, ValidationResult, WriteResult, analyzeUpdateScope, buildLocaleVersion, buildPathnameHistory, createContentAPI, extractBlockName, formatFileSize, generateContentId, getCurrentISODate, getMetadataSize, isContentPublished, isMetadataTooLarge, isValidBlockName, isValidPathname, localesOf, mapLocales, mapSiteNames, normalizePathname, parseDate, resolvePublishDate, serializeMdxWithFrontmatter, shouldUpdateModifiedTimestamp, updatePublishDates, validateAndPrepareMetadata, validateCreateContent };
14
+ export { APIError, BatchOperationResult, BatchResult, BlockFilters, Blocks, type ContentAPI, ContentAPIOptions, ContentData, ContentEntry, ContentIdentity, ContentListResult, ContentManifest, ContentMeta, ContentProp, ContentType, CreateBlockInput, CreateContentInput, CreatePageInput, CreateResult, CreateValidationResult, Data, DataCollectionEntry, DataContext, DeleteLocaleInput, DeleteResult, ErrorCode, ErrorCodes, FindOptions, GlobalFilters, LocaleFileData, LocalePathData, LocaleUpdateData, LocaleVersion, LocalizedEntry, LocalizedManifest, MDXCompileResponse, MDXFrontmatter, MoveResult, PageReference, PathnameValidationReason, PathnameValidationResult, Site, SiteFilters, SitesConfig, UPDATE_SCOPE, UpdateLocaleInput, UpdateResult, UpdateScope, VXJSONFile, ValidationResult, WriteResult, analyzeUpdateScope, buildLocaleVersion, buildPathnameHistory, createContentAPI, extractBlockName, formatFileSize, generateContentId, getCurrentISODate, getMetadataSize, isContentPublished, isMetadataTooLarge, isValidBlockName, isValidPathname, localesOf, mapLocales, mapSiteNames, normalizeAndValidatePathname, normalizePathname, parseDate, resolvePublishDate, serializeMdxWithFrontmatter, shouldUpdateModifiedTimestamp, updatePublishDates, validateAndPrepareMetadata, validateCreateContent };
18
15
  //# sourceMappingURL=reader.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reader.d.mts","names":[],"sources":["../src/content-reader.ts"],"mappings":";;;;UAAiB,oBAAA;EACf,WAAA;EACA,SAAA;AAAA;AAFF;;;;;AAWA;AAXA,iBAWsB,gBAAA,CAAiB,OAAA,EAAS,oBAAA,GAAoB,OAAA,CAAA,oBAAA"}
1
+ {"version":3,"file":"reader.d.mts","names":[],"sources":["../src/content-reader.ts"],"mappings":";;;;KAEY,uBAAuB;;;;;;;iBAQb,iBAAiB,SAAS,uBAAoB,QAApB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Read-only Node.js exports for @conloca/content-api.
3
+ *
4
+ * Intended for static/build-time consumers that need content discovery and reads
5
+ * without importing the full server barrel.
6
+ */
7
+ export { Blocks } from './blocks';
8
+ export type { ContentAPI } from './content-api.interface';
9
+ export * from './content-operations';
10
+ export { createContentAPI } from './content-reader';
11
+ export * from './content-utils';
12
+ export { Data } from './data';
13
+ export { Site } from './site';
14
+ export * from './types';
15
+ //# sourceMappingURL=reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../src/reader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,cAAc,SAAS,CAAC"}
package/dist/reader.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Read-only Node.js exports for @conloca/content-api.
3
+ *
4
+ * Intended for static/build-time consumers that need content discovery and reads
5
+ * without importing the full server barrel.
6
+ */
7
+ export { Blocks } from './blocks';
8
+ export * from './content-operations';
9
+ export { createContentAPI } from './content-reader';
10
+ export * from './content-utils';
11
+ export { Data } from './data';
12
+ export { Site } from './site';
13
+ export * from './types';
package/dist/reader.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { C as parseDate, E as Blocks, S as normalizePathname, T as serializeMdxWithFrontmatter, _ as isValidBlockName, a as buildPathnameHistory, b as mapLocales, c as validateAndPrepareMetadata, d as formatFileSize, f as generateContentId, g as isMetadataTooLarge, h as isContentPublished, i as buildLocaleVersion, l as validateCreateContent, m as getMetadataSize, n as UPDATE_SCOPE, o as shouldUpdateModifiedTimestamp, p as getCurrentISODate, r as analyzeUpdateScope, s as updatePublishDates, t as Site, u as extractBlockName, v as isValidPathname, w as resolvePublishDate, x as mapSiteNames, y as localesOf } from "./site-vNtJ5jCh.mjs";
2
- import { t as ErrorCodes } from "./types-DWt912tu.mjs";
3
- import { t as Data } from "./data-Db1Iv9T0.mjs";
4
-
1
+ import { a as buildPathnameHistory, c as validateAndPrepareMetadata, i as buildLocaleVersion, l as validateCreateContent, n as UPDATE_SCOPE, o as shouldUpdateModifiedTimestamp, r as analyzeUpdateScope, s as updatePublishDates, t as Site, u as Blocks } from "./site-8oaj1Q60.mjs";
2
+ import { _ as serializeMdxWithFrontmatter, a as getMetadataSize, c as isValidBlockName, d as mapLocales, f as mapSiteNames, g as resolvePublishDate, h as parseDate, i as getCurrentISODate, l as isValidPathname, m as normalizePathname, n as formatFileSize, o as isContentPublished, p as normalizeAndValidatePathname, r as generateContentId, s as isMetadataTooLarge, t as extractBlockName, u as localesOf } from "./content-utils-fWNHTrPy.mjs";
3
+ import { t as ErrorCodes } from "./types-DOdldbfD.mjs";
4
+ import { t as Data } from "./data-DquNIEnQ.mjs";
5
5
  //#region src/content-reader.ts
6
6
  /**
7
7
  * Creates a read-oriented content API instance for build-time consumers.
@@ -10,13 +10,13 @@ import { t as Data } from "./data-Db1Iv9T0.mjs";
10
10
  * eagerly traverse native hashing dependencies through the reader entrypoint.
11
11
  */
12
12
  async function createContentAPI(options) {
13
- const { FileSystemContentAPI: ReaderAPI } = await import("./filesystem-content-api-kxKY5IUw.mjs").then((n) => n.n);
13
+ const { FileSystemContentAPI: ReaderAPI } = await import("./filesystem-content-api-B1KIQJfk.mjs");
14
14
  return ReaderAPI.create({
15
- contentRoot: options.contentRoot,
15
+ ...options,
16
16
  canvasDir: options.canvasDir || "./canvas"
17
17
  });
18
18
  }
19
-
20
19
  //#endregion
21
- export { Blocks, Data, ErrorCodes, Site, UPDATE_SCOPE, analyzeUpdateScope, buildLocaleVersion, buildPathnameHistory, createContentAPI, extractBlockName, formatFileSize, generateContentId, getCurrentISODate, getMetadataSize, isContentPublished, isMetadataTooLarge, isValidBlockName, isValidPathname, localesOf, mapLocales, mapSiteNames, normalizePathname, parseDate, resolvePublishDate, serializeMdxWithFrontmatter, shouldUpdateModifiedTimestamp, updatePublishDates, validateAndPrepareMetadata, validateCreateContent };
20
+ export { Blocks, Data, ErrorCodes, Site, UPDATE_SCOPE, analyzeUpdateScope, buildLocaleVersion, buildPathnameHistory, createContentAPI, extractBlockName, formatFileSize, generateContentId, getCurrentISODate, getMetadataSize, isContentPublished, isMetadataTooLarge, isValidBlockName, isValidPathname, localesOf, mapLocales, mapSiteNames, normalizeAndValidatePathname, normalizePathname, parseDate, resolvePublishDate, serializeMdxWithFrontmatter, shouldUpdateModifiedTimestamp, updatePublishDates, validateAndPrepareMetadata, validateCreateContent };
21
+
22
22
  //# sourceMappingURL=reader.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reader.mjs","names":[],"sources":["../src/content-reader.ts"],"sourcesContent":["export interface ContentReaderOptions {\n contentRoot: string;\n canvasDir?: string;\n}\n\n/**\n * Creates a read-oriented content API instance for build-time consumers.\n *\n * The filesystem implementation is loaded lazily so build tooling does not\n * eagerly traverse native hashing dependencies through the reader entrypoint.\n */\nexport async function createContentAPI(options: ContentReaderOptions) {\n const { FileSystemContentAPI: ReaderAPI } = await import('./filesystem-content-api');\n\n return ReaderAPI.create({\n contentRoot: options.contentRoot,\n canvasDir: options.canvasDir || './canvas',\n });\n}\n"],"mappings":";;;;;;;;;;;AAWA,eAAsB,iBAAiB,SAA+B;CACpE,MAAM,EAAE,sBAAsB,cAAc,MAAM,OAAO;AAEzD,QAAO,UAAU,OAAO;EACtB,aAAa,QAAQ;EACrB,WAAW,QAAQ,aAAa;EACjC,CAAC"}
1
+ {"version":3,"file":"reader.mjs","names":[],"sources":["../src/content-reader.ts"],"sourcesContent":["import type { ContentAPIOptions } from './types';\n\nexport type ContentReaderOptions = ContentAPIOptions;\n\n/**\n * Creates a read-oriented content API instance for build-time consumers.\n *\n * The filesystem implementation is loaded lazily so build tooling does not\n * eagerly traverse native hashing dependencies through the reader entrypoint.\n */\nexport async function createContentAPI(options: ContentReaderOptions) {\n const { FileSystemContentAPI: ReaderAPI } = await import('./filesystem-content-api');\n\n return ReaderAPI.create({\n ...options,\n canvasDir: options.canvasDir || './canvas',\n });\n}\n"],"mappings":";;;;;;;;;;;AAUA,eAAsB,iBAAiB,SAA+B;CACpE,MAAM,EAAE,sBAAsB,cAAc,MAAM,OAAO;CAEzD,OAAO,UAAU,OAAO;EACtB,GAAG;EACH,WAAW,QAAQ,aAAa;CAClC,CAAC;AACH"}
@@ -1,90 +1,2 @@
1
- import { z } from "zod";
2
-
3
- //#region src/schemas/index.d.ts
4
- /**
5
- * Base schema for page metadata - editable fields only.
6
- * Used by CMS forms for dynamic form generation.
7
- * Add .describe() for form field labels/hints.
8
- */
9
- declare const pageEditableSchema: z.ZodObject<{
10
- title: z.ZodString;
11
- description: z.ZodOptional<z.ZodString>;
12
- pathname: z.ZodString;
13
- publishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
14
- unpublishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
15
- robots: z.ZodOptional<z.ZodString>;
16
- canonical: z.ZodOptional<z.ZodString>;
17
- }, z.core.$strip>;
18
- type PageEditable = z.infer<typeof pageEditableSchema>;
19
- /**
20
- * Full page schema with system fields.
21
- * Used by Astro Content Collections for validation.
22
- */
23
- declare const pageMetaSchema: z.ZodObject<{
24
- title: z.ZodString;
25
- description: z.ZodOptional<z.ZodString>;
26
- pathname: z.ZodString;
27
- publishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
28
- unpublishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
29
- robots: z.ZodOptional<z.ZodString>;
30
- canonical: z.ZodOptional<z.ZodString>;
31
- id: z.ZodString;
32
- locale: z.ZodString;
33
- }, z.core.$strip>;
34
- type PageMeta = z.infer<typeof pageMetaSchema>;
35
- /**
36
- * Base schema for block metadata - editable fields only.
37
- * Used by CMS forms for dynamic form generation.
38
- * Add .describe() for form field labels/hints.
39
- */
40
- declare const blockEditableSchema: z.ZodObject<{
41
- title: z.ZodString;
42
- description: z.ZodOptional<z.ZodString>;
43
- category: z.ZodOptional<z.ZodString>;
44
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
- }, z.core.$strip>;
46
- type BlockEditable = z.infer<typeof blockEditableSchema>;
47
- /**
48
- * Full block schema with system fields.
49
- * Used by Astro Content Collections for validation.
50
- */
51
- declare const blockMetaSchema: z.ZodObject<{
52
- title: z.ZodString;
53
- description: z.ZodOptional<z.ZodString>;
54
- category: z.ZodOptional<z.ZodString>;
55
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
- id: z.ZodString;
57
- locale: z.ZodString;
58
- name: z.ZodString;
59
- }, z.core.$strip>;
60
- type BlockMeta = z.infer<typeof blockMetaSchema>;
61
- /**
62
- * Base schema for data entry metadata - editable fields only.
63
- * Used by CMS forms for dynamic form generation.
64
- * Add .describe() for form field labels/hints.
65
- */
66
- declare const dataEditableSchema: z.ZodObject<{
67
- title: z.ZodString;
68
- description: z.ZodOptional<z.ZodString>;
69
- category: z.ZodOptional<z.ZodString>;
70
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
- }, z.core.$strip>;
72
- type DataEditable = z.infer<typeof dataEditableSchema>;
73
- /**
74
- * Zod schema for data entry metadata.
75
- * Covers common organizational fields for structured data collections.
76
- */
77
- declare const dataMetaSchema: z.ZodObject<{
78
- title: z.ZodString;
79
- description: z.ZodOptional<z.ZodString>;
80
- category: z.ZodOptional<z.ZodString>;
81
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
- id: z.ZodString;
83
- locale: z.ZodString;
84
- name: z.ZodString;
85
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
86
- }, z.core.$strip>;
87
- type DataMeta = z.infer<typeof dataMetaSchema>;
88
- //#endregion
89
- export { BlockEditable, BlockMeta, DataEditable, DataMeta, PageEditable, PageMeta, blockEditableSchema, blockMetaSchema, dataEditableSchema, dataMetaSchema, pageEditableSchema, pageMetaSchema };
90
- //# sourceMappingURL=index.d.mts.map
1
+ import { a as MdxPageFrontmatter, c as blockEditableSchema, d as dataMetaSchema, f as mdxPageFrontmatterSchema, i as DataMeta, l as blockMetaSchema, m as pageMetaSchema, n as BlockMeta, o as PageEditable, p as pageEditableSchema, r as DataEditable, s as PageMeta, t as BlockEditable, u as dataEditableSchema } from "../index-DxVTFK66.mjs";
2
+ export { BlockEditable, BlockMeta, DataEditable, DataMeta, MdxPageFrontmatter, PageEditable, PageMeta, blockEditableSchema, blockMetaSchema, dataEditableSchema, dataMetaSchema, mdxPageFrontmatterSchema, pageEditableSchema, pageMetaSchema };
@@ -0,0 +1,102 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Base schema for page metadata - editable fields only.
4
+ * Used by CMS forms for dynamic form generation.
5
+ * Add .describe() for form field labels/hints.
6
+ */
7
+ export declare const pageEditableSchema: z.ZodObject<{
8
+ title: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ pathname: z.ZodString;
11
+ publishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
12
+ unpublishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
13
+ robots: z.ZodOptional<z.ZodString>;
14
+ canonical: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ export type PageEditable = z.infer<typeof pageEditableSchema>;
17
+ /**
18
+ * Full page schema with system fields.
19
+ * Used by Astro Content Collections for validation.
20
+ */
21
+ export declare const pageMetaSchema: z.ZodObject<{
22
+ title: z.ZodString;
23
+ description: z.ZodOptional<z.ZodString>;
24
+ pathname: z.ZodString;
25
+ publishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
26
+ unpublishAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
27
+ robots: z.ZodOptional<z.ZodString>;
28
+ canonical: z.ZodOptional<z.ZodString>;
29
+ id: z.ZodString;
30
+ locale: z.ZodString;
31
+ }, z.core.$strip>;
32
+ export type PageMeta = z.infer<typeof pageMetaSchema>;
33
+ /**
34
+ * Base schema for block metadata - editable fields only.
35
+ * Used by CMS forms for dynamic form generation.
36
+ * Add .describe() for form field labels/hints.
37
+ */
38
+ export declare const blockEditableSchema: z.ZodObject<{
39
+ title: z.ZodString;
40
+ description: z.ZodOptional<z.ZodString>;
41
+ category: z.ZodOptional<z.ZodString>;
42
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
+ }, z.core.$strip>;
44
+ export type BlockEditable = z.infer<typeof blockEditableSchema>;
45
+ /**
46
+ * Full block schema with system fields.
47
+ * Used by Astro Content Collections for validation.
48
+ */
49
+ export declare const blockMetaSchema: z.ZodObject<{
50
+ title: z.ZodString;
51
+ description: z.ZodOptional<z.ZodString>;
52
+ category: z.ZodOptional<z.ZodString>;
53
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ id: z.ZodString;
55
+ locale: z.ZodString;
56
+ name: z.ZodString;
57
+ }, z.core.$strip>;
58
+ export type BlockMeta = z.infer<typeof blockMetaSchema>;
59
+ /**
60
+ * Base schema for mdx-type page frontmatter — renderer-neutral.
61
+ *
62
+ * Default for the CMS form when editing an mdx page; projects override via
63
+ * `mdxPages.schema` when they want a renderer-specific shape (e.g. an
64
+ * Astro-collection schema with extra fields).
65
+ *
66
+ * Permissive on purpose: `.passthrough()` lets unknown frontmatter keys flow
67
+ * through unchanged so the file's existing fields are never lost on save.
68
+ */
69
+ export declare const mdxPageFrontmatterSchema: z.ZodObject<{
70
+ title: z.ZodString;
71
+ description: z.ZodOptional<z.ZodString>;
72
+ draft: z.ZodOptional<z.ZodBoolean>;
73
+ }, z.core.$loose>;
74
+ export type MdxPageFrontmatter = z.infer<typeof mdxPageFrontmatterSchema>;
75
+ /**
76
+ * Base schema for data entry metadata - editable fields only.
77
+ * Used by CMS forms for dynamic form generation.
78
+ * Add .describe() for form field labels/hints.
79
+ */
80
+ export declare const dataEditableSchema: z.ZodObject<{
81
+ title: z.ZodString;
82
+ description: z.ZodOptional<z.ZodString>;
83
+ category: z.ZodOptional<z.ZodString>;
84
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ }, z.core.$strip>;
86
+ export type DataEditable = z.infer<typeof dataEditableSchema>;
87
+ /**
88
+ * Zod schema for data entry metadata.
89
+ * Covers common organizational fields for structured data collections.
90
+ */
91
+ export declare const dataMetaSchema: z.ZodObject<{
92
+ title: z.ZodString;
93
+ description: z.ZodOptional<z.ZodString>;
94
+ category: z.ZodOptional<z.ZodString>;
95
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ id: z.ZodString;
97
+ locale: z.ZodString;
98
+ name: z.ZodString;
99
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
100
+ }, z.core.$strip>;
101
+ export type DataMeta = z.infer<typeof dataMetaSchema>;
102
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;iBAQ7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;iBAGzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAItD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;iBAI1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;iBAMrB,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;iBAQzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { z } from 'zod';
2
+ // ===== Page Schemas =====
3
+ /**
4
+ * Base schema for page metadata - editable fields only.
5
+ * Used by CMS forms for dynamic form generation.
6
+ * Add .describe() for form field labels/hints.
7
+ */
8
+ export const pageEditableSchema = z.object({
9
+ title: z.string().describe('Page title for SEO and browser tab'),
10
+ description: z.string().optional().describe('Meta description for search engines'),
11
+ pathname: z.string().describe('URL path (e.g., /about)'),
12
+ publishAt: z.coerce.date().nullable().optional().describe('Schedule publish date/time'),
13
+ unpublishAt: z.coerce.date().nullable().optional().describe('Schedule unpublish date/time'),
14
+ robots: z.string().optional().describe('Robots meta tag (e.g., index, follow)'),
15
+ canonical: z.string().url().optional().describe('Canonical URL for duplicate content'),
16
+ });
17
+ /**
18
+ * Full page schema with system fields.
19
+ * Used by Astro Content Collections for validation.
20
+ */
21
+ export const pageMetaSchema = pageEditableSchema.extend({
22
+ id: z.string(),
23
+ locale: z.string(),
24
+ });
25
+ // ===== Block Schemas =====
26
+ /**
27
+ * Base schema for block metadata - editable fields only.
28
+ * Used by CMS forms for dynamic form generation.
29
+ * Add .describe() for form field labels/hints.
30
+ */
31
+ export const blockEditableSchema = z.object({
32
+ title: z.string().describe('Display name for the block'),
33
+ description: z.string().optional().describe('Brief description of this block'),
34
+ category: z.string().optional().describe('Category for organizing blocks (e.g., headers, cta, content)'),
35
+ tags: z.array(z.string()).optional().describe('Tags for filtering and organization'),
36
+ });
37
+ /**
38
+ * Full block schema with system fields.
39
+ * Used by Astro Content Collections for validation.
40
+ */
41
+ export const blockMetaSchema = blockEditableSchema.extend({
42
+ id: z.string(),
43
+ locale: z.string(),
44
+ name: z.string(),
45
+ });
46
+ // ===== MDX Page Schemas =====
47
+ /**
48
+ * Base schema for mdx-type page frontmatter — renderer-neutral.
49
+ *
50
+ * Default for the CMS form when editing an mdx page; projects override via
51
+ * `mdxPages.schema` when they want a renderer-specific shape (e.g. an
52
+ * Astro-collection schema with extra fields).
53
+ *
54
+ * Permissive on purpose: `.passthrough()` lets unknown frontmatter keys flow
55
+ * through unchanged so the file's existing fields are never lost on save.
56
+ */
57
+ export const mdxPageFrontmatterSchema = z
58
+ .object({
59
+ title: z.string().describe('Page title for SEO and browser tab'),
60
+ description: z.string().optional().describe('Meta description for search engines'),
61
+ draft: z.boolean().optional().describe('Hide the page from production builds'),
62
+ })
63
+ .passthrough();
64
+ // ===== Data Schemas =====
65
+ /**
66
+ * Base schema for data entry metadata - editable fields only.
67
+ * Used by CMS forms for dynamic form generation.
68
+ * Add .describe() for form field labels/hints.
69
+ */
70
+ export const dataEditableSchema = z.object({
71
+ title: z.string().describe('Display name for the entry'),
72
+ description: z.string().optional().describe('Brief description of this entry'),
73
+ category: z.string().optional().describe('Category for organizing entries'),
74
+ tags: z.array(z.string()).optional().describe('Tags for filtering and organization'),
75
+ });
76
+ /**
77
+ * Zod schema for data entry metadata.
78
+ * Covers common organizational fields for structured data collections.
79
+ */
80
+ export const dataMetaSchema = dataEditableSchema.extend({
81
+ // System fields (added by loader)
82
+ id: z.string(),
83
+ locale: z.string(),
84
+ name: z.string(),
85
+ // Actual data content (arbitrary JSON structure)
86
+ data: z.record(z.string(), z.unknown()).optional(),
87
+ });
@@ -1,70 +1,2 @@
1
- import { z } from "zod";
2
-
3
- //#region src/schemas/index.ts
4
- /**
5
- * Base schema for page metadata - editable fields only.
6
- * Used by CMS forms for dynamic form generation.
7
- * Add .describe() for form field labels/hints.
8
- */
9
- const pageEditableSchema = z.object({
10
- title: z.string().describe("Page title for SEO and browser tab"),
11
- description: z.string().optional().describe("Meta description for search engines"),
12
- pathname: z.string().describe("URL path (e.g., /about)"),
13
- publishAt: z.coerce.date().nullable().optional().describe("Schedule publish date/time"),
14
- unpublishAt: z.coerce.date().nullable().optional().describe("Schedule unpublish date/time"),
15
- robots: z.string().optional().describe("Robots meta tag (e.g., index, follow)"),
16
- canonical: z.string().url().optional().describe("Canonical URL for duplicate content")
17
- });
18
- /**
19
- * Full page schema with system fields.
20
- * Used by Astro Content Collections for validation.
21
- */
22
- const pageMetaSchema = pageEditableSchema.extend({
23
- id: z.string(),
24
- locale: z.string()
25
- });
26
- /**
27
- * Base schema for block metadata - editable fields only.
28
- * Used by CMS forms for dynamic form generation.
29
- * Add .describe() for form field labels/hints.
30
- */
31
- const blockEditableSchema = z.object({
32
- title: z.string().describe("Display name for the block"),
33
- description: z.string().optional().describe("Brief description of this block"),
34
- category: z.string().optional().describe("Category for organizing blocks (e.g., headers, cta, content)"),
35
- tags: z.array(z.string()).optional().describe("Tags for filtering and organization")
36
- });
37
- /**
38
- * Full block schema with system fields.
39
- * Used by Astro Content Collections for validation.
40
- */
41
- const blockMetaSchema = blockEditableSchema.extend({
42
- id: z.string(),
43
- locale: z.string(),
44
- name: z.string()
45
- });
46
- /**
47
- * Base schema for data entry metadata - editable fields only.
48
- * Used by CMS forms for dynamic form generation.
49
- * Add .describe() for form field labels/hints.
50
- */
51
- const dataEditableSchema = z.object({
52
- title: z.string().describe("Display name for the entry"),
53
- description: z.string().optional().describe("Brief description of this entry"),
54
- category: z.string().optional().describe("Category for organizing entries"),
55
- tags: z.array(z.string()).optional().describe("Tags for filtering and organization")
56
- });
57
- /**
58
- * Zod schema for data entry metadata.
59
- * Covers common organizational fields for structured data collections.
60
- */
61
- const dataMetaSchema = dataEditableSchema.extend({
62
- id: z.string(),
63
- locale: z.string(),
64
- name: z.string(),
65
- data: z.record(z.string(), z.unknown()).optional()
66
- });
67
-
68
- //#endregion
69
- export { blockEditableSchema, blockMetaSchema, dataEditableSchema, dataMetaSchema, pageEditableSchema, pageMetaSchema };
70
- //# sourceMappingURL=index.mjs.map
1
+ import { a as mdxPageFrontmatterSchema, i as dataMetaSchema, n as blockMetaSchema, o as pageEditableSchema, r as dataEditableSchema, s as pageMetaSchema, t as blockEditableSchema } from "../schemas-CFRD0FIQ.mjs";
2
+ export { blockEditableSchema, blockMetaSchema, dataEditableSchema, dataMetaSchema, mdxPageFrontmatterSchema, pageEditableSchema, pageMetaSchema };
@@ -0,0 +1,84 @@
1
+ import { z } from "zod";
2
+ //#region src/schemas/index.ts
3
+ /**
4
+ * Base schema for page metadata - editable fields only.
5
+ * Used by CMS forms for dynamic form generation.
6
+ * Add .describe() for form field labels/hints.
7
+ */
8
+ const pageEditableSchema = z.object({
9
+ title: z.string().describe("Page title for SEO and browser tab"),
10
+ description: z.string().optional().describe("Meta description for search engines"),
11
+ pathname: z.string().describe("URL path (e.g., /about)"),
12
+ publishAt: z.coerce.date().nullable().optional().describe("Schedule publish date/time"),
13
+ unpublishAt: z.coerce.date().nullable().optional().describe("Schedule unpublish date/time"),
14
+ robots: z.string().optional().describe("Robots meta tag (e.g., index, follow)"),
15
+ canonical: z.string().url().optional().describe("Canonical URL for duplicate content")
16
+ });
17
+ /**
18
+ * Full page schema with system fields.
19
+ * Used by Astro Content Collections for validation.
20
+ */
21
+ const pageMetaSchema = pageEditableSchema.extend({
22
+ id: z.string(),
23
+ locale: z.string()
24
+ });
25
+ /**
26
+ * Base schema for block metadata - editable fields only.
27
+ * Used by CMS forms for dynamic form generation.
28
+ * Add .describe() for form field labels/hints.
29
+ */
30
+ const blockEditableSchema = z.object({
31
+ title: z.string().describe("Display name for the block"),
32
+ description: z.string().optional().describe("Brief description of this block"),
33
+ category: z.string().optional().describe("Category for organizing blocks (e.g., headers, cta, content)"),
34
+ tags: z.array(z.string()).optional().describe("Tags for filtering and organization")
35
+ });
36
+ /**
37
+ * Full block schema with system fields.
38
+ * Used by Astro Content Collections for validation.
39
+ */
40
+ const blockMetaSchema = blockEditableSchema.extend({
41
+ id: z.string(),
42
+ locale: z.string(),
43
+ name: z.string()
44
+ });
45
+ /**
46
+ * Base schema for mdx-type page frontmatter — renderer-neutral.
47
+ *
48
+ * Default for the CMS form when editing an mdx page; projects override via
49
+ * `mdxPages.schema` when they want a renderer-specific shape (e.g. an
50
+ * Astro-collection schema with extra fields).
51
+ *
52
+ * Permissive on purpose: `.passthrough()` lets unknown frontmatter keys flow
53
+ * through unchanged so the file's existing fields are never lost on save.
54
+ */
55
+ const mdxPageFrontmatterSchema = z.object({
56
+ title: z.string().describe("Page title for SEO and browser tab"),
57
+ description: z.string().optional().describe("Meta description for search engines"),
58
+ draft: z.boolean().optional().describe("Hide the page from production builds")
59
+ }).passthrough();
60
+ /**
61
+ * Base schema for data entry metadata - editable fields only.
62
+ * Used by CMS forms for dynamic form generation.
63
+ * Add .describe() for form field labels/hints.
64
+ */
65
+ const dataEditableSchema = z.object({
66
+ title: z.string().describe("Display name for the entry"),
67
+ description: z.string().optional().describe("Brief description of this entry"),
68
+ category: z.string().optional().describe("Category for organizing entries"),
69
+ tags: z.array(z.string()).optional().describe("Tags for filtering and organization")
70
+ });
71
+ /**
72
+ * Zod schema for data entry metadata.
73
+ * Covers common organizational fields for structured data collections.
74
+ */
75
+ const dataMetaSchema = dataEditableSchema.extend({
76
+ id: z.string(),
77
+ locale: z.string(),
78
+ name: z.string(),
79
+ data: z.record(z.string(), z.unknown()).optional()
80
+ });
81
+ //#endregion
82
+ export { mdxPageFrontmatterSchema as a, dataMetaSchema as i, blockMetaSchema as n, pageEditableSchema as o, dataEditableSchema as r, pageMetaSchema as s, blockEditableSchema as t };
83
+
84
+ //# sourceMappingURL=schemas-CFRD0FIQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-CFRD0FIQ.mjs","names":[],"sources":["../src/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n// ===== Page Schemas =====\n\n/**\n * Base schema for page metadata - editable fields only.\n * Used by CMS forms for dynamic form generation.\n * Add .describe() for form field labels/hints.\n */\nexport const pageEditableSchema = z.object({\n title: z.string().describe('Page title for SEO and browser tab'),\n description: z.string().optional().describe('Meta description for search engines'),\n pathname: z.string().describe('URL path (e.g., /about)'),\n publishAt: z.coerce.date().nullable().optional().describe('Schedule publish date/time'),\n unpublishAt: z.coerce.date().nullable().optional().describe('Schedule unpublish date/time'),\n robots: z.string().optional().describe('Robots meta tag (e.g., index, follow)'),\n canonical: z.string().url().optional().describe('Canonical URL for duplicate content'),\n});\n\nexport type PageEditable = z.infer<typeof pageEditableSchema>;\n\n/**\n * Full page schema with system fields.\n * Used by Astro Content Collections for validation.\n */\nexport const pageMetaSchema = pageEditableSchema.extend({\n id: z.string(),\n locale: z.string(),\n});\n\nexport type PageMeta = z.infer<typeof pageMetaSchema>;\n\n// ===== Block Schemas =====\n\n/**\n * Base schema for block metadata - editable fields only.\n * Used by CMS forms for dynamic form generation.\n * Add .describe() for form field labels/hints.\n */\nexport const blockEditableSchema = z.object({\n title: z.string().describe('Display name for the block'),\n description: z.string().optional().describe('Brief description of this block'),\n category: z.string().optional().describe('Category for organizing blocks (e.g., headers, cta, content)'),\n tags: z.array(z.string()).optional().describe('Tags for filtering and organization'),\n});\n\nexport type BlockEditable = z.infer<typeof blockEditableSchema>;\n\n/**\n * Full block schema with system fields.\n * Used by Astro Content Collections for validation.\n */\nexport const blockMetaSchema = blockEditableSchema.extend({\n id: z.string(),\n locale: z.string(),\n name: z.string(),\n});\n\nexport type BlockMeta = z.infer<typeof blockMetaSchema>;\n\n// ===== MDX Page Schemas =====\n\n/**\n * Base schema for mdx-type page frontmatter — renderer-neutral.\n *\n * Default for the CMS form when editing an mdx page; projects override via\n * `mdxPages.schema` when they want a renderer-specific shape (e.g. an\n * Astro-collection schema with extra fields).\n *\n * Permissive on purpose: `.passthrough()` lets unknown frontmatter keys flow\n * through unchanged so the file's existing fields are never lost on save.\n */\nexport const mdxPageFrontmatterSchema = z\n .object({\n title: z.string().describe('Page title for SEO and browser tab'),\n description: z.string().optional().describe('Meta description for search engines'),\n draft: z.boolean().optional().describe('Hide the page from production builds'),\n })\n .passthrough();\n\nexport type MdxPageFrontmatter = z.infer<typeof mdxPageFrontmatterSchema>;\n\n// ===== Data Schemas =====\n\n/**\n * Base schema for data entry metadata - editable fields only.\n * Used by CMS forms for dynamic form generation.\n * Add .describe() for form field labels/hints.\n */\nexport const dataEditableSchema = z.object({\n title: z.string().describe('Display name for the entry'),\n description: z.string().optional().describe('Brief description of this entry'),\n category: z.string().optional().describe('Category for organizing entries'),\n tags: z.array(z.string()).optional().describe('Tags for filtering and organization'),\n});\n\nexport type DataEditable = z.infer<typeof dataEditableSchema>;\n\n/**\n * Zod schema for data entry metadata.\n * Covers common organizational fields for structured data collections.\n */\nexport const dataMetaSchema = dataEditableSchema.extend({\n // System fields (added by loader)\n id: z.string(),\n locale: z.string(),\n name: z.string(),\n\n // Actual data content (arbitrary JSON structure)\n data: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type DataMeta = z.infer<typeof dataMetaSchema>;\n"],"mappings":";;;;;;;AASA,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC;CAC/D,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;CACjF,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB;CACvD,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,4BAA4B;CACtF,aAAa,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,8BAA8B;CAC1F,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,uCAAuC;CAC9E,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;AACvF,CAAC;;;;;AAQD,MAAa,iBAAiB,mBAAmB,OAAO;CACtD,IAAI,EAAE,OAAO;CACb,QAAQ,EAAE,OAAO;AACnB,CAAC;;;;;;AAWD,MAAa,sBAAsB,EAAE,OAAO;CAC1C,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B;CACvD,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;CAC7E,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,8DAA8D;CACvG,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;AACrF,CAAC;;;;;AAQD,MAAa,kBAAkB,oBAAoB,OAAO;CACxD,IAAI,EAAE,OAAO;CACb,QAAQ,EAAE,OAAO;CACjB,MAAM,EAAE,OAAO;AACjB,CAAC;;;;;;;;;;;AAgBD,MAAa,2BAA2B,EACrC,OAAO;CACN,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC;CAC/D,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;CACjF,OAAO,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,sCAAsC;AAC/E,CAAC,CAAC,CACD,YAAY;;;;;;AAWf,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B;CACvD,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;CAC7E,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;CAC1E,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;AACrF,CAAC;;;;;AAQD,MAAa,iBAAiB,mBAAmB,OAAO;CAEtD,IAAI,EAAE,OAAO;CACb,QAAQ,EAAE,OAAO;CACjB,MAAM,EAAE,OAAO;CAGf,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;AACnD,CAAC"}