@drawnagency/primitives 0.1.114 → 0.1.116
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/chunk-26V4YNOR.js +108 -0
- package/dist/{chunk-OAGJBCSH.js → chunk-4WQ36ZP7.js} +19 -3
- package/dist/{chunk-PTY2RG2K.js → chunk-67P34WNW.js} +75 -130
- package/dist/chunk-APIJPTFG.js +64 -0
- package/dist/chunk-CDBURDPX.js +90 -0
- package/dist/{chunk-PLANHXS7.js → chunk-CEFFP3CH.js} +2 -2
- package/dist/chunk-DFKTF3CH.js +0 -0
- package/dist/chunk-DJABADOO.js +131 -0
- package/dist/{chunk-IP2SEBAJ.js → chunk-DJOGPSRU.js} +31 -72
- package/dist/chunk-DKZCHCV3.js +64 -0
- package/dist/chunk-FGQXHUAE.js +39 -0
- package/dist/chunk-GNF6KFQ7.js +18 -0
- package/dist/{chunk-QHMKIODQ.js → chunk-HHNPSKPT.js} +2 -89
- package/dist/{chunk-PZPGJZRG.js → chunk-HUOW3ZV2.js} +3 -3
- package/dist/{chunk-Y5QECJX7.js → chunk-L7WTERU5.js} +2 -2
- package/dist/{chunk-N3G7DOU3.js → chunk-LNQUUC2S.js} +2 -2
- package/dist/{chunk-7SAAJVDE.js → chunk-MSBHMY3C.js} +17 -15
- package/dist/{chunk-PNSCDBU7.js → chunk-O37AV27P.js} +6 -49
- package/dist/{chunk-5KSAS4VY.js → chunk-RIITGTV3.js} +1 -1
- package/dist/chunk-S7QRHUWO.js +8 -0
- package/dist/chunk-VY3IFGE3.js +70 -0
- package/dist/{chunk-VUYCRBJK.js → chunk-W72BPGR3.js} +7 -5
- package/dist/collab/rebase.d.ts.map +1 -1
- package/dist/collab/rebase.js +15 -15
- package/dist/components/editor/index.js +8 -8
- package/dist/components/primitives/index.js +14 -9
- package/dist/components/sections/brand-guide.js +12 -7
- package/dist/components/sections/register-schemas.js +17 -12
- package/dist/components/sections/register.js +17 -12
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/deck-builder/index.js +6 -6
- package/dist/hooks/useEditorPublish.d.ts +4 -1
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/index.js +78 -49
- package/dist/lib/dexie.d.ts +7 -1
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +3 -2
- package/dist/lib/document-refs.d.ts +8 -0
- package/dist/lib/document-refs.d.ts.map +1 -1
- package/dist/lib/document-refs.js +14 -0
- package/dist/lib/image-variant-plan.d.ts +42 -0
- package/dist/lib/image-variant-plan.d.ts.map +1 -0
- package/dist/lib/image-variant-plan.js +53 -0
- package/dist/lib/index-ops.d.ts.map +1 -1
- package/dist/lib/index-ops.js +20 -16
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +36 -15
- package/dist/lib/loader.d.ts +16 -17
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/media-ops.d.ts +73 -0
- package/dist/lib/media-ops.d.ts.map +1 -0
- package/dist/lib/media-ops.js +60 -0
- package/dist/lib/nav-tree.d.ts +6 -0
- package/dist/lib/nav-tree.d.ts.map +1 -1
- package/dist/lib/pages.d.ts +2 -1
- package/dist/lib/pages.d.ts.map +1 -1
- package/dist/lib/reference-validation.js +4 -33
- package/dist/lib/section-check.d.ts +49 -0
- package/dist/lib/section-check.d.ts.map +1 -0
- package/dist/lib/section-check.js +14 -0
- package/dist/lib/sidecar-diagnostics.d.ts +20 -0
- package/dist/lib/sidecar-diagnostics.d.ts.map +1 -0
- package/dist/lib/sidecars.d.ts +118 -0
- package/dist/lib/sidecars.d.ts.map +1 -0
- package/dist/lib/sidecars.js +23 -0
- package/dist/lib/site-validation.d.ts +123 -0
- package/dist/lib/site-validation.d.ts.map +1 -0
- package/dist/lib/site-validation.js +230 -0
- package/dist/lib/slug.d.ts +2 -0
- package/dist/lib/slug.d.ts.map +1 -0
- package/dist/lib/storage-tier.d.ts +17 -0
- package/dist/lib/storage-tier.d.ts.map +1 -0
- package/dist/lib/storage-tier.js +29 -0
- package/dist/lib/tags.d.ts +6 -0
- package/dist/lib/tags.d.ts.map +1 -1
- package/dist/media/index.js +15 -15
- package/dist/media/queue.d.ts +2 -0
- package/dist/media/queue.d.ts.map +1 -1
- package/dist/media/worker.d.ts +1 -35
- package/dist/media/worker.d.ts.map +1 -1
- package/dist/schemas/index.js +18 -12
- package/dist/schemas/media.d.ts +4 -0
- package/dist/schemas/media.d.ts.map +1 -1
- package/dist/storage/index.js +2 -1
- package/dist/storage/memory.d.ts +21 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/memory.js +129 -0
- package/dist/storage/types.d.ts +9 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/package.json +34 -1
- package/src/collab/rebase.ts +12 -16
- package/src/components/shell/EditorShell.tsx +7 -4
- package/src/hooks/useEditorPublish.ts +9 -4
- package/src/hooks/useMediaPipeline.ts +29 -23
- package/src/lib/dexie.ts +9 -1
- package/src/lib/document-refs.ts +30 -0
- package/src/lib/image-variant-plan.ts +92 -0
- package/src/lib/index-ops.ts +9 -18
- package/src/lib/index.ts +15 -0
- package/src/lib/loader.ts +18 -77
- package/src/lib/media-ops.ts +112 -0
- package/src/lib/nav-tree.ts +33 -4
- package/src/lib/pages.ts +2 -3
- package/src/lib/section-check.ts +166 -0
- package/src/lib/sidecar-diagnostics.ts +29 -0
- package/src/lib/sidecars.ts +221 -0
- package/src/lib/site-validation.ts +269 -0
- package/src/lib/slug.ts +6 -0
- package/src/lib/storage-tier.ts +38 -0
- package/src/lib/tags.ts +20 -3
- package/src/media/queue.ts +3 -0
- package/src/media/utils.ts +1 -1
- package/src/media/worker.ts +17 -8
- package/src/schemas/media.ts +7 -2
- package/src/storage/memory.ts +178 -0
- package/src/storage/types.ts +15 -2
- /package/dist/{chunk-45FA7Z55.js → chunk-UUUSJDIG.js} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { type SidecarDiagnostic } from "./sidecars";
|
|
2
|
+
import { type ReferenceProblem } from "./reference-validation";
|
|
3
|
+
/** What the caller can vouch for. Never how severe anything is — that is SEVERITY. */
|
|
4
|
+
export interface SiteValidationPolicy {
|
|
5
|
+
/**
|
|
6
|
+
* A section type with no registered schema: `trust` reads it as a real type
|
|
7
|
+
* this caller cannot check (the connector, whose branch index is the proof; a
|
|
8
|
+
* CLI whose site sections module failed to load), `reject` as an unknown type.
|
|
9
|
+
*/
|
|
10
|
+
unregisteredTypes: "trust" | "reject";
|
|
11
|
+
}
|
|
12
|
+
export interface SchemaIssue {
|
|
13
|
+
path: readonly PropertyKey[];
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
type ProblemBody = {
|
|
17
|
+
code: "index-missing";
|
|
18
|
+
} | {
|
|
19
|
+
code: "index-invalid";
|
|
20
|
+
detail: string;
|
|
21
|
+
} | {
|
|
22
|
+
code: "site-id-empty";
|
|
23
|
+
} | {
|
|
24
|
+
code: "site-config-missing";
|
|
25
|
+
} | {
|
|
26
|
+
code: "site-config-invalid";
|
|
27
|
+
detail: string;
|
|
28
|
+
} | {
|
|
29
|
+
code: "sidecar-degraded";
|
|
30
|
+
sidecar: "nav" | "tags";
|
|
31
|
+
} | {
|
|
32
|
+
code: "sidecar-repaired";
|
|
33
|
+
sidecar: "nav" | "tags";
|
|
34
|
+
diagnostic: SidecarDiagnostic;
|
|
35
|
+
} | {
|
|
36
|
+
code: "image-manifest-invalid";
|
|
37
|
+
detail: string;
|
|
38
|
+
} | {
|
|
39
|
+
code: "document-manifest-invalid";
|
|
40
|
+
detail: string;
|
|
41
|
+
} | {
|
|
42
|
+
code: "section-missing";
|
|
43
|
+
sectionId: string;
|
|
44
|
+
} | {
|
|
45
|
+
code: "section-unparseable";
|
|
46
|
+
sectionId: string;
|
|
47
|
+
detail: string;
|
|
48
|
+
} | {
|
|
49
|
+
code: "section-id-mismatch";
|
|
50
|
+
sectionId: string;
|
|
51
|
+
fileId: unknown;
|
|
52
|
+
} | {
|
|
53
|
+
code: "section-type-mismatch";
|
|
54
|
+
sectionId: string;
|
|
55
|
+
fileType: unknown;
|
|
56
|
+
indexType: string;
|
|
57
|
+
} | {
|
|
58
|
+
code: "unknown-type";
|
|
59
|
+
sectionId: string;
|
|
60
|
+
type: string;
|
|
61
|
+
} | {
|
|
62
|
+
code: "unvalidated-type";
|
|
63
|
+
sectionId: string;
|
|
64
|
+
type: string;
|
|
65
|
+
} | {
|
|
66
|
+
code: "section-invalid";
|
|
67
|
+
sectionId: string;
|
|
68
|
+
type: string;
|
|
69
|
+
issues: SchemaIssue[];
|
|
70
|
+
} | {
|
|
71
|
+
code: "layout-invalid";
|
|
72
|
+
sectionId: string;
|
|
73
|
+
issues: SchemaIssue[];
|
|
74
|
+
} | {
|
|
75
|
+
code: "too-deep";
|
|
76
|
+
sectionId: string;
|
|
77
|
+
} | {
|
|
78
|
+
code: "reference-in-container";
|
|
79
|
+
sectionId: string;
|
|
80
|
+
} | {
|
|
81
|
+
code: "html-entities";
|
|
82
|
+
sectionId: string;
|
|
83
|
+
path: string;
|
|
84
|
+
entities: string[];
|
|
85
|
+
} | {
|
|
86
|
+
code: "dangling-image";
|
|
87
|
+
sectionId: string;
|
|
88
|
+
imageId: string;
|
|
89
|
+
} | {
|
|
90
|
+
code: "dangling-document";
|
|
91
|
+
sectionId: string;
|
|
92
|
+
documentId: string;
|
|
93
|
+
} | {
|
|
94
|
+
code: "reference-problem";
|
|
95
|
+
problem: ReferenceProblem;
|
|
96
|
+
};
|
|
97
|
+
export type SiteProblemCode = ProblemBody["code"];
|
|
98
|
+
export type Severity = "error" | "warning";
|
|
99
|
+
export type SiteProblem = ProblemBody & {
|
|
100
|
+
severity: Severity;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* The one severity table every caller shares. An ERROR is something the site
|
|
104
|
+
* cannot load, or authored content it silently loses or rejects. A WARNING is
|
|
105
|
+
* something the site renders through — dropping or repairing it itself — and
|
|
106
|
+
* that is fixable in-product, so it must not fail a build.
|
|
107
|
+
*/
|
|
108
|
+
export declare const SEVERITY: Readonly<Record<SiteProblemCode, Severity>>;
|
|
109
|
+
export interface SiteValidation {
|
|
110
|
+
problems: SiteProblem[];
|
|
111
|
+
/** The section ids the index places on pages; null when the index could not be read. */
|
|
112
|
+
placedIds: string[] | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validate a site's committed content. `files` maps repo paths under
|
|
116
|
+
* `src/content/` to their text; an absent path is an absent file. Pure: it reads
|
|
117
|
+
* the schema registry, so callers register built-in (and any site-local)
|
|
118
|
+
* schemas first. Only sections the index places on a page are judged — orphan
|
|
119
|
+
* files are the caller's concern.
|
|
120
|
+
*/
|
|
121
|
+
export declare function validateSite(files: Readonly<Record<string, string>>, policy: SiteValidationPolicy): SiteValidation;
|
|
122
|
+
export {};
|
|
123
|
+
//# sourceMappingURL=site-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-validation.d.ts","sourceRoot":"","sources":["../../src/lib/site-validation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsD,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKxG,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAOlF,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,GAAG,QAAQ,CAAC;CACvC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,WAAW,GACZ;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IA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AAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAiJlH"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectDocumentIds
|
|
3
|
+
} from "../chunk-DKZCHCV3.js";
|
|
4
|
+
import {
|
|
5
|
+
referenceProblems
|
|
6
|
+
} from "../chunk-FGQXHUAE.js";
|
|
7
|
+
import {
|
|
8
|
+
checkSection
|
|
9
|
+
} from "../chunk-26V4YNOR.js";
|
|
10
|
+
import {
|
|
11
|
+
upgradeLegacySection
|
|
12
|
+
} from "../chunk-FRVO75DK.js";
|
|
13
|
+
import "../chunk-L45X7DKX.js";
|
|
14
|
+
import {
|
|
15
|
+
NAV,
|
|
16
|
+
TAGS,
|
|
17
|
+
readSidecarText
|
|
18
|
+
} from "../chunk-DJABADOO.js";
|
|
19
|
+
import "../chunk-DJOGPSRU.js";
|
|
20
|
+
import "../chunk-4WQ36ZP7.js";
|
|
21
|
+
import "../chunk-GNF6KFQ7.js";
|
|
22
|
+
import "../chunk-5GFACGSN.js";
|
|
23
|
+
import {
|
|
24
|
+
IndexSchema,
|
|
25
|
+
SiteConfigSchema
|
|
26
|
+
} from "../chunk-67P34WNW.js";
|
|
27
|
+
import "../chunk-4TZJZU2T.js";
|
|
28
|
+
import "../chunk-4Y2JQQZL.js";
|
|
29
|
+
import {
|
|
30
|
+
ImageManifestSchema
|
|
31
|
+
} from "../chunk-APIJPTFG.js";
|
|
32
|
+
import "../chunk-FTPETWXE.js";
|
|
33
|
+
import "../chunk-AASEGXNT.js";
|
|
34
|
+
import "../chunk-NSCT3AMV.js";
|
|
35
|
+
import {
|
|
36
|
+
DOCUMENT_MANIFEST_PATH,
|
|
37
|
+
DocumentManifestSchema
|
|
38
|
+
} from "../chunk-BS5AQHZG.js";
|
|
39
|
+
import "../chunk-JSBRDJBE.js";
|
|
40
|
+
|
|
41
|
+
// src/lib/image-refs.ts
|
|
42
|
+
function tallyImageIds(value, counts = /* @__PURE__ */ new Map()) {
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
for (const item of value) tallyImageIds(item, counts);
|
|
45
|
+
} else if (value !== null && typeof value === "object") {
|
|
46
|
+
for (const [key, v] of Object.entries(value)) {
|
|
47
|
+
if (key === "imageId" && typeof v === "string" && v !== "") {
|
|
48
|
+
counts.set(v, (counts.get(v) ?? 0) + 1);
|
|
49
|
+
} else {
|
|
50
|
+
tallyImageIds(v, counts);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return counts;
|
|
55
|
+
}
|
|
56
|
+
function collectImageIds(value) {
|
|
57
|
+
return new Set(tallyImageIds(value).keys());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/lib/site-validation.ts
|
|
61
|
+
var INDEX_PATH = "src/content/index.json";
|
|
62
|
+
var SITE_CONFIG_PATH = "src/content/site-config.json";
|
|
63
|
+
var IMAGE_MANIFEST_PATH = "src/content/image-manifest.json";
|
|
64
|
+
var sectionPath = (id) => `src/content/sections/${id}.json`;
|
|
65
|
+
var SEVERITY = {
|
|
66
|
+
"index-missing": "error",
|
|
67
|
+
"index-invalid": "error",
|
|
68
|
+
"site-id-empty": "error",
|
|
69
|
+
"site-config-missing": "error",
|
|
70
|
+
"site-config-invalid": "error",
|
|
71
|
+
// The loader drops what it cannot read, so authored grouping or tags vanish.
|
|
72
|
+
"sidecar-degraded": "error",
|
|
73
|
+
// What reconcile repairs on every load: the runtime has already fixed it.
|
|
74
|
+
"sidecar-repaired": "warning",
|
|
75
|
+
"image-manifest-invalid": "error",
|
|
76
|
+
"document-manifest-invalid": "error",
|
|
77
|
+
"section-missing": "error",
|
|
78
|
+
"section-unparseable": "error",
|
|
79
|
+
"section-id-mismatch": "error",
|
|
80
|
+
"section-type-mismatch": "error",
|
|
81
|
+
"unknown-type": "error",
|
|
82
|
+
"unvalidated-type": "warning",
|
|
83
|
+
"section-invalid": "error",
|
|
84
|
+
"layout-invalid": "error",
|
|
85
|
+
"too-deep": "error",
|
|
86
|
+
"reference-in-container": "error",
|
|
87
|
+
"html-entities": "warning",
|
|
88
|
+
"dangling-image": "warning",
|
|
89
|
+
"dangling-document": "warning",
|
|
90
|
+
"reference-problem": "warning"
|
|
91
|
+
};
|
|
92
|
+
function parseJson(text) {
|
|
93
|
+
try {
|
|
94
|
+
return { ok: true, value: JSON.parse(text) };
|
|
95
|
+
} catch (e) {
|
|
96
|
+
return { ok: false, detail: e instanceof Error ? e.message : String(e) };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function parseFile(text, schema) {
|
|
100
|
+
const json = parseJson(text);
|
|
101
|
+
if (!json.ok) return json;
|
|
102
|
+
const parsed = schema.safeParse(json.value);
|
|
103
|
+
return parsed.success ? { ok: true, data: parsed.data } : { ok: false, detail: parsed.error.message };
|
|
104
|
+
}
|
|
105
|
+
function validateSite(files, policy) {
|
|
106
|
+
const problems = [];
|
|
107
|
+
const report = (body) => problems.push({ ...body, severity: SEVERITY[body.code] });
|
|
108
|
+
const indexText = files[INDEX_PATH];
|
|
109
|
+
if (indexText === void 0) {
|
|
110
|
+
report({ code: "index-missing" });
|
|
111
|
+
return { problems, placedIds: null };
|
|
112
|
+
}
|
|
113
|
+
const indexRead = parseFile(indexText, IndexSchema);
|
|
114
|
+
if (!indexRead.ok) {
|
|
115
|
+
report({ code: "index-invalid", detail: indexRead.detail });
|
|
116
|
+
return { problems, placedIds: null };
|
|
117
|
+
}
|
|
118
|
+
const index = indexRead.data;
|
|
119
|
+
const placedIds = [...new Set(index.pages.flatMap((p) => p.order))];
|
|
120
|
+
if (!index.siteId) report({ code: "site-id-empty" });
|
|
121
|
+
const configText = files[SITE_CONFIG_PATH];
|
|
122
|
+
if (configText === void 0) {
|
|
123
|
+
report({ code: "site-config-missing" });
|
|
124
|
+
} else {
|
|
125
|
+
const configRead = parseFile(configText, SiteConfigSchema);
|
|
126
|
+
if (!configRead.ok) report({ code: "site-config-invalid", detail: configRead.detail });
|
|
127
|
+
}
|
|
128
|
+
const checkSidecar = (def) => {
|
|
129
|
+
const text = files[def.path];
|
|
130
|
+
if (text === void 0) return [];
|
|
131
|
+
const read = readSidecarText(def, text);
|
|
132
|
+
if (read.degraded) {
|
|
133
|
+
report({ code: "sidecar-degraded", sidecar: def.name });
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
for (const diagnostic of def.reconcile(read.entries, index).diagnostics) {
|
|
137
|
+
report({ code: "sidecar-repaired", sidecar: def.name, diagnostic });
|
|
138
|
+
}
|
|
139
|
+
return read.entries;
|
|
140
|
+
};
|
|
141
|
+
checkSidecar(NAV);
|
|
142
|
+
const tags = checkSidecar(TAGS);
|
|
143
|
+
const tagIds = tags === null ? null : new Set(tags.map((t) => t.id));
|
|
144
|
+
let imageIds = /* @__PURE__ */ new Set();
|
|
145
|
+
const imageText = files[IMAGE_MANIFEST_PATH];
|
|
146
|
+
if (imageText !== void 0) {
|
|
147
|
+
const read = parseFile(imageText, ImageManifestSchema);
|
|
148
|
+
if (read.ok) imageIds = new Set(Object.keys(read.data.images));
|
|
149
|
+
else {
|
|
150
|
+
report({ code: "image-manifest-invalid", detail: read.detail });
|
|
151
|
+
imageIds = null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
let documentIds = /* @__PURE__ */ new Set();
|
|
155
|
+
const documentText = files[DOCUMENT_MANIFEST_PATH];
|
|
156
|
+
if (documentText !== void 0) {
|
|
157
|
+
const read = parseFile(documentText, DocumentManifestSchema);
|
|
158
|
+
if (read.ok) documentIds = new Set(Object.keys(read.data));
|
|
159
|
+
else {
|
|
160
|
+
report({ code: "document-manifest-invalid", detail: read.detail });
|
|
161
|
+
documentIds = null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const bodies = [];
|
|
165
|
+
for (const id of placedIds) {
|
|
166
|
+
const text = files[sectionPath(id)];
|
|
167
|
+
if (text === void 0) {
|
|
168
|
+
report({ code: "section-missing", sectionId: id });
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const json = parseJson(text);
|
|
172
|
+
if (!json.ok) {
|
|
173
|
+
report({ code: "section-unparseable", sectionId: id, detail: json.detail });
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const onDisk = typeof json.value === "object" && json.value !== null ? json.value : {};
|
|
177
|
+
if (onDisk.id !== id) report({ code: "section-id-mismatch", sectionId: id, fileId: onDisk.id });
|
|
178
|
+
const body = upgradeLegacySection(json.value);
|
|
179
|
+
bodies.push({ id, content: body });
|
|
180
|
+
const upgradedType = typeof body === "object" && body !== null ? body.type : void 0;
|
|
181
|
+
const type = typeof upgradedType === "string" ? upgradedType : "";
|
|
182
|
+
const indexType = index.sections[id].type;
|
|
183
|
+
if (indexType !== onDisk.type && indexType !== upgradedType) {
|
|
184
|
+
report({ code: "section-type-mismatch", sectionId: id, fileType: onDisk.type, indexType });
|
|
185
|
+
}
|
|
186
|
+
if (type === "") continue;
|
|
187
|
+
const check = checkSection(type, body);
|
|
188
|
+
if (check.unregistered) {
|
|
189
|
+
if (policy.unregisteredTypes === "reject") {
|
|
190
|
+
report({ code: "unknown-type", sectionId: id, type });
|
|
191
|
+
} else {
|
|
192
|
+
report({ code: "unvalidated-type", sectionId: id, type });
|
|
193
|
+
if (check.error?.code === "depth") report({ code: "too-deep", sectionId: id });
|
|
194
|
+
}
|
|
195
|
+
} else if (check.error) {
|
|
196
|
+
const error = check.error;
|
|
197
|
+
switch (error.code) {
|
|
198
|
+
case "schema":
|
|
199
|
+
report({ code: "section-invalid", sectionId: id, type, issues: error.zodError.issues });
|
|
200
|
+
break;
|
|
201
|
+
case "layout":
|
|
202
|
+
report({ code: "layout-invalid", sectionId: id, issues: error.zodError.issues });
|
|
203
|
+
break;
|
|
204
|
+
case "depth":
|
|
205
|
+
report({ code: "too-deep", sectionId: id });
|
|
206
|
+
break;
|
|
207
|
+
case "reference-in-container":
|
|
208
|
+
report({ code: "reference-in-container", sectionId: id });
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
for (const { path, entities } of check.entities) report({ code: "html-entities", sectionId: id, path, entities });
|
|
213
|
+
if (imageIds) {
|
|
214
|
+
for (const imageId of collectImageIds(body)) {
|
|
215
|
+
if (!imageIds.has(imageId)) report({ code: "dangling-image", sectionId: id, imageId });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (documentIds) {
|
|
219
|
+
for (const documentId of collectDocumentIds(body)) {
|
|
220
|
+
if (!documentIds.has(documentId)) report({ code: "dangling-document", sectionId: id, documentId });
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
for (const problem of referenceProblems(bodies, index, tagIds)) report({ code: "reference-problem", problem });
|
|
225
|
+
return { problems, placedIds };
|
|
226
|
+
}
|
|
227
|
+
export {
|
|
228
|
+
SEVERITY,
|
|
229
|
+
validateSite
|
|
230
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slug.d.ts","sourceRoot":"","sources":["../../src/lib/slug.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DOCUMENT_GIT_MAX_BYTES, DOCUMENT_BUCKET_MAX_BYTES } from "../schemas/documents";
|
|
2
|
+
import { MEDIA_GIT_MAX_BYTES, MEDIA_BUCKET_MAX_BYTES, type MediaConfig } from "../schemas/media";
|
|
3
|
+
export { DOCUMENT_GIT_MAX_BYTES, DOCUMENT_BUCKET_MAX_BYTES, MEDIA_GIT_MAX_BYTES, MEDIA_BUCKET_MAX_BYTES };
|
|
4
|
+
/**
|
|
5
|
+
* The MCP connector's own document ceiling, half the bucket cap. The binding
|
|
6
|
+
* constraint is memory, not time: a presigned PUT cannot stream, so the whole
|
|
7
|
+
* body is buffered (peak about 2x the file). The browser path has no such
|
|
8
|
+
* limit because those bytes never pass through a function.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DOCUMENT_CONNECTOR_MAX_BYTES = 104857600;
|
|
11
|
+
export type StorageTier = "git" | "bucket" | "too_large";
|
|
12
|
+
type MediaLimits = Pick<MediaConfig, "maxFileSize" | "maxAssetSize">;
|
|
13
|
+
/** Media limits come from the site's `media` config; documents' are fixed. */
|
|
14
|
+
export declare function tierFor(kind: "document" | "media", bytes: number, media?: MediaLimits): StorageTier;
|
|
15
|
+
/** "2.5 MB", "100 MB" — one decimal at most, in binary megabytes. */
|
|
16
|
+
export declare function formatBytes(bytes: number): string;
|
|
17
|
+
//# sourceMappingURL=storage-tier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-tier.d.ts","sourceRoot":"","sources":["../../src/lib/storage-tier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOjG,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;AAE1G;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,YAAc,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEzD,KAAK,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,cAAc,CAAC,CAAC;AAErE,8EAA8E;AAC9E,wBAAgB,OAAO,CACrB,IAAI,EAAE,UAAU,GAAG,OAAO,EAC1B,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,WAAwF,GAC9F,WAAW,CAKb;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MEDIA_BUCKET_MAX_BYTES,
|
|
3
|
+
MEDIA_GIT_MAX_BYTES
|
|
4
|
+
} from "../chunk-APIJPTFG.js";
|
|
5
|
+
import {
|
|
6
|
+
DOCUMENT_BUCKET_MAX_BYTES,
|
|
7
|
+
DOCUMENT_GIT_MAX_BYTES
|
|
8
|
+
} from "../chunk-BS5AQHZG.js";
|
|
9
|
+
import "../chunk-JSBRDJBE.js";
|
|
10
|
+
|
|
11
|
+
// src/lib/storage-tier.ts
|
|
12
|
+
var DOCUMENT_CONNECTOR_MAX_BYTES = 104857600;
|
|
13
|
+
function tierFor(kind, bytes, media = { maxFileSize: MEDIA_GIT_MAX_BYTES, maxAssetSize: MEDIA_BUCKET_MAX_BYTES }) {
|
|
14
|
+
const [gitMax, bucketMax] = kind === "document" ? [DOCUMENT_GIT_MAX_BYTES, DOCUMENT_BUCKET_MAX_BYTES] : [media.maxFileSize, media.maxAssetSize];
|
|
15
|
+
if (bytes <= gitMax) return "git";
|
|
16
|
+
return bytes <= bucketMax ? "bucket" : "too_large";
|
|
17
|
+
}
|
|
18
|
+
function formatBytes(bytes) {
|
|
19
|
+
return `${Math.round(bytes / 1024 / 1024 * 10) / 10} MB`;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
DOCUMENT_BUCKET_MAX_BYTES,
|
|
23
|
+
DOCUMENT_CONNECTOR_MAX_BYTES,
|
|
24
|
+
DOCUMENT_GIT_MAX_BYTES,
|
|
25
|
+
MEDIA_BUCKET_MAX_BYTES,
|
|
26
|
+
MEDIA_GIT_MAX_BYTES,
|
|
27
|
+
formatBytes,
|
|
28
|
+
tierFor
|
|
29
|
+
};
|
package/dist/lib/tags.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TagEntry } from "../schemas/tags";
|
|
2
2
|
import type { SiteIndex } from "../schemas/site-config";
|
|
3
|
+
import { type SidecarDiagnostic } from "./sidecar-diagnostics";
|
|
3
4
|
/**
|
|
4
5
|
* Repair the tag sidecar against the current section set.
|
|
5
6
|
*
|
|
@@ -18,6 +19,11 @@ import type { SiteIndex } from "../schemas/site-config";
|
|
|
18
19
|
* React state, where a shared array would let a later edit mutate prior state).
|
|
19
20
|
*/
|
|
20
21
|
export declare function reconcileTags(entries: TagEntry[], sections: SiteIndex["sections"]): TagEntry[];
|
|
22
|
+
/** reconcileTags plus what the repair changed — what a validator reports. */
|
|
23
|
+
export declare function reconcileTagsReport(entries: TagEntry[], sections: SiteIndex["sections"]): {
|
|
24
|
+
entries: TagEntry[];
|
|
25
|
+
diagnostics: SidecarDiagnostic[];
|
|
26
|
+
};
|
|
21
27
|
/**
|
|
22
28
|
* The ONLY sanctioned way to read the tags. Always reconciles, so callers never
|
|
23
29
|
* reason about whether index.tags is present, stale, or names deleted sections.
|
package/dist/lib/tags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/lib/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/lib/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAErF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ,EAAE,CAE9F;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,QAAQ,EAAE,EACnB,QAAQ,EAAE,SAAS,CAAC,U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
3
|
-
EXT_TO_MIME,
|
|
4
|
-
MIME_TO_EXT,
|
|
5
3
|
ProcessingQueue,
|
|
6
4
|
composePreviewImage,
|
|
5
|
+
generateVideoPoster,
|
|
6
|
+
getMediaProvider,
|
|
7
|
+
rebindImageRef,
|
|
8
|
+
resolveLogo,
|
|
9
|
+
resolveManifestReferences,
|
|
10
|
+
resolveMedia,
|
|
11
|
+
setMediaProvider
|
|
12
|
+
} from "../chunk-HHNPSKPT.js";
|
|
13
|
+
import {
|
|
14
|
+
EXT_TO_MIME,
|
|
15
|
+
MIME_TO_EXT,
|
|
7
16
|
displayFilename,
|
|
8
17
|
displayFilenameExt,
|
|
9
18
|
displayName,
|
|
10
19
|
formatFileSize,
|
|
11
|
-
generateVideoPoster,
|
|
12
|
-
getMediaProvider,
|
|
13
20
|
hashFileBuffer,
|
|
14
21
|
imageThumbnailUrl,
|
|
15
22
|
mediaThumbnailUrl,
|
|
16
23
|
mimeToExt,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
resolveMedia,
|
|
21
|
-
sanitizeMediaName,
|
|
22
|
-
setMediaProvider
|
|
23
|
-
} from "../chunk-QHMKIODQ.js";
|
|
24
|
-
import "../chunk-IP2SEBAJ.js";
|
|
24
|
+
sanitizeMediaName
|
|
25
|
+
} from "../chunk-CDBURDPX.js";
|
|
26
|
+
import "../chunk-S7QRHUWO.js";
|
|
25
27
|
import {
|
|
26
28
|
ImageManifestSchema,
|
|
27
29
|
MediaConfigSchema,
|
|
28
30
|
MediaFolderSchema,
|
|
29
31
|
MediaItemSchema,
|
|
30
32
|
VariantSchema
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import "../chunk-4TZJZU2T.js";
|
|
33
|
-
import "../chunk-AASEGXNT.js";
|
|
33
|
+
} from "../chunk-APIJPTFG.js";
|
|
34
34
|
import "../chunk-JSBRDJBE.js";
|
|
35
35
|
export {
|
|
36
36
|
BAKED_MEDIA_KEYS,
|
package/dist/media/queue.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MediaKind } from "./types";
|
|
2
|
+
import type { ImageVariantPlan } from "../lib/image-variant-plan";
|
|
2
3
|
export interface QueueInput {
|
|
3
4
|
buffer: ArrayBuffer;
|
|
4
5
|
originalName: string;
|
|
@@ -26,6 +27,7 @@ export interface QueueItem {
|
|
|
26
27
|
posterBlob?: Blob;
|
|
27
28
|
width: number;
|
|
28
29
|
height: number;
|
|
30
|
+
plan?: ImageVariantPlan;
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
export type QueueEvent = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/media/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/media/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,QAAQ,E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C;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,EAAE,CAAA;KAAE;IAelF,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,eAAe;IA+DvB,OAAO,CAAC,aAAa;IAKrB,OAAO,IAAI,IAAI;CAUhB"}
|
package/dist/media/worker.d.ts
CHANGED
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type: "process";
|
|
3
|
-
id: string;
|
|
4
|
-
buffer: ArrayBuffer;
|
|
5
|
-
originalName: string;
|
|
6
|
-
mimeType: string;
|
|
7
|
-
hash: string;
|
|
8
|
-
kind: "image" | "animated" | "video";
|
|
9
|
-
sizes: number[];
|
|
10
|
-
quality: number;
|
|
11
|
-
}
|
|
12
|
-
interface ProgressMessage {
|
|
13
|
-
type: "progress";
|
|
14
|
-
id: string;
|
|
15
|
-
percent: number;
|
|
16
|
-
}
|
|
17
|
-
interface CompleteMessage {
|
|
18
|
-
type: "complete";
|
|
19
|
-
id: string;
|
|
20
|
-
variants: {
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
size: number;
|
|
24
|
-
blob: Blob;
|
|
25
|
-
}[];
|
|
26
|
-
primaryBlob: Blob;
|
|
27
|
-
posterBlob?: Blob;
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
}
|
|
31
|
-
interface ErrorMessage {
|
|
32
|
-
type: "error";
|
|
33
|
-
id: string;
|
|
34
|
-
message: string;
|
|
35
|
-
}
|
|
1
|
+
export {};
|
|
36
2
|
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/media/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/media/worker.ts"],"names":[],"mappings":""}
|
package/dist/schemas/index.js
CHANGED
|
@@ -6,21 +6,11 @@ import {
|
|
|
6
6
|
getSectionSchema,
|
|
7
7
|
getSectionSchemaForType
|
|
8
8
|
} from "../chunk-DMCGN5AS.js";
|
|
9
|
-
import {
|
|
10
|
-
NavEntrySchema,
|
|
11
|
-
NavFileSchema,
|
|
12
|
-
TagEntrySchema,
|
|
13
|
-
TagsFileSchema
|
|
14
|
-
} from "../chunk-4Y2JQQZL.js";
|
|
15
9
|
import {
|
|
16
10
|
ChatbotConfigSchema,
|
|
17
11
|
ChatbotTaskSchema,
|
|
18
12
|
DeckBuilderConfigSchema,
|
|
19
|
-
ImageManifestSchema,
|
|
20
13
|
IndexSchema,
|
|
21
|
-
MediaConfigSchema,
|
|
22
|
-
MediaFolderSchema,
|
|
23
|
-
MediaItemSchema,
|
|
24
14
|
PageSchema,
|
|
25
15
|
PageStatusSchema,
|
|
26
16
|
RESERVED_SLUGS,
|
|
@@ -28,10 +18,24 @@ import {
|
|
|
28
18
|
SectionMetaSchema,
|
|
29
19
|
SiteConfigSchema,
|
|
30
20
|
StatusSchema,
|
|
31
|
-
VariantSchema,
|
|
32
21
|
normalizeSiteIndex
|
|
33
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-67P34WNW.js";
|
|
34
23
|
import "../chunk-4TZJZU2T.js";
|
|
24
|
+
import {
|
|
25
|
+
NavEntrySchema,
|
|
26
|
+
NavFileSchema,
|
|
27
|
+
TagEntrySchema,
|
|
28
|
+
TagsFileSchema
|
|
29
|
+
} from "../chunk-4Y2JQQZL.js";
|
|
30
|
+
import {
|
|
31
|
+
ImageManifestSchema,
|
|
32
|
+
MEDIA_BUCKET_MAX_BYTES,
|
|
33
|
+
MEDIA_GIT_MAX_BYTES,
|
|
34
|
+
MediaConfigSchema,
|
|
35
|
+
MediaFolderSchema,
|
|
36
|
+
MediaItemSchema,
|
|
37
|
+
VariantSchema
|
|
38
|
+
} from "../chunk-APIJPTFG.js";
|
|
35
39
|
import "../chunk-FTPETWXE.js";
|
|
36
40
|
import {
|
|
37
41
|
AudienceSchema,
|
|
@@ -100,6 +104,8 @@ export {
|
|
|
100
104
|
IndexSchema,
|
|
101
105
|
LinkTargetSchema,
|
|
102
106
|
LinkValueSchema,
|
|
107
|
+
MEDIA_BUCKET_MAX_BYTES,
|
|
108
|
+
MEDIA_GIT_MAX_BYTES,
|
|
103
109
|
MediaConfigSchema,
|
|
104
110
|
MediaFolderSchema,
|
|
105
111
|
MediaGridOptionsSchema,
|
package/dist/schemas/media.d.ts
CHANGED
|
@@ -76,6 +76,10 @@ export declare const ImageManifestSchema: z.ZodObject<{
|
|
|
76
76
|
}, z.core.$strip>>>;
|
|
77
77
|
}, z.core.$strip>;
|
|
78
78
|
export type MediaManifest = z.infer<typeof ImageManifestSchema>;
|
|
79
|
+
/** Default git-tier cap for media (bytes); a site may override it as `media.maxFileSize`. */
|
|
80
|
+
export declare const MEDIA_GIT_MAX_BYTES = 5242880;
|
|
81
|
+
/** Default bucket-tier cap for media (bytes); a site may override it as `media.maxAssetSize`. */
|
|
82
|
+
export declare const MEDIA_BUCKET_MAX_BYTES = 209715200;
|
|
79
83
|
export declare const MediaConfigSchema: z.ZodObject<{
|
|
80
84
|
sizes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
81
85
|
maxFileSize: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/schemas/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;iBAIxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAIpD,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,eAAe;;;;;;;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;;;iBAO5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/storage/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../chunk-DFKTF3CH.js";
|
|
1
2
|
import {
|
|
2
3
|
ASSET_CACHE_CONTROL,
|
|
3
4
|
DOCUMENT_CACHE_CONTROL,
|
|
@@ -7,7 +8,7 @@ import {
|
|
|
7
8
|
NothingToPublishError,
|
|
8
9
|
StorageConflictError,
|
|
9
10
|
withIdempotencyTrailer
|
|
10
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-UUUSJDIG.js";
|
|
11
12
|
import "../chunk-JSBRDJBE.js";
|
|
12
13
|
export {
|
|
13
14
|
ASSET_CACHE_CONTROL,
|