bank20baht-validator 0.0.3 → 0.0.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/index.d.ts +3 -3
- package/dist/index.js +5 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, validateField, type FormDefinition, type NestedData, type Registry, type WorkflowDefinition, type WorkflowForm } from 'bank20baht-ui/engine';
|
|
1
|
+
import { applyFlags, approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, validateField, type FormDefinition, type NestedData, type Registry, type WorkflowDefinition, type WorkflowForm } from 'bank20baht-ui/engine';
|
|
2
2
|
export type SchemaDefinition = FormDefinition | WorkflowDefinition;
|
|
3
3
|
/** One violation. `ref` is the field key for forms, `formName.key` for workflows. */
|
|
4
4
|
export interface ValidationIssue {
|
|
@@ -46,6 +46,6 @@ export declare function validateSubmission(schema: SchemaDefinition, data: unkno
|
|
|
46
46
|
* render. Throws with a human-readable message on bad input.
|
|
47
47
|
*/
|
|
48
48
|
export declare function parseSchema(json: unknown): SchemaDefinition;
|
|
49
|
-
export { approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, validateField };
|
|
49
|
+
export { applyFlags, approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, validateField, };
|
|
50
50
|
export type { FormDefinition, NestedData, Registry, WorkflowDefinition, WorkflowForm };
|
|
51
|
-
export type { FormViewSpec, Locale, MessageCatalog } from 'bank20baht-ui/engine';
|
|
51
|
+
export type { FeatureFlags, FormViewSpec, Locale, MessageCatalog } from 'bank20baht-ui/engine';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// request that bypasses the frontend hits the exact same rules — no codegen,
|
|
8
8
|
// no recompile: swap the stored JSON and validation follows.
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
|
-
import { approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, t, validateField, } from 'bank20baht-ui/engine';
|
|
10
|
+
import { applyFlags, approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, t, validateField, } from 'bank20baht-ui/engine';
|
|
11
11
|
export function isWorkflowDefinition(schema) {
|
|
12
12
|
return (isRecord(schema) &&
|
|
13
13
|
typeof schema['workflowId'] === 'string' &&
|
|
@@ -217,5 +217,7 @@ function assertValidViews(form) {
|
|
|
217
217
|
}
|
|
218
218
|
// Re-exported so servers can type stores and registries without a direct
|
|
219
219
|
// dependency on bank20baht-ui. `setLocale` localizes the issues this package
|
|
220
|
-
// emits (same catalog the client renders).
|
|
221
|
-
|
|
220
|
+
// emits (same catalog the client renders). `applyFlags` resolves feature
|
|
221
|
+
// flags server-side — validate flag-gated schemas as
|
|
222
|
+
// `validateSubmission(applyFlags(schema, flags), data)`.
|
|
223
|
+
export { applyFlags, approvalFields, defaultValue, evaluate, resolveViewFields, setLocale, validateField, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bank20baht-validator",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Runtime validation for bahtui form/workflow JSON — the exact engine rules the client runs, on the server.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"test:watch": "vitest"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"bank20baht-ui": "^0.0.
|
|
42
|
+
"bank20baht-ui": "^0.0.10"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.8.3",
|