@conloca/content-api 0.1.1 → 0.1.2

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 (67) hide show
  1. package/package.json +1 -1
  2. package/dist/asset-manifest.d.ts +0 -20
  3. package/dist/asset-manifest.d.ts.map +0 -1
  4. package/dist/asset-operations.d.ts +0 -156
  5. package/dist/asset-operations.d.ts.map +0 -1
  6. package/dist/asset-types.d.ts +0 -56
  7. package/dist/asset-types.d.ts.map +0 -1
  8. package/dist/base-content-index.d.ts +0 -57
  9. package/dist/base-content-index.d.ts.map +0 -1
  10. package/dist/block-index.d.ts +0 -9
  11. package/dist/block-index.d.ts.map +0 -1
  12. package/dist/blocks.d.ts +0 -16
  13. package/dist/blocks.d.ts.map +0 -1
  14. package/dist/cf-access.d.ts +0 -31
  15. package/dist/cf-access.d.ts.map +0 -1
  16. package/dist/component-registry.d.ts +0 -50
  17. package/dist/component-registry.d.ts.map +0 -1
  18. package/dist/component-registry.types.d.ts +0 -11
  19. package/dist/component-registry.types.d.ts.map +0 -1
  20. package/dist/content-api.interface.d.ts +0 -64
  21. package/dist/content-api.interface.d.ts.map +0 -1
  22. package/dist/content-filters.d.ts +0 -31
  23. package/dist/content-filters.d.ts.map +0 -1
  24. package/dist/content-index.d.ts +0 -126
  25. package/dist/content-index.d.ts.map +0 -1
  26. package/dist/content-operations.d.ts +0 -94
  27. package/dist/content-operations.d.ts.map +0 -1
  28. package/dist/content-utils.d.ts +0 -109
  29. package/dist/content-utils.d.ts.map +0 -1
  30. package/dist/content-watcher.d.ts +0 -25
  31. package/dist/content-watcher.d.ts.map +0 -1
  32. package/dist/data-index.d.ts +0 -8
  33. package/dist/data-index.d.ts.map +0 -1
  34. package/dist/data.d.ts +0 -43
  35. package/dist/data.d.ts.map +0 -1
  36. package/dist/etag-utils.d.ts +0 -77
  37. package/dist/etag-utils.d.ts.map +0 -1
  38. package/dist/filesystem-content-api.d.ts +0 -120
  39. package/dist/filesystem-content-api.d.ts.map +0 -1
  40. package/dist/git-operations.d.ts +0 -44
  41. package/dist/git-operations.d.ts.map +0 -1
  42. package/dist/in-memory-content-api.d.ts +0 -35
  43. package/dist/in-memory-content-api.d.ts.map +0 -1
  44. package/dist/index.d.ts +0 -17
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/json-whitespace-view.d.ts +0 -32
  47. package/dist/json-whitespace-view.d.ts.map +0 -1
  48. package/dist/middleware.d.ts +0 -20
  49. package/dist/middleware.d.ts.map +0 -1
  50. package/dist/node.d.ts +0 -25
  51. package/dist/node.d.ts.map +0 -1
  52. package/dist/schemas/index.d.ts +0 -179
  53. package/dist/schemas/index.d.ts.map +0 -1
  54. package/dist/site-index.d.ts +0 -60
  55. package/dist/site-index.d.ts.map +0 -1
  56. package/dist/site.d.ts +0 -21
  57. package/dist/site.d.ts.map +0 -1
  58. package/dist/types.d.ts +0 -329
  59. package/dist/types.d.ts.map +0 -1
  60. package/dist/url-safe-base64.d.ts +0 -12
  61. package/dist/url-safe-base64.d.ts.map +0 -1
  62. package/dist/utils.d.ts +0 -46
  63. package/dist/utils.d.ts.map +0 -1
  64. package/dist/vite-plugin.d.ts +0 -12
  65. package/dist/vite-plugin.d.ts.map +0 -1
  66. package/dist/vxjson.d.ts +0 -111
  67. package/dist/vxjson.d.ts.map +0 -1
