@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agntcms/next",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "agntcms runtime for Next.js: domain model, storage adapters, React components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -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 };