@nuasite/cms-core 0.59.0 → 0.61.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/types/byte-range.d.ts +15 -0
- package/dist/types/byte-range.d.ts.map +1 -0
- package/dist/types/collection-scanner.d.ts.map +1 -1
- package/dist/types/content-config-ast.d.ts.map +1 -1
- package/dist/types/core.d.ts +8 -0
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/fs/node-fs.d.ts.map +1 -1
- package/dist/types/fs/staged.d.ts +65 -0
- package/dist/types/fs/staged.d.ts.map +1 -0
- package/dist/types/fs/types.d.ts +2 -0
- package/dist/types/fs/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -23
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/media/file-system.d.ts +15 -0
- package/dist/types/media/file-system.d.ts.map +1 -0
- package/dist/types/media/index.d.ts +2 -1
- package/dist/types/media/index.d.ts.map +1 -1
- package/dist/types/media/local.d.ts +0 -3
- package/dist/types/media/local.d.ts.map +1 -1
- package/dist/types/media/mime.d.ts +4 -0
- package/dist/types/media/mime.d.ts.map +1 -0
- package/dist/types/portable.d.ts +30 -0
- package/dist/types/portable.d.ts.map +1 -0
- package/dist/types/public-static-file.d.ts +11 -0
- package/dist/types/public-static-file.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/byte-range.ts +33 -0
- package/src/check.ts +2 -2
- package/src/collection-scanner.ts +5 -0
- package/src/content-config-ast.ts +1 -0
- package/src/core.ts +43 -21
- package/src/fs/node-fs.ts +18 -12
- package/src/fs/staged.ts +230 -0
- package/src/fs/types.ts +2 -0
- package/src/handlers/entry-ops.ts +1 -1
- package/src/index.ts +3 -125
- package/src/media/file-system.ts +133 -0
- package/src/media/index.ts +2 -1
- package/src/media/local.ts +1 -24
- package/src/media/mime.ts +23 -0
- package/src/media/project-images.ts +1 -1
- package/src/media/s3.ts +1 -1
- package/src/portable.ts +143 -0
- package/src/public-static-file.ts +42 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** An inclusive byte span of a resource, as a `Content-Range: bytes start-end/size` names it. */
|
|
2
|
+
export interface ByteRange {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Resolve a request's `Range` header against a resource of `size` bytes.
|
|
8
|
+
*
|
|
9
|
+
* A browser plays `<video>` by asking for byte ranges; without a `206` answer it cannot seek, and
|
|
10
|
+
* Safari refuses to play at all. Only a single `bytes=` range is honoured. `null` means "serve the
|
|
11
|
+
* whole resource": no header, a malformed one, or a multi-range request, all of which RFC 9110 lets
|
|
12
|
+
* a server answer with `200`. `'unsatisfiable'` is a well-formed range lying past the end (`416`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveByteRange(header: string | null, size: number): ByteRange | 'unsatisfiable' | null;
|
|
15
|
+
//# sourceMappingURL=byte-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byte-range.d.ts","sourceRoot":"","sources":["../../src/byte-range.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,CAkBxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-scanner.d.ts","sourceRoot":"","sources":["../../src/collection-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EAEpB,oBAAoB,EAIpB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAMN,KAAK,UAAU,EAKf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"collection-scanner.d.ts","sourceRoot":"","sources":["../../src/collection-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EAEpB,oBAAoB,EAIpB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAMN,KAAK,UAAU,EAKf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,YAAY,CAAA;AA8iC5D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAqCD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACpC,EAAE,EAAE,aAAa,EACjB,UAAU,GAAE,MAAsB,EAClC,UAAU,GAAE,UAAsB,EAClC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CA4G/C;AAKD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,oBAAoB,GAAG,SAAS,CAExH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-config-ast.d.ts","sourceRoot":"","sources":["../../src/content-config-ast.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,SAAS,EAId,KAAK,YAAY,EACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,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.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AddRedirectRequest, CollectionDefinition, CollectionScanReport, ComponentDefinition, CreatePageRequest, DeletePageRequest, DeleteRedirectRequest, DuplicatePageRequest, GetRedirectsResponse, LayoutInfo, MediaStorageAdapter, MutationResult, PageOperationResponse, RedirectOperationResponse, UpdateRedirectRequest } from '@nuasite/cms-types';
|
|
2
|
+
import { type CmsCommit } from './fs/staged';
|
|
2
3
|
import type { CmsFileSystem } from './fs/types';
|
|
3
4
|
import { type AddArrayItemInput, type CreateEntryInput, type EntryAsset, type GetEntryResult, type RemoveArrayItemInput, type UpdateEntryInput } from './handlers/entry-ops';
|
|
4
5
|
export interface CmsCoreOptions {
|
|
@@ -8,6 +9,13 @@ export interface CmsCoreOptions {
|
|
|
8
9
|
media?: MediaStorageAdapter;
|
|
9
10
|
/** Directories to scan for Astro components (used for MDX import resolution). Defaults to `['src/components']`. */
|
|
10
11
|
componentDirs?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Runs each mutation over a staged view of the filesystem and hands its changes to this
|
|
14
|
+
* function instead of writing them directly. See {@link CmsCommit}: it rejects with
|
|
15
|
+
* `CmsCommitConflictError` when a file the mutation read has changed meanwhile, and the
|
|
16
|
+
* mutation then rejects with it. Without it, mutations write as they go.
|
|
17
|
+
*/
|
|
18
|
+
commit?: CmsCommit;
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* The framework-agnostic CMS brain over a `CmsFileSystem` port.
|
package/dist/types/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EACnB,cAAc,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AAO,CAAC,cAAc,CAAC,CAAA;IAGlF,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IAC/D,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IAGrE,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACpE,aAAa,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC1E,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACpE,UAAU,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACnC,aAAa,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAC9C,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAC1E,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAChF,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAGhF,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAC3B;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAyFnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-fs.d.ts","sourceRoot":"","sources":["../../../src/fs/node-fs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"node-fs.d.ts","sourceRoot":"","sources":["../../../src/fs/node-fs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AA0I5C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CA6ExD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CmsFileSystem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Compare-and-commit for CMS mutations.
|
|
4
|
+
*
|
|
5
|
+
* A mutation runs over a staged view of the filesystem: reads go to the real filesystem and
|
|
6
|
+
* record what they saw, writes and removals stay in memory. When the mutation is done, its
|
|
7
|
+
* changeset goes to a commit function that applies the changes only if every file the mutation
|
|
8
|
+
* looked at is still as it saw it. A host whose files can also change by other means (an agent
|
|
9
|
+
* editing the same checkout) implements that commit atomically, so a CMS write never overwrites
|
|
10
|
+
* a change it did not see.
|
|
11
|
+
*/
|
|
12
|
+
/** What a mutation saw of a path. */
|
|
13
|
+
export type CmsFileVersion = {
|
|
14
|
+
kind: 'absent';
|
|
15
|
+
}
|
|
16
|
+
/** It existed. Recorded by `exists`/`stat`, which do not read the content. */
|
|
17
|
+
| {
|
|
18
|
+
kind: 'present';
|
|
19
|
+
}
|
|
20
|
+
/** Its bytes, as {@link digestBytes} gives them. */
|
|
21
|
+
| {
|
|
22
|
+
kind: 'content';
|
|
23
|
+
digest: string;
|
|
24
|
+
};
|
|
25
|
+
export type CmsStagedChange = {
|
|
26
|
+
kind: 'write';
|
|
27
|
+
path: string;
|
|
28
|
+
content: Uint8Array;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'remove';
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
export interface CmsChangeset {
|
|
34
|
+
/** Each path the mutation read, tested or changed, with the version it first saw. Paths are root-relative, without a leading slash. */
|
|
35
|
+
readonly reads: ReadonlyMap<string, CmsFileVersion>;
|
|
36
|
+
/** The final state of each changed path, in the order the paths were first changed. A rename is a removal plus a write. */
|
|
37
|
+
readonly changes: readonly CmsStagedChange[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Applies a changeset when every path in `reads` still has the recorded version, and applies
|
|
41
|
+
* nothing otherwise, rejecting with {@link CmsCommitConflictError}. The check and the writes must
|
|
42
|
+
* not interleave with other writes to the same files.
|
|
43
|
+
*/
|
|
44
|
+
export type CmsCommit = (changeset: CmsChangeset) => Promise<void>;
|
|
45
|
+
export declare class CmsCommitConflictError extends Error {
|
|
46
|
+
readonly paths: readonly string[];
|
|
47
|
+
constructor(paths: readonly string[]);
|
|
48
|
+
}
|
|
49
|
+
/** `sha256:<hex>` of the bytes; for UTF-8 text, the same value the sidecar reports as a source hash. */
|
|
50
|
+
export declare function digestBytes(content: Uint8Array): string;
|
|
51
|
+
export interface StagedFileSystem extends CmsFileSystem {
|
|
52
|
+
changeset(): CmsChangeset;
|
|
53
|
+
}
|
|
54
|
+
export declare function createStagedFileSystem(base: CmsFileSystem): StagedFileSystem;
|
|
55
|
+
/** The version of `path` now, in the terms {@link CmsFileVersion} records. */
|
|
56
|
+
export declare function versionOf(fs: CmsFileSystem, path: string): Promise<CmsFileVersion>;
|
|
57
|
+
/** Whether a path whose version was `recorded` may be overwritten now that it is `current`. */
|
|
58
|
+
export declare function versionMatches(recorded: CmsFileVersion, current: CmsFileVersion): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A commit over `fs` that checks the recorded versions and then applies the changes. It is atomic
|
|
61
|
+
* only when nothing else writes to `fs` between its awaits; a host with concurrent writers does
|
|
62
|
+
* both steps inside its own critical section instead.
|
|
63
|
+
*/
|
|
64
|
+
export declare function commitChangeset(fs: CmsFileSystem): CmsCommit;
|
|
65
|
+
//# sourceMappingURL=staged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staged.d.ts","sourceRoot":"","sources":["../../../src/fs/staged.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;;;;GASG;AAEH,qCAAqC;AACrC,MAAM,MAAM,cAAc,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE;AACpB,8EAA8E;GAC5E;IA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eAAe,CAAC,EAAE,EAAE,aAAa,GAAG,SAAS,CAY5D"}
|
package/dist/types/fs/types.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface CmsFileSystem {
|
|
|
37
37
|
readBytes(path: string): Promise<Uint8Array>;
|
|
38
38
|
/** Write a UTF-8 text file atomically (write temp + rename). Creates parent dirs. */
|
|
39
39
|
writeFile(path: string, content: string): Promise<void>;
|
|
40
|
+
/** Write raw bytes (images and other binary assets) atomically, like `writeFile`. Creates parent dirs. */
|
|
41
|
+
writeBytes(path: string, content: Uint8Array): Promise<void>;
|
|
40
42
|
/** Rename/move a file. Creates the destination's parent dir. */
|
|
41
43
|
rename(from: string, to: string): Promise<void>;
|
|
42
44
|
/** Remove a file. No-op when it does not exist. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fs/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACvC,qGAAqG;IACrG,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC5C,qFAAqF;IACrF,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvD,gEAAgE;IAChE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IA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AA;IACvD,0GAA0G;IAC1G,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,gEAAgE;IAChE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,mDAAmD;IACnD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,0CAA0C;IAC1C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACtC,qFAAqF;IACrF,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC,CAAA;IACpE;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/D,2DAA2D;IAC3D,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
export { resolveAssetCandidates } from './asset-paths';
|
|
2
|
-
export { analyzeAstroScript, analyzeAstroSource, type AstroCollectionBinding, type AstroContentAccessor, type AstroContentCall, type AstroSourceAnalysis, type AstroSourceImport, } from './astro-source-analysis';
|
|
3
|
-
export { checkContent, type CheckContentOptions, type CheckFinding, type CheckReport, type CheckSeverity, formatCheckReport } from './check';
|
|
4
|
-
export { collectionKind, entryStem, loadCollections, type LoadedCollection, type LoadedCollections, type LoadedEntry, normalizeBase, parseEntry, } from './check-entries';
|
|
5
|
-
export { checkAgainstSchemas, type LiveCheckInput } from './check-live';
|
|
6
|
-
export { checkFieldShapes, type ShapeCheckInput } from './check-shape';
|
|
7
|
-
export { checkEditorWrites, type WriteCheckInput } from './check-write';
|
|
8
|
-
export { collectionScanReport, scanCollections } from './collection-scanner';
|
|
9
|
-
export { scanComponentDefinitions } from './component-registry';
|
|
10
|
-
export { classifyEmptyContentConfig, CONTENT_CONFIG_PATHS, type ContentConfigRead, type DeclaredCollection, type EmptyContentConfigReason, type ParseCache, parseConfigSource, parseContentConfig, type ParsedCollection, type ParsedConfig, type ParsedField, type ParsedReference, readContentConfig, UNREAD_CONTENT_CONFIG_PATHS, } from './content-config-ast';
|
|
11
|
-
export { createCmsCore } from './core';
|
|
12
|
-
export type { CmsCore, CmsCoreOptions } from './core';
|
|
13
|
-
export { applyCreateRouteFields, blankFieldValue, blankRequiredFields, type CollectionKind, type CreateWriteField, isBlankFieldValue, newEntryFrontmatter, newRepeaterItem, normalizeCreateWrite, omitEmptyOnCreate, type RepeaterItemField, type RequiredGuardField, seedValueForRequiredField, withoutBlankArrayItems, type WriteModelField, } from './editor-write-model';
|
|
14
|
-
export { globMayMatchUnder, globToRegExp, UnreadableDirectoryError } from './fs/glob';
|
|
15
1
|
export { createNodeFs } from './fs/node-fs';
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export {
|
|
19
|
-
export { parseProjectCmsConfig, parseProjectCmsConfigSource } from './project-config-ast';
|
|
20
|
-
export { CLOUDFLARE_REDIRECT_LIMITS, CMS_REDIRECTS_FILE, type MergedRedirects, mergeRedirects, parseRedirectRule, type RedirectLayer, type RedirectLine, type RedirectRuleLine, } from './redirects';
|
|
21
|
-
export { type RouteCollectionScan, scanRouteCollections } from './route-scan';
|
|
22
|
-
export { describeIssue, type LiveIssue, type LiveParseResult, type LiveSchema, type LiveSchemas, schemaFor } from './schema-port';
|
|
23
|
-
export { acceptsMissing, firstAcceptedEntry, governsPath, pointAt, type ProbePoint, rejectsValueAt } from './schema-probe';
|
|
24
|
-
export { applyDerivedTransform, computeDerivedFieldUpdates, computePathnameFromSpec, type DerivedFieldSpec, escapeHtml, relativeImportPath, resolvePathnameFromSpec, slugify, slugifyHref, } from './shared';
|
|
2
|
+
export { createLocalStorageAdapter, type LocalStorageOptions } from './media/local';
|
|
3
|
+
export * from './portable';
|
|
4
|
+
export { createPublicStaticFileChecker } from './public-static-file';
|
|
25
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnF,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MediaStorageAdapter } from '@nuasite/cms-types';
|
|
2
|
+
import type { CmsFileSystem } from '../fs/types';
|
|
3
|
+
export interface FileSystemStorageOptions {
|
|
4
|
+
/** Directory to store media files in, relative to the filesystem's root. Default: `public/uploads`. */
|
|
5
|
+
dir?: string;
|
|
6
|
+
/** URL prefix the files are served under. Default: `/uploads`. */
|
|
7
|
+
urlPrefix?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Media stored in the project itself, through the same `CmsFileSystem` the core edits it with: the
|
|
11
|
+
* counterpart of the local adapter for a host without `node:fs`. Uploads land at
|
|
12
|
+
* `<dir>/<folder>/<uuid>.<ext>` and are listed newest first.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createFileSystemStorageAdapter(fs: CmsFileSystem, options?: FileSystemStorageOptions): MediaStorageAdapter;
|
|
15
|
+
//# sourceMappingURL=file-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../../src/media/file-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+C,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAKhD,MAAM,WAAW,wBAAwB;IACxC,uGAAuG;IACvG,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAoBD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,GAAE,wBAA6B,GAAG,mBAAmB,CAgG7H"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { type ContemberStorageOptions, createContemberStorageAdapter } from './contember';
|
|
2
2
|
export { MEDIA_INVALID_FOLDER, MEDIA_INVALID_ID, MEDIA_NOT_FOUND, mediaErrorStatus } from './errors';
|
|
3
|
-
export {
|
|
3
|
+
export { createFileSystemStorageAdapter, type FileSystemStorageOptions } from './file-system';
|
|
4
|
+
export { getFileExtension, MIME_BY_EXT, mimeFromExt } from './mime';
|
|
4
5
|
export { isUnsafeFolder } from './names';
|
|
5
6
|
export { listProjectImages, type ListProjectImagesOptions, uploadsDirRelativeToRoot } from './project-images';
|
|
6
7
|
export { createS3StorageAdapter, type S3StorageOptions } from './s3';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACpG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACpG,OAAO,EAAE,8BAA8B,EAAE,KAAK,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAC7F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC7G,OAAO,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,MAAM,CAAA;AACpE,OAAO,EACN,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,eAAe,CAAA"}
|
|
@@ -14,7 +14,4 @@ export interface LocalStorageOptions {
|
|
|
14
14
|
urlPrefix?: string;
|
|
15
15
|
}
|
|
16
16
|
export declare function createLocalStorageAdapter(options?: LocalStorageOptions): MediaStorageAdapter;
|
|
17
|
-
export declare function getFileExtension(filename: string): string;
|
|
18
|
-
export declare const MIME_BY_EXT: Record<string, string>;
|
|
19
|
-
export declare function mimeFromExt(ext: string): string;
|
|
20
17
|
//# sourceMappingURL=local.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/media/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,mBAAmB,EAAqB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/media/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,mBAAmB,EAAqB,MAAM,oBAAoB,CAAA;AAQlH,MAAM,WAAW,mBAAmB;IACnC;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAsCD,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,mBAAwB,GAAG,mBAAmB,CA0KhG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mime.d.ts","sourceRoot":"","sources":["../../../src/media/mime.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAY9C,CAAA;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything cms-core offers that runs without `node:fs`. The package root resolves here under the
|
|
3
|
+
* `workerd` condition; the default root adds the Node filesystem and the local media adapter.
|
|
4
|
+
*/
|
|
5
|
+
export { resolveAssetCandidates } from './asset-paths';
|
|
6
|
+
export { analyzeAstroScript, analyzeAstroSource, type AstroCollectionBinding, type AstroContentAccessor, type AstroContentCall, type AstroSourceAnalysis, type AstroSourceImport, } from './astro-source-analysis';
|
|
7
|
+
export { type ByteRange, resolveByteRange } from './byte-range';
|
|
8
|
+
export { checkContent, type CheckContentOptions, type CheckFinding, type CheckReport, type CheckSeverity, formatCheckReport } from './check';
|
|
9
|
+
export { collectionKind, entryStem, loadCollections, type LoadedCollection, type LoadedCollections, type LoadedEntry, normalizeBase, parseEntry, } from './check-entries';
|
|
10
|
+
export { checkAgainstSchemas, type LiveCheckInput } from './check-live';
|
|
11
|
+
export { checkFieldShapes, type ShapeCheckInput } from './check-shape';
|
|
12
|
+
export { checkEditorWrites, type WriteCheckInput } from './check-write';
|
|
13
|
+
export { collectionScanReport, scanCollections } from './collection-scanner';
|
|
14
|
+
export { scanComponentDefinitions } from './component-registry';
|
|
15
|
+
export { classifyEmptyContentConfig, CONTENT_CONFIG_PATHS, type ContentConfigRead, type DeclaredCollection, type EmptyContentConfigReason, type ParseCache, parseConfigSource, parseContentConfig, type ParsedCollection, type ParsedConfig, type ParsedField, type ParsedReference, readContentConfig, UNREAD_CONTENT_CONFIG_PATHS, } from './content-config-ast';
|
|
16
|
+
export { createCmsCore } from './core';
|
|
17
|
+
export type { CmsCore, CmsCoreOptions } from './core';
|
|
18
|
+
export { applyCreateRouteFields, blankFieldValue, blankRequiredFields, type CollectionKind, type CreateWriteField, isBlankFieldValue, newEntryFrontmatter, newRepeaterItem, normalizeCreateWrite, omitEmptyOnCreate, type RepeaterItemField, type RequiredGuardField, seedValueForRequiredField, withoutBlankArrayItems, type WriteModelField, } from './editor-write-model';
|
|
19
|
+
export { globMayMatchUnder, globToRegExp, UnreadableDirectoryError } from './fs/glob';
|
|
20
|
+
export { type CmsChangeset, type CmsCommit, CmsCommitConflictError, type CmsFileVersion, type CmsStagedChange, commitChangeset, createStagedFileSystem, digestBytes, type StagedFileSystem, versionMatches, versionOf, } from './fs/staged';
|
|
21
|
+
export type { CmsFileSystem, GlobOptions } from './fs/types';
|
|
22
|
+
export { type AddArrayItemInput, type CreateEntryInput, ensureMdxImports, type EntryAsset, type EntryOpsDeps, type GetEntryResult, parseFrontmatter, type RemoveArrayItemInput, serializeFrontmatter, type UpdateEntryInput, } from './handlers/entry-ops';
|
|
23
|
+
export { type ContemberStorageOptions, createContemberStorageAdapter, createFileSystemStorageAdapter, createS3StorageAdapter, decodeFilteredMediaCursor, type FileSystemStorageOptions, getFileExtension, isUnsafeFolder, listFilteredMedia, listProjectImages, type ListProjectImagesOptions, MEDIA_CURSOR_TYPE_MISMATCH, MEDIA_INVALID_CURSOR, MEDIA_INVALID_FOLDER, MEDIA_INVALID_ID, MEDIA_NOT_FOUND, MediaCursorError, mediaErrorStatus, MIME_BY_EXT, mimeFromExt, parseMediaTypeFilter, type S3StorageOptions, uploadsDirRelativeToRoot, } from './media/index';
|
|
24
|
+
export { parseProjectCmsConfig, parseProjectCmsConfigSource } from './project-config-ast';
|
|
25
|
+
export { CLOUDFLARE_REDIRECT_LIMITS, CMS_REDIRECTS_FILE, type MergedRedirects, mergeRedirects, parseRedirectRule, type RedirectLayer, type RedirectLine, type RedirectRuleLine, } from './redirects';
|
|
26
|
+
export { type RouteCollectionScan, scanRouteCollections } from './route-scan';
|
|
27
|
+
export { describeIssue, type LiveIssue, type LiveParseResult, type LiveSchema, type LiveSchemas, schemaFor } from './schema-port';
|
|
28
|
+
export { acceptsMissing, firstAcceptedEntry, governsPath, pointAt, type ProbePoint, rejectsValueAt } from './schema-probe';
|
|
29
|
+
export { applyDerivedTransform, computeDerivedFieldUpdates, computePathnameFromSpec, type DerivedFieldSpec, escapeHtml, relativeImportPath, resolvePathnameFromSpec, slugify, slugifyHref, } from './shared';
|
|
30
|
+
//# sourceMappingURL=portable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portable.d.ts","sourceRoot":"","sources":["../../src/portable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACN,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC5I,OA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,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACjI,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC1H,OAAO,EACN,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,OAAO,EACP,WAAW,GACX,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a checker that decides whether a request URL maps to an existing file
|
|
3
|
+
* under Astro's `publicDir`. Used to bypass HTML rewriting for vendor pages
|
|
4
|
+
* whose inline scripts can be corrupted by injected markers or content-length
|
|
5
|
+
* mismatches.
|
|
6
|
+
*
|
|
7
|
+
* Cache lives for the dev server's lifetime; vendor HTML is essentially static,
|
|
8
|
+
* and the cache is cleared on restart.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createPublicStaticFileChecker(publicDir: string | undefined): (urlPath: string) => boolean;
|
|
11
|
+
//# sourceMappingURL=public-static-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-static-file.d.ts","sourceRoot":"","sources":["../../src/public-static-file.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CA6BzG"}
|