@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.
- package/dist/asset-constraints.d.ts +16 -0
- package/dist/asset-constraints.d.ts.map +1 -0
- package/dist/asset-constraints.js +29 -0
- package/dist/asset-constraints.js.map +1 -0
- package/dist/asset-metadata-store.d.ts +60 -0
- package/dist/asset-metadata-store.d.ts.map +1 -0
- package/dist/asset-metadata-store.js +335 -0
- package/dist/asset-metadata-store.js.map +1 -0
- package/dist/asset-operations.d.ts +164 -0
- package/dist/asset-operations.d.ts.map +1 -0
- package/dist/asset-operations.js +784 -0
- package/dist/asset-operations.js.map +1 -0
- package/dist/asset-types.d.ts +72 -0
- package/dist/asset-types.d.ts.map +1 -0
- package/dist/asset-types.js +13 -0
- package/dist/asset-types.js.map +1 -0
- package/dist/asset-usage.d.ts +10 -0
- package/dist/asset-usage.d.ts.map +1 -0
- package/dist/asset-usage.js +49 -0
- package/dist/asset-usage.js.map +1 -0
- package/dist/base-content-index.d.ts +63 -0
- package/dist/base-content-index.d.ts.map +1 -0
- package/dist/base-content-index.js +200 -0
- package/dist/base-content-index.js.map +1 -0
- package/dist/cf-access.d.ts +31 -0
- package/dist/cf-access.d.ts.map +1 -0
- package/dist/cf-access.js +67 -0
- package/dist/cf-access.js.map +1 -0
- package/dist/component-registry.d.ts +50 -0
- package/dist/component-registry.d.ts.map +1 -0
- package/dist/component-registry.js +121 -0
- package/dist/component-registry.js.map +1 -0
- package/dist/component-registry.types.d.ts +11 -0
- package/dist/component-registry.types.d.ts.map +1 -0
- package/dist/component-registry.types.js +2 -0
- package/dist/component-registry.types.js.map +1 -0
- package/dist/component-vocabulary.d.ts +33 -0
- package/dist/component-vocabulary.d.ts.map +1 -0
- package/dist/component-vocabulary.js +105 -0
- package/dist/component-vocabulary.js.map +1 -0
- package/dist/content-api.interface.d.ts +64 -0
- package/dist/content-api.interface.d.ts.map +1 -0
- package/dist/content-api.interface.js +2 -0
- package/dist/content-api.interface.js.map +1 -0
- package/dist/content-filters.d.ts +31 -0
- package/dist/content-filters.d.ts.map +1 -0
- package/dist/content-filters.js +247 -0
- package/dist/content-filters.js.map +1 -0
- package/dist/content-index.d.ts +184 -0
- package/dist/content-index.d.ts.map +1 -0
- package/dist/content-index.js +546 -0
- package/dist/content-index.js.map +1 -0
- package/dist/content-operations.d.ts +157 -0
- package/dist/content-operations.d.ts.map +1 -0
- package/dist/content-operations.js +359 -0
- package/dist/content-operations.js.map +1 -0
- package/dist/content-path.d.ts +59 -0
- package/dist/content-path.d.ts.map +1 -0
- package/dist/content-path.js +88 -0
- package/dist/content-path.js.map +1 -0
- package/dist/content-reader.d.ts +10 -0
- package/dist/content-reader.d.ts.map +1 -0
- package/dist/content-reader.js +14 -0
- package/dist/content-reader.js.map +1 -0
- package/dist/content-utils.d.ts +175 -0
- package/dist/content-utils.d.ts.map +1 -0
- package/dist/content-utils.js +421 -0
- package/dist/content-utils.js.map +1 -0
- package/dist/content-watcher.d.ts +43 -0
- package/dist/content-watcher.d.ts.map +1 -0
- package/dist/content-watcher.js +86 -0
- package/dist/content-watcher.js.map +1 -0
- package/dist/data-index.d.ts +8 -0
- package/dist/data-index.d.ts.map +1 -0
- package/dist/data-index.js +8 -0
- package/dist/data-index.js.map +1 -0
- package/dist/data.d.ts +35 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +104 -0
- package/dist/data.js.map +1 -0
- package/dist/editor-data-bindings.d.ts +10 -0
- package/dist/editor-data-bindings.d.ts.map +1 -0
- package/dist/editor-data-bindings.js +67 -0
- package/dist/editor-data-bindings.js.map +1 -0
- package/dist/etag-utils.d.ts +77 -0
- package/dist/etag-utils.d.ts.map +1 -0
- package/dist/etag-utils.js +161 -0
- package/dist/etag-utils.js.map +1 -0
- package/dist/filesystem-content-api.d.ts +162 -0
- package/dist/filesystem-content-api.d.ts.map +1 -0
- package/dist/filesystem-content-api.js +2307 -0
- package/dist/filesystem-content-api.js.map +1 -0
- package/dist/filesystem-reader-backend.d.ts +46 -0
- package/dist/filesystem-reader-backend.d.ts.map +1 -0
- package/dist/filesystem-reader-backend.js +119 -0
- package/dist/filesystem-reader-backend.js.map +1 -0
- package/dist/fragment-index.d.ts +8 -0
- package/dist/fragment-index.d.ts.map +1 -0
- package/dist/fragment-index.js +8 -0
- package/dist/fragment-index.js.map +1 -0
- package/dist/fragments.d.ts +16 -0
- package/dist/fragments.d.ts.map +1 -0
- package/dist/fragments.js +104 -0
- package/dist/fragments.js.map +1 -0
- package/dist/git-operations.d.ts +49 -0
- package/dist/git-operations.d.ts.map +1 -0
- package/dist/git-operations.js +256 -0
- package/dist/git-operations.js.map +1 -0
- package/dist/header-parser.d.ts +37 -0
- package/dist/header-parser.d.ts.map +1 -0
- package/dist/header-parser.js +233 -0
- package/dist/header-parser.js.map +1 -0
- package/dist/in-memory-content-api.d.ts +35 -0
- package/dist/in-memory-content-api.d.ts.map +1 -0
- package/dist/in-memory-content-api.js +609 -0
- package/dist/in-memory-content-api.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/indexing.d.ts +5 -0
- package/dist/indexing.d.ts.map +1 -0
- package/dist/indexing.js +8 -0
- package/dist/indexing.js.map +1 -0
- package/dist/json-whitespace-view.d.ts +32 -0
- package/dist/json-whitespace-view.d.ts.map +1 -0
- package/dist/json-whitespace-view.js +153 -0
- package/dist/json-whitespace-view.js.map +1 -0
- package/dist/middleware.d.ts +20 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +1082 -0
- package/dist/middleware.js.map +1 -0
- package/dist/node.d.ts +32 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +27 -0
- package/dist/node.js.map +1 -0
- package/dist/page-references.d.ts +21 -0
- package/dist/page-references.d.ts.map +1 -0
- package/dist/page-references.js +50 -0
- package/dist/page-references.js.map +1 -0
- package/dist/read-date.d.ts +3 -0
- package/dist/read-date.d.ts.map +1 -0
- package/dist/read-date.js +9 -0
- package/dist/read-date.js.map +1 -0
- package/dist/reader-backend.d.ts +54 -0
- package/dist/reader-backend.d.ts.map +1 -0
- package/dist/reader-backend.js +2 -0
- package/dist/reader-backend.js.map +1 -0
- package/dist/reader.d.ts +15 -0
- package/dist/reader.d.ts.map +1 -0
- package/dist/reader.js +14 -0
- package/dist/reader.js.map +1 -0
- package/dist/schemas/index.d.ts +102 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +88 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/site-index.d.ts +60 -0
- package/dist/site-index.d.ts.map +1 -0
- package/dist/site-index.js +291 -0
- package/dist/site-index.js.map +1 -0
- package/dist/site.d.ts +23 -0
- package/dist/site.d.ts.map +1 -0
- package/dist/site.js +180 -0
- package/dist/site.js.map +1 -0
- package/dist/types.d.ts +641 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +45 -0
- package/dist/types.js.map +1 -0
- package/dist/url-safe-base64.d.ts +12 -0
- package/dist/url-safe-base64.d.ts.map +1 -0
- package/dist/url-safe-base64.js +41 -0
- package/dist/url-safe-base64.js.map +1 -0
- package/dist/url-validation.d.ts +28 -0
- package/dist/url-validation.d.ts.map +1 -0
- package/dist/url-validation.js +123 -0
- package/dist/url-validation.js.map +1 -0
- package/dist/utils/atomic-write.d.ts +6 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/atomic-write.js +21 -0
- package/dist/utils/atomic-write.js.map +1 -0
- package/dist/utils.d.ts +46 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +71 -0
- package/dist/utils.js.map +1 -0
- package/dist/vite-plugin.d.ts +12 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.js +30 -0
- package/dist/vite-plugin.js.map +1 -0
- package/dist/vxjson-serialize.d.ts +13 -0
- package/dist/vxjson-serialize.d.ts.map +1 -0
- package/dist/vxjson-serialize.js +53 -0
- package/dist/vxjson-serialize.js.map +1 -0
- package/dist/vxjson.d.ts +113 -0
- package/dist/vxjson.d.ts.map +1 -0
- package/dist/vxjson.js +381 -0
- package/dist/vxjson.js.map +1 -0
- package/dist/xxhash.d.ts +10 -0
- package/dist/xxhash.d.ts.map +1 -0
- package/dist/xxhash.js +35 -0
- package/dist/xxhash.js.map +1 -0
- package/package.json +132 -34
- package/src/asset-constraints.ts +33 -0
- package/src/asset-metadata-store.ts +401 -0
- package/src/asset-operations.ts +914 -0
- package/src/asset-types.ts +74 -0
- package/src/asset-usage.ts +47 -0
- package/src/base-content-index.ts +227 -0
- package/src/cf-access.ts +85 -0
- package/src/component-registry.ts +145 -0
- package/src/component-registry.types.ts +12 -0
- package/src/component-vocabulary.ts +87 -0
- package/src/content-api.interface.ts +94 -0
- package/src/content-filters.ts +278 -0
- package/src/content-index.ts +642 -0
- package/src/content-operations.ts +497 -0
- package/src/content-path.ts +113 -0
- package/src/content-reader.ts +18 -0
- package/src/content-utils.ts +474 -0
- package/src/content-watcher.ts +122 -0
- package/src/data-index.ts +7 -0
- package/src/data.ts +134 -0
- package/src/editor-data-bindings.ts +66 -0
- package/src/etag-utils.ts +204 -0
- package/src/filesystem-content-api.ts +2685 -0
- package/src/filesystem-reader-backend.ts +135 -0
- package/src/fragment-index.ts +7 -0
- package/src/fragments.ts +113 -0
- package/src/git-operations.ts +340 -0
- package/src/header-parser.ts +272 -0
- package/src/in-memory-content-api.ts +760 -0
- package/src/index.ts +45 -0
- package/src/indexing.ts +8 -0
- package/src/json-whitespace-view.ts +155 -0
- package/src/middleware.ts +1341 -0
- package/src/node.ts +40 -0
- package/src/page-references.ts +76 -0
- package/src/read-date.ts +7 -0
- package/src/reader-backend.ts +54 -0
- package/src/reader.ts +15 -0
- package/src/schemas/index.ts +113 -0
- package/src/site-index.ts +330 -0
- package/src/site.ts +198 -0
- package/src/types.ts +759 -0
- package/src/url-safe-base64.ts +38 -0
- package/src/url-validation.ts +121 -0
- package/src/utils/atomic-write.ts +20 -0
- package/src/utils.ts +84 -0
- package/src/vite-plugin.ts +45 -0
- package/src/vxjson-serialize.ts +66 -0
- package/src/vxjson.ts +442 -0
- package/src/xxhash.ts +43 -0
- package/dist/component-registry.types-CBGONnYn.d.mts +0 -71
- package/dist/component-registry.types-CBGONnYn.d.mts.map +0 -1
- package/dist/content-operations-Dv67amz3.d.mts +0 -852
- package/dist/content-operations-Dv67amz3.d.mts.map +0 -1
- package/dist/data-Db1Iv9T0.mjs +0 -60
- package/dist/data-Db1Iv9T0.mjs.map +0 -1
- package/dist/filesystem-content-api-C1TM0GLo.d.mts +0 -119
- package/dist/filesystem-content-api-C1TM0GLo.d.mts.map +0 -1
- package/dist/filesystem-content-api-kxKY5IUw.mjs +0 -2678
- package/dist/filesystem-content-api-kxKY5IUw.mjs.map +0 -1
- package/dist/index.d.mts +0 -79
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -47
- package/dist/index.mjs.map +0 -1
- package/dist/node.d.mts +0 -378
- package/dist/node.d.mts.map +0 -1
- package/dist/node.mjs +0 -2618
- package/dist/node.mjs.map +0 -1
- package/dist/reader.d.mts +0 -18
- package/dist/reader.d.mts.map +0 -1
- package/dist/reader.mjs +0 -22
- package/dist/reader.mjs.map +0 -1
- package/dist/schemas/index.d.mts +0 -90
- package/dist/schemas/index.d.mts.map +0 -1
- package/dist/schemas/index.mjs +0 -70
- package/dist/schemas/index.mjs.map +0 -1
- package/dist/site-vNtJ5jCh.mjs +0 -538
- package/dist/site-vNtJ5jCh.mjs.map +0 -1
- package/dist/types-DWt912tu.mjs +0 -33
- package/dist/types-DWt912tu.mjs.map +0 -1
package/dist/data.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export class Data {
|
|
2
|
+
api;
|
|
3
|
+
dataIndex;
|
|
4
|
+
constructor(api, dataIndex) {
|
|
5
|
+
this.api = api;
|
|
6
|
+
this.dataIndex = dataIndex;
|
|
7
|
+
}
|
|
8
|
+
// Content discovery
|
|
9
|
+
*listContent(filters) {
|
|
10
|
+
// Choose the most efficient method based on filters
|
|
11
|
+
if (filters?.collection) {
|
|
12
|
+
if (filters.locales && filters.locales.length > 0) {
|
|
13
|
+
// Filter by locales after getting collection entries
|
|
14
|
+
for (const manifest of this.dataIndex.getManifestsByCollection(filters.collection)) {
|
|
15
|
+
if (filters.locales.some((locale) => manifest.locales[locale])) {
|
|
16
|
+
yield manifest;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
yield* this.dataIndex.getManifestsByCollection(filters.collection);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else if (filters?.locales && filters.locales.length > 0) {
|
|
25
|
+
// For multiple locales, we need to check each
|
|
26
|
+
for (const manifest of this.dataIndex.getAllManifests()) {
|
|
27
|
+
if (filters.locales.some((locale) => manifest.locales[locale])) {
|
|
28
|
+
yield manifest;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
yield* this.dataIndex.getAllManifests();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Get all data collections
|
|
37
|
+
get collections() {
|
|
38
|
+
return this.dataIndex.collections;
|
|
39
|
+
}
|
|
40
|
+
// Data operations (returns null if not found)
|
|
41
|
+
getByName(collection, name, locale) {
|
|
42
|
+
return this.dataIndex.getByName(collection, name, locale);
|
|
43
|
+
}
|
|
44
|
+
// Check if data name is available, in any letter case as getNameConflict checks it
|
|
45
|
+
isNameAvailable(collection, name, excludeId) {
|
|
46
|
+
return this.getNameConflict(collection, name, excludeId) === null;
|
|
47
|
+
}
|
|
48
|
+
// Get the ID of content that conflicts with a data name
|
|
49
|
+
getNameConflict(collection, name, excludeId) {
|
|
50
|
+
// In any letter case: those names share one file on a case-insensitive disk.
|
|
51
|
+
for (const existing of this.dataIndex.getAllByNameInAnyCase(collection, name)) {
|
|
52
|
+
if (existing.id !== excludeId)
|
|
53
|
+
return existing.id;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
// Check if data name is valid
|
|
58
|
+
isDataNameValid(dataName) {
|
|
59
|
+
// Data names must not be empty
|
|
60
|
+
if (!dataName || dataName.trim() === '') {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
// Data names must not contain dots (would interfere with locale suffixes)
|
|
64
|
+
if (dataName.includes('.')) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
// Data names must not contain path separators
|
|
68
|
+
if (dataName.includes('/') || dataName.includes('\\')) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
// Data names should only contain alphanumeric, hyphens, underscores
|
|
72
|
+
return /^[a-zA-Z0-9_-]+$/.test(dataName);
|
|
73
|
+
}
|
|
74
|
+
// Create data entry with name validation
|
|
75
|
+
async create(input) {
|
|
76
|
+
// Validate data name
|
|
77
|
+
if (!this.isDataNameValid(input.name)) {
|
|
78
|
+
return {
|
|
79
|
+
success: false,
|
|
80
|
+
reason: 'invalid_name',
|
|
81
|
+
error: new Error(`Invalid data name: ${input.name}`),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Check if name is already taken in any locale
|
|
85
|
+
const existing = this.getByName(input.collection, input.name);
|
|
86
|
+
if (existing) {
|
|
87
|
+
return {
|
|
88
|
+
success: false,
|
|
89
|
+
reason: 'name_taken',
|
|
90
|
+
error: new Error(`Data name ${input.name} already exists in collection ${input.collection}`),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// Create the content
|
|
94
|
+
return this.api.createContent({
|
|
95
|
+
kind: 'data',
|
|
96
|
+
collection: input.collection,
|
|
97
|
+
type: 'json',
|
|
98
|
+
name: input.name,
|
|
99
|
+
meta: input.meta,
|
|
100
|
+
locales: input.locales,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=data.js.map
|
package/d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,CAAC,IAAI,CAAC,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,oEAAoE;QACpE,OAAO,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,yCAAyC;IACzC,KAAK,CAAC,MAAM,CAAC,KAAsB;QACjC,qBAAqB;QACrB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,cAAc;gBACtB,KAAK,EAAE,IAAI,KAAK,CAAC,sBAAsB,KAAK,CAAC,IAAI,EAAE,CAAC;aACrD,CAAC;QACJ,CAAC;QAED,+CAA+C;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,YAAY;gBACpB,KAAK,EAAE,IAAI,KAAK,CAAC,aAAa,KAAK,CAAC,IAAI,iCAAiC,KAAK,CAAC,UAAU,EAAE,CAAC;aAC7F,CAAC;QACJ,CAAC;QAED,qBAAqB;QACrB,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC;YAC5B,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EditorDataBindings } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Reads a site's data bindings off a channel the editor does not control (a
|
|
4
|
+
* build's environment, or a host app that passes them in), or undefined when
|
|
5
|
+
* the value is not bindings at all. A malformed route is dropped and its
|
|
6
|
+
* neighbours kept: one bad route must not cost every other page its data
|
|
7
|
+
* context.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readEditorDataBindings(raw: unknown): EditorDataBindings | undefined;
|
|
10
|
+
//# sourceMappingURL=editor-data-bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-data-bindings.d.ts","sourceRoot":"","sources":["../src/editor-data-bindings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA8CxE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAUnF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** A plain object, not null and not an array. */
|
|
2
|
+
function isRecord(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function isString(value) {
|
|
6
|
+
return typeof value === 'string';
|
|
7
|
+
}
|
|
8
|
+
function isPageSort(value) {
|
|
9
|
+
return value === 'date-desc' || value === 'date-asc' || value === 'title';
|
|
10
|
+
}
|
|
11
|
+
/** A route's page feed with only the fields a feed declares, or undefined when any of them is malformed. */
|
|
12
|
+
function readPageFeed(raw) {
|
|
13
|
+
if (!isRecord(raw))
|
|
14
|
+
return undefined;
|
|
15
|
+
const { prefix, sort, limit } = raw;
|
|
16
|
+
if (!isString(prefix))
|
|
17
|
+
return undefined;
|
|
18
|
+
if (sort !== undefined && !isPageSort(sort))
|
|
19
|
+
return undefined;
|
|
20
|
+
if (limit !== undefined && !(typeof limit === 'number' && limit > 0))
|
|
21
|
+
return undefined;
|
|
22
|
+
return {
|
|
23
|
+
prefix,
|
|
24
|
+
...(sort === undefined ? {} : { sort }),
|
|
25
|
+
...(limit === undefined ? {} : { limit }),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** One route's bindings with only the fields a binding declares, or undefined when any of them is malformed. */
|
|
29
|
+
function readRouteBindings(raw) {
|
|
30
|
+
if (!isRecord(raw))
|
|
31
|
+
return undefined;
|
|
32
|
+
const { collections, locale, pages } = raw;
|
|
33
|
+
if (collections !== undefined && !(Array.isArray(collections) && collections.every(isString)))
|
|
34
|
+
return undefined;
|
|
35
|
+
if (locale !== undefined && !isString(locale))
|
|
36
|
+
return undefined;
|
|
37
|
+
const feed = pages === undefined ? undefined : readPageFeed(pages);
|
|
38
|
+
if (pages !== undefined && feed === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
return {
|
|
41
|
+
...(collections === undefined ? {} : { collections }),
|
|
42
|
+
...(locale === undefined ? {} : { locale }),
|
|
43
|
+
...(feed === undefined ? {} : { pages: feed }),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Reads a site's data bindings off a channel the editor does not control (a
|
|
48
|
+
* build's environment, or a host app that passes them in), or undefined when
|
|
49
|
+
* the value is not bindings at all. A malformed route is dropped and its
|
|
50
|
+
* neighbours kept: one bad route must not cost every other page its data
|
|
51
|
+
* context.
|
|
52
|
+
*/
|
|
53
|
+
export function readEditorDataBindings(raw) {
|
|
54
|
+
if (!isRecord(raw))
|
|
55
|
+
return undefined;
|
|
56
|
+
const { siteName, locale, routes } = raw;
|
|
57
|
+
if (!isString(siteName) || !isString(locale) || !isRecord(routes))
|
|
58
|
+
return undefined;
|
|
59
|
+
const readRoutes = {};
|
|
60
|
+
for (const [collection, route] of Object.entries(routes)) {
|
|
61
|
+
const bindings = readRouteBindings(route);
|
|
62
|
+
if (bindings !== undefined)
|
|
63
|
+
readRoutes[collection] = bindings;
|
|
64
|
+
}
|
|
65
|
+
return { siteName, locale, routes: readRoutes };
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=editor-data-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-data-bindings.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,OAAO,SAAS,CAAC;IACpF,MAAM,UAAU,GAAsC,EAAE,CAAC;IACzD,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,QAAQ,KAAK,SAAS;YAAE,UAAU,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;IAChE,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dual ETag system for content API
|
|
3
|
+
* - Meta ETag: Based on non-derived LocaleManifest fields (using XXH64)
|
|
4
|
+
* - Content ETag: Based on ContentProp.content (using SHA256)
|
|
5
|
+
* Both skip whitespace to allow pretty-printing without affecting hashes
|
|
6
|
+
*
|
|
7
|
+
* Format: "metaEtag.contentEtag" in query strings
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Calculate metadata ETag (XXH64) from buffer view
|
|
11
|
+
* @param buffer - The file buffer view
|
|
12
|
+
* @param start - Start position (inclusive)
|
|
13
|
+
* @param end - End position (exclusive), or -1 for entire buffer
|
|
14
|
+
*/
|
|
15
|
+
export declare function calculateMetaEtagFromBuffer(buffer: Uint8Array, start?: number, end?: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Calculate content ETag using SHA256 from buffer view
|
|
18
|
+
* @param buffer - The file buffer view
|
|
19
|
+
* @param start - Start position (inclusive)
|
|
20
|
+
* @param end - End position (exclusive), or -1 for entire buffer
|
|
21
|
+
*/
|
|
22
|
+
export declare function calculateContentEtagFromBuffer(buffer: Uint8Array, start?: number, end?: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Find the content start position in MDX buffer (after second ---)
|
|
25
|
+
* @param buffer - The MDX content buffer
|
|
26
|
+
* @returns Position where content starts, or -1 if not found
|
|
27
|
+
*/
|
|
28
|
+
export declare function findMdxContentStartPosition(buffer: Uint8Array): number;
|
|
29
|
+
/**
|
|
30
|
+
* Calculate both ETags from an MDX buffer
|
|
31
|
+
*
|
|
32
|
+
* MDX files use YAML frontmatter which has different characteristics than JSON:
|
|
33
|
+
* - YAML does not require quotes around keys or string values
|
|
34
|
+
* - YAML allows multiple formatting styles (flow vs block style)
|
|
35
|
+
* - YAML field order is not significant for parsing
|
|
36
|
+
*
|
|
37
|
+
* Unlike VXJSON which requires "content" to be the last field and needs special
|
|
38
|
+
* parsing to validate structure, YAML frontmatter can be hashed as-is because:
|
|
39
|
+
* 1. The frontmatter boundaries are clearly delimited by ---
|
|
40
|
+
* 2. Different YAML formatting of the same data SHOULD produce different hashes
|
|
41
|
+
* (e.g., flow style [a,b] vs block style with dashes)
|
|
42
|
+
* 3. There's no requirement to validate field ordering
|
|
43
|
+
*
|
|
44
|
+
* This means we can directly hash the YAML bytes without any whitespace
|
|
45
|
+
* normalization or parsing, which is both simpler and more correct.
|
|
46
|
+
*
|
|
47
|
+
* @param buffer - The complete file buffer
|
|
48
|
+
* @param contentStartPos - Position where content starts (after second ---), or -1 if no content
|
|
49
|
+
*/
|
|
50
|
+
export declare function calculateEtagsFromMdxBuffer(buffer: Uint8Array, contentStartPos: number): {
|
|
51
|
+
metaEtag: string;
|
|
52
|
+
contentEtag: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Combined ETag structure
|
|
56
|
+
*/
|
|
57
|
+
export interface DualEtag {
|
|
58
|
+
meta: string;
|
|
59
|
+
content: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Format dual ETags for query string: "meta.content"
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatDualEtag(etags: DualEtag): string;
|
|
65
|
+
/**
|
|
66
|
+
* Parse dual ETags from query string: "meta.content"
|
|
67
|
+
*/
|
|
68
|
+
export declare function parseDualEtag(etag: string): DualEtag | null;
|
|
69
|
+
/**
|
|
70
|
+
* Check if etag matches either meta or content
|
|
71
|
+
*/
|
|
72
|
+
export declare function matchesEtag(providedEtag: string, currentMeta: string, currentContent: string): {
|
|
73
|
+
matches: boolean;
|
|
74
|
+
metaChanged: boolean;
|
|
75
|
+
contentChanged: boolean;
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=etag-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"etag-utils.d.ts","sourceRoot":"","sources":["../src/etag-utils.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,SAAI,EAAE,GAAG,SAAK,GAAG,MAAM,CAQ3F;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,SAAI,EAAE,GAAG,SAAK,GAAG,MAAM,CAQ9F;AAKD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAiCtE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,UAAU,EAClB,eAAe,EAAE,MAAM,GACtB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CA4BA;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAQ3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB,CAkBA"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { JsonWhitespaceSkippingView } from './json-whitespace-view.js';
|
|
3
|
+
import { bigintToUrlSafeBase64, toUrlSafeBase64 } from './url-safe-base64.js';
|
|
4
|
+
import { createXxh64 } from './xxhash.js';
|
|
5
|
+
/**
|
|
6
|
+
* Dual ETag system for content API
|
|
7
|
+
* - Meta ETag: Based on non-derived LocaleManifest fields (using XXH64)
|
|
8
|
+
* - Content ETag: Based on ContentProp.content (using SHA256)
|
|
9
|
+
* Both skip whitespace to allow pretty-printing without affecting hashes
|
|
10
|
+
*
|
|
11
|
+
* Format: "metaEtag.contentEtag" in query strings
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Calculate metadata ETag (XXH64) from buffer view
|
|
15
|
+
* @param buffer - The file buffer view
|
|
16
|
+
* @param start - Start position (inclusive)
|
|
17
|
+
* @param end - End position (exclusive), or -1 for entire buffer
|
|
18
|
+
*/
|
|
19
|
+
export function calculateMetaEtagFromBuffer(buffer, start = 0, end = -1) {
|
|
20
|
+
const actualEnd = end === -1 ? buffer.length : end;
|
|
21
|
+
const hasher = createXxh64();
|
|
22
|
+
const jsonView = new JsonWhitespaceSkippingView(hasher);
|
|
23
|
+
jsonView.updateBuffer(buffer, start, actualEnd);
|
|
24
|
+
return bigintToUrlSafeBase64(hasher.digest());
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Calculate content ETag using SHA256 from buffer view
|
|
28
|
+
* @param buffer - The file buffer view
|
|
29
|
+
* @param start - Start position (inclusive)
|
|
30
|
+
* @param end - End position (exclusive), or -1 for entire buffer
|
|
31
|
+
*/
|
|
32
|
+
export function calculateContentEtagFromBuffer(buffer, start = 0, end = -1) {
|
|
33
|
+
const actualEnd = end === -1 ? buffer.length : end;
|
|
34
|
+
const hasher = createHash('sha256');
|
|
35
|
+
const jsonView = new JsonWhitespaceSkippingView(hasher);
|
|
36
|
+
jsonView.updateBuffer(buffer, start, actualEnd);
|
|
37
|
+
return toUrlSafeBase64(hasher.digest());
|
|
38
|
+
}
|
|
39
|
+
const dashCode = '-'.charCodeAt(0); // 45
|
|
40
|
+
const newlineCode = '\n'.charCodeAt(0); // 10
|
|
41
|
+
/**
|
|
42
|
+
* Find the content start position in MDX buffer (after second ---)
|
|
43
|
+
* @param buffer - The MDX content buffer
|
|
44
|
+
* @returns Position where content starts, or -1 if not found
|
|
45
|
+
*/
|
|
46
|
+
export function findMdxContentStartPosition(buffer) {
|
|
47
|
+
let dashCount = 0;
|
|
48
|
+
let i = 0;
|
|
49
|
+
// Look for the second occurrence of "---\n"
|
|
50
|
+
while (i < buffer.length - 4) {
|
|
51
|
+
if (buffer[i] === dashCode &&
|
|
52
|
+
buffer[i + 1] === dashCode &&
|
|
53
|
+
buffer[i + 2] === dashCode &&
|
|
54
|
+
buffer[i + 3] === newlineCode) {
|
|
55
|
+
dashCount++;
|
|
56
|
+
if (dashCount === 2) {
|
|
57
|
+
// Found second ---, now look for the following newline to get content start
|
|
58
|
+
i += 4; // Skip past "---\n"
|
|
59
|
+
if (i < buffer.length && buffer[i] === newlineCode) {
|
|
60
|
+
return i + 1; // Return position after the empty line
|
|
61
|
+
}
|
|
62
|
+
return i; // Return position right after "---\n"
|
|
63
|
+
}
|
|
64
|
+
i += 4; // Skip this "---\n" and continue looking
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Use indexOf to skip ahead faster instead of incrementing by 1
|
|
68
|
+
const nextDashPos = buffer.indexOf(dashCode, i + 1);
|
|
69
|
+
if (nextDashPos === -1) {
|
|
70
|
+
break; // No more dashes found
|
|
71
|
+
}
|
|
72
|
+
i = nextDashPos;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return -1; // Not found
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Calculate both ETags from an MDX buffer
|
|
79
|
+
*
|
|
80
|
+
* MDX files use YAML frontmatter which has different characteristics than JSON:
|
|
81
|
+
* - YAML does not require quotes around keys or string values
|
|
82
|
+
* - YAML allows multiple formatting styles (flow vs block style)
|
|
83
|
+
* - YAML field order is not significant for parsing
|
|
84
|
+
*
|
|
85
|
+
* Unlike VXJSON which requires "content" to be the last field and needs special
|
|
86
|
+
* parsing to validate structure, YAML frontmatter can be hashed as-is because:
|
|
87
|
+
* 1. The frontmatter boundaries are clearly delimited by ---
|
|
88
|
+
* 2. Different YAML formatting of the same data SHOULD produce different hashes
|
|
89
|
+
* (e.g., flow style [a,b] vs block style with dashes)
|
|
90
|
+
* 3. There's no requirement to validate field ordering
|
|
91
|
+
*
|
|
92
|
+
* This means we can directly hash the YAML bytes without any whitespace
|
|
93
|
+
* normalization or parsing, which is both simpler and more correct.
|
|
94
|
+
*
|
|
95
|
+
* @param buffer - The complete file buffer
|
|
96
|
+
* @param contentStartPos - Position where content starts (after second ---), or -1 if no content
|
|
97
|
+
*/
|
|
98
|
+
export function calculateEtagsFromMdxBuffer(buffer, contentStartPos) {
|
|
99
|
+
if (contentStartPos === -1) {
|
|
100
|
+
// No content, only frontmatter - hash entire buffer as metadata
|
|
101
|
+
const hasher = createXxh64();
|
|
102
|
+
hasher.update(buffer);
|
|
103
|
+
const metaEtag = bigintToUrlSafeBase64(hasher.digest());
|
|
104
|
+
return {
|
|
105
|
+
metaEtag,
|
|
106
|
+
contentEtag: calculateContentEtagFromBuffer(new Uint8Array(0)), // empty content
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// For MDX, we hash the YAML frontmatter as-is (including the --- markers)
|
|
110
|
+
// This is different from JSON where we need to parse and validate structure
|
|
111
|
+
const metaHasher = createXxh64();
|
|
112
|
+
metaHasher.update(buffer.subarray(0, contentStartPos));
|
|
113
|
+
const metaEtag = bigintToUrlSafeBase64(metaHasher.digest());
|
|
114
|
+
// Content is everything after the second ---
|
|
115
|
+
const contentHasher = createHash('sha256');
|
|
116
|
+
contentHasher.update(buffer.subarray(contentStartPos));
|
|
117
|
+
const contentEtag = toUrlSafeBase64(contentHasher.digest());
|
|
118
|
+
return {
|
|
119
|
+
metaEtag,
|
|
120
|
+
contentEtag,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Format dual ETags for query string: "meta.content"
|
|
125
|
+
*/
|
|
126
|
+
export function formatDualEtag(etags) {
|
|
127
|
+
return `${etags.meta}.${etags.content}`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Parse dual ETags from query string: "meta.content"
|
|
131
|
+
*/
|
|
132
|
+
export function parseDualEtag(etag) {
|
|
133
|
+
const parts = etag.split('.');
|
|
134
|
+
if (parts.length !== 2)
|
|
135
|
+
return null;
|
|
136
|
+
return {
|
|
137
|
+
meta: parts[0],
|
|
138
|
+
content: parts[1],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Check if etag matches either meta or content
|
|
143
|
+
*/
|
|
144
|
+
export function matchesEtag(providedEtag, currentMeta, currentContent) {
|
|
145
|
+
const parsed = parseDualEtag(providedEtag);
|
|
146
|
+
if (!parsed) {
|
|
147
|
+
return {
|
|
148
|
+
matches: false,
|
|
149
|
+
metaChanged: true,
|
|
150
|
+
contentChanged: true,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const metaChanged = parsed.meta !== currentMeta;
|
|
154
|
+
const contentChanged = parsed.content !== currentContent;
|
|
155
|
+
return {
|
|
156
|
+
matches: !metaChanged && !contentChanged,
|
|
157
|
+
metaChanged,
|
|
158
|
+
contentChanged,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=etag-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"etag-utils.js","sourceRoot":"","sources":["../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C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACd,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;KAClB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,YAAoB,EACpB,WAAmB,EACnB,cAAsB;IAMtB,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,IAAI;SACrB,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC;IAChD,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,KAAK,cAAc,CAAC;IAEzD,OAAO;QACL,OAAO,EAAE,CAAC,WAAW,IAAI,CAAC,cAAc;QACxC,WAAW;QACX,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { ContentAPI } from './content-api.interface.js';
|
|
2
|
+
import { type IndexProblem } from './content-index.js';
|
|
3
|
+
import { type ContentPathLayout } from './content-path.js';
|
|
4
|
+
import { Data } from './data.js';
|
|
5
|
+
import { Fragments } from './fragments.js';
|
|
6
|
+
import { Site } from './site.js';
|
|
7
|
+
import type { BatchResult, ContentAPIOptions, ContentData, ContentEntry, ContentManifest, CreateContentInput, CreateResult, DeleteLocaleInput, DeleteResult, FindOptions, GlobalFilters, LocalizedEntry, LocalizedManifest, SitesConfig, UpdateLocaleInput, UpdateResult } from './types.js';
|
|
8
|
+
interface ReindexResult {
|
|
9
|
+
filesProcessed: number;
|
|
10
|
+
filesSkipped: number;
|
|
11
|
+
filesDeleted?: number;
|
|
12
|
+
errors?: number;
|
|
13
|
+
updated: LocalizedManifest[];
|
|
14
|
+
deleted?: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
locale: string;
|
|
17
|
+
kind: 'page' | 'fragment' | 'data';
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* FileSystem-based Content API Implementation
|
|
22
|
+
*
|
|
23
|
+
* Stores content as files on disk in a git-friendly format:
|
|
24
|
+
* - Pages: /{site}/pages/{filename}.{locale}.vxjson
|
|
25
|
+
* - Fragments: /fragments/{collection}/{filename}.{locale}.{mdx|vxjson}
|
|
26
|
+
*
|
|
27
|
+
* ## Indexing
|
|
28
|
+
*
|
|
29
|
+
* Content is indexed at startup for performance. The index is cached per
|
|
30
|
+
* content root path and cleared when the process restarts.
|
|
31
|
+
*
|
|
32
|
+
* ## Read-Repair
|
|
33
|
+
*
|
|
34
|
+
* Since files can be modified externally (git, editors), this implementation:
|
|
35
|
+
*
|
|
36
|
+
* 1. Repairs invalid VXJSON files (ensures "content" field is last)
|
|
37
|
+
* 2. Adds missing required fields (id, created, modified)
|
|
38
|
+
* 3. Handles files added after initial indexing
|
|
39
|
+
* 4. Updates the index when files are repaired or discovered
|
|
40
|
+
*
|
|
41
|
+
* ## Performance
|
|
42
|
+
*
|
|
43
|
+
* - Initial indexing reads only first 4KB of each file
|
|
44
|
+
* - Full content is loaded on demand
|
|
45
|
+
* - ETags are calculated using streaming for efficiency
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Read and validate `<contentRoot>/sites.json`. Returns a safe default
|
|
49
|
+
* (`{ sites: {}, globalLocales: ['en'] }`) when the file is missing or
|
|
50
|
+
* has invalid structure, with a warning logged in each case.
|
|
51
|
+
*
|
|
52
|
+
* Exported standalone so the Astro integration (and any other tooling
|
|
53
|
+
* that needs to inspect per-site config at startup time) can read the
|
|
54
|
+
* config without spinning up a full content-api instance.
|
|
55
|
+
*/
|
|
56
|
+
export declare function readSitesConfig(contentRoot: string): Promise<SitesConfig>;
|
|
57
|
+
export type { IndexProblem } from './content-index.js';
|
|
58
|
+
export declare class FileSystemContentAPI implements ContentAPI {
|
|
59
|
+
private contentRoot;
|
|
60
|
+
private absoluteContentRoot;
|
|
61
|
+
private contentIndex;
|
|
62
|
+
readonly sitesConfig: SitesConfig;
|
|
63
|
+
readonly fragments: Fragments;
|
|
64
|
+
readonly data: Data;
|
|
65
|
+
private readonly sites;
|
|
66
|
+
private absoluteMdxPagesRoot?;
|
|
67
|
+
private mdxPagesDefaultLocale;
|
|
68
|
+
private mdxPagesSite;
|
|
69
|
+
private mdxPagesCollection;
|
|
70
|
+
private readonly availableLocales;
|
|
71
|
+
get normalizedContentRoot(): string;
|
|
72
|
+
private constructor();
|
|
73
|
+
static create(options: ContentAPIOptions): Promise<FileSystemContentAPI>;
|
|
74
|
+
/**
|
|
75
|
+
* Hydrate the content index for this FileSystemContentAPI by scanning the
|
|
76
|
+
* content root and running parseFileHeaderWithRepair on each file. This is
|
|
77
|
+
* the legacy hydration path that preserves the filesystem read-repair
|
|
78
|
+
* behavior (file renames, canonical-form rewrites, id/timestamp backfill).
|
|
79
|
+
*
|
|
80
|
+
* ContentIndex.indexAll(backend) is the backend-agnostic replacement for
|
|
81
|
+
* content that is not on disk; this private method exists so FileSystemContentAPI
|
|
82
|
+
* can keep its repair-on-read side effects until they are lifted onto a
|
|
83
|
+
* dedicated FileSystemReaderBackend field.
|
|
84
|
+
*/
|
|
85
|
+
private indexAllContent;
|
|
86
|
+
/**
|
|
87
|
+
* Record a file the indexer could not read. Signature matches the `onError`
|
|
88
|
+
* callback of ContentIndex.indexAll so it can be handed over unchanged when
|
|
89
|
+
* this class migrates off the legacy repair-on-read hydration path. The
|
|
90
|
+
* problems live on the index itself, not on this instance: the index is
|
|
91
|
+
* cached per content root, and a later instance over the same root reuses it
|
|
92
|
+
* without re-indexing, so instance-local problems would vanish.
|
|
93
|
+
*/
|
|
94
|
+
private recordIndexProblem;
|
|
95
|
+
/**
|
|
96
|
+
* Files the indexer could not read. They are absent from listAllContent(),
|
|
97
|
+
* so any caller that treats that list as complete — `conloca doctor`, most
|
|
98
|
+
* of all — must consult this to avoid reporting success over broken content.
|
|
99
|
+
*/
|
|
100
|
+
getIndexProblems(): readonly IndexProblem[];
|
|
101
|
+
/**
|
|
102
|
+
* Clear all caches - useful for testing
|
|
103
|
+
*/
|
|
104
|
+
static clearCaches(): void;
|
|
105
|
+
private parseFileHeaderWithRepair;
|
|
106
|
+
/**
|
|
107
|
+
* Perform read-repair by writing back the file with missing fields
|
|
108
|
+
* This ensures stable IDs and timestamps across restarts
|
|
109
|
+
*/
|
|
110
|
+
private performReadRepair;
|
|
111
|
+
private scanContentFiles;
|
|
112
|
+
/**
|
|
113
|
+
* Why a page of `type` cannot have `pathname` in `locale` where `getFilePath` puts it: an mdx
|
|
114
|
+
* page lives in the MDX pages folder when one is configured, where a default-language path may
|
|
115
|
+
* not start with a language folder (see `checkMdxPagesPathname`).
|
|
116
|
+
*/
|
|
117
|
+
private mdxPagesPathnameRefusal;
|
|
118
|
+
private getFilePath;
|
|
119
|
+
/**
|
|
120
|
+
* Parse a file path back into its components for checking against the path index
|
|
121
|
+
* Returns null if the path doesn't match expected patterns
|
|
122
|
+
*/
|
|
123
|
+
parseFilePath(filePath: string): ContentPathLayout | null;
|
|
124
|
+
getContent(id: string): Promise<ContentEntry | null>;
|
|
125
|
+
getLocalized(id: string, locale: string): Promise<LocalizedEntry | null>;
|
|
126
|
+
private readLocaleFile;
|
|
127
|
+
createContent(data: CreateContentInput): Promise<CreateResult>;
|
|
128
|
+
updateLocalized(input: UpdateLocaleInput): Promise<UpdateResult>;
|
|
129
|
+
deleteContent(id: string, etag: string): Promise<DeleteResult>;
|
|
130
|
+
deleteLocalized(input: DeleteLocaleInput): Promise<DeleteResult>;
|
|
131
|
+
getSite(siteName: string): Site | null;
|
|
132
|
+
listAllContent(filters?: GlobalFilters): Generator<ContentManifest>;
|
|
133
|
+
findUntranslatedContent(targetLocale: string, options?: FindOptions): Generator<ContentManifest>;
|
|
134
|
+
/**
|
|
135
|
+
* Reindex files that were added or changed after initial creation
|
|
136
|
+
*
|
|
137
|
+
* This method:
|
|
138
|
+
* 1. Either scans for all content files or processes specific paths
|
|
139
|
+
* 2. Uses the path index to check if files are already indexed
|
|
140
|
+
* 3. Indexes new files or force-reindexes specified files
|
|
141
|
+
* 4. Optionally handles file deletions
|
|
142
|
+
*
|
|
143
|
+
* @param paths - Optional array of specific file paths to reindex. If not provided, scans all content files.
|
|
144
|
+
* @param options - Options for reindexing behavior
|
|
145
|
+
* @returns Statistics about the reindexing operation
|
|
146
|
+
*/
|
|
147
|
+
reindex(paths?: string[], options?: {
|
|
148
|
+
handleDeletions?: boolean;
|
|
149
|
+
}): Promise<ReindexResult>;
|
|
150
|
+
/**
|
|
151
|
+
* Read content directly from cache
|
|
152
|
+
* For testing purposes - returns null if not cached
|
|
153
|
+
*/
|
|
154
|
+
readFromCache(id: string, locale: string): Promise<ContentData | null>;
|
|
155
|
+
getContentAsBuffer(id: string, locale: string): Promise<{
|
|
156
|
+
buffer: Uint8Array;
|
|
157
|
+
etag: string;
|
|
158
|
+
contentType: 'application/json' | 'text/mdx';
|
|
159
|
+
} | null>;
|
|
160
|
+
batchUpdate(operations: UpdateLocaleInput[]): Promise<BatchResult>;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=filesystem-content-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem-content-api.d.ts","sourceRoot":"","sources":["../src/filesystem-content-api.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAoC,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAiB7G,OAAO,EAAE,KAAK,iBAAiB,EAA+C,MAAM,mBAAmB,CAAC;AAQxG,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,C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