@stndrds/schema 1.0.0-alpha.95 → 1.0.0-alpha.97
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/attributes-C-bhC0k5.d.ts +673 -0
- package/dist/attributes-DB76JqXm.d.mts +673 -0
- package/dist/chunk-2TEWGEUI.js +212 -0
- package/dist/chunk-4RGFTMQR.mjs +8 -0
- package/dist/chunk-5TLM4QXO.mjs +8 -0
- package/dist/chunk-67PQMHQA.mjs +199 -0
- package/dist/chunk-6HHSX6LP.js +64 -0
- package/dist/chunk-AHPXNPJC.js +105 -0
- package/dist/chunk-BEN6TE7Y.js +11 -0
- package/dist/chunk-BH3RPSC5.js +22 -0
- package/dist/chunk-BIQ35DLC.mjs +78 -0
- package/dist/chunk-CKZHFJQT.js +16 -0
- package/dist/chunk-E6XO2STS.js +11 -11
- package/dist/chunk-EIWGW2ML.mjs +99 -0
- package/dist/chunk-EKG35CSO.mjs +1 -0
- package/dist/chunk-IMEPIVTR.js +217 -0
- package/dist/chunk-J4ORNCAH.js +10 -0
- package/dist/chunk-KC4F3HB7.js +32 -0
- package/dist/chunk-LHXE7LLD.js +28 -0
- package/dist/chunk-MD6XGXTU.mjs +18 -0
- package/dist/chunk-N47XKY4R.js +14 -0
- package/dist/chunk-NXXSNUDI.mjs +8 -0
- package/dist/chunk-PKG3E5MW.mjs +18 -0
- package/dist/chunk-PZT3CIHD.mjs +192 -0
- package/dist/chunk-QL3UGPUG.mjs +60 -0
- package/dist/chunk-QY65ZSBL.js +16 -0
- package/dist/chunk-R6JFUC32.js +2 -0
- package/dist/chunk-RDXQ4CYT.mjs +9 -0
- package/dist/chunk-S5VJ2FZE.js +12 -0
- package/dist/chunk-SVII65W7.mjs +14 -0
- package/dist/chunk-U7VN3RUE.mjs +25 -0
- package/dist/chunk-VCPYYLCS.js +83 -0
- package/dist/chunk-VD3P2A6Q.js +10 -0
- package/dist/chunk-VPEV3W34.mjs +10 -0
- package/dist/chunk-WGFQMQMV.mjs +14 -0
- package/dist/chunk-X6VDDXG7.mjs +12 -0
- package/dist/chunk-XAORXFAX.mjs +1 -10
- package/dist/chunk-XEOG24K6.mjs +8 -0
- package/dist/chunk-XK6XC3V4.js +10 -0
- package/dist/chunk-XZ5B5MTG.js +20 -0
- package/dist/chunk-YKHC2AW6.js +10 -0
- package/dist/chunk-Z2T7ONKU.js +20 -0
- package/dist/chunk-ZFL7DXAE.mjs +28 -0
- package/dist/chunk-ZM7W2ZCF.mjs +20 -0
- package/dist/{validators-5XMwJOlV.d.ts → index-Bt-0XNSh.d.ts} +14 -1499
- package/dist/{validators-BCw4Sn01.d.mts → index-C9tOwUbK.d.mts} +14 -1499
- package/dist/index.d.mts +1267 -976
- package/dist/index.d.ts +1267 -976
- package/dist/index.js +1293 -1001
- package/dist/index.mjs +529 -785
- package/dist/types-B7nS2D1A.d.ts +39 -0
- package/dist/types-CjXbGsy8.d.mts +39 -0
- package/dist/utils.js +38 -20
- package/dist/utils.mjs +1 -20
- package/dist/validation/all.d.mts +23 -0
- package/dist/validation/all.d.ts +23 -0
- package/dist/validation/all.js +265 -0
- package/dist/validation/all.mjs +20 -0
- package/dist/validation/complex/currency.d.mts +15 -0
- package/dist/validation/complex/currency.d.ts +15 -0
- package/dist/validation/complex/currency.js +12 -0
- package/dist/validation/complex/currency.mjs +3 -0
- package/dist/validation/complex/file.d.mts +13 -0
- package/dist/validation/complex/file.d.ts +13 -0
- package/dist/validation/complex/file.js +12 -0
- package/dist/validation/complex/file.mjs +3 -0
- package/dist/validation/complex/location.d.mts +22 -0
- package/dist/validation/complex/location.d.ts +22 -0
- package/dist/validation/complex/location.js +12 -0
- package/dist/validation/complex/location.mjs +3 -0
- package/dist/validation/complex/phone.d.mts +22 -0
- package/dist/validation/complex/phone.d.ts +22 -0
- package/dist/validation/complex/phone.js +12 -0
- package/dist/validation/complex/phone.mjs +3 -0
- package/dist/validation/complex/relation.d.mts +25 -0
- package/dist/validation/complex/relation.d.ts +25 -0
- package/dist/validation/complex/relation.js +20 -0
- package/dist/validation/complex/relation.mjs +3 -0
- package/dist/validation/complex/richtext.d.mts +13 -0
- package/dist/validation/complex/richtext.d.ts +13 -0
- package/dist/validation/complex/richtext.js +12 -0
- package/dist/validation/complex/richtext.mjs +3 -0
- package/dist/validation/complex/select.d.mts +20 -0
- package/dist/validation/complex/select.d.ts +20 -0
- package/dist/validation/complex/select.js +20 -0
- package/dist/validation/complex/select.mjs +3 -0
- package/dist/validation/complex/user.d.mts +13 -0
- package/dist/validation/complex/user.d.ts +13 -0
- package/dist/validation/complex/user.js +12 -0
- package/dist/validation/complex/user.mjs +3 -0
- package/dist/validation/computed/formula.d.mts +14 -0
- package/dist/validation/computed/formula.d.ts +14 -0
- package/dist/validation/computed/formula.js +12 -0
- package/dist/validation/computed/formula.mjs +3 -0
- package/dist/validation/computed/rollup.d.mts +14 -0
- package/dist/validation/computed/rollup.d.ts +14 -0
- package/dist/validation/computed/rollup.js +12 -0
- package/dist/validation/computed/rollup.mjs +3 -0
- package/dist/validation/config/index.d.mts +421 -0
- package/dist/validation/config/index.d.ts +421 -0
- package/dist/validation/config/index.js +103 -0
- package/dist/validation/config/index.mjs +2 -0
- package/dist/validation/core/index.d.mts +85 -0
- package/dist/validation/core/index.d.ts +85 -0
- package/dist/validation/core/index.js +27 -0
- package/dist/validation/core/index.mjs +2 -0
- package/dist/validation/object/index.d.mts +6 -0
- package/dist/validation/object/index.d.ts +6 -0
- package/dist/validation/object/index.js +71 -0
- package/dist/validation/object/index.mjs +18 -0
- package/dist/validation/primitives/checkbox.d.mts +12 -0
- package/dist/validation/primitives/checkbox.d.ts +12 -0
- package/dist/validation/primitives/checkbox.js +12 -0
- package/dist/validation/primitives/checkbox.mjs +3 -0
- package/dist/validation/primitives/date.d.mts +12 -0
- package/dist/validation/primitives/date.d.ts +12 -0
- package/dist/validation/primitives/date.js +12 -0
- package/dist/validation/primitives/date.mjs +3 -0
- package/dist/validation/primitives/number.d.mts +12 -0
- package/dist/validation/primitives/number.d.ts +12 -0
- package/dist/validation/primitives/number.js +12 -0
- package/dist/validation/primitives/number.mjs +3 -0
- package/dist/validation/primitives/rating.d.mts +12 -0
- package/dist/validation/primitives/rating.d.ts +12 -0
- package/dist/validation/primitives/rating.js +12 -0
- package/dist/validation/primitives/rating.mjs +3 -0
- package/dist/validation/primitives/text.d.mts +17 -0
- package/dist/validation/primitives/text.d.ts +17 -0
- package/dist/validation/primitives/text.js +16 -0
- package/dist/validation/primitives/text.mjs +3 -0
- package/dist/validation/validators.d.mts +21 -2
- package/dist/validation/validators.d.ts +21 -2
- package/dist/validation/validators.js +265 -120
- package/dist/validation/validators.mjs +20 -120
- package/package.json +108 -5
- package/dist/chunk-4362R5F2.mjs +0 -780
- package/dist/chunk-7QUI6TSO.js +0 -780
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { V as ValidationMessages } from '../../types-B7nS2D1A.js';
|
|
2
|
+
export { a as ValidationResult } from '../../types-B7nS2D1A.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import '../../attributes-C-bhC0k5.js';
|
|
5
|
+
import '@stndrds/constants';
|
|
6
|
+
import '../../utils.js';
|
|
7
|
+
|
|
8
|
+
declare const DEFAULT_VALIDATION_MESSAGES: ValidationMessages;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Format Zod validation errors into a consistent structure.
|
|
12
|
+
* This eliminates code duplication across multiple validation functions.
|
|
13
|
+
*/
|
|
14
|
+
declare function formatZodErrors(error: z.ZodError): Array<{
|
|
15
|
+
path: string[];
|
|
16
|
+
message: string;
|
|
17
|
+
}>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Least Recently Used (LRU) Cache implementation
|
|
21
|
+
* Caps cache size and evicts oldest entries when capacity is reached.
|
|
22
|
+
*/
|
|
23
|
+
declare class LRUCache<K, V> {
|
|
24
|
+
private readonly capacity;
|
|
25
|
+
private cache;
|
|
26
|
+
constructor(capacity: number);
|
|
27
|
+
get(key: K): V | undefined;
|
|
28
|
+
set(key: K, value: V): void;
|
|
29
|
+
has(key: K): boolean;
|
|
30
|
+
clear(): void;
|
|
31
|
+
get size(): number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Factory function to create an isolated regex cache.
|
|
36
|
+
* Each validator module can create its own cache to avoid shared mutable state.
|
|
37
|
+
* Uses LRU eviction with max 100 entries to prevent unbounded growth.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Create a module-local cache
|
|
42
|
+
* const myCache = createRegexCache();
|
|
43
|
+
*
|
|
44
|
+
* // Use it with getCachedRegex
|
|
45
|
+
* const regex = getCachedRegex(myCache, "^[a-z]+$");
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function createRegexCache(capacity?: number): LRUCache<string, RegExp>;
|
|
49
|
+
/**
|
|
50
|
+
* Helper to get or compile a cached regex.
|
|
51
|
+
*
|
|
52
|
+
* **API Change (v1.0.0-alpha.95)**: This function now requires a cache instance
|
|
53
|
+
* as the first parameter. This change enables tree-shaking by eliminating
|
|
54
|
+
* shared mutable state. Use `createRegexCache()` to create a module-local cache.
|
|
55
|
+
*
|
|
56
|
+
* @param cache - The LRU cache instance (created via `createRegexCache()`)
|
|
57
|
+
* @param pattern - The regex pattern string
|
|
58
|
+
* @returns Compiled RegExp
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const textRegexCache = createRegexCache();
|
|
63
|
+
* const emailRegex = getCachedRegex(textRegexCache, "^[^@]+@[^@]+$");
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare function getCachedRegex(cache: LRUCache<string, RegExp>, pattern: string): RegExp;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use `getCachedRegex(cache, pattern)` instead.
|
|
69
|
+
* This function uses a shared global cache which prevents optimal tree-shaking.
|
|
70
|
+
*
|
|
71
|
+
* Migration:
|
|
72
|
+
* ```typescript
|
|
73
|
+
* // Before
|
|
74
|
+
* import { getRegex } from "@stndrds/schema/validators/core";
|
|
75
|
+
* const regex = getRegex("^[a-z]+$");
|
|
76
|
+
*
|
|
77
|
+
* // After
|
|
78
|
+
* import { createRegexCache, getCachedRegex } from "@stndrds/schema/validators/core";
|
|
79
|
+
* const myCache = createRegexCache();
|
|
80
|
+
* const regex = getCachedRegex(myCache, "^[a-z]+$");
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
declare function getRegex(pattern: string): RegExp;
|
|
84
|
+
|
|
85
|
+
export { DEFAULT_VALIDATION_MESSAGES, ValidationMessages, createRegexCache, formatZodErrors, getCachedRegex, getRegex };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVCPYYLCS_js = require('../../chunk-VCPYYLCS.js');
|
|
4
|
+
var chunkBEN6TE7Y_js = require('../../chunk-BEN6TE7Y.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "DEFAULT_VALIDATION_MESSAGES", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkVCPYYLCS_js.DEFAULT_VALIDATION_MESSAGES; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "createRegexCache", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkVCPYYLCS_js.createRegexCache; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "getCachedRegex", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkVCPYYLCS_js.getCachedRegex; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "getRegex", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkVCPYYLCS_js.getRegex; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "formatZodErrors", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkBEN6TE7Y_js.formatZodErrors; }
|
|
27
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { c as computeRecordStatus, a as createAttributeValidator, b as createDraftValidator, d as createFormAttributeValidator, e as createObjectValidator, g as getMissingRequiredAttributes, i as isRecordComplete, v as validateAttribute, f as validateDraft, h as validateDraftOrThrow, j as validateObject, k as validateObjectOrThrow } from '../../index-C9tOwUbK.mjs';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '../../attributes-DB76JqXm.mjs';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.mjs';
|
|
6
|
+
import '../../types-CjXbGsy8.mjs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { c as computeRecordStatus, a as createAttributeValidator, b as createDraftValidator, d as createFormAttributeValidator, e as createObjectValidator, g as getMissingRequiredAttributes, i as isRecordComplete, v as validateAttribute, f as validateDraft, h as validateDraftOrThrow, j as validateObject, k as validateObjectOrThrow } from '../../index-Bt-0XNSh.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '../../attributes-C-bhC0k5.js';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.js';
|
|
6
|
+
import '../../types-B7nS2D1A.js';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk2TEWGEUI_js = require('../../chunk-2TEWGEUI.js');
|
|
4
|
+
require('../../chunk-XK6XC3V4.js');
|
|
5
|
+
require('../../chunk-VD3P2A6Q.js');
|
|
6
|
+
require('../../chunk-XZ5B5MTG.js');
|
|
7
|
+
require('../../chunk-N47XKY4R.js');
|
|
8
|
+
require('../../chunk-LHXE7LLD.js');
|
|
9
|
+
require('../../chunk-6HHSX6LP.js');
|
|
10
|
+
require('../../chunk-S5VJ2FZE.js');
|
|
11
|
+
require('../../chunk-KC4F3HB7.js');
|
|
12
|
+
require('../../chunk-CKZHFJQT.js');
|
|
13
|
+
require('../../chunk-J4ORNCAH.js');
|
|
14
|
+
require('../../chunk-YKHC2AW6.js');
|
|
15
|
+
require('../../chunk-QY65ZSBL.js');
|
|
16
|
+
require('../../chunk-Z2T7ONKU.js');
|
|
17
|
+
require('../../chunk-BH3RPSC5.js');
|
|
18
|
+
require('../../chunk-AHPXNPJC.js');
|
|
19
|
+
require('../../chunk-VCPYYLCS.js');
|
|
20
|
+
require('../../chunk-BEN6TE7Y.js');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Object.defineProperty(exports, "computeRecordStatus", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunk2TEWGEUI_js.computeRecordStatus; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "createAttributeValidator", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunk2TEWGEUI_js.createAttributeValidator; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "createDraftValidator", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return chunk2TEWGEUI_js.createDraftValidator; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "createFormAttributeValidator", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return chunk2TEWGEUI_js.createFormAttributeValidator; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "createObjectValidator", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return chunk2TEWGEUI_js.createObjectValidator; }
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "getMissingRequiredAttributes", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return chunk2TEWGEUI_js.getMissingRequiredAttributes; }
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "isRecordComplete", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () { return chunk2TEWGEUI_js.isRecordComplete; }
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "validateAttribute", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return chunk2TEWGEUI_js.validateAttribute; }
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "validateDraft", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () { return chunk2TEWGEUI_js.validateDraft; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "validateDraftOrThrow", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunk2TEWGEUI_js.validateDraftOrThrow; }
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "validateObject", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return chunk2TEWGEUI_js.validateObject; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "validateObjectOrThrow", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunk2TEWGEUI_js.validateObjectOrThrow; }
|
|
71
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { computeRecordStatus, createAttributeValidator, createDraftValidator, createFormAttributeValidator, createObjectValidator, getMissingRequiredAttributes, isRecordComplete, validateAttribute, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow } from '../../chunk-67PQMHQA.mjs';
|
|
2
|
+
import '../../chunk-5TLM4QXO.mjs';
|
|
3
|
+
import '../../chunk-XEOG24K6.mjs';
|
|
4
|
+
import '../../chunk-PKG3E5MW.mjs';
|
|
5
|
+
import '../../chunk-X6VDDXG7.mjs';
|
|
6
|
+
import '../../chunk-U7VN3RUE.mjs';
|
|
7
|
+
import '../../chunk-QL3UGPUG.mjs';
|
|
8
|
+
import '../../chunk-VPEV3W34.mjs';
|
|
9
|
+
import '../../chunk-ZFL7DXAE.mjs';
|
|
10
|
+
import '../../chunk-WGFQMQMV.mjs';
|
|
11
|
+
import '../../chunk-4RGFTMQR.mjs';
|
|
12
|
+
import '../../chunk-NXXSNUDI.mjs';
|
|
13
|
+
import '../../chunk-SVII65W7.mjs';
|
|
14
|
+
import '../../chunk-MD6XGXTU.mjs';
|
|
15
|
+
import '../../chunk-ZM7W2ZCF.mjs';
|
|
16
|
+
import '../../chunk-EIWGW2ML.mjs';
|
|
17
|
+
import '../../chunk-BIQ35DLC.mjs';
|
|
18
|
+
import '../../chunk-RDXQ4CYT.mjs';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { g as CheckboxAttribute } from '../../attributes-DB76JqXm.mjs';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-CjXbGsy8.mjs';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a checkbox attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createCheckboxValidator(_attr: CheckboxAttribute, _messages?: ValidationMessages): z.ZodBoolean;
|
|
11
|
+
|
|
12
|
+
export { createCheckboxValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { g as CheckboxAttribute } from '../../attributes-C-bhC0k5.js';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-B7nS2D1A.js';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a checkbox attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createCheckboxValidator(_attr: CheckboxAttribute, _messages?: ValidationMessages): z.ZodBoolean;
|
|
11
|
+
|
|
12
|
+
export { createCheckboxValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXK6XC3V4_js = require('../../chunk-XK6XC3V4.js');
|
|
4
|
+
require('../../chunk-VCPYYLCS.js');
|
|
5
|
+
require('../../chunk-BEN6TE7Y.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "createCheckboxValidator", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkXK6XC3V4_js.createCheckboxValidator; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { D as DateAttribute } from '../../attributes-DB76JqXm.mjs';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-CjXbGsy8.mjs';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a date attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createDateValidator(attr: DateAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
11
|
+
|
|
12
|
+
export { createDateValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { D as DateAttribute } from '../../attributes-C-bhC0k5.js';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-B7nS2D1A.js';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a date attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createDateValidator(attr: DateAttribute, messages?: ValidationMessages): z.ZodTypeAny;
|
|
11
|
+
|
|
12
|
+
export { createDateValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVD3P2A6Q_js = require('../../chunk-VD3P2A6Q.js');
|
|
4
|
+
require('../../chunk-VCPYYLCS.js');
|
|
5
|
+
require('../../chunk-BEN6TE7Y.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "createDateValidator", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkVD3P2A6Q_js.createDateValidator; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { N as NumberAttribute } from '../../attributes-DB76JqXm.mjs';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-CjXbGsy8.mjs';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a number attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z.ZodNumber;
|
|
11
|
+
|
|
12
|
+
export { createNumberValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { N as NumberAttribute } from '../../attributes-C-bhC0k5.js';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-B7nS2D1A.js';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a number attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createNumberValidator(attr: NumberAttribute, messages?: ValidationMessages): z.ZodNumber;
|
|
11
|
+
|
|
12
|
+
export { createNumberValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXZ5B5MTG_js = require('../../chunk-XZ5B5MTG.js');
|
|
4
|
+
require('../../chunk-VCPYYLCS.js');
|
|
5
|
+
require('../../chunk-BEN6TE7Y.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "createNumberValidator", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkXZ5B5MTG_js.createNumberValidator; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { h as RatingAttribute } from '../../attributes-DB76JqXm.mjs';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-CjXbGsy8.mjs';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a rating attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createRatingValidator(attr: RatingAttribute, messages?: ValidationMessages): z.ZodNumber;
|
|
11
|
+
|
|
12
|
+
export { createRatingValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { h as RatingAttribute } from '../../attributes-C-bhC0k5.js';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-B7nS2D1A.js';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a rating attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createRatingValidator(attr: RatingAttribute, messages?: ValidationMessages): z.ZodNumber;
|
|
11
|
+
|
|
12
|
+
export { createRatingValidator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkN47XKY4R_js = require('../../chunk-N47XKY4R.js');
|
|
4
|
+
require('../../chunk-VCPYYLCS.js');
|
|
5
|
+
require('../../chunk-BEN6TE7Y.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "createRatingValidator", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkN47XKY4R_js.createRatingValidator; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { T as TextAreaAttribute, i as TextAttribute } from '../../attributes-DB76JqXm.mjs';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-CjXbGsy8.mjs';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a text attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z.ZodString;
|
|
11
|
+
/**
|
|
12
|
+
* Create a Zod schema for a textarea attribute.
|
|
13
|
+
* Validates that the value is a string.
|
|
14
|
+
*/
|
|
15
|
+
declare function createTextAreaValidator(_attr: TextAreaAttribute, _messages?: ValidationMessages): z.ZodString;
|
|
16
|
+
|
|
17
|
+
export { createTextAreaValidator, createTextValidator };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { T as TextAreaAttribute, i as TextAttribute } from '../../attributes-C-bhC0k5.js';
|
|
3
|
+
import { V as ValidationMessages } from '../../types-B7nS2D1A.js';
|
|
4
|
+
import '@stndrds/constants';
|
|
5
|
+
import '../../utils.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a Zod schema for a text attribute
|
|
9
|
+
*/
|
|
10
|
+
declare function createTextValidator(attr: TextAttribute, messages?: ValidationMessages): z.ZodString;
|
|
11
|
+
/**
|
|
12
|
+
* Create a Zod schema for a textarea attribute.
|
|
13
|
+
* Validates that the value is a string.
|
|
14
|
+
*/
|
|
15
|
+
declare function createTextAreaValidator(_attr: TextAreaAttribute, _messages?: ValidationMessages): z.ZodString;
|
|
16
|
+
|
|
17
|
+
export { createTextAreaValidator, createTextValidator };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkLHXE7LLD_js = require('../../chunk-LHXE7LLD.js');
|
|
4
|
+
require('../../chunk-VCPYYLCS.js');
|
|
5
|
+
require('../../chunk-BEN6TE7Y.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "createTextAreaValidator", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkLHXE7LLD_js.createTextAreaValidator; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "createTextValidator", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkLHXE7LLD_js.createTextValidator; }
|
|
16
|
+
});
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export { V as ValidationMessages, a as ValidationResult } from '../types-CjXbGsy8.mjs';
|
|
2
|
+
export { DEFAULT_VALIDATION_MESSAGES, createRegexCache, formatZodErrors, getCachedRegex } from './core/index.mjs';
|
|
3
|
+
export { createTextAreaValidator, createTextValidator } from './primitives/text.mjs';
|
|
4
|
+
export { createNumberValidator } from './primitives/number.mjs';
|
|
5
|
+
export { createCheckboxValidator } from './primitives/checkbox.mjs';
|
|
6
|
+
export { createDateValidator } from './primitives/date.mjs';
|
|
7
|
+
export { createRatingValidator } from './primitives/rating.mjs';
|
|
8
|
+
export { createPhoneValidator } from './complex/phone.mjs';
|
|
9
|
+
export { createCurrencyValidator } from './complex/currency.mjs';
|
|
10
|
+
export { createLocationValidator } from './complex/location.mjs';
|
|
11
|
+
export { createRichtextValidator } from './complex/richtext.mjs';
|
|
12
|
+
export { createMultiselectValidator, createSelectValidator, createStatusValidator } from './complex/select.mjs';
|
|
13
|
+
export { createFileValidator } from './complex/file.mjs';
|
|
14
|
+
export { createUserValidator } from './complex/user.mjs';
|
|
15
|
+
export { createMultiRelationValidator, createRelationValidator, createSingleRelationValidator } from './complex/relation.mjs';
|
|
16
|
+
export { createFormulaValidator } from './computed/formula.mjs';
|
|
17
|
+
export { createRollupValidator } from './computed/rollup.mjs';
|
|
18
|
+
export { attributeConfigSchemas, checkboxConfigSchema, currencyConfigSchema, dateConfigSchema, documentConfigSchema, fileConfigSchema, formulaConfigSchema, getAttributeConfigSchema, locationConfigSchema, multiselectConfigSchema, numberConfigSchema, parseAttributeConfig, phoneConfigSchema, ratingConfigSchema, relationConfigSchema, richtextConfigSchema, rollupConfigSchema, safeParseAttributeConfig, selectConfigSchema, statusConfigSchema, textConfigSchema, textareaConfigSchema, userConfigSchema, validateAttributeConfig } from './config/index.mjs';
|
|
19
|
+
export { c as computeRecordStatus, a as createAttributeValidator, b as createDraftValidator, d as createFormAttributeValidator, e as createObjectValidator, g as getMissingRequiredAttributes, i as isRecordComplete, v as validateAttribute, f as validateDraft, h as validateDraftOrThrow, j as validateObject, k as validateObjectOrThrow } from '../index-C9tOwUbK.mjs';
|
|
20
|
+
import '../attributes-DB76JqXm.mjs';
|
|
3
21
|
import '@stndrds/constants';
|
|
4
22
|
import '../utils.mjs';
|
|
23
|
+
import 'zod';
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export { V as ValidationMessages, a as ValidationResult } from '../types-B7nS2D1A.js';
|
|
2
|
+
export { DEFAULT_VALIDATION_MESSAGES, createRegexCache, formatZodErrors, getCachedRegex } from './core/index.js';
|
|
3
|
+
export { createTextAreaValidator, createTextValidator } from './primitives/text.js';
|
|
4
|
+
export { createNumberValidator } from './primitives/number.js';
|
|
5
|
+
export { createCheckboxValidator } from './primitives/checkbox.js';
|
|
6
|
+
export { createDateValidator } from './primitives/date.js';
|
|
7
|
+
export { createRatingValidator } from './primitives/rating.js';
|
|
8
|
+
export { createPhoneValidator } from './complex/phone.js';
|
|
9
|
+
export { createCurrencyValidator } from './complex/currency.js';
|
|
10
|
+
export { createLocationValidator } from './complex/location.js';
|
|
11
|
+
export { createRichtextValidator } from './complex/richtext.js';
|
|
12
|
+
export { createMultiselectValidator, createSelectValidator, createStatusValidator } from './complex/select.js';
|
|
13
|
+
export { createFileValidator } from './complex/file.js';
|
|
14
|
+
export { createUserValidator } from './complex/user.js';
|
|
15
|
+
export { createMultiRelationValidator, createRelationValidator, createSingleRelationValidator } from './complex/relation.js';
|
|
16
|
+
export { createFormulaValidator } from './computed/formula.js';
|
|
17
|
+
export { createRollupValidator } from './computed/rollup.js';
|
|
18
|
+
export { attributeConfigSchemas, checkboxConfigSchema, currencyConfigSchema, dateConfigSchema, documentConfigSchema, fileConfigSchema, formulaConfigSchema, getAttributeConfigSchema, locationConfigSchema, multiselectConfigSchema, numberConfigSchema, parseAttributeConfig, phoneConfigSchema, ratingConfigSchema, relationConfigSchema, richtextConfigSchema, rollupConfigSchema, safeParseAttributeConfig, selectConfigSchema, statusConfigSchema, textConfigSchema, textareaConfigSchema, userConfigSchema, validateAttributeConfig } from './config/index.js';
|
|
19
|
+
export { c as computeRecordStatus, a as createAttributeValidator, b as createDraftValidator, d as createFormAttributeValidator, e as createObjectValidator, g as getMissingRequiredAttributes, i as isRecordComplete, v as validateAttribute, f as validateDraft, h as validateDraftOrThrow, j as validateObject, k as validateObjectOrThrow } from '../index-Bt-0XNSh.js';
|
|
20
|
+
import '../attributes-C-bhC0k5.js';
|
|
3
21
|
import '@stndrds/constants';
|
|
4
22
|
import '../utils.js';
|
|
23
|
+
import 'zod';
|