@agntcms/next 0.3.1 → 0.3.4
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 → assets-B3oNeLdj.d.cts} +1 -1
- package/dist/{assets-P8OCigDG.d.ts → assets-DHumg-X7.d.ts} +1 -1
- package/dist/client.cjs +2831 -4747
- package/dist/client.d.cts +11 -153
- package/dist/client.d.ts +11 -153
- package/dist/client.mjs +4750 -6675
- package/dist/config.cjs +25 -121
- package/dist/config.d.cts +6 -59
- package/dist/config.d.ts +6 -59
- package/dist/config.mjs +25 -114
- package/dist/{defineSection-Kr0pWqMY.d.ts → defineSection-ByG5uwiR.d.cts} +5 -24
- package/dist/{defineSection-9qQ5ulAH.d.cts → defineSection-ChkZCQyQ.d.ts} +5 -24
- package/dist/{rateLimit-CXptRM_K.d.ts → getContent-DAgAn095.d.ts} +3 -132
- package/dist/{rateLimit-CiROGTLE.d.cts → getContent-yK-sARoc.d.cts} +3 -132
- package/dist/handlers.cjs +19 -382
- package/dist/handlers.d.cts +4 -73
- package/dist/handlers.d.ts +4 -73
- package/dist/handlers.mjs +19 -377
- package/dist/index.cjs +1 -109
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.mjs +1 -103
- package/dist/{form-BqY0H1V5.d.cts → page-DXF0_SrY.d.cts} +3 -293
- package/dist/{form-BqY0H1V5.d.ts → page-DXF0_SrY.d.ts} +3 -293
- package/dist/server.cjs +15 -635
- package/dist/server.d.cts +8 -75
- package/dist/server.d.ts +8 -75
- package/dist/server.mjs +11 -618
- package/package.json +1 -1
- package/dist/defineForm-Bp9vzW56.d.ts +0 -71
- package/dist/defineForm-CJ8KZC93.d.cts +0 -71
- package/dist/registry-CraTTwT7.d.cts +0 -29
- package/dist/registry-DMujGqt0.d.ts +0 -29
package/dist/server.d.cts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { G as GetGlobal, P as PreviewMode } from './
|
|
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
|
|
3
|
-
import { C as ContentStorageAdapter, A as AssetStorageAdapter } from './assets-
|
|
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-
|
|
5
|
-
|
|
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';
|
|
1
|
+
import { G as GetGlobal, P as PreviewMode } from './getContent-yK-sARoc.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 Runtime, j as RuntimeOptions, k as createListPages, l as createRuntime } from './getContent-yK-sARoc.cjs';
|
|
3
|
+
import { C as ContentStorageAdapter, A as AssetStorageAdapter } from './assets-B3oNeLdj.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-B3oNeLdj.cjs';
|
|
5
|
+
export { g as BooleanField, B as ButtonField, f as ButtonValue, F as FieldDescriptor, l as FieldKind, k as FieldValueFor, I as ImageField, a as ImageValue, L as LinkField, e as LinkValue, i as ListField, m as ListItem, N as NumberField, P as Page, n as PageSeo, j as PageSummary, c as ReferenceField, d as ReferenceValue, R as RichTextField, o as Section, S as SectionSchema, h as SelectField, p as SelectOption, T as TextField, V as VideoField, b as VideoValue } from './page-DXF0_SrY.cjs';
|
|
7
6
|
export { hasUniqueSectionIds, hrefOf, isExternalLink, linkAnchorAttrs, normalizeLinkValue, validateEmail, validateExternalUrl, validateInternalSlug, validatePhone } from './index.cjs';
|
|
8
7
|
export { G as Global } from './global-CV23g5Bn.cjs';
|
|
9
|
-
import { A as AnySectionDefinition } from './defineSection-
|
|
10
|
-
export { D as DataOf, a as DefineSectionInput, F as FieldDataType, S as SectionComponent, b as SectionDefinition, d as defineSection } from './defineSection-
|
|
8
|
+
import { A as AnySectionDefinition } from './defineSection-ByG5uwiR.cjs';
|
|
9
|
+
export { D as DataOf, a as DefineSectionInput, F as FieldDataType, S as SectionComponent, b as SectionDefinition, d as defineSection } from './defineSection-ByG5uwiR.cjs';
|
|
11
10
|
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
11
|
|
|
15
12
|
declare const NOT_FOUND_PAGE_SLUG = "404";
|
|
16
13
|
declare const SERVER_ERROR_PAGE_SLUG = "500";
|
|
@@ -46,61 +43,6 @@ interface FsAssetAdapterOptions {
|
|
|
46
43
|
}
|
|
47
44
|
declare const createFsAssetAdapter: (options: FsAssetAdapterOptions) => AssetStorageAdapter;
|
|
48
45
|
|
|
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
46
|
interface DefaultAdapterOptions {
|
|
105
47
|
/** Project root. Defaults to `process.cwd()`. */
|
|
106
48
|
readonly projectRoot?: string;
|
|
@@ -116,15 +58,6 @@ declare function createDefaultContentAdapter(options?: DefaultAdapterOptions): C
|
|
|
116
58
|
* (ARCHITECTURE.md §3).
|
|
117
59
|
*/
|
|
118
60
|
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
61
|
|
|
129
62
|
interface GlobalSlotProps {
|
|
130
63
|
/** The global's name as registered in `content/globals/<name>.json`. */
|
|
@@ -150,4 +83,4 @@ interface GlobalSlotProps {
|
|
|
150
83
|
*/
|
|
151
84
|
declare function GlobalSlot(props: GlobalSlotProps): Promise<React.ReactElement | null>;
|
|
152
85
|
|
|
153
|
-
export { AnySectionDefinition, AssetStorageAdapter, ContentStorageAdapter, type DefaultAdapterOptions, type FsAssetAdapterOptions, type FsContentAdapterOptions,
|
|
86
|
+
export { AnySectionDefinition, AssetStorageAdapter, ContentStorageAdapter, type DefaultAdapterOptions, type FsAssetAdapterOptions, type FsContentAdapterOptions, GetGlobal, GlobalSlot, type GlobalSlotProps, NOT_FOUND_PAGE_SLUG, PreviewMode, SERVER_ERROR_PAGE_SLUG, createDefaultAssetAdapter, createDefaultContentAdapter, createFsAssetAdapter, createFsContentAdapter, getReservedPageSlugViolation, isSitemapEligibleSlug };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { G as GetGlobal, P as PreviewMode } from './
|
|
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
|
|
3
|
-
import { C as ContentStorageAdapter, A as AssetStorageAdapter } from './assets-
|
|
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-
|
|
5
|
-
|
|
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';
|
|
1
|
+
import { G as GetGlobal, P as PreviewMode } from './getContent-DAgAn095.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 Runtime, j as RuntimeOptions, k as createListPages, l as createRuntime } from './getContent-DAgAn095.js';
|
|
3
|
+
import { C as ContentStorageAdapter, A as AssetStorageAdapter } from './assets-DHumg-X7.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-DHumg-X7.js';
|
|
5
|
+
export { g as BooleanField, B as ButtonField, f as ButtonValue, F as FieldDescriptor, l as FieldKind, k as FieldValueFor, I as ImageField, a as ImageValue, L as LinkField, e as LinkValue, i as ListField, m as ListItem, N as NumberField, P as Page, n as PageSeo, j as PageSummary, c as ReferenceField, d as ReferenceValue, R as RichTextField, o as Section, S as SectionSchema, h as SelectField, p as SelectOption, T as TextField, V as VideoField, b as VideoValue } from './page-DXF0_SrY.js';
|
|
7
6
|
export { hasUniqueSectionIds, hrefOf, isExternalLink, linkAnchorAttrs, normalizeLinkValue, validateEmail, validateExternalUrl, validateInternalSlug, validatePhone } from './index.js';
|
|
8
7
|
export { G as Global } from './global-CV23g5Bn.js';
|
|
9
|
-
import { A as AnySectionDefinition } from './defineSection-
|
|
10
|
-
export { D as DataOf, a as DefineSectionInput, F as FieldDataType, S as SectionComponent, b as SectionDefinition, d as defineSection } from './defineSection-
|
|
8
|
+
import { A as AnySectionDefinition } from './defineSection-ChkZCQyQ.js';
|
|
9
|
+
export { D as DataOf, a as DefineSectionInput, F as FieldDataType, S as SectionComponent, b as SectionDefinition, d as defineSection } from './defineSection-ChkZCQyQ.js';
|
|
11
10
|
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
11
|
|
|
15
12
|
declare const NOT_FOUND_PAGE_SLUG = "404";
|
|
16
13
|
declare const SERVER_ERROR_PAGE_SLUG = "500";
|
|
@@ -46,61 +43,6 @@ interface FsAssetAdapterOptions {
|
|
|
46
43
|
}
|
|
47
44
|
declare const createFsAssetAdapter: (options: FsAssetAdapterOptions) => AssetStorageAdapter;
|
|
48
45
|
|
|
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
46
|
interface DefaultAdapterOptions {
|
|
105
47
|
/** Project root. Defaults to `process.cwd()`. */
|
|
106
48
|
readonly projectRoot?: string;
|
|
@@ -116,15 +58,6 @@ declare function createDefaultContentAdapter(options?: DefaultAdapterOptions): C
|
|
|
116
58
|
* (ARCHITECTURE.md §3).
|
|
117
59
|
*/
|
|
118
60
|
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
61
|
|
|
129
62
|
interface GlobalSlotProps {
|
|
130
63
|
/** The global's name as registered in `content/globals/<name>.json`. */
|
|
@@ -150,4 +83,4 @@ interface GlobalSlotProps {
|
|
|
150
83
|
*/
|
|
151
84
|
declare function GlobalSlot(props: GlobalSlotProps): Promise<React.ReactElement | null>;
|
|
152
85
|
|
|
153
|
-
export { AnySectionDefinition, AssetStorageAdapter, ContentStorageAdapter, type DefaultAdapterOptions, type FsAssetAdapterOptions, type FsContentAdapterOptions,
|
|
86
|
+
export { AnySectionDefinition, AssetStorageAdapter, ContentStorageAdapter, type DefaultAdapterOptions, type FsAssetAdapterOptions, type FsContentAdapterOptions, GetGlobal, GlobalSlot, type GlobalSlotProps, NOT_FOUND_PAGE_SLUG, PreviewMode, SERVER_ERROR_PAGE_SLUG, createDefaultAssetAdapter, createDefaultContentAdapter, createFsAssetAdapter, createFsContentAdapter, getReservedPageSlugViolation, isSitemapEligibleSlug };
|