package/dist/types.d.ts DELETED
@@ -1,329 +0,0 @@
1
- export interface ContentAPIOptions {
2
- contentRoot: string;
3
- canvasDir?: string;
4
- }
5
- export interface APIError {
6
- error: {
7
- code: string;
8
- message: string;
9
- details?: any;
10
- };
11
- }
12
- export declare const ErrorCodes: {
13
- readonly CONTENT_NOT_FOUND: "CONTENT_NOT_FOUND";
14
- readonly LOCALE_NOT_FOUND: "LOCALE_NOT_FOUND";
15
- readonly COLLECTION_NOT_FOUND: "COLLECTION_NOT_FOUND";
16
- readonly SITE_NOT_FOUND: "SITE_NOT_FOUND";
17
- readonly STALE_WRITE: "STALE_WRITE";
18
- readonly ALREADY_EXISTS: "ALREADY_EXISTS";
19
- readonly PATHNAME_TAKEN: "PATHNAME_TAKEN";
20
- readonly NAME_TAKEN: "NAME_TAKEN";
21
- readonly METADATA_TOO_LARGE: "METADATA_TOO_LARGE";
22
- readonly WRITE_ERROR: "WRITE_ERROR";
23
- readonly MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
24
- readonly INVALID_LOCALE: "INVALID_LOCALE";
25
- readonly INVALID_CONTENT_TYPE: "INVALID_CONTENT_TYPE";
26
- readonly INVALID_REQUEST: "INVALID_REQUEST";
27
- readonly INTERNAL_ERROR: "INTERNAL_ERROR";
28
- readonly FETCH_ERROR: "FETCH_ERROR";
29
- readonly GIT_NOT_REPO: "GIT_NOT_REPO";
30
- readonly GIT_COMMIT_FAILED: "GIT_COMMIT_FAILED";
31
- readonly GIT_PUSH_FAILED: "GIT_PUSH_FAILED";
32
- readonly GIT_STATUS_FAILED: "GIT_STATUS_FAILED";
33
- readonly ASSET_NOT_FOUND: "ASSET_NOT_FOUND";
34
- readonly ASSET_INVALID_FORMAT: "ASSET_INVALID_FORMAT";
35
- readonly ASSET_TOO_LARGE: "ASSET_TOO_LARGE";
36
- readonly ASSET_UPLOAD_FAILED: "ASSET_UPLOAD_FAILED";
37
- };
38
- export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
39
- export type ContentType = 'puck' | 'mdx' | 'json';
40
- export interface ContentData {
41
- puckData?: any;
42
- mdx?: string;
43
- data?: Record<string, unknown>;
44
- }
45
- export interface ContentProp {
46
- content: ContentData;
47
- }
48
- export interface ContentIdentity {
49
- id: string;
50
- type: ContentType;
51
- kind: 'block' | 'page' | 'data';
52
- site?: string;
53
- collection: string;
54
- }
55
- export interface LocalePathData {
56
- locale: string;
57
- pathname?: string;
58
- name?: string;
59
- }
60
- export interface LocaleVersion extends LocalePathData {
61
- etag: string;
62
- created: string;
63
- modified: string;
64
- publishAt?: string;
65
- unpublishAt?: string;
66
- previousPathnames?: Record<string, string>;
67
- meta: ContentMeta;
68
- }
69
- export interface ContentManifest extends ContentIdentity {
70
- locales: Record<string, LocaleVersion | undefined>;
71
- }
72
- export interface LocalizedManifest extends ContentIdentity {
73
- localized: LocaleVersion;
74
- }
75
- export interface LocalizedEntry extends ContentIdentity {
76
- localized: LocaleVersion & ContentProp;
77
- }
78
- export interface ContentEntry extends ContentManifest {
79
- locales: Record<string, LocaleVersion & ContentProp>;
80
- }
81
- export interface UpdateResult {
82
- success: boolean;
83
- etag?: string;
84
- modified?: Date;
85
- reason?: 'not_found' | 'stale_write' | 'write_error';
86
- error?: Error;
87
- currentEtag?: string;
88
- conflictDetails?: {
89
- metaChanged: boolean;
90
- contentChanged: boolean;
91
- currentMeta?: ContentMeta;
92
- currentContent?: ContentData;
93
- localContent?: ContentData;
94
- };
95
- }
96
- export interface MoveResult {
97
- moved: boolean;
98
- previousPathname?: string;
99
- files?: string[];
100
- reason?: 'not_found' | 'already_exists' | 'stale_write' | 'write_error';
101
- error?: Error;
102
- etag?: string;
103
- }
104
- export interface ContentListResult {
105
- items: ContentManifest[];
106
- total: number;
107
- hasMore?: boolean;
108
- }
109
- export interface GlobalFilters {
110
- site?: string;
111
- collection?: string;
112
- locales?: string[];
113
- type?: 'puck' | 'mdx' | 'json';
114
- published?: boolean;
115
- kind?: 'block' | 'page' | 'data';
116
- localization?: 'complete' | 'partial' | 'one';
117
- missingLocales?: string[];
118
- }
119
- export interface SiteFilters {
120
- collection?: string;
121
- locales?: string[];
122
- type?: 'puck' | 'mdx';
123
- published?: boolean;
124
- }
125
- export interface BlockFilters {
126
- collection?: string;
127
- locales?: string[];
128
- }
129
- export interface FindOptions {
130
- excludeSites?: string[];
131
- includeUnpublished?: boolean;
132
- }
133
- export interface CreateContentInput {
134
- kind: 'block' | 'page' | 'data';
135
- site?: string;
136
- collection: string;
137
- type: ContentType;
138
- created?: string;
139
- name?: string;
140
- meta?: Partial<ContentMeta>;
141
- locales: {
142
- [locale: string]: {
143
- pathname?: string;
144
- publishAt?: string | null | false;
145
- unpublishAt?: string | null | false;
146
- meta?: Partial<ContentMeta>;
147
- } & ContentProp;
148
- };
149
- }
150
- export interface CreatePageInput {
151
- collection: string;
152
- locales: {
153
- [locale: string]: {
154
- pathname: string;
155
- publishAt?: string | null | false;
156
- unpublishAt?: string | null | false;
157
- meta: ContentMeta;
158
- content: {
159
- puckData: any;
160
- };
161
- };
162
- };
163
- }
164
- export interface CreateBlockInput {
165
- collection: string;
166
- type: 'mdx';
167
- name: string;
168
- meta?: Partial<ContentMeta>;
169
- locales: {
170
- [locale: string]: {
171
- publishAt?: string | null | false;
172
- unpublishAt?: string | null | false;
173
- meta?: Partial<ContentMeta>;
174
- content: {
175
- mdx: string;
176
- };
177
- };
178
- };
179
- }
180
- export interface UpdateLocaleInput {
181
- id: string;
182
- locale: string;
183
- data: LocaleUpdateData;
184
- etag: string;
185
- }
186
- export interface LocaleUpdateData {
187
- pathname?: string;
188
- name?: string;
189
- publishAt?: string | null | false;
190
- unpublishAt?: string | null | false;
191
- modified?: string;
192
- meta?: Partial<ContentMeta>;
193
- content?: ContentData;
194
- }
195
- export interface DeleteLocaleInput {
196
- id: string;
197
- locale: string;
198
- etag: string;
199
- }
200
- export interface SitesConfig {
201
- sites: {
202
- [siteName: string]: {
203
- locales: string[];
204
- defaultLocale: string;
205
- domains?: {
206
- [locale: string]: string;
207
- };
208
- };
209
- };
210
- globalLocales: string[];
211
- }
212
- export interface BatchResult {
213
- operations: BatchOperationResult[];
214
- success: boolean;
215
- failed: number;
216
- updated: number;
217
- }
218
- export interface ContentMeta {
219
- title: string;
220
- description?: string;
221
- author?: string;
222
- tags?: string[];
223
- keywords?: string[];
224
- ogTitle?: string;
225
- ogDescription?: string;
226
- ogImage?: string;
227
- [key: string]: any;
228
- }
229
- /**
230
- * VXJSON (Variant JSON) File Format
231
- *
232
- * VXJSON is a specialized JSON format that guarantees:
233
- * 1. The root is always an object (never an array or primitive)
234
- * 2. The "content" field always comes last in the object
235
- * 3. Field order is deterministic for consistent ETag calculation
236
- *
237
- * This format enables efficient streaming ETag calculation where metadata
238
- * can be hashed separately from content, supporting partial updates and
239
- * conflict resolution in CMS scenarios.
240
- *
241
- * Files using this format have the extension .vxjson
242
- */
243
- export interface VXJSONFile {
244
- id: string;
245
- type: ContentType;
246
- created: string;
247
- modified: string;
248
- publishAt?: string;
249
- unpublishAt?: string;
250
- previousPathnames?: Record<string, string>;
251
- meta: ContentMeta;
252
- content: ContentData;
253
- }
254
- export interface MDXFrontmatter {
255
- id: string;
256
- type: 'mdx';
257
- created: string;
258
- modified: string;
259
- publishAt?: string;
260
- unpublishAt?: string;
261
- meta: ContentMeta;
262
- }
263
- export type WriteResult = {
264
- success: true;
265
- etag: string;
266
- modified?: Date;
267
- reason?: undefined;
268
- error?: undefined;
269
- currentEtag?: undefined;
270
- } | {
271
- success: false;
272
- etag?: undefined;
273
- modified?: undefined;
274
- reason: 'stale_write';
275
- error?: undefined;
276
- currentEtag: string;
277
- } | {
278
- success: false;
279
- etag?: undefined;
280
- modified?: undefined;
281
- reason: 'already_exists';
282
- error?: undefined;
283
- currentEtag: string;
284
- } | {
285
- success: false;
286
- etag?: undefined;
287
- modified?: undefined;
288
- reason: 'write_error';
289
- error: Error;
290
- currentEtag?: string;
291
- };
292
- export interface DeleteResult {
293
- success: boolean;
294
- error?: Error;
295
- reason?: 'stale_write' | 'not_found' | 'delete_error';
296
- currentEtag?: string;
297
- }
298
- export interface CreateResult {
299
- success: boolean;
300
- id?: string;
301
- etag?: string;
302
- created?: Date;
303
- reason?: 'already_exists' | 'write_error' | 'invalid_name' | 'name_taken' | 'pathname_taken' | 'pathname_in_redirects' | 'metadata_too_large';
304
- error?: Error;
305
- existingId?: string;
306
- }
307
- export interface BatchOperationResult {
308
- id: string;
309
- locale: string;
310
- updated: boolean;
311
- error?: Error;
312
- etag?: string;
313
- }
314
- export interface LocaleFileData {
315
- locale: string;
316
- etag: string;
317
- created: string;
318
- modified: string;
319
- publishAt?: string;
320
- unpublishAt?: string;
321
- previousPathnames?: Record<string, string>;
322
- meta: ContentMeta;
323
- content: {
324
- puckData?: any;
325
- mdx?: string;
326
- data?: Record<string, unknown>;
327
- };
328
- }
329
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC;KACf,CAAC;CACH;AAGD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;CAoCb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAGrE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAGlD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAGD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,WAAW,CAAC;CACtB;AAGD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IA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AE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;CACH"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Convert bytes to URL-safe base64
3
- * Replaces + with -, / with _, and removes = padding
4
- */
5
- export declare function toUrlSafeBase64(bytes: Uint8Array): string;
6
- /**
7
- * Convert BigInt to URL-safe base64
8
- * @param value - The BigInt value to convert
9
- * @returns URL-safe base64 string representation
10
- */
11
- export declare function bigintToUrlSafeBase64(value: bigint): string;
12
- //# sourceMappingURL=url-safe-base64.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url-safe-base64.d.ts","sourceRoot":"","sources":["../src/url-safe-base64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAoBzD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM3D"}
package/dist/utils.d.ts DELETED
@@ -1,46 +0,0 @@
1
- /**
2
- * Utilities for working with suffix pattern as specified in 04-cms-api.md
3
- */
4
- export declare const ContentUtils: {
5
- /**
6
- * Extract locale from filename
7
- * @example
8
- * - about.en.vxjson → 'en'
9
- * - about.nl.vxjson → 'nl'
10
- * - hero-main.mdx → 'en' (default)
11
- * - hero-main.nl.mdx → 'nl'
12
- */
13
- extractLocale(filename: string): string;
14
- /**
15
- * Get base path without locale and extension
16
- * @example
17
- * - about.en.vxjson → 'about'
18
- * - about.nl.vxjson → 'about'
19
- * - hero-main.mdx → 'hero-main'
20
- */
21
- extractBasePath(filename: string): string;
22
- /**
23
- * Build filename from base path and locale
24
- * @example
25
- * - ('about', 'en') → 'about.en.vxjson'
26
- * - ('about', 'nl') → 'about.nl.vxjson'
27
- */
28
- buildFilename(basePath: string, locale: string, extension?: string): string;
29
- /**
30
- * Group files by base path for i18n
31
- */
32
- groupByContent(filenames: string[]): Map<string, Record<string, string>>;
33
- /**
34
- * Check if a file is a content file (vxjson or mdx)
35
- */
36
- isContentFile(filename: string): boolean;
37
- /**
38
- * Parse filename to get all components
39
- */
40
- parseFilename(filename: string): {
41
- basePath: string;
42
- locale: string;
43
- extension: string;
44
- };
45
- };
46
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB;;;;;;;OAOG;4BACqB,MAAM,GAAG,MAAM;IAKvC;;;;;;OAMG;8BACuB,MAAM,GAAG,MAAM;IAIzC;;;;;OAKG;4BACqB,MAAM,UAAU,MAAM,uBAAyB,MAAM;IAO7E;;OAEG;8BACuB,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAkBxE;;OAEG;4BACqB,MAAM,GAAG,OAAO;IAIxC;;OAEG;4BACqB,MAAM,GAAG;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB;CAOF,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface ConlocaContentOptions {
3
- contentRoot: string;
4
- canvasDir?: string;
5
- basePath?: string;
6
- }
7
- /**
8
- * Vite plugin wrapper for content middleware
9
- * This follows the spec in 04-cms-api.md and 09-conloca-content-editing.md
10
- */
11
- export declare function conlocaContent(options: ConlocaContentOptions): Plugin;
12
- //# sourceMappingURL=vite-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAKlD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CA4BrE"}
package/dist/vxjson.d.ts DELETED
@@ -1,111 +0,0 @@
1
- import type { ContentData, ContentMeta, VXJSONFile } from './types';
2
- /**
3
- * Calculate both ETags from a VXJSON buffer using views
4
- * Finds the "content" field position and validates it's the last field
5
- * @param buffer - The complete file buffer
6
- * @returns Result with ETags or validation error
7
- */
8
- declare function calculateEtagsFromVXJSONBuffer(buffer: Uint8Array, allowTruncated?: boolean): {
9
- success: true;
10
- metaEtag: string;
11
- contentEtag?: string;
12
- contentStartPos: number;
13
- } | {
14
- success: false;
15
- error: 'content_not_last' | 'invalid_json';
16
- };
17
- /**
18
- * VXJSON (Variant JSON) module for parsing and serializing VXJSON files
19
- *
20
- * VXJSON is a specialized JSON format that guarantees:
21
- * 1. The root is always an object (never an array or primitive)
22
- * 2. The "content" field always comes last in the object
23
- * 3. Field order is deterministic for consistent ETag calculation
24
- * 4. Metadata fits within 4085 bytes, ensuring "content" field is found within first 4KB
25
- * 5. First 4KB must either be complete JSON OR end exactly with '"content":'
26
- *
27
- * This format enables efficient 4KB parsing where only the first 4KB of a file
28
- * needs to be read to extract all metadata and locate the content position.
29
- * The constraint that 4KB reads must end with '"content":' ensures reliable parsing.
30
- *
31
- * This module centralizes all VXJSON-specific logic including:
32
- * - Parsing partial buffers (first 4KB for indexing)
33
- * - Finding content position for ETag calculation
34
- * - Serializing with proper field ordering and size validation
35
- * - Calculating ETags from buffers
36
- */
37
- /**
38
- * VXJSON static utilities for parsing and validating VXJSON files
39
- */
40
- export declare class VXJSON {
41
- /**
42
- * Parse first 4KB of VXJSON content from buffer
43
- * Used during indexing to extract metadata without loading full content
44
- *
45
- * VXJSON format requirement: first 4KB must either be complete JSON OR end with '"content":'
46
- * This ensures reliable parsing and validation.
47
- */
48
- static parse4KB(buffer: Uint8Array, bytesRead: number): {
49
- id?: string;
50
- created?: string;
51
- modified?: string;
52
- publishAt?: string;
53
- unpublishAt?: string;
54
- previousPathnames?: Record<string, string>;
55
- pathname?: string;
56
- name?: string;
57
- meta: ContentMeta;
58
- content?: ContentData;
59
- contentStartPos?: number;
60
- };
61
- /**
62
- * Find the position of the "content" field in a VXJSON buffer
63
- * Returns -1 if not found
64
- */
65
- static findContentPosition(buffer: Uint8Array): number;
66
- /**
67
- * Calculate ETags for a VXJSON buffer
68
- * Returns null if the buffer is not valid VXJSON
69
- */
70
- static calculateEtagsOnly(buffer: Uint8Array): {
71
- metaEtag: string;
72
- contentEtag?: string;
73
- } | null;
74
- /**
75
- * Create a dual ETag string from a VXJSON buffer
76
- * Returns null if the buffer is not valid VXJSON
77
- */
78
- static createEtag(buffer: Uint8Array): string | null;
79
- /**
80
- * Validate that a VXJSON buffer has the correct structure
81
- * (content field must be last)
82
- */
83
- static isValid(buffer: Uint8Array): boolean;
84
- /**
85
- * Parse a complete VXJSON file from string
86
- */
87
- static parse(content: string): VXJSONFile;
88
- /**
89
- * Parse a complete VXJSON file from buffer
90
- */
91
- static parseBuffer(buffer: Uint8Array): VXJSONFile;
92
- /**
93
- * Calculate both ETags from a VXJSON buffer using views
94
- * Finds the "content" field position and validates it's the last field
95
- * @param buffer - The complete file buffer
96
- * @returns Result with ETags or validation error
97
- */
98
- static calculateETags: typeof calculateEtagsFromVXJSONBuffer;
99
- /**
100
- * Calculate a simple single etag from the entire buffer
101
- * Used for data files that don't follow the content-last convention
102
- */
103
- static calculateSimpleEtag(buffer: Uint8Array): string;
104
- /**
105
- * Serialize a VXJSONFile to VXJSON format string
106
- * Ensures content field is last and enforces 4KB constraint efficiently
107
- */
108
- static serialize(data: VXJSONFile): string;
109
- }
110
- export {};
111
- //# sourceMappingURL=vxjson.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vxjson.d.ts","sourceRoot":"","sources":["../src/vxjson.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA0BpE;;;;;GAKG;AACH,iBAAS,8BAA8B,CACrC,MAAM,EAAE,UAAU,EAClB,cAAc,UAAQ,GAEpB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAClF;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,kBAAkB,GAAG,cAAc,CAAA;CAAE,CAuMjE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH,qBAAa,MAAM;IACjB;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CACb,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,MAAM,GAChB;QACD,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAA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