yuppi 1.2.6 → 1.2.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.
- package/dist/main.d.mts +139 -17
- package/dist/main.d.ts +139 -17
- package/package.json +2 -2
- package/dist/Patterns.barrel-D-k3IHDq.d.mts +0 -20
- package/dist/Patterns.barrel-JdN3lL2Q.d.ts +0 -20
- package/dist/Yuppi.class.d.mts +0 -24
- package/dist/Yuppi.class.d.ts +0 -24
- package/dist/Yuppi.class.js +0 -244
- package/dist/Yuppi.class.mjs +0 -209
- package/dist/barrels/Patterns.barrel.d.mts +0 -7
- package/dist/barrels/Patterns.barrel.d.ts +0 -7
- package/dist/barrels/Patterns.barrel.js +0 -62
- package/dist/barrels/Patterns.barrel.mjs +0 -29
- package/dist/barrels/Types.barrel.d.mts +0 -8
- package/dist/barrels/Types.barrel.d.ts +0 -8
- package/dist/barrels/Types.barrel.js +0 -18
- package/dist/barrels/Types.barrel.mjs +0 -0
- package/dist/defaults/YuppiOptions.default.d.mts +0 -7
- package/dist/defaults/YuppiOptions.default.d.ts +0 -7
- package/dist/defaults/YuppiOptions.default.js +0 -73
- package/dist/defaults/YuppiOptions.default.mjs +0 -48
- package/dist/patterns/Any.pattern.d.mts +0 -3
- package/dist/patterns/Any.pattern.d.ts +0 -3
- package/dist/patterns/Any.pattern.js +0 -30
- package/dist/patterns/Any.pattern.mjs +0 -5
- package/dist/patterns/Domain.pattern.d.mts +0 -3
- package/dist/patterns/Domain.pattern.d.ts +0 -3
- package/dist/patterns/Domain.pattern.js +0 -30
- package/dist/patterns/Domain.pattern.mjs +0 -5
- package/dist/patterns/Email.pattern.d.mts +0 -3
- package/dist/patterns/Email.pattern.d.ts +0 -3
- package/dist/patterns/Email.pattern.js +0 -30
- package/dist/patterns/Email.pattern.mjs +0 -5
- package/dist/patterns/HTTP.pattern.d.mts +0 -3
- package/dist/patterns/HTTP.pattern.d.ts +0 -3
- package/dist/patterns/HTTP.pattern.js +0 -30
- package/dist/patterns/HTTP.pattern.mjs +0 -5
- package/dist/patterns/PhoneNumber.pattern.d.mts +0 -3
- package/dist/patterns/PhoneNumber.pattern.d.ts +0 -3
- package/dist/patterns/PhoneNumber.pattern.js +0 -30
- package/dist/patterns/PhoneNumber.pattern.mjs +0 -5
- package/dist/patterns/URI.pattern.d.mts +0 -3
- package/dist/patterns/URI.pattern.d.ts +0 -3
- package/dist/patterns/URI.pattern.js +0 -30
- package/dist/patterns/URI.pattern.mjs +0 -5
- package/dist/patterns/Username.pattern.d.mts +0 -3
- package/dist/patterns/Username.pattern.d.ts +0 -3
- package/dist/patterns/Username.pattern.js +0 -30
- package/dist/patterns/Username.pattern.mjs +0 -5
- package/dist/types/AnyObject.type.d.mts +0 -5
- package/dist/types/AnyObject.type.d.ts +0 -5
- package/dist/types/AnyObject.type.js +0 -18
- package/dist/types/AnyObject.type.mjs +0 -0
- package/dist/types/JSONSchema.type.d.mts +0 -5
- package/dist/types/JSONSchema.type.d.ts +0 -5
- package/dist/types/JSONSchema.type.js +0 -18
- package/dist/types/JSONSchema.type.mjs +0 -0
- package/dist/types/Schema.type.d.mts +0 -45
- package/dist/types/Schema.type.d.ts +0 -45
- package/dist/types/Schema.type.js +0 -18
- package/dist/types/Schema.type.mjs +0 -0
- package/dist/types/ValidateOptions.type.d.mts +0 -5
- package/dist/types/ValidateOptions.type.d.ts +0 -5
- package/dist/types/ValidateOptions.type.js +0 -18
- package/dist/types/ValidateOptions.type.mjs +0 -0
- package/dist/types/ValidationError.type.d.mts +0 -5
- package/dist/types/ValidationError.type.d.ts +0 -5
- package/dist/types/ValidationError.type.js +0 -18
- package/dist/types/ValidationError.type.mjs +0 -0
- package/dist/types/YuppiOptions.type.d.mts +0 -46
- package/dist/types/YuppiOptions.type.d.ts +0 -46
- package/dist/types/YuppiOptions.type.js +0 -18
- package/dist/types/YuppiOptions.type.mjs +0 -0
- package/dist/utils/ConvertToJSONSchema.util.d.mts +0 -7
- package/dist/utils/ConvertToJSONSchema.util.d.ts +0 -7
- package/dist/utils/ConvertToJSONSchema.util.js +0 -69
- package/dist/utils/ConvertToJSONSchema.util.mjs +0 -44
- package/dist/utils/ConvertToYup.util.d.mts +0 -12
- package/dist/utils/ConvertToYup.util.d.ts +0 -12
- package/dist/utils/ConvertToYup.util.js +0 -140
- package/dist/utils/ConvertToYup.util.mjs +0 -105
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/patterns/HTTP.pattern.ts
|
|
21
|
-
var HTTP_pattern_exports = {};
|
|
22
|
-
__export(HTTP_pattern_exports, {
|
|
23
|
-
HTTP: () => HTTP
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(HTTP_pattern_exports);
|
|
26
|
-
var HTTP = "^(https?:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
HTTP
|
|
30
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/patterns/PhoneNumber.pattern.ts
|
|
21
|
-
var PhoneNumber_pattern_exports = {};
|
|
22
|
-
__export(PhoneNumber_pattern_exports, {
|
|
23
|
-
PhoneNumber: () => PhoneNumber
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(PhoneNumber_pattern_exports);
|
|
26
|
-
var PhoneNumber = "^\\d{4}-\\d{7,12}$";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
PhoneNumber
|
|
30
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/patterns/URI.pattern.ts
|
|
21
|
-
var URI_pattern_exports = {};
|
|
22
|
-
__export(URI_pattern_exports, {
|
|
23
|
-
URI: () => URI
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(URI_pattern_exports);
|
|
26
|
-
var URI = "^([a-zA-Z][a-zA-Z0-9+\\-.]*:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
URI
|
|
30
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/patterns/Username.pattern.ts
|
|
21
|
-
var Username_pattern_exports = {};
|
|
22
|
-
__export(Username_pattern_exports, {
|
|
23
|
-
Username: () => Username
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Username_pattern_exports);
|
|
26
|
-
var Username = "^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
Username
|
|
30
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types/AnyObject.type.ts
|
|
17
|
-
var AnyObject_type_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(AnyObject_type_exports);
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types/JSONSchema.type.ts
|
|
17
|
-
var JSONSchema_type_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(JSONSchema_type_exports);
|
|
File without changes
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
type Base = {
|
|
2
|
-
pattern?: string;
|
|
3
|
-
default?: unknown;
|
|
4
|
-
nullable: boolean;
|
|
5
|
-
required: boolean;
|
|
6
|
-
};
|
|
7
|
-
type String = Base & {
|
|
8
|
-
type: 'string';
|
|
9
|
-
enum?: string[];
|
|
10
|
-
min?: number;
|
|
11
|
-
max?: number;
|
|
12
|
-
lowercase?: boolean;
|
|
13
|
-
uppercase?: boolean;
|
|
14
|
-
};
|
|
15
|
-
type Number = Base & {
|
|
16
|
-
type: 'number';
|
|
17
|
-
enum?: number[];
|
|
18
|
-
min?: number;
|
|
19
|
-
max?: number;
|
|
20
|
-
integer?: boolean;
|
|
21
|
-
positive?: boolean;
|
|
22
|
-
negative?: boolean;
|
|
23
|
-
};
|
|
24
|
-
type Boolean = Base & {
|
|
25
|
-
type: 'boolean';
|
|
26
|
-
};
|
|
27
|
-
type Date = Base & {
|
|
28
|
-
type: 'date';
|
|
29
|
-
min?: string;
|
|
30
|
-
max?: string;
|
|
31
|
-
};
|
|
32
|
-
type Object$1 = Base & {
|
|
33
|
-
type: 'object';
|
|
34
|
-
properties: Schema;
|
|
35
|
-
};
|
|
36
|
-
type Array = Base & {
|
|
37
|
-
type: 'array';
|
|
38
|
-
min?: number;
|
|
39
|
-
max?: number;
|
|
40
|
-
items: Types;
|
|
41
|
-
};
|
|
42
|
-
type Types = String | Number | Boolean | Date | Object$1 | Array;
|
|
43
|
-
type Schema = Record<string, Types>;
|
|
44
|
-
|
|
45
|
-
export type { Array, Base, Boolean, Date, Number, Object$1 as Object, Schema, String, Types };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
type Base = {
|
|
2
|
-
pattern?: string;
|
|
3
|
-
default?: unknown;
|
|
4
|
-
nullable: boolean;
|
|
5
|
-
required: boolean;
|
|
6
|
-
};
|
|
7
|
-
type String = Base & {
|
|
8
|
-
type: 'string';
|
|
9
|
-
enum?: string[];
|
|
10
|
-
min?: number;
|
|
11
|
-
max?: number;
|
|
12
|
-
lowercase?: boolean;
|
|
13
|
-
uppercase?: boolean;
|
|
14
|
-
};
|
|
15
|
-
type Number = Base & {
|
|
16
|
-
type: 'number';
|
|
17
|
-
enum?: number[];
|
|
18
|
-
min?: number;
|
|
19
|
-
max?: number;
|
|
20
|
-
integer?: boolean;
|
|
21
|
-
positive?: boolean;
|
|
22
|
-
negative?: boolean;
|
|
23
|
-
};
|
|
24
|
-
type Boolean = Base & {
|
|
25
|
-
type: 'boolean';
|
|
26
|
-
};
|
|
27
|
-
type Date = Base & {
|
|
28
|
-
type: 'date';
|
|
29
|
-
min?: string;
|
|
30
|
-
max?: string;
|
|
31
|
-
};
|
|
32
|
-
type Object$1 = Base & {
|
|
33
|
-
type: 'object';
|
|
34
|
-
properties: Schema;
|
|
35
|
-
};
|
|
36
|
-
type Array = Base & {
|
|
37
|
-
type: 'array';
|
|
38
|
-
min?: number;
|
|
39
|
-
max?: number;
|
|
40
|
-
items: Types;
|
|
41
|
-
};
|
|
42
|
-
type Types = String | Number | Boolean | Date | Object$1 | Array;
|
|
43
|
-
type Schema = Record<string, Types>;
|
|
44
|
-
|
|
45
|
-
export type { Array, Base, Boolean, Date, Number, Object$1 as Object, Schema, String, Types };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types/Schema.type.ts
|
|
17
|
-
var Schema_type_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(Schema_type_exports);
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types/ValidateOptions.type.ts
|
|
17
|
-
var ValidateOptions_type_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(ValidateOptions_type_exports);
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types/ValidationError.type.ts
|
|
17
|
-
var ValidationError_type_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(ValidationError_type_exports);
|
|
File without changes
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ValidateOptions } from './ValidateOptions.type.mjs';
|
|
2
|
-
import 'yup';
|
|
3
|
-
|
|
4
|
-
type YuppiOptions = {
|
|
5
|
-
error_messages?: {
|
|
6
|
-
base?: {
|
|
7
|
-
pattern?: string;
|
|
8
|
-
nullable?: string;
|
|
9
|
-
required?: string;
|
|
10
|
-
};
|
|
11
|
-
string?: {
|
|
12
|
-
type?: string;
|
|
13
|
-
enum?: string;
|
|
14
|
-
min?: string;
|
|
15
|
-
max?: string;
|
|
16
|
-
};
|
|
17
|
-
number?: {
|
|
18
|
-
type?: string;
|
|
19
|
-
enum?: string;
|
|
20
|
-
min?: string;
|
|
21
|
-
max?: string;
|
|
22
|
-
integer?: string;
|
|
23
|
-
positive?: string;
|
|
24
|
-
negative?: string;
|
|
25
|
-
};
|
|
26
|
-
boolean?: {
|
|
27
|
-
type?: string;
|
|
28
|
-
};
|
|
29
|
-
date?: {
|
|
30
|
-
type?: string;
|
|
31
|
-
min?: string;
|
|
32
|
-
max?: string;
|
|
33
|
-
};
|
|
34
|
-
object?: {
|
|
35
|
-
type?: string;
|
|
36
|
-
};
|
|
37
|
-
array?: {
|
|
38
|
-
type?: string;
|
|
39
|
-
min?: string;
|
|
40
|
-
max?: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
validate_options?: ValidateOptions;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type { YuppiOptions };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ValidateOptions } from './ValidateOptions.type.js';
|
|
2
|
-
import 'yup';
|
|
3
|
-
|
|
4
|
-
type YuppiOptions = {
|
|
5
|
-
error_messages?: {
|
|
6
|
-
base?: {
|
|
7
|
-
pattern?: string;
|
|
8
|
-
nullable?: string;
|
|
9
|
-
required?: string;
|
|
10
|
-
};
|
|
11
|
-
string?: {
|
|
12
|
-
type?: string;
|
|
13
|
-
enum?: string;
|
|
14
|
-
min?: string;
|
|
15
|
-
max?: string;
|
|
16
|
-
};
|
|
17
|
-
number?: {
|
|
18
|
-
type?: string;
|
|
19
|
-
enum?: string;
|
|
20
|
-
min?: string;
|
|
21
|
-
max?: string;
|
|
22
|
-
integer?: string;
|
|
23
|
-
positive?: string;
|
|
24
|
-
negative?: string;
|
|
25
|
-
};
|
|
26
|
-
boolean?: {
|
|
27
|
-
type?: string;
|
|
28
|
-
};
|
|
29
|
-
date?: {
|
|
30
|
-
type?: string;
|
|
31
|
-
min?: string;
|
|
32
|
-
max?: string;
|
|
33
|
-
};
|
|
34
|
-
object?: {
|
|
35
|
-
type?: string;
|
|
36
|
-
};
|
|
37
|
-
array?: {
|
|
38
|
-
type?: string;
|
|
39
|
-
min?: string;
|
|
40
|
-
max?: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
validate_options?: ValidateOptions;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type { YuppiOptions };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/types/YuppiOptions.type.ts
|
|
17
|
-
var YuppiOptions_type_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(YuppiOptions_type_exports);
|
|
File without changes
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils/ConvertToJSONSchema.util.ts
|
|
21
|
-
var ConvertToJSONSchema_util_exports = {};
|
|
22
|
-
__export(ConvertToJSONSchema_util_exports, {
|
|
23
|
-
convertToJSONSchema: () => convertToJSONSchema
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(ConvertToJSONSchema_util_exports);
|
|
26
|
-
var import_typebox = require("@sinclair/typebox");
|
|
27
|
-
|
|
28
|
-
// src/patterns/Any.pattern.ts
|
|
29
|
-
var Any = "[\\s\\S]*";
|
|
30
|
-
|
|
31
|
-
// src/utils/ConvertToJSONSchema.util.ts
|
|
32
|
-
var convertToJSONSchema = (schema) => {
|
|
33
|
-
const build = (key, config) => {
|
|
34
|
-
if (config.type === "string") {
|
|
35
|
-
let schema2 = import_typebox.Type.String({ enum: config.enum, minLength: config.min, maxLength: config.max, pattern: new RegExp(config.pattern ?? Any).source, default: config.default });
|
|
36
|
-
if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
|
|
37
|
-
return config.required ? schema2 : import_typebox.Type.Optional(schema2);
|
|
38
|
-
} else if (config.type === "number") {
|
|
39
|
-
let schema2 = config.integer === true ? import_typebox.Type.Integer({ enum: config.enum, minimum: config.min, maximum: config.max, default: config.default }) : import_typebox.Type.Number({ enum: config.enum, minimum: config.min, maximum: config.max, default: config.default });
|
|
40
|
-
if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
|
|
41
|
-
return config.required ? schema2 : import_typebox.Type.Optional(schema2);
|
|
42
|
-
} else if (config.type === "boolean") {
|
|
43
|
-
let schema2 = import_typebox.Type.Boolean({ default: config.default });
|
|
44
|
-
if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
|
|
45
|
-
return config.required ? schema2 : import_typebox.Type.Optional(schema2);
|
|
46
|
-
} else if (config.type === "date") {
|
|
47
|
-
let schema2 = import_typebox.Type.String({ format: "date-time", minimum: config.min, maximum: config.max, pattern: new RegExp(config.pattern ?? Any).source, default: config.default });
|
|
48
|
-
if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
|
|
49
|
-
return config.required ? schema2 : import_typebox.Type.Optional(schema2);
|
|
50
|
-
} else if (config.type === "object") {
|
|
51
|
-
const nested_properties = {};
|
|
52
|
-
for (const [nested_key, nested_config] of Object.entries(config.properties)) nested_properties[nested_key] = build(nested_key, nested_config);
|
|
53
|
-
let schema2 = import_typebox.Type.Object(nested_properties);
|
|
54
|
-
if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
|
|
55
|
-
return config.required ? schema2 : import_typebox.Type.Optional(schema2);
|
|
56
|
-
} else if (config.type === "array") {
|
|
57
|
-
let schema2 = import_typebox.Type.Array(build(key, config.items), { minItems: config.min, maxItems: config.max, default: config.default });
|
|
58
|
-
if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
|
|
59
|
-
return config.required ? schema2 : import_typebox.Type.Optional(schema2);
|
|
60
|
-
} else throw new Error(`Unsupported schema type for ${key}`);
|
|
61
|
-
};
|
|
62
|
-
const properties = {};
|
|
63
|
-
for (const [key, config] of Object.entries(schema)) properties[key] = build(key, config);
|
|
64
|
-
return import_typebox.Type.Object(properties);
|
|
65
|
-
};
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
convertToJSONSchema
|
|
69
|
-
});
|