@logto/connector-apple 1.0.0-beta.11 → 1.0.0-beta.15
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/lib/index.js +1433 -766
- package/lib/jest.config.d.ts +1 -1
- package/lib/src/constant.d.ts +1 -1
- package/lib/src/index.d.ts +1 -1
- package/lib/src/types.d.ts +1 -1
- package/package.json +30 -29
package/lib/index.js
CHANGED
|
@@ -2,188 +2,87 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
6
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
24
|
-
exports.parseJson = exports.validateConfig = void 0;
|
|
25
|
-
const types_1 = __nccwpck_require__(8053);
|
|
26
|
-
__exportStar(__nccwpck_require__(8053), exports);
|
|
27
|
-
function validateConfig(config, guard) {
|
|
28
|
-
const result = guard.safeParse(config);
|
|
29
|
-
if (!result.success) {
|
|
30
|
-
throw new types_1.ConnectorError(types_1.ConnectorErrorCodes.InvalidConfig, result.error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.validateConfig = validateConfig;
|
|
34
|
-
const parseJson = (jsonString, errorCode = types_1.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
|
|
35
|
-
try {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
37
|
-
return JSON.parse(jsonString);
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
throw new types_1.ConnectorError(errorCode, errorPayload ?? jsonString);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.parseJson = parseJson;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/***/ }),
|
|
47
|
-
|
|
48
|
-
/***/ 8053:
|
|
49
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
53
|
-
exports.messageTypesGuard = exports.MessageTypes = exports.ConnectorError = exports.ConnectorErrorCodes = exports.ConnectorPlatform = exports.ConnectorType = void 0;
|
|
54
|
-
const zod_1 = __nccwpck_require__(8062);
|
|
55
|
-
// MARK: Foundation
|
|
56
|
-
var ConnectorType;
|
|
57
|
-
(function (ConnectorType) {
|
|
58
|
-
ConnectorType["Email"] = "Email";
|
|
59
|
-
ConnectorType["Sms"] = "Sms";
|
|
60
|
-
ConnectorType["Social"] = "Social";
|
|
61
|
-
})(ConnectorType = exports.ConnectorType || (exports.ConnectorType = {}));
|
|
62
|
-
var ConnectorPlatform;
|
|
63
|
-
(function (ConnectorPlatform) {
|
|
64
|
-
ConnectorPlatform["Native"] = "Native";
|
|
65
|
-
ConnectorPlatform["Universal"] = "Universal";
|
|
66
|
-
ConnectorPlatform["Web"] = "Web";
|
|
67
|
-
})(ConnectorPlatform = exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
|
|
68
|
-
var ConnectorErrorCodes;
|
|
69
|
-
(function (ConnectorErrorCodes) {
|
|
70
|
-
ConnectorErrorCodes["General"] = "general";
|
|
71
|
-
ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
|
|
72
|
-
ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
|
|
73
|
-
ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
|
|
74
|
-
ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
|
|
75
|
-
ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
|
|
76
|
-
ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
|
|
77
|
-
ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
|
|
78
|
-
ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
|
|
79
|
-
ConnectorErrorCodes["NotImplemented"] = "not_implemented";
|
|
80
|
-
ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
|
|
81
|
-
ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
|
|
82
|
-
ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
|
|
83
|
-
ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
|
|
84
|
-
})(ConnectorErrorCodes = exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
|
|
85
|
-
class ConnectorError extends Error {
|
|
86
|
-
constructor(code, data) {
|
|
87
|
-
const message = typeof data === 'string' ? data : 'Connector error occurred.';
|
|
88
|
-
super(message);
|
|
89
|
-
this.code = code;
|
|
90
|
-
this.data = typeof data === 'string' ? { message: data } : data;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.ConnectorError = ConnectorError;
|
|
94
|
-
var MessageTypes;
|
|
95
|
-
(function (MessageTypes) {
|
|
96
|
-
MessageTypes["SignIn"] = "SignIn";
|
|
97
|
-
MessageTypes["Register"] = "Register";
|
|
98
|
-
MessageTypes["ForgotPassword"] = "ForgotPassword";
|
|
99
|
-
MessageTypes["Test"] = "Test";
|
|
100
|
-
})(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
|
|
101
|
-
exports.messageTypesGuard = zod_1.z.nativeEnum(MessageTypes);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/***/ }),
|
|
105
|
-
|
|
106
|
-
/***/ 4974:
|
|
5
|
+
/***/ 9179:
|
|
107
6
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
108
7
|
|
|
109
8
|
|
|
110
9
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
111
10
|
exports.base64url = exports.generateSecret = exports.generateKeyPair = exports.errors = exports.decodeJwt = exports.decodeProtectedHeader = exports.importJWK = exports.importX509 = exports.importPKCS8 = exports.importSPKI = exports.exportJWK = exports.exportSPKI = exports.exportPKCS8 = exports.UnsecuredJWT = exports.createRemoteJWKSet = exports.createLocalJWKSet = exports.EmbeddedJWK = exports.calculateJwkThumbprintUri = exports.calculateJwkThumbprint = exports.EncryptJWT = exports.SignJWT = exports.GeneralSign = exports.FlattenedSign = exports.CompactSign = exports.FlattenedEncrypt = exports.CompactEncrypt = exports.jwtDecrypt = exports.jwtVerify = exports.generalVerify = exports.flattenedVerify = exports.compactVerify = exports.GeneralEncrypt = exports.generalDecrypt = exports.flattenedDecrypt = exports.compactDecrypt = void 0;
|
|
112
|
-
var decrypt_js_1 = __nccwpck_require__(
|
|
11
|
+
var decrypt_js_1 = __nccwpck_require__(9293);
|
|
113
12
|
Object.defineProperty(exports, "compactDecrypt", ({ enumerable: true, get: function () { return decrypt_js_1.compactDecrypt; } }));
|
|
114
|
-
var decrypt_js_2 = __nccwpck_require__(
|
|
13
|
+
var decrypt_js_2 = __nccwpck_require__(9836);
|
|
115
14
|
Object.defineProperty(exports, "flattenedDecrypt", ({ enumerable: true, get: function () { return decrypt_js_2.flattenedDecrypt; } }));
|
|
116
|
-
var decrypt_js_3 = __nccwpck_require__(
|
|
15
|
+
var decrypt_js_3 = __nccwpck_require__(1807);
|
|
117
16
|
Object.defineProperty(exports, "generalDecrypt", ({ enumerable: true, get: function () { return decrypt_js_3.generalDecrypt; } }));
|
|
118
|
-
var encrypt_js_1 = __nccwpck_require__(
|
|
17
|
+
var encrypt_js_1 = __nccwpck_require__(4086);
|
|
119
18
|
Object.defineProperty(exports, "GeneralEncrypt", ({ enumerable: true, get: function () { return encrypt_js_1.GeneralEncrypt; } }));
|
|
120
|
-
var verify_js_1 = __nccwpck_require__(
|
|
19
|
+
var verify_js_1 = __nccwpck_require__(214);
|
|
121
20
|
Object.defineProperty(exports, "compactVerify", ({ enumerable: true, get: function () { return verify_js_1.compactVerify; } }));
|
|
122
|
-
var verify_js_2 = __nccwpck_require__(
|
|
21
|
+
var verify_js_2 = __nccwpck_require__(5763);
|
|
123
22
|
Object.defineProperty(exports, "flattenedVerify", ({ enumerable: true, get: function () { return verify_js_2.flattenedVerify; } }));
|
|
124
|
-
var verify_js_3 = __nccwpck_require__(
|
|
23
|
+
var verify_js_3 = __nccwpck_require__(6984);
|
|
125
24
|
Object.defineProperty(exports, "generalVerify", ({ enumerable: true, get: function () { return verify_js_3.generalVerify; } }));
|
|
126
|
-
var verify_js_4 = __nccwpck_require__(
|
|
25
|
+
var verify_js_4 = __nccwpck_require__(2005);
|
|
127
26
|
Object.defineProperty(exports, "jwtVerify", ({ enumerable: true, get: function () { return verify_js_4.jwtVerify; } }));
|
|
128
|
-
var decrypt_js_4 = __nccwpck_require__(
|
|
27
|
+
var decrypt_js_4 = __nccwpck_require__(3632);
|
|
129
28
|
Object.defineProperty(exports, "jwtDecrypt", ({ enumerable: true, get: function () { return decrypt_js_4.jwtDecrypt; } }));
|
|
130
|
-
var encrypt_js_2 = __nccwpck_require__(
|
|
29
|
+
var encrypt_js_2 = __nccwpck_require__(7623);
|
|
131
30
|
Object.defineProperty(exports, "CompactEncrypt", ({ enumerable: true, get: function () { return encrypt_js_2.CompactEncrypt; } }));
|
|
132
|
-
var encrypt_js_3 = __nccwpck_require__(
|
|
31
|
+
var encrypt_js_3 = __nccwpck_require__(2079);
|
|
133
32
|
Object.defineProperty(exports, "FlattenedEncrypt", ({ enumerable: true, get: function () { return encrypt_js_3.FlattenedEncrypt; } }));
|
|
134
|
-
var sign_js_1 = __nccwpck_require__(
|
|
33
|
+
var sign_js_1 = __nccwpck_require__(9630);
|
|
135
34
|
Object.defineProperty(exports, "CompactSign", ({ enumerable: true, get: function () { return sign_js_1.CompactSign; } }));
|
|
136
|
-
var sign_js_2 = __nccwpck_require__(
|
|
35
|
+
var sign_js_2 = __nccwpck_require__(7347);
|
|
137
36
|
Object.defineProperty(exports, "FlattenedSign", ({ enumerable: true, get: function () { return sign_js_2.FlattenedSign; } }));
|
|
138
|
-
var sign_js_3 = __nccwpck_require__(
|
|
37
|
+
var sign_js_3 = __nccwpck_require__(7687);
|
|
139
38
|
Object.defineProperty(exports, "GeneralSign", ({ enumerable: true, get: function () { return sign_js_3.GeneralSign; } }));
|
|
140
|
-
var sign_js_4 = __nccwpck_require__(
|
|
39
|
+
var sign_js_4 = __nccwpck_require__(7561);
|
|
141
40
|
Object.defineProperty(exports, "SignJWT", ({ enumerable: true, get: function () { return sign_js_4.SignJWT; } }));
|
|
142
|
-
var encrypt_js_4 = __nccwpck_require__(
|
|
41
|
+
var encrypt_js_4 = __nccwpck_require__(8332);
|
|
143
42
|
Object.defineProperty(exports, "EncryptJWT", ({ enumerable: true, get: function () { return encrypt_js_4.EncryptJWT; } }));
|
|
144
|
-
var thumbprint_js_1 = __nccwpck_require__(
|
|
43
|
+
var thumbprint_js_1 = __nccwpck_require__(7093);
|
|
145
44
|
Object.defineProperty(exports, "calculateJwkThumbprint", ({ enumerable: true, get: function () { return thumbprint_js_1.calculateJwkThumbprint; } }));
|
|
146
45
|
Object.defineProperty(exports, "calculateJwkThumbprintUri", ({ enumerable: true, get: function () { return thumbprint_js_1.calculateJwkThumbprintUri; } }));
|
|
147
|
-
var embedded_js_1 = __nccwpck_require__(
|
|
46
|
+
var embedded_js_1 = __nccwpck_require__(8433);
|
|
148
47
|
Object.defineProperty(exports, "EmbeddedJWK", ({ enumerable: true, get: function () { return embedded_js_1.EmbeddedJWK; } }));
|
|
149
|
-
var local_js_1 = __nccwpck_require__(
|
|
48
|
+
var local_js_1 = __nccwpck_require__(1588);
|
|
150
49
|
Object.defineProperty(exports, "createLocalJWKSet", ({ enumerable: true, get: function () { return local_js_1.createLocalJWKSet; } }));
|
|
151
|
-
var remote_js_1 = __nccwpck_require__(
|
|
50
|
+
var remote_js_1 = __nccwpck_require__(9143);
|
|
152
51
|
Object.defineProperty(exports, "createRemoteJWKSet", ({ enumerable: true, get: function () { return remote_js_1.createRemoteJWKSet; } }));
|
|
153
|
-
var unsecured_js_1 = __nccwpck_require__(
|
|
52
|
+
var unsecured_js_1 = __nccwpck_require__(7986);
|
|
154
53
|
Object.defineProperty(exports, "UnsecuredJWT", ({ enumerable: true, get: function () { return unsecured_js_1.UnsecuredJWT; } }));
|
|
155
|
-
var export_js_1 = __nccwpck_require__(
|
|
54
|
+
var export_js_1 = __nccwpck_require__(8239);
|
|
156
55
|
Object.defineProperty(exports, "exportPKCS8", ({ enumerable: true, get: function () { return export_js_1.exportPKCS8; } }));
|
|
157
56
|
Object.defineProperty(exports, "exportSPKI", ({ enumerable: true, get: function () { return export_js_1.exportSPKI; } }));
|
|
158
57
|
Object.defineProperty(exports, "exportJWK", ({ enumerable: true, get: function () { return export_js_1.exportJWK; } }));
|
|
159
|
-
var import_js_1 = __nccwpck_require__(
|
|
58
|
+
var import_js_1 = __nccwpck_require__(1010);
|
|
160
59
|
Object.defineProperty(exports, "importSPKI", ({ enumerable: true, get: function () { return import_js_1.importSPKI; } }));
|
|
161
60
|
Object.defineProperty(exports, "importPKCS8", ({ enumerable: true, get: function () { return import_js_1.importPKCS8; } }));
|
|
162
61
|
Object.defineProperty(exports, "importX509", ({ enumerable: true, get: function () { return import_js_1.importX509; } }));
|
|
163
62
|
Object.defineProperty(exports, "importJWK", ({ enumerable: true, get: function () { return import_js_1.importJWK; } }));
|
|
164
|
-
var decode_protected_header_js_1 = __nccwpck_require__(
|
|
63
|
+
var decode_protected_header_js_1 = __nccwpck_require__(1533);
|
|
165
64
|
Object.defineProperty(exports, "decodeProtectedHeader", ({ enumerable: true, get: function () { return decode_protected_header_js_1.decodeProtectedHeader; } }));
|
|
166
|
-
var decode_jwt_js_1 = __nccwpck_require__(
|
|
65
|
+
var decode_jwt_js_1 = __nccwpck_require__(2467);
|
|
167
66
|
Object.defineProperty(exports, "decodeJwt", ({ enumerable: true, get: function () { return decode_jwt_js_1.decodeJwt; } }));
|
|
168
|
-
exports.errors = __nccwpck_require__(
|
|
169
|
-
var generate_key_pair_js_1 = __nccwpck_require__(
|
|
67
|
+
exports.errors = __nccwpck_require__(2745);
|
|
68
|
+
var generate_key_pair_js_1 = __nccwpck_require__(5449);
|
|
170
69
|
Object.defineProperty(exports, "generateKeyPair", ({ enumerable: true, get: function () { return generate_key_pair_js_1.generateKeyPair; } }));
|
|
171
|
-
var generate_secret_js_1 = __nccwpck_require__(
|
|
70
|
+
var generate_secret_js_1 = __nccwpck_require__(6096);
|
|
172
71
|
Object.defineProperty(exports, "generateSecret", ({ enumerable: true, get: function () { return generate_secret_js_1.generateSecret; } }));
|
|
173
|
-
exports.base64url = __nccwpck_require__(
|
|
72
|
+
exports.base64url = __nccwpck_require__(2443);
|
|
174
73
|
|
|
175
74
|
|
|
176
75
|
/***/ }),
|
|
177
76
|
|
|
178
|
-
/***/
|
|
77
|
+
/***/ 9293:
|
|
179
78
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
180
79
|
|
|
181
80
|
|
|
182
81
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
183
82
|
exports.compactDecrypt = void 0;
|
|
184
|
-
const decrypt_js_1 = __nccwpck_require__(
|
|
185
|
-
const errors_js_1 = __nccwpck_require__(
|
|
186
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
83
|
+
const decrypt_js_1 = __nccwpck_require__(9836);
|
|
84
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
85
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
187
86
|
async function compactDecrypt(jwe, key, options) {
|
|
188
87
|
if (jwe instanceof Uint8Array) {
|
|
189
88
|
jwe = buffer_utils_js_1.decoder.decode(jwe);
|
|
@@ -213,13 +112,13 @@ exports.compactDecrypt = compactDecrypt;
|
|
|
213
112
|
|
|
214
113
|
/***/ }),
|
|
215
114
|
|
|
216
|
-
/***/
|
|
115
|
+
/***/ 7623:
|
|
217
116
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
218
117
|
|
|
219
118
|
|
|
220
119
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
221
120
|
exports.CompactEncrypt = void 0;
|
|
222
|
-
const encrypt_js_1 = __nccwpck_require__(
|
|
121
|
+
const encrypt_js_1 = __nccwpck_require__(2079);
|
|
223
122
|
class CompactEncrypt {
|
|
224
123
|
constructor(plaintext) {
|
|
225
124
|
this._flattened = new encrypt_js_1.FlattenedEncrypt(plaintext);
|
|
@@ -250,23 +149,23 @@ exports.CompactEncrypt = CompactEncrypt;
|
|
|
250
149
|
|
|
251
150
|
/***/ }),
|
|
252
151
|
|
|
253
|
-
/***/
|
|
152
|
+
/***/ 9836:
|
|
254
153
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
255
154
|
|
|
256
155
|
|
|
257
156
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
258
157
|
exports.flattenedDecrypt = void 0;
|
|
259
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
260
|
-
const decrypt_js_1 = __nccwpck_require__(
|
|
261
|
-
const zlib_js_1 = __nccwpck_require__(
|
|
262
|
-
const errors_js_1 = __nccwpck_require__(
|
|
263
|
-
const is_disjoint_js_1 = __nccwpck_require__(
|
|
264
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
265
|
-
const decrypt_key_management_js_1 = __nccwpck_require__(
|
|
266
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
267
|
-
const cek_js_1 = __nccwpck_require__(
|
|
268
|
-
const validate_crit_js_1 = __nccwpck_require__(
|
|
269
|
-
const validate_algorithms_js_1 = __nccwpck_require__(
|
|
158
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
159
|
+
const decrypt_js_1 = __nccwpck_require__(4888);
|
|
160
|
+
const zlib_js_1 = __nccwpck_require__(4486);
|
|
161
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
162
|
+
const is_disjoint_js_1 = __nccwpck_require__(7577);
|
|
163
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
164
|
+
const decrypt_key_management_js_1 = __nccwpck_require__(5044);
|
|
165
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
166
|
+
const cek_js_1 = __nccwpck_require__(284);
|
|
167
|
+
const validate_crit_js_1 = __nccwpck_require__(6203);
|
|
168
|
+
const validate_algorithms_js_1 = __nccwpck_require__(3290);
|
|
270
169
|
async function flattenedDecrypt(jwe, key, options) {
|
|
271
170
|
var _a;
|
|
272
171
|
if (!(0, is_object_js_1.default)(jwe)) {
|
|
@@ -398,21 +297,21 @@ exports.flattenedDecrypt = flattenedDecrypt;
|
|
|
398
297
|
|
|
399
298
|
/***/ }),
|
|
400
299
|
|
|
401
|
-
/***/
|
|
300
|
+
/***/ 2079:
|
|
402
301
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
403
302
|
|
|
404
303
|
|
|
405
304
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
406
305
|
exports.FlattenedEncrypt = exports.unprotected = void 0;
|
|
407
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
408
|
-
const encrypt_js_1 = __nccwpck_require__(
|
|
409
|
-
const zlib_js_1 = __nccwpck_require__(
|
|
410
|
-
const iv_js_1 = __nccwpck_require__(
|
|
411
|
-
const encrypt_key_management_js_1 = __nccwpck_require__(
|
|
412
|
-
const errors_js_1 = __nccwpck_require__(
|
|
413
|
-
const is_disjoint_js_1 = __nccwpck_require__(
|
|
414
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
415
|
-
const validate_crit_js_1 = __nccwpck_require__(
|
|
306
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
307
|
+
const encrypt_js_1 = __nccwpck_require__(277);
|
|
308
|
+
const zlib_js_1 = __nccwpck_require__(4486);
|
|
309
|
+
const iv_js_1 = __nccwpck_require__(7751);
|
|
310
|
+
const encrypt_key_management_js_1 = __nccwpck_require__(1050);
|
|
311
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
312
|
+
const is_disjoint_js_1 = __nccwpck_require__(7577);
|
|
313
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
314
|
+
const validate_crit_js_1 = __nccwpck_require__(6203);
|
|
416
315
|
exports.unprotected = Symbol();
|
|
417
316
|
class FlattenedEncrypt {
|
|
418
317
|
constructor(plaintext) {
|
|
@@ -584,15 +483,15 @@ exports.FlattenedEncrypt = FlattenedEncrypt;
|
|
|
584
483
|
|
|
585
484
|
/***/ }),
|
|
586
485
|
|
|
587
|
-
/***/
|
|
486
|
+
/***/ 1807:
|
|
588
487
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
589
488
|
|
|
590
489
|
|
|
591
490
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
592
491
|
exports.generalDecrypt = void 0;
|
|
593
|
-
const decrypt_js_1 = __nccwpck_require__(
|
|
594
|
-
const errors_js_1 = __nccwpck_require__(
|
|
595
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
492
|
+
const decrypt_js_1 = __nccwpck_require__(9836);
|
|
493
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
494
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
596
495
|
async function generalDecrypt(jwe, key, options) {
|
|
597
496
|
if (!(0, is_object_js_1.default)(jwe)) {
|
|
598
497
|
throw new errors_js_1.JWEInvalid('General JWE must be an object');
|
|
@@ -626,19 +525,19 @@ exports.generalDecrypt = generalDecrypt;
|
|
|
626
525
|
|
|
627
526
|
/***/ }),
|
|
628
527
|
|
|
629
|
-
/***/
|
|
528
|
+
/***/ 4086:
|
|
630
529
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
631
530
|
|
|
632
531
|
|
|
633
532
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
634
533
|
exports.GeneralEncrypt = void 0;
|
|
635
|
-
const encrypt_js_1 = __nccwpck_require__(
|
|
636
|
-
const errors_js_1 = __nccwpck_require__(
|
|
637
|
-
const cek_js_1 = __nccwpck_require__(
|
|
638
|
-
const is_disjoint_js_1 = __nccwpck_require__(
|
|
639
|
-
const encrypt_key_management_js_1 = __nccwpck_require__(
|
|
640
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
641
|
-
const validate_crit_js_1 = __nccwpck_require__(
|
|
534
|
+
const encrypt_js_1 = __nccwpck_require__(2079);
|
|
535
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
536
|
+
const cek_js_1 = __nccwpck_require__(284);
|
|
537
|
+
const is_disjoint_js_1 = __nccwpck_require__(7577);
|
|
538
|
+
const encrypt_key_management_js_1 = __nccwpck_require__(1050);
|
|
539
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
540
|
+
const validate_crit_js_1 = __nccwpck_require__(6203);
|
|
642
541
|
class IndividualRecipient {
|
|
643
542
|
constructor(enc, key, options) {
|
|
644
543
|
this.parent = enc;
|
|
@@ -815,15 +714,15 @@ exports.GeneralEncrypt = GeneralEncrypt;
|
|
|
815
714
|
|
|
816
715
|
/***/ }),
|
|
817
716
|
|
|
818
|
-
/***/
|
|
717
|
+
/***/ 8433:
|
|
819
718
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
820
719
|
|
|
821
720
|
|
|
822
721
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
823
722
|
exports.EmbeddedJWK = void 0;
|
|
824
|
-
const import_js_1 = __nccwpck_require__(
|
|
825
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
826
|
-
const errors_js_1 = __nccwpck_require__(
|
|
723
|
+
const import_js_1 = __nccwpck_require__(1010);
|
|
724
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
725
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
827
726
|
async function EmbeddedJWK(protectedHeader, token) {
|
|
828
727
|
const joseHeader = {
|
|
829
728
|
...protectedHeader,
|
|
@@ -843,17 +742,17 @@ exports.EmbeddedJWK = EmbeddedJWK;
|
|
|
843
742
|
|
|
844
743
|
/***/ }),
|
|
845
744
|
|
|
846
|
-
/***/
|
|
745
|
+
/***/ 7093:
|
|
847
746
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
848
747
|
|
|
849
748
|
|
|
850
749
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
851
750
|
exports.calculateJwkThumbprintUri = exports.calculateJwkThumbprint = void 0;
|
|
852
|
-
const digest_js_1 = __nccwpck_require__(
|
|
853
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
854
|
-
const errors_js_1 = __nccwpck_require__(
|
|
855
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
856
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
751
|
+
const digest_js_1 = __nccwpck_require__(1011);
|
|
752
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
753
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
754
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
755
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
857
756
|
const check = (value, description) => {
|
|
858
757
|
if (typeof value !== 'string' || !value) {
|
|
859
758
|
throw new errors_js_1.JWKInvalid(`${description} missing or invalid`);
|
|
@@ -908,15 +807,15 @@ exports.calculateJwkThumbprintUri = calculateJwkThumbprintUri;
|
|
|
908
807
|
|
|
909
808
|
/***/ }),
|
|
910
809
|
|
|
911
|
-
/***/
|
|
810
|
+
/***/ 1588:
|
|
912
811
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
913
812
|
|
|
914
813
|
|
|
915
814
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
916
815
|
exports.createLocalJWKSet = exports.LocalJWKSet = exports.isJWKSLike = void 0;
|
|
917
|
-
const import_js_1 = __nccwpck_require__(
|
|
918
|
-
const errors_js_1 = __nccwpck_require__(
|
|
919
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
816
|
+
const import_js_1 = __nccwpck_require__(1010);
|
|
817
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
818
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
920
819
|
function getKtyFromAlg(alg) {
|
|
921
820
|
switch (typeof alg === 'string' && alg.slice(0, 2)) {
|
|
922
821
|
case 'RS':
|
|
@@ -1019,16 +918,16 @@ exports.createLocalJWKSet = createLocalJWKSet;
|
|
|
1019
918
|
|
|
1020
919
|
/***/ }),
|
|
1021
920
|
|
|
1022
|
-
/***/
|
|
921
|
+
/***/ 9143:
|
|
1023
922
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1024
923
|
|
|
1025
924
|
|
|
1026
925
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1027
926
|
exports.createRemoteJWKSet = void 0;
|
|
1028
|
-
const fetch_jwks_js_1 = __nccwpck_require__(
|
|
1029
|
-
const env_js_1 = __nccwpck_require__(
|
|
1030
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1031
|
-
const local_js_1 = __nccwpck_require__(
|
|
927
|
+
const fetch_jwks_js_1 = __nccwpck_require__(7409);
|
|
928
|
+
const env_js_1 = __nccwpck_require__(9884);
|
|
929
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
930
|
+
const local_js_1 = __nccwpck_require__(1588);
|
|
1032
931
|
class RemoteJWKSet extends local_js_1.LocalJWKSet {
|
|
1033
932
|
constructor(url, options) {
|
|
1034
933
|
super({ keys: [] });
|
|
@@ -1111,13 +1010,13 @@ exports.createRemoteJWKSet = createRemoteJWKSet;
|
|
|
1111
1010
|
|
|
1112
1011
|
/***/ }),
|
|
1113
1012
|
|
|
1114
|
-
/***/
|
|
1013
|
+
/***/ 9630:
|
|
1115
1014
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1116
1015
|
|
|
1117
1016
|
|
|
1118
1017
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1119
1018
|
exports.CompactSign = void 0;
|
|
1120
|
-
const sign_js_1 = __nccwpck_require__(
|
|
1019
|
+
const sign_js_1 = __nccwpck_require__(7347);
|
|
1121
1020
|
class CompactSign {
|
|
1122
1021
|
constructor(payload) {
|
|
1123
1022
|
this._flattened = new sign_js_1.FlattenedSign(payload);
|
|
@@ -1139,15 +1038,15 @@ exports.CompactSign = CompactSign;
|
|
|
1139
1038
|
|
|
1140
1039
|
/***/ }),
|
|
1141
1040
|
|
|
1142
|
-
/***/
|
|
1041
|
+
/***/ 214:
|
|
1143
1042
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1144
1043
|
|
|
1145
1044
|
|
|
1146
1045
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1147
1046
|
exports.compactVerify = void 0;
|
|
1148
|
-
const verify_js_1 = __nccwpck_require__(
|
|
1149
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1150
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
1047
|
+
const verify_js_1 = __nccwpck_require__(5763);
|
|
1048
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1049
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
1151
1050
|
async function compactVerify(jws, key, options) {
|
|
1152
1051
|
if (jws instanceof Uint8Array) {
|
|
1153
1052
|
jws = buffer_utils_js_1.decoder.decode(jws);
|
|
@@ -1171,19 +1070,19 @@ exports.compactVerify = compactVerify;
|
|
|
1171
1070
|
|
|
1172
1071
|
/***/ }),
|
|
1173
1072
|
|
|
1174
|
-
/***/
|
|
1073
|
+
/***/ 7347:
|
|
1175
1074
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1176
1075
|
|
|
1177
1076
|
|
|
1178
1077
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1179
1078
|
exports.FlattenedSign = void 0;
|
|
1180
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
1181
|
-
const sign_js_1 = __nccwpck_require__(
|
|
1182
|
-
const is_disjoint_js_1 = __nccwpck_require__(
|
|
1183
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1184
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
1185
|
-
const check_key_type_js_1 = __nccwpck_require__(
|
|
1186
|
-
const validate_crit_js_1 = __nccwpck_require__(
|
|
1079
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
1080
|
+
const sign_js_1 = __nccwpck_require__(6193);
|
|
1081
|
+
const is_disjoint_js_1 = __nccwpck_require__(7577);
|
|
1082
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1083
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
1084
|
+
const check_key_type_js_1 = __nccwpck_require__(7898);
|
|
1085
|
+
const validate_crit_js_1 = __nccwpck_require__(6203);
|
|
1187
1086
|
class FlattenedSign {
|
|
1188
1087
|
constructor(payload) {
|
|
1189
1088
|
if (!(payload instanceof Uint8Array)) {
|
|
@@ -1263,21 +1162,21 @@ exports.FlattenedSign = FlattenedSign;
|
|
|
1263
1162
|
|
|
1264
1163
|
/***/ }),
|
|
1265
1164
|
|
|
1266
|
-
/***/
|
|
1165
|
+
/***/ 5763:
|
|
1267
1166
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1268
1167
|
|
|
1269
1168
|
|
|
1270
1169
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1271
1170
|
exports.flattenedVerify = void 0;
|
|
1272
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
1273
|
-
const verify_js_1 = __nccwpck_require__(
|
|
1274
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1275
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
1276
|
-
const is_disjoint_js_1 = __nccwpck_require__(
|
|
1277
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
1278
|
-
const check_key_type_js_1 = __nccwpck_require__(
|
|
1279
|
-
const validate_crit_js_1 = __nccwpck_require__(
|
|
1280
|
-
const validate_algorithms_js_1 = __nccwpck_require__(
|
|
1171
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
1172
|
+
const verify_js_1 = __nccwpck_require__(4476);
|
|
1173
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1174
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
1175
|
+
const is_disjoint_js_1 = __nccwpck_require__(7577);
|
|
1176
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
1177
|
+
const check_key_type_js_1 = __nccwpck_require__(7898);
|
|
1178
|
+
const validate_crit_js_1 = __nccwpck_require__(6203);
|
|
1179
|
+
const validate_algorithms_js_1 = __nccwpck_require__(3290);
|
|
1281
1180
|
async function flattenedVerify(jws, key, options) {
|
|
1282
1181
|
var _a;
|
|
1283
1182
|
if (!(0, is_object_js_1.default)(jws)) {
|
|
@@ -1378,14 +1277,14 @@ exports.flattenedVerify = flattenedVerify;
|
|
|
1378
1277
|
|
|
1379
1278
|
/***/ }),
|
|
1380
1279
|
|
|
1381
|
-
/***/
|
|
1280
|
+
/***/ 7687:
|
|
1382
1281
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1383
1282
|
|
|
1384
1283
|
|
|
1385
1284
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1386
1285
|
exports.GeneralSign = void 0;
|
|
1387
|
-
const sign_js_1 = __nccwpck_require__(
|
|
1388
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1286
|
+
const sign_js_1 = __nccwpck_require__(7347);
|
|
1287
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1389
1288
|
class IndividualSignature {
|
|
1390
1289
|
constructor(sig, key, options) {
|
|
1391
1290
|
this.parent = sig;
|
|
@@ -1456,15 +1355,15 @@ exports.GeneralSign = GeneralSign;
|
|
|
1456
1355
|
|
|
1457
1356
|
/***/ }),
|
|
1458
1357
|
|
|
1459
|
-
/***/
|
|
1358
|
+
/***/ 6984:
|
|
1460
1359
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1461
1360
|
|
|
1462
1361
|
|
|
1463
1362
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1464
1363
|
exports.generalVerify = void 0;
|
|
1465
|
-
const verify_js_1 = __nccwpck_require__(
|
|
1466
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1467
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
1364
|
+
const verify_js_1 = __nccwpck_require__(5763);
|
|
1365
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1366
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
1468
1367
|
async function generalVerify(jws, key, options) {
|
|
1469
1368
|
if (!(0, is_object_js_1.default)(jws)) {
|
|
1470
1369
|
throw new errors_js_1.JWSInvalid('General JWS must be an object');
|
|
@@ -1491,15 +1390,15 @@ exports.generalVerify = generalVerify;
|
|
|
1491
1390
|
|
|
1492
1391
|
/***/ }),
|
|
1493
1392
|
|
|
1494
|
-
/***/
|
|
1393
|
+
/***/ 3632:
|
|
1495
1394
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1496
1395
|
|
|
1497
1396
|
|
|
1498
1397
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1499
1398
|
exports.jwtDecrypt = void 0;
|
|
1500
|
-
const decrypt_js_1 = __nccwpck_require__(
|
|
1501
|
-
const jwt_claims_set_js_1 = __nccwpck_require__(
|
|
1502
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1399
|
+
const decrypt_js_1 = __nccwpck_require__(9293);
|
|
1400
|
+
const jwt_claims_set_js_1 = __nccwpck_require__(4737);
|
|
1401
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1503
1402
|
async function jwtDecrypt(jwt, key, options) {
|
|
1504
1403
|
const decrypted = await (0, decrypt_js_1.compactDecrypt)(jwt, key, options);
|
|
1505
1404
|
const payload = (0, jwt_claims_set_js_1.default)(decrypted.protectedHeader, decrypted.plaintext, options);
|
|
@@ -1525,15 +1424,15 @@ exports.jwtDecrypt = jwtDecrypt;
|
|
|
1525
1424
|
|
|
1526
1425
|
/***/ }),
|
|
1527
1426
|
|
|
1528
|
-
/***/
|
|
1427
|
+
/***/ 8332:
|
|
1529
1428
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1530
1429
|
|
|
1531
1430
|
|
|
1532
1431
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1533
1432
|
exports.EncryptJWT = void 0;
|
|
1534
|
-
const encrypt_js_1 = __nccwpck_require__(
|
|
1535
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
1536
|
-
const produce_js_1 = __nccwpck_require__(
|
|
1433
|
+
const encrypt_js_1 = __nccwpck_require__(7623);
|
|
1434
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
1435
|
+
const produce_js_1 = __nccwpck_require__(7969);
|
|
1537
1436
|
class EncryptJWT extends produce_js_1.ProduceJWT {
|
|
1538
1437
|
setProtectedHeader(protectedHeader) {
|
|
1539
1438
|
if (this._protectedHeader) {
|
|
@@ -1604,15 +1503,15 @@ exports.EncryptJWT = EncryptJWT;
|
|
|
1604
1503
|
|
|
1605
1504
|
/***/ }),
|
|
1606
1505
|
|
|
1607
|
-
/***/
|
|
1506
|
+
/***/ 7969:
|
|
1608
1507
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1609
1508
|
|
|
1610
1509
|
|
|
1611
1510
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1612
1511
|
exports.ProduceJWT = void 0;
|
|
1613
|
-
const epoch_js_1 = __nccwpck_require__(
|
|
1614
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
1615
|
-
const secs_js_1 = __nccwpck_require__(
|
|
1512
|
+
const epoch_js_1 = __nccwpck_require__(7722);
|
|
1513
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
1514
|
+
const secs_js_1 = __nccwpck_require__(6293);
|
|
1616
1515
|
class ProduceJWT {
|
|
1617
1516
|
constructor(payload) {
|
|
1618
1517
|
if (!(0, is_object_js_1.default)(payload)) {
|
|
@@ -1669,16 +1568,16 @@ exports.ProduceJWT = ProduceJWT;
|
|
|
1669
1568
|
|
|
1670
1569
|
/***/ }),
|
|
1671
1570
|
|
|
1672
|
-
/***/
|
|
1571
|
+
/***/ 7561:
|
|
1673
1572
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1674
1573
|
|
|
1675
1574
|
|
|
1676
1575
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1677
1576
|
exports.SignJWT = void 0;
|
|
1678
|
-
const sign_js_1 = __nccwpck_require__(
|
|
1679
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1680
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
1681
|
-
const produce_js_1 = __nccwpck_require__(
|
|
1577
|
+
const sign_js_1 = __nccwpck_require__(9630);
|
|
1578
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1579
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
1580
|
+
const produce_js_1 = __nccwpck_require__(7969);
|
|
1682
1581
|
class SignJWT extends produce_js_1.ProduceJWT {
|
|
1683
1582
|
setProtectedHeader(protectedHeader) {
|
|
1684
1583
|
this._protectedHeader = protectedHeader;
|
|
@@ -1701,17 +1600,17 @@ exports.SignJWT = SignJWT;
|
|
|
1701
1600
|
|
|
1702
1601
|
/***/ }),
|
|
1703
1602
|
|
|
1704
|
-
/***/
|
|
1603
|
+
/***/ 7986:
|
|
1705
1604
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1706
1605
|
|
|
1707
1606
|
|
|
1708
1607
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1709
1608
|
exports.UnsecuredJWT = void 0;
|
|
1710
|
-
const base64url = __nccwpck_require__(
|
|
1711
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
1712
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1713
|
-
const jwt_claims_set_js_1 = __nccwpck_require__(
|
|
1714
|
-
const produce_js_1 = __nccwpck_require__(
|
|
1609
|
+
const base64url = __nccwpck_require__(7395);
|
|
1610
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
1611
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1612
|
+
const jwt_claims_set_js_1 = __nccwpck_require__(4737);
|
|
1613
|
+
const produce_js_1 = __nccwpck_require__(7969);
|
|
1715
1614
|
class UnsecuredJWT extends produce_js_1.ProduceJWT {
|
|
1716
1615
|
encode() {
|
|
1717
1616
|
const header = base64url.encode(JSON.stringify({ alg: 'none' }));
|
|
@@ -1744,15 +1643,15 @@ exports.UnsecuredJWT = UnsecuredJWT;
|
|
|
1744
1643
|
|
|
1745
1644
|
/***/ }),
|
|
1746
1645
|
|
|
1747
|
-
/***/
|
|
1646
|
+
/***/ 2005:
|
|
1748
1647
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1749
1648
|
|
|
1750
1649
|
|
|
1751
1650
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1752
1651
|
exports.jwtVerify = void 0;
|
|
1753
|
-
const verify_js_1 = __nccwpck_require__(
|
|
1754
|
-
const jwt_claims_set_js_1 = __nccwpck_require__(
|
|
1755
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1652
|
+
const verify_js_1 = __nccwpck_require__(214);
|
|
1653
|
+
const jwt_claims_set_js_1 = __nccwpck_require__(4737);
|
|
1654
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1756
1655
|
async function jwtVerify(jwt, key, options) {
|
|
1757
1656
|
var _a;
|
|
1758
1657
|
const verified = await (0, verify_js_1.compactVerify)(jwt, key, options);
|
|
@@ -1771,15 +1670,15 @@ exports.jwtVerify = jwtVerify;
|
|
|
1771
1670
|
|
|
1772
1671
|
/***/ }),
|
|
1773
1672
|
|
|
1774
|
-
/***/
|
|
1673
|
+
/***/ 8239:
|
|
1775
1674
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1776
1675
|
|
|
1777
1676
|
|
|
1778
1677
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1779
1678
|
exports.exportJWK = exports.exportPKCS8 = exports.exportSPKI = void 0;
|
|
1780
|
-
const asn1_js_1 = __nccwpck_require__(
|
|
1781
|
-
const asn1_js_2 = __nccwpck_require__(
|
|
1782
|
-
const key_to_jwk_js_1 = __nccwpck_require__(
|
|
1679
|
+
const asn1_js_1 = __nccwpck_require__(1662);
|
|
1680
|
+
const asn1_js_2 = __nccwpck_require__(1662);
|
|
1681
|
+
const key_to_jwk_js_1 = __nccwpck_require__(4135);
|
|
1783
1682
|
async function exportSPKI(key) {
|
|
1784
1683
|
return (0, asn1_js_1.toSPKI)(key);
|
|
1785
1684
|
}
|
|
@@ -1796,13 +1695,13 @@ exports.exportJWK = exportJWK;
|
|
|
1796
1695
|
|
|
1797
1696
|
/***/ }),
|
|
1798
1697
|
|
|
1799
|
-
/***/
|
|
1698
|
+
/***/ 5449:
|
|
1800
1699
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1801
1700
|
|
|
1802
1701
|
|
|
1803
1702
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1804
1703
|
exports.generateKeyPair = void 0;
|
|
1805
|
-
const generate_js_1 = __nccwpck_require__(
|
|
1704
|
+
const generate_js_1 = __nccwpck_require__(3583);
|
|
1806
1705
|
async function generateKeyPair(alg, options) {
|
|
1807
1706
|
return (0, generate_js_1.generateKeyPair)(alg, options);
|
|
1808
1707
|
}
|
|
@@ -1811,13 +1710,13 @@ exports.generateKeyPair = generateKeyPair;
|
|
|
1811
1710
|
|
|
1812
1711
|
/***/ }),
|
|
1813
1712
|
|
|
1814
|
-
/***/
|
|
1713
|
+
/***/ 6096:
|
|
1815
1714
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1816
1715
|
|
|
1817
1716
|
|
|
1818
1717
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1819
1718
|
exports.generateSecret = void 0;
|
|
1820
|
-
const generate_js_1 = __nccwpck_require__(
|
|
1719
|
+
const generate_js_1 = __nccwpck_require__(3583);
|
|
1821
1720
|
async function generateSecret(alg, options) {
|
|
1822
1721
|
return (0, generate_js_1.generateSecret)(alg, options);
|
|
1823
1722
|
}
|
|
@@ -1826,19 +1725,19 @@ exports.generateSecret = generateSecret;
|
|
|
1826
1725
|
|
|
1827
1726
|
/***/ }),
|
|
1828
1727
|
|
|
1829
|
-
/***/
|
|
1728
|
+
/***/ 1010:
|
|
1830
1729
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1831
1730
|
|
|
1832
1731
|
|
|
1833
1732
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1834
1733
|
exports.importJWK = exports.importPKCS8 = exports.importX509 = exports.importSPKI = void 0;
|
|
1835
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
1836
|
-
const asn1_js_1 = __nccwpck_require__(
|
|
1837
|
-
const asn1_js_2 = __nccwpck_require__(
|
|
1838
|
-
const jwk_to_key_js_1 = __nccwpck_require__(
|
|
1839
|
-
const errors_js_1 = __nccwpck_require__(
|
|
1840
|
-
const format_pem_js_1 = __nccwpck_require__(
|
|
1841
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
1734
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
1735
|
+
const asn1_js_1 = __nccwpck_require__(1662);
|
|
1736
|
+
const asn1_js_2 = __nccwpck_require__(1662);
|
|
1737
|
+
const jwk_to_key_js_1 = __nccwpck_require__(3810);
|
|
1738
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1739
|
+
const format_pem_js_1 = __nccwpck_require__(3257);
|
|
1740
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
1842
1741
|
function getElement(seq) {
|
|
1843
1742
|
let result = [];
|
|
1844
1743
|
let next = 0;
|
|
@@ -1960,16 +1859,16 @@ exports.importJWK = importJWK;
|
|
|
1960
1859
|
|
|
1961
1860
|
/***/ }),
|
|
1962
1861
|
|
|
1963
|
-
/***/
|
|
1862
|
+
/***/ 3049:
|
|
1964
1863
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1965
1864
|
|
|
1966
1865
|
|
|
1967
1866
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1968
1867
|
exports.unwrap = exports.wrap = void 0;
|
|
1969
|
-
const encrypt_js_1 = __nccwpck_require__(
|
|
1970
|
-
const decrypt_js_1 = __nccwpck_require__(
|
|
1971
|
-
const iv_js_1 = __nccwpck_require__(
|
|
1972
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
1868
|
+
const encrypt_js_1 = __nccwpck_require__(277);
|
|
1869
|
+
const decrypt_js_1 = __nccwpck_require__(4888);
|
|
1870
|
+
const iv_js_1 = __nccwpck_require__(7751);
|
|
1871
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
1973
1872
|
async function wrap(alg, key, cek, iv) {
|
|
1974
1873
|
const jweAlgorithm = alg.slice(0, 7);
|
|
1975
1874
|
iv || (iv = (0, iv_js_1.default)(jweAlgorithm));
|
|
@@ -1986,13 +1885,13 @@ exports.unwrap = unwrap;
|
|
|
1986
1885
|
|
|
1987
1886
|
/***/ }),
|
|
1988
1887
|
|
|
1989
|
-
/***/
|
|
1888
|
+
/***/ 614:
|
|
1990
1889
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1991
1890
|
|
|
1992
1891
|
|
|
1993
1892
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1994
1893
|
exports.concatKdf = exports.lengthAndInput = exports.uint32be = exports.uint64be = exports.p2s = exports.concat = exports.decoder = exports.encoder = void 0;
|
|
1995
|
-
const digest_js_1 = __nccwpck_require__(
|
|
1894
|
+
const digest_js_1 = __nccwpck_require__(1011);
|
|
1996
1895
|
exports.encoder = new TextEncoder();
|
|
1997
1896
|
exports.decoder = new TextDecoder();
|
|
1998
1897
|
const MAX_INT32 = 2 ** 32;
|
|
@@ -2053,14 +1952,14 @@ exports.concatKdf = concatKdf;
|
|
|
2053
1952
|
|
|
2054
1953
|
/***/ }),
|
|
2055
1954
|
|
|
2056
|
-
/***/
|
|
1955
|
+
/***/ 284:
|
|
2057
1956
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2058
1957
|
|
|
2059
1958
|
|
|
2060
1959
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2061
1960
|
exports.bitLength = void 0;
|
|
2062
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2063
|
-
const random_js_1 = __nccwpck_require__(
|
|
1961
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1962
|
+
const random_js_1 = __nccwpck_require__(2368);
|
|
2064
1963
|
function bitLength(alg) {
|
|
2065
1964
|
switch (alg) {
|
|
2066
1965
|
case 'A128GCM':
|
|
@@ -2084,13 +1983,13 @@ exports["default"] = (alg) => (0, random_js_1.default)(new Uint8Array(bitLength(
|
|
|
2084
1983
|
|
|
2085
1984
|
/***/ }),
|
|
2086
1985
|
|
|
2087
|
-
/***/
|
|
1986
|
+
/***/ 2225:
|
|
2088
1987
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2089
1988
|
|
|
2090
1989
|
|
|
2091
1990
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2092
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2093
|
-
const iv_js_1 = __nccwpck_require__(
|
|
1991
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
1992
|
+
const iv_js_1 = __nccwpck_require__(7751);
|
|
2094
1993
|
const checkIvLength = (enc, iv) => {
|
|
2095
1994
|
if (iv.length << 3 !== (0, iv_js_1.bitLength)(enc)) {
|
|
2096
1995
|
throw new errors_js_1.JWEInvalid('Invalid Initialization Vector length');
|
|
@@ -2101,13 +2000,13 @@ exports["default"] = checkIvLength;
|
|
|
2101
2000
|
|
|
2102
2001
|
/***/ }),
|
|
2103
2002
|
|
|
2104
|
-
/***/
|
|
2003
|
+
/***/ 7898:
|
|
2105
2004
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2106
2005
|
|
|
2107
2006
|
|
|
2108
2007
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2109
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
2110
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
2008
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
2009
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
2111
2010
|
const symmetricTypeCheck = (key) => {
|
|
2112
2011
|
if (key instanceof Uint8Array)
|
|
2113
2012
|
return;
|
|
@@ -2155,12 +2054,12 @@ exports["default"] = checkKeyType;
|
|
|
2155
2054
|
|
|
2156
2055
|
/***/ }),
|
|
2157
2056
|
|
|
2158
|
-
/***/
|
|
2057
|
+
/***/ 5025:
|
|
2159
2058
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2160
2059
|
|
|
2161
2060
|
|
|
2162
2061
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2163
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2062
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2164
2063
|
function checkP2s(p2s) {
|
|
2165
2064
|
if (!(p2s instanceof Uint8Array) || p2s.length < 8) {
|
|
2166
2065
|
throw new errors_js_1.JWEInvalid('PBES2 Salt Input must be 8 or more octets');
|
|
@@ -2171,13 +2070,13 @@ exports["default"] = checkP2s;
|
|
|
2171
2070
|
|
|
2172
2071
|
/***/ }),
|
|
2173
2072
|
|
|
2174
|
-
/***/
|
|
2073
|
+
/***/ 5985:
|
|
2175
2074
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2176
2075
|
|
|
2177
2076
|
|
|
2178
2077
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2179
2078
|
exports.checkEncCryptoKey = exports.checkSigCryptoKey = void 0;
|
|
2180
|
-
const env_js_1 = __nccwpck_require__(
|
|
2079
|
+
const env_js_1 = __nccwpck_require__(9884);
|
|
2181
2080
|
function unusable(name, prop = 'algorithm.name') {
|
|
2182
2081
|
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
2183
2082
|
}
|
|
@@ -2328,22 +2227,22 @@ exports.checkEncCryptoKey = checkEncCryptoKey;
|
|
|
2328
2227
|
|
|
2329
2228
|
/***/ }),
|
|
2330
2229
|
|
|
2331
|
-
/***/
|
|
2230
|
+
/***/ 5044:
|
|
2332
2231
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2333
2232
|
|
|
2334
2233
|
|
|
2335
2234
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2336
|
-
const aeskw_js_1 = __nccwpck_require__(
|
|
2337
|
-
const ECDH = __nccwpck_require__(
|
|
2338
|
-
const pbes2kw_js_1 = __nccwpck_require__(
|
|
2339
|
-
const rsaes_js_1 = __nccwpck_require__(
|
|
2340
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
2341
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2342
|
-
const cek_js_1 = __nccwpck_require__(
|
|
2343
|
-
const import_js_1 = __nccwpck_require__(
|
|
2344
|
-
const check_key_type_js_1 = __nccwpck_require__(
|
|
2345
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
2346
|
-
const aesgcmkw_js_1 = __nccwpck_require__(
|
|
2235
|
+
const aeskw_js_1 = __nccwpck_require__(4357);
|
|
2236
|
+
const ECDH = __nccwpck_require__(9356);
|
|
2237
|
+
const pbes2kw_js_1 = __nccwpck_require__(9295);
|
|
2238
|
+
const rsaes_js_1 = __nccwpck_require__(211);
|
|
2239
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
2240
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2241
|
+
const cek_js_1 = __nccwpck_require__(284);
|
|
2242
|
+
const import_js_1 = __nccwpck_require__(1010);
|
|
2243
|
+
const check_key_type_js_1 = __nccwpck_require__(7898);
|
|
2244
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
2245
|
+
const aesgcmkw_js_1 = __nccwpck_require__(3049);
|
|
2347
2246
|
async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
|
|
2348
2247
|
(0, check_key_type_js_1.default)(alg, key, 'decrypt');
|
|
2349
2248
|
switch (alg) {
|
|
@@ -2435,21 +2334,21 @@ exports["default"] = decryptKeyManagement;
|
|
|
2435
2334
|
|
|
2436
2335
|
/***/ }),
|
|
2437
2336
|
|
|
2438
|
-
/***/
|
|
2337
|
+
/***/ 1050:
|
|
2439
2338
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2440
2339
|
|
|
2441
2340
|
|
|
2442
2341
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2443
|
-
const aeskw_js_1 = __nccwpck_require__(
|
|
2444
|
-
const ECDH = __nccwpck_require__(
|
|
2445
|
-
const pbes2kw_js_1 = __nccwpck_require__(
|
|
2446
|
-
const rsaes_js_1 = __nccwpck_require__(
|
|
2447
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
2448
|
-
const cek_js_1 = __nccwpck_require__(
|
|
2449
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2450
|
-
const export_js_1 = __nccwpck_require__(
|
|
2451
|
-
const check_key_type_js_1 = __nccwpck_require__(
|
|
2452
|
-
const aesgcmkw_js_1 = __nccwpck_require__(
|
|
2342
|
+
const aeskw_js_1 = __nccwpck_require__(4357);
|
|
2343
|
+
const ECDH = __nccwpck_require__(9356);
|
|
2344
|
+
const pbes2kw_js_1 = __nccwpck_require__(9295);
|
|
2345
|
+
const rsaes_js_1 = __nccwpck_require__(211);
|
|
2346
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
2347
|
+
const cek_js_1 = __nccwpck_require__(284);
|
|
2348
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2349
|
+
const export_js_1 = __nccwpck_require__(8239);
|
|
2350
|
+
const check_key_type_js_1 = __nccwpck_require__(7898);
|
|
2351
|
+
const aesgcmkw_js_1 = __nccwpck_require__(3049);
|
|
2453
2352
|
async function encryptKeyManagement(alg, enc, key, providedCek, providedParameters = {}) {
|
|
2454
2353
|
let encryptedKey;
|
|
2455
2354
|
let parameters;
|
|
@@ -2531,7 +2430,7 @@ exports["default"] = encryptKeyManagement;
|
|
|
2531
2430
|
|
|
2532
2431
|
/***/ }),
|
|
2533
2432
|
|
|
2534
|
-
/***/
|
|
2433
|
+
/***/ 7722:
|
|
2535
2434
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2536
2435
|
|
|
2537
2436
|
|
|
@@ -2541,7 +2440,7 @@ exports["default"] = (date) => Math.floor(date.getTime() / 1000);
|
|
|
2541
2440
|
|
|
2542
2441
|
/***/ }),
|
|
2543
2442
|
|
|
2544
|
-
/***/
|
|
2443
|
+
/***/ 3257:
|
|
2545
2444
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2546
2445
|
|
|
2547
2446
|
|
|
@@ -2554,7 +2453,7 @@ exports["default"] = (b64, descriptor) => {
|
|
|
2554
2453
|
|
|
2555
2454
|
/***/ }),
|
|
2556
2455
|
|
|
2557
|
-
/***/
|
|
2456
|
+
/***/ 5547:
|
|
2558
2457
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2559
2458
|
|
|
2560
2459
|
|
|
@@ -2588,7 +2487,7 @@ exports["default"] = (actual, ...types) => {
|
|
|
2588
2487
|
|
|
2589
2488
|
/***/ }),
|
|
2590
2489
|
|
|
2591
|
-
/***/
|
|
2490
|
+
/***/ 7577:
|
|
2592
2491
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2593
2492
|
|
|
2594
2493
|
|
|
@@ -2619,7 +2518,7 @@ exports["default"] = isDisjoint;
|
|
|
2619
2518
|
|
|
2620
2519
|
/***/ }),
|
|
2621
2520
|
|
|
2622
|
-
/***/
|
|
2521
|
+
/***/ 6643:
|
|
2623
2522
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2624
2523
|
|
|
2625
2524
|
|
|
@@ -2645,14 +2544,14 @@ exports["default"] = isObject;
|
|
|
2645
2544
|
|
|
2646
2545
|
/***/ }),
|
|
2647
2546
|
|
|
2648
|
-
/***/
|
|
2547
|
+
/***/ 7751:
|
|
2649
2548
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2650
2549
|
|
|
2651
2550
|
|
|
2652
2551
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2653
2552
|
exports.bitLength = void 0;
|
|
2654
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2655
|
-
const random_js_1 = __nccwpck_require__(
|
|
2553
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2554
|
+
const random_js_1 = __nccwpck_require__(2368);
|
|
2656
2555
|
function bitLength(alg) {
|
|
2657
2556
|
switch (alg) {
|
|
2658
2557
|
case 'A128GCM':
|
|
@@ -2676,16 +2575,16 @@ exports["default"] = (alg) => (0, random_js_1.default)(new Uint8Array(bitLength(
|
|
|
2676
2575
|
|
|
2677
2576
|
/***/ }),
|
|
2678
2577
|
|
|
2679
|
-
/***/
|
|
2578
|
+
/***/ 4737:
|
|
2680
2579
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2681
2580
|
|
|
2682
2581
|
|
|
2683
2582
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2684
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2685
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
2686
|
-
const epoch_js_1 = __nccwpck_require__(
|
|
2687
|
-
const secs_js_1 = __nccwpck_require__(
|
|
2688
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
2583
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2584
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
2585
|
+
const epoch_js_1 = __nccwpck_require__(7722);
|
|
2586
|
+
const secs_js_1 = __nccwpck_require__(6293);
|
|
2587
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
2689
2588
|
const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '');
|
|
2690
2589
|
const checkAudiencePresence = (audPayload, audOption) => {
|
|
2691
2590
|
if (typeof audPayload === 'string') {
|
|
@@ -2776,7 +2675,7 @@ exports["default"] = (protectedHeader, encodedPayload, options = {}) => {
|
|
|
2776
2675
|
|
|
2777
2676
|
/***/ }),
|
|
2778
2677
|
|
|
2779
|
-
/***/
|
|
2678
|
+
/***/ 6293:
|
|
2780
2679
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2781
2680
|
|
|
2782
2681
|
|
|
@@ -2829,7 +2728,7 @@ exports["default"] = (str) => {
|
|
|
2829
2728
|
|
|
2830
2729
|
/***/ }),
|
|
2831
2730
|
|
|
2832
|
-
/***/
|
|
2731
|
+
/***/ 3290:
|
|
2833
2732
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2834
2733
|
|
|
2835
2734
|
|
|
@@ -2849,12 +2748,12 @@ exports["default"] = validateAlgorithms;
|
|
|
2849
2748
|
|
|
2850
2749
|
/***/ }),
|
|
2851
2750
|
|
|
2852
|
-
/***/
|
|
2751
|
+
/***/ 6203:
|
|
2853
2752
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2854
2753
|
|
|
2855
2754
|
|
|
2856
2755
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2857
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2756
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2858
2757
|
function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
|
|
2859
2758
|
if (joseHeader.crit !== undefined && protectedHeader.crit === undefined) {
|
|
2860
2759
|
throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
@@ -2892,7 +2791,7 @@ exports["default"] = validateCrit;
|
|
|
2892
2791
|
|
|
2893
2792
|
/***/ }),
|
|
2894
2793
|
|
|
2895
|
-
/***/
|
|
2794
|
+
/***/ 4357:
|
|
2896
2795
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2897
2796
|
|
|
2898
2797
|
|
|
@@ -2900,14 +2799,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2900
2799
|
exports.unwrap = exports.wrap = void 0;
|
|
2901
2800
|
const buffer_1 = __nccwpck_require__(4300);
|
|
2902
2801
|
const crypto_1 = __nccwpck_require__(6113);
|
|
2903
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2904
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
2905
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
2906
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
2907
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
2908
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
2909
|
-
const ciphers_js_1 = __nccwpck_require__(
|
|
2910
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
2802
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
2803
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
2804
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
2805
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
2806
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
2807
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
2808
|
+
const ciphers_js_1 = __nccwpck_require__(7464);
|
|
2809
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
2911
2810
|
function checkKeySize(key, alg) {
|
|
2912
2811
|
if (key.symmetricKeySize << 3 !== parseInt(alg.slice(1, 4), 10)) {
|
|
2913
2812
|
throw new TypeError(`Invalid key size for alg: ${alg}`);
|
|
@@ -2954,7 +2853,7 @@ exports.unwrap = unwrap;
|
|
|
2954
2853
|
|
|
2955
2854
|
/***/ }),
|
|
2956
2855
|
|
|
2957
|
-
/***/
|
|
2856
|
+
/***/ 1662:
|
|
2958
2857
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2959
2858
|
|
|
2960
2859
|
|
|
@@ -2962,10 +2861,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2962
2861
|
exports.fromSPKI = exports.fromPKCS8 = exports.toPKCS8 = exports.toSPKI = void 0;
|
|
2963
2862
|
const crypto_1 = __nccwpck_require__(6113);
|
|
2964
2863
|
const buffer_1 = __nccwpck_require__(4300);
|
|
2965
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
2966
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
2967
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
2968
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
2864
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
2865
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
2866
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
2867
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
2969
2868
|
const genericExport = (keyType, keyFormat, key) => {
|
|
2970
2869
|
let keyObject;
|
|
2971
2870
|
if ((0, webcrypto_js_1.isCryptoKey)(key)) {
|
|
@@ -3009,7 +2908,7 @@ exports.fromSPKI = fromSPKI;
|
|
|
3009
2908
|
|
|
3010
2909
|
/***/ }),
|
|
3011
2910
|
|
|
3012
|
-
/***/
|
|
2911
|
+
/***/ 5554:
|
|
3013
2912
|
/***/ ((__unused_webpack_module, exports) => {
|
|
3014
2913
|
|
|
3015
2914
|
|
|
@@ -3063,13 +2962,13 @@ exports["default"] = Asn1SequenceDecoder;
|
|
|
3063
2962
|
|
|
3064
2963
|
/***/ }),
|
|
3065
2964
|
|
|
3066
|
-
/***/
|
|
2965
|
+
/***/ 7390:
|
|
3067
2966
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3068
2967
|
|
|
3069
2968
|
|
|
3070
2969
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3071
2970
|
const buffer_1 = __nccwpck_require__(4300);
|
|
3072
|
-
const errors_js_1 = __nccwpck_require__(
|
|
2971
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3073
2972
|
const tagInteger = 0x02;
|
|
3074
2973
|
const tagBitStr = 0x03;
|
|
3075
2974
|
const tagOctStr = 0x04;
|
|
@@ -3161,14 +3060,14 @@ exports["default"] = DumbAsn1Encoder;
|
|
|
3161
3060
|
|
|
3162
3061
|
/***/ }),
|
|
3163
3062
|
|
|
3164
|
-
/***/
|
|
3063
|
+
/***/ 7395:
|
|
3165
3064
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3166
3065
|
|
|
3167
3066
|
|
|
3168
3067
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3169
3068
|
exports.decode = exports.encode = exports.encodeBase64 = exports.decodeBase64 = void 0;
|
|
3170
3069
|
const buffer_1 = __nccwpck_require__(4300);
|
|
3171
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
3070
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
3172
3071
|
let encode;
|
|
3173
3072
|
exports.encode = encode;
|
|
3174
3073
|
function normalize(input) {
|
|
@@ -3194,13 +3093,13 @@ exports.decode = decode;
|
|
|
3194
3093
|
|
|
3195
3094
|
/***/ }),
|
|
3196
3095
|
|
|
3197
|
-
/***/
|
|
3096
|
+
/***/ 3680:
|
|
3198
3097
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3199
3098
|
|
|
3200
3099
|
|
|
3201
3100
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3202
3101
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3203
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
3102
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
3204
3103
|
function cbcTag(aad, iv, ciphertext, macSize, macKey, keySize) {
|
|
3205
3104
|
const macData = (0, buffer_utils_js_1.concat)(aad, iv, ciphertext, (0, buffer_utils_js_1.uint64be)(aad.length << 3));
|
|
3206
3105
|
const hmac = (0, crypto_1.createHmac)(`sha${macSize}`, macKey);
|
|
@@ -3212,13 +3111,13 @@ exports["default"] = cbcTag;
|
|
|
3212
3111
|
|
|
3213
3112
|
/***/ }),
|
|
3214
3113
|
|
|
3215
|
-
/***/
|
|
3114
|
+
/***/ 4507:
|
|
3216
3115
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3217
3116
|
|
|
3218
3117
|
|
|
3219
3118
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3220
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3221
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
3119
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3120
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
3222
3121
|
const checkCekLength = (enc, cek) => {
|
|
3223
3122
|
let expected;
|
|
3224
3123
|
switch (enc) {
|
|
@@ -3254,7 +3153,7 @@ exports["default"] = checkCekLength;
|
|
|
3254
3153
|
|
|
3255
3154
|
/***/ }),
|
|
3256
3155
|
|
|
3257
|
-
/***/
|
|
3156
|
+
/***/ 3995:
|
|
3258
3157
|
/***/ ((__unused_webpack_module, exports) => {
|
|
3259
3158
|
|
|
3260
3159
|
|
|
@@ -3313,7 +3212,7 @@ exports["default"] = (key, alg) => {
|
|
|
3313
3212
|
|
|
3314
3213
|
/***/ }),
|
|
3315
3214
|
|
|
3316
|
-
/***/
|
|
3215
|
+
/***/ 7464:
|
|
3317
3216
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3318
3217
|
|
|
3319
3218
|
|
|
@@ -3328,24 +3227,24 @@ exports["default"] = (algorithm) => {
|
|
|
3328
3227
|
|
|
3329
3228
|
/***/ }),
|
|
3330
3229
|
|
|
3331
|
-
/***/
|
|
3230
|
+
/***/ 4888:
|
|
3332
3231
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3333
3232
|
|
|
3334
3233
|
|
|
3335
3234
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3336
3235
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3337
|
-
const check_iv_length_js_1 = __nccwpck_require__(
|
|
3338
|
-
const check_cek_length_js_1 = __nccwpck_require__(
|
|
3339
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
3340
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3341
|
-
const timing_safe_equal_js_1 = __nccwpck_require__(
|
|
3342
|
-
const cbc_tag_js_1 = __nccwpck_require__(
|
|
3343
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
3344
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
3345
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
3346
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
3347
|
-
const ciphers_js_1 = __nccwpck_require__(
|
|
3348
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
3236
|
+
const check_iv_length_js_1 = __nccwpck_require__(2225);
|
|
3237
|
+
const check_cek_length_js_1 = __nccwpck_require__(4507);
|
|
3238
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
3239
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3240
|
+
const timing_safe_equal_js_1 = __nccwpck_require__(1517);
|
|
3241
|
+
const cbc_tag_js_1 = __nccwpck_require__(3680);
|
|
3242
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
3243
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
3244
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
3245
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
3246
|
+
const ciphers_js_1 = __nccwpck_require__(7464);
|
|
3247
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
3349
3248
|
function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
3350
3249
|
const keySize = parseInt(enc.slice(1, 4), 10);
|
|
3351
3250
|
if ((0, is_key_object_js_1.default)(cek)) {
|
|
@@ -3432,7 +3331,7 @@ exports["default"] = decrypt;
|
|
|
3432
3331
|
|
|
3433
3332
|
/***/ }),
|
|
3434
3333
|
|
|
3435
|
-
/***/
|
|
3334
|
+
/***/ 1011:
|
|
3436
3335
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3437
3336
|
|
|
3438
3337
|
|
|
@@ -3444,12 +3343,12 @@ exports["default"] = digest;
|
|
|
3444
3343
|
|
|
3445
3344
|
/***/ }),
|
|
3446
3345
|
|
|
3447
|
-
/***/
|
|
3346
|
+
/***/ 8704:
|
|
3448
3347
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3449
3348
|
|
|
3450
3349
|
|
|
3451
3350
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3452
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3351
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3453
3352
|
function dsaDigest(alg) {
|
|
3454
3353
|
switch (alg) {
|
|
3455
3354
|
case 'PS256':
|
|
@@ -3476,7 +3375,7 @@ exports["default"] = dsaDigest;
|
|
|
3476
3375
|
|
|
3477
3376
|
/***/ }),
|
|
3478
3377
|
|
|
3479
|
-
/***/
|
|
3378
|
+
/***/ 9356:
|
|
3480
3379
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3481
3380
|
|
|
3482
3381
|
|
|
@@ -3484,14 +3383,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
3484
3383
|
exports.ecdhAllowed = exports.generateEpk = exports.deriveKey = void 0;
|
|
3485
3384
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3486
3385
|
const util_1 = __nccwpck_require__(3837);
|
|
3487
|
-
const get_named_curve_js_1 = __nccwpck_require__(
|
|
3488
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
3489
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3490
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
3491
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
3492
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
3493
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
3494
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
3386
|
+
const get_named_curve_js_1 = __nccwpck_require__(6572);
|
|
3387
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
3388
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3389
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
3390
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
3391
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
3392
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
3393
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
3495
3394
|
const generateKeyPair = (0, util_1.promisify)(crypto_1.generateKeyPair);
|
|
3496
3395
|
async function deriveKey(publicKee, privateKee, algorithm, keyLength, apu = new Uint8Array(0), apv = new Uint8Array(0)) {
|
|
3497
3396
|
let publicKey;
|
|
@@ -3553,23 +3452,23 @@ exports.ecdhAllowed = ecdhAllowed;
|
|
|
3553
3452
|
|
|
3554
3453
|
/***/ }),
|
|
3555
3454
|
|
|
3556
|
-
/***/
|
|
3455
|
+
/***/ 277:
|
|
3557
3456
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3558
3457
|
|
|
3559
3458
|
|
|
3560
3459
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3561
3460
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3562
|
-
const check_iv_length_js_1 = __nccwpck_require__(
|
|
3563
|
-
const check_cek_length_js_1 = __nccwpck_require__(
|
|
3564
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
3565
|
-
const cbc_tag_js_1 = __nccwpck_require__(
|
|
3566
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
3567
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
3568
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
3569
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
3570
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3571
|
-
const ciphers_js_1 = __nccwpck_require__(
|
|
3572
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
3461
|
+
const check_iv_length_js_1 = __nccwpck_require__(2225);
|
|
3462
|
+
const check_cek_length_js_1 = __nccwpck_require__(4507);
|
|
3463
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
3464
|
+
const cbc_tag_js_1 = __nccwpck_require__(3680);
|
|
3465
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
3466
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
3467
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
3468
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
3469
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3470
|
+
const ciphers_js_1 = __nccwpck_require__(7464);
|
|
3471
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
3573
3472
|
function cbcEncrypt(enc, plaintext, cek, iv, aad) {
|
|
3574
3473
|
const keySize = parseInt(enc.slice(1, 4), 10);
|
|
3575
3474
|
if ((0, is_key_object_js_1.default)(cek)) {
|
|
@@ -3634,7 +3533,7 @@ exports["default"] = encrypt;
|
|
|
3634
3533
|
|
|
3635
3534
|
/***/ }),
|
|
3636
3535
|
|
|
3637
|
-
/***/
|
|
3536
|
+
/***/ 9884:
|
|
3638
3537
|
/***/ ((__unused_webpack_module, exports) => {
|
|
3639
3538
|
|
|
3640
3539
|
|
|
@@ -3648,7 +3547,7 @@ exports.isCloudflareWorkers = isCloudflareWorkers;
|
|
|
3648
3547
|
|
|
3649
3548
|
/***/ }),
|
|
3650
3549
|
|
|
3651
|
-
/***/
|
|
3550
|
+
/***/ 7409:
|
|
3652
3551
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3653
3552
|
|
|
3654
3553
|
|
|
@@ -3656,8 +3555,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
3656
3555
|
const http = __nccwpck_require__(3685);
|
|
3657
3556
|
const https = __nccwpck_require__(5687);
|
|
3658
3557
|
const events_1 = __nccwpck_require__(2361);
|
|
3659
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3660
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
3558
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3559
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
3661
3560
|
const fetchJwks = async (url, timeout, options) => {
|
|
3662
3561
|
let get;
|
|
3663
3562
|
switch (url.protocol) {
|
|
@@ -3700,7 +3599,7 @@ exports["default"] = fetchJwks;
|
|
|
3700
3599
|
|
|
3701
3600
|
/***/ }),
|
|
3702
3601
|
|
|
3703
|
-
/***/
|
|
3602
|
+
/***/ 3583:
|
|
3704
3603
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3705
3604
|
|
|
3706
3605
|
|
|
@@ -3708,9 +3607,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
3708
3607
|
exports.generateKeyPair = exports.generateSecret = void 0;
|
|
3709
3608
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3710
3609
|
const util_1 = __nccwpck_require__(3837);
|
|
3711
|
-
const random_js_1 = __nccwpck_require__(
|
|
3712
|
-
const check_modulus_length_js_1 = __nccwpck_require__(
|
|
3713
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3610
|
+
const random_js_1 = __nccwpck_require__(2368);
|
|
3611
|
+
const check_modulus_length_js_1 = __nccwpck_require__(3995);
|
|
3612
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3714
3613
|
const generate = (0, util_1.promisify)(crypto_1.generateKeyPair);
|
|
3715
3614
|
async function generateSecret(alg, options) {
|
|
3716
3615
|
let length;
|
|
@@ -3812,7 +3711,7 @@ exports.generateKeyPair = generateKeyPair;
|
|
|
3812
3711
|
|
|
3813
3712
|
/***/ }),
|
|
3814
3713
|
|
|
3815
|
-
/***/
|
|
3714
|
+
/***/ 6572:
|
|
3816
3715
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3817
3716
|
|
|
3818
3717
|
|
|
@@ -3820,11 +3719,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
3820
3719
|
exports.setCurve = exports.weakMap = void 0;
|
|
3821
3720
|
const buffer_1 = __nccwpck_require__(4300);
|
|
3822
3721
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3823
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3824
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
3825
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
3826
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
3827
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
3722
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3723
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
3724
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
3725
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
3726
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
3828
3727
|
const p256 = buffer_1.Buffer.from([42, 134, 72, 206, 61, 3, 1, 7]);
|
|
3829
3728
|
const p384 = buffer_1.Buffer.from([43, 129, 4, 0, 34]);
|
|
3830
3729
|
const p521 = buffer_1.Buffer.from([43, 129, 4, 0, 35]);
|
|
@@ -3914,16 +3813,16 @@ exports["default"] = getNamedCurve;
|
|
|
3914
3813
|
|
|
3915
3814
|
/***/ }),
|
|
3916
3815
|
|
|
3917
|
-
/***/
|
|
3816
|
+
/***/ 2450:
|
|
3918
3817
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3919
3818
|
|
|
3920
3819
|
|
|
3921
3820
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3922
3821
|
const crypto_1 = __nccwpck_require__(6113);
|
|
3923
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
3924
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
3925
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
3926
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
3822
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
3823
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
3824
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
3825
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
3927
3826
|
function getSignVerifyKey(alg, key, usage) {
|
|
3928
3827
|
if (key instanceof Uint8Array) {
|
|
3929
3828
|
if (!alg.startsWith('HS')) {
|
|
@@ -3945,12 +3844,12 @@ exports["default"] = getSignVerifyKey;
|
|
|
3945
3844
|
|
|
3946
3845
|
/***/ }),
|
|
3947
3846
|
|
|
3948
|
-
/***/
|
|
3847
|
+
/***/ 1273:
|
|
3949
3848
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3950
3849
|
|
|
3951
3850
|
|
|
3952
3851
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3953
|
-
const errors_js_1 = __nccwpck_require__(
|
|
3852
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3954
3853
|
function hmacDigest(alg) {
|
|
3955
3854
|
switch (alg) {
|
|
3956
3855
|
case 'HS256':
|
|
@@ -3968,14 +3867,14 @@ exports["default"] = hmacDigest;
|
|
|
3968
3867
|
|
|
3969
3868
|
/***/ }),
|
|
3970
3869
|
|
|
3971
|
-
/***/
|
|
3870
|
+
/***/ 4871:
|
|
3972
3871
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3973
3872
|
|
|
3974
3873
|
|
|
3975
3874
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3976
3875
|
exports.types = void 0;
|
|
3977
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
3978
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
3876
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
3877
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
3979
3878
|
exports["default"] = (key) => (0, is_key_object_js_1.default)(key) || (0, webcrypto_js_1.isCryptoKey)(key);
|
|
3980
3879
|
const types = ['KeyObject'];
|
|
3981
3880
|
exports.types = types;
|
|
@@ -3986,7 +3885,7 @@ if (parseInt(process.versions.node) >= 16) {
|
|
|
3986
3885
|
|
|
3987
3886
|
/***/ }),
|
|
3988
3887
|
|
|
3989
|
-
/***/
|
|
3888
|
+
/***/ 1093:
|
|
3990
3889
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3991
3890
|
|
|
3992
3891
|
|
|
@@ -4000,18 +3899,18 @@ exports["default"] = util.types.isKeyObject
|
|
|
4000
3899
|
|
|
4001
3900
|
/***/ }),
|
|
4002
3901
|
|
|
4003
|
-
/***/
|
|
3902
|
+
/***/ 3810:
|
|
4004
3903
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4005
3904
|
|
|
4006
3905
|
|
|
4007
3906
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4008
3907
|
const buffer_1 = __nccwpck_require__(4300);
|
|
4009
3908
|
const crypto_1 = __nccwpck_require__(6113);
|
|
4010
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
4011
|
-
const errors_js_1 = __nccwpck_require__(
|
|
4012
|
-
const get_named_curve_js_1 = __nccwpck_require__(
|
|
4013
|
-
const check_modulus_length_js_1 = __nccwpck_require__(
|
|
4014
|
-
const asn1_sequence_encoder_js_1 = __nccwpck_require__(
|
|
3909
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
3910
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
3911
|
+
const get_named_curve_js_1 = __nccwpck_require__(6572);
|
|
3912
|
+
const check_modulus_length_js_1 = __nccwpck_require__(3995);
|
|
3913
|
+
const asn1_sequence_encoder_js_1 = __nccwpck_require__(7390);
|
|
4015
3914
|
const [major, minor] = process.version
|
|
4016
3915
|
.slice(1)
|
|
4017
3916
|
.split('.')
|
|
@@ -4129,20 +4028,20 @@ exports["default"] = parse;
|
|
|
4129
4028
|
|
|
4130
4029
|
/***/ }),
|
|
4131
4030
|
|
|
4132
|
-
/***/
|
|
4031
|
+
/***/ 4135:
|
|
4133
4032
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4134
4033
|
|
|
4135
4034
|
|
|
4136
4035
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4137
4036
|
const crypto_1 = __nccwpck_require__(6113);
|
|
4138
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
4139
|
-
const asn1_sequence_decoder_js_1 = __nccwpck_require__(
|
|
4140
|
-
const errors_js_1 = __nccwpck_require__(
|
|
4141
|
-
const get_named_curve_js_1 = __nccwpck_require__(
|
|
4142
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
4143
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
4144
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
4145
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
4037
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
4038
|
+
const asn1_sequence_decoder_js_1 = __nccwpck_require__(5554);
|
|
4039
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
4040
|
+
const get_named_curve_js_1 = __nccwpck_require__(6572);
|
|
4041
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
4042
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
4043
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
4044
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
4146
4045
|
const [major, minor] = process.version
|
|
4147
4046
|
.slice(1)
|
|
4148
4047
|
.split('.')
|
|
@@ -4300,15 +4199,15 @@ exports["default"] = keyToJWK;
|
|
|
4300
4199
|
|
|
4301
4200
|
/***/ }),
|
|
4302
4201
|
|
|
4303
|
-
/***/
|
|
4202
|
+
/***/ 9072:
|
|
4304
4203
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4305
4204
|
|
|
4306
4205
|
|
|
4307
4206
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4308
4207
|
const crypto_1 = __nccwpck_require__(6113);
|
|
4309
|
-
const get_named_curve_js_1 = __nccwpck_require__(
|
|
4310
|
-
const errors_js_1 = __nccwpck_require__(
|
|
4311
|
-
const check_modulus_length_js_1 = __nccwpck_require__(
|
|
4208
|
+
const get_named_curve_js_1 = __nccwpck_require__(6572);
|
|
4209
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
4210
|
+
const check_modulus_length_js_1 = __nccwpck_require__(3995);
|
|
4312
4211
|
const [major, minor] = process.version
|
|
4313
4212
|
.slice(1)
|
|
4314
4213
|
.split('.')
|
|
@@ -4390,7 +4289,7 @@ exports["default"] = keyForCrypto;
|
|
|
4390
4289
|
|
|
4391
4290
|
/***/ }),
|
|
4392
4291
|
|
|
4393
|
-
/***/
|
|
4292
|
+
/***/ 9295:
|
|
4394
4293
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4395
4294
|
|
|
4396
4295
|
|
|
@@ -4398,16 +4297,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
4398
4297
|
exports.decrypt = exports.encrypt = void 0;
|
|
4399
4298
|
const util_1 = __nccwpck_require__(3837);
|
|
4400
4299
|
const crypto_1 = __nccwpck_require__(6113);
|
|
4401
|
-
const random_js_1 = __nccwpck_require__(
|
|
4402
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
4403
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
4404
|
-
const aeskw_js_1 = __nccwpck_require__(
|
|
4405
|
-
const check_p2s_js_1 = __nccwpck_require__(
|
|
4406
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
4407
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
4408
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
4409
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
4410
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
4300
|
+
const random_js_1 = __nccwpck_require__(2368);
|
|
4301
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
4302
|
+
const base64url_js_1 = __nccwpck_require__(7395);
|
|
4303
|
+
const aeskw_js_1 = __nccwpck_require__(4357);
|
|
4304
|
+
const check_p2s_js_1 = __nccwpck_require__(5025);
|
|
4305
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
4306
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
4307
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
4308
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
4309
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
4411
4310
|
const pbkdf2 = (0, util_1.promisify)(crypto_1.pbkdf2);
|
|
4412
4311
|
function getPassword(key, alg) {
|
|
4413
4312
|
if ((0, is_key_object_js_1.default)(key)) {
|
|
@@ -4445,7 +4344,7 @@ exports.decrypt = decrypt;
|
|
|
4445
4344
|
|
|
4446
4345
|
/***/ }),
|
|
4447
4346
|
|
|
4448
|
-
/***/
|
|
4347
|
+
/***/ 2368:
|
|
4449
4348
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4450
4349
|
|
|
4451
4350
|
|
|
@@ -4457,19 +4356,19 @@ Object.defineProperty(exports, "default", ({ enumerable: true, get: function ()
|
|
|
4457
4356
|
|
|
4458
4357
|
/***/ }),
|
|
4459
4358
|
|
|
4460
|
-
/***/
|
|
4359
|
+
/***/ 211:
|
|
4461
4360
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4462
4361
|
|
|
4463
4362
|
|
|
4464
4363
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4465
4364
|
exports.decrypt = exports.encrypt = void 0;
|
|
4466
4365
|
const crypto_1 = __nccwpck_require__(6113);
|
|
4467
|
-
const check_modulus_length_js_1 = __nccwpck_require__(
|
|
4468
|
-
const webcrypto_js_1 = __nccwpck_require__(
|
|
4469
|
-
const crypto_key_js_1 = __nccwpck_require__(
|
|
4470
|
-
const is_key_object_js_1 = __nccwpck_require__(
|
|
4471
|
-
const invalid_key_input_js_1 = __nccwpck_require__(
|
|
4472
|
-
const is_key_like_js_1 = __nccwpck_require__(
|
|
4366
|
+
const check_modulus_length_js_1 = __nccwpck_require__(3995);
|
|
4367
|
+
const webcrypto_js_1 = __nccwpck_require__(2259);
|
|
4368
|
+
const crypto_key_js_1 = __nccwpck_require__(5985);
|
|
4369
|
+
const is_key_object_js_1 = __nccwpck_require__(1093);
|
|
4370
|
+
const invalid_key_input_js_1 = __nccwpck_require__(5547);
|
|
4371
|
+
const is_key_like_js_1 = __nccwpck_require__(4871);
|
|
4473
4372
|
const checkKey = (key, alg) => {
|
|
4474
4373
|
if (key.asymmetricKeyType !== 'rsa') {
|
|
4475
4374
|
throw new TypeError('Invalid key for this operation, its asymmetricKeyType must be rsa');
|
|
@@ -4533,17 +4432,17 @@ exports.decrypt = decrypt;
|
|
|
4533
4432
|
|
|
4534
4433
|
/***/ }),
|
|
4535
4434
|
|
|
4536
|
-
/***/
|
|
4435
|
+
/***/ 6193:
|
|
4537
4436
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4538
4437
|
|
|
4539
4438
|
|
|
4540
4439
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4541
4440
|
const crypto = __nccwpck_require__(6113);
|
|
4542
4441
|
const util_1 = __nccwpck_require__(3837);
|
|
4543
|
-
const dsa_digest_js_1 = __nccwpck_require__(
|
|
4544
|
-
const hmac_digest_js_1 = __nccwpck_require__(
|
|
4545
|
-
const node_key_js_1 = __nccwpck_require__(
|
|
4546
|
-
const get_sign_verify_key_js_1 = __nccwpck_require__(
|
|
4442
|
+
const dsa_digest_js_1 = __nccwpck_require__(8704);
|
|
4443
|
+
const hmac_digest_js_1 = __nccwpck_require__(1273);
|
|
4444
|
+
const node_key_js_1 = __nccwpck_require__(9072);
|
|
4445
|
+
const get_sign_verify_key_js_1 = __nccwpck_require__(2450);
|
|
4547
4446
|
let oneShotSign;
|
|
4548
4447
|
if (crypto.sign.length > 3) {
|
|
4549
4448
|
oneShotSign = (0, util_1.promisify)(crypto.sign);
|
|
@@ -4565,7 +4464,7 @@ exports["default"] = sign;
|
|
|
4565
4464
|
|
|
4566
4465
|
/***/ }),
|
|
4567
4466
|
|
|
4568
|
-
/***/
|
|
4467
|
+
/***/ 1517:
|
|
4569
4468
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4570
4469
|
|
|
4571
4470
|
|
|
@@ -4577,17 +4476,17 @@ exports["default"] = timingSafeEqual;
|
|
|
4577
4476
|
|
|
4578
4477
|
/***/ }),
|
|
4579
4478
|
|
|
4580
|
-
/***/
|
|
4479
|
+
/***/ 4476:
|
|
4581
4480
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4582
4481
|
|
|
4583
4482
|
|
|
4584
4483
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4585
4484
|
const crypto = __nccwpck_require__(6113);
|
|
4586
4485
|
const util_1 = __nccwpck_require__(3837);
|
|
4587
|
-
const dsa_digest_js_1 = __nccwpck_require__(
|
|
4588
|
-
const node_key_js_1 = __nccwpck_require__(
|
|
4589
|
-
const sign_js_1 = __nccwpck_require__(
|
|
4590
|
-
const get_sign_verify_key_js_1 = __nccwpck_require__(
|
|
4486
|
+
const dsa_digest_js_1 = __nccwpck_require__(8704);
|
|
4487
|
+
const node_key_js_1 = __nccwpck_require__(9072);
|
|
4488
|
+
const sign_js_1 = __nccwpck_require__(6193);
|
|
4489
|
+
const get_sign_verify_key_js_1 = __nccwpck_require__(2450);
|
|
4591
4490
|
const [major, minor] = process.version
|
|
4592
4491
|
.slice(1)
|
|
4593
4492
|
.split('.')
|
|
@@ -4626,7 +4525,7 @@ exports["default"] = verify;
|
|
|
4626
4525
|
|
|
4627
4526
|
/***/ }),
|
|
4628
4527
|
|
|
4629
|
-
/***/
|
|
4528
|
+
/***/ 2259:
|
|
4630
4529
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4631
4530
|
|
|
4632
4531
|
|
|
@@ -4644,7 +4543,7 @@ exports.isCryptoKey = util.types.isCryptoKey
|
|
|
4644
4543
|
|
|
4645
4544
|
/***/ }),
|
|
4646
4545
|
|
|
4647
|
-
/***/
|
|
4546
|
+
/***/ 4486:
|
|
4648
4547
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4649
4548
|
|
|
4650
4549
|
|
|
@@ -4662,29 +4561,29 @@ exports.deflate = deflate;
|
|
|
4662
4561
|
|
|
4663
4562
|
/***/ }),
|
|
4664
4563
|
|
|
4665
|
-
/***/
|
|
4564
|
+
/***/ 2443:
|
|
4666
4565
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4667
4566
|
|
|
4668
4567
|
|
|
4669
4568
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4670
4569
|
exports.decode = exports.encode = void 0;
|
|
4671
|
-
const base64url = __nccwpck_require__(
|
|
4570
|
+
const base64url = __nccwpck_require__(7395);
|
|
4672
4571
|
exports.encode = base64url.encode;
|
|
4673
4572
|
exports.decode = base64url.decode;
|
|
4674
4573
|
|
|
4675
4574
|
|
|
4676
4575
|
/***/ }),
|
|
4677
4576
|
|
|
4678
|
-
/***/
|
|
4577
|
+
/***/ 2467:
|
|
4679
4578
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4680
4579
|
|
|
4681
4580
|
|
|
4682
4581
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4683
4582
|
exports.decodeJwt = void 0;
|
|
4684
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
4685
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
4686
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
4687
|
-
const errors_js_1 = __nccwpck_require__(
|
|
4583
|
+
const base64url_js_1 = __nccwpck_require__(2443);
|
|
4584
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
4585
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
4586
|
+
const errors_js_1 = __nccwpck_require__(2745);
|
|
4688
4587
|
function decodeJwt(jwt) {
|
|
4689
4588
|
if (typeof jwt !== 'string')
|
|
4690
4589
|
throw new errors_js_1.JWTInvalid('JWTs must use Compact JWS serialization, JWT must be a string');
|
|
@@ -4718,15 +4617,15 @@ exports.decodeJwt = decodeJwt;
|
|
|
4718
4617
|
|
|
4719
4618
|
/***/ }),
|
|
4720
4619
|
|
|
4721
|
-
/***/
|
|
4620
|
+
/***/ 1533:
|
|
4722
4621
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4723
4622
|
|
|
4724
4623
|
|
|
4725
4624
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4726
4625
|
exports.decodeProtectedHeader = void 0;
|
|
4727
|
-
const base64url_js_1 = __nccwpck_require__(
|
|
4728
|
-
const buffer_utils_js_1 = __nccwpck_require__(
|
|
4729
|
-
const is_object_js_1 = __nccwpck_require__(
|
|
4626
|
+
const base64url_js_1 = __nccwpck_require__(2443);
|
|
4627
|
+
const buffer_utils_js_1 = __nccwpck_require__(614);
|
|
4628
|
+
const is_object_js_1 = __nccwpck_require__(6643);
|
|
4730
4629
|
function decodeProtectedHeader(token) {
|
|
4731
4630
|
let protectedB64u;
|
|
4732
4631
|
if (typeof token === 'string') {
|
|
@@ -4763,7 +4662,7 @@ exports.decodeProtectedHeader = decodeProtectedHeader;
|
|
|
4763
4662
|
|
|
4764
4663
|
/***/ }),
|
|
4765
4664
|
|
|
4766
|
-
/***/
|
|
4665
|
+
/***/ 2745:
|
|
4767
4666
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4768
4667
|
|
|
4769
4668
|
|
|
@@ -4935,14 +4834,13 @@ exports.JWSSignatureVerificationFailed = JWSSignatureVerificationFailed;
|
|
|
4935
4834
|
|
|
4936
4835
|
/***/ }),
|
|
4937
4836
|
|
|
4938
|
-
/***/
|
|
4837
|
+
/***/ 3933:
|
|
4939
4838
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4940
4839
|
|
|
4941
4840
|
|
|
4942
4841
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4943
|
-
exports.
|
|
4944
|
-
const
|
|
4945
|
-
const util_1 = __nccwpck_require__(809);
|
|
4842
|
+
exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
|
|
4843
|
+
const util_1 = __nccwpck_require__(9973);
|
|
4946
4844
|
exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
4947
4845
|
"invalid_type",
|
|
4948
4846
|
"invalid_literal",
|
|
@@ -4959,6 +4857,7 @@ exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
|
4959
4857
|
"too_big",
|
|
4960
4858
|
"invalid_intersection_types",
|
|
4961
4859
|
"not_multiple_of",
|
|
4860
|
+
"not_finite",
|
|
4962
4861
|
]);
|
|
4963
4862
|
const quotelessJson = (obj) => {
|
|
4964
4863
|
const json = JSON.stringify(obj, null, 2);
|
|
@@ -5042,7 +4941,7 @@ class ZodError extends Error {
|
|
|
5042
4941
|
return this.message;
|
|
5043
4942
|
}
|
|
5044
4943
|
get message() {
|
|
5045
|
-
return JSON.stringify(this.issues,
|
|
4944
|
+
return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
|
|
5046
4945
|
}
|
|
5047
4946
|
get isEmpty() {
|
|
5048
4947
|
return this.issues.length === 0;
|
|
@@ -5070,101 +4969,22 @@ ZodError.create = (issues) => {
|
|
|
5070
4969
|
const error = new ZodError(issues);
|
|
5071
4970
|
return error;
|
|
5072
4971
|
};
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
break;
|
|
5084
|
-
case exports.ZodIssueCode.invalid_literal:
|
|
5085
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, parseUtil_1.jsonStringifyReplacer)}`;
|
|
5086
|
-
break;
|
|
5087
|
-
case exports.ZodIssueCode.unrecognized_keys:
|
|
5088
|
-
message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
|
|
5089
|
-
break;
|
|
5090
|
-
case exports.ZodIssueCode.invalid_union:
|
|
5091
|
-
message = `Invalid input`;
|
|
5092
|
-
break;
|
|
5093
|
-
case exports.ZodIssueCode.invalid_union_discriminator:
|
|
5094
|
-
message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
|
|
5095
|
-
break;
|
|
5096
|
-
case exports.ZodIssueCode.invalid_enum_value:
|
|
5097
|
-
message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
5098
|
-
break;
|
|
5099
|
-
case exports.ZodIssueCode.invalid_arguments:
|
|
5100
|
-
message = `Invalid function arguments`;
|
|
5101
|
-
break;
|
|
5102
|
-
case exports.ZodIssueCode.invalid_return_type:
|
|
5103
|
-
message = `Invalid function return type`;
|
|
5104
|
-
break;
|
|
5105
|
-
case exports.ZodIssueCode.invalid_date:
|
|
5106
|
-
message = `Invalid date`;
|
|
5107
|
-
break;
|
|
5108
|
-
case exports.ZodIssueCode.invalid_string:
|
|
5109
|
-
if (typeof issue.validation === "object") {
|
|
5110
|
-
if ("startsWith" in issue.validation) {
|
|
5111
|
-
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
5112
|
-
}
|
|
5113
|
-
else if ("endsWith" in issue.validation) {
|
|
5114
|
-
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
5115
|
-
}
|
|
5116
|
-
else {
|
|
5117
|
-
util_1.util.assertNever(issue.validation);
|
|
5118
|
-
}
|
|
5119
|
-
}
|
|
5120
|
-
else if (issue.validation !== "regex") {
|
|
5121
|
-
message = `Invalid ${issue.validation}`;
|
|
5122
|
-
}
|
|
5123
|
-
else {
|
|
5124
|
-
message = "Invalid";
|
|
5125
|
-
}
|
|
5126
|
-
break;
|
|
5127
|
-
case exports.ZodIssueCode.too_small:
|
|
5128
|
-
if (issue.type === "array")
|
|
5129
|
-
message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
5130
|
-
else if (issue.type === "string")
|
|
5131
|
-
message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
5132
|
-
else if (issue.type === "number")
|
|
5133
|
-
message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
|
|
5134
|
-
else if (issue.type === "date")
|
|
5135
|
-
message = `Date must be greater than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.minimum)}`;
|
|
5136
|
-
else
|
|
5137
|
-
message = "Invalid input";
|
|
5138
|
-
break;
|
|
5139
|
-
case exports.ZodIssueCode.too_big:
|
|
5140
|
-
if (issue.type === "array")
|
|
5141
|
-
message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
5142
|
-
else if (issue.type === "string")
|
|
5143
|
-
message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
5144
|
-
else if (issue.type === "number")
|
|
5145
|
-
message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
|
|
5146
|
-
else if (issue.type === "date")
|
|
5147
|
-
message = `Date must be smaller than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.maximum)}`;
|
|
5148
|
-
else
|
|
5149
|
-
message = "Invalid input";
|
|
5150
|
-
break;
|
|
5151
|
-
case exports.ZodIssueCode.custom:
|
|
5152
|
-
message = `Invalid input`;
|
|
5153
|
-
break;
|
|
5154
|
-
case exports.ZodIssueCode.invalid_intersection_types:
|
|
5155
|
-
message = `Intersection results could not be merged`;
|
|
5156
|
-
break;
|
|
5157
|
-
case exports.ZodIssueCode.not_multiple_of:
|
|
5158
|
-
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
5159
|
-
break;
|
|
5160
|
-
default:
|
|
5161
|
-
message = _ctx.defaultError;
|
|
5162
|
-
util_1.util.assertNever(issue);
|
|
5163
|
-
}
|
|
5164
|
-
return { message };
|
|
4972
|
+
|
|
4973
|
+
|
|
4974
|
+
/***/ }),
|
|
4975
|
+
|
|
4976
|
+
/***/ 5391:
|
|
4977
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4978
|
+
|
|
4979
|
+
|
|
4980
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4981
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5165
4982
|
};
|
|
5166
|
-
exports
|
|
5167
|
-
|
|
4983
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4984
|
+
exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
|
|
4985
|
+
const en_1 = __importDefault(__nccwpck_require__(184));
|
|
4986
|
+
exports.defaultErrorMap = en_1.default;
|
|
4987
|
+
let overrideErrorMap = en_1.default;
|
|
5168
4988
|
function setErrorMap(map) {
|
|
5169
4989
|
overrideErrorMap = map;
|
|
5170
4990
|
}
|
|
@@ -5177,7 +4997,7 @@ exports.getErrorMap = getErrorMap;
|
|
|
5177
4997
|
|
|
5178
4998
|
/***/ }),
|
|
5179
4999
|
|
|
5180
|
-
/***/
|
|
5000
|
+
/***/ 7365:
|
|
5181
5001
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
5182
5002
|
|
|
5183
5003
|
|
|
@@ -5192,19 +5012,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
5192
5012
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
5193
5013
|
};
|
|
5194
5014
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5195
|
-
|
|
5196
|
-
__exportStar(__nccwpck_require__(
|
|
5197
|
-
__exportStar(__nccwpck_require__(
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
__exportStar(__nccwpck_require__(54), exports);
|
|
5202
|
-
__exportStar(__nccwpck_require__(6597), exports);
|
|
5015
|
+
__exportStar(__nccwpck_require__(5391), exports);
|
|
5016
|
+
__exportStar(__nccwpck_require__(3636), exports);
|
|
5017
|
+
__exportStar(__nccwpck_require__(9599), exports);
|
|
5018
|
+
__exportStar(__nccwpck_require__(9973), exports);
|
|
5019
|
+
__exportStar(__nccwpck_require__(7889), exports);
|
|
5020
|
+
__exportStar(__nccwpck_require__(3933), exports);
|
|
5203
5021
|
|
|
5204
5022
|
|
|
5205
5023
|
/***/ }),
|
|
5206
5024
|
|
|
5207
|
-
/***/
|
|
5025
|
+
/***/ 9849:
|
|
5208
5026
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5209
5027
|
|
|
5210
5028
|
|
|
@@ -5219,13 +5037,17 @@ var errorUtil;
|
|
|
5219
5037
|
|
|
5220
5038
|
/***/ }),
|
|
5221
5039
|
|
|
5222
|
-
/***/
|
|
5223
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__)
|
|
5040
|
+
/***/ 3636:
|
|
5041
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
5224
5042
|
|
|
5225
5043
|
|
|
5044
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5045
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5046
|
+
};
|
|
5226
5047
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5227
|
-
exports.
|
|
5228
|
-
const
|
|
5048
|
+
exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
|
|
5049
|
+
const errors_1 = __nccwpck_require__(5391);
|
|
5050
|
+
const en_1 = __importDefault(__nccwpck_require__(184));
|
|
5229
5051
|
const makeIssue = (params) => {
|
|
5230
5052
|
const { data, path, errorMaps, issueData } = params;
|
|
5231
5053
|
const fullPath = [...path, ...(issueData.path || [])];
|
|
@@ -5250,15 +5072,15 @@ const makeIssue = (params) => {
|
|
|
5250
5072
|
exports.makeIssue = makeIssue;
|
|
5251
5073
|
exports.EMPTY_PATH = [];
|
|
5252
5074
|
function addIssueToContext(ctx, issueData) {
|
|
5253
|
-
const issue = exports.makeIssue({
|
|
5075
|
+
const issue = (0, exports.makeIssue)({
|
|
5254
5076
|
issueData: issueData,
|
|
5255
5077
|
data: ctx.data,
|
|
5256
5078
|
path: ctx.path,
|
|
5257
5079
|
errorMaps: [
|
|
5258
5080
|
ctx.common.contextualErrorMap,
|
|
5259
5081
|
ctx.schemaErrorMap,
|
|
5260
|
-
|
|
5261
|
-
|
|
5082
|
+
(0, errors_1.getErrorMap)(),
|
|
5083
|
+
en_1.default, // then global default map
|
|
5262
5084
|
].filter((x) => !!x),
|
|
5263
5085
|
});
|
|
5264
5086
|
ctx.common.issues.push(issue);
|
|
@@ -5332,18 +5154,11 @@ const isValid = (x) => x.status === "valid";
|
|
|
5332
5154
|
exports.isValid = isValid;
|
|
5333
5155
|
const isAsync = (x) => typeof Promise !== undefined && x instanceof Promise;
|
|
5334
5156
|
exports.isAsync = isAsync;
|
|
5335
|
-
const jsonStringifyReplacer = (_, value) => {
|
|
5336
|
-
if (typeof value === "bigint") {
|
|
5337
|
-
return value.toString();
|
|
5338
|
-
}
|
|
5339
|
-
return value;
|
|
5340
|
-
};
|
|
5341
|
-
exports.jsonStringifyReplacer = jsonStringifyReplacer;
|
|
5342
5157
|
|
|
5343
5158
|
|
|
5344
5159
|
/***/ }),
|
|
5345
5160
|
|
|
5346
|
-
/***/
|
|
5161
|
+
/***/ 9599:
|
|
5347
5162
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5348
5163
|
|
|
5349
5164
|
|
|
@@ -5352,7 +5167,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5352
5167
|
|
|
5353
5168
|
/***/ }),
|
|
5354
5169
|
|
|
5355
|
-
/***/
|
|
5170
|
+
/***/ 9973:
|
|
5356
5171
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5357
5172
|
|
|
5358
5173
|
|
|
@@ -5414,6 +5229,12 @@ var util;
|
|
|
5414
5229
|
.join(separator);
|
|
5415
5230
|
}
|
|
5416
5231
|
util.joinValues = joinValues;
|
|
5232
|
+
util.jsonStringifyReplacer = (_, value) => {
|
|
5233
|
+
if (typeof value === "bigint") {
|
|
5234
|
+
return value.toString();
|
|
5235
|
+
}
|
|
5236
|
+
return value;
|
|
5237
|
+
};
|
|
5417
5238
|
})(util = exports.util || (exports.util = {}));
|
|
5418
5239
|
exports.ZodParsedType = util.arrayToEnum([
|
|
5419
5240
|
"string",
|
|
@@ -5452,6 +5273,8 @@ const getParsedType = (data) => {
|
|
|
5452
5273
|
return exports.ZodParsedType.function;
|
|
5453
5274
|
case "bigint":
|
|
5454
5275
|
return exports.ZodParsedType.bigint;
|
|
5276
|
+
case "symbol":
|
|
5277
|
+
return exports.ZodParsedType.symbol;
|
|
5455
5278
|
case "object":
|
|
5456
5279
|
if (Array.isArray(data)) {
|
|
5457
5280
|
return exports.ZodParsedType.array;
|
|
@@ -5484,7 +5307,7 @@ exports.getParsedType = getParsedType;
|
|
|
5484
5307
|
|
|
5485
5308
|
/***/ }),
|
|
5486
5309
|
|
|
5487
|
-
/***/
|
|
5310
|
+
/***/ 6319:
|
|
5488
5311
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
5489
5312
|
|
|
5490
5313
|
|
|
@@ -5512,25 +5335,150 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
5512
5335
|
};
|
|
5513
5336
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5514
5337
|
exports.z = void 0;
|
|
5515
|
-
const mod = __importStar(__nccwpck_require__(
|
|
5338
|
+
const mod = __importStar(__nccwpck_require__(7365));
|
|
5516
5339
|
exports.z = mod;
|
|
5517
|
-
__exportStar(__nccwpck_require__(
|
|
5340
|
+
__exportStar(__nccwpck_require__(7365), exports);
|
|
5518
5341
|
exports["default"] = mod;
|
|
5519
5342
|
|
|
5520
5343
|
|
|
5521
5344
|
/***/ }),
|
|
5522
5345
|
|
|
5523
|
-
/***/
|
|
5346
|
+
/***/ 184:
|
|
5347
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5348
|
+
|
|
5349
|
+
|
|
5350
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5351
|
+
const util_1 = __nccwpck_require__(9973);
|
|
5352
|
+
const ZodError_1 = __nccwpck_require__(3933);
|
|
5353
|
+
const errorMap = (issue, _ctx) => {
|
|
5354
|
+
let message;
|
|
5355
|
+
switch (issue.code) {
|
|
5356
|
+
case ZodError_1.ZodIssueCode.invalid_type:
|
|
5357
|
+
if (issue.received === util_1.ZodParsedType.undefined) {
|
|
5358
|
+
message = "Required";
|
|
5359
|
+
}
|
|
5360
|
+
else {
|
|
5361
|
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
5362
|
+
}
|
|
5363
|
+
break;
|
|
5364
|
+
case ZodError_1.ZodIssueCode.invalid_literal:
|
|
5365
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;
|
|
5366
|
+
break;
|
|
5367
|
+
case ZodError_1.ZodIssueCode.unrecognized_keys:
|
|
5368
|
+
message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
|
|
5369
|
+
break;
|
|
5370
|
+
case ZodError_1.ZodIssueCode.invalid_union:
|
|
5371
|
+
message = `Invalid input`;
|
|
5372
|
+
break;
|
|
5373
|
+
case ZodError_1.ZodIssueCode.invalid_union_discriminator:
|
|
5374
|
+
message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
|
|
5375
|
+
break;
|
|
5376
|
+
case ZodError_1.ZodIssueCode.invalid_enum_value:
|
|
5377
|
+
message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
5378
|
+
break;
|
|
5379
|
+
case ZodError_1.ZodIssueCode.invalid_arguments:
|
|
5380
|
+
message = `Invalid function arguments`;
|
|
5381
|
+
break;
|
|
5382
|
+
case ZodError_1.ZodIssueCode.invalid_return_type:
|
|
5383
|
+
message = `Invalid function return type`;
|
|
5384
|
+
break;
|
|
5385
|
+
case ZodError_1.ZodIssueCode.invalid_date:
|
|
5386
|
+
message = `Invalid date`;
|
|
5387
|
+
break;
|
|
5388
|
+
case ZodError_1.ZodIssueCode.invalid_string:
|
|
5389
|
+
if (typeof issue.validation === "object") {
|
|
5390
|
+
if ("startsWith" in issue.validation) {
|
|
5391
|
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
5392
|
+
}
|
|
5393
|
+
else if ("endsWith" in issue.validation) {
|
|
5394
|
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
5395
|
+
}
|
|
5396
|
+
else {
|
|
5397
|
+
util_1.util.assertNever(issue.validation);
|
|
5398
|
+
}
|
|
5399
|
+
}
|
|
5400
|
+
else if (issue.validation !== "regex") {
|
|
5401
|
+
message = `Invalid ${issue.validation}`;
|
|
5402
|
+
}
|
|
5403
|
+
else {
|
|
5404
|
+
message = "Invalid";
|
|
5405
|
+
}
|
|
5406
|
+
break;
|
|
5407
|
+
case ZodError_1.ZodIssueCode.too_small:
|
|
5408
|
+
if (issue.type === "array")
|
|
5409
|
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
5410
|
+
else if (issue.type === "string")
|
|
5411
|
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
5412
|
+
else if (issue.type === "number")
|
|
5413
|
+
message = `Number must be ${issue.exact
|
|
5414
|
+
? `exactly equal to `
|
|
5415
|
+
: issue.inclusive
|
|
5416
|
+
? `greater than or equal to `
|
|
5417
|
+
: `greater than `}${issue.minimum}`;
|
|
5418
|
+
else if (issue.type === "date")
|
|
5419
|
+
message = `Date must be ${issue.exact
|
|
5420
|
+
? `exactly equal to `
|
|
5421
|
+
: issue.inclusive
|
|
5422
|
+
? `greater than or equal to `
|
|
5423
|
+
: `greater than `}${new Date(issue.minimum)}`;
|
|
5424
|
+
else
|
|
5425
|
+
message = "Invalid input";
|
|
5426
|
+
break;
|
|
5427
|
+
case ZodError_1.ZodIssueCode.too_big:
|
|
5428
|
+
if (issue.type === "array")
|
|
5429
|
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
5430
|
+
else if (issue.type === "string")
|
|
5431
|
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
5432
|
+
else if (issue.type === "number")
|
|
5433
|
+
message = `Number must be ${issue.exact
|
|
5434
|
+
? `exactly`
|
|
5435
|
+
: issue.inclusive
|
|
5436
|
+
? `less than or equal to`
|
|
5437
|
+
: `less than`} ${issue.maximum}`;
|
|
5438
|
+
else if (issue.type === "date")
|
|
5439
|
+
message = `Date must be ${issue.exact
|
|
5440
|
+
? `exactly`
|
|
5441
|
+
: issue.inclusive
|
|
5442
|
+
? `smaller than or equal to`
|
|
5443
|
+
: `smaller than`} ${new Date(issue.maximum)}`;
|
|
5444
|
+
else
|
|
5445
|
+
message = "Invalid input";
|
|
5446
|
+
break;
|
|
5447
|
+
case ZodError_1.ZodIssueCode.custom:
|
|
5448
|
+
message = `Invalid input`;
|
|
5449
|
+
break;
|
|
5450
|
+
case ZodError_1.ZodIssueCode.invalid_intersection_types:
|
|
5451
|
+
message = `Intersection results could not be merged`;
|
|
5452
|
+
break;
|
|
5453
|
+
case ZodError_1.ZodIssueCode.not_multiple_of:
|
|
5454
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
5455
|
+
break;
|
|
5456
|
+
case ZodError_1.ZodIssueCode.not_finite:
|
|
5457
|
+
message = "Number must be finite";
|
|
5458
|
+
break;
|
|
5459
|
+
default:
|
|
5460
|
+
message = _ctx.defaultError;
|
|
5461
|
+
util_1.util.assertNever(issue);
|
|
5462
|
+
}
|
|
5463
|
+
return { message };
|
|
5464
|
+
};
|
|
5465
|
+
exports["default"] = errorMap;
|
|
5466
|
+
|
|
5467
|
+
|
|
5468
|
+
/***/ }),
|
|
5469
|
+
|
|
5470
|
+
/***/ 7889:
|
|
5524
5471
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5525
5472
|
|
|
5526
5473
|
|
|
5527
5474
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5528
|
-
exports
|
|
5529
|
-
exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = void 0;
|
|
5530
|
-
const
|
|
5531
|
-
const
|
|
5532
|
-
const
|
|
5533
|
-
const
|
|
5475
|
+
exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
|
|
5476
|
+
exports.NEVER = exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = void 0;
|
|
5477
|
+
const errors_1 = __nccwpck_require__(5391);
|
|
5478
|
+
const errorUtil_1 = __nccwpck_require__(9849);
|
|
5479
|
+
const parseUtil_1 = __nccwpck_require__(3636);
|
|
5480
|
+
const util_1 = __nccwpck_require__(9973);
|
|
5481
|
+
const ZodError_1 = __nccwpck_require__(3933);
|
|
5534
5482
|
class ParseInputLazyPath {
|
|
5535
5483
|
constructor(parent, value, path, key) {
|
|
5536
5484
|
this.parent = parent;
|
|
@@ -5543,7 +5491,7 @@ class ParseInputLazyPath {
|
|
|
5543
5491
|
}
|
|
5544
5492
|
}
|
|
5545
5493
|
const handleResult = (ctx, result) => {
|
|
5546
|
-
if (parseUtil_1.isValid(result)) {
|
|
5494
|
+
if ((0, parseUtil_1.isValid)(result)) {
|
|
5547
5495
|
return { success: true, data: result.value };
|
|
5548
5496
|
}
|
|
5549
5497
|
else {
|
|
@@ -5559,7 +5507,7 @@ function processCreateParams(params) {
|
|
|
5559
5507
|
return {};
|
|
5560
5508
|
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
5561
5509
|
if (errorMap && (invalid_type_error || required_error)) {
|
|
5562
|
-
throw new Error(`Can't use "
|
|
5510
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
5563
5511
|
}
|
|
5564
5512
|
if (errorMap)
|
|
5565
5513
|
return { errorMap: errorMap, description };
|
|
@@ -5577,7 +5525,6 @@ class ZodType {
|
|
|
5577
5525
|
constructor(def) {
|
|
5578
5526
|
/** Alias of safeParseAsync */
|
|
5579
5527
|
this.spa = this.safeParseAsync;
|
|
5580
|
-
this.superRefine = this._refinement;
|
|
5581
5528
|
this._def = def;
|
|
5582
5529
|
this.parse = this.parse.bind(this);
|
|
5583
5530
|
this.safeParse = this.safeParse.bind(this);
|
|
@@ -5595,8 +5542,11 @@ class ZodType {
|
|
|
5595
5542
|
this.or = this.or.bind(this);
|
|
5596
5543
|
this.and = this.and.bind(this);
|
|
5597
5544
|
this.transform = this.transform.bind(this);
|
|
5545
|
+
this.brand = this.brand.bind(this);
|
|
5598
5546
|
this.default = this.default.bind(this);
|
|
5547
|
+
this.catch = this.catch.bind(this);
|
|
5599
5548
|
this.describe = this.describe.bind(this);
|
|
5549
|
+
this.pipe = this.pipe.bind(this);
|
|
5600
5550
|
this.isNullable = this.isNullable.bind(this);
|
|
5601
5551
|
this.isOptional = this.isOptional.bind(this);
|
|
5602
5552
|
}
|
|
@@ -5604,13 +5554,13 @@ class ZodType {
|
|
|
5604
5554
|
return this._def.description;
|
|
5605
5555
|
}
|
|
5606
5556
|
_getType(input) {
|
|
5607
|
-
return util_1.getParsedType(input.data);
|
|
5557
|
+
return (0, util_1.getParsedType)(input.data);
|
|
5608
5558
|
}
|
|
5609
5559
|
_getOrReturnCtx(input, ctx) {
|
|
5610
5560
|
return (ctx || {
|
|
5611
5561
|
common: input.parent.common,
|
|
5612
5562
|
data: input.data,
|
|
5613
|
-
parsedType: util_1.getParsedType(input.data),
|
|
5563
|
+
parsedType: (0, util_1.getParsedType)(input.data),
|
|
5614
5564
|
schemaErrorMap: this._def.errorMap,
|
|
5615
5565
|
path: input.path,
|
|
5616
5566
|
parent: input.parent,
|
|
@@ -5622,7 +5572,7 @@ class ZodType {
|
|
|
5622
5572
|
ctx: {
|
|
5623
5573
|
common: input.parent.common,
|
|
5624
5574
|
data: input.data,
|
|
5625
|
-
parsedType: util_1.getParsedType(input.data),
|
|
5575
|
+
parsedType: (0, util_1.getParsedType)(input.data),
|
|
5626
5576
|
schemaErrorMap: this._def.errorMap,
|
|
5627
5577
|
path: input.path,
|
|
5628
5578
|
parent: input.parent,
|
|
@@ -5631,7 +5581,7 @@ class ZodType {
|
|
|
5631
5581
|
}
|
|
5632
5582
|
_parseSync(input) {
|
|
5633
5583
|
const result = this._parse(input);
|
|
5634
|
-
if (parseUtil_1.isAsync(result)) {
|
|
5584
|
+
if ((0, parseUtil_1.isAsync)(result)) {
|
|
5635
5585
|
throw new Error("Synchronous parse encountered promise.");
|
|
5636
5586
|
}
|
|
5637
5587
|
return result;
|
|
@@ -5658,7 +5608,7 @@ class ZodType {
|
|
|
5658
5608
|
schemaErrorMap: this._def.errorMap,
|
|
5659
5609
|
parent: null,
|
|
5660
5610
|
data,
|
|
5661
|
-
parsedType: util_1.getParsedType(data),
|
|
5611
|
+
parsedType: (0, util_1.getParsedType)(data),
|
|
5662
5612
|
};
|
|
5663
5613
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
5664
5614
|
return handleResult(ctx, result);
|
|
@@ -5680,10 +5630,10 @@ class ZodType {
|
|
|
5680
5630
|
schemaErrorMap: this._def.errorMap,
|
|
5681
5631
|
parent: null,
|
|
5682
5632
|
data,
|
|
5683
|
-
parsedType: util_1.getParsedType(data),
|
|
5633
|
+
parsedType: (0, util_1.getParsedType)(data),
|
|
5684
5634
|
};
|
|
5685
|
-
const maybeAsyncResult = this._parse({ data, path:
|
|
5686
|
-
const result = await (parseUtil_1.isAsync(maybeAsyncResult)
|
|
5635
|
+
const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
|
|
5636
|
+
const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)
|
|
5687
5637
|
? maybeAsyncResult
|
|
5688
5638
|
: Promise.resolve(maybeAsyncResult));
|
|
5689
5639
|
return handleResult(ctx, result);
|
|
@@ -5746,6 +5696,9 @@ class ZodType {
|
|
|
5746
5696
|
effect: { type: "refinement", refinement },
|
|
5747
5697
|
});
|
|
5748
5698
|
}
|
|
5699
|
+
superRefine(refinement) {
|
|
5700
|
+
return this._refinement(refinement);
|
|
5701
|
+
}
|
|
5749
5702
|
optional() {
|
|
5750
5703
|
return ZodOptional.create(this);
|
|
5751
5704
|
}
|
|
@@ -5789,6 +5742,14 @@ class ZodType {
|
|
|
5789
5742
|
...processCreateParams(undefined),
|
|
5790
5743
|
});
|
|
5791
5744
|
}
|
|
5745
|
+
catch(def) {
|
|
5746
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
5747
|
+
return new ZodCatch({
|
|
5748
|
+
innerType: this,
|
|
5749
|
+
defaultValue: defaultValueFunc,
|
|
5750
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
5751
|
+
});
|
|
5752
|
+
}
|
|
5792
5753
|
describe(description) {
|
|
5793
5754
|
const This = this.constructor;
|
|
5794
5755
|
return new This({
|
|
@@ -5796,6 +5757,9 @@ class ZodType {
|
|
|
5796
5757
|
description,
|
|
5797
5758
|
});
|
|
5798
5759
|
}
|
|
5760
|
+
pipe(target) {
|
|
5761
|
+
return ZodPipeline.create(this, target);
|
|
5762
|
+
}
|
|
5799
5763
|
isOptional() {
|
|
5800
5764
|
return this.safeParse(undefined).success;
|
|
5801
5765
|
}
|
|
@@ -5813,18 +5777,51 @@ const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-
|
|
|
5813
5777
|
// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
|
|
5814
5778
|
// eslint-disable-next-line
|
|
5815
5779
|
const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5780
|
+
// interface IsDateStringOptions extends StringDateOptions {
|
|
5781
|
+
/**
|
|
5782
|
+
* Match any configuration
|
|
5783
|
+
*/
|
|
5784
|
+
// any?: boolean;
|
|
5785
|
+
// }
|
|
5786
|
+
// Adapted from https://stackoverflow.com/a/3143231
|
|
5787
|
+
const datetimeRegex = (args) => {
|
|
5788
|
+
if (args.precision) {
|
|
5789
|
+
if (args.offset) {
|
|
5790
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
5791
|
+
}
|
|
5792
|
+
else {
|
|
5793
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
5794
|
+
}
|
|
5795
|
+
}
|
|
5796
|
+
else if (args.precision === 0) {
|
|
5797
|
+
if (args.offset) {
|
|
5798
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
5799
|
+
}
|
|
5800
|
+
else {
|
|
5801
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
5802
|
+
}
|
|
5803
|
+
}
|
|
5804
|
+
else {
|
|
5805
|
+
if (args.offset) {
|
|
5806
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
5807
|
+
}
|
|
5808
|
+
else {
|
|
5809
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
5810
|
+
}
|
|
5811
|
+
}
|
|
5812
|
+
};
|
|
5813
|
+
class ZodString extends ZodType {
|
|
5814
|
+
constructor() {
|
|
5815
|
+
super(...arguments);
|
|
5816
|
+
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
|
5817
|
+
validation,
|
|
5818
|
+
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5819
|
+
...errorUtil_1.errorUtil.errToObj(message),
|
|
5820
|
+
});
|
|
5821
|
+
/**
|
|
5822
|
+
* @deprecated Use z.string().min(1) instead.
|
|
5823
|
+
* @see {@link ZodString.min}
|
|
5824
|
+
*/
|
|
5828
5825
|
this.nonempty = (message) => this.min(1, errorUtil_1.errorUtil.errToObj(message));
|
|
5829
5826
|
this.trim = () => new ZodString({
|
|
5830
5827
|
...this._def,
|
|
@@ -5832,10 +5829,13 @@ class ZodString extends ZodType {
|
|
|
5832
5829
|
});
|
|
5833
5830
|
}
|
|
5834
5831
|
_parse(input) {
|
|
5832
|
+
if (this._def.coerce) {
|
|
5833
|
+
input.data = String(input.data);
|
|
5834
|
+
}
|
|
5835
5835
|
const parsedType = this._getType(input);
|
|
5836
5836
|
if (parsedType !== util_1.ZodParsedType.string) {
|
|
5837
5837
|
const ctx = this._getOrReturnCtx(input);
|
|
5838
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5838
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5839
5839
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
5840
5840
|
expected: util_1.ZodParsedType.string,
|
|
5841
5841
|
received: ctx.parsedType,
|
|
@@ -5850,11 +5850,12 @@ class ZodString extends ZodType {
|
|
|
5850
5850
|
if (check.kind === "min") {
|
|
5851
5851
|
if (input.data.length < check.value) {
|
|
5852
5852
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5853
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5853
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5854
5854
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
5855
5855
|
minimum: check.value,
|
|
5856
5856
|
type: "string",
|
|
5857
5857
|
inclusive: true,
|
|
5858
|
+
exact: false,
|
|
5858
5859
|
message: check.message,
|
|
5859
5860
|
});
|
|
5860
5861
|
status.dirty();
|
|
@@ -5863,20 +5864,49 @@ class ZodString extends ZodType {
|
|
|
5863
5864
|
else if (check.kind === "max") {
|
|
5864
5865
|
if (input.data.length > check.value) {
|
|
5865
5866
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5866
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5867
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5867
5868
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
5868
5869
|
maximum: check.value,
|
|
5869
5870
|
type: "string",
|
|
5870
5871
|
inclusive: true,
|
|
5872
|
+
exact: false,
|
|
5871
5873
|
message: check.message,
|
|
5872
5874
|
});
|
|
5873
5875
|
status.dirty();
|
|
5874
5876
|
}
|
|
5875
5877
|
}
|
|
5878
|
+
else if (check.kind === "length") {
|
|
5879
|
+
const tooBig = input.data.length > check.value;
|
|
5880
|
+
const tooSmall = input.data.length < check.value;
|
|
5881
|
+
if (tooBig || tooSmall) {
|
|
5882
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
5883
|
+
if (tooBig) {
|
|
5884
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5885
|
+
code: ZodError_1.ZodIssueCode.too_big,
|
|
5886
|
+
maximum: check.value,
|
|
5887
|
+
type: "string",
|
|
5888
|
+
inclusive: true,
|
|
5889
|
+
exact: true,
|
|
5890
|
+
message: check.message,
|
|
5891
|
+
});
|
|
5892
|
+
}
|
|
5893
|
+
else if (tooSmall) {
|
|
5894
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5895
|
+
code: ZodError_1.ZodIssueCode.too_small,
|
|
5896
|
+
minimum: check.value,
|
|
5897
|
+
type: "string",
|
|
5898
|
+
inclusive: true,
|
|
5899
|
+
exact: true,
|
|
5900
|
+
message: check.message,
|
|
5901
|
+
});
|
|
5902
|
+
}
|
|
5903
|
+
status.dirty();
|
|
5904
|
+
}
|
|
5905
|
+
}
|
|
5876
5906
|
else if (check.kind === "email") {
|
|
5877
5907
|
if (!emailRegex.test(input.data)) {
|
|
5878
5908
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5879
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5909
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5880
5910
|
validation: "email",
|
|
5881
5911
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5882
5912
|
message: check.message,
|
|
@@ -5887,7 +5917,7 @@ class ZodString extends ZodType {
|
|
|
5887
5917
|
else if (check.kind === "uuid") {
|
|
5888
5918
|
if (!uuidRegex.test(input.data)) {
|
|
5889
5919
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5890
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5920
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5891
5921
|
validation: "uuid",
|
|
5892
5922
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5893
5923
|
message: check.message,
|
|
@@ -5898,7 +5928,7 @@ class ZodString extends ZodType {
|
|
|
5898
5928
|
else if (check.kind === "cuid") {
|
|
5899
5929
|
if (!cuidRegex.test(input.data)) {
|
|
5900
5930
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5901
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5931
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5902
5932
|
validation: "cuid",
|
|
5903
5933
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5904
5934
|
message: check.message,
|
|
@@ -5912,7 +5942,7 @@ class ZodString extends ZodType {
|
|
|
5912
5942
|
}
|
|
5913
5943
|
catch (_a) {
|
|
5914
5944
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5915
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5945
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5916
5946
|
validation: "url",
|
|
5917
5947
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5918
5948
|
message: check.message,
|
|
@@ -5925,7 +5955,7 @@ class ZodString extends ZodType {
|
|
|
5925
5955
|
const testResult = check.regex.test(input.data);
|
|
5926
5956
|
if (!testResult) {
|
|
5927
5957
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5928
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5958
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5929
5959
|
validation: "regex",
|
|
5930
5960
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5931
5961
|
message: check.message,
|
|
@@ -5939,7 +5969,7 @@ class ZodString extends ZodType {
|
|
|
5939
5969
|
else if (check.kind === "startsWith") {
|
|
5940
5970
|
if (!input.data.startsWith(check.value)) {
|
|
5941
5971
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5942
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5972
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5943
5973
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5944
5974
|
validation: { startsWith: check.value },
|
|
5945
5975
|
message: check.message,
|
|
@@ -5950,7 +5980,7 @@ class ZodString extends ZodType {
|
|
|
5950
5980
|
else if (check.kind === "endsWith") {
|
|
5951
5981
|
if (!input.data.endsWith(check.value)) {
|
|
5952
5982
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
5953
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
5983
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5954
5984
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5955
5985
|
validation: { endsWith: check.value },
|
|
5956
5986
|
message: check.message,
|
|
@@ -5958,6 +5988,18 @@ class ZodString extends ZodType {
|
|
|
5958
5988
|
status.dirty();
|
|
5959
5989
|
}
|
|
5960
5990
|
}
|
|
5991
|
+
else if (check.kind === "datetime") {
|
|
5992
|
+
const regex = datetimeRegex(check);
|
|
5993
|
+
if (!regex.test(input.data)) {
|
|
5994
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
5995
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
5996
|
+
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
5997
|
+
validation: "datetime",
|
|
5998
|
+
message: check.message,
|
|
5999
|
+
});
|
|
6000
|
+
status.dirty();
|
|
6001
|
+
}
|
|
6002
|
+
}
|
|
5961
6003
|
else {
|
|
5962
6004
|
util_1.util.assertNever(check);
|
|
5963
6005
|
}
|
|
@@ -5982,6 +6024,23 @@ class ZodString extends ZodType {
|
|
|
5982
6024
|
cuid(message) {
|
|
5983
6025
|
return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
|
|
5984
6026
|
}
|
|
6027
|
+
datetime(options) {
|
|
6028
|
+
var _a;
|
|
6029
|
+
if (typeof options === "string") {
|
|
6030
|
+
return this._addCheck({
|
|
6031
|
+
kind: "datetime",
|
|
6032
|
+
precision: null,
|
|
6033
|
+
offset: false,
|
|
6034
|
+
message: options,
|
|
6035
|
+
});
|
|
6036
|
+
}
|
|
6037
|
+
return this._addCheck({
|
|
6038
|
+
kind: "datetime",
|
|
6039
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
6040
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
6041
|
+
...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
|
|
6042
|
+
});
|
|
6043
|
+
}
|
|
5985
6044
|
regex(regex, message) {
|
|
5986
6045
|
return this._addCheck({
|
|
5987
6046
|
kind: "regex",
|
|
@@ -6018,7 +6077,14 @@ class ZodString extends ZodType {
|
|
|
6018
6077
|
});
|
|
6019
6078
|
}
|
|
6020
6079
|
length(len, message) {
|
|
6021
|
-
return this.
|
|
6080
|
+
return this._addCheck({
|
|
6081
|
+
kind: "length",
|
|
6082
|
+
value: len,
|
|
6083
|
+
...errorUtil_1.errorUtil.errToObj(message),
|
|
6084
|
+
});
|
|
6085
|
+
}
|
|
6086
|
+
get isDatetime() {
|
|
6087
|
+
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
6022
6088
|
}
|
|
6023
6089
|
get isEmail() {
|
|
6024
6090
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
@@ -6055,9 +6121,11 @@ class ZodString extends ZodType {
|
|
|
6055
6121
|
}
|
|
6056
6122
|
exports.ZodString = ZodString;
|
|
6057
6123
|
ZodString.create = (params) => {
|
|
6124
|
+
var _a;
|
|
6058
6125
|
return new ZodString({
|
|
6059
6126
|
checks: [],
|
|
6060
6127
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
6128
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
6061
6129
|
...processCreateParams(params),
|
|
6062
6130
|
});
|
|
6063
6131
|
};
|
|
@@ -6078,10 +6146,13 @@ class ZodNumber extends ZodType {
|
|
|
6078
6146
|
this.step = this.multipleOf;
|
|
6079
6147
|
}
|
|
6080
6148
|
_parse(input) {
|
|
6149
|
+
if (this._def.coerce) {
|
|
6150
|
+
input.data = Number(input.data);
|
|
6151
|
+
}
|
|
6081
6152
|
const parsedType = this._getType(input);
|
|
6082
6153
|
if (parsedType !== util_1.ZodParsedType.number) {
|
|
6083
6154
|
const ctx = this._getOrReturnCtx(input);
|
|
6084
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6155
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6085
6156
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6086
6157
|
expected: util_1.ZodParsedType.number,
|
|
6087
6158
|
received: ctx.parsedType,
|
|
@@ -6094,7 +6165,7 @@ class ZodNumber extends ZodType {
|
|
|
6094
6165
|
if (check.kind === "int") {
|
|
6095
6166
|
if (!util_1.util.isInteger(input.data)) {
|
|
6096
6167
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
6097
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6168
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6098
6169
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6099
6170
|
expected: "integer",
|
|
6100
6171
|
received: "float",
|
|
@@ -6109,11 +6180,12 @@ class ZodNumber extends ZodType {
|
|
|
6109
6180
|
: input.data <= check.value;
|
|
6110
6181
|
if (tooSmall) {
|
|
6111
6182
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
6112
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6183
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6113
6184
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
6114
6185
|
minimum: check.value,
|
|
6115
6186
|
type: "number",
|
|
6116
6187
|
inclusive: check.inclusive,
|
|
6188
|
+
exact: false,
|
|
6117
6189
|
message: check.message,
|
|
6118
6190
|
});
|
|
6119
6191
|
status.dirty();
|
|
@@ -6125,11 +6197,12 @@ class ZodNumber extends ZodType {
|
|
|
6125
6197
|
: input.data >= check.value;
|
|
6126
6198
|
if (tooBig) {
|
|
6127
6199
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
6128
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6200
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6129
6201
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
6130
6202
|
maximum: check.value,
|
|
6131
6203
|
type: "number",
|
|
6132
6204
|
inclusive: check.inclusive,
|
|
6205
|
+
exact: false,
|
|
6133
6206
|
message: check.message,
|
|
6134
6207
|
});
|
|
6135
6208
|
status.dirty();
|
|
@@ -6138,7 +6211,7 @@ class ZodNumber extends ZodType {
|
|
|
6138
6211
|
else if (check.kind === "multipleOf") {
|
|
6139
6212
|
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
|
6140
6213
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
6141
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6214
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6142
6215
|
code: ZodError_1.ZodIssueCode.not_multiple_of,
|
|
6143
6216
|
multipleOf: check.value,
|
|
6144
6217
|
message: check.message,
|
|
@@ -6146,6 +6219,16 @@ class ZodNumber extends ZodType {
|
|
|
6146
6219
|
status.dirty();
|
|
6147
6220
|
}
|
|
6148
6221
|
}
|
|
6222
|
+
else if (check.kind === "finite") {
|
|
6223
|
+
if (!Number.isFinite(input.data)) {
|
|
6224
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
6225
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6226
|
+
code: ZodError_1.ZodIssueCode.not_finite,
|
|
6227
|
+
message: check.message,
|
|
6228
|
+
});
|
|
6229
|
+
status.dirty();
|
|
6230
|
+
}
|
|
6231
|
+
}
|
|
6149
6232
|
else {
|
|
6150
6233
|
util_1.util.assertNever(check);
|
|
6151
6234
|
}
|
|
@@ -6229,6 +6312,12 @@ class ZodNumber extends ZodType {
|
|
|
6229
6312
|
message: errorUtil_1.errorUtil.toString(message),
|
|
6230
6313
|
});
|
|
6231
6314
|
}
|
|
6315
|
+
finite(message) {
|
|
6316
|
+
return this._addCheck({
|
|
6317
|
+
kind: "finite",
|
|
6318
|
+
message: errorUtil_1.errorUtil.toString(message),
|
|
6319
|
+
});
|
|
6320
|
+
}
|
|
6232
6321
|
get minValue() {
|
|
6233
6322
|
let min = null;
|
|
6234
6323
|
for (const ch of this._def.checks) {
|
|
@@ -6258,59 +6347,72 @@ ZodNumber.create = (params) => {
|
|
|
6258
6347
|
return new ZodNumber({
|
|
6259
6348
|
checks: [],
|
|
6260
6349
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
6350
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
6261
6351
|
...processCreateParams(params),
|
|
6262
6352
|
});
|
|
6263
6353
|
};
|
|
6264
6354
|
class ZodBigInt extends ZodType {
|
|
6265
6355
|
_parse(input) {
|
|
6356
|
+
if (this._def.coerce) {
|
|
6357
|
+
input.data = BigInt(input.data);
|
|
6358
|
+
}
|
|
6266
6359
|
const parsedType = this._getType(input);
|
|
6267
6360
|
if (parsedType !== util_1.ZodParsedType.bigint) {
|
|
6268
6361
|
const ctx = this._getOrReturnCtx(input);
|
|
6269
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6362
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6270
6363
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6271
6364
|
expected: util_1.ZodParsedType.bigint,
|
|
6272
6365
|
received: ctx.parsedType,
|
|
6273
6366
|
});
|
|
6274
6367
|
return parseUtil_1.INVALID;
|
|
6275
6368
|
}
|
|
6276
|
-
return parseUtil_1.OK(input.data);
|
|
6369
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6277
6370
|
}
|
|
6278
6371
|
}
|
|
6279
6372
|
exports.ZodBigInt = ZodBigInt;
|
|
6280
6373
|
ZodBigInt.create = (params) => {
|
|
6374
|
+
var _a;
|
|
6281
6375
|
return new ZodBigInt({
|
|
6282
6376
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
6377
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
6283
6378
|
...processCreateParams(params),
|
|
6284
6379
|
});
|
|
6285
6380
|
};
|
|
6286
6381
|
class ZodBoolean extends ZodType {
|
|
6287
6382
|
_parse(input) {
|
|
6383
|
+
if (this._def.coerce) {
|
|
6384
|
+
input.data = Boolean(input.data);
|
|
6385
|
+
}
|
|
6288
6386
|
const parsedType = this._getType(input);
|
|
6289
6387
|
if (parsedType !== util_1.ZodParsedType.boolean) {
|
|
6290
6388
|
const ctx = this._getOrReturnCtx(input);
|
|
6291
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6389
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6292
6390
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6293
6391
|
expected: util_1.ZodParsedType.boolean,
|
|
6294
6392
|
received: ctx.parsedType,
|
|
6295
6393
|
});
|
|
6296
6394
|
return parseUtil_1.INVALID;
|
|
6297
6395
|
}
|
|
6298
|
-
return parseUtil_1.OK(input.data);
|
|
6396
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6299
6397
|
}
|
|
6300
6398
|
}
|
|
6301
6399
|
exports.ZodBoolean = ZodBoolean;
|
|
6302
6400
|
ZodBoolean.create = (params) => {
|
|
6303
6401
|
return new ZodBoolean({
|
|
6304
6402
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
6403
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
6305
6404
|
...processCreateParams(params),
|
|
6306
6405
|
});
|
|
6307
6406
|
};
|
|
6308
6407
|
class ZodDate extends ZodType {
|
|
6309
6408
|
_parse(input) {
|
|
6409
|
+
if (this._def.coerce) {
|
|
6410
|
+
input.data = new Date(input.data);
|
|
6411
|
+
}
|
|
6310
6412
|
const parsedType = this._getType(input);
|
|
6311
6413
|
if (parsedType !== util_1.ZodParsedType.date) {
|
|
6312
6414
|
const ctx = this._getOrReturnCtx(input);
|
|
6313
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6415
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6314
6416
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6315
6417
|
expected: util_1.ZodParsedType.date,
|
|
6316
6418
|
received: ctx.parsedType,
|
|
@@ -6319,7 +6421,7 @@ class ZodDate extends ZodType {
|
|
|
6319
6421
|
}
|
|
6320
6422
|
if (isNaN(input.data.getTime())) {
|
|
6321
6423
|
const ctx = this._getOrReturnCtx(input);
|
|
6322
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6424
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6323
6425
|
code: ZodError_1.ZodIssueCode.invalid_date,
|
|
6324
6426
|
});
|
|
6325
6427
|
return parseUtil_1.INVALID;
|
|
@@ -6330,10 +6432,11 @@ class ZodDate extends ZodType {
|
|
|
6330
6432
|
if (check.kind === "min") {
|
|
6331
6433
|
if (input.data.getTime() < check.value) {
|
|
6332
6434
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
6333
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6435
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6334
6436
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
6335
6437
|
message: check.message,
|
|
6336
6438
|
inclusive: true,
|
|
6439
|
+
exact: false,
|
|
6337
6440
|
minimum: check.value,
|
|
6338
6441
|
type: "date",
|
|
6339
6442
|
});
|
|
@@ -6343,10 +6446,11 @@ class ZodDate extends ZodType {
|
|
|
6343
6446
|
else if (check.kind === "max") {
|
|
6344
6447
|
if (input.data.getTime() > check.value) {
|
|
6345
6448
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
6346
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6449
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6347
6450
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
6348
6451
|
message: check.message,
|
|
6349
6452
|
inclusive: true,
|
|
6453
|
+
exact: false,
|
|
6350
6454
|
maximum: check.value,
|
|
6351
6455
|
type: "date",
|
|
6352
6456
|
});
|
|
@@ -6407,23 +6511,46 @@ exports.ZodDate = ZodDate;
|
|
|
6407
6511
|
ZodDate.create = (params) => {
|
|
6408
6512
|
return new ZodDate({
|
|
6409
6513
|
checks: [],
|
|
6514
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
6410
6515
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
6411
6516
|
...processCreateParams(params),
|
|
6412
6517
|
});
|
|
6413
6518
|
};
|
|
6519
|
+
class ZodSymbol extends ZodType {
|
|
6520
|
+
_parse(input) {
|
|
6521
|
+
const parsedType = this._getType(input);
|
|
6522
|
+
if (parsedType !== util_1.ZodParsedType.symbol) {
|
|
6523
|
+
const ctx = this._getOrReturnCtx(input);
|
|
6524
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6525
|
+
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6526
|
+
expected: util_1.ZodParsedType.symbol,
|
|
6527
|
+
received: ctx.parsedType,
|
|
6528
|
+
});
|
|
6529
|
+
return parseUtil_1.INVALID;
|
|
6530
|
+
}
|
|
6531
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6532
|
+
}
|
|
6533
|
+
}
|
|
6534
|
+
exports.ZodSymbol = ZodSymbol;
|
|
6535
|
+
ZodSymbol.create = (params) => {
|
|
6536
|
+
return new ZodSymbol({
|
|
6537
|
+
typeName: ZodFirstPartyTypeKind.ZodSymbol,
|
|
6538
|
+
...processCreateParams(params),
|
|
6539
|
+
});
|
|
6540
|
+
};
|
|
6414
6541
|
class ZodUndefined extends ZodType {
|
|
6415
6542
|
_parse(input) {
|
|
6416
6543
|
const parsedType = this._getType(input);
|
|
6417
6544
|
if (parsedType !== util_1.ZodParsedType.undefined) {
|
|
6418
6545
|
const ctx = this._getOrReturnCtx(input);
|
|
6419
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6546
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6420
6547
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6421
6548
|
expected: util_1.ZodParsedType.undefined,
|
|
6422
6549
|
received: ctx.parsedType,
|
|
6423
6550
|
});
|
|
6424
6551
|
return parseUtil_1.INVALID;
|
|
6425
6552
|
}
|
|
6426
|
-
return parseUtil_1.OK(input.data);
|
|
6553
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6427
6554
|
}
|
|
6428
6555
|
}
|
|
6429
6556
|
exports.ZodUndefined = ZodUndefined;
|
|
@@ -6438,14 +6565,14 @@ class ZodNull extends ZodType {
|
|
|
6438
6565
|
const parsedType = this._getType(input);
|
|
6439
6566
|
if (parsedType !== util_1.ZodParsedType.null) {
|
|
6440
6567
|
const ctx = this._getOrReturnCtx(input);
|
|
6441
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6568
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6442
6569
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6443
6570
|
expected: util_1.ZodParsedType.null,
|
|
6444
6571
|
received: ctx.parsedType,
|
|
6445
6572
|
});
|
|
6446
6573
|
return parseUtil_1.INVALID;
|
|
6447
6574
|
}
|
|
6448
|
-
return parseUtil_1.OK(input.data);
|
|
6575
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6449
6576
|
}
|
|
6450
6577
|
}
|
|
6451
6578
|
exports.ZodNull = ZodNull;
|
|
@@ -6462,7 +6589,7 @@ class ZodAny extends ZodType {
|
|
|
6462
6589
|
this._any = true;
|
|
6463
6590
|
}
|
|
6464
6591
|
_parse(input) {
|
|
6465
|
-
return parseUtil_1.OK(input.data);
|
|
6592
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6466
6593
|
}
|
|
6467
6594
|
}
|
|
6468
6595
|
exports.ZodAny = ZodAny;
|
|
@@ -6479,7 +6606,7 @@ class ZodUnknown extends ZodType {
|
|
|
6479
6606
|
this._unknown = true;
|
|
6480
6607
|
}
|
|
6481
6608
|
_parse(input) {
|
|
6482
|
-
return parseUtil_1.OK(input.data);
|
|
6609
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6483
6610
|
}
|
|
6484
6611
|
}
|
|
6485
6612
|
exports.ZodUnknown = ZodUnknown;
|
|
@@ -6492,7 +6619,7 @@ ZodUnknown.create = (params) => {
|
|
|
6492
6619
|
class ZodNever extends ZodType {
|
|
6493
6620
|
_parse(input) {
|
|
6494
6621
|
const ctx = this._getOrReturnCtx(input);
|
|
6495
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6622
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6496
6623
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6497
6624
|
expected: util_1.ZodParsedType.never,
|
|
6498
6625
|
received: ctx.parsedType,
|
|
@@ -6512,14 +6639,14 @@ class ZodVoid extends ZodType {
|
|
|
6512
6639
|
const parsedType = this._getType(input);
|
|
6513
6640
|
if (parsedType !== util_1.ZodParsedType.undefined) {
|
|
6514
6641
|
const ctx = this._getOrReturnCtx(input);
|
|
6515
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6642
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6516
6643
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6517
6644
|
expected: util_1.ZodParsedType.void,
|
|
6518
6645
|
received: ctx.parsedType,
|
|
6519
6646
|
});
|
|
6520
6647
|
return parseUtil_1.INVALID;
|
|
6521
6648
|
}
|
|
6522
|
-
return parseUtil_1.OK(input.data);
|
|
6649
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
6523
6650
|
}
|
|
6524
6651
|
}
|
|
6525
6652
|
exports.ZodVoid = ZodVoid;
|
|
@@ -6534,20 +6661,37 @@ class ZodArray extends ZodType {
|
|
|
6534
6661
|
const { ctx, status } = this._processInputParams(input);
|
|
6535
6662
|
const def = this._def;
|
|
6536
6663
|
if (ctx.parsedType !== util_1.ZodParsedType.array) {
|
|
6537
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6664
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6538
6665
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6539
6666
|
expected: util_1.ZodParsedType.array,
|
|
6540
6667
|
received: ctx.parsedType,
|
|
6541
6668
|
});
|
|
6542
6669
|
return parseUtil_1.INVALID;
|
|
6543
6670
|
}
|
|
6671
|
+
if (def.exactLength !== null) {
|
|
6672
|
+
const tooBig = ctx.data.length > def.exactLength.value;
|
|
6673
|
+
const tooSmall = ctx.data.length < def.exactLength.value;
|
|
6674
|
+
if (tooBig || tooSmall) {
|
|
6675
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6676
|
+
code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
|
|
6677
|
+
minimum: (tooSmall ? def.exactLength.value : undefined),
|
|
6678
|
+
maximum: (tooBig ? def.exactLength.value : undefined),
|
|
6679
|
+
type: "array",
|
|
6680
|
+
inclusive: true,
|
|
6681
|
+
exact: true,
|
|
6682
|
+
message: def.exactLength.message,
|
|
6683
|
+
});
|
|
6684
|
+
status.dirty();
|
|
6685
|
+
}
|
|
6686
|
+
}
|
|
6544
6687
|
if (def.minLength !== null) {
|
|
6545
6688
|
if (ctx.data.length < def.minLength.value) {
|
|
6546
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6689
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6547
6690
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
6548
6691
|
minimum: def.minLength.value,
|
|
6549
6692
|
type: "array",
|
|
6550
6693
|
inclusive: true,
|
|
6694
|
+
exact: false,
|
|
6551
6695
|
message: def.minLength.message,
|
|
6552
6696
|
});
|
|
6553
6697
|
status.dirty();
|
|
@@ -6555,11 +6699,12 @@ class ZodArray extends ZodType {
|
|
|
6555
6699
|
}
|
|
6556
6700
|
if (def.maxLength !== null) {
|
|
6557
6701
|
if (ctx.data.length > def.maxLength.value) {
|
|
6558
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6702
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6559
6703
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
6560
6704
|
maximum: def.maxLength.value,
|
|
6561
6705
|
type: "array",
|
|
6562
6706
|
inclusive: true,
|
|
6707
|
+
exact: false,
|
|
6563
6708
|
message: def.maxLength.message,
|
|
6564
6709
|
});
|
|
6565
6710
|
status.dirty();
|
|
@@ -6593,7 +6738,10 @@ class ZodArray extends ZodType {
|
|
|
6593
6738
|
});
|
|
6594
6739
|
}
|
|
6595
6740
|
length(len, message) {
|
|
6596
|
-
return
|
|
6741
|
+
return new ZodArray({
|
|
6742
|
+
...this._def,
|
|
6743
|
+
exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },
|
|
6744
|
+
});
|
|
6597
6745
|
}
|
|
6598
6746
|
nonempty(message) {
|
|
6599
6747
|
return this.min(1, message);
|
|
@@ -6605,6 +6753,7 @@ ZodArray.create = (schema, params) => {
|
|
|
6605
6753
|
type: schema,
|
|
6606
6754
|
minLength: null,
|
|
6607
6755
|
maxLength: null,
|
|
6756
|
+
exactLength: null,
|
|
6608
6757
|
typeName: ZodFirstPartyTypeKind.ZodArray,
|
|
6609
6758
|
...processCreateParams(params),
|
|
6610
6759
|
});
|
|
@@ -6621,7 +6770,7 @@ var objectUtil;
|
|
|
6621
6770
|
objectUtil.mergeShapes = (first, second) => {
|
|
6622
6771
|
return {
|
|
6623
6772
|
...first,
|
|
6624
|
-
...second,
|
|
6773
|
+
...second, // second overwrites first
|
|
6625
6774
|
};
|
|
6626
6775
|
};
|
|
6627
6776
|
})(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
|
|
@@ -6685,7 +6834,7 @@ class ZodObject extends ZodType {
|
|
|
6685
6834
|
const parsedType = this._getType(input);
|
|
6686
6835
|
if (parsedType !== util_1.ZodParsedType.object) {
|
|
6687
6836
|
const ctx = this._getOrReturnCtx(input);
|
|
6688
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6837
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6689
6838
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
6690
6839
|
expected: util_1.ZodParsedType.object,
|
|
6691
6840
|
received: ctx.parsedType,
|
|
@@ -6695,9 +6844,12 @@ class ZodObject extends ZodType {
|
|
|
6695
6844
|
const { status, ctx } = this._processInputParams(input);
|
|
6696
6845
|
const { shape, keys: shapeKeys } = this._getCached();
|
|
6697
6846
|
const extraKeys = [];
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6847
|
+
if (!(this._def.catchall instanceof ZodNever &&
|
|
6848
|
+
this._def.unknownKeys === "strip")) {
|
|
6849
|
+
for (const key in ctx.data) {
|
|
6850
|
+
if (!shapeKeys.includes(key)) {
|
|
6851
|
+
extraKeys.push(key);
|
|
6852
|
+
}
|
|
6701
6853
|
}
|
|
6702
6854
|
}
|
|
6703
6855
|
const pairs = [];
|
|
@@ -6722,7 +6874,7 @@ class ZodObject extends ZodType {
|
|
|
6722
6874
|
}
|
|
6723
6875
|
else if (unknownKeys === "strict") {
|
|
6724
6876
|
if (extraKeys.length > 0) {
|
|
6725
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
6877
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6726
6878
|
code: ZodError_1.ZodIssueCode.unrecognized_keys,
|
|
6727
6879
|
keys: extraKeys,
|
|
6728
6880
|
});
|
|
@@ -6888,15 +7040,32 @@ class ZodObject extends ZodType {
|
|
|
6888
7040
|
shape: () => newShape,
|
|
6889
7041
|
});
|
|
6890
7042
|
}
|
|
6891
|
-
required() {
|
|
7043
|
+
required(mask) {
|
|
6892
7044
|
const newShape = {};
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
7045
|
+
if (mask) {
|
|
7046
|
+
util_1.util.objectKeys(this.shape).map((key) => {
|
|
7047
|
+
if (util_1.util.objectKeys(mask).indexOf(key) === -1) {
|
|
7048
|
+
newShape[key] = this.shape[key];
|
|
7049
|
+
}
|
|
7050
|
+
else {
|
|
7051
|
+
const fieldSchema = this.shape[key];
|
|
7052
|
+
let newField = fieldSchema;
|
|
7053
|
+
while (newField instanceof ZodOptional) {
|
|
7054
|
+
newField = newField._def.innerType;
|
|
7055
|
+
}
|
|
7056
|
+
newShape[key] = newField;
|
|
7057
|
+
}
|
|
7058
|
+
});
|
|
7059
|
+
}
|
|
7060
|
+
else {
|
|
7061
|
+
for (const key in this.shape) {
|
|
7062
|
+
const fieldSchema = this.shape[key];
|
|
7063
|
+
let newField = fieldSchema;
|
|
7064
|
+
while (newField instanceof ZodOptional) {
|
|
7065
|
+
newField = newField._def.innerType;
|
|
7066
|
+
}
|
|
7067
|
+
newShape[key] = newField;
|
|
6898
7068
|
}
|
|
6899
|
-
newShape[key] = newField;
|
|
6900
7069
|
}
|
|
6901
7070
|
return new ZodObject({
|
|
6902
7071
|
...this._def,
|
|
@@ -6955,7 +7124,7 @@ class ZodUnion extends ZodType {
|
|
|
6955
7124
|
}
|
|
6956
7125
|
// return invalid
|
|
6957
7126
|
const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
|
|
6958
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7127
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
6959
7128
|
code: ZodError_1.ZodIssueCode.invalid_union,
|
|
6960
7129
|
unionErrors,
|
|
6961
7130
|
});
|
|
@@ -7013,7 +7182,7 @@ class ZodUnion extends ZodType {
|
|
|
7013
7182
|
return dirty.result;
|
|
7014
7183
|
}
|
|
7015
7184
|
const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));
|
|
7016
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7185
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7017
7186
|
code: ZodError_1.ZodIssueCode.invalid_union,
|
|
7018
7187
|
unionErrors,
|
|
7019
7188
|
});
|
|
@@ -7032,11 +7201,48 @@ ZodUnion.create = (types, params) => {
|
|
|
7032
7201
|
...processCreateParams(params),
|
|
7033
7202
|
});
|
|
7034
7203
|
};
|
|
7204
|
+
/////////////////////////////////////////////////////
|
|
7205
|
+
/////////////////////////////////////////////////////
|
|
7206
|
+
////////// //////////
|
|
7207
|
+
////////// ZodDiscriminatedUnion //////////
|
|
7208
|
+
////////// //////////
|
|
7209
|
+
/////////////////////////////////////////////////////
|
|
7210
|
+
/////////////////////////////////////////////////////
|
|
7211
|
+
const getDiscriminator = (type) => {
|
|
7212
|
+
if (type instanceof ZodLazy) {
|
|
7213
|
+
return getDiscriminator(type.schema);
|
|
7214
|
+
}
|
|
7215
|
+
else if (type instanceof ZodEffects) {
|
|
7216
|
+
return getDiscriminator(type.innerType());
|
|
7217
|
+
}
|
|
7218
|
+
else if (type instanceof ZodLiteral) {
|
|
7219
|
+
return [type.value];
|
|
7220
|
+
}
|
|
7221
|
+
else if (type instanceof ZodEnum) {
|
|
7222
|
+
return type.options;
|
|
7223
|
+
}
|
|
7224
|
+
else if (type instanceof ZodNativeEnum) {
|
|
7225
|
+
// eslint-disable-next-line ban/ban
|
|
7226
|
+
return Object.keys(type.enum);
|
|
7227
|
+
}
|
|
7228
|
+
else if (type instanceof ZodDefault) {
|
|
7229
|
+
return getDiscriminator(type._def.innerType);
|
|
7230
|
+
}
|
|
7231
|
+
else if (type instanceof ZodUndefined) {
|
|
7232
|
+
return [undefined];
|
|
7233
|
+
}
|
|
7234
|
+
else if (type instanceof ZodNull) {
|
|
7235
|
+
return [null];
|
|
7236
|
+
}
|
|
7237
|
+
else {
|
|
7238
|
+
return null;
|
|
7239
|
+
}
|
|
7240
|
+
};
|
|
7035
7241
|
class ZodDiscriminatedUnion extends ZodType {
|
|
7036
7242
|
_parse(input) {
|
|
7037
7243
|
const { ctx } = this._processInputParams(input);
|
|
7038
7244
|
if (ctx.parsedType !== util_1.ZodParsedType.object) {
|
|
7039
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7245
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7040
7246
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7041
7247
|
expected: util_1.ZodParsedType.object,
|
|
7042
7248
|
received: ctx.parsedType,
|
|
@@ -7045,11 +7251,11 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
7045
7251
|
}
|
|
7046
7252
|
const discriminator = this.discriminator;
|
|
7047
7253
|
const discriminatorValue = ctx.data[discriminator];
|
|
7048
|
-
const option = this.
|
|
7254
|
+
const option = this.optionsMap.get(discriminatorValue);
|
|
7049
7255
|
if (!option) {
|
|
7050
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7256
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7051
7257
|
code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
|
|
7052
|
-
options: this.
|
|
7258
|
+
options: Array.from(this.optionsMap.keys()),
|
|
7053
7259
|
path: [discriminator],
|
|
7054
7260
|
});
|
|
7055
7261
|
return parseUtil_1.INVALID;
|
|
@@ -7072,12 +7278,12 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
7072
7278
|
get discriminator() {
|
|
7073
7279
|
return this._def.discriminator;
|
|
7074
7280
|
}
|
|
7075
|
-
get validDiscriminatorValues() {
|
|
7076
|
-
return Array.from(this.options.keys());
|
|
7077
|
-
}
|
|
7078
7281
|
get options() {
|
|
7079
7282
|
return this._def.options;
|
|
7080
7283
|
}
|
|
7284
|
+
get optionsMap() {
|
|
7285
|
+
return this._def.optionsMap;
|
|
7286
|
+
}
|
|
7081
7287
|
/**
|
|
7082
7288
|
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
7083
7289
|
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
@@ -7086,34 +7292,35 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
7086
7292
|
* @param types an array of object schemas
|
|
7087
7293
|
* @param params
|
|
7088
7294
|
*/
|
|
7089
|
-
static create(discriminator,
|
|
7295
|
+
static create(discriminator, options, params) {
|
|
7090
7296
|
// Get all the valid discriminator values
|
|
7091
|
-
const
|
|
7092
|
-
try {
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7297
|
+
const optionsMap = new Map();
|
|
7298
|
+
// try {
|
|
7299
|
+
for (const type of options) {
|
|
7300
|
+
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
7301
|
+
if (!discriminatorValues) {
|
|
7302
|
+
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
7303
|
+
}
|
|
7304
|
+
for (const value of discriminatorValues) {
|
|
7305
|
+
if (optionsMap.has(value)) {
|
|
7306
|
+
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
7307
|
+
}
|
|
7308
|
+
optionsMap.set(value, type);
|
|
7309
|
+
}
|
|
7104
7310
|
}
|
|
7105
7311
|
return new ZodDiscriminatedUnion({
|
|
7106
7312
|
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
7107
7313
|
discriminator,
|
|
7108
7314
|
options,
|
|
7315
|
+
optionsMap,
|
|
7109
7316
|
...processCreateParams(params),
|
|
7110
7317
|
});
|
|
7111
7318
|
}
|
|
7112
7319
|
}
|
|
7113
7320
|
exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
|
|
7114
7321
|
function mergeValues(a, b) {
|
|
7115
|
-
const aType = util_1.getParsedType(a);
|
|
7116
|
-
const bType = util_1.getParsedType(b);
|
|
7322
|
+
const aType = (0, util_1.getParsedType)(a);
|
|
7323
|
+
const bType = (0, util_1.getParsedType)(b);
|
|
7117
7324
|
if (a === b) {
|
|
7118
7325
|
return { valid: true, data: a };
|
|
7119
7326
|
}
|
|
@@ -7161,17 +7368,17 @@ class ZodIntersection extends ZodType {
|
|
|
7161
7368
|
_parse(input) {
|
|
7162
7369
|
const { status, ctx } = this._processInputParams(input);
|
|
7163
7370
|
const handleParsed = (parsedLeft, parsedRight) => {
|
|
7164
|
-
if (parseUtil_1.isAborted(parsedLeft) || parseUtil_1.isAborted(parsedRight)) {
|
|
7371
|
+
if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
|
|
7165
7372
|
return parseUtil_1.INVALID;
|
|
7166
7373
|
}
|
|
7167
7374
|
const merged = mergeValues(parsedLeft.value, parsedRight.value);
|
|
7168
7375
|
if (!merged.valid) {
|
|
7169
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7376
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7170
7377
|
code: ZodError_1.ZodIssueCode.invalid_intersection_types,
|
|
7171
7378
|
});
|
|
7172
7379
|
return parseUtil_1.INVALID;
|
|
7173
7380
|
}
|
|
7174
|
-
if (parseUtil_1.isDirty(parsedLeft) || parseUtil_1.isDirty(parsedRight)) {
|
|
7381
|
+
if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
|
|
7175
7382
|
status.dirty();
|
|
7176
7383
|
}
|
|
7177
7384
|
return { status: status.value, value: merged.data };
|
|
@@ -7216,7 +7423,7 @@ class ZodTuple extends ZodType {
|
|
|
7216
7423
|
_parse(input) {
|
|
7217
7424
|
const { status, ctx } = this._processInputParams(input);
|
|
7218
7425
|
if (ctx.parsedType !== util_1.ZodParsedType.array) {
|
|
7219
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7426
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7220
7427
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7221
7428
|
expected: util_1.ZodParsedType.array,
|
|
7222
7429
|
received: ctx.parsedType,
|
|
@@ -7224,20 +7431,22 @@ class ZodTuple extends ZodType {
|
|
|
7224
7431
|
return parseUtil_1.INVALID;
|
|
7225
7432
|
}
|
|
7226
7433
|
if (ctx.data.length < this._def.items.length) {
|
|
7227
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7434
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7228
7435
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
7229
7436
|
minimum: this._def.items.length,
|
|
7230
7437
|
inclusive: true,
|
|
7438
|
+
exact: false,
|
|
7231
7439
|
type: "array",
|
|
7232
7440
|
});
|
|
7233
7441
|
return parseUtil_1.INVALID;
|
|
7234
7442
|
}
|
|
7235
7443
|
const rest = this._def.rest;
|
|
7236
7444
|
if (!rest && ctx.data.length > this._def.items.length) {
|
|
7237
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7445
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7238
7446
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
7239
7447
|
maximum: this._def.items.length,
|
|
7240
7448
|
inclusive: true,
|
|
7449
|
+
exact: false,
|
|
7241
7450
|
type: "array",
|
|
7242
7451
|
});
|
|
7243
7452
|
status.dirty();
|
|
@@ -7271,6 +7480,9 @@ class ZodTuple extends ZodType {
|
|
|
7271
7480
|
}
|
|
7272
7481
|
exports.ZodTuple = ZodTuple;
|
|
7273
7482
|
ZodTuple.create = (schemas, params) => {
|
|
7483
|
+
if (!Array.isArray(schemas)) {
|
|
7484
|
+
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
7485
|
+
}
|
|
7274
7486
|
return new ZodTuple({
|
|
7275
7487
|
items: schemas,
|
|
7276
7488
|
typeName: ZodFirstPartyTypeKind.ZodTuple,
|
|
@@ -7288,7 +7500,7 @@ class ZodRecord extends ZodType {
|
|
|
7288
7500
|
_parse(input) {
|
|
7289
7501
|
const { status, ctx } = this._processInputParams(input);
|
|
7290
7502
|
if (ctx.parsedType !== util_1.ZodParsedType.object) {
|
|
7291
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7503
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7292
7504
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7293
7505
|
expected: util_1.ZodParsedType.object,
|
|
7294
7506
|
received: ctx.parsedType,
|
|
@@ -7336,7 +7548,7 @@ class ZodMap extends ZodType {
|
|
|
7336
7548
|
_parse(input) {
|
|
7337
7549
|
const { status, ctx } = this._processInputParams(input);
|
|
7338
7550
|
if (ctx.parsedType !== util_1.ZodParsedType.map) {
|
|
7339
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7551
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7340
7552
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7341
7553
|
expected: util_1.ZodParsedType.map,
|
|
7342
7554
|
received: ctx.parsedType,
|
|
@@ -7398,7 +7610,7 @@ class ZodSet extends ZodType {
|
|
|
7398
7610
|
_parse(input) {
|
|
7399
7611
|
const { status, ctx } = this._processInputParams(input);
|
|
7400
7612
|
if (ctx.parsedType !== util_1.ZodParsedType.set) {
|
|
7401
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7613
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7402
7614
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7403
7615
|
expected: util_1.ZodParsedType.set,
|
|
7404
7616
|
received: ctx.parsedType,
|
|
@@ -7408,11 +7620,12 @@ class ZodSet extends ZodType {
|
|
|
7408
7620
|
const def = this._def;
|
|
7409
7621
|
if (def.minSize !== null) {
|
|
7410
7622
|
if (ctx.data.size < def.minSize.value) {
|
|
7411
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7623
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7412
7624
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
7413
7625
|
minimum: def.minSize.value,
|
|
7414
7626
|
type: "set",
|
|
7415
7627
|
inclusive: true,
|
|
7628
|
+
exact: false,
|
|
7416
7629
|
message: def.minSize.message,
|
|
7417
7630
|
});
|
|
7418
7631
|
status.dirty();
|
|
@@ -7420,11 +7633,12 @@ class ZodSet extends ZodType {
|
|
|
7420
7633
|
}
|
|
7421
7634
|
if (def.maxSize !== null) {
|
|
7422
7635
|
if (ctx.data.size > def.maxSize.value) {
|
|
7423
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7636
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7424
7637
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
7425
7638
|
maximum: def.maxSize.value,
|
|
7426
7639
|
type: "set",
|
|
7427
7640
|
inclusive: true,
|
|
7641
|
+
exact: false,
|
|
7428
7642
|
message: def.maxSize.message,
|
|
7429
7643
|
});
|
|
7430
7644
|
status.dirty();
|
|
@@ -7487,7 +7701,7 @@ class ZodFunction extends ZodType {
|
|
|
7487
7701
|
_parse(input) {
|
|
7488
7702
|
const { ctx } = this._processInputParams(input);
|
|
7489
7703
|
if (ctx.parsedType !== util_1.ZodParsedType.function) {
|
|
7490
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7704
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7491
7705
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7492
7706
|
expected: util_1.ZodParsedType.function,
|
|
7493
7707
|
received: ctx.parsedType,
|
|
@@ -7495,14 +7709,14 @@ class ZodFunction extends ZodType {
|
|
|
7495
7709
|
return parseUtil_1.INVALID;
|
|
7496
7710
|
}
|
|
7497
7711
|
function makeArgsIssue(args, error) {
|
|
7498
|
-
return parseUtil_1.makeIssue({
|
|
7712
|
+
return (0, parseUtil_1.makeIssue)({
|
|
7499
7713
|
data: args,
|
|
7500
7714
|
path: ctx.path,
|
|
7501
7715
|
errorMaps: [
|
|
7502
7716
|
ctx.common.contextualErrorMap,
|
|
7503
7717
|
ctx.schemaErrorMap,
|
|
7504
|
-
|
|
7505
|
-
|
|
7718
|
+
(0, errors_1.getErrorMap)(),
|
|
7719
|
+
errors_1.defaultErrorMap,
|
|
7506
7720
|
].filter((x) => !!x),
|
|
7507
7721
|
issueData: {
|
|
7508
7722
|
code: ZodError_1.ZodIssueCode.invalid_arguments,
|
|
@@ -7511,14 +7725,14 @@ class ZodFunction extends ZodType {
|
|
|
7511
7725
|
});
|
|
7512
7726
|
}
|
|
7513
7727
|
function makeReturnsIssue(returns, error) {
|
|
7514
|
-
return parseUtil_1.makeIssue({
|
|
7728
|
+
return (0, parseUtil_1.makeIssue)({
|
|
7515
7729
|
data: returns,
|
|
7516
7730
|
path: ctx.path,
|
|
7517
7731
|
errorMaps: [
|
|
7518
7732
|
ctx.common.contextualErrorMap,
|
|
7519
7733
|
ctx.schemaErrorMap,
|
|
7520
|
-
|
|
7521
|
-
|
|
7734
|
+
(0, errors_1.getErrorMap)(),
|
|
7735
|
+
errors_1.defaultErrorMap,
|
|
7522
7736
|
].filter((x) => !!x),
|
|
7523
7737
|
issueData: {
|
|
7524
7738
|
code: ZodError_1.ZodIssueCode.invalid_return_type,
|
|
@@ -7529,7 +7743,7 @@ class ZodFunction extends ZodType {
|
|
|
7529
7743
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
7530
7744
|
const fn = ctx.data;
|
|
7531
7745
|
if (this._def.returns instanceof ZodPromise) {
|
|
7532
|
-
return parseUtil_1.OK(async (...args) => {
|
|
7746
|
+
return (0, parseUtil_1.OK)(async (...args) => {
|
|
7533
7747
|
const error = new ZodError_1.ZodError([]);
|
|
7534
7748
|
const parsedArgs = await this._def.args
|
|
7535
7749
|
.parseAsync(args, params)
|
|
@@ -7548,7 +7762,7 @@ class ZodFunction extends ZodType {
|
|
|
7548
7762
|
});
|
|
7549
7763
|
}
|
|
7550
7764
|
else {
|
|
7551
|
-
return parseUtil_1.OK((...args) => {
|
|
7765
|
+
return (0, parseUtil_1.OK)((...args) => {
|
|
7552
7766
|
const parsedArgs = this._def.args.safeParse(args, params);
|
|
7553
7767
|
if (!parsedArgs.success) {
|
|
7554
7768
|
throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
@@ -7588,18 +7802,18 @@ class ZodFunction extends ZodType {
|
|
|
7588
7802
|
const validatedFunc = this.parse(func);
|
|
7589
7803
|
return validatedFunc;
|
|
7590
7804
|
}
|
|
7805
|
+
static create(args, returns, params) {
|
|
7806
|
+
return new ZodFunction({
|
|
7807
|
+
args: (args
|
|
7808
|
+
? args
|
|
7809
|
+
: ZodTuple.create([]).rest(ZodUnknown.create())),
|
|
7810
|
+
returns: returns || ZodUnknown.create(),
|
|
7811
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
7812
|
+
...processCreateParams(params),
|
|
7813
|
+
});
|
|
7814
|
+
}
|
|
7591
7815
|
}
|
|
7592
7816
|
exports.ZodFunction = ZodFunction;
|
|
7593
|
-
ZodFunction.create = (args, returns, params) => {
|
|
7594
|
-
return new ZodFunction({
|
|
7595
|
-
args: (args
|
|
7596
|
-
? args.rest(ZodUnknown.create())
|
|
7597
|
-
: ZodTuple.create([]).rest(ZodUnknown.create())),
|
|
7598
|
-
returns: returns || ZodUnknown.create(),
|
|
7599
|
-
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
7600
|
-
...processCreateParams(params),
|
|
7601
|
-
});
|
|
7602
|
-
};
|
|
7603
7817
|
class ZodLazy extends ZodType {
|
|
7604
7818
|
get schema() {
|
|
7605
7819
|
return this._def.getter();
|
|
@@ -7622,7 +7836,7 @@ class ZodLiteral extends ZodType {
|
|
|
7622
7836
|
_parse(input) {
|
|
7623
7837
|
if (input.data !== this._def.value) {
|
|
7624
7838
|
const ctx = this._getOrReturnCtx(input);
|
|
7625
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7839
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7626
7840
|
code: ZodError_1.ZodIssueCode.invalid_literal,
|
|
7627
7841
|
expected: this._def.value,
|
|
7628
7842
|
});
|
|
@@ -7654,7 +7868,7 @@ class ZodEnum extends ZodType {
|
|
|
7654
7868
|
if (typeof input.data !== "string") {
|
|
7655
7869
|
const ctx = this._getOrReturnCtx(input);
|
|
7656
7870
|
const expectedValues = this._def.values;
|
|
7657
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7871
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7658
7872
|
expected: util_1.util.joinValues(expectedValues),
|
|
7659
7873
|
received: ctx.parsedType,
|
|
7660
7874
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
@@ -7664,14 +7878,14 @@ class ZodEnum extends ZodType {
|
|
|
7664
7878
|
if (this._def.values.indexOf(input.data) === -1) {
|
|
7665
7879
|
const ctx = this._getOrReturnCtx(input);
|
|
7666
7880
|
const expectedValues = this._def.values;
|
|
7667
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7881
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7668
7882
|
received: ctx.data,
|
|
7669
7883
|
code: ZodError_1.ZodIssueCode.invalid_enum_value,
|
|
7670
7884
|
options: expectedValues,
|
|
7671
7885
|
});
|
|
7672
7886
|
return parseUtil_1.INVALID;
|
|
7673
7887
|
}
|
|
7674
|
-
return parseUtil_1.OK(input.data);
|
|
7888
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
7675
7889
|
}
|
|
7676
7890
|
get options() {
|
|
7677
7891
|
return this._def.values;
|
|
@@ -7707,7 +7921,7 @@ class ZodNativeEnum extends ZodType {
|
|
|
7707
7921
|
if (ctx.parsedType !== util_1.ZodParsedType.string &&
|
|
7708
7922
|
ctx.parsedType !== util_1.ZodParsedType.number) {
|
|
7709
7923
|
const expectedValues = util_1.util.objectValues(nativeEnumValues);
|
|
7710
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7924
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7711
7925
|
expected: util_1.util.joinValues(expectedValues),
|
|
7712
7926
|
received: ctx.parsedType,
|
|
7713
7927
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
@@ -7716,14 +7930,14 @@ class ZodNativeEnum extends ZodType {
|
|
|
7716
7930
|
}
|
|
7717
7931
|
if (nativeEnumValues.indexOf(input.data) === -1) {
|
|
7718
7932
|
const expectedValues = util_1.util.objectValues(nativeEnumValues);
|
|
7719
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7933
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7720
7934
|
received: ctx.data,
|
|
7721
7935
|
code: ZodError_1.ZodIssueCode.invalid_enum_value,
|
|
7722
7936
|
options: expectedValues,
|
|
7723
7937
|
});
|
|
7724
7938
|
return parseUtil_1.INVALID;
|
|
7725
7939
|
}
|
|
7726
|
-
return parseUtil_1.OK(input.data);
|
|
7940
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
7727
7941
|
}
|
|
7728
7942
|
get enum() {
|
|
7729
7943
|
return this._def.values;
|
|
@@ -7742,7 +7956,7 @@ class ZodPromise extends ZodType {
|
|
|
7742
7956
|
const { ctx } = this._processInputParams(input);
|
|
7743
7957
|
if (ctx.parsedType !== util_1.ZodParsedType.promise &&
|
|
7744
7958
|
ctx.common.async === false) {
|
|
7745
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
7959
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7746
7960
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7747
7961
|
expected: util_1.ZodParsedType.promise,
|
|
7748
7962
|
received: ctx.parsedType,
|
|
@@ -7752,7 +7966,7 @@ class ZodPromise extends ZodType {
|
|
|
7752
7966
|
const promisified = ctx.parsedType === util_1.ZodParsedType.promise
|
|
7753
7967
|
? ctx.data
|
|
7754
7968
|
: Promise.resolve(ctx.data);
|
|
7755
|
-
return parseUtil_1.OK(promisified.then((data) => {
|
|
7969
|
+
return (0, parseUtil_1.OK)(promisified.then((data) => {
|
|
7756
7970
|
return this._def.type.parseAsync(data, {
|
|
7757
7971
|
path: ctx.path,
|
|
7758
7972
|
errorMap: ctx.common.contextualErrorMap,
|
|
@@ -7772,6 +7986,11 @@ class ZodEffects extends ZodType {
|
|
|
7772
7986
|
innerType() {
|
|
7773
7987
|
return this._def.schema;
|
|
7774
7988
|
}
|
|
7989
|
+
sourceType() {
|
|
7990
|
+
return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
|
|
7991
|
+
? this._def.schema.sourceType()
|
|
7992
|
+
: this._def.schema;
|
|
7993
|
+
}
|
|
7775
7994
|
_parse(input) {
|
|
7776
7995
|
const { status, ctx } = this._processInputParams(input);
|
|
7777
7996
|
const effect = this._def.effect || null;
|
|
@@ -7796,7 +8015,7 @@ class ZodEffects extends ZodType {
|
|
|
7796
8015
|
}
|
|
7797
8016
|
const checkCtx = {
|
|
7798
8017
|
addIssue: (arg) => {
|
|
7799
|
-
parseUtil_1.addIssueToContext(ctx, arg);
|
|
8018
|
+
(0, parseUtil_1.addIssueToContext)(ctx, arg);
|
|
7800
8019
|
if (arg.fatal) {
|
|
7801
8020
|
status.abort();
|
|
7802
8021
|
}
|
|
@@ -7861,7 +8080,7 @@ class ZodEffects extends ZodType {
|
|
|
7861
8080
|
// if (base.status === "dirty") {
|
|
7862
8081
|
// return { status: "dirty", value: base.value };
|
|
7863
8082
|
// }
|
|
7864
|
-
if (!parseUtil_1.isValid(base))
|
|
8083
|
+
if (!(0, parseUtil_1.isValid)(base))
|
|
7865
8084
|
return base;
|
|
7866
8085
|
const result = effect.transform(base.value, checkCtx);
|
|
7867
8086
|
if (result instanceof Promise) {
|
|
@@ -7873,7 +8092,7 @@ class ZodEffects extends ZodType {
|
|
|
7873
8092
|
return this._def.schema
|
|
7874
8093
|
._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
|
|
7875
8094
|
.then((base) => {
|
|
7876
|
-
if (!parseUtil_1.isValid(base))
|
|
8095
|
+
if (!(0, parseUtil_1.isValid)(base))
|
|
7877
8096
|
return base;
|
|
7878
8097
|
// if (base.status === "aborted") return INVALID;
|
|
7879
8098
|
// if (base.status === "dirty") {
|
|
@@ -7908,7 +8127,7 @@ class ZodOptional extends ZodType {
|
|
|
7908
8127
|
_parse(input) {
|
|
7909
8128
|
const parsedType = this._getType(input);
|
|
7910
8129
|
if (parsedType === util_1.ZodParsedType.undefined) {
|
|
7911
|
-
return parseUtil_1.OK(undefined);
|
|
8130
|
+
return (0, parseUtil_1.OK)(undefined);
|
|
7912
8131
|
}
|
|
7913
8132
|
return this._def.innerType._parse(input);
|
|
7914
8133
|
}
|
|
@@ -7928,7 +8147,7 @@ class ZodNullable extends ZodType {
|
|
|
7928
8147
|
_parse(input) {
|
|
7929
8148
|
const parsedType = this._getType(input);
|
|
7930
8149
|
if (parsedType === util_1.ZodParsedType.null) {
|
|
7931
|
-
return parseUtil_1.OK(null);
|
|
8150
|
+
return (0, parseUtil_1.OK)(null);
|
|
7932
8151
|
}
|
|
7933
8152
|
return this._def.innerType._parse(input);
|
|
7934
8153
|
}
|
|
@@ -7963,9 +8182,50 @@ class ZodDefault extends ZodType {
|
|
|
7963
8182
|
}
|
|
7964
8183
|
exports.ZodDefault = ZodDefault;
|
|
7965
8184
|
ZodDefault.create = (type, params) => {
|
|
7966
|
-
return new
|
|
8185
|
+
return new ZodDefault({
|
|
7967
8186
|
innerType: type,
|
|
7968
|
-
typeName: ZodFirstPartyTypeKind.
|
|
8187
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault,
|
|
8188
|
+
defaultValue: typeof params.default === "function"
|
|
8189
|
+
? params.default
|
|
8190
|
+
: () => params.default,
|
|
8191
|
+
...processCreateParams(params),
|
|
8192
|
+
});
|
|
8193
|
+
};
|
|
8194
|
+
class ZodCatch extends ZodType {
|
|
8195
|
+
_parse(input) {
|
|
8196
|
+
const { ctx } = this._processInputParams(input);
|
|
8197
|
+
const result = this._def.innerType._parse({
|
|
8198
|
+
data: ctx.data,
|
|
8199
|
+
path: ctx.path,
|
|
8200
|
+
parent: ctx,
|
|
8201
|
+
});
|
|
8202
|
+
if ((0, parseUtil_1.isAsync)(result)) {
|
|
8203
|
+
return result.then((result) => {
|
|
8204
|
+
return {
|
|
8205
|
+
status: "valid",
|
|
8206
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue(),
|
|
8207
|
+
};
|
|
8208
|
+
});
|
|
8209
|
+
}
|
|
8210
|
+
else {
|
|
8211
|
+
return {
|
|
8212
|
+
status: "valid",
|
|
8213
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue(),
|
|
8214
|
+
};
|
|
8215
|
+
}
|
|
8216
|
+
}
|
|
8217
|
+
removeDefault() {
|
|
8218
|
+
return this._def.innerType;
|
|
8219
|
+
}
|
|
8220
|
+
}
|
|
8221
|
+
exports.ZodCatch = ZodCatch;
|
|
8222
|
+
ZodCatch.create = (type, params) => {
|
|
8223
|
+
return new ZodCatch({
|
|
8224
|
+
innerType: type,
|
|
8225
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
8226
|
+
defaultValue: typeof params.default === "function"
|
|
8227
|
+
? params.default
|
|
8228
|
+
: () => params.default,
|
|
7969
8229
|
...processCreateParams(params),
|
|
7970
8230
|
});
|
|
7971
8231
|
};
|
|
@@ -7974,7 +8234,7 @@ class ZodNaN extends ZodType {
|
|
|
7974
8234
|
const parsedType = this._getType(input);
|
|
7975
8235
|
if (parsedType !== util_1.ZodParsedType.nan) {
|
|
7976
8236
|
const ctx = this._getOrReturnCtx(input);
|
|
7977
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
8237
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
7978
8238
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
7979
8239
|
expected: util_1.ZodParsedType.nan,
|
|
7980
8240
|
received: ctx.parsedType,
|
|
@@ -8007,6 +8267,65 @@ class ZodBranded extends ZodType {
|
|
|
8007
8267
|
}
|
|
8008
8268
|
}
|
|
8009
8269
|
exports.ZodBranded = ZodBranded;
|
|
8270
|
+
class ZodPipeline extends ZodType {
|
|
8271
|
+
_parse(input) {
|
|
8272
|
+
const { status, ctx } = this._processInputParams(input);
|
|
8273
|
+
if (ctx.common.async) {
|
|
8274
|
+
const handleAsync = async () => {
|
|
8275
|
+
const inResult = await this._def.in._parseAsync({
|
|
8276
|
+
data: ctx.data,
|
|
8277
|
+
path: ctx.path,
|
|
8278
|
+
parent: ctx,
|
|
8279
|
+
});
|
|
8280
|
+
if (inResult.status === "aborted")
|
|
8281
|
+
return parseUtil_1.INVALID;
|
|
8282
|
+
if (inResult.status === "dirty") {
|
|
8283
|
+
status.dirty();
|
|
8284
|
+
return (0, parseUtil_1.DIRTY)(inResult.value);
|
|
8285
|
+
}
|
|
8286
|
+
else {
|
|
8287
|
+
return this._def.out._parseAsync({
|
|
8288
|
+
data: inResult.value,
|
|
8289
|
+
path: ctx.path,
|
|
8290
|
+
parent: ctx,
|
|
8291
|
+
});
|
|
8292
|
+
}
|
|
8293
|
+
};
|
|
8294
|
+
return handleAsync();
|
|
8295
|
+
}
|
|
8296
|
+
else {
|
|
8297
|
+
const inResult = this._def.in._parseSync({
|
|
8298
|
+
data: ctx.data,
|
|
8299
|
+
path: ctx.path,
|
|
8300
|
+
parent: ctx,
|
|
8301
|
+
});
|
|
8302
|
+
if (inResult.status === "aborted")
|
|
8303
|
+
return parseUtil_1.INVALID;
|
|
8304
|
+
if (inResult.status === "dirty") {
|
|
8305
|
+
status.dirty();
|
|
8306
|
+
return {
|
|
8307
|
+
status: "dirty",
|
|
8308
|
+
value: inResult.value,
|
|
8309
|
+
};
|
|
8310
|
+
}
|
|
8311
|
+
else {
|
|
8312
|
+
return this._def.out._parseSync({
|
|
8313
|
+
data: inResult.value,
|
|
8314
|
+
path: ctx.path,
|
|
8315
|
+
parent: ctx,
|
|
8316
|
+
});
|
|
8317
|
+
}
|
|
8318
|
+
}
|
|
8319
|
+
}
|
|
8320
|
+
static create(a, b) {
|
|
8321
|
+
return new ZodPipeline({
|
|
8322
|
+
in: a,
|
|
8323
|
+
out: b,
|
|
8324
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline,
|
|
8325
|
+
});
|
|
8326
|
+
}
|
|
8327
|
+
}
|
|
8328
|
+
exports.ZodPipeline = ZodPipeline;
|
|
8010
8329
|
const custom = (check, params = {}, fatal) => {
|
|
8011
8330
|
if (check)
|
|
8012
8331
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
@@ -8030,6 +8349,7 @@ var ZodFirstPartyTypeKind;
|
|
|
8030
8349
|
ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
|
|
8031
8350
|
ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
|
|
8032
8351
|
ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
|
|
8352
|
+
ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
|
|
8033
8353
|
ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
|
|
8034
8354
|
ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
|
|
8035
8355
|
ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
|
|
@@ -8054,12 +8374,21 @@ var ZodFirstPartyTypeKind;
|
|
|
8054
8374
|
ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
|
|
8055
8375
|
ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
|
|
8056
8376
|
ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
|
|
8377
|
+
ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
|
|
8057
8378
|
ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
|
|
8058
8379
|
ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
|
|
8380
|
+
ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
|
|
8059
8381
|
})(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {}));
|
|
8060
|
-
|
|
8382
|
+
// new approach that works for abstract classes
|
|
8383
|
+
// but requires TS 4.4+
|
|
8384
|
+
class Class {
|
|
8385
|
+
constructor(..._) { }
|
|
8386
|
+
}
|
|
8387
|
+
const instanceOfType = (
|
|
8388
|
+
// const instanceOfType = <T extends new (...args: any[]) => any>(
|
|
8389
|
+
cls, params = {
|
|
8061
8390
|
message: `Input not instance of ${cls.name}`,
|
|
8062
|
-
}) => exports.custom((data) => data instanceof cls, params, true);
|
|
8391
|
+
}) => (0, exports.custom)((data) => data instanceof cls, params, true);
|
|
8063
8392
|
exports["instanceof"] = instanceOfType;
|
|
8064
8393
|
const stringType = ZodString.create;
|
|
8065
8394
|
exports.string = stringType;
|
|
@@ -8073,6 +8402,8 @@ const booleanType = ZodBoolean.create;
|
|
|
8073
8402
|
exports.boolean = booleanType;
|
|
8074
8403
|
const dateType = ZodDate.create;
|
|
8075
8404
|
exports.date = dateType;
|
|
8405
|
+
const symbolType = ZodSymbol.create;
|
|
8406
|
+
exports.symbol = symbolType;
|
|
8076
8407
|
const undefinedType = ZodUndefined.create;
|
|
8077
8408
|
exports.undefined = undefinedType;
|
|
8078
8409
|
const nullType = ZodNull.create;
|
|
@@ -8126,23 +8457,33 @@ const nullableType = ZodNullable.create;
|
|
|
8126
8457
|
exports.nullable = nullableType;
|
|
8127
8458
|
const preprocessType = ZodEffects.createWithPreprocess;
|
|
8128
8459
|
exports.preprocess = preprocessType;
|
|
8460
|
+
const pipelineType = ZodPipeline.create;
|
|
8461
|
+
exports.pipeline = pipelineType;
|
|
8129
8462
|
const ostring = () => stringType().optional();
|
|
8130
8463
|
exports.ostring = ostring;
|
|
8131
8464
|
const onumber = () => numberType().optional();
|
|
8132
8465
|
exports.onumber = onumber;
|
|
8133
8466
|
const oboolean = () => booleanType().optional();
|
|
8134
8467
|
exports.oboolean = oboolean;
|
|
8468
|
+
exports.coerce = {
|
|
8469
|
+
string: ((arg) => ZodString.create({ ...arg, coerce: true })),
|
|
8470
|
+
number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
|
|
8471
|
+
boolean: ((arg) => ZodBoolean.create({ ...arg, coerce: true })),
|
|
8472
|
+
bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
|
|
8473
|
+
date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
|
|
8474
|
+
};
|
|
8475
|
+
exports.NEVER = parseUtil_1.INVALID;
|
|
8135
8476
|
|
|
8136
8477
|
|
|
8137
8478
|
/***/ }),
|
|
8138
8479
|
|
|
8139
|
-
/***/
|
|
8480
|
+
/***/ 2124:
|
|
8140
8481
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8141
8482
|
|
|
8142
8483
|
|
|
8143
8484
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8144
8485
|
exports.defaultTimeout = exports.defaultMetadata = exports.scope = exports.jwksUri = exports.accessTokenEndpoint = exports.authorizationEndpoint = exports.issuer = void 0;
|
|
8145
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
8486
|
+
const connector_kit_1 = __nccwpck_require__(4758);
|
|
8146
8487
|
// https://appleid.apple.com/.well-known/openid-configuration
|
|
8147
8488
|
exports.issuer = 'https://appleid.apple.com';
|
|
8148
8489
|
exports.authorizationEndpoint = `${exports.issuer}/auth/authorize`;
|
|
@@ -8176,13 +8517,13 @@ exports.defaultTimeout = 5000;
|
|
|
8176
8517
|
|
|
8177
8518
|
/***/ }),
|
|
8178
8519
|
|
|
8179
|
-
/***/
|
|
8520
|
+
/***/ 2174:
|
|
8180
8521
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8181
8522
|
|
|
8182
8523
|
|
|
8183
8524
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8184
8525
|
exports.dataGuard = exports.appleConfigGuard = void 0;
|
|
8185
|
-
const zod_1 = __nccwpck_require__(
|
|
8526
|
+
const zod_1 = __nccwpck_require__(6319);
|
|
8186
8527
|
exports.appleConfigGuard = zod_1.z.object({
|
|
8187
8528
|
clientId: zod_1.z.string(),
|
|
8188
8529
|
});
|
|
@@ -8241,6 +8582,332 @@ module.exports = require("util");
|
|
|
8241
8582
|
|
|
8242
8583
|
module.exports = require("zlib");
|
|
8243
8584
|
|
|
8585
|
+
/***/ }),
|
|
8586
|
+
|
|
8587
|
+
/***/ 4758:
|
|
8588
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8589
|
+
|
|
8590
|
+
|
|
8591
|
+
|
|
8592
|
+
var types = __nccwpck_require__(1876);
|
|
8593
|
+
|
|
8594
|
+
function validateConfig(config, guard) {
|
|
8595
|
+
const result = guard.safeParse(config);
|
|
8596
|
+
if (!result.success) {
|
|
8597
|
+
throw new types.ConnectorError(types.ConnectorErrorCodes.InvalidConfig, result.error);
|
|
8598
|
+
}
|
|
8599
|
+
}
|
|
8600
|
+
const parseJson = (jsonString, errorCode = types.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
|
|
8601
|
+
try {
|
|
8602
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
8603
|
+
return JSON.parse(jsonString);
|
|
8604
|
+
}
|
|
8605
|
+
catch {
|
|
8606
|
+
throw new types.ConnectorError(errorCode, errorPayload ?? jsonString);
|
|
8607
|
+
}
|
|
8608
|
+
};
|
|
8609
|
+
|
|
8610
|
+
exports.ConnectorError = types.ConnectorError;
|
|
8611
|
+
Object.defineProperty(exports, "ConnectorErrorCodes", ({
|
|
8612
|
+
enumerable: true,
|
|
8613
|
+
get: function () { return types.ConnectorErrorCodes; }
|
|
8614
|
+
}));
|
|
8615
|
+
Object.defineProperty(exports, "ConnectorPlatform", ({
|
|
8616
|
+
enumerable: true,
|
|
8617
|
+
get: function () { return types.ConnectorPlatform; }
|
|
8618
|
+
}));
|
|
8619
|
+
Object.defineProperty(exports, "ConnectorType", ({
|
|
8620
|
+
enumerable: true,
|
|
8621
|
+
get: function () { return types.ConnectorType; }
|
|
8622
|
+
}));
|
|
8623
|
+
Object.defineProperty(exports, "MessageTypes", ({
|
|
8624
|
+
enumerable: true,
|
|
8625
|
+
get: function () { return types.MessageTypes; }
|
|
8626
|
+
}));
|
|
8627
|
+
exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
|
|
8628
|
+
exports.connectorSessionGuard = types.connectorSessionGuard;
|
|
8629
|
+
exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
|
|
8630
|
+
exports.messageTypesGuard = types.messageTypesGuard;
|
|
8631
|
+
exports.parseJson = parseJson;
|
|
8632
|
+
exports.validateConfig = validateConfig;
|
|
8633
|
+
|
|
8634
|
+
|
|
8635
|
+
/***/ }),
|
|
8636
|
+
|
|
8637
|
+
/***/ 1876:
|
|
8638
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8639
|
+
|
|
8640
|
+
|
|
8641
|
+
|
|
8642
|
+
var languageKit = __nccwpck_require__(1230);
|
|
8643
|
+
var zod = __nccwpck_require__(6319);
|
|
8644
|
+
|
|
8645
|
+
// MARK: Foundation
|
|
8646
|
+
exports.ConnectorType = void 0;
|
|
8647
|
+
(function (ConnectorType) {
|
|
8648
|
+
ConnectorType["Email"] = "Email";
|
|
8649
|
+
ConnectorType["Sms"] = "Sms";
|
|
8650
|
+
ConnectorType["Social"] = "Social";
|
|
8651
|
+
})(exports.ConnectorType || (exports.ConnectorType = {}));
|
|
8652
|
+
exports.ConnectorPlatform = void 0;
|
|
8653
|
+
(function (ConnectorPlatform) {
|
|
8654
|
+
ConnectorPlatform["Native"] = "Native";
|
|
8655
|
+
ConnectorPlatform["Universal"] = "Universal";
|
|
8656
|
+
ConnectorPlatform["Web"] = "Web";
|
|
8657
|
+
})(exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
|
|
8658
|
+
const i18nPhrasesGuard = zod.z
|
|
8659
|
+
.object({ en: zod.z.string() })
|
|
8660
|
+
.and(zod.z.record(zod.z.string()))
|
|
8661
|
+
.refine((i18nObject) => {
|
|
8662
|
+
const keys = Object.keys(i18nObject);
|
|
8663
|
+
if (!keys.includes('en')) {
|
|
8664
|
+
return false;
|
|
8665
|
+
}
|
|
8666
|
+
for (const value of keys) {
|
|
8667
|
+
if (!languageKit.isLanguageTag(value)) {
|
|
8668
|
+
return false;
|
|
8669
|
+
}
|
|
8670
|
+
}
|
|
8671
|
+
return true;
|
|
8672
|
+
});
|
|
8673
|
+
exports.ConnectorErrorCodes = void 0;
|
|
8674
|
+
(function (ConnectorErrorCodes) {
|
|
8675
|
+
ConnectorErrorCodes["General"] = "general";
|
|
8676
|
+
ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
|
|
8677
|
+
ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
|
|
8678
|
+
ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
|
|
8679
|
+
ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
|
|
8680
|
+
ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
|
|
8681
|
+
ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
|
|
8682
|
+
ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
|
|
8683
|
+
ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
|
|
8684
|
+
ConnectorErrorCodes["NotImplemented"] = "not_implemented";
|
|
8685
|
+
ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
|
|
8686
|
+
ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
|
|
8687
|
+
ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
|
|
8688
|
+
ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
|
|
8689
|
+
})(exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
|
|
8690
|
+
class ConnectorError extends Error {
|
|
8691
|
+
constructor(code, data) {
|
|
8692
|
+
const message = typeof data === 'string' ? data : 'Connector error occurred.';
|
|
8693
|
+
super(message);
|
|
8694
|
+
this.code = code;
|
|
8695
|
+
this.data = typeof data === 'string' ? { message: data } : data;
|
|
8696
|
+
}
|
|
8697
|
+
}
|
|
8698
|
+
exports.MessageTypes = void 0;
|
|
8699
|
+
(function (MessageTypes) {
|
|
8700
|
+
MessageTypes["SignIn"] = "SignIn";
|
|
8701
|
+
MessageTypes["Register"] = "Register";
|
|
8702
|
+
MessageTypes["ForgotPassword"] = "ForgotPassword";
|
|
8703
|
+
MessageTypes["Continue"] = "Continue";
|
|
8704
|
+
MessageTypes["Test"] = "Test";
|
|
8705
|
+
})(exports.MessageTypes || (exports.MessageTypes = {}));
|
|
8706
|
+
const messageTypesGuard = zod.z.nativeEnum(exports.MessageTypes);
|
|
8707
|
+
const connectorMetadataGuard = zod.z.object({
|
|
8708
|
+
id: zod.z.string(),
|
|
8709
|
+
target: zod.z.string(),
|
|
8710
|
+
platform: zod.z.nativeEnum(exports.ConnectorPlatform).nullable(),
|
|
8711
|
+
name: i18nPhrasesGuard,
|
|
8712
|
+
logo: zod.z.string(),
|
|
8713
|
+
logoDark: zod.z.string().nullable(),
|
|
8714
|
+
description: i18nPhrasesGuard,
|
|
8715
|
+
isStandard: zod.z.boolean().optional(),
|
|
8716
|
+
readme: zod.z.string(),
|
|
8717
|
+
configTemplate: zod.z.string(),
|
|
8718
|
+
});
|
|
8719
|
+
const configurableConnectorMetadataGuard = connectorMetadataGuard
|
|
8720
|
+
.pick({
|
|
8721
|
+
target: true,
|
|
8722
|
+
name: true,
|
|
8723
|
+
logo: true,
|
|
8724
|
+
logoDark: true,
|
|
8725
|
+
})
|
|
8726
|
+
.partial();
|
|
8727
|
+
const connectorSessionGuard = zod.z.object({
|
|
8728
|
+
nonce: zod.z.string().optional(),
|
|
8729
|
+
redirectUri: zod.z.string().optional(),
|
|
8730
|
+
});
|
|
8731
|
+
|
|
8732
|
+
exports.ConnectorError = ConnectorError;
|
|
8733
|
+
exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
|
|
8734
|
+
exports.connectorSessionGuard = connectorSessionGuard;
|
|
8735
|
+
exports.i18nPhrasesGuard = i18nPhrasesGuard;
|
|
8736
|
+
exports.messageTypesGuard = messageTypesGuard;
|
|
8737
|
+
|
|
8738
|
+
|
|
8739
|
+
/***/ }),
|
|
8740
|
+
|
|
8741
|
+
/***/ 8670:
|
|
8742
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
8743
|
+
|
|
8744
|
+
|
|
8745
|
+
|
|
8746
|
+
const languages = Object.freeze({
|
|
8747
|
+
'af-ZA': 'Afrikaans',
|
|
8748
|
+
'am-ET': 'አማርኛ',
|
|
8749
|
+
'ar-AR': 'العربية',
|
|
8750
|
+
'as-IN': 'অসমীয়া',
|
|
8751
|
+
'az-AZ': 'Azərbaycan dili',
|
|
8752
|
+
'be-BY': 'Беларуская',
|
|
8753
|
+
'bg-BG': 'Български',
|
|
8754
|
+
'bn-IN': 'বাংলা',
|
|
8755
|
+
'br-FR': 'Brezhoneg',
|
|
8756
|
+
'bs-BA': 'Bosanski',
|
|
8757
|
+
'ca-ES': 'Català',
|
|
8758
|
+
'cb-IQ': 'کوردیی ناوەندی',
|
|
8759
|
+
'co-FR': 'Corsu',
|
|
8760
|
+
'cs-CZ': 'Čeština',
|
|
8761
|
+
'cx-PH': 'Bisaya',
|
|
8762
|
+
'cy-GB': 'Cymraeg',
|
|
8763
|
+
'da-DK': 'Dansk',
|
|
8764
|
+
de: 'Deutsch',
|
|
8765
|
+
'de-DE': 'Deutsch (Deutschland)',
|
|
8766
|
+
'el-GR': 'Ελληνικά',
|
|
8767
|
+
en: 'English',
|
|
8768
|
+
'en-GB': 'English (UK)',
|
|
8769
|
+
'en-US': 'English (US)',
|
|
8770
|
+
'eo-EO': 'Esperanto',
|
|
8771
|
+
es: 'Español',
|
|
8772
|
+
'es-ES': 'Español (España)',
|
|
8773
|
+
'es-419': 'Español (Latinoamérica)',
|
|
8774
|
+
'et-EE': 'Eesti',
|
|
8775
|
+
'eu-ES': 'Euskara',
|
|
8776
|
+
'fa-IR': 'فارسی',
|
|
8777
|
+
'ff-NG': 'Fula',
|
|
8778
|
+
'fi-FI': 'Suomi',
|
|
8779
|
+
'fo-FO': 'Føroyskt',
|
|
8780
|
+
fr: 'Français',
|
|
8781
|
+
'fr-CA': 'Français (Canada)',
|
|
8782
|
+
'fr-FR': 'Français (France)',
|
|
8783
|
+
'fy-NL': 'Frysk',
|
|
8784
|
+
'ga-IE': 'Gaeilge',
|
|
8785
|
+
'gl-ES': 'Galego',
|
|
8786
|
+
'gn-PY': 'Guarani',
|
|
8787
|
+
'gu-IN': 'ગુજરાતી',
|
|
8788
|
+
'ha-NG': 'Hausa',
|
|
8789
|
+
'he-IL': 'עברית',
|
|
8790
|
+
'hi-IN': 'हिन्दी',
|
|
8791
|
+
'hr-HR': 'Hrvatski',
|
|
8792
|
+
'ht-HT': 'Kreyòl Ayisyen',
|
|
8793
|
+
'hu-HU': 'Magyar',
|
|
8794
|
+
'hy-AM': 'Հայերեն',
|
|
8795
|
+
'id-ID': 'Bahasa Indonesia',
|
|
8796
|
+
'ik-US': 'Iñupiatun',
|
|
8797
|
+
'is-IS': 'Íslenska',
|
|
8798
|
+
it: 'Italiano',
|
|
8799
|
+
'it-IT': 'italiano (Italia)',
|
|
8800
|
+
'iu-CA': 'Inuktitut',
|
|
8801
|
+
ja: '日本語',
|
|
8802
|
+
'ja-JP': '日本語',
|
|
8803
|
+
'ja-KS': '日本語(関西)',
|
|
8804
|
+
'jv-ID': 'Basa Jawa',
|
|
8805
|
+
'ka-GE': 'ქართული',
|
|
8806
|
+
'kk-KZ': 'Қазақша',
|
|
8807
|
+
'km-KH': 'ភាសាខ្មែរ',
|
|
8808
|
+
'kn-IN': 'ಕನ್ನಡ',
|
|
8809
|
+
ko: '한국어',
|
|
8810
|
+
'ko-KR': '한국어',
|
|
8811
|
+
'ku-TR': 'Kurdî (Kurmancî)',
|
|
8812
|
+
'ky-KG': 'кыргызча',
|
|
8813
|
+
'lo-LA': 'ພາສາລາວ',
|
|
8814
|
+
'lt-LT': 'Lietuvių',
|
|
8815
|
+
'lv-LV': 'Latviešu',
|
|
8816
|
+
'mg-MG': 'Malagasy',
|
|
8817
|
+
'mk-MK': 'Македонски',
|
|
8818
|
+
'ml-IN': 'മലയാളം',
|
|
8819
|
+
'mn-MN': 'Монгол',
|
|
8820
|
+
'mr-IN': 'मराठी',
|
|
8821
|
+
'ms-MY': 'Bahasa Melayu',
|
|
8822
|
+
'mt-MT': 'Malti',
|
|
8823
|
+
'my-MM': 'မြန်မာဘာသာ',
|
|
8824
|
+
'nb-NO': 'Norsk (bokmål)',
|
|
8825
|
+
'ne-NP': 'नेपाली',
|
|
8826
|
+
'nl-BE': 'Vlaams',
|
|
8827
|
+
'nl-NL': 'Nederlands',
|
|
8828
|
+
'nn-NO': 'Norsk (nynorsk)',
|
|
8829
|
+
'or-IN': 'ଓଡ଼ିଆ',
|
|
8830
|
+
'pa-IN': 'ਪੰਜਾਬੀ',
|
|
8831
|
+
'pl-PL': 'Polski',
|
|
8832
|
+
'ps-AF': 'پښتو',
|
|
8833
|
+
pt: 'português',
|
|
8834
|
+
'pt-BR': 'Português (Brasil)',
|
|
8835
|
+
'pt-PT': 'português (Portugal)',
|
|
8836
|
+
'ro-RO': 'Română',
|
|
8837
|
+
ru: 'Русский',
|
|
8838
|
+
'ru-RU': 'Русский',
|
|
8839
|
+
'rw-RW': 'Ikinyarwanda',
|
|
8840
|
+
'sc-IT': 'Sardu',
|
|
8841
|
+
'si-LK': 'සිංහල',
|
|
8842
|
+
'sk-SK': 'Slovenčina',
|
|
8843
|
+
'sl-SI': 'Slovenščina',
|
|
8844
|
+
'sn-ZW': 'Shona',
|
|
8845
|
+
'sq-AL': 'Shqip',
|
|
8846
|
+
'sr-RS': 'Српски',
|
|
8847
|
+
'sv-SE': 'Svenska',
|
|
8848
|
+
'sw-KE': 'Kiswahili',
|
|
8849
|
+
'sy-SY': 'ܣܘܪܝܝܐ',
|
|
8850
|
+
'sz-PL': 'ślōnskŏ gŏdka',
|
|
8851
|
+
'ta-IN': 'தமிழ்',
|
|
8852
|
+
'te-IN': 'తెలుగు',
|
|
8853
|
+
'tg-TJ': 'Тоҷикӣ',
|
|
8854
|
+
'th-TH': 'ภาษาไทย',
|
|
8855
|
+
'tl-PH': 'Filipino',
|
|
8856
|
+
tr: 'Türkçe',
|
|
8857
|
+
'tr-TR': 'Türkçe',
|
|
8858
|
+
'tt-RU': 'Татарча',
|
|
8859
|
+
'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
|
|
8860
|
+
'uk-UA': 'Українська',
|
|
8861
|
+
'ur-PK': 'اردو',
|
|
8862
|
+
'uz-UZ': "O'zbek",
|
|
8863
|
+
'vi-VN': 'Tiếng Việt',
|
|
8864
|
+
zh: '中文',
|
|
8865
|
+
'zh-CN': '简体中文',
|
|
8866
|
+
'zh-HK': '繁體中文(香港)',
|
|
8867
|
+
'zh-MO': '繁體中文(澳門)',
|
|
8868
|
+
'zh-TW': '繁體中文(台灣)',
|
|
8869
|
+
'zz-TR': 'Zaza',
|
|
8870
|
+
});
|
|
8871
|
+
|
|
8872
|
+
exports.languages = languages;
|
|
8873
|
+
|
|
8874
|
+
|
|
8875
|
+
/***/ }),
|
|
8876
|
+
|
|
8877
|
+
/***/ 1230:
|
|
8878
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8879
|
+
|
|
8880
|
+
|
|
8881
|
+
|
|
8882
|
+
var _const = __nccwpck_require__(8670);
|
|
8883
|
+
var utility = __nccwpck_require__(2304);
|
|
8884
|
+
|
|
8885
|
+
|
|
8886
|
+
|
|
8887
|
+
exports.languages = _const.languages;
|
|
8888
|
+
exports.isLanguageTag = utility.isLanguageTag;
|
|
8889
|
+
exports.languageTagGuard = utility.languageTagGuard;
|
|
8890
|
+
|
|
8891
|
+
|
|
8892
|
+
/***/ }),
|
|
8893
|
+
|
|
8894
|
+
/***/ 2304:
|
|
8895
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8896
|
+
|
|
8897
|
+
|
|
8898
|
+
|
|
8899
|
+
var zod = __nccwpck_require__(6319);
|
|
8900
|
+
var _const = __nccwpck_require__(8670);
|
|
8901
|
+
|
|
8902
|
+
const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
|
|
8903
|
+
const languageTagGuard = zod.z
|
|
8904
|
+
.any()
|
|
8905
|
+
.refine((value) => isLanguageTag(value));
|
|
8906
|
+
|
|
8907
|
+
exports.isLanguageTag = isLanguageTag;
|
|
8908
|
+
exports.languageTagGuard = languageTagGuard;
|
|
8909
|
+
|
|
8910
|
+
|
|
8244
8911
|
/***/ })
|
|
8245
8912
|
|
|
8246
8913
|
/******/ });
|
|
@@ -8287,10 +8954,10 @@ var __webpack_exports__ = {};
|
|
|
8287
8954
|
var exports = __webpack_exports__;
|
|
8288
8955
|
|
|
8289
8956
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8290
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
8291
|
-
const jose_1 = __nccwpck_require__(
|
|
8292
|
-
const constant_1 = __nccwpck_require__(
|
|
8293
|
-
const types_1 = __nccwpck_require__(
|
|
8957
|
+
const connector_kit_1 = __nccwpck_require__(4758);
|
|
8958
|
+
const jose_1 = __nccwpck_require__(9179);
|
|
8959
|
+
const constant_1 = __nccwpck_require__(2124);
|
|
8960
|
+
const types_1 = __nccwpck_require__(2174);
|
|
8294
8961
|
// TO-DO: support nonce validation
|
|
8295
8962
|
const getAuthorizationUri = (getConfig) => async ({ state, redirectUri }) => {
|
|
8296
8963
|
const config = await getConfig(constant_1.defaultMetadata.id);
|