@conloca/content-api 0.1.15 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/asset-constraints.d.ts +16 -0
  2. package/dist/asset-constraints.d.ts.map +1 -0
  3. package/dist/asset-constraints.js +29 -0
  4. package/dist/asset-constraints.js.map +1 -0
  5. package/dist/asset-metadata-store.d.ts +60 -0
  6. package/dist/asset-metadata-store.d.ts.map +1 -0
  7. package/dist/asset-metadata-store.js +335 -0
  8. package/dist/asset-metadata-store.js.map +1 -0
  9. package/dist/asset-operations.d.ts +164 -0
  10. package/dist/asset-operations.d.ts.map +1 -0
  11. package/dist/asset-operations.js +784 -0
  12. package/dist/asset-operations.js.map +1 -0
  13. package/dist/asset-types.d.ts +72 -0
  14. package/dist/asset-types.d.ts.map +1 -0
  15. package/dist/asset-types.js +13 -0
  16. package/dist/asset-types.js.map +1 -0
  17. package/dist/asset-usage.d.ts +10 -0
  18. package/dist/asset-usage.d.ts.map +1 -0
  19. package/dist/asset-usage.js +49 -0
  20. package/dist/asset-usage.js.map +1 -0
  21. package/dist/base-content-index.d.ts +63 -0
  22. package/dist/base-content-index.d.ts.map +1 -0
  23. package/dist/base-content-index.js +200 -0
  24. package/dist/base-content-index.js.map +1 -0
  25. package/dist/cf-access.d.ts +31 -0
  26. package/dist/cf-access.d.ts.map +1 -0
  27. package/dist/cf-access.js +67 -0
  28. package/dist/cf-access.js.map +1 -0
  29. package/dist/component-registry.d.ts +50 -0
  30. package/dist/component-registry.d.ts.map +1 -0
  31. package/dist/component-registry.js +121 -0
  32. package/dist/component-registry.js.map +1 -0
  33. package/dist/component-registry.types.d.ts +11 -0
  34. package/dist/component-registry.types.d.ts.map +1 -0
  35. package/dist/component-registry.types.js +2 -0
  36. package/dist/component-registry.types.js.map +1 -0
  37. package/dist/component-vocabulary.d.ts +33 -0
  38. package/dist/component-vocabulary.d.ts.map +1 -0
  39. package/dist/component-vocabulary.js +105 -0
  40. package/dist/component-vocabulary.js.map +1 -0
  41. package/dist/content-api.interface.d.ts +64 -0
  42. package/dist/content-api.interface.d.ts.map +1 -0
  43. package/dist/content-api.interface.js +2 -0
  44. package/dist/content-api.interface.js.map +1 -0
  45. package/dist/content-filters.d.ts +31 -0
  46. package/dist/content-filters.d.ts.map +1 -0
  47. package/dist/content-filters.js +247 -0
  48. package/dist/content-filters.js.map +1 -0
  49. package/dist/content-index.d.ts +184 -0
  50. package/dist/content-index.d.ts.map +1 -0
  51. package/dist/content-index.js +546 -0
  52. package/dist/content-index.js.map +1 -0
  53. package/dist/content-operations.d.ts +157 -0
  54. package/dist/content-operations.d.ts.map +1 -0
  55. package/dist/content-operations.js +359 -0
  56. package/dist/content-operations.js.map +1 -0
  57. package/dist/content-path.d.ts +59 -0
  58. package/dist/content-path.d.ts.map +1 -0
  59. package/dist/content-path.js +88 -0
  60. package/dist/content-path.js.map +1 -0
  61. package/dist/content-reader.d.ts +10 -0
  62. package/dist/content-reader.d.ts.map +1 -0
  63. package/dist/content-reader.js +14 -0
  64. package/dist/content-reader.js.map +1 -0
  65. package/dist/content-utils.d.ts +175 -0
  66. package/dist/content-utils.d.ts.map +1 -0
  67. package/dist/content-utils.js +421 -0
  68. package/dist/content-utils.js.map +1 -0
  69. package/dist/content-watcher.d.ts +43 -0
  70. package/dist/content-watcher.d.ts.map +1 -0
  71. package/dist/content-watcher.js +86 -0
  72. package/dist/content-watcher.js.map +1 -0
  73. package/dist/data-index.d.ts +8 -0
  74. package/dist/data-index.d.ts.map +1 -0
  75. package/dist/data-index.js +8 -0
  76. package/dist/data-index.js.map +1 -0
  77. package/dist/data.d.ts +35 -0
  78. package/dist/data.d.ts.map +1 -0
  79. package/dist/data.js +104 -0
  80. package/dist/data.js.map +1 -0
  81. package/dist/editor-data-bindings.d.ts +10 -0
  82. package/dist/editor-data-bindings.d.ts.map +1 -0
  83. package/dist/editor-data-bindings.js +67 -0
  84. package/dist/editor-data-bindings.js.map +1 -0
  85. package/dist/etag-utils.d.ts +77 -0
  86. package/dist/etag-utils.d.ts.map +1 -0
  87. package/dist/etag-utils.js +161 -0
  88. package/dist/etag-utils.js.map +1 -0
  89. package/dist/filesystem-content-api.d.ts +162 -0
  90. package/dist/filesystem-content-api.d.ts.map +1 -0
  91. package/dist/filesystem-content-api.js +2307 -0
  92. package/dist/filesystem-content-api.js.map +1 -0
  93. package/dist/filesystem-reader-backend.d.ts +46 -0
  94. package/dist/filesystem-reader-backend.d.ts.map +1 -0
  95. package/dist/filesystem-reader-backend.js +119 -0
  96. package/dist/filesystem-reader-backend.js.map +1 -0
  97. package/dist/fragment-index.d.ts +8 -0
  98. package/dist/fragment-index.d.ts.map +1 -0
  99. package/dist/fragment-index.js +8 -0
  100. package/dist/fragment-index.js.map +1 -0
  101. package/dist/fragments.d.ts +16 -0
  102. package/dist/fragments.d.ts.map +1 -0
  103. package/dist/fragments.js +104 -0
  104. package/dist/fragments.js.map +1 -0
  105. package/dist/git-operations.d.ts +49 -0
  106. package/dist/git-operations.d.ts.map +1 -0
  107. package/dist/git-operations.js +256 -0
  108. package/dist/git-operations.js.map +1 -0
  109. package/dist/header-parser.d.ts +37 -0
  110. package/dist/header-parser.d.ts.map +1 -0
  111. package/dist/header-parser.js +233 -0
  112. package/dist/header-parser.js.map +1 -0
  113. package/dist/in-memory-content-api.d.ts +35 -0
  114. package/dist/in-memory-content-api.d.ts.map +1 -0
  115. package/dist/in-memory-content-api.js +609 -0
  116. package/dist/in-memory-content-api.js.map +1 -0
  117. package/dist/index.d.ts +26 -0
  118. package/dist/index.d.ts.map +1 -0
  119. package/dist/index.js +28 -0
  120. package/dist/index.js.map +1 -0
  121. package/dist/indexing.d.ts +5 -0
  122. package/dist/indexing.d.ts.map +1 -0
  123. package/dist/indexing.js +8 -0
  124. package/dist/indexing.js.map +1 -0
  125. package/dist/json-whitespace-view.d.ts +32 -0
  126. package/dist/json-whitespace-view.d.ts.map +1 -0
  127. package/dist/json-whitespace-view.js +153 -0
  128. package/dist/json-whitespace-view.js.map +1 -0
  129. package/dist/middleware.d.ts +20 -0
  130. package/dist/middleware.d.ts.map +1 -0
  131. package/dist/middleware.js +1082 -0
  132. package/dist/middleware.js.map +1 -0
  133. package/dist/node.d.ts +32 -0
  134. package/dist/node.d.ts.map +1 -0
  135. package/dist/node.js +27 -0
  136. package/dist/node.js.map +1 -0
  137. package/dist/page-references.d.ts +21 -0
  138. package/dist/page-references.d.ts.map +1 -0
  139. package/dist/page-references.js +50 -0
  140. package/dist/page-references.js.map +1 -0
  141. package/dist/read-date.d.ts +3 -0
  142. package/dist/read-date.d.ts.map +1 -0
  143. package/dist/read-date.js +9 -0
  144. package/dist/read-date.js.map +1 -0
  145. package/dist/reader-backend.d.ts +54 -0
  146. package/dist/reader-backend.d.ts.map +1 -0
  147. package/dist/reader-backend.js +2 -0
  148. package/dist/reader-backend.js.map +1 -0
  149. package/dist/reader.d.ts +15 -0
  150. package/dist/reader.d.ts.map +1 -0
  151. package/dist/reader.js +14 -0
  152. package/dist/reader.js.map +1 -0
  153. package/dist/schemas/index.d.ts +102 -0
  154. package/dist/schemas/index.d.ts.map +1 -0
  155. package/dist/schemas/index.js +88 -0
  156. package/dist/schemas/index.js.map +1 -0
  157. package/dist/site-index.d.ts +60 -0
  158. package/dist/site-index.d.ts.map +1 -0
  159. package/dist/site-index.js +291 -0
  160. package/dist/site-index.js.map +1 -0
  161. package/dist/site.d.ts +23 -0
  162. package/dist/site.d.ts.map +1 -0
  163. package/dist/site.js +180 -0
  164. package/dist/site.js.map +1 -0
  165. package/dist/types.d.ts +641 -0
  166. package/dist/types.d.ts.map +1 -0
  167. package/dist/types.js +45 -0
  168. package/dist/types.js.map +1 -0
  169. package/dist/url-safe-base64.d.ts +12 -0
  170. package/dist/url-safe-base64.d.ts.map +1 -0
  171. package/dist/url-safe-base64.js +41 -0
  172. package/dist/url-safe-base64.js.map +1 -0
  173. package/dist/url-validation.d.ts +28 -0
  174. package/dist/url-validation.d.ts.map +1 -0
  175. package/dist/url-validation.js +123 -0
  176. package/dist/url-validation.js.map +1 -0
  177. package/dist/utils/atomic-write.d.ts +6 -0
  178. package/dist/utils/atomic-write.d.ts.map +1 -0
  179. package/dist/utils/atomic-write.js +21 -0
  180. package/dist/utils/atomic-write.js.map +1 -0
  181. package/dist/utils.d.ts +46 -0
  182. package/dist/utils.d.ts.map +1 -0
  183. package/dist/utils.js +71 -0
  184. package/dist/utils.js.map +1 -0
  185. package/dist/vite-plugin.d.ts +12 -0
  186. package/dist/vite-plugin.d.ts.map +1 -0
  187. package/dist/vite-plugin.js +30 -0
  188. package/dist/vite-plugin.js.map +1 -0
  189. package/dist/vxjson-serialize.d.ts +13 -0
  190. package/dist/vxjson-serialize.d.ts.map +1 -0
  191. package/dist/vxjson-serialize.js +53 -0
  192. package/dist/vxjson-serialize.js.map +1 -0
  193. package/dist/vxjson.d.ts +113 -0
  194. package/dist/vxjson.d.ts.map +1 -0
  195. package/dist/vxjson.js +381 -0
  196. package/dist/vxjson.js.map +1 -0
  197. package/dist/xxhash.d.ts +10 -0
  198. package/dist/xxhash.d.ts.map +1 -0
  199. package/dist/xxhash.js +35 -0
  200. package/dist/xxhash.js.map +1 -0
  201. package/package.json +132 -34
  202. package/src/asset-constraints.ts +33 -0
  203. package/src/asset-metadata-store.ts +401 -0
  204. package/src/asset-operations.ts +914 -0
  205. package/src/asset-types.ts +74 -0
  206. package/src/asset-usage.ts +47 -0
  207. package/src/base-content-index.ts +227 -0
  208. package/src/cf-access.ts +85 -0
  209. package/src/component-registry.ts +145 -0
  210. package/src/component-registry.types.ts +12 -0
  211. package/src/component-vocabulary.ts +87 -0
  212. package/src/content-api.interface.ts +94 -0
  213. package/src/content-filters.ts +278 -0
  214. package/src/content-index.ts +642 -0
  215. package/src/content-operations.ts +497 -0
  216. package/src/content-path.ts +113 -0
  217. package/src/content-reader.ts +18 -0
  218. package/src/content-utils.ts +474 -0
  219. package/src/content-watcher.ts +122 -0
  220. package/src/data-index.ts +7 -0
  221. package/src/data.ts +134 -0
  222. package/src/editor-data-bindings.ts +66 -0
  223. package/src/etag-utils.ts +204 -0
  224. package/src/filesystem-content-api.ts +2685 -0
  225. package/src/filesystem-reader-backend.ts +135 -0
  226. package/src/fragment-index.ts +7 -0
  227. package/src/fragments.ts +113 -0
  228. package/src/git-operations.ts +340 -0
  229. package/src/header-parser.ts +272 -0
  230. package/src/in-memory-content-api.ts +760 -0
  231. package/src/index.ts +45 -0
  232. package/src/indexing.ts +8 -0
  233. package/src/json-whitespace-view.ts +155 -0
  234. package/src/middleware.ts +1341 -0
  235. package/src/node.ts +40 -0
  236. package/src/page-references.ts +76 -0
  237. package/src/read-date.ts +7 -0
  238. package/src/reader-backend.ts +54 -0
  239. package/src/reader.ts +15 -0
  240. package/src/schemas/index.ts +113 -0
  241. package/src/site-index.ts +330 -0
  242. package/src/site.ts +198 -0
  243. package/src/types.ts +759 -0
  244. package/src/url-safe-base64.ts +38 -0
  245. package/src/url-validation.ts +121 -0
  246. package/src/utils/atomic-write.ts +20 -0
  247. package/src/utils.ts +84 -0
  248. package/src/vite-plugin.ts +45 -0
  249. package/src/vxjson-serialize.ts +66 -0
  250. package/src/vxjson.ts +442 -0
  251. package/src/xxhash.ts +43 -0
  252. package/dist/component-registry.types-CBGONnYn.d.mts +0 -71
  253. package/dist/component-registry.types-CBGONnYn.d.mts.map +0 -1
  254. package/dist/content-operations-Dv67amz3.d.mts +0 -852
  255. package/dist/content-operations-Dv67amz3.d.mts.map +0 -1
  256. package/dist/data-Db1Iv9T0.mjs +0 -60
  257. package/dist/data-Db1Iv9T0.mjs.map +0 -1
  258. package/dist/filesystem-content-api-C1TM0GLo.d.mts +0 -119
  259. package/dist/filesystem-content-api-C1TM0GLo.d.mts.map +0 -1
  260. package/dist/filesystem-content-api-kxKY5IUw.mjs +0 -2678
  261. package/dist/filesystem-content-api-kxKY5IUw.mjs.map +0 -1
  262. package/dist/index.d.mts +0 -79
  263. package/dist/index.d.mts.map +0 -1
  264. package/dist/index.mjs +0 -47
  265. package/dist/index.mjs.map +0 -1
  266. package/dist/node.d.mts +0 -378
  267. package/dist/node.d.mts.map +0 -1
  268. package/dist/node.mjs +0 -2618
  269. package/dist/node.mjs.map +0 -1
  270. package/dist/reader.d.mts +0 -18
  271. package/dist/reader.d.mts.map +0 -1
  272. package/dist/reader.mjs +0 -22
  273. package/dist/reader.mjs.map +0 -1
  274. package/dist/schemas/index.d.mts +0 -90
  275. package/dist/schemas/index.d.mts.map +0 -1
  276. package/dist/schemas/index.mjs +0 -70
  277. package/dist/schemas/index.mjs.map +0 -1
  278. package/dist/site-vNtJ5jCh.mjs +0 -538
  279. package/dist/site-vNtJ5jCh.mjs.map +0 -1
  280. package/dist/types-DWt912tu.mjs +0 -33
  281. package/dist/types-DWt912tu.mjs.map +0 -1
