configforge 1.0.0-beta.5 → 1.0.0-beta.7

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.
@@ -0,0 +1,93 @@
1
+ import { ValidatorFn, ValidationContext } from '../types';
2
+ /**
3
+ * Built-in validator functions for common validation scenarios
4
+ */
5
+ /**
6
+ * Validates that a value is required (not null, undefined, or empty string)
7
+ */
8
+ export declare const required: ValidatorFn;
9
+ /**
10
+ * Validates that a string has a minimum length
11
+ */
12
+ export declare const minLength: (min: number) => ValidatorFn;
13
+ /**
14
+ * Validates that a string has a maximum length
15
+ */
16
+ export declare const maxLength: (max: number) => ValidatorFn;
17
+ /**
18
+ * Validates that a number is within a range
19
+ */
20
+ export declare const range: (min: number, max: number) => ValidatorFn;
21
+ /**
22
+ * Validates that a number is positive
23
+ */
24
+ export declare const positive: ValidatorFn;
25
+ /**
26
+ * Validates that a number is non-negative
27
+ */
28
+ export declare const nonNegative: ValidatorFn;
29
+ /**
30
+ * Validates that a value is an integer
31
+ */
32
+ export declare const integer: ValidatorFn;
33
+ /**
34
+ * Validates that a string matches a regular expression
35
+ */
36
+ export declare const pattern: (regex: RegExp, message?: string) => ValidatorFn;
37
+ /**
38
+ * Validates that a string is a valid email address
39
+ */
40
+ export declare const email: ValidatorFn;
41
+ /**
42
+ * Validates that a string is a valid URL
43
+ */
44
+ export declare const url: ValidatorFn;
45
+ /**
46
+ * Validates that a string is a valid UUID
47
+ */
48
+ export declare const uuid: ValidatorFn;
49
+ /**
50
+ * Validates that a value is one of the allowed values
51
+ */
52
+ export declare const oneOf: <T>(allowedValues: T[]) => ValidatorFn;
53
+ /**
54
+ * Validates that an array has a minimum length
55
+ */
56
+ export declare const minItems: (min: number) => ValidatorFn;
57
+ /**
58
+ * Validates that an array has a maximum length
59
+ */
60
+ export declare const maxItems: (max: number) => ValidatorFn;
61
+ /**
62
+ * Validates that all items in an array are unique
63
+ */
64
+ export declare const uniqueItems: ValidatorFn;
65
+ /**
66
+ * Validates that a value is of a specific type
67
+ */
68
+ export declare const type: (expectedType: string) => ValidatorFn;
69
+ /**
70
+ * Validates that an object has required properties
71
+ */
72
+ export declare const hasProperties: (properties: string[]) => ValidatorFn;
73
+ /**
74
+ * Validates using a custom function with access to the full validation context
75
+ */
76
+ export declare const custom: (validatorFn: (value: any, context: ValidationContext) => boolean | string) => ValidatorFn;
77
+ /**
78
+ * Combines multiple validators with AND logic
79
+ */
80
+ export declare const all: (...validators: ValidatorFn[]) => ValidatorFn;
81
+ /**
82
+ * Combines multiple validators with OR logic (passes if any validator passes)
83
+ */
84
+ export declare const any: (...validators: ValidatorFn[]) => ValidatorFn;
85
+ /**
86
+ * Validates only if the value is not null/undefined (optional validation)
87
+ */
88
+ export declare const optional: (validator: ValidatorFn) => ValidatorFn;
89
+ /**
90
+ * Validates that a value passes validation only if a condition is met
91
+ */
92
+ export declare const when: (condition: (value: any, context: ValidationContext) => boolean, validator: ValidatorFn) => ValidatorFn;
93
+ //# sourceMappingURL=built-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../../src/validators/built-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1D;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,WAKtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,KAAG,WAUvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,KAAG,WAUvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,WAUhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,WAQtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAQzB,CAAC;AAEF;;GAEG;A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KAAK,OAAO,EAC9D,WAAW,WAAW,KACrB,WAOF,CAAC"}
@@ -0,0 +1,290 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.when = exports.optional = exports.any = exports.all = exports.custom = exports.hasProperties = exports.type = exports.uniqueItems = exports.maxItems = exports.minItems = exports.oneOf = exports.uuid = exports.url = exports.email = exports.pattern = exports.integer = exports.nonNegative = exports.positive = exports.range = exports.maxLength = exports.minLength = exports.required = void 0;
4
+ /**
5
+ * Built-in validator functions for common validation scenarios
6
+ */
7
+ /**
8
+ * Validates that a value is required (not null, undefined, or empty string)
9
+ */
10
+ const required = (value) => {
11
+ if (value === null || value === undefined || value === '') {
12
+ return 'Field is required';
13
+ }
14
+ return true;
15
+ };
16
+ exports.required = required;
17
+ /**
18
+ * Validates that a string has a minimum length
19
+ */
20
+ const minLength = (min) => {
21
+ return (value) => {
22
+ if (typeof value !== 'string') {
23
+ return `Expected string, got ${typeof value}`;
24
+ }
25
+ if (value.length < min) {
26
+ return `String must be at least ${min} characters long, got ${value.length}`;
27
+ }
28
+ return true;
29
+ };
30
+ };
31
+ exports.minLength = minLength;
32
+ /**
33
+ * Validates that a string has a maximum length
34
+ */
35
+ const maxLength = (max) => {
36
+ return (value) => {
37
+ if (typeof value !== 'string') {
38
+ return `Expected string, got ${typeof value}`;
39
+ }
40
+ if (value.length > max) {
41
+ return `String must be at most ${max} characters long, got ${value.length}`;
42
+ }
43
+ return true;
44
+ };
45
+ };
46
+ exports.maxLength = maxLength;
47
+ /**
48
+ * Validates that a number is within a range
49
+ */
50
+ const range = (min, max) => {
51
+ return (value) => {
52
+ if (typeof value !== 'number') {
53
+ return `Expected number, got ${typeof value}`;
54
+ }
55
+ if (value < min || value > max) {
56
+ return `Number must be between ${min} and ${max}, got ${value}`;
57
+ }
58
+ return true;
59
+ };
60
+ };
61
+ exports.range = range;
62
+ /**
63
+ * Validates that a number is positive
64
+ */
65
+ const positive = (value) => {
66
+ if (typeof value !== 'number') {
67
+ return `Expected number, got ${typeof value}`;
68
+ }
69
+ if (value <= 0) {
70
+ return `Number must be positive, got ${value}`;
71
+ }
72
+ return true;
73
+ };
74
+ exports.positive = positive;
75
+ /**
76
+ * Validates that a number is non-negative
77
+ */
78
+ const nonNegative = (value) => {
79
+ if (typeof value !== 'number') {
80
+ return `Expected number, got ${typeof value}`;
81
+ }
82
+ if (value < 0) {
83
+ return `Number must be non-negative, got ${value}`;
84
+ }
85
+ return true;
86
+ };
87
+ exports.nonNegative = nonNegative;
88
+ /**
89
+ * Validates that a value is an integer
90
+ */
91
+ const integer = (value) => {
92
+ if (typeof value !== 'number') {
93
+ return `Expected number, got ${typeof value}`;
94
+ }
95
+ if (!Number.isInteger(value)) {
96
+ return `Expected integer, got ${value}`;
97
+ }
98
+ return true;
99
+ };
100
+ exports.integer = integer;
101
+ /**
102
+ * Validates that a string matches a regular expression
103
+ */
104
+ const pattern = (regex, message) => {
105
+ return (value) => {
106
+ if (typeof value !== 'string') {
107
+ return `Expected string, got ${typeof value}`;
108
+ }
109
+ if (!regex.test(value)) {
110
+ return message || `String does not match required pattern`;
111
+ }
112
+ return true;
113
+ };
114
+ };
115
+ exports.pattern = pattern;
116
+ /**
117
+ * Validates that a string is a valid email address
118
+ */
119
+ exports.email = (0, exports.pattern)(/^[^\s@]+@[^\s@]+\.[^\s@]+$/, 'Invalid email address format');
120
+ /**
121
+ * Validates that a string is a valid URL
122
+ */
123
+ const url = (value) => {
124
+ if (typeof value !== 'string') {
125
+ return `Expected string, got ${typeof value}`;
126
+ }
127
+ try {
128
+ new URL(value);
129
+ return true;
130
+ }
131
+ catch {
132
+ return 'Invalid URL format';
133
+ }
134
+ };
135
+ exports.url = url;
136
+ /**
137
+ * Validates that a string is a valid UUID
138
+ */
139
+ exports.uuid = (0, exports.pattern)(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, 'Invalid UUID format');
140
+ /**
141
+ * Validates that a value is one of the allowed values
142
+ */
143
+ const oneOf = (allowedValues) => {
144
+ return (value) => {
145
+ if (!allowedValues.includes(value)) {
146
+ return `Value must be one of: ${allowedValues.join(', ')}, got ${value}`;
147
+ }
148
+ return true;
149
+ };
150
+ };
151
+ exports.oneOf = oneOf;
152
+ /**
153
+ * Validates that an array has a minimum length
154
+ */
155
+ const minItems = (min) => {
156
+ return (value) => {
157
+ if (!Array.isArray(value)) {
158
+ return `Expected array, got ${typeof value}`;
159
+ }
160
+ if (value.length < min) {
161
+ return `Array must have at least ${min} items, got ${value.length}`;
162
+ }
163
+ return true;
164
+ };
165
+ };
166
+ exports.minItems = minItems;
167
+ /**
168
+ * Validates that an array has a maximum length
169
+ */
170
+ const maxItems = (max) => {
171
+ return (value) => {
172
+ if (!Array.isArray(value)) {
173
+ return `Expected array, got ${typeof value}`;
174
+ }
175
+ if (value.length > max) {
176
+ return `Array must have at most ${max} items, got ${value.length}`;
177
+ }
178
+ return true;
179
+ };
180
+ };
181
+ exports.maxItems = maxItems;
182
+ /**
183
+ * Validates that all items in an array are unique
184
+ */
185
+ const uniqueItems = (value) => {
186
+ if (!Array.isArray(value)) {
187
+ return `Expected array, got ${typeof value}`;
188
+ }
189
+ const unique = new Set(value);
190
+ if (unique.size !== value.length) {
191
+ return 'Array items must be unique';
192
+ }
193
+ return true;
194
+ };
195
+ exports.uniqueItems = uniqueItems;
196
+ /**
197
+ * Validates that a value is of a specific type
198
+ */
199
+ const type = (expectedType) => {
200
+ return (value) => {
201
+ const actualType = Array.isArray(value) ? 'array' : typeof value;
202
+ if (actualType !== expectedType) {
203
+ return `Expected ${expectedType}, got ${actualType}`;
204
+ }
205
+ return true;
206
+ };
207
+ };
208
+ exports.type = type;
209
+ /**
210
+ * Validates that an object has required properties
211
+ */
212
+ const hasProperties = (properties) => {
213
+ return (value) => {
214
+ if (typeof value !== 'object' || value === null) {
215
+ return `Expected object, got ${typeof value}`;
216
+ }
217
+ const missing = properties.filter(prop => !(prop in value));
218
+ if (missing.length > 0) {
219
+ return `Missing required properties: ${missing.join(', ')}`;
220
+ }
221
+ return true;
222
+ };
223
+ };
224
+ exports.hasProperties = hasProperties;
225
+ /**
226
+ * Validates using a custom function with access to the full validation context
227
+ */
228
+ const custom = (validatorFn) => {
229
+ return validatorFn;
230
+ };
231
+ exports.custom = custom;
232
+ /**
233
+ * Combines multiple validators with AND logic
234
+ */
235
+ const all = (...validators) => {
236
+ return (value, context) => {
237
+ for (const validator of validators) {
238
+ const result = validator(value, context);
239
+ if (result !== true) {
240
+ return result;
241
+ }
242
+ }
243
+ return true;
244
+ };
245
+ };
246
+ exports.all = all;
247
+ /**
248
+ * Combines multiple validators with OR logic (passes if any validator passes)
249
+ */
250
+ const any = (...validators) => {
251
+ return (value, context) => {
252
+ const errors = [];
253
+ for (const validator of validators) {
254
+ const result = validator(value, context);
255
+ if (result === true) {
256
+ return true;
257
+ }
258
+ if (typeof result === 'string') {
259
+ errors.push(result);
260
+ }
261
+ }
262
+ return `All validations failed: ${errors.join('; ')}`;
263
+ };
264
+ };
265
+ exports.any = any;
266
+ /**
267
+ * Validates only if the value is not null/undefined (optional validation)
268
+ */
269
+ const optional = (validator) => {
270
+ return (value, context) => {
271
+ if (value === null || value === undefined) {
272
+ return true;
273
+ }
274
+ return validator(value, context);
275
+ };
276
+ };
277
+ exports.optional = optional;
278
+ /**
279
+ * Validates that a value passes validation only if a condition is met
280
+ */
281
+ const when = (condition, validator) => {
282
+ return (value, context) => {
283
+ if (!condition(value, context)) {
284
+ return true;
285
+ }
286
+ return validator(value, context);
287
+ };
288
+ };
289
+ exports.when = when;
290
+ //# sourceMappingURL=built-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in.js","sourceRoot":"","sources":["../../src/validators/built-in.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AAEH;;GAEG;AACI,MAAM,QAAQ,GAAgB,CAAC,KAAU,EAAoB,EAAE;IACpE,IAAI,KAAK,KAAK,IAAI,I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E,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,QAAQ,YAOnB;AAEF;;GAEG;AACI,MAAM,IAAI,GAAG,CAClB,SAA8D,EAC9D,SAAsB,EACT,EAAE;IACf,OAAO,CAAC,KAAU,EAAE,OAA0B,EAAoB,EAAE;QAClE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,IAAI,QAUf"}
@@ -0,0 +1,4 @@
1
+ export * from './built-in';
2
+ export { ValidatorRegistry, validatorRegistry } from './ValidatorRegistry';
3
+ export type { Validator, ValidatorFn, ValidationContext } from '../types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG3E,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.validatorRegistry = exports.ValidatorRegistry = void 0;
18
+ // Export built-in validators
19
+ __exportStar(require("./built-in"), exports);
20
+ // Export validator registry
21
+ var ValidatorRegistry_1 = require("./ValidatorRegistry");
22
+ Object.defineProperty(exports, "ValidatorRegistry", { enumerable: true, get: function () { return ValidatorRegistry_1.ValidatorRegistry; } });
23
+ Object.defineProperty(exports, "validatorRegistry", { enumerable: true, get: function () { return ValidatorRegistry_1.validatorRegistry; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,6CAA2B;AAE3B,4BAA4B;AAC5B,yDAA2E;AAAlE,sHAAA,iBAAiB,OAAA;AAAE,sHAAA,iBAAiB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "configforge",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "Universal config converter framework with exceptional developer experience",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",