@agntcms/next 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/assets-Cyt9upqW.d.cts +290 -0
- package/dist/assets-P8OCigDG.d.ts +290 -0
- package/dist/client.cjs +13244 -0
- package/dist/client.d.cts +806 -0
- package/dist/client.d.ts +806 -0
- package/dist/client.mjs +13234 -0
- package/dist/config.cjs +240 -0
- package/dist/config.d.cts +112 -0
- package/dist/config.d.ts +112 -0
- package/dist/config.mjs +194 -0
- package/dist/defineForm-Bp9vzW56.d.ts +71 -0
- package/dist/defineForm-CJ8KZC93.d.cts +71 -0
- package/dist/defineSection-9qQ5ulAH.d.cts +243 -0
- package/dist/defineSection-Kr0pWqMY.d.ts +243 -0
- package/dist/form-BqY0H1V5.d.cts +753 -0
- package/dist/form-BqY0H1V5.d.ts +753 -0
- package/dist/global-CV23g5Bn.d.cts +15 -0
- package/dist/global-CV23g5Bn.d.ts +15 -0
- package/dist/handlers.cjs +2525 -0
- package/dist/handlers.d.cts +330 -0
- package/dist/handlers.d.ts +330 -0
- package/dist/handlers.mjs +2473 -0
- package/dist/index.cjs +372 -0
- package/dist/index.d.cts +133 -0
- package/dist/index.d.ts +133 -0
- package/dist/index.mjs +319 -0
- package/dist/rateLimit-CXptRM_K.d.ts +391 -0
- package/dist/rateLimit-CiROGTLE.d.cts +391 -0
- package/dist/registry-CraTTwT7.d.cts +29 -0
- package/dist/registry-DMujGqt0.d.ts +29 -0
- package/dist/server.cjs +1970 -0
- package/dist/server.d.cts +153 -0
- package/dist/server.d.ts +153 -0
- package/dist/server.mjs +1889 -0
- package/package.json +62 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { G as GetGlobal, P as PreviewMode } from './rateLimit-CiROGTLE.cjs';
|
|
2
|
+
export { F as FieldIn, a as GetContent, b as GetContentInput, c as GetContentOptions, d as GetGlobalInput, L as ListPages, e as ListPagesInput, f as ListPagesSort, g as PageContent, h as PreviewField, i as PreviewFieldOrigin, R as RateLimit, j as RateLimitOptions, k as RateLimitResult, l as Runtime, m as RuntimeOptions, S as SubmitForm, n as SubmitFormDeps, o as SubmitFormInput, p as SubmitFormResult, q as createListPages, r as createRateLimit, s as createRuntime, t as createSubmitForm } from './rateLimit-CiROGTLE.cjs';
|
|
3
|
+
import { C as ContentStorageAdapter, A as AssetStorageAdapter } from './assets-Cyt9upqW.cjs';
|
|
4
|
+
export { a as AssetUploadInput, b as AssetUploadResult, D as DraftSummary, G as GlobalSummary, H as HistoryEntry, P as PageMode, c as PageSummaryEntry, d as PublishedPageEntry } from './assets-Cyt9upqW.cjs';
|
|
5
|
+
import { o as SubmissionStorageAdapter } from './form-BqY0H1V5.cjs';
|
|
6
|
+
export { A as AnyFormDefinition, j as BooleanField, B as ButtonField, i as ButtonValue, c as FieldDescriptor, y as FieldKind, x as FieldValueFor, b as FormDefinition, p as FormFieldDescriptor, q as FormFieldOverride, n as FormFieldOverrides, r as FormOverridesField, m as FormOverridesFieldDescriptor, a as FormSchema, I as ImageField, d as ImageValue, L as LinkField, h as LinkValue, l as ListField, z as ListItem, N as NumberField, P as Page, C as PageSeo, w as PageSummary, f as ReferenceField, g as ReferenceValue, R as RichTextField, D as Section, S as SectionSchema, k as SelectField, E as SelectOption, s as Submission, t as SubmissionAdapterInfo, u as SubmissionSummary, v as SubmissionsNotReadableError, T as TextField, V as VideoField, e as VideoValue } from './form-BqY0H1V5.cjs';
|
|
7
|
+
export { hasUniqueSectionIds, hrefOf, isExternalLink, linkAnchorAttrs, normalizeLinkValue, validateEmail, validateExternalUrl, validateInternalSlug, validatePhone } from './index.cjs';
|
|
8
|
+
export { G as Global } from './global-CV23g5Bn.cjs';
|
|
9
|
+
import { A as AnySectionDefinition } from './defineSection-9qQ5ulAH.cjs';
|
|
10
|
+
export { D as DataOf, a as DefineSectionInput, F as FieldDataType, S as SectionComponent, b as SectionDefinition, d as defineSection } from './defineSection-9qQ5ulAH.cjs';
|
|
11
|
+
import { ReactNode } from 'react';
|
|
12
|
+
export { D as DefineFormInput, H as HoneypotCollisionError, I as InvalidFormFieldError, a as InvalidFormNameError, d as defineForm } from './defineForm-CJ8KZC93.cjs';
|
|
13
|
+
export { D as DuplicateFormNameError, F as FormDefinitionList, a as FormRegistry, b as buildFormRegistry } from './registry-CraTTwT7.cjs';
|
|
14
|
+
|
|
15
|
+
declare const NOT_FOUND_PAGE_SLUG = "404";
|
|
16
|
+
declare const SERVER_ERROR_PAGE_SLUG = "500";
|
|
17
|
+
interface ReservedPageSlugViolation {
|
|
18
|
+
readonly slug: string;
|
|
19
|
+
readonly canonicalSlug: string;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}
|
|
22
|
+
declare const getReservedPageSlugViolation: (slug: string) => ReservedPageSlugViolation | null;
|
|
23
|
+
declare const isSitemapEligibleSlug: (slug: string) => boolean;
|
|
24
|
+
|
|
25
|
+
/** Config for `createFsContentAdapter`. */
|
|
26
|
+
interface FsContentAdapterOptions {
|
|
27
|
+
/** Absolute path to the root of the content tree (ARCHITECTURE.md §3). */
|
|
28
|
+
readonly contentRoot: string;
|
|
29
|
+
}
|
|
30
|
+
declare const createFsContentAdapter: (options: FsContentAdapterOptions) => ContentStorageAdapter;
|
|
31
|
+
|
|
32
|
+
/** Config for `createFsAssetAdapter`. */
|
|
33
|
+
interface FsAssetAdapterOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Absolute path to the directory where uploaded bytes land. In the
|
|
36
|
+
* template this is `public/assets/`, served as static files by Next.js.
|
|
37
|
+
*/
|
|
38
|
+
readonly assetsRoot: string;
|
|
39
|
+
/**
|
|
40
|
+
* URL prefix prepended to stored filenames to produce `AssetUploadResult.url`.
|
|
41
|
+
* Example: `/assets` yields URLs like `/assets/<hash>.png`.
|
|
42
|
+
* The prefix MUST NOT end in `/`; the adapter always joins with a single
|
|
43
|
+
* `/` before the filename.
|
|
44
|
+
*/
|
|
45
|
+
readonly publicUrlBase: string;
|
|
46
|
+
}
|
|
47
|
+
declare const createFsAssetAdapter: (options: FsAssetAdapterOptions) => AssetStorageAdapter;
|
|
48
|
+
|
|
49
|
+
/** Config for `createFsSubmissionAdapter`. */
|
|
50
|
+
interface FsSubmissionAdapterOptions {
|
|
51
|
+
/** Absolute path to the root of the submissions tree (e.g. `<projectRoot>/content/submissions`). */
|
|
52
|
+
readonly submissionsRoot: string;
|
|
53
|
+
/**
|
|
54
|
+
* Maximum number of newest entries `list()` returns. Default: 500.
|
|
55
|
+
* Bounds the AdminModal "Submissions" tab response size — a v1
|
|
56
|
+
* mitigation in lieu of full pagination (deferred to v0.3, see
|
|
57
|
+
* ARCHITECTURE.md §11). Older entries beyond the cap are still on
|
|
58
|
+
* disk but invisible to `list`. Must be a positive integer.
|
|
59
|
+
*/
|
|
60
|
+
readonly maxList?: number;
|
|
61
|
+
}
|
|
62
|
+
declare const createFsSubmissionAdapter: (options: FsSubmissionAdapterOptions) => SubmissionStorageAdapter;
|
|
63
|
+
|
|
64
|
+
/** Config for `createWebhookSubmissionAdapter`. */
|
|
65
|
+
interface WebhookSubmissionAdapterOptions {
|
|
66
|
+
/** Absolute URL to POST submissions to. MUST be `http(s)://...`. */
|
|
67
|
+
readonly url: string;
|
|
68
|
+
/** Optional headers (e.g. `Authorization: Bearer ...`). */
|
|
69
|
+
readonly headers?: Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Per-request timeout in milliseconds. Default: 10_000 (10s). When the
|
|
72
|
+
* webhook does not respond within this window we abort the fetch and
|
|
73
|
+
* throw — the route handler catches and maps to HTTP 502, so a hung
|
|
74
|
+
* upstream cannot block a Next.js worker. Set to a positive integer.
|
|
75
|
+
*/
|
|
76
|
+
readonly timeoutMs?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch implementation. Optional — defaults to the global `fetch`. Tests
|
|
79
|
+
* pass a fake. Typed as the minimal surface we use to avoid pinning to
|
|
80
|
+
* a specific lib.dom/node-types version.
|
|
81
|
+
*/
|
|
82
|
+
readonly fetch?: WebhookFetch;
|
|
83
|
+
}
|
|
84
|
+
/** Minimal `fetch`-like signature needed by the webhook adapter. */
|
|
85
|
+
type WebhookFetch = (url: string, init: WebhookFetchInit) => Promise<WebhookFetchResponse>;
|
|
86
|
+
interface WebhookFetchInit {
|
|
87
|
+
readonly method: 'POST';
|
|
88
|
+
readonly headers: Record<string, string>;
|
|
89
|
+
readonly body: string;
|
|
90
|
+
/**
|
|
91
|
+
* Optional `AbortSignal` for the per-request timeout. The adapter
|
|
92
|
+
* always sets this when calling `fetch`. The fake fetch used in tests
|
|
93
|
+
* may inspect `signal.aborted` to simulate a timed-out request.
|
|
94
|
+
*/
|
|
95
|
+
readonly signal?: AbortSignal;
|
|
96
|
+
}
|
|
97
|
+
interface WebhookFetchResponse {
|
|
98
|
+
readonly ok: boolean;
|
|
99
|
+
readonly status: number;
|
|
100
|
+
text(): Promise<string>;
|
|
101
|
+
}
|
|
102
|
+
declare const createWebhookSubmissionAdapter: (options: WebhookSubmissionAdapterOptions) => SubmissionStorageAdapter;
|
|
103
|
+
|
|
104
|
+
interface DefaultAdapterOptions {
|
|
105
|
+
/** Project root. Defaults to `process.cwd()`. */
|
|
106
|
+
readonly projectRoot?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Create the default FS content adapter using the canonical path
|
|
110
|
+
* `<projectRoot>/content` (ARCHITECTURE.md §3).
|
|
111
|
+
*/
|
|
112
|
+
declare function createDefaultContentAdapter(options?: DefaultAdapterOptions): ContentStorageAdapter;
|
|
113
|
+
/**
|
|
114
|
+
* Create the default FS asset adapter using the canonical path
|
|
115
|
+
* `<projectRoot>/public/assets` with URL base `/assets`
|
|
116
|
+
* (ARCHITECTURE.md §3).
|
|
117
|
+
*/
|
|
118
|
+
declare function createDefaultAssetAdapter(options?: DefaultAdapterOptions): AssetStorageAdapter;
|
|
119
|
+
/**
|
|
120
|
+
* Create the default FS submission adapter using the canonical path
|
|
121
|
+
* `<projectRoot>/content/submissions` (ARCHITECTURE.md §3, §6.5).
|
|
122
|
+
*
|
|
123
|
+
* Templates are expected to add `content/submissions/` to `.gitignore`
|
|
124
|
+
* (skills-dev scope, Dispatch 3 territory). The framework does not
|
|
125
|
+
* touch git here.
|
|
126
|
+
*/
|
|
127
|
+
declare function createDefaultSubmissionAdapter(options?: DefaultAdapterOptions): SubmissionStorageAdapter;
|
|
128
|
+
|
|
129
|
+
interface GlobalSlotProps {
|
|
130
|
+
/** The global's name as registered in `content/globals/<name>.json`. */
|
|
131
|
+
readonly name: string;
|
|
132
|
+
/** The runtime's `getGlobal` (from `createRuntime`). */
|
|
133
|
+
readonly getGlobal: GetGlobal;
|
|
134
|
+
/** Section definitions registry. Same shape as `<PageRenderer>` consumes. */
|
|
135
|
+
readonly definitions: readonly AnySectionDefinition[];
|
|
136
|
+
/**
|
|
137
|
+
* Read mode — same `'preview' | 'published'` as `getContent`. The
|
|
138
|
+
* caller passes the same value it would pass to `getContent`,
|
|
139
|
+
* typically derived from `draftMode().isEnabled`.
|
|
140
|
+
*/
|
|
141
|
+
readonly mode: PreviewMode;
|
|
142
|
+
/** Rendered when the global doesn't exist or has no matching definition. */
|
|
143
|
+
readonly fallback?: ReactNode;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Renders a named global by looking up its `type` in the section
|
|
147
|
+
* definitions registry. When `mode === 'preview'`, wraps the render
|
|
148
|
+
* output with a `GlobalSaveProvider` so descendant editable widgets
|
|
149
|
+
* dispatch saves to `/api/agntcms/global/save`.
|
|
150
|
+
*/
|
|
151
|
+
declare function GlobalSlot(props: GlobalSlotProps): Promise<React.ReactElement | null>;
|
|
152
|
+
|
|
153
|
+
export { AnySectionDefinition, AssetStorageAdapter, ContentStorageAdapter, type DefaultAdapterOptions, type FsAssetAdapterOptions, type FsContentAdapterOptions, type FsSubmissionAdapterOptions, GetGlobal, GlobalSlot, type GlobalSlotProps, NOT_FOUND_PAGE_SLUG, PreviewMode, SERVER_ERROR_PAGE_SLUG, SubmissionStorageAdapter, type WebhookFetch, type WebhookFetchInit, type WebhookFetchResponse, type WebhookSubmissionAdapterOptions, createDefaultAssetAdapter, createDefaultContentAdapter, createDefaultSubmissionAdapter, createFsAssetAdapter, createFsContentAdapter, createFsSubmissionAdapter, createWebhookSubmissionAdapter, getReservedPageSlugViolation, isSitemapEligibleSlug };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { G as GetGlobal, P as PreviewMode } from './rateLimit-CXptRM_K.js';
|
|
2
|
+
export { F as FieldIn, a as GetContent, b as GetContentInput, c as GetContentOptions, d as GetGlobalInput, L as ListPages, e as ListPagesInput, f as ListPagesSort, g as PageContent, h as PreviewField, i as PreviewFieldOrigin, R as RateLimit, j as RateLimitOptions, k as RateLimitResult, l as Runtime, m as RuntimeOptions, S as SubmitForm, n as SubmitFormDeps, o as SubmitFormInput, p as SubmitFormResult, q as createListPages, r as createRateLimit, s as createRuntime, t as createSubmitForm } from './rateLimit-CXptRM_K.js';
|
|
3
|
+
import { C as ContentStorageAdapter, A as AssetStorageAdapter } from './assets-P8OCigDG.js';
|
|
4
|
+
export { a as AssetUploadInput, b as AssetUploadResult, D as DraftSummary, G as GlobalSummary, H as HistoryEntry, P as PageMode, c as PageSummaryEntry, d as PublishedPageEntry } from './assets-P8OCigDG.js';
|
|
5
|
+
import { o as SubmissionStorageAdapter } from './form-BqY0H1V5.js';
|
|
6
|
+
export { A as AnyFormDefinition, j as BooleanField, B as ButtonField, i as ButtonValue, c as FieldDescriptor, y as FieldKind, x as FieldValueFor, b as FormDefinition, p as FormFieldDescriptor, q as FormFieldOverride, n as FormFieldOverrides, r as FormOverridesField, m as FormOverridesFieldDescriptor, a as FormSchema, I as ImageField, d as ImageValue, L as LinkField, h as LinkValue, l as ListField, z as ListItem, N as NumberField, P as Page, C as PageSeo, w as PageSummary, f as ReferenceField, g as ReferenceValue, R as RichTextField, D as Section, S as SectionSchema, k as SelectField, E as SelectOption, s as Submission, t as SubmissionAdapterInfo, u as SubmissionSummary, v as SubmissionsNotReadableError, T as TextField, V as VideoField, e as VideoValue } from './form-BqY0H1V5.js';
|
|
7
|
+
export { hasUniqueSectionIds, hrefOf, isExternalLink, linkAnchorAttrs, normalizeLinkValue, validateEmail, validateExternalUrl, validateInternalSlug, validatePhone } from './index.js';
|
|
8
|
+
export { G as Global } from './global-CV23g5Bn.js';
|
|
9
|
+
import { A as AnySectionDefinition } from './defineSection-Kr0pWqMY.js';
|
|
10
|
+
export { D as DataOf, a as DefineSectionInput, F as FieldDataType, S as SectionComponent, b as SectionDefinition, d as defineSection } from './defineSection-Kr0pWqMY.js';
|
|
11
|
+
import { ReactNode } from 'react';
|
|
12
|
+
export { D as DefineFormInput, H as HoneypotCollisionError, I as InvalidFormFieldError, a as InvalidFormNameError, d as defineForm } from './defineForm-Bp9vzW56.js';
|
|
13
|
+
export { D as DuplicateFormNameError, F as FormDefinitionList, a as FormRegistry, b as buildFormRegistry } from './registry-DMujGqt0.js';
|
|
14
|
+
|
|
15
|
+
declare const NOT_FOUND_PAGE_SLUG = "404";
|
|
16
|
+
declare const SERVER_ERROR_PAGE_SLUG = "500";
|
|
17
|
+
interface ReservedPageSlugViolation {
|
|
18
|
+
readonly slug: string;
|
|
19
|
+
readonly canonicalSlug: string;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}
|
|
22
|
+
declare const getReservedPageSlugViolation: (slug: string) => ReservedPageSlugViolation | null;
|
|
23
|
+
declare const isSitemapEligibleSlug: (slug: string) => boolean;
|
|
24
|
+
|
|
25
|
+
/** Config for `createFsContentAdapter`. */
|
|
26
|
+
interface FsContentAdapterOptions {
|
|
27
|
+
/** Absolute path to the root of the content tree (ARCHITECTURE.md §3). */
|
|
28
|
+
readonly contentRoot: string;
|
|
29
|
+
}
|
|
30
|
+
declare const createFsContentAdapter: (options: FsContentAdapterOptions) => ContentStorageAdapter;
|
|
31
|
+
|
|
32
|
+
/** Config for `createFsAssetAdapter`. */
|
|
33
|
+
interface FsAssetAdapterOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Absolute path to the directory where uploaded bytes land. In the
|
|
36
|
+
* template this is `public/assets/`, served as static files by Next.js.
|
|
37
|
+
*/
|
|
38
|
+
readonly assetsRoot: string;
|
|
39
|
+
/**
|
|
40
|
+
* URL prefix prepended to stored filenames to produce `AssetUploadResult.url`.
|
|
41
|
+
* Example: `/assets` yields URLs like `/assets/<hash>.png`.
|
|
42
|
+
* The prefix MUST NOT end in `/`; the adapter always joins with a single
|
|
43
|
+
* `/` before the filename.
|
|
44
|
+
*/
|
|
45
|
+
readonly publicUrlBase: string;
|
|
46
|
+
}
|
|
47
|
+
declare const createFsAssetAdapter: (options: FsAssetAdapterOptions) => AssetStorageAdapter;
|
|
48
|
+
|
|
49
|
+
/** Config for `createFsSubmissionAdapter`. */
|
|
50
|
+
interface FsSubmissionAdapterOptions {
|
|
51
|
+
/** Absolute path to the root of the submissions tree (e.g. `<projectRoot>/content/submissions`). */
|
|
52
|
+
readonly submissionsRoot: string;
|
|
53
|
+
/**
|
|
54
|
+
* Maximum number of newest entries `list()` returns. Default: 500.
|
|
55
|
+
* Bounds the AdminModal "Submissions" tab response size — a v1
|
|
56
|
+
* mitigation in lieu of full pagination (deferred to v0.3, see
|
|
57
|
+
* ARCHITECTURE.md §11). Older entries beyond the cap are still on
|
|
58
|
+
* disk but invisible to `list`. Must be a positive integer.
|
|
59
|
+
*/
|
|
60
|
+
readonly maxList?: number;
|
|
61
|
+
}
|
|
62
|
+
declare const createFsSubmissionAdapter: (options: FsSubmissionAdapterOptions) => SubmissionStorageAdapter;
|
|
63
|
+
|
|
64
|
+
/** Config for `createWebhookSubmissionAdapter`. */
|
|
65
|
+
interface WebhookSubmissionAdapterOptions {
|
|
66
|
+
/** Absolute URL to POST submissions to. MUST be `http(s)://...`. */
|
|
67
|
+
readonly url: string;
|
|
68
|
+
/** Optional headers (e.g. `Authorization: Bearer ...`). */
|
|
69
|
+
readonly headers?: Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Per-request timeout in milliseconds. Default: 10_000 (10s). When the
|
|
72
|
+
* webhook does not respond within this window we abort the fetch and
|
|
73
|
+
* throw — the route handler catches and maps to HTTP 502, so a hung
|
|
74
|
+
* upstream cannot block a Next.js worker. Set to a positive integer.
|
|
75
|
+
*/
|
|
76
|
+
readonly timeoutMs?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch implementation. Optional — defaults to the global `fetch`. Tests
|
|
79
|
+
* pass a fake. Typed as the minimal surface we use to avoid pinning to
|
|
80
|
+
* a specific lib.dom/node-types version.
|
|
81
|
+
*/
|
|
82
|
+
readonly fetch?: WebhookFetch;
|
|
83
|
+
}
|
|
84
|
+
/** Minimal `fetch`-like signature needed by the webhook adapter. */
|
|
85
|
+
type WebhookFetch = (url: string, init: WebhookFetchInit) => Promise<WebhookFetchResponse>;
|
|
86
|
+
interface WebhookFetchInit {
|
|
87
|
+
readonly method: 'POST';
|
|
88
|
+
readonly headers: Record<string, string>;
|
|
89
|
+
readonly body: string;
|
|
90
|
+
/**
|
|
91
|
+
* Optional `AbortSignal` for the per-request timeout. The adapter
|
|
92
|
+
* always sets this when calling `fetch`. The fake fetch used in tests
|
|
93
|
+
* may inspect `signal.aborted` to simulate a timed-out request.
|
|
94
|
+
*/
|
|
95
|
+
readonly signal?: AbortSignal;
|
|
96
|
+
}
|
|
97
|
+
interface WebhookFetchResponse {
|
|
98
|
+
readonly ok: boolean;
|
|
99
|
+
readonly status: number;
|
|
100
|
+
text(): Promise<string>;
|
|
101
|
+
}
|
|
102
|
+
declare const createWebhookSubmissionAdapter: (options: WebhookSubmissionAdapterOptions) => SubmissionStorageAdapter;
|
|
103
|
+
|
|
104
|
+
interface DefaultAdapterOptions {
|
|
105
|
+
/** Project root. Defaults to `process.cwd()`. */
|
|
106
|
+
readonly projectRoot?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Create the default FS content adapter using the canonical path
|
|
110
|
+
* `<projectRoot>/content` (ARCHITECTURE.md §3).
|
|
111
|
+
*/
|
|
112
|
+
declare function createDefaultContentAdapter(options?: DefaultAdapterOptions): ContentStorageAdapter;
|
|
113
|
+
/**
|
|
114
|
+
* Create the default FS asset adapter using the canonical path
|
|
115
|
+
* `<projectRoot>/public/assets` with URL base `/assets`
|
|
116
|
+
* (ARCHITECTURE.md §3).
|
|
117
|
+
*/
|
|
118
|
+
declare function createDefaultAssetAdapter(options?: DefaultAdapterOptions): AssetStorageAdapter;
|
|
119
|
+
/**
|
|
120
|
+
* Create the default FS submission adapter using the canonical path
|
|
121
|
+
* `<projectRoot>/content/submissions` (ARCHITECTURE.md §3, §6.5).
|
|
122
|
+
*
|
|
123
|
+
* Templates are expected to add `content/submissions/` to `.gitignore`
|
|
124
|
+
* (skills-dev scope, Dispatch 3 territory). The framework does not
|
|
125
|
+
* touch git here.
|
|
126
|
+
*/
|
|
127
|
+
declare function createDefaultSubmissionAdapter(options?: DefaultAdapterOptions): SubmissionStorageAdapter;
|
|
128
|
+
|
|
129
|
+
interface GlobalSlotProps {
|
|
130
|
+
/** The global's name as registered in `content/globals/<name>.json`. */
|
|
131
|
+
readonly name: string;
|
|
132
|
+
/** The runtime's `getGlobal` (from `createRuntime`). */
|
|
133
|
+
readonly getGlobal: GetGlobal;
|
|
134
|
+
/** Section definitions registry. Same shape as `<PageRenderer>` consumes. */
|
|
135
|
+
readonly definitions: readonly AnySectionDefinition[];
|
|
136
|
+
/**
|
|
137
|
+
* Read mode — same `'preview' | 'published'` as `getContent`. The
|
|
138
|
+
* caller passes the same value it would pass to `getContent`,
|
|
139
|
+
* typically derived from `draftMode().isEnabled`.
|
|
140
|
+
*/
|
|
141
|
+
readonly mode: PreviewMode;
|
|
142
|
+
/** Rendered when the global doesn't exist or has no matching definition. */
|
|
143
|
+
readonly fallback?: ReactNode;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Renders a named global by looking up its `type` in the section
|
|
147
|
+
* definitions registry. When `mode === 'preview'`, wraps the render
|
|
148
|
+
* output with a `GlobalSaveProvider` so descendant editable widgets
|
|
149
|
+
* dispatch saves to `/api/agntcms/global/save`.
|
|
150
|
+
*/
|
|
151
|
+
declare function GlobalSlot(props: GlobalSlotProps): Promise<React.ReactElement | null>;
|
|
152
|
+
|
|
153
|
+
export { AnySectionDefinition, AssetStorageAdapter, ContentStorageAdapter, type DefaultAdapterOptions, type FsAssetAdapterOptions, type FsContentAdapterOptions, type FsSubmissionAdapterOptions, GetGlobal, GlobalSlot, type GlobalSlotProps, NOT_FOUND_PAGE_SLUG, PreviewMode, SERVER_ERROR_PAGE_SLUG, SubmissionStorageAdapter, type WebhookFetch, type WebhookFetchInit, type WebhookFetchResponse, type WebhookSubmissionAdapterOptions, createDefaultAssetAdapter, createDefaultContentAdapter, createDefaultSubmissionAdapter, createFsAssetAdapter, createFsContentAdapter, createFsSubmissionAdapter, createWebhookSubmissionAdapter, getReservedPageSlugViolation, isSitemapEligibleSlug };
|