@agntcms/next 0.3.2 → 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 +2 -123
- package/dist/config.d.cts +4 -59
- package/dist/config.d.ts +4 -59
- package/dist/config.mjs +2 -116
- 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/package.json
CHANGED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { a as FormSchema, b as FormDefinition } from './form-BqY0H1V5.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Input shape for `defineForm`. Split out so the factory can use a single
|
|
5
|
-
* generic parameter for both input and output, the same pattern as
|
|
6
|
-
* `defineSection`.
|
|
7
|
-
*/
|
|
8
|
-
interface DefineFormInput<S extends FormSchema> {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly schema: S;
|
|
11
|
-
/**
|
|
12
|
-
* Optional honeypot field name (out-of-schema). The route handler treats
|
|
13
|
-
* a non-empty value at this key in the submit payload as a bot
|
|
14
|
-
* indicator and silently drops the submission. The handler MUST NOT
|
|
15
|
-
* leak suppression to the client (returns 200 ok with `stored: false`).
|
|
16
|
-
*
|
|
17
|
-
* MUST NOT collide with any field name in `schema`.
|
|
18
|
-
*/
|
|
19
|
-
readonly honeypot?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Thrown when `defineForm` rejects a form schema that violates the v1 restrictions. */
|
|
22
|
-
declare class InvalidFormFieldError extends Error {
|
|
23
|
-
readonly formName: string;
|
|
24
|
-
readonly fieldName: string;
|
|
25
|
-
readonly fieldKind: string;
|
|
26
|
-
constructor(formName: string, fieldName: string, fieldKind: string);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Thrown when a `honeypot` value is unusable. Discriminated by `reason`:
|
|
30
|
-
*
|
|
31
|
-
* - `'collision'` — the honeypot name matches a field already declared
|
|
32
|
-
* in the schema. This would let bot traffic occupy a real field key.
|
|
33
|
-
* - `'empty'` — the honeypot name is the empty string. An empty key is
|
|
34
|
-
* never a valid identifier in the submit payload, so the honeypot
|
|
35
|
-
* check would silently always pass; this is treated as an authoring
|
|
36
|
-
* mistake.
|
|
37
|
-
*
|
|
38
|
-
* Single class with a discriminator (rather than a second error class)
|
|
39
|
-
* keeps the public error surface small while still letting callers
|
|
40
|
-
* distinguish the two failure modes through `err.reason`.
|
|
41
|
-
*/
|
|
42
|
-
declare class HoneypotCollisionError extends Error {
|
|
43
|
-
readonly formName: string;
|
|
44
|
-
readonly fieldName: string;
|
|
45
|
-
readonly reason: 'collision' | 'empty';
|
|
46
|
-
constructor(formName: string, fieldName: string, reason?: 'collision' | 'empty');
|
|
47
|
-
}
|
|
48
|
-
/** Thrown when `name` is empty or fails the conservative URL-segment check. */
|
|
49
|
-
declare class InvalidFormNameError extends Error {
|
|
50
|
-
constructor(name: string);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Type-safe factory for a `FormDefinition`.
|
|
54
|
-
*
|
|
55
|
-
* Compile-time guarantee: `S extends FormSchema` constrains each field
|
|
56
|
-
* to `FormFieldDescriptor` (the closed v1 subset). Runtime guarantee:
|
|
57
|
-
* the factory iterates `schema` and throws `InvalidFormFieldError` if any
|
|
58
|
-
* descriptor's `kind` is in `FORM_FORBIDDEN_KINDS`. Both layers exist on
|
|
59
|
-
* purpose — see file header.
|
|
60
|
-
*
|
|
61
|
-
* Allowed field kinds (see ARCHITECTURE.md §6.5):
|
|
62
|
-
* text, richText, number, boolean, select, link
|
|
63
|
-
*
|
|
64
|
-
* Forbidden in v1 (throws):
|
|
65
|
-
* image — file upload deferred (§6.5, §12)
|
|
66
|
-
* reference — semantic mismatch for user input
|
|
67
|
-
* list — recursive payload validation, YAGNI for v1
|
|
68
|
-
*/
|
|
69
|
-
declare function defineForm<S extends FormSchema>(input: DefineFormInput<S>): FormDefinition<S>;
|
|
70
|
-
|
|
71
|
-
export { type DefineFormInput as D, HoneypotCollisionError as H, InvalidFormFieldError as I, InvalidFormNameError as a, defineForm as d };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { a as FormSchema, b as FormDefinition } from './form-BqY0H1V5.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Input shape for `defineForm`. Split out so the factory can use a single
|
|
5
|
-
* generic parameter for both input and output, the same pattern as
|
|
6
|
-
* `defineSection`.
|
|
7
|
-
*/
|
|
8
|
-
interface DefineFormInput<S extends FormSchema> {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly schema: S;
|
|
11
|
-
/**
|
|
12
|
-
* Optional honeypot field name (out-of-schema). The route handler treats
|
|
13
|
-
* a non-empty value at this key in the submit payload as a bot
|
|
14
|
-
* indicator and silently drops the submission. The handler MUST NOT
|
|
15
|
-
* leak suppression to the client (returns 200 ok with `stored: false`).
|
|
16
|
-
*
|
|
17
|
-
* MUST NOT collide with any field name in `schema`.
|
|
18
|
-
*/
|
|
19
|
-
readonly honeypot?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Thrown when `defineForm` rejects a form schema that violates the v1 restrictions. */
|
|
22
|
-
declare class InvalidFormFieldError extends Error {
|
|
23
|
-
readonly formName: string;
|
|
24
|
-
readonly fieldName: string;
|
|
25
|
-
readonly fieldKind: string;
|
|
26
|
-
constructor(formName: string, fieldName: string, fieldKind: string);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Thrown when a `honeypot` value is unusable. Discriminated by `reason`:
|
|
30
|
-
*
|
|
31
|
-
* - `'collision'` — the honeypot name matches a field already declared
|
|
32
|
-
* in the schema. This would let bot traffic occupy a real field key.
|
|
33
|
-
* - `'empty'` — the honeypot name is the empty string. An empty key is
|
|
34
|
-
* never a valid identifier in the submit payload, so the honeypot
|
|
35
|
-
* check would silently always pass; this is treated as an authoring
|
|
36
|
-
* mistake.
|
|
37
|
-
*
|
|
38
|
-
* Single class with a discriminator (rather than a second error class)
|
|
39
|
-
* keeps the public error surface small while still letting callers
|
|
40
|
-
* distinguish the two failure modes through `err.reason`.
|
|
41
|
-
*/
|
|
42
|
-
declare class HoneypotCollisionError extends Error {
|
|
43
|
-
readonly formName: string;
|
|
44
|
-
readonly fieldName: string;
|
|
45
|
-
readonly reason: 'collision' | 'empty';
|
|
46
|
-
constructor(formName: string, fieldName: string, reason?: 'collision' | 'empty');
|
|
47
|
-
}
|
|
48
|
-
/** Thrown when `name` is empty or fails the conservative URL-segment check. */
|
|
49
|
-
declare class InvalidFormNameError extends Error {
|
|
50
|
-
constructor(name: string);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Type-safe factory for a `FormDefinition`.
|
|
54
|
-
*
|
|
55
|
-
* Compile-time guarantee: `S extends FormSchema` constrains each field
|
|
56
|
-
* to `FormFieldDescriptor` (the closed v1 subset). Runtime guarantee:
|
|
57
|
-
* the factory iterates `schema` and throws `InvalidFormFieldError` if any
|
|
58
|
-
* descriptor's `kind` is in `FORM_FORBIDDEN_KINDS`. Both layers exist on
|
|
59
|
-
* purpose — see file header.
|
|
60
|
-
*
|
|
61
|
-
* Allowed field kinds (see ARCHITECTURE.md §6.5):
|
|
62
|
-
* text, richText, number, boolean, select, link
|
|
63
|
-
*
|
|
64
|
-
* Forbidden in v1 (throws):
|
|
65
|
-
* image — file upload deferred (§6.5, §12)
|
|
66
|
-
* reference — semantic mismatch for user input
|
|
67
|
-
* list — recursive payload validation, YAGNI for v1
|
|
68
|
-
*/
|
|
69
|
-
declare function defineForm<S extends FormSchema>(input: DefineFormInput<S>): FormDefinition<S>;
|
|
70
|
-
|
|
71
|
-
export { type DefineFormInput as D, HoneypotCollisionError as H, InvalidFormFieldError as I, InvalidFormNameError as a, defineForm as d };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { A as AnyFormDefinition, F as FormLookup } from './form-BqY0H1V5.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The input list `defineConfig` takes for forms.
|
|
5
|
-
*/
|
|
6
|
-
type FormDefinitionList = readonly AnyFormDefinition[];
|
|
7
|
-
/**
|
|
8
|
-
* Opaque, immutable lookup built from a `FormDefinitionList`. Structurally
|
|
9
|
-
* extends `FormLookup` (defined in `domain/`) so the runtime can accept
|
|
10
|
-
* any `FormLookup` without depending on `forms/`.
|
|
11
|
-
*/
|
|
12
|
-
interface FormRegistry extends FormLookup {
|
|
13
|
-
readonly definitions: FormDefinitionList;
|
|
14
|
-
get(name: string): AnyFormDefinition | undefined;
|
|
15
|
-
has(name: string): boolean;
|
|
16
|
-
}
|
|
17
|
-
/** Thrown when two form definitions share a `name`. */
|
|
18
|
-
declare class DuplicateFormNameError extends Error {
|
|
19
|
-
readonly formName: string;
|
|
20
|
-
constructor(name: string);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Build an immutable `FormRegistry` from an ordered list of definitions.
|
|
24
|
-
* Rejects duplicates eagerly — see `buildSectionRegistry` for the same
|
|
25
|
-
* rationale.
|
|
26
|
-
*/
|
|
27
|
-
declare function buildFormRegistry(definitions: FormDefinitionList): FormRegistry;
|
|
28
|
-
|
|
29
|
-
export { DuplicateFormNameError as D, type FormDefinitionList as F, type FormRegistry as a, buildFormRegistry as b };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { A as AnyFormDefinition, F as FormLookup } from './form-BqY0H1V5.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The input list `defineConfig` takes for forms.
|
|
5
|
-
*/
|
|
6
|
-
type FormDefinitionList = readonly AnyFormDefinition[];
|
|
7
|
-
/**
|
|
8
|
-
* Opaque, immutable lookup built from a `FormDefinitionList`. Structurally
|
|
9
|
-
* extends `FormLookup` (defined in `domain/`) so the runtime can accept
|
|
10
|
-
* any `FormLookup` without depending on `forms/`.
|
|
11
|
-
*/
|
|
12
|
-
interface FormRegistry extends FormLookup {
|
|
13
|
-
readonly definitions: FormDefinitionList;
|
|
14
|
-
get(name: string): AnyFormDefinition | undefined;
|
|
15
|
-
has(name: string): boolean;
|
|
16
|
-
}
|
|
17
|
-
/** Thrown when two form definitions share a `name`. */
|
|
18
|
-
declare class DuplicateFormNameError extends Error {
|
|
19
|
-
readonly formName: string;
|
|
20
|
-
constructor(name: string);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Build an immutable `FormRegistry` from an ordered list of definitions.
|
|
24
|
-
* Rejects duplicates eagerly — see `buildSectionRegistry` for the same
|
|
25
|
-
* rationale.
|
|
26
|
-
*/
|
|
27
|
-
declare function buildFormRegistry(definitions: FormDefinitionList): FormRegistry;
|
|
28
|
-
|
|
29
|
-
export { DuplicateFormNameError as D, type FormDefinitionList as F, type FormRegistry as a, buildFormRegistry as b };
|