@@ -0,0 +1,157 @@
1
+ import { generateContentId, isContentPublished } from './content-utils.js';
2
+ import type { Fragments } from './fragments.js';
3
+ import type { Site } from './site.js';
4
+ import type { ContentMeta, CreateContentInput, LocaleUpdateData, LocaleVersion } from './types.js';
5
+ /**
6
+ * Shared business logic for content operations
7
+ * Used by both FileSystemContentAPI and InMemoryContentAPI
8
+ */
9
+ export interface ValidationResult {
10
+ valid: boolean;
11
+ error?: string;
12
+ sortedMeta?: ContentMeta;
13
+ size?: number;
14
+ }
15
+ export interface CreateValidationResult {
16
+ valid: boolean;
17
+ error?: string;
18
+ reason?: 'metadata_too_large' | 'pathname_taken' | 'pathname_in_redirects' | 'invalid_pathname' | 'invalid_name' | 'name_taken' | 'invalid_collection' | 'invalid_locale' | 'missing_field' | 'unknown_site' | 'no_sites_configured';
19
+ existingId?: string;
20
+ /** The input field a caller has to change, when the validator knows which one it is. */
21
+ field?: string;
22
+ }
23
+ /**
24
+ * Validate and prepare metadata for storage
25
+ * Ensures title exists and metadata doesn't exceed 4KB
26
+ */
27
+ export declare function validateAndPrepareMetadata(meta: Partial<ContentMeta>): ValidationResult;
28
+ /**
29
+ * Build pathname history update
30
+ */
31
+ export declare function buildPathnameHistory(oldPathname: string | undefined, newPathname: string | undefined, isPublished: boolean, now: string): Record<string, string>;
32
+ /**
33
+ * Build a locale manifest
34
+ */
35
+ export declare function buildLocaleVersion(params: {
36
+ locale: string;
37
+ etag: string;
38
+ created: string;
39
+ modified: string;
40
+ meta: ContentMeta;
41
+ kind: 'fragment' | 'page' | 'data';
42
+ publishAt?: string;
43
+ unpublishAt?: string;
44
+ pathname?: string;
45
+ name?: string;
46
+ previousPathnames?: Record<string, string>;
47
+ }): LocaleVersion;
48
+ /**
49
+ * Update publish dates on a locale manifest
50
+ */
51
+ export declare function updatePublishDates(manifest: LocaleVersion, data: LocaleUpdateData): void;
52
+ /**
53
+ * Validate content creation data
54
+ */
55
+ export declare function validateCreateContent(data: CreateContentInput, sites: Record<string, Site>, fragments: Fragments, dataApi?: {
56
+ isDataNameValid: (name: string) => boolean;
57
+ getNameConflict: (collection: string, name: string) => string | null;
58
+ }): CreateValidationResult;
59
+ /** Why a new entry's collection or one of its locales cannot be part of its file path. */
60
+ export interface PlaceRefusal {
61
+ valid: false;
62
+ reason: 'invalid_collection' | 'invalid_locale';
63
+ error: string;
64
+ field: 'collection' | 'locales';
65
+ }
66
+ /**
67
+ * Why a new entry cannot be stored in `collection` under `locales`, or null when it can. Both are
68
+ * part of the entry's file path, so a collection must be a plain folder name and a locale a
69
+ * language code the file layout reads back: '../x' in either would put the file somewhere else.
70
+ */
71
+ export declare function checkEntryPlace(collection: string | undefined, locales: string[]): PlaceRefusal | null;
72
+ /**
73
+ * Why a new page of `site` cannot be stored under `locales`, or null when it can: each must be a
74
+ * language the site is set up for (`siteLocales`), in the same capitals. The site's pages are read
75
+ * back only in those languages, and a file in another one lands on a page's file: 'EN' on a macOS
76
+ * or Windows disk is the 'en' file, and in an MDX pages folder 'fr' is read as a path folder.
77
+ */
78
+ export declare function checkPageLocales(site: string, siteLocales: readonly string[], locales: string[]): PlaceRefusal | null;
79
+ /** Why a name cannot be a fragment or data entry's name, and the entry that has it when it is taken. */
80
+ export interface NameRefusal {
81
+ valid: false;
82
+ reason: 'invalid_name' | 'name_taken';
83
+ error: string;
84
+ existingId?: string;
85
+ }
86
+ /**
87
+ * Why `name` cannot be the name of a `kind` entry in `collection`, or null when it can: it is
88
+ * missing or malformed, or `conflictOf` finds another entry of the collection with it. The name is
89
+ * part of the entry's file path, so 'a/b' or '../x' would put the file somewhere else.
90
+ */
91
+ export declare function checkEntryName(kind: 'fragment' | 'data', collection: string, name: string | undefined, isValid: (name: string) => boolean, conflictOf: (name: string) => string | null): NameRefusal | null;
92
+ /** Why a path cannot be a page's path, and the page that has it when it is taken. */
93
+ export interface PathnameRefusal {
94
+ valid: false;
95
+ reason: 'invalid_pathname' | 'pathname_taken';
96
+ error: string;
97
+ existingId?: string;
98
+ }
99
+ /**
100
+ * `pathname` tidied as a page's path in `locale`, or why it cannot be one: it is malformed, or
101
+ * another page has it. The path names the page's file, so '/../x' would write it outside the
102
+ * content folder, and '/about/' is the file of the page at '/about'. `excludeId` is a page whose
103
+ * own path is changing; it never blocks itself. Without a `site`, only the path's form is checked.
104
+ */
105
+ export declare function checkPagePathname(site: Site | undefined, pathname: string, locale: string, excludeId?: string): {
106
+ valid: true;
107
+ pathname: string;
108
+ } | PathnameRefusal;
109
+ /**
110
+ * Why a page cannot have `pathname` in `locale` in a site's MDX pages folder (sites.json
111
+ * `mdxPages`), or null when it can. In that folder a page's language is its first folder and a
112
+ * default-language page has none, so '/de/x' in the default language would be written to
113
+ * <folder>/de/x.mdx, the file of the German page at '/x', and read back as that page. `locales`
114
+ * are the languages the folder reads as a first folder. They match in any capitals: macOS and
115
+ * Windows disks treat <folder>/pt-br/x.mdx and <folder>/pt-BR/x.mdx as one file.
116
+ */
117
+ export declare function checkMdxPagesPathname(pathname: string, locale: string, folder: {
118
+ defaultLocale: string;
119
+ locales: Iterable<string>;
120
+ }): PathnameRefusal | null;
121
+ /**
122
+ * Generate a new content ID
123
+ */
124
+ /**
125
+ * Check if content is published
126
+ */
127
+ export { generateContentId, isContentPublished };
128
+ /**
129
+ * Update scope bit flags
130
+ * Can be combined with bitwise OR and checked with bitwise AND
131
+ */
132
+ export declare const UPDATE_SCOPE: {
133
+ readonly NONE: 0;
134
+ readonly META: number;
135
+ readonly CONTENT: number;
136
+ readonly BOTH: 3;
137
+ };
138
+ export type UpdateScope = (typeof UPDATE_SCOPE)[keyof typeof UPDATE_SCOPE];
139
+ /**
140
+ * Determine what parts of content are being updated
141
+ * Returns bit flags that can be checked with bitwise AND
142
+ *
143
+ * Example usage:
144
+ * ```
145
+ * const scope = analyzeUpdateScope(data);
146
+ * if (scope & UPDATE_SCOPE.META) { // metadata is being updated }
147
+ * if (scope & UPDATE_SCOPE.CONTENT) { // content is being updated }
148
+ * if (scope === UPDATE_SCOPE.BOTH) { // both are being updated }
149
+ * ```
150
+ */
151
+ export declare function analyzeUpdateScope(data: LocaleUpdateData): UpdateScope;
152
+ /**
153
+ * Determine whether the modified timestamp should be updated
154
+ * Updates for ANY change - either metadata or content
155
+ */
156
+ export declare function shouldUpdateModifiedTimestamp(data: LocaleUpdateData): boolean;
157
+ //# sourceMappingURL=content-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-operations.d.ts","sourceRoot":"","sources":["../src/content-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAgC,MAAM,oBAAoB,CAAC;AACzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEnG;;;GAGG;AAGH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,WAAW,CAAC;IACz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AG7E"}
@@ -0,0 +1,359 @@
1
+ import sortKeys from 'sort-keys';
2
+ import { isContentLocale } from './content-path.js';
3
+ import { generateContentId, isContentPublished, normalizeAndValidatePathname } from './content-utils.js';
4
+ /**
5
+ * Validate and prepare metadata for storage
6
+ * Ensures title exists and metadata doesn't exceed 4KB
7
+ */
8
+ export function validateAndPrepareMetadata(meta) {
9
+ // Ensure title is present
10
+ if (!meta.title) {
11
+ return {
12
+ valid: false,
13
+ error: 'Title is required in metadata',
14
+ };
15
+ }
16
+ const sortedMeta = sortKeys(meta, { deep: true }); // We've validated title exists
17
+ const metaJson = JSON.stringify(sortedMeta, null, 2);
18
+ const metaSize = new TextEncoder().encode(metaJson).length;
19
+ if (metaSize > 4088) {
20
+ // Leave 8 bytes for safety
21
+ return {
22
+ valid: false,
23
+ error: `Metadata exceeds 4KB limit (${metaSize} bytes)`,
24
+ };
25
+ }
26
+ return {
27
+ valid: true,
28
+ sortedMeta,
29
+ size: metaSize,
30
+ };
31
+ }
32
+ /**
33
+ * Build pathname history update
34
+ */
35
+ export function buildPathnameHistory(oldPathname, newPathname, isPublished, now) {
36
+ const history = {};
37
+ if (oldPathname && newPathname && oldPathname !== newPathname && isPublished) {
38
+ history[oldPathname] = now;
39
+ }
40
+ return history;
41
+ }
42
+ /**
43
+ * Build a locale manifest
44
+ */
45
+ export function buildLocaleVersion(params) {
46
+ const manifest = {
47
+ locale: params.locale,
48
+ etag: params.etag,
49
+ created: params.created,
50
+ modified: params.modified,
51
+ meta: params.meta,
52
+ };
53
+ // Add optional fields only if they exist
54
+ if (params.publishAt) {
55
+ manifest.publishAt = params.publishAt;
56
+ }
57
+ if (params.unpublishAt) {
58
+ manifest.unpublishAt = params.unpublishAt;
59
+ }
60
+ if (params.pathname && params.kind === 'page') {
61
+ manifest.pathname = params.pathname;
62
+ }
63
+ if (params.name && (params.kind === 'fragment' || params.kind === 'data')) {
64
+ manifest.name = params.name;
65
+ }
66
+ if (params.previousPathnames && Object.keys(params.previousPathnames).length > 0) {
67
+ manifest.previousPathnames = params.previousPathnames;
68
+ }
69
+ return manifest;
70
+ }
71
+ /**
72
+ * Update publish dates on a locale manifest
73
+ */
74
+ export function updatePublishDates(manifest, data) {
75
+ // Handle publishAt
76
+ if ('publishAt' in data) {
77
+ if (data.publishAt && typeof data.publishAt === 'string') {
78
+ manifest.publishAt = data.publishAt;
79
+ }
80
+ else {
81
+ // Explicitly delete the field when value is falsy
82
+ delete manifest.publishAt;
83
+ }
84
+ }
85
+ // Handle unpublishAt
86
+ if ('unpublishAt' in data) {
87
+ if (data.unpublishAt && typeof data.unpublishAt === 'string') {
88
+ manifest.unpublishAt = data.unpublishAt;
89
+ }
90
+ else {
91
+ // Explicitly delete the field when value is falsy
92
+ delete manifest.unpublishAt;
93
+ }
94
+ }
95
+ }
96
+ /**
97
+ * Validate content creation data
98
+ */
99
+ export function validateCreateContent(data, sites, fragments, dataApi) {
100
+ const misplaced = checkEntryPlace(data.collection, Object.keys(data.locales));
101
+ if (misplaced)
102
+ return misplaced;
103
+ // Validate metadata for all locales
104
+ for (const localeData of Object.values(data.locales)) {
105
+ const meta = { ...data.meta, ...localeData.meta };
106
+ const validation = validateAndPrepareMetadata(meta);
107
+ if (!validation.valid) {
108
+ return {
109
+ valid: false,
110
+ error: validation.error,
111
+ reason: 'metadata_too_large',
112
+ };
113
+ }
114
+ }
115
+ // Validate pathname for pages
116
+ if (data.kind === 'page') {
117
+ // A content root that declares no sites at all cannot take a page, whatever
118
+ // site the caller names. Blaming the `site` field here sends people hunting
119
+ // for a site name when the real cause is the missing config file.
120
+ if (Object.keys(sites).length === 0) {
121
+ return {
122
+ valid: false,
123
+ error: 'No sites are configured. Create content/sites.json, or run `conloca init <directory> <site-name>`.',
124
+ reason: 'no_sites_configured',
125
+ field: 'site',
126
+ };
127
+ }
128
+ if (!data.site) {
129
+ return {
130
+ valid: false,
131
+ error: 'Site is required for pages',
132
+ reason: 'missing_field',
133
+ field: 'site',
134
+ };
135
+ }
136
+ // Own-key only: the site name is caller-supplied, so an inherited key like
137
+ // `constructor` used to pass this gate and then break on the non-Site.
138
+ const site = Object.hasOwn(sites, data.site) ? sites[data.site] : undefined;
139
+ if (!site) {
140
+ return {
141
+ valid: false,
142
+ error: `Site ${data.site} not found`,
143
+ reason: 'unknown_site',
144
+ field: 'site',
145
+ };
146
+ }
147
+ const unsupported = checkPageLocales(data.site, site.locales, Object.keys(data.locales));
148
+ if (unsupported)
149
+ return unsupported;
150
+ for (const [locale, localeData] of Object.entries(data.locales)) {
151
+ const pathname = localeData.pathname;
152
+ // Pathname is required for pages
153
+ if (!pathname) {
154
+ return {
155
+ valid: false,
156
+ error: `Pathname is required for pages (locale: ${locale})`,
157
+ reason: 'missing_field',
158
+ field: 'pathname',
159
+ };
160
+ }
161
+ // The tidied path is written back to localeData so the rest of the
162
+ // create flow (file writes, indexing) sees the cleaned form.
163
+ const checked = checkPagePathname(site, pathname, locale);
164
+ if (!checked.valid)
165
+ return checked;
166
+ localeData.pathname = checked.pathname;
167
+ // Check if pathname is in redirects
168
+ if (site.isPathnameInRedirects(checked.pathname, locale)) {
169
+ return {
170
+ valid: false,
171
+ error: `Pathname ${checked.pathname} is already in use as a redirect`,
172
+ reason: 'pathname_in_redirects',
173
+ field: 'pathname',
174
+ };
175
+ }
176
+ }
177
+ }
178
+ // A fragment or data entry's name
179
+ if (data.kind === 'fragment') {
180
+ const refused = checkEntryName('fragment', data.collection, data.name, (name) => fragments.isFragmentNameValid(name), (name) => fragments.getNameConflict(data.collection, name));
181
+ if (refused)
182
+ return refused;
183
+ }
184
+ if (data.kind === 'data' && dataApi) {
185
+ const refused = checkEntryName('data', data.collection, data.name, (name) => dataApi.isDataNameValid(name), (name) => dataApi.getNameConflict(data.collection, name));
186
+ if (refused)
187
+ return refused;
188
+ }
189
+ return { valid: true };
190
+ }
191
+ /**
192
+ * Why a new entry cannot be stored in `collection` under `locales`, or null when it can. Both are
193
+ * part of the entry's file path, so a collection must be a plain folder name and a locale a
194
+ * language code the file layout reads back: '../x' in either would put the file somewhere else.
195
+ */
196
+ export function checkEntryPlace(collection, locales) {
197
+ if (!collection) {
198
+ return { valid: false, reason: 'invalid_collection', error: 'Collection name is required', field: 'collection' };
199
+ }
200
+ if (!/^[a-zA-Z0-9_-]+$/.test(collection)) {
201
+ return {
202
+ valid: false,
203
+ reason: 'invalid_collection',
204
+ error: `Invalid collection name: ${collection}. Collection names must contain only alphanumeric characters, hyphens, and underscores.`,
205
+ field: 'collection',
206
+ };
207
+ }
208
+ const malformed = locales.find((locale) => !isContentLocale(locale));
209
+ if (malformed !== undefined) {
210
+ return {
211
+ valid: false,
212
+ reason: 'invalid_locale',
213
+ error: `Invalid locale: ${malformed}. A locale is a two-letter language code, optionally with a region, like en or en-US.`,
214
+ field: 'locales',
215
+ };
216
+ }
217
+ return null;
218
+ }
219
+ /**
220
+ * Why a new page of `site` cannot be stored under `locales`, or null when it can: each must be a
221
+ * language the site is set up for (`siteLocales`), in the same capitals. The site's pages are read
222
+ * back only in those languages, and a file in another one lands on a page's file: 'EN' on a macOS
223
+ * or Windows disk is the 'en' file, and in an MDX pages folder 'fr' is read as a path folder.
224
+ */
225
+ export function checkPageLocales(site, siteLocales, locales) {
226
+ const unsupported = locales.find((locale) => !siteLocales.includes(locale));
227
+ if (unsupported === undefined)
228
+ return null;
229
+ return {
230
+ valid: false,
231
+ reason: 'invalid_locale',
232
+ error: `Invalid locale: ${unsupported}. Site ${site} is set up for ${siteLocales.join(', ')}.`,
233
+ field: 'locales',
234
+ };
235
+ }
236
+ /**
237
+ * Why `name` cannot be the name of a `kind` entry in `collection`, or null when it can: it is
238
+ * missing or malformed, or `conflictOf` finds another entry of the collection with it. The name is
239
+ * part of the entry's file path, so 'a/b' or '../x' would put the file somewhere else.
240
+ */
241
+ export function checkEntryName(kind, collection, name, isValid, conflictOf) {
242
+ const label = kind === 'fragment' ? 'Fragment' : 'Data';
243
+ if (!name) {
244
+ return { valid: false, reason: 'invalid_name', error: `${label} name is required` };
245
+ }
246
+ if (!isValid(name)) {
247
+ return {
248
+ valid: false,
249
+ reason: 'invalid_name',
250
+ error: `Invalid ${kind} name: ${name}. ${label} names must contain only alphanumeric characters, hyphens, and underscores.`,
251
+ };
252
+ }
253
+ const existingId = conflictOf(name);
254
+ if (existingId) {
255
+ return {
256
+ valid: false,
257
+ reason: 'name_taken',
258
+ error: `${label} name ${name} already exists in collection ${collection}`,
259
+ existingId,
260
+ };
261
+ }
262
+ return null;
263
+ }
264
+ /**
265
+ * `pathname` tidied as a page's path in `locale`, or why it cannot be one: it is malformed, or
266
+ * another page has it. The path names the page's file, so '/../x' would write it outside the
267
+ * content folder, and '/about/' is the file of the page at '/about'. `excludeId` is a page whose
268
+ * own path is changing; it never blocks itself. Without a `site`, only the path's form is checked.
269
+ */
270
+ export function checkPagePathname(site, pathname, locale, excludeId) {
271
+ const validation = normalizeAndValidatePathname(pathname);
272
+ if (!validation.valid) {
273
+ return {
274
+ valid: false,
275
+ reason: 'invalid_pathname',
276
+ error: `Invalid pathname for locale ${locale}: ${validation.message}`,
277
+ };
278
+ }
279
+ const tidied = validation.value;
280
+ const existingId = site?.getPathnameConflict(tidied, locale, excludeId);
281
+ if (existingId) {
282
+ return { valid: false, reason: 'pathname_taken', error: `Pathname ${tidied} already exists`, existingId };
283
+ }
284
+ return { valid: true, pathname: tidied };
285
+ }
286
+ /**
287
+ * Why a page cannot have `pathname` in `locale` in a site's MDX pages folder (sites.json
288
+ * `mdxPages`), or null when it can. In that folder a page's language is its first folder and a
289
+ * default-language page has none, so '/de/x' in the default language would be written to
290
+ * <folder>/de/x.mdx, the file of the German page at '/x', and read back as that page. `locales`
291
+ * are the languages the folder reads as a first folder. They match in any capitals: macOS and
292
+ * Windows disks treat <folder>/pt-br/x.mdx and <folder>/pt-BR/x.mdx as one file.
293
+ */
294
+ export function checkMdxPagesPathname(pathname, locale, folder) {
295
+ if (locale !== folder.defaultLocale)
296
+ return null;
297
+ const [first, ...rest] = pathname.slice(1).split('/');
298
+ if (rest.length === 0)
299
+ return null;
300
+ const kept = [...folder.locales].find((folderLocale) => folderLocale.toLowerCase() === first.toLowerCase());
301
+ if (kept === undefined)
302
+ return null;
303
+ return {
304
+ valid: false,
305
+ reason: 'invalid_pathname',
306
+ error: `Invalid pathname for locale ${locale}: Path cannot start with \`/${first}/\`: the MDX pages folder keeps the ${kept} pages there`,
307
+ };
308
+ }
309
+ /**
310
+ * Generate a new content ID
311
+ */
312
+ /**
313
+ * Check if content is published
314
+ */
315
+ export { generateContentId, isContentPublished };
316
+ /**
317
+ * Update scope bit flags
318
+ * Can be combined with bitwise OR and checked with bitwise AND
319
+ */
320
+ export const UPDATE_SCOPE = {
321
+ NONE: 0, // 00
322
+ META: 1 << 0, // 01
323
+ CONTENT: 1 << 1, // 10
324
+ BOTH: 3, // 11 (META | CONTENT)
325
+ };
326
+ /**
327
+ * Determine what parts of content are being updated
328
+ * Returns bit flags that can be checked with bitwise AND
329
+ *
330
+ * Example usage:
331
+ * ```
332
+ * const scope = analyzeUpdateScope(data);
333
+ * if (scope & UPDATE_SCOPE.META) { // metadata is being updated }
334
+ * if (scope & UPDATE_SCOPE.CONTENT) { // content is being updated }
335
+ * if (scope === UPDATE_SCOPE.BOTH) { // both are being updated }
336
+ * ```
337
+ */
338
+ export function analyzeUpdateScope(data) {
339
+ let scope = UPDATE_SCOPE.NONE;
340
+ // Note: pathname is NOT considered a metadata change because:
341
+ // - For pages, pathname is derived from file path, not stored in metadata
342
+ // - Pathname changes don't affect the metadata hash in the ETag
343
+ if (data.meta !== undefined || data.publishAt !== undefined || data.unpublishAt !== undefined) {
344
+ scope |= UPDATE_SCOPE.META;
345
+ }
346
+ if (data.content !== undefined) {
347
+ scope |= UPDATE_SCOPE.CONTENT;
348
+ }
349
+ return scope;
350
+ }
351
+ /**
352
+ * Determine whether the modified timestamp should be updated
353
+ * Updates for ANY change - either metadata or content
354
+ */
355
+ export function shouldUpdateModifiedTimestamp(data) {
356
+ const scope = analyzeUpdateScope(data);
357
+ return scope !== UPDATE_SCOPE.NONE;
358
+ }
359
+ //# sourceMappingURL=content-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-operations.js","sourceRoot":"","sources":["../src/content-operations.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAsCzG;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAA0B;IACnE,0BAA0B;IAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,+BAA+B;SACvC,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAgB,CAAC,CAAC,+BAA+B;IACjG,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;IAE3D,IAAI,QAAQ,GAAG,IAAI,EAAE,CAAC;QACpB,2BAA2B;QAC3B,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,+BAA+B,QAAQ,SAAS;SACxD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK,EAAE,IAAI;QACX,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAA+B,EAC/B,WAA+B,EAC/B,WAAoB,EACpB,GAAW;IAEX,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,IAAI,WAAW,IAAI,WAAW,IAAI,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IAClE,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,KAAK,KAAK,YAAY,CAAC,IAAI,CAAC;AACrC,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The ONE locale/path grammar for content files.
3
+ *
4
+ * Every reader that turns a storage path back into content identity parses it
5
+ * here: the pure header parser, the filesystem indexer, and any other reader
6
+ * of content files. Each of those used to carry its own copy of the
7
+ * regex and the copies disagreed — a copy that refused `about.EN.mdx`
8
+ * made content the index had accepted unreadable, and an indexer copy
9
+ * matching `\w+` filed `about.en-US.mdx` under a fallback locale with no
10
+ * pathname at all.
11
+ *
12
+ * Zero imports on purpose: some consumers embed this module where nothing
13
+ * effectful may run at import time.
14
+ */
15
+ /**
16
+ * Whether `locale` is one this grammar reads back. A writer checks a new entry's locale with it:
17
+ * the locale is spliced into the file path, so anything else is either unreadable or, like
18
+ * '../x', a path out of the entry's folder.
19
+ */
20
+ export declare function isContentLocale(locale: string): boolean;
21
+ export type ContentFileExtension = 'mdx' | 'vxjson' | 'json';
22
+ export interface LocaleFilename {
23
+ /** Filename with the `.<locale>.<ext>` suffix removed. */
24
+ base: string;
25
+ /** Locale exactly as written in the filename. */
26
+ locale: string;
27
+ extension: ContentFileExtension;
28
+ }
29
+ /** Split `<base>.<locale>.<ext>`. Null when the filename carries no locale suffix. */
30
+ export declare function parseLocaleFilename(filename: string): LocaleFilename | null;
31
+ export interface ContentPathLayout {
32
+ kind: 'fragment' | 'page' | 'data';
33
+ site?: string;
34
+ collection: string;
35
+ locale: string;
36
+ pathname?: string;
37
+ name?: string;
38
+ }
39
+ /**
40
+ * Pure path → identity mapper. Returns null when the path doesn't match any
41
+ * supported layout or lacks an explicit locale suffix.
42
+ *
43
+ * Layouts honoured here mirror filesystem-content-api.ts:137-144:
44
+ *
45
+ * - `fragments/<collection>/<name>.<locale>.{mdx,vxjson}` (collection required;
46
+ * `fragments/<name>.<locale>.ext` is a legacy form that FileSystemContentAPI
47
+ * repairs by renaming. The pure parser refuses it.)
48
+ * - `data/<collection>/<name>.<locale>.json`
49
+ * - `<site>/<collection>/<path...>/<file>.<locale>.{vxjson,mdx}` (pages; `index`
50
+ * basename maps to the parent path).
51
+ *
52
+ * Reads accept .mdx pages even though the filesystem writer emits main-layout
53
+ * pages as .vxjson only (its mdx pages live under the separate mdxPagesRoot):
54
+ * another writer may derive the extension from the content type, so an
55
+ * mdx-typed page can land here as <site>/pages/<f>.<l>.mdx and must re-parse —
56
+ * dropping it made written pages unreadable.
57
+ */
58
+ export declare function parseContentPathLayout(path: string): ContentPathLayout | null;
59
+ //# sourceMappingURL=content-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-path.d.ts","sourceRoot":"","sources":["../src/content-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiBH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD;AAKD,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,oBAAoB,CAAC;CACjC;AAED,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAI3E;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAyB7E"}