@u-krupaveho-kraba/form-schemas 0.1.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/index.js +25 -0
- package/package.json +29 -0
- package/schema/campaign.schema.json +4686 -0
- package/schemas/campaign.js +64 -0
- package/schemas/element.js +88 -0
- package/schemas/elementProperties.js +117 -0
- package/schemas/form.js +33 -0
- package/schemas/formDisplay.js +61 -0
- package/schemas/helpers.js +12 -0
- package/schemas/step.js +15 -0
- package/types/index.d.ts +18 -0
- package/types/schemas/campaign.d.ts +15172 -0
- package/types/schemas/element.d.ts +1503 -0
- package/types/schemas/elementProperties.d.ts +346 -0
- package/types/schemas/form.d.ts +6027 -0
- package/types/schemas/formDisplay.d.ts +278 -0
- package/types/schemas/helpers.d.ts +9 -0
- package/types/schemas/step.d.ts +693 -0
package/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
import { FormSchema } from "./schemas/form.js";
|
|
3
|
+
import { CampaignSchema } from "./schemas/campaign.js";
|
|
4
|
+
export * from "./schemas/helpers.js";
|
|
5
|
+
export * from "./schemas/formDisplay.js";
|
|
6
|
+
export * from "./schemas/elementProperties.js";
|
|
7
|
+
export * from "./schemas/element.js";
|
|
8
|
+
export * from "./schemas/step.js";
|
|
9
|
+
export * from "./schemas/form.js";
|
|
10
|
+
export * from "./schemas/campaign.js";
|
|
11
|
+
/**
|
|
12
|
+
* Serializes the full form type tree as standard JSON Schema —
|
|
13
|
+
* used to tell an LLM the exact shape of valid form JSON (issue 024).
|
|
14
|
+
*/
|
|
15
|
+
export function getFormJsonSchema() {
|
|
16
|
+
return z.toJSONSchema(FormSchema);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Serializes the Campaign contract as standard JSON Schema — the artifact
|
|
20
|
+
* exported to ecomailapp so its PHP publish job can validate against the
|
|
21
|
+
* real schema instead of drifting silently (ticket 115/118, ADR 0017).
|
|
22
|
+
*/
|
|
23
|
+
export function getCampaignJsonSchema() {
|
|
24
|
+
return z.toJSONSchema(CampaignSchema);
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@u-krupaveho-kraba/form-schemas",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zod schemas for Topol form JSON (validation gate + AI generation)",
|
|
5
|
+
"author": "Topol.io",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/TOPOL-io/editors.git",
|
|
10
|
+
"directory": "packages/form-schemas"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./index.js",
|
|
14
|
+
"module": "./index.js",
|
|
15
|
+
"types": "./types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"import": "./index.js",
|
|
20
|
+
"require": "./index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"zod": "^4.1.11"
|
|
28
|
+
}
|
|
29
|
+
}
|