@logto/connector-github 1.0.0-beta.12 → 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 +1301 -856
- package/lib/jest.config.d.ts +1 -1
- package/lib/src/types.d.ts +3 -3
- package/package.json +29 -27
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 5254:
|
|
5
5
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
@@ -21,342 +21,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
24
|
-
|
|
25
|
-
const types_js_1 = __nccwpck_require__(6309);
|
|
26
|
-
__exportStar(__nccwpck_require__(6309), exports);
|
|
27
|
-
function validateConfig(config, guard) {
|
|
28
|
-
const result = guard.safeParse(config);
|
|
29
|
-
if (!result.success) {
|
|
30
|
-
throw new types_js_1.ConnectorError(types_js_1.ConnectorErrorCodes.InvalidConfig, result.error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.validateConfig = validateConfig;
|
|
34
|
-
const parseJson = (jsonString, errorCode = types_js_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_js_1.ConnectorError(errorCode, errorPayload ?? jsonString);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.parseJson = parseJson;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/***/ }),
|
|
47
|
-
|
|
48
|
-
/***/ 6309:
|
|
49
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
50
|
-
|
|
51
|
-
"use strict";
|
|
52
|
-
|
|
53
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
54
|
-
exports.configurableConnectorMetadataGuard = exports.messageTypesGuard = exports.MessageTypes = exports.ConnectorError = exports.ConnectorErrorCodes = exports.i18nPhrasesGuard = exports.ConnectorPlatform = exports.ConnectorType = void 0;
|
|
55
|
-
const language_kit_1 = __nccwpck_require__(7266);
|
|
56
|
-
const zod_1 = __nccwpck_require__(8062);
|
|
57
|
-
// MARK: Foundation
|
|
58
|
-
var ConnectorType;
|
|
59
|
-
(function (ConnectorType) {
|
|
60
|
-
ConnectorType["Email"] = "Email";
|
|
61
|
-
ConnectorType["Sms"] = "Sms";
|
|
62
|
-
ConnectorType["Social"] = "Social";
|
|
63
|
-
})(ConnectorType = exports.ConnectorType || (exports.ConnectorType = {}));
|
|
64
|
-
var ConnectorPlatform;
|
|
65
|
-
(function (ConnectorPlatform) {
|
|
66
|
-
ConnectorPlatform["Native"] = "Native";
|
|
67
|
-
ConnectorPlatform["Universal"] = "Universal";
|
|
68
|
-
ConnectorPlatform["Web"] = "Web";
|
|
69
|
-
})(ConnectorPlatform = exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
|
|
70
|
-
exports.i18nPhrasesGuard = zod_1.z
|
|
71
|
-
.object({ en: zod_1.z.string() })
|
|
72
|
-
.and(zod_1.z.record(zod_1.z.string()))
|
|
73
|
-
.refine((i18nObject) => {
|
|
74
|
-
const keys = Object.keys(i18nObject);
|
|
75
|
-
if (!keys.includes('en')) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
for (const value of keys) {
|
|
79
|
-
if (!(0, language_kit_1.isLanguageTag)(value)) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
});
|
|
85
|
-
var ConnectorErrorCodes;
|
|
86
|
-
(function (ConnectorErrorCodes) {
|
|
87
|
-
ConnectorErrorCodes["General"] = "general";
|
|
88
|
-
ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
|
|
89
|
-
ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
|
|
90
|
-
ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
|
|
91
|
-
ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
|
|
92
|
-
ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
|
|
93
|
-
ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
|
|
94
|
-
ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
|
|
95
|
-
ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
|
|
96
|
-
ConnectorErrorCodes["NotImplemented"] = "not_implemented";
|
|
97
|
-
ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
|
|
98
|
-
ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
|
|
99
|
-
ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
|
|
100
|
-
ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
|
|
101
|
-
})(ConnectorErrorCodes = exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
|
|
102
|
-
class ConnectorError extends Error {
|
|
103
|
-
constructor(code, data) {
|
|
104
|
-
const message = typeof data === 'string' ? data : 'Connector error occurred.';
|
|
105
|
-
super(message);
|
|
106
|
-
this.code = code;
|
|
107
|
-
this.data = typeof data === 'string' ? { message: data } : data;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.ConnectorError = ConnectorError;
|
|
111
|
-
var MessageTypes;
|
|
112
|
-
(function (MessageTypes) {
|
|
113
|
-
MessageTypes["SignIn"] = "SignIn";
|
|
114
|
-
MessageTypes["Register"] = "Register";
|
|
115
|
-
MessageTypes["ForgotPassword"] = "ForgotPassword";
|
|
116
|
-
MessageTypes["Test"] = "Test";
|
|
117
|
-
})(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
|
|
118
|
-
exports.messageTypesGuard = zod_1.z.nativeEnum(MessageTypes);
|
|
119
|
-
const connectorMetadataGuard = zod_1.z.object({
|
|
120
|
-
id: zod_1.z.string(),
|
|
121
|
-
target: zod_1.z.string(),
|
|
122
|
-
platform: zod_1.z.nativeEnum(ConnectorPlatform).nullable(),
|
|
123
|
-
name: exports.i18nPhrasesGuard,
|
|
124
|
-
logo: zod_1.z.string(),
|
|
125
|
-
logoDark: zod_1.z.string().nullable(),
|
|
126
|
-
description: exports.i18nPhrasesGuard,
|
|
127
|
-
isStandard: zod_1.z.boolean().optional(),
|
|
128
|
-
readme: zod_1.z.string(),
|
|
129
|
-
configTemplate: zod_1.z.string(),
|
|
130
|
-
});
|
|
131
|
-
exports.configurableConnectorMetadataGuard = connectorMetadataGuard
|
|
132
|
-
.pick({
|
|
133
|
-
target: true,
|
|
134
|
-
name: true,
|
|
135
|
-
logo: true,
|
|
136
|
-
logoDark: true,
|
|
137
|
-
})
|
|
138
|
-
.partial();
|
|
24
|
+
__exportStar(__nccwpck_require__(7189), exports);
|
|
139
25
|
|
|
140
26
|
|
|
141
27
|
/***/ }),
|
|
142
28
|
|
|
143
|
-
/***/
|
|
144
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
145
|
-
|
|
146
|
-
"use strict";
|
|
147
|
-
|
|
148
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
149
|
-
exports.languages = void 0;
|
|
150
|
-
exports.languages = Object.freeze({
|
|
151
|
-
'af-ZA': 'Afrikaans',
|
|
152
|
-
'am-ET': 'አማርኛ',
|
|
153
|
-
'ar-AR': 'العربية',
|
|
154
|
-
'as-IN': 'অসমীয়া',
|
|
155
|
-
'az-AZ': 'Azərbaycan dili',
|
|
156
|
-
'be-BY': 'Беларуская',
|
|
157
|
-
'bg-BG': 'Български',
|
|
158
|
-
'bn-IN': 'বাংলা',
|
|
159
|
-
'br-FR': 'Brezhoneg',
|
|
160
|
-
'bs-BA': 'Bosanski',
|
|
161
|
-
'ca-ES': 'Català',
|
|
162
|
-
'cb-IQ': 'کوردیی ناوەندی',
|
|
163
|
-
'co-FR': 'Corsu',
|
|
164
|
-
'cs-CZ': 'Čeština',
|
|
165
|
-
'cx-PH': 'Bisaya',
|
|
166
|
-
'cy-GB': 'Cymraeg',
|
|
167
|
-
'da-DK': 'Dansk',
|
|
168
|
-
de: 'Deutsch',
|
|
169
|
-
'de-DE': 'Deutsch (Deutschland)',
|
|
170
|
-
'el-GR': 'Ελληνικά',
|
|
171
|
-
en: 'English',
|
|
172
|
-
'en-GB': 'English (UK)',
|
|
173
|
-
'en-US': 'English (US)',
|
|
174
|
-
'eo-EO': 'Esperanto',
|
|
175
|
-
es: 'Español',
|
|
176
|
-
'es-ES': 'Español (España)',
|
|
177
|
-
'es-419': 'Español (Latinoamérica)',
|
|
178
|
-
'et-EE': 'Eesti',
|
|
179
|
-
'eu-ES': 'Euskara',
|
|
180
|
-
'fa-IR': 'فارسی',
|
|
181
|
-
'ff-NG': 'Fula',
|
|
182
|
-
'fi-FI': 'Suomi',
|
|
183
|
-
'fo-FO': 'Føroyskt',
|
|
184
|
-
fr: 'Français',
|
|
185
|
-
'fr-CA': 'Français (Canada)',
|
|
186
|
-
'fr-FR': 'Français (France)',
|
|
187
|
-
'fy-NL': 'Frysk',
|
|
188
|
-
'ga-IE': 'Gaeilge',
|
|
189
|
-
'gl-ES': 'Galego',
|
|
190
|
-
'gn-PY': 'Guarani',
|
|
191
|
-
'gu-IN': 'ગુજરાતી',
|
|
192
|
-
'ha-NG': 'Hausa',
|
|
193
|
-
'he-IL': 'עברית',
|
|
194
|
-
'hi-IN': 'हिन्दी',
|
|
195
|
-
'hr-HR': 'Hrvatski',
|
|
196
|
-
'ht-HT': 'Kreyòl Ayisyen',
|
|
197
|
-
'hu-HU': 'Magyar',
|
|
198
|
-
'hy-AM': 'Հայերեն',
|
|
199
|
-
'id-ID': 'Bahasa Indonesia',
|
|
200
|
-
'ik-US': 'Iñupiatun',
|
|
201
|
-
'is-IS': 'Íslenska',
|
|
202
|
-
it: 'Italiano',
|
|
203
|
-
'it-IT': 'italiano (Italia)',
|
|
204
|
-
'iu-CA': 'Inuktitut',
|
|
205
|
-
ja: '日本語',
|
|
206
|
-
'ja-JP': '日本語',
|
|
207
|
-
'ja-KS': '日本語(関西)',
|
|
208
|
-
'jv-ID': 'Basa Jawa',
|
|
209
|
-
'ka-GE': 'ქართული',
|
|
210
|
-
'kk-KZ': 'Қазақша',
|
|
211
|
-
'km-KH': 'ភាសាខ្មែរ',
|
|
212
|
-
'kn-IN': 'ಕನ್ನಡ',
|
|
213
|
-
ko: '한국어',
|
|
214
|
-
'ko-KR': '한국어',
|
|
215
|
-
'ku-TR': 'Kurdî (Kurmancî)',
|
|
216
|
-
'ky-KG': 'кыргызча',
|
|
217
|
-
'lo-LA': 'ພາສາລາວ',
|
|
218
|
-
'lt-LT': 'Lietuvių',
|
|
219
|
-
'lv-LV': 'Latviešu',
|
|
220
|
-
'mg-MG': 'Malagasy',
|
|
221
|
-
'mk-MK': 'Македонски',
|
|
222
|
-
'ml-IN': 'മലയാളം',
|
|
223
|
-
'mn-MN': 'Монгол',
|
|
224
|
-
'mr-IN': 'मराठी',
|
|
225
|
-
'ms-MY': 'Bahasa Melayu',
|
|
226
|
-
'mt-MT': 'Malti',
|
|
227
|
-
'my-MM': 'မြန်မာဘာသာ',
|
|
228
|
-
'nb-NO': 'Norsk (bokmål)',
|
|
229
|
-
'ne-NP': 'नेपाली',
|
|
230
|
-
'nl-BE': 'Vlaams',
|
|
231
|
-
'nl-NL': 'Nederlands',
|
|
232
|
-
'nn-NO': 'Norsk (nynorsk)',
|
|
233
|
-
'or-IN': 'ଓଡ଼ିଆ',
|
|
234
|
-
'pa-IN': 'ਪੰਜਾਬੀ',
|
|
235
|
-
'pl-PL': 'Polski',
|
|
236
|
-
'ps-AF': 'پښتو',
|
|
237
|
-
pt: 'português',
|
|
238
|
-
'pt-BR': 'Português (Brasil)',
|
|
239
|
-
'pt-PT': 'português (Portugal)',
|
|
240
|
-
'ro-RO': 'Română',
|
|
241
|
-
ru: 'Русский',
|
|
242
|
-
'ru-RU': 'Русский',
|
|
243
|
-
'rw-RW': 'Ikinyarwanda',
|
|
244
|
-
'sc-IT': 'Sardu',
|
|
245
|
-
'si-LK': 'සිංහල',
|
|
246
|
-
'sk-SK': 'Slovenčina',
|
|
247
|
-
'sl-SI': 'Slovenščina',
|
|
248
|
-
'sn-ZW': 'Shona',
|
|
249
|
-
'sq-AL': 'Shqip',
|
|
250
|
-
'sr-RS': 'Српски',
|
|
251
|
-
'sv-SE': 'Svenska',
|
|
252
|
-
'sw-KE': 'Kiswahili',
|
|
253
|
-
'sy-SY': 'ܣܘܪܝܝܐ',
|
|
254
|
-
'sz-PL': 'ślōnskŏ gŏdka',
|
|
255
|
-
'ta-IN': 'தமிழ்',
|
|
256
|
-
'te-IN': 'తెలుగు',
|
|
257
|
-
'tg-TJ': 'Тоҷикӣ',
|
|
258
|
-
'th-TH': 'ภาษาไทย',
|
|
259
|
-
'tl-PH': 'Filipino',
|
|
260
|
-
tr: 'Türkçe',
|
|
261
|
-
'tr-TR': 'Türkçe',
|
|
262
|
-
'tt-RU': 'Татарча',
|
|
263
|
-
'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
|
|
264
|
-
'uk-UA': 'Українська',
|
|
265
|
-
'ur-PK': 'اردو',
|
|
266
|
-
'uz-UZ': "O'zbek",
|
|
267
|
-
'vi-VN': 'Tiếng Việt',
|
|
268
|
-
zh: '中文',
|
|
269
|
-
'zh-CN': '简体中文',
|
|
270
|
-
'zh-HK': '繁體中文(香港)',
|
|
271
|
-
'zh-MO': '繁體中文(澳門)',
|
|
272
|
-
'zh-TW': '繁體中文(台灣)',
|
|
273
|
-
'zz-TR': 'Zaza',
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
/***/ }),
|
|
278
|
-
|
|
279
|
-
/***/ 7266:
|
|
280
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
281
|
-
|
|
282
|
-
"use strict";
|
|
283
|
-
|
|
284
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
285
|
-
if (k2 === undefined) k2 = k;
|
|
286
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
287
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
288
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
289
|
-
}
|
|
290
|
-
Object.defineProperty(o, k2, desc);
|
|
291
|
-
}) : (function(o, m, k, k2) {
|
|
292
|
-
if (k2 === undefined) k2 = k;
|
|
293
|
-
o[k2] = m[k];
|
|
294
|
-
}));
|
|
295
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
296
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
297
|
-
};
|
|
298
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
299
|
-
__exportStar(__nccwpck_require__(6921), exports);
|
|
300
|
-
__exportStar(__nccwpck_require__(9962), exports);
|
|
301
|
-
__exportStar(__nccwpck_require__(9715), exports);
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
/***/ }),
|
|
305
|
-
|
|
306
|
-
/***/ 9962:
|
|
307
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
308
|
-
|
|
309
|
-
"use strict";
|
|
310
|
-
|
|
311
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
/***/ }),
|
|
315
|
-
|
|
316
|
-
/***/ 9715:
|
|
317
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
318
|
-
|
|
319
|
-
"use strict";
|
|
320
|
-
|
|
321
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
322
|
-
exports.languageTagGuard = exports.isLanguageTag = void 0;
|
|
323
|
-
const zod_1 = __nccwpck_require__(8062);
|
|
324
|
-
const const_1 = __nccwpck_require__(6921);
|
|
325
|
-
const isLanguageTag = (value) => typeof value === 'string' && value in const_1.languages;
|
|
326
|
-
exports.isLanguageTag = isLanguageTag;
|
|
327
|
-
exports.languageTagGuard = zod_1.z
|
|
328
|
-
.any()
|
|
329
|
-
.refine((value) => (0, exports.isLanguageTag)(value));
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
/***/ }),
|
|
333
|
-
|
|
334
|
-
/***/ 8138:
|
|
335
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
336
|
-
|
|
337
|
-
"use strict";
|
|
338
|
-
|
|
339
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
340
|
-
if (k2 === undefined) k2 = k;
|
|
341
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
342
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
343
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
344
|
-
}
|
|
345
|
-
Object.defineProperty(o, k2, desc);
|
|
346
|
-
}) : (function(o, m, k, k2) {
|
|
347
|
-
if (k2 === undefined) k2 = k;
|
|
348
|
-
o[k2] = m[k];
|
|
349
|
-
}));
|
|
350
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
351
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
352
|
-
};
|
|
353
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
354
|
-
__exportStar(__nccwpck_require__(685), exports);
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
/***/ }),
|
|
358
|
-
|
|
359
|
-
/***/ 6375:
|
|
29
|
+
/***/ 9454:
|
|
360
30
|
/***/ ((__unused_webpack_module, exports) => {
|
|
361
31
|
|
|
362
32
|
"use strict";
|
|
@@ -385,7 +55,7 @@ exports.repeat = repeat;
|
|
|
385
55
|
|
|
386
56
|
/***/ }),
|
|
387
57
|
|
|
388
|
-
/***/
|
|
58
|
+
/***/ 8980:
|
|
389
59
|
/***/ ((__unused_webpack_module, exports) => {
|
|
390
60
|
|
|
391
61
|
"use strict";
|
|
@@ -405,7 +75,7 @@ exports.assert = assert;
|
|
|
405
75
|
|
|
406
76
|
/***/ }),
|
|
407
77
|
|
|
408
|
-
/***/
|
|
78
|
+
/***/ 1635:
|
|
409
79
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
410
80
|
|
|
411
81
|
"use strict";
|
|
@@ -415,7 +85,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
415
85
|
};
|
|
416
86
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
417
87
|
exports.hasChineseCharacter = exports.has = exports.notEmpty = exports.notFalsy = exports.isSameArray = void 0;
|
|
418
|
-
const lodash_orderby_1 = __importDefault(__nccwpck_require__(
|
|
88
|
+
const lodash_orderby_1 = __importDefault(__nccwpck_require__(1128));
|
|
419
89
|
const isSameArray = (array1, array2) => {
|
|
420
90
|
if (array1.length !== array2.length) {
|
|
421
91
|
return false;
|
|
@@ -438,14 +108,14 @@ exports.hasChineseCharacter = hasChineseCharacter;
|
|
|
438
108
|
|
|
439
109
|
/***/ }),
|
|
440
110
|
|
|
441
|
-
/***/
|
|
111
|
+
/***/ 9532:
|
|
442
112
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
443
113
|
|
|
444
114
|
"use strict";
|
|
445
115
|
|
|
446
116
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
447
117
|
exports.conditionalString = exports.conditional = exports.nullable = void 0;
|
|
448
|
-
const assertions_1 = __nccwpck_require__(
|
|
118
|
+
const assertions_1 = __nccwpck_require__(1635);
|
|
449
119
|
const nullable = (exp) => ((0, assertions_1.notFalsy)(exp) ? exp : null);
|
|
450
120
|
exports.nullable = nullable;
|
|
451
121
|
const conditional = (exp) => ((0, assertions_1.notFalsy)(exp) ? exp : undefined);
|
|
@@ -456,14 +126,14 @@ exports.conditionalString = conditionalString;
|
|
|
456
126
|
|
|
457
127
|
/***/ }),
|
|
458
128
|
|
|
459
|
-
/***/
|
|
129
|
+
/***/ 316:
|
|
460
130
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
461
131
|
|
|
462
132
|
"use strict";
|
|
463
133
|
|
|
464
134
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
465
135
|
exports.isNode = exports.assertEnv = exports.getEnvAsStringArray = exports.getEnv = void 0;
|
|
466
|
-
const assert_1 = __nccwpck_require__(
|
|
136
|
+
const assert_1 = __nccwpck_require__(8980);
|
|
467
137
|
// Browsers don't have `process`
|
|
468
138
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
469
139
|
const getEnv = (key, fallback = '') => { var _a; return (_a = process === null || process === void 0 ? void 0 : process.env[key]) !== null && _a !== void 0 ? _a : fallback; };
|
|
@@ -493,7 +163,7 @@ exports.isNode = isNode;
|
|
|
493
163
|
|
|
494
164
|
/***/ }),
|
|
495
165
|
|
|
496
|
-
/***/
|
|
166
|
+
/***/ 7189:
|
|
497
167
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
498
168
|
|
|
499
169
|
"use strict";
|
|
@@ -517,21 +187,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
517
187
|
};
|
|
518
188
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
519
189
|
exports.orderBy = void 0;
|
|
520
|
-
__exportStar(__nccwpck_require__(
|
|
521
|
-
__exportStar(__nccwpck_require__(
|
|
522
|
-
__exportStar(__nccwpck_require__(
|
|
523
|
-
__exportStar(__nccwpck_require__(
|
|
524
|
-
__exportStar(__nccwpck_require__(
|
|
525
|
-
__exportStar(__nccwpck_require__(
|
|
526
|
-
__exportStar(__nccwpck_require__(
|
|
527
|
-
__exportStar(__nccwpck_require__(
|
|
528
|
-
var lodash_orderby_1 = __nccwpck_require__(
|
|
190
|
+
__exportStar(__nccwpck_require__(9454), exports);
|
|
191
|
+
__exportStar(__nccwpck_require__(8980), exports);
|
|
192
|
+
__exportStar(__nccwpck_require__(1635), exports);
|
|
193
|
+
__exportStar(__nccwpck_require__(9532), exports);
|
|
194
|
+
__exportStar(__nccwpck_require__(316), exports);
|
|
195
|
+
__exportStar(__nccwpck_require__(4110), exports);
|
|
196
|
+
__exportStar(__nccwpck_require__(2973), exports);
|
|
197
|
+
__exportStar(__nccwpck_require__(5827), exports);
|
|
198
|
+
var lodash_orderby_1 = __nccwpck_require__(1128);
|
|
529
199
|
Object.defineProperty(exports, "orderBy", ({ enumerable: true, get: function () { return __importDefault(lodash_orderby_1).default; } }));
|
|
530
200
|
|
|
531
201
|
|
|
532
202
|
/***/ }),
|
|
533
203
|
|
|
534
|
-
/***/
|
|
204
|
+
/***/ 4110:
|
|
535
205
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
536
206
|
|
|
537
207
|
"use strict";
|
|
@@ -541,8 +211,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
541
211
|
};
|
|
542
212
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
543
213
|
exports.pickState = exports.pick = void 0;
|
|
544
|
-
const lodash_pick_1 = __importDefault(__nccwpck_require__(
|
|
545
|
-
var lodash_pick_2 = __nccwpck_require__(
|
|
214
|
+
const lodash_pick_1 = __importDefault(__nccwpck_require__(9103));
|
|
215
|
+
var lodash_pick_2 = __nccwpck_require__(9103);
|
|
546
216
|
Object.defineProperty(exports, "pick", ({ enumerable: true, get: function () { return __importDefault(lodash_pick_2).default; } }));
|
|
547
217
|
const pickState = (...keys) => (state) => (0, lodash_pick_1.default)(state, ...keys);
|
|
548
218
|
exports.pickState = pickState;
|
|
@@ -550,14 +220,14 @@ exports.pickState = pickState;
|
|
|
550
220
|
|
|
551
221
|
/***/ }),
|
|
552
222
|
|
|
553
|
-
/***/
|
|
223
|
+
/***/ 2973:
|
|
554
224
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
555
225
|
|
|
556
226
|
"use strict";
|
|
557
227
|
|
|
558
228
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
559
229
|
exports.UrlSafeBase64 = exports.toTitle = void 0;
|
|
560
|
-
const env_1 = __nccwpck_require__(
|
|
230
|
+
const env_1 = __nccwpck_require__(316);
|
|
561
231
|
function toTitle(string) {
|
|
562
232
|
if (typeof string !== 'string') {
|
|
563
233
|
throw new TypeError('Expected a string');
|
|
@@ -602,7 +272,7 @@ exports.UrlSafeBase64 = {
|
|
|
602
272
|
|
|
603
273
|
/***/ }),
|
|
604
274
|
|
|
605
|
-
/***/
|
|
275
|
+
/***/ 5827:
|
|
606
276
|
/***/ ((__unused_webpack_module, exports) => {
|
|
607
277
|
|
|
608
278
|
"use strict";
|
|
@@ -613,7 +283,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
613
283
|
|
|
614
284
|
/***/ }),
|
|
615
285
|
|
|
616
|
-
/***/
|
|
286
|
+
/***/ 6198:
|
|
617
287
|
/***/ ((module, exports) => {
|
|
618
288
|
|
|
619
289
|
"use strict";
|
|
@@ -1055,13 +725,13 @@ module.exports.assert = exports.assert;
|
|
|
1055
725
|
|
|
1056
726
|
/***/ }),
|
|
1057
727
|
|
|
1058
|
-
/***/
|
|
728
|
+
/***/ 3632:
|
|
1059
729
|
/***/ ((module, exports, __nccwpck_require__) => {
|
|
1060
730
|
|
|
1061
731
|
"use strict";
|
|
1062
732
|
|
|
1063
733
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1064
|
-
const defer_to_connect_1 = __nccwpck_require__(
|
|
734
|
+
const defer_to_connect_1 = __nccwpck_require__(8836);
|
|
1065
735
|
const util_1 = __nccwpck_require__(3837);
|
|
1066
736
|
const nodejsMajorVersion = Number(process.versions.node.split('.')[0]);
|
|
1067
737
|
const timer = (request) => {
|
|
@@ -1189,7 +859,7 @@ module.exports["default"] = timer;
|
|
|
1189
859
|
|
|
1190
860
|
/***/ }),
|
|
1191
861
|
|
|
1192
|
-
/***/
|
|
862
|
+
/***/ 2074:
|
|
1193
863
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1194
864
|
|
|
1195
865
|
"use strict";
|
|
@@ -1633,7 +1303,7 @@ module.exports["default"] = CacheableLookup;
|
|
|
1633
1303
|
|
|
1634
1304
|
/***/ }),
|
|
1635
1305
|
|
|
1636
|
-
/***/
|
|
1306
|
+
/***/ 5967:
|
|
1637
1307
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1638
1308
|
|
|
1639
1309
|
"use strict";
|
|
@@ -1641,13 +1311,13 @@ module.exports["default"] = CacheableLookup;
|
|
|
1641
1311
|
|
|
1642
1312
|
const EventEmitter = __nccwpck_require__(2361);
|
|
1643
1313
|
const urlLib = __nccwpck_require__(7310);
|
|
1644
|
-
const normalizeUrl = __nccwpck_require__(
|
|
1645
|
-
const getStream = __nccwpck_require__(
|
|
1646
|
-
const CachePolicy = __nccwpck_require__(
|
|
1647
|
-
const Response = __nccwpck_require__(
|
|
1648
|
-
const lowercaseKeys = __nccwpck_require__(
|
|
1649
|
-
const cloneResponse = __nccwpck_require__(
|
|
1650
|
-
const Keyv = __nccwpck_require__(
|
|
1314
|
+
const normalizeUrl = __nccwpck_require__(5797);
|
|
1315
|
+
const getStream = __nccwpck_require__(3421);
|
|
1316
|
+
const CachePolicy = __nccwpck_require__(8412);
|
|
1317
|
+
const Response = __nccwpck_require__(4404);
|
|
1318
|
+
const lowercaseKeys = __nccwpck_require__(2893);
|
|
1319
|
+
const cloneResponse = __nccwpck_require__(6592);
|
|
1320
|
+
const Keyv = __nccwpck_require__(6474);
|
|
1651
1321
|
|
|
1652
1322
|
class CacheableRequest {
|
|
1653
1323
|
constructor(request, cacheAdapter) {
|
|
@@ -1892,14 +1562,14 @@ module.exports = CacheableRequest;
|
|
|
1892
1562
|
|
|
1893
1563
|
/***/ }),
|
|
1894
1564
|
|
|
1895
|
-
/***/
|
|
1565
|
+
/***/ 6592:
|
|
1896
1566
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1897
1567
|
|
|
1898
1568
|
"use strict";
|
|
1899
1569
|
|
|
1900
1570
|
|
|
1901
1571
|
const PassThrough = (__nccwpck_require__(2781).PassThrough);
|
|
1902
|
-
const mimicResponse = __nccwpck_require__(
|
|
1572
|
+
const mimicResponse = __nccwpck_require__(7642);
|
|
1903
1573
|
|
|
1904
1574
|
const cloneResponse = response => {
|
|
1905
1575
|
if (!(response && response.pipe)) {
|
|
@@ -1917,17 +1587,17 @@ module.exports = cloneResponse;
|
|
|
1917
1587
|
|
|
1918
1588
|
/***/ }),
|
|
1919
1589
|
|
|
1920
|
-
/***/
|
|
1590
|
+
/***/ 996:
|
|
1921
1591
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1922
1592
|
|
|
1923
1593
|
"use strict";
|
|
1924
1594
|
|
|
1925
1595
|
|
|
1926
1596
|
const { promisify } = __nccwpck_require__(3837)
|
|
1927
|
-
const JSONB = __nccwpck_require__(
|
|
1597
|
+
const JSONB = __nccwpck_require__(3180)
|
|
1928
1598
|
const zlib = __nccwpck_require__(9796)
|
|
1929
1599
|
|
|
1930
|
-
const mergeOptions = __nccwpck_require__(
|
|
1600
|
+
const mergeOptions = __nccwpck_require__(8672)
|
|
1931
1601
|
|
|
1932
1602
|
const compress = promisify(zlib.brotliCompress)
|
|
1933
1603
|
|
|
@@ -1970,7 +1640,7 @@ module.exports.parse = JSONB.parse
|
|
|
1970
1640
|
|
|
1971
1641
|
/***/ }),
|
|
1972
1642
|
|
|
1973
|
-
/***/
|
|
1643
|
+
/***/ 8672:
|
|
1974
1644
|
/***/ ((module) => {
|
|
1975
1645
|
|
|
1976
1646
|
"use strict";
|
|
@@ -1996,7 +1666,7 @@ module.exports = (defaultOptions = {}, options = {}) => {
|
|
|
1996
1666
|
|
|
1997
1667
|
/***/ }),
|
|
1998
1668
|
|
|
1999
|
-
/***/
|
|
1669
|
+
/***/ 164:
|
|
2000
1670
|
/***/ ((module) => {
|
|
2001
1671
|
|
|
2002
1672
|
"use strict";
|
|
@@ -2098,14 +1768,14 @@ module.exports = function (encodedURI) {
|
|
|
2098
1768
|
|
|
2099
1769
|
/***/ }),
|
|
2100
1770
|
|
|
2101
|
-
/***/
|
|
1771
|
+
/***/ 1331:
|
|
2102
1772
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2103
1773
|
|
|
2104
1774
|
"use strict";
|
|
2105
1775
|
|
|
2106
1776
|
const {Transform, PassThrough} = __nccwpck_require__(2781);
|
|
2107
1777
|
const zlib = __nccwpck_require__(9796);
|
|
2108
|
-
const mimicResponse = __nccwpck_require__(
|
|
1778
|
+
const mimicResponse = __nccwpck_require__(9443);
|
|
2109
1779
|
|
|
2110
1780
|
module.exports = response => {
|
|
2111
1781
|
const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();
|
|
@@ -2164,7 +1834,7 @@ module.exports = response => {
|
|
|
2164
1834
|
|
|
2165
1835
|
/***/ }),
|
|
2166
1836
|
|
|
2167
|
-
/***/
|
|
1837
|
+
/***/ 8836:
|
|
2168
1838
|
/***/ ((module, exports) => {
|
|
2169
1839
|
|
|
2170
1840
|
"use strict";
|
|
@@ -2219,10 +1889,10 @@ module.exports["default"] = deferToConnect;
|
|
|
2219
1889
|
|
|
2220
1890
|
/***/ }),
|
|
2221
1891
|
|
|
2222
|
-
/***/
|
|
1892
|
+
/***/ 1243:
|
|
2223
1893
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2224
1894
|
|
|
2225
|
-
var once = __nccwpck_require__(
|
|
1895
|
+
var once = __nccwpck_require__(2469);
|
|
2226
1896
|
|
|
2227
1897
|
var noop = function() {};
|
|
2228
1898
|
|
|
@@ -2320,7 +1990,7 @@ module.exports = eos;
|
|
|
2320
1990
|
|
|
2321
1991
|
/***/ }),
|
|
2322
1992
|
|
|
2323
|
-
/***/
|
|
1993
|
+
/***/ 8172:
|
|
2324
1994
|
/***/ ((module) => {
|
|
2325
1995
|
|
|
2326
1996
|
"use strict";
|
|
@@ -2345,7 +2015,7 @@ module.exports = function (obj, predicate) {
|
|
|
2345
2015
|
|
|
2346
2016
|
/***/ }),
|
|
2347
2017
|
|
|
2348
|
-
/***/
|
|
2018
|
+
/***/ 6957:
|
|
2349
2019
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2350
2020
|
|
|
2351
2021
|
"use strict";
|
|
@@ -2405,14 +2075,14 @@ module.exports = options => {
|
|
|
2405
2075
|
|
|
2406
2076
|
/***/ }),
|
|
2407
2077
|
|
|
2408
|
-
/***/
|
|
2078
|
+
/***/ 3421:
|
|
2409
2079
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2410
2080
|
|
|
2411
2081
|
"use strict";
|
|
2412
2082
|
|
|
2413
2083
|
const {constants: BufferConstants} = __nccwpck_require__(4300);
|
|
2414
|
-
const pump = __nccwpck_require__(
|
|
2415
|
-
const bufferStream = __nccwpck_require__(
|
|
2084
|
+
const pump = __nccwpck_require__(1216);
|
|
2085
|
+
const bufferStream = __nccwpck_require__(6957);
|
|
2416
2086
|
|
|
2417
2087
|
class MaxBufferError extends Error {
|
|
2418
2088
|
constructor() {
|
|
@@ -2473,13 +2143,13 @@ module.exports.MaxBufferError = MaxBufferError;
|
|
|
2473
2143
|
|
|
2474
2144
|
/***/ }),
|
|
2475
2145
|
|
|
2476
|
-
/***/
|
|
2146
|
+
/***/ 4827:
|
|
2477
2147
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2478
2148
|
|
|
2479
2149
|
"use strict";
|
|
2480
2150
|
|
|
2481
2151
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2482
|
-
const types_1 = __nccwpck_require__(
|
|
2152
|
+
const types_1 = __nccwpck_require__(2554);
|
|
2483
2153
|
function createRejection(error, ...beforeErrorGroups) {
|
|
2484
2154
|
const promise = (async () => {
|
|
2485
2155
|
if (error instanceof types_1.RequestError) {
|
|
@@ -2511,7 +2181,7 @@ exports["default"] = createRejection;
|
|
|
2511
2181
|
|
|
2512
2182
|
/***/ }),
|
|
2513
2183
|
|
|
2514
|
-
/***/
|
|
2184
|
+
/***/ 6894:
|
|
2515
2185
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
2516
2186
|
|
|
2517
2187
|
"use strict";
|
|
@@ -2528,14 +2198,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
2528
2198
|
};
|
|
2529
2199
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2530
2200
|
const events_1 = __nccwpck_require__(2361);
|
|
2531
|
-
const is_1 = __nccwpck_require__(
|
|
2532
|
-
const PCancelable = __nccwpck_require__(
|
|
2533
|
-
const types_1 = __nccwpck_require__(
|
|
2534
|
-
const parse_body_1 = __nccwpck_require__(
|
|
2535
|
-
const core_1 = __nccwpck_require__(
|
|
2536
|
-
const proxy_events_1 = __nccwpck_require__(
|
|
2537
|
-
const get_buffer_1 = __nccwpck_require__(
|
|
2538
|
-
const is_response_ok_1 = __nccwpck_require__(
|
|
2201
|
+
const is_1 = __nccwpck_require__(6198);
|
|
2202
|
+
const PCancelable = __nccwpck_require__(5323);
|
|
2203
|
+
const types_1 = __nccwpck_require__(2554);
|
|
2204
|
+
const parse_body_1 = __nccwpck_require__(3544);
|
|
2205
|
+
const core_1 = __nccwpck_require__(8525);
|
|
2206
|
+
const proxy_events_1 = __nccwpck_require__(8423);
|
|
2207
|
+
const get_buffer_1 = __nccwpck_require__(5444);
|
|
2208
|
+
const is_response_ok_1 = __nccwpck_require__(3117);
|
|
2539
2209
|
const proxiedRequestEvents = [
|
|
2540
2210
|
'request',
|
|
2541
2211
|
'response',
|
|
@@ -2689,18 +2359,18 @@ function asPromise(normalizedOptions) {
|
|
|
2689
2359
|
return promise;
|
|
2690
2360
|
}
|
|
2691
2361
|
exports["default"] = asPromise;
|
|
2692
|
-
__exportStar(__nccwpck_require__(
|
|
2362
|
+
__exportStar(__nccwpck_require__(2554), exports);
|
|
2693
2363
|
|
|
2694
2364
|
|
|
2695
2365
|
/***/ }),
|
|
2696
2366
|
|
|
2697
|
-
/***/
|
|
2367
|
+
/***/ 5040:
|
|
2698
2368
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2699
2369
|
|
|
2700
2370
|
"use strict";
|
|
2701
2371
|
|
|
2702
2372
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2703
|
-
const is_1 = __nccwpck_require__(
|
|
2373
|
+
const is_1 = __nccwpck_require__(6198);
|
|
2704
2374
|
const normalizeArguments = (options, defaults) => {
|
|
2705
2375
|
if (is_1.default.null_(options.encoding)) {
|
|
2706
2376
|
throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead');
|
|
@@ -2780,13 +2450,13 @@ exports["default"] = normalizeArguments;
|
|
|
2780
2450
|
|
|
2781
2451
|
/***/ }),
|
|
2782
2452
|
|
|
2783
|
-
/***/
|
|
2453
|
+
/***/ 3544:
|
|
2784
2454
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2785
2455
|
|
|
2786
2456
|
"use strict";
|
|
2787
2457
|
|
|
2788
2458
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2789
|
-
const types_1 = __nccwpck_require__(
|
|
2459
|
+
const types_1 = __nccwpck_require__(2554);
|
|
2790
2460
|
const parseBody = (response, responseType, parseJson, encoding) => {
|
|
2791
2461
|
const { rawBody } = response;
|
|
2792
2462
|
try {
|
|
@@ -2813,7 +2483,7 @@ exports["default"] = parseBody;
|
|
|
2813
2483
|
|
|
2814
2484
|
/***/ }),
|
|
2815
2485
|
|
|
2816
|
-
/***/
|
|
2486
|
+
/***/ 2554:
|
|
2817
2487
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
2818
2488
|
|
|
2819
2489
|
"use strict";
|
|
@@ -2830,7 +2500,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
2830
2500
|
};
|
|
2831
2501
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2832
2502
|
exports.CancelError = exports.ParseError = void 0;
|
|
2833
|
-
const core_1 = __nccwpck_require__(
|
|
2503
|
+
const core_1 = __nccwpck_require__(8525);
|
|
2834
2504
|
/**
|
|
2835
2505
|
An error to be thrown when server response code is 2xx, and parsing body fails.
|
|
2836
2506
|
Includes a `response` property.
|
|
@@ -2858,12 +2528,12 @@ class CancelError extends core_1.RequestError {
|
|
|
2858
2528
|
}
|
|
2859
2529
|
}
|
|
2860
2530
|
exports.CancelError = CancelError;
|
|
2861
|
-
__exportStar(__nccwpck_require__(
|
|
2531
|
+
__exportStar(__nccwpck_require__(8525), exports);
|
|
2862
2532
|
|
|
2863
2533
|
|
|
2864
2534
|
/***/ }),
|
|
2865
2535
|
|
|
2866
|
-
/***/
|
|
2536
|
+
/***/ 9388:
|
|
2867
2537
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2868
2538
|
|
|
2869
2539
|
"use strict";
|
|
@@ -2900,7 +2570,7 @@ exports["default"] = calculateRetryDelay;
|
|
|
2900
2570
|
|
|
2901
2571
|
/***/ }),
|
|
2902
2572
|
|
|
2903
|
-
/***/
|
|
2573
|
+
/***/ 8525:
|
|
2904
2574
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2905
2575
|
|
|
2906
2576
|
"use strict";
|
|
@@ -2914,27 +2584,27 @@ const url_1 = __nccwpck_require__(7310);
|
|
|
2914
2584
|
const http = __nccwpck_require__(3685);
|
|
2915
2585
|
const http_1 = __nccwpck_require__(3685);
|
|
2916
2586
|
const https = __nccwpck_require__(5687);
|
|
2917
|
-
const http_timer_1 = __nccwpck_require__(
|
|
2918
|
-
const cacheable_lookup_1 = __nccwpck_require__(
|
|
2919
|
-
const CacheableRequest = __nccwpck_require__(
|
|
2920
|
-
const decompressResponse = __nccwpck_require__(
|
|
2587
|
+
const http_timer_1 = __nccwpck_require__(3632);
|
|
2588
|
+
const cacheable_lookup_1 = __nccwpck_require__(2074);
|
|
2589
|
+
const CacheableRequest = __nccwpck_require__(5967);
|
|
2590
|
+
const decompressResponse = __nccwpck_require__(1331);
|
|
2921
2591
|
// @ts-expect-error Missing types
|
|
2922
|
-
const http2wrapper = __nccwpck_require__(
|
|
2923
|
-
const lowercaseKeys = __nccwpck_require__(
|
|
2924
|
-
const is_1 = __nccwpck_require__(
|
|
2925
|
-
const get_body_size_1 = __nccwpck_require__(
|
|
2926
|
-
const is_form_data_1 = __nccwpck_require__(
|
|
2927
|
-
const proxy_events_1 = __nccwpck_require__(
|
|
2928
|
-
const timed_out_1 = __nccwpck_require__(
|
|
2929
|
-
const url_to_options_1 = __nccwpck_require__(
|
|
2930
|
-
const options_to_url_1 = __nccwpck_require__(
|
|
2931
|
-
const weakable_map_1 = __nccwpck_require__(
|
|
2932
|
-
const get_buffer_1 = __nccwpck_require__(
|
|
2933
|
-
const dns_ip_version_1 = __nccwpck_require__(
|
|
2934
|
-
const is_response_ok_1 = __nccwpck_require__(
|
|
2935
|
-
const deprecation_warning_1 = __nccwpck_require__(
|
|
2936
|
-
const normalize_arguments_1 = __nccwpck_require__(
|
|
2937
|
-
const calculate_retry_delay_1 = __nccwpck_require__(
|
|
2592
|
+
const http2wrapper = __nccwpck_require__(739);
|
|
2593
|
+
const lowercaseKeys = __nccwpck_require__(2893);
|
|
2594
|
+
const is_1 = __nccwpck_require__(6198);
|
|
2595
|
+
const get_body_size_1 = __nccwpck_require__(7408);
|
|
2596
|
+
const is_form_data_1 = __nccwpck_require__(9502);
|
|
2597
|
+
const proxy_events_1 = __nccwpck_require__(8423);
|
|
2598
|
+
const timed_out_1 = __nccwpck_require__(6843);
|
|
2599
|
+
const url_to_options_1 = __nccwpck_require__(4003);
|
|
2600
|
+
const options_to_url_1 = __nccwpck_require__(8124);
|
|
2601
|
+
const weakable_map_1 = __nccwpck_require__(7849);
|
|
2602
|
+
const get_buffer_1 = __nccwpck_require__(5444);
|
|
2603
|
+
const dns_ip_version_1 = __nccwpck_require__(4254);
|
|
2604
|
+
const is_response_ok_1 = __nccwpck_require__(3117);
|
|
2605
|
+
const deprecation_warning_1 = __nccwpck_require__(5531);
|
|
2606
|
+
const normalize_arguments_1 = __nccwpck_require__(5040);
|
|
2607
|
+
const calculate_retry_delay_1 = __nccwpck_require__(9388);
|
|
2938
2608
|
let globalDnsCache;
|
|
2939
2609
|
const kRequest = Symbol('request');
|
|
2940
2610
|
const kResponse = Symbol('response');
|
|
@@ -4413,7 +4083,7 @@ exports["default"] = Request;
|
|
|
4413
4083
|
|
|
4414
4084
|
/***/ }),
|
|
4415
4085
|
|
|
4416
|
-
/***/
|
|
4086
|
+
/***/ 4254:
|
|
4417
4087
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4418
4088
|
|
|
4419
4089
|
"use strict";
|
|
@@ -4438,7 +4108,7 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {
|
|
|
4438
4108
|
|
|
4439
4109
|
/***/ }),
|
|
4440
4110
|
|
|
4441
|
-
/***/
|
|
4111
|
+
/***/ 7408:
|
|
4442
4112
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4443
4113
|
|
|
4444
4114
|
"use strict";
|
|
@@ -4446,8 +4116,8 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {
|
|
|
4446
4116
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4447
4117
|
const fs_1 = __nccwpck_require__(7147);
|
|
4448
4118
|
const util_1 = __nccwpck_require__(3837);
|
|
4449
|
-
const is_1 = __nccwpck_require__(
|
|
4450
|
-
const is_form_data_1 = __nccwpck_require__(
|
|
4119
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4120
|
+
const is_form_data_1 = __nccwpck_require__(9502);
|
|
4451
4121
|
const statAsync = util_1.promisify(fs_1.stat);
|
|
4452
4122
|
exports["default"] = async (body, headers) => {
|
|
4453
4123
|
if (headers && 'content-length' in headers) {
|
|
@@ -4478,7 +4148,7 @@ exports["default"] = async (body, headers) => {
|
|
|
4478
4148
|
|
|
4479
4149
|
/***/ }),
|
|
4480
4150
|
|
|
4481
|
-
/***/
|
|
4151
|
+
/***/ 5444:
|
|
4482
4152
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4483
4153
|
|
|
4484
4154
|
"use strict";
|
|
@@ -4502,19 +4172,19 @@ exports["default"] = getBuffer;
|
|
|
4502
4172
|
|
|
4503
4173
|
/***/ }),
|
|
4504
4174
|
|
|
4505
|
-
/***/
|
|
4175
|
+
/***/ 9502:
|
|
4506
4176
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4507
4177
|
|
|
4508
4178
|
"use strict";
|
|
4509
4179
|
|
|
4510
4180
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4511
|
-
const is_1 = __nccwpck_require__(
|
|
4181
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4512
4182
|
exports["default"] = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary);
|
|
4513
4183
|
|
|
4514
4184
|
|
|
4515
4185
|
/***/ }),
|
|
4516
4186
|
|
|
4517
|
-
/***/
|
|
4187
|
+
/***/ 3117:
|
|
4518
4188
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4519
4189
|
|
|
4520
4190
|
"use strict";
|
|
@@ -4530,7 +4200,7 @@ exports.isResponseOk = (response) => {
|
|
|
4530
4200
|
|
|
4531
4201
|
/***/ }),
|
|
4532
4202
|
|
|
4533
|
-
/***/
|
|
4203
|
+
/***/ 8124:
|
|
4534
4204
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4535
4205
|
|
|
4536
4206
|
"use strict";
|
|
@@ -4591,7 +4261,7 @@ exports["default"] = (origin, options) => {
|
|
|
4591
4261
|
|
|
4592
4262
|
/***/ }),
|
|
4593
4263
|
|
|
4594
|
-
/***/
|
|
4264
|
+
/***/ 8423:
|
|
4595
4265
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4596
4266
|
|
|
4597
4267
|
"use strict";
|
|
@@ -4616,7 +4286,7 @@ exports["default"] = default_1;
|
|
|
4616
4286
|
|
|
4617
4287
|
/***/ }),
|
|
4618
4288
|
|
|
4619
|
-
/***/
|
|
4289
|
+
/***/ 6843:
|
|
4620
4290
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4621
4291
|
|
|
4622
4292
|
"use strict";
|
|
@@ -4624,7 +4294,7 @@ exports["default"] = default_1;
|
|
|
4624
4294
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4625
4295
|
exports.TimeoutError = void 0;
|
|
4626
4296
|
const net = __nccwpck_require__(1808);
|
|
4627
|
-
const unhandle_1 = __nccwpck_require__(
|
|
4297
|
+
const unhandle_1 = __nccwpck_require__(6922);
|
|
4628
4298
|
const reentry = Symbol('reentry');
|
|
4629
4299
|
const noop = () => { };
|
|
4630
4300
|
class TimeoutError extends Error {
|
|
@@ -4745,7 +4415,7 @@ exports["default"] = (request, delays, options) => {
|
|
|
4745
4415
|
|
|
4746
4416
|
/***/ }),
|
|
4747
4417
|
|
|
4748
|
-
/***/
|
|
4418
|
+
/***/ 6922:
|
|
4749
4419
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4750
4420
|
|
|
4751
4421
|
"use strict";
|
|
@@ -4775,13 +4445,13 @@ exports["default"] = () => {
|
|
|
4775
4445
|
|
|
4776
4446
|
/***/ }),
|
|
4777
4447
|
|
|
4778
|
-
/***/
|
|
4448
|
+
/***/ 4003:
|
|
4779
4449
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4780
4450
|
|
|
4781
4451
|
"use strict";
|
|
4782
4452
|
|
|
4783
4453
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4784
|
-
const is_1 = __nccwpck_require__(
|
|
4454
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4785
4455
|
exports["default"] = (url) => {
|
|
4786
4456
|
// Cast to URL
|
|
4787
4457
|
url = url;
|
|
@@ -4807,7 +4477,7 @@ exports["default"] = (url) => {
|
|
|
4807
4477
|
|
|
4808
4478
|
/***/ }),
|
|
4809
4479
|
|
|
4810
|
-
/***/
|
|
4480
|
+
/***/ 7849:
|
|
4811
4481
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4812
4482
|
|
|
4813
4483
|
"use strict";
|
|
@@ -4844,7 +4514,7 @@ exports["default"] = WeakableMap;
|
|
|
4844
4514
|
|
|
4845
4515
|
/***/ }),
|
|
4846
4516
|
|
|
4847
|
-
/***/
|
|
4517
|
+
/***/ 9162:
|
|
4848
4518
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4849
4519
|
|
|
4850
4520
|
"use strict";
|
|
@@ -4861,11 +4531,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
4861
4531
|
};
|
|
4862
4532
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4863
4533
|
exports.defaultHandler = void 0;
|
|
4864
|
-
const is_1 = __nccwpck_require__(
|
|
4865
|
-
const as_promise_1 = __nccwpck_require__(
|
|
4866
|
-
const create_rejection_1 = __nccwpck_require__(
|
|
4867
|
-
const core_1 = __nccwpck_require__(
|
|
4868
|
-
const deep_freeze_1 = __nccwpck_require__(
|
|
4534
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4535
|
+
const as_promise_1 = __nccwpck_require__(6894);
|
|
4536
|
+
const create_rejection_1 = __nccwpck_require__(4827);
|
|
4537
|
+
const core_1 = __nccwpck_require__(8525);
|
|
4538
|
+
const deep_freeze_1 = __nccwpck_require__(2982);
|
|
4869
4539
|
const errors = {
|
|
4870
4540
|
RequestError: as_promise_1.RequestError,
|
|
4871
4541
|
CacheError: as_promise_1.CacheError,
|
|
@@ -5087,12 +4757,12 @@ const create = (defaults) => {
|
|
|
5087
4757
|
return got;
|
|
5088
4758
|
};
|
|
5089
4759
|
exports["default"] = create;
|
|
5090
|
-
__exportStar(__nccwpck_require__(
|
|
4760
|
+
__exportStar(__nccwpck_require__(9239), exports);
|
|
5091
4761
|
|
|
5092
4762
|
|
|
5093
4763
|
/***/ }),
|
|
5094
4764
|
|
|
5095
|
-
/***/
|
|
4765
|
+
/***/ 9235:
|
|
5096
4766
|
/***/ (function(module, exports, __nccwpck_require__) {
|
|
5097
4767
|
|
|
5098
4768
|
"use strict";
|
|
@@ -5109,7 +4779,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
5109
4779
|
};
|
|
5110
4780
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5111
4781
|
const url_1 = __nccwpck_require__(7310);
|
|
5112
|
-
const create_1 = __nccwpck_require__(
|
|
4782
|
+
const create_1 = __nccwpck_require__(9162);
|
|
5113
4783
|
const defaults = {
|
|
5114
4784
|
options: {
|
|
5115
4785
|
method: 'GET',
|
|
@@ -5226,13 +4896,13 @@ exports["default"] = got;
|
|
|
5226
4896
|
module.exports = got;
|
|
5227
4897
|
module.exports["default"] = got;
|
|
5228
4898
|
module.exports.__esModule = true; // Workaround for TS issue: https://github.com/sindresorhus/got/pull/1267
|
|
5229
|
-
__exportStar(__nccwpck_require__(
|
|
5230
|
-
__exportStar(__nccwpck_require__(
|
|
4899
|
+
__exportStar(__nccwpck_require__(9162), exports);
|
|
4900
|
+
__exportStar(__nccwpck_require__(6894), exports);
|
|
5231
4901
|
|
|
5232
4902
|
|
|
5233
4903
|
/***/ }),
|
|
5234
4904
|
|
|
5235
|
-
/***/
|
|
4905
|
+
/***/ 9239:
|
|
5236
4906
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5237
4907
|
|
|
5238
4908
|
"use strict";
|
|
@@ -5242,13 +4912,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5242
4912
|
|
|
5243
4913
|
/***/ }),
|
|
5244
4914
|
|
|
5245
|
-
/***/
|
|
4915
|
+
/***/ 2982:
|
|
5246
4916
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5247
4917
|
|
|
5248
4918
|
"use strict";
|
|
5249
4919
|
|
|
5250
4920
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5251
|
-
const is_1 = __nccwpck_require__(
|
|
4921
|
+
const is_1 = __nccwpck_require__(6198);
|
|
5252
4922
|
function deepFreeze(object) {
|
|
5253
4923
|
for (const value of Object.values(object)) {
|
|
5254
4924
|
if (is_1.default.plainObject(value) || is_1.default.array(value)) {
|
|
@@ -5262,7 +4932,7 @@ exports["default"] = deepFreeze;
|
|
|
5262
4932
|
|
|
5263
4933
|
/***/ }),
|
|
5264
4934
|
|
|
5265
|
-
/***/
|
|
4935
|
+
/***/ 5531:
|
|
5266
4936
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5267
4937
|
|
|
5268
4938
|
"use strict";
|
|
@@ -5283,7 +4953,7 @@ exports["default"] = (message) => {
|
|
|
5283
4953
|
|
|
5284
4954
|
/***/ }),
|
|
5285
4955
|
|
|
5286
|
-
/***/
|
|
4956
|
+
/***/ 8412:
|
|
5287
4957
|
/***/ ((module) => {
|
|
5288
4958
|
|
|
5289
4959
|
"use strict";
|
|
@@ -5964,15 +5634,15 @@ module.exports = class CachePolicy {
|
|
|
5964
5634
|
|
|
5965
5635
|
/***/ }),
|
|
5966
5636
|
|
|
5967
|
-
/***/
|
|
5637
|
+
/***/ 6495:
|
|
5968
5638
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5969
5639
|
|
|
5970
5640
|
"use strict";
|
|
5971
5641
|
|
|
5972
5642
|
const EventEmitter = __nccwpck_require__(2361);
|
|
5973
|
-
const tls = __nccwpck_require__(
|
|
5643
|
+
const tls = __nccwpck_require__(6821);
|
|
5974
5644
|
const http2 = __nccwpck_require__(5158);
|
|
5975
|
-
const QuickLRU = __nccwpck_require__(
|
|
5645
|
+
const QuickLRU = __nccwpck_require__(4225);
|
|
5976
5646
|
|
|
5977
5647
|
const kCurrentStreamsCount = Symbol('currentStreamsCount');
|
|
5978
5648
|
const kRequest = Symbol('request');
|
|
@@ -6642,18 +6312,18 @@ module.exports = {
|
|
|
6642
6312
|
|
|
6643
6313
|
/***/ }),
|
|
6644
6314
|
|
|
6645
|
-
/***/
|
|
6315
|
+
/***/ 229:
|
|
6646
6316
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6647
6317
|
|
|
6648
6318
|
"use strict";
|
|
6649
6319
|
|
|
6650
6320
|
const http = __nccwpck_require__(3685);
|
|
6651
6321
|
const https = __nccwpck_require__(5687);
|
|
6652
|
-
const resolveALPN = __nccwpck_require__(
|
|
6653
|
-
const QuickLRU = __nccwpck_require__(
|
|
6654
|
-
const Http2ClientRequest = __nccwpck_require__(
|
|
6655
|
-
const calculateServerName = __nccwpck_require__(
|
|
6656
|
-
const urlToOptions = __nccwpck_require__(
|
|
6322
|
+
const resolveALPN = __nccwpck_require__(6354);
|
|
6323
|
+
const QuickLRU = __nccwpck_require__(4225);
|
|
6324
|
+
const Http2ClientRequest = __nccwpck_require__(3674);
|
|
6325
|
+
const calculateServerName = __nccwpck_require__(5502);
|
|
6326
|
+
const urlToOptions = __nccwpck_require__(5142);
|
|
6657
6327
|
|
|
6658
6328
|
const cache = new QuickLRU({maxSize: 100});
|
|
6659
6329
|
const queue = new Map();
|
|
@@ -6799,18 +6469,18 @@ module.exports.protocolCache = cache;
|
|
|
6799
6469
|
|
|
6800
6470
|
/***/ }),
|
|
6801
6471
|
|
|
6802
|
-
/***/
|
|
6472
|
+
/***/ 3674:
|
|
6803
6473
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6804
6474
|
|
|
6805
6475
|
"use strict";
|
|
6806
6476
|
|
|
6807
6477
|
const http2 = __nccwpck_require__(5158);
|
|
6808
6478
|
const {Writable} = __nccwpck_require__(2781);
|
|
6809
|
-
const {Agent, globalAgent} = __nccwpck_require__(
|
|
6810
|
-
const IncomingMessage = __nccwpck_require__(
|
|
6811
|
-
const urlToOptions = __nccwpck_require__(
|
|
6812
|
-
const proxyEvents = __nccwpck_require__(
|
|
6813
|
-
const isRequestPseudoHeader = __nccwpck_require__(
|
|
6479
|
+
const {Agent, globalAgent} = __nccwpck_require__(6495);
|
|
6480
|
+
const IncomingMessage = __nccwpck_require__(6877);
|
|
6481
|
+
const urlToOptions = __nccwpck_require__(5142);
|
|
6482
|
+
const proxyEvents = __nccwpck_require__(6993);
|
|
6483
|
+
const isRequestPseudoHeader = __nccwpck_require__(7708);
|
|
6814
6484
|
const {
|
|
6815
6485
|
ERR_INVALID_ARG_TYPE,
|
|
6816
6486
|
ERR_INVALID_PROTOCOL,
|
|
@@ -6818,7 +6488,7 @@ const {
|
|
|
6818
6488
|
ERR_INVALID_HTTP_TOKEN,
|
|
6819
6489
|
ERR_HTTP_INVALID_HEADER_VALUE,
|
|
6820
6490
|
ERR_INVALID_CHAR
|
|
6821
|
-
} = __nccwpck_require__(
|
|
6491
|
+
} = __nccwpck_require__(3223);
|
|
6822
6492
|
|
|
6823
6493
|
const {
|
|
6824
6494
|
HTTP2_HEADER_STATUS,
|
|
@@ -7252,7 +6922,7 @@ module.exports = ClientRequest;
|
|
|
7252
6922
|
|
|
7253
6923
|
/***/ }),
|
|
7254
6924
|
|
|
7255
|
-
/***/
|
|
6925
|
+
/***/ 6877:
|
|
7256
6926
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7257
6927
|
|
|
7258
6928
|
"use strict";
|
|
@@ -7318,16 +6988,16 @@ module.exports = IncomingMessage;
|
|
|
7318
6988
|
|
|
7319
6989
|
/***/ }),
|
|
7320
6990
|
|
|
7321
|
-
/***/
|
|
6991
|
+
/***/ 739:
|
|
7322
6992
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7323
6993
|
|
|
7324
6994
|
"use strict";
|
|
7325
6995
|
|
|
7326
6996
|
const http2 = __nccwpck_require__(5158);
|
|
7327
|
-
const agent = __nccwpck_require__(
|
|
7328
|
-
const ClientRequest = __nccwpck_require__(
|
|
7329
|
-
const IncomingMessage = __nccwpck_require__(
|
|
7330
|
-
const auto = __nccwpck_require__(
|
|
6997
|
+
const agent = __nccwpck_require__(6495);
|
|
6998
|
+
const ClientRequest = __nccwpck_require__(3674);
|
|
6999
|
+
const IncomingMessage = __nccwpck_require__(6877);
|
|
7000
|
+
const auto = __nccwpck_require__(229);
|
|
7331
7001
|
|
|
7332
7002
|
const request = (url, options, callback) => {
|
|
7333
7003
|
return new ClientRequest(url, options, callback);
|
|
@@ -7354,7 +7024,7 @@ module.exports = {
|
|
|
7354
7024
|
|
|
7355
7025
|
/***/ }),
|
|
7356
7026
|
|
|
7357
|
-
/***/
|
|
7027
|
+
/***/ 5502:
|
|
7358
7028
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7359
7029
|
|
|
7360
7030
|
"use strict";
|
|
@@ -7389,7 +7059,7 @@ module.exports = options => {
|
|
|
7389
7059
|
|
|
7390
7060
|
/***/ }),
|
|
7391
7061
|
|
|
7392
|
-
/***/
|
|
7062
|
+
/***/ 3223:
|
|
7393
7063
|
/***/ ((module) => {
|
|
7394
7064
|
|
|
7395
7065
|
"use strict";
|
|
@@ -7442,7 +7112,7 @@ makeError(TypeError, 'ERR_INVALID_CHAR', args => {
|
|
|
7442
7112
|
|
|
7443
7113
|
/***/ }),
|
|
7444
7114
|
|
|
7445
|
-
/***/
|
|
7115
|
+
/***/ 7708:
|
|
7446
7116
|
/***/ ((module) => {
|
|
7447
7117
|
|
|
7448
7118
|
"use strict";
|
|
@@ -7463,7 +7133,7 @@ module.exports = header => {
|
|
|
7463
7133
|
|
|
7464
7134
|
/***/ }),
|
|
7465
7135
|
|
|
7466
|
-
/***/
|
|
7136
|
+
/***/ 6993:
|
|
7467
7137
|
/***/ ((module) => {
|
|
7468
7138
|
|
|
7469
7139
|
"use strict";
|
|
@@ -7478,7 +7148,7 @@ module.exports = (from, to, events) => {
|
|
|
7478
7148
|
|
|
7479
7149
|
/***/ }),
|
|
7480
7150
|
|
|
7481
|
-
/***/
|
|
7151
|
+
/***/ 5142:
|
|
7482
7152
|
/***/ ((module) => {
|
|
7483
7153
|
|
|
7484
7154
|
"use strict";
|
|
@@ -7511,7 +7181,7 @@ module.exports = url => {
|
|
|
7511
7181
|
|
|
7512
7182
|
/***/ }),
|
|
7513
7183
|
|
|
7514
|
-
/***/
|
|
7184
|
+
/***/ 3180:
|
|
7515
7185
|
/***/ ((__unused_webpack_module, exports) => {
|
|
7516
7186
|
|
|
7517
7187
|
//TODO: handle reviver/dehydrate function like normal
|
|
@@ -7576,15 +7246,15 @@ exports.parse = function (s) {
|
|
|
7576
7246
|
|
|
7577
7247
|
/***/ }),
|
|
7578
7248
|
|
|
7579
|
-
/***/
|
|
7249
|
+
/***/ 6474:
|
|
7580
7250
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7581
7251
|
|
|
7582
7252
|
"use strict";
|
|
7583
7253
|
|
|
7584
7254
|
|
|
7585
7255
|
const EventEmitter = __nccwpck_require__(2361);
|
|
7586
|
-
const JSONB = __nccwpck_require__(
|
|
7587
|
-
const compressBrotli = __nccwpck_require__(
|
|
7256
|
+
const JSONB = __nccwpck_require__(3180);
|
|
7257
|
+
const compressBrotli = __nccwpck_require__(996);
|
|
7588
7258
|
|
|
7589
7259
|
const loadStore = options => {
|
|
7590
7260
|
const adapters = {
|
|
@@ -7852,7 +7522,7 @@ module.exports = Keyv;
|
|
|
7852
7522
|
|
|
7853
7523
|
/***/ }),
|
|
7854
7524
|
|
|
7855
|
-
/***/
|
|
7525
|
+
/***/ 1128:
|
|
7856
7526
|
/***/ ((module, exports, __nccwpck_require__) => {
|
|
7857
7527
|
|
|
7858
7528
|
/* module decorator */ module = __nccwpck_require__.nmd(module);
|
|
@@ -10346,7 +10016,7 @@ module.exports = orderBy;
|
|
|
10346
10016
|
|
|
10347
10017
|
/***/ }),
|
|
10348
10018
|
|
|
10349
|
-
/***/
|
|
10019
|
+
/***/ 9103:
|
|
10350
10020
|
/***/ ((module) => {
|
|
10351
10021
|
|
|
10352
10022
|
/**
|
|
@@ -10856,7 +10526,7 @@ module.exports = pick;
|
|
|
10856
10526
|
|
|
10857
10527
|
/***/ }),
|
|
10858
10528
|
|
|
10859
|
-
/***/
|
|
10529
|
+
/***/ 2893:
|
|
10860
10530
|
/***/ ((module) => {
|
|
10861
10531
|
|
|
10862
10532
|
"use strict";
|
|
@@ -10874,7 +10544,7 @@ module.exports = object => {
|
|
|
10874
10544
|
|
|
10875
10545
|
/***/ }),
|
|
10876
10546
|
|
|
10877
|
-
/***/
|
|
10547
|
+
/***/ 7642:
|
|
10878
10548
|
/***/ ((module) => {
|
|
10879
10549
|
|
|
10880
10550
|
"use strict";
|
|
@@ -10914,7 +10584,7 @@ module.exports = (fromStream, toStream) => {
|
|
|
10914
10584
|
|
|
10915
10585
|
/***/ }),
|
|
10916
10586
|
|
|
10917
|
-
/***/
|
|
10587
|
+
/***/ 9443:
|
|
10918
10588
|
/***/ ((module) => {
|
|
10919
10589
|
|
|
10920
10590
|
"use strict";
|
|
@@ -10999,7 +10669,7 @@ module.exports = (fromStream, toStream) => {
|
|
|
10999
10669
|
|
|
11000
10670
|
/***/ }),
|
|
11001
10671
|
|
|
11002
|
-
/***/
|
|
10672
|
+
/***/ 5797:
|
|
11003
10673
|
/***/ ((module) => {
|
|
11004
10674
|
|
|
11005
10675
|
"use strict";
|
|
@@ -11223,10 +10893,10 @@ module.exports = normalizeUrl;
|
|
|
11223
10893
|
|
|
11224
10894
|
/***/ }),
|
|
11225
10895
|
|
|
11226
|
-
/***/
|
|
10896
|
+
/***/ 2469:
|
|
11227
10897
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
11228
10898
|
|
|
11229
|
-
var wrappy = __nccwpck_require__(
|
|
10899
|
+
var wrappy = __nccwpck_require__(6540)
|
|
11230
10900
|
module.exports = wrappy(once)
|
|
11231
10901
|
module.exports.strict = wrappy(onceStrict)
|
|
11232
10902
|
|
|
@@ -11272,7 +10942,7 @@ function onceStrict (fn) {
|
|
|
11272
10942
|
|
|
11273
10943
|
/***/ }),
|
|
11274
10944
|
|
|
11275
|
-
/***/
|
|
10945
|
+
/***/ 5323:
|
|
11276
10946
|
/***/ ((module) => {
|
|
11277
10947
|
|
|
11278
10948
|
"use strict";
|
|
@@ -11391,11 +11061,11 @@ module.exports.CancelError = CancelError;
|
|
|
11391
11061
|
|
|
11392
11062
|
/***/ }),
|
|
11393
11063
|
|
|
11394
|
-
/***/
|
|
11064
|
+
/***/ 1216:
|
|
11395
11065
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
11396
11066
|
|
|
11397
|
-
var once = __nccwpck_require__(
|
|
11398
|
-
var eos = __nccwpck_require__(
|
|
11067
|
+
var once = __nccwpck_require__(2469)
|
|
11068
|
+
var eos = __nccwpck_require__(1243)
|
|
11399
11069
|
var fs = __nccwpck_require__(7147) // we only need fs to get the ReadStream and WriteStream prototypes
|
|
11400
11070
|
|
|
11401
11071
|
var noop = function () {}
|
|
@@ -11480,15 +11150,15 @@ module.exports = pump
|
|
|
11480
11150
|
|
|
11481
11151
|
/***/ }),
|
|
11482
11152
|
|
|
11483
|
-
/***/
|
|
11153
|
+
/***/ 2024:
|
|
11484
11154
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11485
11155
|
|
|
11486
11156
|
"use strict";
|
|
11487
11157
|
|
|
11488
|
-
const strictUriEncode = __nccwpck_require__(
|
|
11489
|
-
const decodeComponent = __nccwpck_require__(
|
|
11490
|
-
const splitOnFirst = __nccwpck_require__(
|
|
11491
|
-
const filterObject = __nccwpck_require__(
|
|
11158
|
+
const strictUriEncode = __nccwpck_require__(4450);
|
|
11159
|
+
const decodeComponent = __nccwpck_require__(164);
|
|
11160
|
+
const splitOnFirst = __nccwpck_require__(179);
|
|
11161
|
+
const filterObject = __nccwpck_require__(8172);
|
|
11492
11162
|
|
|
11493
11163
|
const isNullOrUndefined = value => value === null || value === undefined;
|
|
11494
11164
|
|
|
@@ -11970,7 +11640,7 @@ exports.exclude = (input, filter, options) => {
|
|
|
11970
11640
|
|
|
11971
11641
|
/***/ }),
|
|
11972
11642
|
|
|
11973
|
-
/***/
|
|
11643
|
+
/***/ 4225:
|
|
11974
11644
|
/***/ ((module) => {
|
|
11975
11645
|
|
|
11976
11646
|
"use strict";
|
|
@@ -12101,12 +11771,12 @@ module.exports = QuickLRU;
|
|
|
12101
11771
|
|
|
12102
11772
|
/***/ }),
|
|
12103
11773
|
|
|
12104
|
-
/***/
|
|
11774
|
+
/***/ 6354:
|
|
12105
11775
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
12106
11776
|
|
|
12107
11777
|
"use strict";
|
|
12108
11778
|
|
|
12109
|
-
const tls = __nccwpck_require__(
|
|
11779
|
+
const tls = __nccwpck_require__(6821);
|
|
12110
11780
|
|
|
12111
11781
|
module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, reject) => {
|
|
12112
11782
|
let timeout = false;
|
|
@@ -12152,14 +11822,14 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve,
|
|
|
12152
11822
|
|
|
12153
11823
|
/***/ }),
|
|
12154
11824
|
|
|
12155
|
-
/***/
|
|
11825
|
+
/***/ 4404:
|
|
12156
11826
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
12157
11827
|
|
|
12158
11828
|
"use strict";
|
|
12159
11829
|
|
|
12160
11830
|
|
|
12161
11831
|
const Readable = (__nccwpck_require__(2781).Readable);
|
|
12162
|
-
const lowercaseKeys = __nccwpck_require__(
|
|
11832
|
+
const lowercaseKeys = __nccwpck_require__(2893);
|
|
12163
11833
|
|
|
12164
11834
|
class Response extends Readable {
|
|
12165
11835
|
constructor(statusCode, headers, body, url) {
|
|
@@ -12194,7 +11864,7 @@ module.exports = Response;
|
|
|
12194
11864
|
|
|
12195
11865
|
/***/ }),
|
|
12196
11866
|
|
|
12197
|
-
/***/
|
|
11867
|
+
/***/ 179:
|
|
12198
11868
|
/***/ ((module) => {
|
|
12199
11869
|
|
|
12200
11870
|
"use strict";
|
|
@@ -12224,7 +11894,7 @@ module.exports = (string, separator) => {
|
|
|
12224
11894
|
|
|
12225
11895
|
/***/ }),
|
|
12226
11896
|
|
|
12227
|
-
/***/
|
|
11897
|
+
/***/ 4450:
|
|
12228
11898
|
/***/ ((module) => {
|
|
12229
11899
|
|
|
12230
11900
|
"use strict";
|
|
@@ -12234,7 +11904,7 @@ module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.c
|
|
|
12234
11904
|
|
|
12235
11905
|
/***/ }),
|
|
12236
11906
|
|
|
12237
|
-
/***/
|
|
11907
|
+
/***/ 6540:
|
|
12238
11908
|
/***/ ((module) => {
|
|
12239
11909
|
|
|
12240
11910
|
// Returns a wrapper function that returns a wrapped callback
|
|
@@ -12274,15 +11944,14 @@ function wrappy (fn, cb) {
|
|
|
12274
11944
|
|
|
12275
11945
|
/***/ }),
|
|
12276
11946
|
|
|
12277
|
-
/***/
|
|
11947
|
+
/***/ 3933:
|
|
12278
11948
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
12279
11949
|
|
|
12280
11950
|
"use strict";
|
|
12281
11951
|
|
|
12282
11952
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12283
|
-
exports.
|
|
12284
|
-
const
|
|
12285
|
-
const util_1 = __nccwpck_require__(809);
|
|
11953
|
+
exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
|
|
11954
|
+
const util_1 = __nccwpck_require__(9973);
|
|
12286
11955
|
exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
12287
11956
|
"invalid_type",
|
|
12288
11957
|
"invalid_literal",
|
|
@@ -12299,6 +11968,7 @@ exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
|
12299
11968
|
"too_big",
|
|
12300
11969
|
"invalid_intersection_types",
|
|
12301
11970
|
"not_multiple_of",
|
|
11971
|
+
"not_finite",
|
|
12302
11972
|
]);
|
|
12303
11973
|
const quotelessJson = (obj) => {
|
|
12304
11974
|
const json = JSON.stringify(obj, null, 2);
|
|
@@ -12382,7 +12052,7 @@ class ZodError extends Error {
|
|
|
12382
12052
|
return this.message;
|
|
12383
12053
|
}
|
|
12384
12054
|
get message() {
|
|
12385
|
-
return JSON.stringify(this.issues,
|
|
12055
|
+
return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
|
|
12386
12056
|
}
|
|
12387
12057
|
get isEmpty() {
|
|
12388
12058
|
return this.issues.length === 0;
|
|
@@ -12410,101 +12080,23 @@ ZodError.create = (issues) => {
|
|
|
12410
12080
|
const error = new ZodError(issues);
|
|
12411
12081
|
return error;
|
|
12412
12082
|
};
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
case exports.ZodIssueCode.invalid_literal:
|
|
12425
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, parseUtil_1.jsonStringifyReplacer)}`;
|
|
12426
|
-
break;
|
|
12427
|
-
case exports.ZodIssueCode.unrecognized_keys:
|
|
12428
|
-
message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
|
|
12429
|
-
break;
|
|
12430
|
-
case exports.ZodIssueCode.invalid_union:
|
|
12431
|
-
message = `Invalid input`;
|
|
12432
|
-
break;
|
|
12433
|
-
case exports.ZodIssueCode.invalid_union_discriminator:
|
|
12434
|
-
message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
|
|
12435
|
-
break;
|
|
12436
|
-
case exports.ZodIssueCode.invalid_enum_value:
|
|
12437
|
-
message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
12438
|
-
break;
|
|
12439
|
-
case exports.ZodIssueCode.invalid_arguments:
|
|
12440
|
-
message = `Invalid function arguments`;
|
|
12441
|
-
break;
|
|
12442
|
-
case exports.ZodIssueCode.invalid_return_type:
|
|
12443
|
-
message = `Invalid function return type`;
|
|
12444
|
-
break;
|
|
12445
|
-
case exports.ZodIssueCode.invalid_date:
|
|
12446
|
-
message = `Invalid date`;
|
|
12447
|
-
break;
|
|
12448
|
-
case exports.ZodIssueCode.invalid_string:
|
|
12449
|
-
if (typeof issue.validation === "object") {
|
|
12450
|
-
if ("startsWith" in issue.validation) {
|
|
12451
|
-
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
12452
|
-
}
|
|
12453
|
-
else if ("endsWith" in issue.validation) {
|
|
12454
|
-
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
12455
|
-
}
|
|
12456
|
-
else {
|
|
12457
|
-
util_1.util.assertNever(issue.validation);
|
|
12458
|
-
}
|
|
12459
|
-
}
|
|
12460
|
-
else if (issue.validation !== "regex") {
|
|
12461
|
-
message = `Invalid ${issue.validation}`;
|
|
12462
|
-
}
|
|
12463
|
-
else {
|
|
12464
|
-
message = "Invalid";
|
|
12465
|
-
}
|
|
12466
|
-
break;
|
|
12467
|
-
case exports.ZodIssueCode.too_small:
|
|
12468
|
-
if (issue.type === "array")
|
|
12469
|
-
message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
12470
|
-
else if (issue.type === "string")
|
|
12471
|
-
message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
12472
|
-
else if (issue.type === "number")
|
|
12473
|
-
message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
|
|
12474
|
-
else if (issue.type === "date")
|
|
12475
|
-
message = `Date must be greater than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.minimum)}`;
|
|
12476
|
-
else
|
|
12477
|
-
message = "Invalid input";
|
|
12478
|
-
break;
|
|
12479
|
-
case exports.ZodIssueCode.too_big:
|
|
12480
|
-
if (issue.type === "array")
|
|
12481
|
-
message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
12482
|
-
else if (issue.type === "string")
|
|
12483
|
-
message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
12484
|
-
else if (issue.type === "number")
|
|
12485
|
-
message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
|
|
12486
|
-
else if (issue.type === "date")
|
|
12487
|
-
message = `Date must be smaller than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.maximum)}`;
|
|
12488
|
-
else
|
|
12489
|
-
message = "Invalid input";
|
|
12490
|
-
break;
|
|
12491
|
-
case exports.ZodIssueCode.custom:
|
|
12492
|
-
message = `Invalid input`;
|
|
12493
|
-
break;
|
|
12494
|
-
case exports.ZodIssueCode.invalid_intersection_types:
|
|
12495
|
-
message = `Intersection results could not be merged`;
|
|
12496
|
-
break;
|
|
12497
|
-
case exports.ZodIssueCode.not_multiple_of:
|
|
12498
|
-
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
12499
|
-
break;
|
|
12500
|
-
default:
|
|
12501
|
-
message = _ctx.defaultError;
|
|
12502
|
-
util_1.util.assertNever(issue);
|
|
12503
|
-
}
|
|
12504
|
-
return { message };
|
|
12083
|
+
|
|
12084
|
+
|
|
12085
|
+
/***/ }),
|
|
12086
|
+
|
|
12087
|
+
/***/ 5391:
|
|
12088
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
12089
|
+
|
|
12090
|
+
"use strict";
|
|
12091
|
+
|
|
12092
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12093
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12505
12094
|
};
|
|
12506
|
-
exports
|
|
12507
|
-
|
|
12095
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12096
|
+
exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
|
|
12097
|
+
const en_1 = __importDefault(__nccwpck_require__(184));
|
|
12098
|
+
exports.defaultErrorMap = en_1.default;
|
|
12099
|
+
let overrideErrorMap = en_1.default;
|
|
12508
12100
|
function setErrorMap(map) {
|
|
12509
12101
|
overrideErrorMap = map;
|
|
12510
12102
|
}
|
|
@@ -12517,7 +12109,7 @@ exports.getErrorMap = getErrorMap;
|
|
|
12517
12109
|
|
|
12518
12110
|
/***/ }),
|
|
12519
12111
|
|
|
12520
|
-
/***/
|
|
12112
|
+
/***/ 7365:
|
|
12521
12113
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
12522
12114
|
|
|
12523
12115
|
"use strict";
|
|
@@ -12533,19 +12125,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12533
12125
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
12534
12126
|
};
|
|
12535
12127
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12536
|
-
|
|
12537
|
-
__exportStar(__nccwpck_require__(
|
|
12538
|
-
__exportStar(__nccwpck_require__(
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
__exportStar(__nccwpck_require__(54), exports);
|
|
12543
|
-
__exportStar(__nccwpck_require__(6597), exports);
|
|
12128
|
+
__exportStar(__nccwpck_require__(5391), exports);
|
|
12129
|
+
__exportStar(__nccwpck_require__(3636), exports);
|
|
12130
|
+
__exportStar(__nccwpck_require__(9599), exports);
|
|
12131
|
+
__exportStar(__nccwpck_require__(9973), exports);
|
|
12132
|
+
__exportStar(__nccwpck_require__(7889), exports);
|
|
12133
|
+
__exportStar(__nccwpck_require__(3933), exports);
|
|
12544
12134
|
|
|
12545
12135
|
|
|
12546
12136
|
/***/ }),
|
|
12547
12137
|
|
|
12548
|
-
/***/
|
|
12138
|
+
/***/ 9849:
|
|
12549
12139
|
/***/ ((__unused_webpack_module, exports) => {
|
|
12550
12140
|
|
|
12551
12141
|
"use strict";
|
|
@@ -12561,14 +12151,18 @@ var errorUtil;
|
|
|
12561
12151
|
|
|
12562
12152
|
/***/ }),
|
|
12563
12153
|
|
|
12564
|
-
/***/
|
|
12565
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__)
|
|
12154
|
+
/***/ 3636:
|
|
12155
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
12566
12156
|
|
|
12567
12157
|
"use strict";
|
|
12568
12158
|
|
|
12159
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12160
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12161
|
+
};
|
|
12569
12162
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12570
|
-
exports.
|
|
12571
|
-
const
|
|
12163
|
+
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;
|
|
12164
|
+
const errors_1 = __nccwpck_require__(5391);
|
|
12165
|
+
const en_1 = __importDefault(__nccwpck_require__(184));
|
|
12572
12166
|
const makeIssue = (params) => {
|
|
12573
12167
|
const { data, path, errorMaps, issueData } = params;
|
|
12574
12168
|
const fullPath = [...path, ...(issueData.path || [])];
|
|
@@ -12593,15 +12187,15 @@ const makeIssue = (params) => {
|
|
|
12593
12187
|
exports.makeIssue = makeIssue;
|
|
12594
12188
|
exports.EMPTY_PATH = [];
|
|
12595
12189
|
function addIssueToContext(ctx, issueData) {
|
|
12596
|
-
const issue = exports.makeIssue({
|
|
12190
|
+
const issue = (0, exports.makeIssue)({
|
|
12597
12191
|
issueData: issueData,
|
|
12598
12192
|
data: ctx.data,
|
|
12599
12193
|
path: ctx.path,
|
|
12600
12194
|
errorMaps: [
|
|
12601
12195
|
ctx.common.contextualErrorMap,
|
|
12602
12196
|
ctx.schemaErrorMap,
|
|
12603
|
-
|
|
12604
|
-
|
|
12197
|
+
(0, errors_1.getErrorMap)(),
|
|
12198
|
+
en_1.default, // then global default map
|
|
12605
12199
|
].filter((x) => !!x),
|
|
12606
12200
|
});
|
|
12607
12201
|
ctx.common.issues.push(issue);
|
|
@@ -12675,18 +12269,11 @@ const isValid = (x) => x.status === "valid";
|
|
|
12675
12269
|
exports.isValid = isValid;
|
|
12676
12270
|
const isAsync = (x) => typeof Promise !== undefined && x instanceof Promise;
|
|
12677
12271
|
exports.isAsync = isAsync;
|
|
12678
|
-
const jsonStringifyReplacer = (_, value) => {
|
|
12679
|
-
if (typeof value === "bigint") {
|
|
12680
|
-
return value.toString();
|
|
12681
|
-
}
|
|
12682
|
-
return value;
|
|
12683
|
-
};
|
|
12684
|
-
exports.jsonStringifyReplacer = jsonStringifyReplacer;
|
|
12685
12272
|
|
|
12686
12273
|
|
|
12687
12274
|
/***/ }),
|
|
12688
12275
|
|
|
12689
|
-
/***/
|
|
12276
|
+
/***/ 9599:
|
|
12690
12277
|
/***/ ((__unused_webpack_module, exports) => {
|
|
12691
12278
|
|
|
12692
12279
|
"use strict";
|
|
@@ -12696,7 +12283,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
12696
12283
|
|
|
12697
12284
|
/***/ }),
|
|
12698
12285
|
|
|
12699
|
-
/***/
|
|
12286
|
+
/***/ 9973:
|
|
12700
12287
|
/***/ ((__unused_webpack_module, exports) => {
|
|
12701
12288
|
|
|
12702
12289
|
"use strict";
|
|
@@ -12759,6 +12346,12 @@ var util;
|
|
|
12759
12346
|
.join(separator);
|
|
12760
12347
|
}
|
|
12761
12348
|
util.joinValues = joinValues;
|
|
12349
|
+
util.jsonStringifyReplacer = (_, value) => {
|
|
12350
|
+
if (typeof value === "bigint") {
|
|
12351
|
+
return value.toString();
|
|
12352
|
+
}
|
|
12353
|
+
return value;
|
|
12354
|
+
};
|
|
12762
12355
|
})(util = exports.util || (exports.util = {}));
|
|
12763
12356
|
exports.ZodParsedType = util.arrayToEnum([
|
|
12764
12357
|
"string",
|
|
@@ -12797,6 +12390,8 @@ const getParsedType = (data) => {
|
|
|
12797
12390
|
return exports.ZodParsedType.function;
|
|
12798
12391
|
case "bigint":
|
|
12799
12392
|
return exports.ZodParsedType.bigint;
|
|
12393
|
+
case "symbol":
|
|
12394
|
+
return exports.ZodParsedType.symbol;
|
|
12800
12395
|
case "object":
|
|
12801
12396
|
if (Array.isArray(data)) {
|
|
12802
12397
|
return exports.ZodParsedType.array;
|
|
@@ -12829,7 +12424,7 @@ exports.getParsedType = getParsedType;
|
|
|
12829
12424
|
|
|
12830
12425
|
/***/ }),
|
|
12831
12426
|
|
|
12832
|
-
/***/
|
|
12427
|
+
/***/ 6319:
|
|
12833
12428
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
12834
12429
|
|
|
12835
12430
|
"use strict";
|
|
@@ -12858,26 +12453,152 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12858
12453
|
};
|
|
12859
12454
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12860
12455
|
exports.z = void 0;
|
|
12861
|
-
const mod = __importStar(__nccwpck_require__(
|
|
12456
|
+
const mod = __importStar(__nccwpck_require__(7365));
|
|
12862
12457
|
exports.z = mod;
|
|
12863
|
-
__exportStar(__nccwpck_require__(
|
|
12458
|
+
__exportStar(__nccwpck_require__(7365), exports);
|
|
12864
12459
|
exports["default"] = mod;
|
|
12865
12460
|
|
|
12866
12461
|
|
|
12867
12462
|
/***/ }),
|
|
12868
12463
|
|
|
12869
|
-
/***/
|
|
12464
|
+
/***/ 184:
|
|
12465
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
12466
|
+
|
|
12467
|
+
"use strict";
|
|
12468
|
+
|
|
12469
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12470
|
+
const util_1 = __nccwpck_require__(9973);
|
|
12471
|
+
const ZodError_1 = __nccwpck_require__(3933);
|
|
12472
|
+
const errorMap = (issue, _ctx) => {
|
|
12473
|
+
let message;
|
|
12474
|
+
switch (issue.code) {
|
|
12475
|
+
case ZodError_1.ZodIssueCode.invalid_type:
|
|
12476
|
+
if (issue.received === util_1.ZodParsedType.undefined) {
|
|
12477
|
+
message = "Required";
|
|
12478
|
+
}
|
|
12479
|
+
else {
|
|
12480
|
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
12481
|
+
}
|
|
12482
|
+
break;
|
|
12483
|
+
case ZodError_1.ZodIssueCode.invalid_literal:
|
|
12484
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;
|
|
12485
|
+
break;
|
|
12486
|
+
case ZodError_1.ZodIssueCode.unrecognized_keys:
|
|
12487
|
+
message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
|
|
12488
|
+
break;
|
|
12489
|
+
case ZodError_1.ZodIssueCode.invalid_union:
|
|
12490
|
+
message = `Invalid input`;
|
|
12491
|
+
break;
|
|
12492
|
+
case ZodError_1.ZodIssueCode.invalid_union_discriminator:
|
|
12493
|
+
message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
|
|
12494
|
+
break;
|
|
12495
|
+
case ZodError_1.ZodIssueCode.invalid_enum_value:
|
|
12496
|
+
message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
12497
|
+
break;
|
|
12498
|
+
case ZodError_1.ZodIssueCode.invalid_arguments:
|
|
12499
|
+
message = `Invalid function arguments`;
|
|
12500
|
+
break;
|
|
12501
|
+
case ZodError_1.ZodIssueCode.invalid_return_type:
|
|
12502
|
+
message = `Invalid function return type`;
|
|
12503
|
+
break;
|
|
12504
|
+
case ZodError_1.ZodIssueCode.invalid_date:
|
|
12505
|
+
message = `Invalid date`;
|
|
12506
|
+
break;
|
|
12507
|
+
case ZodError_1.ZodIssueCode.invalid_string:
|
|
12508
|
+
if (typeof issue.validation === "object") {
|
|
12509
|
+
if ("startsWith" in issue.validation) {
|
|
12510
|
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
12511
|
+
}
|
|
12512
|
+
else if ("endsWith" in issue.validation) {
|
|
12513
|
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
12514
|
+
}
|
|
12515
|
+
else {
|
|
12516
|
+
util_1.util.assertNever(issue.validation);
|
|
12517
|
+
}
|
|
12518
|
+
}
|
|
12519
|
+
else if (issue.validation !== "regex") {
|
|
12520
|
+
message = `Invalid ${issue.validation}`;
|
|
12521
|
+
}
|
|
12522
|
+
else {
|
|
12523
|
+
message = "Invalid";
|
|
12524
|
+
}
|
|
12525
|
+
break;
|
|
12526
|
+
case ZodError_1.ZodIssueCode.too_small:
|
|
12527
|
+
if (issue.type === "array")
|
|
12528
|
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
12529
|
+
else if (issue.type === "string")
|
|
12530
|
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
12531
|
+
else if (issue.type === "number")
|
|
12532
|
+
message = `Number must be ${issue.exact
|
|
12533
|
+
? `exactly equal to `
|
|
12534
|
+
: issue.inclusive
|
|
12535
|
+
? `greater than or equal to `
|
|
12536
|
+
: `greater than `}${issue.minimum}`;
|
|
12537
|
+
else if (issue.type === "date")
|
|
12538
|
+
message = `Date must be ${issue.exact
|
|
12539
|
+
? `exactly equal to `
|
|
12540
|
+
: issue.inclusive
|
|
12541
|
+
? `greater than or equal to `
|
|
12542
|
+
: `greater than `}${new Date(issue.minimum)}`;
|
|
12543
|
+
else
|
|
12544
|
+
message = "Invalid input";
|
|
12545
|
+
break;
|
|
12546
|
+
case ZodError_1.ZodIssueCode.too_big:
|
|
12547
|
+
if (issue.type === "array")
|
|
12548
|
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
12549
|
+
else if (issue.type === "string")
|
|
12550
|
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
12551
|
+
else if (issue.type === "number")
|
|
12552
|
+
message = `Number must be ${issue.exact
|
|
12553
|
+
? `exactly`
|
|
12554
|
+
: issue.inclusive
|
|
12555
|
+
? `less than or equal to`
|
|
12556
|
+
: `less than`} ${issue.maximum}`;
|
|
12557
|
+
else if (issue.type === "date")
|
|
12558
|
+
message = `Date must be ${issue.exact
|
|
12559
|
+
? `exactly`
|
|
12560
|
+
: issue.inclusive
|
|
12561
|
+
? `smaller than or equal to`
|
|
12562
|
+
: `smaller than`} ${new Date(issue.maximum)}`;
|
|
12563
|
+
else
|
|
12564
|
+
message = "Invalid input";
|
|
12565
|
+
break;
|
|
12566
|
+
case ZodError_1.ZodIssueCode.custom:
|
|
12567
|
+
message = `Invalid input`;
|
|
12568
|
+
break;
|
|
12569
|
+
case ZodError_1.ZodIssueCode.invalid_intersection_types:
|
|
12570
|
+
message = `Intersection results could not be merged`;
|
|
12571
|
+
break;
|
|
12572
|
+
case ZodError_1.ZodIssueCode.not_multiple_of:
|
|
12573
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
12574
|
+
break;
|
|
12575
|
+
case ZodError_1.ZodIssueCode.not_finite:
|
|
12576
|
+
message = "Number must be finite";
|
|
12577
|
+
break;
|
|
12578
|
+
default:
|
|
12579
|
+
message = _ctx.defaultError;
|
|
12580
|
+
util_1.util.assertNever(issue);
|
|
12581
|
+
}
|
|
12582
|
+
return { message };
|
|
12583
|
+
};
|
|
12584
|
+
exports["default"] = errorMap;
|
|
12585
|
+
|
|
12586
|
+
|
|
12587
|
+
/***/ }),
|
|
12588
|
+
|
|
12589
|
+
/***/ 7889:
|
|
12870
12590
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
12871
12591
|
|
|
12872
12592
|
"use strict";
|
|
12873
12593
|
|
|
12874
12594
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12875
|
-
exports
|
|
12876
|
-
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;
|
|
12877
|
-
const
|
|
12878
|
-
const
|
|
12879
|
-
const
|
|
12880
|
-
const
|
|
12595
|
+
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;
|
|
12596
|
+
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;
|
|
12597
|
+
const errors_1 = __nccwpck_require__(5391);
|
|
12598
|
+
const errorUtil_1 = __nccwpck_require__(9849);
|
|
12599
|
+
const parseUtil_1 = __nccwpck_require__(3636);
|
|
12600
|
+
const util_1 = __nccwpck_require__(9973);
|
|
12601
|
+
const ZodError_1 = __nccwpck_require__(3933);
|
|
12881
12602
|
class ParseInputLazyPath {
|
|
12882
12603
|
constructor(parent, value, path, key) {
|
|
12883
12604
|
this.parent = parent;
|
|
@@ -12890,7 +12611,7 @@ class ParseInputLazyPath {
|
|
|
12890
12611
|
}
|
|
12891
12612
|
}
|
|
12892
12613
|
const handleResult = (ctx, result) => {
|
|
12893
|
-
if (parseUtil_1.isValid(result)) {
|
|
12614
|
+
if ((0, parseUtil_1.isValid)(result)) {
|
|
12894
12615
|
return { success: true, data: result.value };
|
|
12895
12616
|
}
|
|
12896
12617
|
else {
|
|
@@ -12906,7 +12627,7 @@ function processCreateParams(params) {
|
|
|
12906
12627
|
return {};
|
|
12907
12628
|
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
12908
12629
|
if (errorMap && (invalid_type_error || required_error)) {
|
|
12909
|
-
throw new Error(`Can't use "
|
|
12630
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
12910
12631
|
}
|
|
12911
12632
|
if (errorMap)
|
|
12912
12633
|
return { errorMap: errorMap, description };
|
|
@@ -12924,7 +12645,6 @@ class ZodType {
|
|
|
12924
12645
|
constructor(def) {
|
|
12925
12646
|
/** Alias of safeParseAsync */
|
|
12926
12647
|
this.spa = this.safeParseAsync;
|
|
12927
|
-
this.superRefine = this._refinement;
|
|
12928
12648
|
this._def = def;
|
|
12929
12649
|
this.parse = this.parse.bind(this);
|
|
12930
12650
|
this.safeParse = this.safeParse.bind(this);
|
|
@@ -12942,8 +12662,11 @@ class ZodType {
|
|
|
12942
12662
|
this.or = this.or.bind(this);
|
|
12943
12663
|
this.and = this.and.bind(this);
|
|
12944
12664
|
this.transform = this.transform.bind(this);
|
|
12665
|
+
this.brand = this.brand.bind(this);
|
|
12945
12666
|
this.default = this.default.bind(this);
|
|
12667
|
+
this.catch = this.catch.bind(this);
|
|
12946
12668
|
this.describe = this.describe.bind(this);
|
|
12669
|
+
this.pipe = this.pipe.bind(this);
|
|
12947
12670
|
this.isNullable = this.isNullable.bind(this);
|
|
12948
12671
|
this.isOptional = this.isOptional.bind(this);
|
|
12949
12672
|
}
|
|
@@ -12951,13 +12674,13 @@ class ZodType {
|
|
|
12951
12674
|
return this._def.description;
|
|
12952
12675
|
}
|
|
12953
12676
|
_getType(input) {
|
|
12954
|
-
return util_1.getParsedType(input.data);
|
|
12677
|
+
return (0, util_1.getParsedType)(input.data);
|
|
12955
12678
|
}
|
|
12956
12679
|
_getOrReturnCtx(input, ctx) {
|
|
12957
12680
|
return (ctx || {
|
|
12958
12681
|
common: input.parent.common,
|
|
12959
12682
|
data: input.data,
|
|
12960
|
-
parsedType: util_1.getParsedType(input.data),
|
|
12683
|
+
parsedType: (0, util_1.getParsedType)(input.data),
|
|
12961
12684
|
schemaErrorMap: this._def.errorMap,
|
|
12962
12685
|
path: input.path,
|
|
12963
12686
|
parent: input.parent,
|
|
@@ -12969,7 +12692,7 @@ class ZodType {
|
|
|
12969
12692
|
ctx: {
|
|
12970
12693
|
common: input.parent.common,
|
|
12971
12694
|
data: input.data,
|
|
12972
|
-
parsedType: util_1.getParsedType(input.data),
|
|
12695
|
+
parsedType: (0, util_1.getParsedType)(input.data),
|
|
12973
12696
|
schemaErrorMap: this._def.errorMap,
|
|
12974
12697
|
path: input.path,
|
|
12975
12698
|
parent: input.parent,
|
|
@@ -12978,7 +12701,7 @@ class ZodType {
|
|
|
12978
12701
|
}
|
|
12979
12702
|
_parseSync(input) {
|
|
12980
12703
|
const result = this._parse(input);
|
|
12981
|
-
if (parseUtil_1.isAsync(result)) {
|
|
12704
|
+
if ((0, parseUtil_1.isAsync)(result)) {
|
|
12982
12705
|
throw new Error("Synchronous parse encountered promise.");
|
|
12983
12706
|
}
|
|
12984
12707
|
return result;
|
|
@@ -13005,7 +12728,7 @@ class ZodType {
|
|
|
13005
12728
|
schemaErrorMap: this._def.errorMap,
|
|
13006
12729
|
parent: null,
|
|
13007
12730
|
data,
|
|
13008
|
-
parsedType: util_1.getParsedType(data),
|
|
12731
|
+
parsedType: (0, util_1.getParsedType)(data),
|
|
13009
12732
|
};
|
|
13010
12733
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
13011
12734
|
return handleResult(ctx, result);
|
|
@@ -13027,10 +12750,10 @@ class ZodType {
|
|
|
13027
12750
|
schemaErrorMap: this._def.errorMap,
|
|
13028
12751
|
parent: null,
|
|
13029
12752
|
data,
|
|
13030
|
-
parsedType: util_1.getParsedType(data),
|
|
12753
|
+
parsedType: (0, util_1.getParsedType)(data),
|
|
13031
12754
|
};
|
|
13032
|
-
const maybeAsyncResult = this._parse({ data, path:
|
|
13033
|
-
const result = await (parseUtil_1.isAsync(maybeAsyncResult)
|
|
12755
|
+
const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
|
|
12756
|
+
const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)
|
|
13034
12757
|
? maybeAsyncResult
|
|
13035
12758
|
: Promise.resolve(maybeAsyncResult));
|
|
13036
12759
|
return handleResult(ctx, result);
|
|
@@ -13093,6 +12816,9 @@ class ZodType {
|
|
|
13093
12816
|
effect: { type: "refinement", refinement },
|
|
13094
12817
|
});
|
|
13095
12818
|
}
|
|
12819
|
+
superRefine(refinement) {
|
|
12820
|
+
return this._refinement(refinement);
|
|
12821
|
+
}
|
|
13096
12822
|
optional() {
|
|
13097
12823
|
return ZodOptional.create(this);
|
|
13098
12824
|
}
|
|
@@ -13136,6 +12862,14 @@ class ZodType {
|
|
|
13136
12862
|
...processCreateParams(undefined),
|
|
13137
12863
|
});
|
|
13138
12864
|
}
|
|
12865
|
+
catch(def) {
|
|
12866
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
12867
|
+
return new ZodCatch({
|
|
12868
|
+
innerType: this,
|
|
12869
|
+
defaultValue: defaultValueFunc,
|
|
12870
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
12871
|
+
});
|
|
12872
|
+
}
|
|
13139
12873
|
describe(description) {
|
|
13140
12874
|
const This = this.constructor;
|
|
13141
12875
|
return new This({
|
|
@@ -13143,6 +12877,9 @@ class ZodType {
|
|
|
13143
12877
|
description,
|
|
13144
12878
|
});
|
|
13145
12879
|
}
|
|
12880
|
+
pipe(target) {
|
|
12881
|
+
return ZodPipeline.create(this, target);
|
|
12882
|
+
}
|
|
13146
12883
|
isOptional() {
|
|
13147
12884
|
return this.safeParse(undefined).success;
|
|
13148
12885
|
}
|
|
@@ -13160,6 +12897,39 @@ const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-
|
|
|
13160
12897
|
// 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;
|
|
13161
12898
|
// eslint-disable-next-line
|
|
13162
12899
|
const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
|
12900
|
+
// interface IsDateStringOptions extends StringDateOptions {
|
|
12901
|
+
/**
|
|
12902
|
+
* Match any configuration
|
|
12903
|
+
*/
|
|
12904
|
+
// any?: boolean;
|
|
12905
|
+
// }
|
|
12906
|
+
// Adapted from https://stackoverflow.com/a/3143231
|
|
12907
|
+
const datetimeRegex = (args) => {
|
|
12908
|
+
if (args.precision) {
|
|
12909
|
+
if (args.offset) {
|
|
12910
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
12911
|
+
}
|
|
12912
|
+
else {
|
|
12913
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
12914
|
+
}
|
|
12915
|
+
}
|
|
12916
|
+
else if (args.precision === 0) {
|
|
12917
|
+
if (args.offset) {
|
|
12918
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
12919
|
+
}
|
|
12920
|
+
else {
|
|
12921
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
12922
|
+
}
|
|
12923
|
+
}
|
|
12924
|
+
else {
|
|
12925
|
+
if (args.offset) {
|
|
12926
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
12927
|
+
}
|
|
12928
|
+
else {
|
|
12929
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
12930
|
+
}
|
|
12931
|
+
}
|
|
12932
|
+
};
|
|
13163
12933
|
class ZodString extends ZodType {
|
|
13164
12934
|
constructor() {
|
|
13165
12935
|
super(...arguments);
|
|
@@ -13179,10 +12949,13 @@ class ZodString extends ZodType {
|
|
|
13179
12949
|
});
|
|
13180
12950
|
}
|
|
13181
12951
|
_parse(input) {
|
|
12952
|
+
if (this._def.coerce) {
|
|
12953
|
+
input.data = String(input.data);
|
|
12954
|
+
}
|
|
13182
12955
|
const parsedType = this._getType(input);
|
|
13183
12956
|
if (parsedType !== util_1.ZodParsedType.string) {
|
|
13184
12957
|
const ctx = this._getOrReturnCtx(input);
|
|
13185
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12958
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13186
12959
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13187
12960
|
expected: util_1.ZodParsedType.string,
|
|
13188
12961
|
received: ctx.parsedType,
|
|
@@ -13197,11 +12970,12 @@ class ZodString extends ZodType {
|
|
|
13197
12970
|
if (check.kind === "min") {
|
|
13198
12971
|
if (input.data.length < check.value) {
|
|
13199
12972
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13200
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12973
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13201
12974
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13202
12975
|
minimum: check.value,
|
|
13203
12976
|
type: "string",
|
|
13204
12977
|
inclusive: true,
|
|
12978
|
+
exact: false,
|
|
13205
12979
|
message: check.message,
|
|
13206
12980
|
});
|
|
13207
12981
|
status.dirty();
|
|
@@ -13210,20 +12984,49 @@ class ZodString extends ZodType {
|
|
|
13210
12984
|
else if (check.kind === "max") {
|
|
13211
12985
|
if (input.data.length > check.value) {
|
|
13212
12986
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13213
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12987
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13214
12988
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13215
12989
|
maximum: check.value,
|
|
13216
12990
|
type: "string",
|
|
13217
12991
|
inclusive: true,
|
|
12992
|
+
exact: false,
|
|
13218
12993
|
message: check.message,
|
|
13219
12994
|
});
|
|
13220
12995
|
status.dirty();
|
|
13221
12996
|
}
|
|
13222
12997
|
}
|
|
12998
|
+
else if (check.kind === "length") {
|
|
12999
|
+
const tooBig = input.data.length > check.value;
|
|
13000
|
+
const tooSmall = input.data.length < check.value;
|
|
13001
|
+
if (tooBig || tooSmall) {
|
|
13002
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
13003
|
+
if (tooBig) {
|
|
13004
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13005
|
+
code: ZodError_1.ZodIssueCode.too_big,
|
|
13006
|
+
maximum: check.value,
|
|
13007
|
+
type: "string",
|
|
13008
|
+
inclusive: true,
|
|
13009
|
+
exact: true,
|
|
13010
|
+
message: check.message,
|
|
13011
|
+
});
|
|
13012
|
+
}
|
|
13013
|
+
else if (tooSmall) {
|
|
13014
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13015
|
+
code: ZodError_1.ZodIssueCode.too_small,
|
|
13016
|
+
minimum: check.value,
|
|
13017
|
+
type: "string",
|
|
13018
|
+
inclusive: true,
|
|
13019
|
+
exact: true,
|
|
13020
|
+
message: check.message,
|
|
13021
|
+
});
|
|
13022
|
+
}
|
|
13023
|
+
status.dirty();
|
|
13024
|
+
}
|
|
13025
|
+
}
|
|
13223
13026
|
else if (check.kind === "email") {
|
|
13224
13027
|
if (!emailRegex.test(input.data)) {
|
|
13225
13028
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13226
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13029
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13227
13030
|
validation: "email",
|
|
13228
13031
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13229
13032
|
message: check.message,
|
|
@@ -13234,7 +13037,7 @@ class ZodString extends ZodType {
|
|
|
13234
13037
|
else if (check.kind === "uuid") {
|
|
13235
13038
|
if (!uuidRegex.test(input.data)) {
|
|
13236
13039
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13237
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13040
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13238
13041
|
validation: "uuid",
|
|
13239
13042
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13240
13043
|
message: check.message,
|
|
@@ -13245,7 +13048,7 @@ class ZodString extends ZodType {
|
|
|
13245
13048
|
else if (check.kind === "cuid") {
|
|
13246
13049
|
if (!cuidRegex.test(input.data)) {
|
|
13247
13050
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13248
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13051
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13249
13052
|
validation: "cuid",
|
|
13250
13053
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13251
13054
|
message: check.message,
|
|
@@ -13259,7 +13062,7 @@ class ZodString extends ZodType {
|
|
|
13259
13062
|
}
|
|
13260
13063
|
catch (_a) {
|
|
13261
13064
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13262
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13065
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13263
13066
|
validation: "url",
|
|
13264
13067
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13265
13068
|
message: check.message,
|
|
@@ -13272,7 +13075,7 @@ class ZodString extends ZodType {
|
|
|
13272
13075
|
const testResult = check.regex.test(input.data);
|
|
13273
13076
|
if (!testResult) {
|
|
13274
13077
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13275
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13078
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13276
13079
|
validation: "regex",
|
|
13277
13080
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13278
13081
|
message: check.message,
|
|
@@ -13286,7 +13089,7 @@ class ZodString extends ZodType {
|
|
|
13286
13089
|
else if (check.kind === "startsWith") {
|
|
13287
13090
|
if (!input.data.startsWith(check.value)) {
|
|
13288
13091
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13289
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13092
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13290
13093
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13291
13094
|
validation: { startsWith: check.value },
|
|
13292
13095
|
message: check.message,
|
|
@@ -13297,7 +13100,7 @@ class ZodString extends ZodType {
|
|
|
13297
13100
|
else if (check.kind === "endsWith") {
|
|
13298
13101
|
if (!input.data.endsWith(check.value)) {
|
|
13299
13102
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13300
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13103
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13301
13104
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13302
13105
|
validation: { endsWith: check.value },
|
|
13303
13106
|
message: check.message,
|
|
@@ -13305,6 +13108,18 @@ class ZodString extends ZodType {
|
|
|
13305
13108
|
status.dirty();
|
|
13306
13109
|
}
|
|
13307
13110
|
}
|
|
13111
|
+
else if (check.kind === "datetime") {
|
|
13112
|
+
const regex = datetimeRegex(check);
|
|
13113
|
+
if (!regex.test(input.data)) {
|
|
13114
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
13115
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13116
|
+
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
13117
|
+
validation: "datetime",
|
|
13118
|
+
message: check.message,
|
|
13119
|
+
});
|
|
13120
|
+
status.dirty();
|
|
13121
|
+
}
|
|
13122
|
+
}
|
|
13308
13123
|
else {
|
|
13309
13124
|
util_1.util.assertNever(check);
|
|
13310
13125
|
}
|
|
@@ -13329,6 +13144,23 @@ class ZodString extends ZodType {
|
|
|
13329
13144
|
cuid(message) {
|
|
13330
13145
|
return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
|
|
13331
13146
|
}
|
|
13147
|
+
datetime(options) {
|
|
13148
|
+
var _a;
|
|
13149
|
+
if (typeof options === "string") {
|
|
13150
|
+
return this._addCheck({
|
|
13151
|
+
kind: "datetime",
|
|
13152
|
+
precision: null,
|
|
13153
|
+
offset: false,
|
|
13154
|
+
message: options,
|
|
13155
|
+
});
|
|
13156
|
+
}
|
|
13157
|
+
return this._addCheck({
|
|
13158
|
+
kind: "datetime",
|
|
13159
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
13160
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
13161
|
+
...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
|
|
13162
|
+
});
|
|
13163
|
+
}
|
|
13332
13164
|
regex(regex, message) {
|
|
13333
13165
|
return this._addCheck({
|
|
13334
13166
|
kind: "regex",
|
|
@@ -13365,7 +13197,14 @@ class ZodString extends ZodType {
|
|
|
13365
13197
|
});
|
|
13366
13198
|
}
|
|
13367
13199
|
length(len, message) {
|
|
13368
|
-
return this.
|
|
13200
|
+
return this._addCheck({
|
|
13201
|
+
kind: "length",
|
|
13202
|
+
value: len,
|
|
13203
|
+
...errorUtil_1.errorUtil.errToObj(message),
|
|
13204
|
+
});
|
|
13205
|
+
}
|
|
13206
|
+
get isDatetime() {
|
|
13207
|
+
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
13369
13208
|
}
|
|
13370
13209
|
get isEmail() {
|
|
13371
13210
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
@@ -13402,9 +13241,11 @@ class ZodString extends ZodType {
|
|
|
13402
13241
|
}
|
|
13403
13242
|
exports.ZodString = ZodString;
|
|
13404
13243
|
ZodString.create = (params) => {
|
|
13244
|
+
var _a;
|
|
13405
13245
|
return new ZodString({
|
|
13406
13246
|
checks: [],
|
|
13407
13247
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
13248
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
13408
13249
|
...processCreateParams(params),
|
|
13409
13250
|
});
|
|
13410
13251
|
};
|
|
@@ -13425,10 +13266,13 @@ class ZodNumber extends ZodType {
|
|
|
13425
13266
|
this.step = this.multipleOf;
|
|
13426
13267
|
}
|
|
13427
13268
|
_parse(input) {
|
|
13269
|
+
if (this._def.coerce) {
|
|
13270
|
+
input.data = Number(input.data);
|
|
13271
|
+
}
|
|
13428
13272
|
const parsedType = this._getType(input);
|
|
13429
13273
|
if (parsedType !== util_1.ZodParsedType.number) {
|
|
13430
13274
|
const ctx = this._getOrReturnCtx(input);
|
|
13431
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13275
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13432
13276
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13433
13277
|
expected: util_1.ZodParsedType.number,
|
|
13434
13278
|
received: ctx.parsedType,
|
|
@@ -13441,7 +13285,7 @@ class ZodNumber extends ZodType {
|
|
|
13441
13285
|
if (check.kind === "int") {
|
|
13442
13286
|
if (!util_1.util.isInteger(input.data)) {
|
|
13443
13287
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13444
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13288
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13445
13289
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13446
13290
|
expected: "integer",
|
|
13447
13291
|
received: "float",
|
|
@@ -13456,11 +13300,12 @@ class ZodNumber extends ZodType {
|
|
|
13456
13300
|
: input.data <= check.value;
|
|
13457
13301
|
if (tooSmall) {
|
|
13458
13302
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13459
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13303
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13460
13304
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13461
13305
|
minimum: check.value,
|
|
13462
13306
|
type: "number",
|
|
13463
13307
|
inclusive: check.inclusive,
|
|
13308
|
+
exact: false,
|
|
13464
13309
|
message: check.message,
|
|
13465
13310
|
});
|
|
13466
13311
|
status.dirty();
|
|
@@ -13472,11 +13317,12 @@ class ZodNumber extends ZodType {
|
|
|
13472
13317
|
: input.data >= check.value;
|
|
13473
13318
|
if (tooBig) {
|
|
13474
13319
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13475
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13320
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13476
13321
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13477
13322
|
maximum: check.value,
|
|
13478
13323
|
type: "number",
|
|
13479
13324
|
inclusive: check.inclusive,
|
|
13325
|
+
exact: false,
|
|
13480
13326
|
message: check.message,
|
|
13481
13327
|
});
|
|
13482
13328
|
status.dirty();
|
|
@@ -13485,7 +13331,7 @@ class ZodNumber extends ZodType {
|
|
|
13485
13331
|
else if (check.kind === "multipleOf") {
|
|
13486
13332
|
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
|
13487
13333
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13488
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13334
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13489
13335
|
code: ZodError_1.ZodIssueCode.not_multiple_of,
|
|
13490
13336
|
multipleOf: check.value,
|
|
13491
13337
|
message: check.message,
|
|
@@ -13493,6 +13339,16 @@ class ZodNumber extends ZodType {
|
|
|
13493
13339
|
status.dirty();
|
|
13494
13340
|
}
|
|
13495
13341
|
}
|
|
13342
|
+
else if (check.kind === "finite") {
|
|
13343
|
+
if (!Number.isFinite(input.data)) {
|
|
13344
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
13345
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13346
|
+
code: ZodError_1.ZodIssueCode.not_finite,
|
|
13347
|
+
message: check.message,
|
|
13348
|
+
});
|
|
13349
|
+
status.dirty();
|
|
13350
|
+
}
|
|
13351
|
+
}
|
|
13496
13352
|
else {
|
|
13497
13353
|
util_1.util.assertNever(check);
|
|
13498
13354
|
}
|
|
@@ -13576,6 +13432,12 @@ class ZodNumber extends ZodType {
|
|
|
13576
13432
|
message: errorUtil_1.errorUtil.toString(message),
|
|
13577
13433
|
});
|
|
13578
13434
|
}
|
|
13435
|
+
finite(message) {
|
|
13436
|
+
return this._addCheck({
|
|
13437
|
+
kind: "finite",
|
|
13438
|
+
message: errorUtil_1.errorUtil.toString(message),
|
|
13439
|
+
});
|
|
13440
|
+
}
|
|
13579
13441
|
get minValue() {
|
|
13580
13442
|
let min = null;
|
|
13581
13443
|
for (const ch of this._def.checks) {
|
|
@@ -13605,59 +13467,72 @@ ZodNumber.create = (params) => {
|
|
|
13605
13467
|
return new ZodNumber({
|
|
13606
13468
|
checks: [],
|
|
13607
13469
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
13470
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
13608
13471
|
...processCreateParams(params),
|
|
13609
13472
|
});
|
|
13610
13473
|
};
|
|
13611
13474
|
class ZodBigInt extends ZodType {
|
|
13612
13475
|
_parse(input) {
|
|
13476
|
+
if (this._def.coerce) {
|
|
13477
|
+
input.data = BigInt(input.data);
|
|
13478
|
+
}
|
|
13613
13479
|
const parsedType = this._getType(input);
|
|
13614
13480
|
if (parsedType !== util_1.ZodParsedType.bigint) {
|
|
13615
13481
|
const ctx = this._getOrReturnCtx(input);
|
|
13616
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13482
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13617
13483
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13618
13484
|
expected: util_1.ZodParsedType.bigint,
|
|
13619
13485
|
received: ctx.parsedType,
|
|
13620
13486
|
});
|
|
13621
13487
|
return parseUtil_1.INVALID;
|
|
13622
13488
|
}
|
|
13623
|
-
return parseUtil_1.OK(input.data);
|
|
13489
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13624
13490
|
}
|
|
13625
13491
|
}
|
|
13626
13492
|
exports.ZodBigInt = ZodBigInt;
|
|
13627
13493
|
ZodBigInt.create = (params) => {
|
|
13494
|
+
var _a;
|
|
13628
13495
|
return new ZodBigInt({
|
|
13629
13496
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
13497
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
13630
13498
|
...processCreateParams(params),
|
|
13631
13499
|
});
|
|
13632
13500
|
};
|
|
13633
13501
|
class ZodBoolean extends ZodType {
|
|
13634
13502
|
_parse(input) {
|
|
13503
|
+
if (this._def.coerce) {
|
|
13504
|
+
input.data = Boolean(input.data);
|
|
13505
|
+
}
|
|
13635
13506
|
const parsedType = this._getType(input);
|
|
13636
13507
|
if (parsedType !== util_1.ZodParsedType.boolean) {
|
|
13637
13508
|
const ctx = this._getOrReturnCtx(input);
|
|
13638
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13509
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13639
13510
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13640
13511
|
expected: util_1.ZodParsedType.boolean,
|
|
13641
13512
|
received: ctx.parsedType,
|
|
13642
13513
|
});
|
|
13643
13514
|
return parseUtil_1.INVALID;
|
|
13644
13515
|
}
|
|
13645
|
-
return parseUtil_1.OK(input.data);
|
|
13516
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13646
13517
|
}
|
|
13647
13518
|
}
|
|
13648
13519
|
exports.ZodBoolean = ZodBoolean;
|
|
13649
13520
|
ZodBoolean.create = (params) => {
|
|
13650
13521
|
return new ZodBoolean({
|
|
13651
13522
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
13523
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
13652
13524
|
...processCreateParams(params),
|
|
13653
13525
|
});
|
|
13654
13526
|
};
|
|
13655
13527
|
class ZodDate extends ZodType {
|
|
13656
13528
|
_parse(input) {
|
|
13529
|
+
if (this._def.coerce) {
|
|
13530
|
+
input.data = new Date(input.data);
|
|
13531
|
+
}
|
|
13657
13532
|
const parsedType = this._getType(input);
|
|
13658
13533
|
if (parsedType !== util_1.ZodParsedType.date) {
|
|
13659
13534
|
const ctx = this._getOrReturnCtx(input);
|
|
13660
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13535
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13661
13536
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13662
13537
|
expected: util_1.ZodParsedType.date,
|
|
13663
13538
|
received: ctx.parsedType,
|
|
@@ -13666,7 +13541,7 @@ class ZodDate extends ZodType {
|
|
|
13666
13541
|
}
|
|
13667
13542
|
if (isNaN(input.data.getTime())) {
|
|
13668
13543
|
const ctx = this._getOrReturnCtx(input);
|
|
13669
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13544
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13670
13545
|
code: ZodError_1.ZodIssueCode.invalid_date,
|
|
13671
13546
|
});
|
|
13672
13547
|
return parseUtil_1.INVALID;
|
|
@@ -13677,10 +13552,11 @@ class ZodDate extends ZodType {
|
|
|
13677
13552
|
if (check.kind === "min") {
|
|
13678
13553
|
if (input.data.getTime() < check.value) {
|
|
13679
13554
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13680
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13555
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13681
13556
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13682
13557
|
message: check.message,
|
|
13683
13558
|
inclusive: true,
|
|
13559
|
+
exact: false,
|
|
13684
13560
|
minimum: check.value,
|
|
13685
13561
|
type: "date",
|
|
13686
13562
|
});
|
|
@@ -13690,10 +13566,11 @@ class ZodDate extends ZodType {
|
|
|
13690
13566
|
else if (check.kind === "max") {
|
|
13691
13567
|
if (input.data.getTime() > check.value) {
|
|
13692
13568
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13693
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13569
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13694
13570
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13695
13571
|
message: check.message,
|
|
13696
13572
|
inclusive: true,
|
|
13573
|
+
exact: false,
|
|
13697
13574
|
maximum: check.value,
|
|
13698
13575
|
type: "date",
|
|
13699
13576
|
});
|
|
@@ -13754,23 +13631,46 @@ exports.ZodDate = ZodDate;
|
|
|
13754
13631
|
ZodDate.create = (params) => {
|
|
13755
13632
|
return new ZodDate({
|
|
13756
13633
|
checks: [],
|
|
13634
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
13757
13635
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
13758
13636
|
...processCreateParams(params),
|
|
13759
13637
|
});
|
|
13760
13638
|
};
|
|
13639
|
+
class ZodSymbol extends ZodType {
|
|
13640
|
+
_parse(input) {
|
|
13641
|
+
const parsedType = this._getType(input);
|
|
13642
|
+
if (parsedType !== util_1.ZodParsedType.symbol) {
|
|
13643
|
+
const ctx = this._getOrReturnCtx(input);
|
|
13644
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13645
|
+
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13646
|
+
expected: util_1.ZodParsedType.symbol,
|
|
13647
|
+
received: ctx.parsedType,
|
|
13648
|
+
});
|
|
13649
|
+
return parseUtil_1.INVALID;
|
|
13650
|
+
}
|
|
13651
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13652
|
+
}
|
|
13653
|
+
}
|
|
13654
|
+
exports.ZodSymbol = ZodSymbol;
|
|
13655
|
+
ZodSymbol.create = (params) => {
|
|
13656
|
+
return new ZodSymbol({
|
|
13657
|
+
typeName: ZodFirstPartyTypeKind.ZodSymbol,
|
|
13658
|
+
...processCreateParams(params),
|
|
13659
|
+
});
|
|
13660
|
+
};
|
|
13761
13661
|
class ZodUndefined extends ZodType {
|
|
13762
13662
|
_parse(input) {
|
|
13763
13663
|
const parsedType = this._getType(input);
|
|
13764
13664
|
if (parsedType !== util_1.ZodParsedType.undefined) {
|
|
13765
13665
|
const ctx = this._getOrReturnCtx(input);
|
|
13766
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13666
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13767
13667
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13768
13668
|
expected: util_1.ZodParsedType.undefined,
|
|
13769
13669
|
received: ctx.parsedType,
|
|
13770
13670
|
});
|
|
13771
13671
|
return parseUtil_1.INVALID;
|
|
13772
13672
|
}
|
|
13773
|
-
return parseUtil_1.OK(input.data);
|
|
13673
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13774
13674
|
}
|
|
13775
13675
|
}
|
|
13776
13676
|
exports.ZodUndefined = ZodUndefined;
|
|
@@ -13785,14 +13685,14 @@ class ZodNull extends ZodType {
|
|
|
13785
13685
|
const parsedType = this._getType(input);
|
|
13786
13686
|
if (parsedType !== util_1.ZodParsedType.null) {
|
|
13787
13687
|
const ctx = this._getOrReturnCtx(input);
|
|
13788
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13688
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13789
13689
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13790
13690
|
expected: util_1.ZodParsedType.null,
|
|
13791
13691
|
received: ctx.parsedType,
|
|
13792
13692
|
});
|
|
13793
13693
|
return parseUtil_1.INVALID;
|
|
13794
13694
|
}
|
|
13795
|
-
return parseUtil_1.OK(input.data);
|
|
13695
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13796
13696
|
}
|
|
13797
13697
|
}
|
|
13798
13698
|
exports.ZodNull = ZodNull;
|
|
@@ -13809,7 +13709,7 @@ class ZodAny extends ZodType {
|
|
|
13809
13709
|
this._any = true;
|
|
13810
13710
|
}
|
|
13811
13711
|
_parse(input) {
|
|
13812
|
-
return parseUtil_1.OK(input.data);
|
|
13712
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13813
13713
|
}
|
|
13814
13714
|
}
|
|
13815
13715
|
exports.ZodAny = ZodAny;
|
|
@@ -13826,7 +13726,7 @@ class ZodUnknown extends ZodType {
|
|
|
13826
13726
|
this._unknown = true;
|
|
13827
13727
|
}
|
|
13828
13728
|
_parse(input) {
|
|
13829
|
-
return parseUtil_1.OK(input.data);
|
|
13729
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13830
13730
|
}
|
|
13831
13731
|
}
|
|
13832
13732
|
exports.ZodUnknown = ZodUnknown;
|
|
@@ -13839,7 +13739,7 @@ ZodUnknown.create = (params) => {
|
|
|
13839
13739
|
class ZodNever extends ZodType {
|
|
13840
13740
|
_parse(input) {
|
|
13841
13741
|
const ctx = this._getOrReturnCtx(input);
|
|
13842
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13742
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13843
13743
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13844
13744
|
expected: util_1.ZodParsedType.never,
|
|
13845
13745
|
received: ctx.parsedType,
|
|
@@ -13859,14 +13759,14 @@ class ZodVoid extends ZodType {
|
|
|
13859
13759
|
const parsedType = this._getType(input);
|
|
13860
13760
|
if (parsedType !== util_1.ZodParsedType.undefined) {
|
|
13861
13761
|
const ctx = this._getOrReturnCtx(input);
|
|
13862
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13762
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13863
13763
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13864
13764
|
expected: util_1.ZodParsedType.void,
|
|
13865
13765
|
received: ctx.parsedType,
|
|
13866
13766
|
});
|
|
13867
13767
|
return parseUtil_1.INVALID;
|
|
13868
13768
|
}
|
|
13869
|
-
return parseUtil_1.OK(input.data);
|
|
13769
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13870
13770
|
}
|
|
13871
13771
|
}
|
|
13872
13772
|
exports.ZodVoid = ZodVoid;
|
|
@@ -13881,20 +13781,37 @@ class ZodArray extends ZodType {
|
|
|
13881
13781
|
const { ctx, status } = this._processInputParams(input);
|
|
13882
13782
|
const def = this._def;
|
|
13883
13783
|
if (ctx.parsedType !== util_1.ZodParsedType.array) {
|
|
13884
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13784
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13885
13785
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13886
13786
|
expected: util_1.ZodParsedType.array,
|
|
13887
13787
|
received: ctx.parsedType,
|
|
13888
13788
|
});
|
|
13889
13789
|
return parseUtil_1.INVALID;
|
|
13890
13790
|
}
|
|
13791
|
+
if (def.exactLength !== null) {
|
|
13792
|
+
const tooBig = ctx.data.length > def.exactLength.value;
|
|
13793
|
+
const tooSmall = ctx.data.length < def.exactLength.value;
|
|
13794
|
+
if (tooBig || tooSmall) {
|
|
13795
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13796
|
+
code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
|
|
13797
|
+
minimum: (tooSmall ? def.exactLength.value : undefined),
|
|
13798
|
+
maximum: (tooBig ? def.exactLength.value : undefined),
|
|
13799
|
+
type: "array",
|
|
13800
|
+
inclusive: true,
|
|
13801
|
+
exact: true,
|
|
13802
|
+
message: def.exactLength.message,
|
|
13803
|
+
});
|
|
13804
|
+
status.dirty();
|
|
13805
|
+
}
|
|
13806
|
+
}
|
|
13891
13807
|
if (def.minLength !== null) {
|
|
13892
13808
|
if (ctx.data.length < def.minLength.value) {
|
|
13893
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13809
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13894
13810
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13895
13811
|
minimum: def.minLength.value,
|
|
13896
13812
|
type: "array",
|
|
13897
13813
|
inclusive: true,
|
|
13814
|
+
exact: false,
|
|
13898
13815
|
message: def.minLength.message,
|
|
13899
13816
|
});
|
|
13900
13817
|
status.dirty();
|
|
@@ -13902,11 +13819,12 @@ class ZodArray extends ZodType {
|
|
|
13902
13819
|
}
|
|
13903
13820
|
if (def.maxLength !== null) {
|
|
13904
13821
|
if (ctx.data.length > def.maxLength.value) {
|
|
13905
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13822
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13906
13823
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13907
13824
|
maximum: def.maxLength.value,
|
|
13908
13825
|
type: "array",
|
|
13909
13826
|
inclusive: true,
|
|
13827
|
+
exact: false,
|
|
13910
13828
|
message: def.maxLength.message,
|
|
13911
13829
|
});
|
|
13912
13830
|
status.dirty();
|
|
@@ -13940,7 +13858,10 @@ class ZodArray extends ZodType {
|
|
|
13940
13858
|
});
|
|
13941
13859
|
}
|
|
13942
13860
|
length(len, message) {
|
|
13943
|
-
return
|
|
13861
|
+
return new ZodArray({
|
|
13862
|
+
...this._def,
|
|
13863
|
+
exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },
|
|
13864
|
+
});
|
|
13944
13865
|
}
|
|
13945
13866
|
nonempty(message) {
|
|
13946
13867
|
return this.min(1, message);
|
|
@@ -13952,6 +13873,7 @@ ZodArray.create = (schema, params) => {
|
|
|
13952
13873
|
type: schema,
|
|
13953
13874
|
minLength: null,
|
|
13954
13875
|
maxLength: null,
|
|
13876
|
+
exactLength: null,
|
|
13955
13877
|
typeName: ZodFirstPartyTypeKind.ZodArray,
|
|
13956
13878
|
...processCreateParams(params),
|
|
13957
13879
|
});
|
|
@@ -13968,7 +13890,7 @@ var objectUtil;
|
|
|
13968
13890
|
objectUtil.mergeShapes = (first, second) => {
|
|
13969
13891
|
return {
|
|
13970
13892
|
...first,
|
|
13971
|
-
...second,
|
|
13893
|
+
...second, // second overwrites first
|
|
13972
13894
|
};
|
|
13973
13895
|
};
|
|
13974
13896
|
})(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
|
|
@@ -14032,7 +13954,7 @@ class ZodObject extends ZodType {
|
|
|
14032
13954
|
const parsedType = this._getType(input);
|
|
14033
13955
|
if (parsedType !== util_1.ZodParsedType.object) {
|
|
14034
13956
|
const ctx = this._getOrReturnCtx(input);
|
|
14035
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13957
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14036
13958
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14037
13959
|
expected: util_1.ZodParsedType.object,
|
|
14038
13960
|
received: ctx.parsedType,
|
|
@@ -14042,9 +13964,12 @@ class ZodObject extends ZodType {
|
|
|
14042
13964
|
const { status, ctx } = this._processInputParams(input);
|
|
14043
13965
|
const { shape, keys: shapeKeys } = this._getCached();
|
|
14044
13966
|
const extraKeys = [];
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
13967
|
+
if (!(this._def.catchall instanceof ZodNever &&
|
|
13968
|
+
this._def.unknownKeys === "strip")) {
|
|
13969
|
+
for (const key in ctx.data) {
|
|
13970
|
+
if (!shapeKeys.includes(key)) {
|
|
13971
|
+
extraKeys.push(key);
|
|
13972
|
+
}
|
|
14048
13973
|
}
|
|
14049
13974
|
}
|
|
14050
13975
|
const pairs = [];
|
|
@@ -14069,7 +13994,7 @@ class ZodObject extends ZodType {
|
|
|
14069
13994
|
}
|
|
14070
13995
|
else if (unknownKeys === "strict") {
|
|
14071
13996
|
if (extraKeys.length > 0) {
|
|
14072
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13997
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14073
13998
|
code: ZodError_1.ZodIssueCode.unrecognized_keys,
|
|
14074
13999
|
keys: extraKeys,
|
|
14075
14000
|
});
|
|
@@ -14235,15 +14160,32 @@ class ZodObject extends ZodType {
|
|
|
14235
14160
|
shape: () => newShape,
|
|
14236
14161
|
});
|
|
14237
14162
|
}
|
|
14238
|
-
required() {
|
|
14163
|
+
required(mask) {
|
|
14239
14164
|
const newShape = {};
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14165
|
+
if (mask) {
|
|
14166
|
+
util_1.util.objectKeys(this.shape).map((key) => {
|
|
14167
|
+
if (util_1.util.objectKeys(mask).indexOf(key) === -1) {
|
|
14168
|
+
newShape[key] = this.shape[key];
|
|
14169
|
+
}
|
|
14170
|
+
else {
|
|
14171
|
+
const fieldSchema = this.shape[key];
|
|
14172
|
+
let newField = fieldSchema;
|
|
14173
|
+
while (newField instanceof ZodOptional) {
|
|
14174
|
+
newField = newField._def.innerType;
|
|
14175
|
+
}
|
|
14176
|
+
newShape[key] = newField;
|
|
14177
|
+
}
|
|
14178
|
+
});
|
|
14179
|
+
}
|
|
14180
|
+
else {
|
|
14181
|
+
for (const key in this.shape) {
|
|
14182
|
+
const fieldSchema = this.shape[key];
|
|
14183
|
+
let newField = fieldSchema;
|
|
14184
|
+
while (newField instanceof ZodOptional) {
|
|
14185
|
+
newField = newField._def.innerType;
|
|
14186
|
+
}
|
|
14187
|
+
newShape[key] = newField;
|
|
14245
14188
|
}
|
|
14246
|
-
newShape[key] = newField;
|
|
14247
14189
|
}
|
|
14248
14190
|
return new ZodObject({
|
|
14249
14191
|
...this._def,
|
|
@@ -14302,7 +14244,7 @@ class ZodUnion extends ZodType {
|
|
|
14302
14244
|
}
|
|
14303
14245
|
// return invalid
|
|
14304
14246
|
const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
|
|
14305
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14247
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14306
14248
|
code: ZodError_1.ZodIssueCode.invalid_union,
|
|
14307
14249
|
unionErrors,
|
|
14308
14250
|
});
|
|
@@ -14360,7 +14302,7 @@ class ZodUnion extends ZodType {
|
|
|
14360
14302
|
return dirty.result;
|
|
14361
14303
|
}
|
|
14362
14304
|
const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));
|
|
14363
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14305
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14364
14306
|
code: ZodError_1.ZodIssueCode.invalid_union,
|
|
14365
14307
|
unionErrors,
|
|
14366
14308
|
});
|
|
@@ -14379,11 +14321,48 @@ ZodUnion.create = (types, params) => {
|
|
|
14379
14321
|
...processCreateParams(params),
|
|
14380
14322
|
});
|
|
14381
14323
|
};
|
|
14324
|
+
/////////////////////////////////////////////////////
|
|
14325
|
+
/////////////////////////////////////////////////////
|
|
14326
|
+
////////// //////////
|
|
14327
|
+
////////// ZodDiscriminatedUnion //////////
|
|
14328
|
+
////////// //////////
|
|
14329
|
+
/////////////////////////////////////////////////////
|
|
14330
|
+
/////////////////////////////////////////////////////
|
|
14331
|
+
const getDiscriminator = (type) => {
|
|
14332
|
+
if (type instanceof ZodLazy) {
|
|
14333
|
+
return getDiscriminator(type.schema);
|
|
14334
|
+
}
|
|
14335
|
+
else if (type instanceof ZodEffects) {
|
|
14336
|
+
return getDiscriminator(type.innerType());
|
|
14337
|
+
}
|
|
14338
|
+
else if (type instanceof ZodLiteral) {
|
|
14339
|
+
return [type.value];
|
|
14340
|
+
}
|
|
14341
|
+
else if (type instanceof ZodEnum) {
|
|
14342
|
+
return type.options;
|
|
14343
|
+
}
|
|
14344
|
+
else if (type instanceof ZodNativeEnum) {
|
|
14345
|
+
// eslint-disable-next-line ban/ban
|
|
14346
|
+
return Object.keys(type.enum);
|
|
14347
|
+
}
|
|
14348
|
+
else if (type instanceof ZodDefault) {
|
|
14349
|
+
return getDiscriminator(type._def.innerType);
|
|
14350
|
+
}
|
|
14351
|
+
else if (type instanceof ZodUndefined) {
|
|
14352
|
+
return [undefined];
|
|
14353
|
+
}
|
|
14354
|
+
else if (type instanceof ZodNull) {
|
|
14355
|
+
return [null];
|
|
14356
|
+
}
|
|
14357
|
+
else {
|
|
14358
|
+
return null;
|
|
14359
|
+
}
|
|
14360
|
+
};
|
|
14382
14361
|
class ZodDiscriminatedUnion extends ZodType {
|
|
14383
14362
|
_parse(input) {
|
|
14384
14363
|
const { ctx } = this._processInputParams(input);
|
|
14385
14364
|
if (ctx.parsedType !== util_1.ZodParsedType.object) {
|
|
14386
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14365
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14387
14366
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14388
14367
|
expected: util_1.ZodParsedType.object,
|
|
14389
14368
|
received: ctx.parsedType,
|
|
@@ -14392,11 +14371,11 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
14392
14371
|
}
|
|
14393
14372
|
const discriminator = this.discriminator;
|
|
14394
14373
|
const discriminatorValue = ctx.data[discriminator];
|
|
14395
|
-
const option = this.
|
|
14374
|
+
const option = this.optionsMap.get(discriminatorValue);
|
|
14396
14375
|
if (!option) {
|
|
14397
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14376
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14398
14377
|
code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
|
|
14399
|
-
options: this.
|
|
14378
|
+
options: Array.from(this.optionsMap.keys()),
|
|
14400
14379
|
path: [discriminator],
|
|
14401
14380
|
});
|
|
14402
14381
|
return parseUtil_1.INVALID;
|
|
@@ -14419,12 +14398,12 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
14419
14398
|
get discriminator() {
|
|
14420
14399
|
return this._def.discriminator;
|
|
14421
14400
|
}
|
|
14422
|
-
get validDiscriminatorValues() {
|
|
14423
|
-
return Array.from(this.options.keys());
|
|
14424
|
-
}
|
|
14425
14401
|
get options() {
|
|
14426
14402
|
return this._def.options;
|
|
14427
14403
|
}
|
|
14404
|
+
get optionsMap() {
|
|
14405
|
+
return this._def.optionsMap;
|
|
14406
|
+
}
|
|
14428
14407
|
/**
|
|
14429
14408
|
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
14430
14409
|
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
@@ -14433,34 +14412,35 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
14433
14412
|
* @param types an array of object schemas
|
|
14434
14413
|
* @param params
|
|
14435
14414
|
*/
|
|
14436
|
-
static create(discriminator,
|
|
14415
|
+
static create(discriminator, options, params) {
|
|
14437
14416
|
// Get all the valid discriminator values
|
|
14438
|
-
const
|
|
14439
|
-
try {
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14417
|
+
const optionsMap = new Map();
|
|
14418
|
+
// try {
|
|
14419
|
+
for (const type of options) {
|
|
14420
|
+
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
14421
|
+
if (!discriminatorValues) {
|
|
14422
|
+
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
14423
|
+
}
|
|
14424
|
+
for (const value of discriminatorValues) {
|
|
14425
|
+
if (optionsMap.has(value)) {
|
|
14426
|
+
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
14427
|
+
}
|
|
14428
|
+
optionsMap.set(value, type);
|
|
14429
|
+
}
|
|
14451
14430
|
}
|
|
14452
14431
|
return new ZodDiscriminatedUnion({
|
|
14453
14432
|
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
14454
14433
|
discriminator,
|
|
14455
14434
|
options,
|
|
14435
|
+
optionsMap,
|
|
14456
14436
|
...processCreateParams(params),
|
|
14457
14437
|
});
|
|
14458
14438
|
}
|
|
14459
14439
|
}
|
|
14460
14440
|
exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
|
|
14461
14441
|
function mergeValues(a, b) {
|
|
14462
|
-
const aType = util_1.getParsedType(a);
|
|
14463
|
-
const bType = util_1.getParsedType(b);
|
|
14442
|
+
const aType = (0, util_1.getParsedType)(a);
|
|
14443
|
+
const bType = (0, util_1.getParsedType)(b);
|
|
14464
14444
|
if (a === b) {
|
|
14465
14445
|
return { valid: true, data: a };
|
|
14466
14446
|
}
|
|
@@ -14508,17 +14488,17 @@ class ZodIntersection extends ZodType {
|
|
|
14508
14488
|
_parse(input) {
|
|
14509
14489
|
const { status, ctx } = this._processInputParams(input);
|
|
14510
14490
|
const handleParsed = (parsedLeft, parsedRight) => {
|
|
14511
|
-
if (parseUtil_1.isAborted(parsedLeft) || parseUtil_1.isAborted(parsedRight)) {
|
|
14491
|
+
if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
|
|
14512
14492
|
return parseUtil_1.INVALID;
|
|
14513
14493
|
}
|
|
14514
14494
|
const merged = mergeValues(parsedLeft.value, parsedRight.value);
|
|
14515
14495
|
if (!merged.valid) {
|
|
14516
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14496
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14517
14497
|
code: ZodError_1.ZodIssueCode.invalid_intersection_types,
|
|
14518
14498
|
});
|
|
14519
14499
|
return parseUtil_1.INVALID;
|
|
14520
14500
|
}
|
|
14521
|
-
if (parseUtil_1.isDirty(parsedLeft) || parseUtil_1.isDirty(parsedRight)) {
|
|
14501
|
+
if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
|
|
14522
14502
|
status.dirty();
|
|
14523
14503
|
}
|
|
14524
14504
|
return { status: status.value, value: merged.data };
|
|
@@ -14563,7 +14543,7 @@ class ZodTuple extends ZodType {
|
|
|
14563
14543
|
_parse(input) {
|
|
14564
14544
|
const { status, ctx } = this._processInputParams(input);
|
|
14565
14545
|
if (ctx.parsedType !== util_1.ZodParsedType.array) {
|
|
14566
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14546
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14567
14547
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14568
14548
|
expected: util_1.ZodParsedType.array,
|
|
14569
14549
|
received: ctx.parsedType,
|
|
@@ -14571,20 +14551,22 @@ class ZodTuple extends ZodType {
|
|
|
14571
14551
|
return parseUtil_1.INVALID;
|
|
14572
14552
|
}
|
|
14573
14553
|
if (ctx.data.length < this._def.items.length) {
|
|
14574
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14554
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14575
14555
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
14576
14556
|
minimum: this._def.items.length,
|
|
14577
14557
|
inclusive: true,
|
|
14558
|
+
exact: false,
|
|
14578
14559
|
type: "array",
|
|
14579
14560
|
});
|
|
14580
14561
|
return parseUtil_1.INVALID;
|
|
14581
14562
|
}
|
|
14582
14563
|
const rest = this._def.rest;
|
|
14583
14564
|
if (!rest && ctx.data.length > this._def.items.length) {
|
|
14584
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14565
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14585
14566
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
14586
14567
|
maximum: this._def.items.length,
|
|
14587
14568
|
inclusive: true,
|
|
14569
|
+
exact: false,
|
|
14588
14570
|
type: "array",
|
|
14589
14571
|
});
|
|
14590
14572
|
status.dirty();
|
|
@@ -14618,6 +14600,9 @@ class ZodTuple extends ZodType {
|
|
|
14618
14600
|
}
|
|
14619
14601
|
exports.ZodTuple = ZodTuple;
|
|
14620
14602
|
ZodTuple.create = (schemas, params) => {
|
|
14603
|
+
if (!Array.isArray(schemas)) {
|
|
14604
|
+
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
14605
|
+
}
|
|
14621
14606
|
return new ZodTuple({
|
|
14622
14607
|
items: schemas,
|
|
14623
14608
|
typeName: ZodFirstPartyTypeKind.ZodTuple,
|
|
@@ -14635,7 +14620,7 @@ class ZodRecord extends ZodType {
|
|
|
14635
14620
|
_parse(input) {
|
|
14636
14621
|
const { status, ctx } = this._processInputParams(input);
|
|
14637
14622
|
if (ctx.parsedType !== util_1.ZodParsedType.object) {
|
|
14638
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14623
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14639
14624
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14640
14625
|
expected: util_1.ZodParsedType.object,
|
|
14641
14626
|
received: ctx.parsedType,
|
|
@@ -14683,7 +14668,7 @@ class ZodMap extends ZodType {
|
|
|
14683
14668
|
_parse(input) {
|
|
14684
14669
|
const { status, ctx } = this._processInputParams(input);
|
|
14685
14670
|
if (ctx.parsedType !== util_1.ZodParsedType.map) {
|
|
14686
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14671
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14687
14672
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14688
14673
|
expected: util_1.ZodParsedType.map,
|
|
14689
14674
|
received: ctx.parsedType,
|
|
@@ -14745,7 +14730,7 @@ class ZodSet extends ZodType {
|
|
|
14745
14730
|
_parse(input) {
|
|
14746
14731
|
const { status, ctx } = this._processInputParams(input);
|
|
14747
14732
|
if (ctx.parsedType !== util_1.ZodParsedType.set) {
|
|
14748
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14733
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14749
14734
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14750
14735
|
expected: util_1.ZodParsedType.set,
|
|
14751
14736
|
received: ctx.parsedType,
|
|
@@ -14755,11 +14740,12 @@ class ZodSet extends ZodType {
|
|
|
14755
14740
|
const def = this._def;
|
|
14756
14741
|
if (def.minSize !== null) {
|
|
14757
14742
|
if (ctx.data.size < def.minSize.value) {
|
|
14758
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14743
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14759
14744
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
14760
14745
|
minimum: def.minSize.value,
|
|
14761
14746
|
type: "set",
|
|
14762
14747
|
inclusive: true,
|
|
14748
|
+
exact: false,
|
|
14763
14749
|
message: def.minSize.message,
|
|
14764
14750
|
});
|
|
14765
14751
|
status.dirty();
|
|
@@ -14767,11 +14753,12 @@ class ZodSet extends ZodType {
|
|
|
14767
14753
|
}
|
|
14768
14754
|
if (def.maxSize !== null) {
|
|
14769
14755
|
if (ctx.data.size > def.maxSize.value) {
|
|
14770
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14756
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14771
14757
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
14772
14758
|
maximum: def.maxSize.value,
|
|
14773
14759
|
type: "set",
|
|
14774
14760
|
inclusive: true,
|
|
14761
|
+
exact: false,
|
|
14775
14762
|
message: def.maxSize.message,
|
|
14776
14763
|
});
|
|
14777
14764
|
status.dirty();
|
|
@@ -14834,7 +14821,7 @@ class ZodFunction extends ZodType {
|
|
|
14834
14821
|
_parse(input) {
|
|
14835
14822
|
const { ctx } = this._processInputParams(input);
|
|
14836
14823
|
if (ctx.parsedType !== util_1.ZodParsedType.function) {
|
|
14837
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14824
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14838
14825
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14839
14826
|
expected: util_1.ZodParsedType.function,
|
|
14840
14827
|
received: ctx.parsedType,
|
|
@@ -14842,14 +14829,14 @@ class ZodFunction extends ZodType {
|
|
|
14842
14829
|
return parseUtil_1.INVALID;
|
|
14843
14830
|
}
|
|
14844
14831
|
function makeArgsIssue(args, error) {
|
|
14845
|
-
return parseUtil_1.makeIssue({
|
|
14832
|
+
return (0, parseUtil_1.makeIssue)({
|
|
14846
14833
|
data: args,
|
|
14847
14834
|
path: ctx.path,
|
|
14848
14835
|
errorMaps: [
|
|
14849
14836
|
ctx.common.contextualErrorMap,
|
|
14850
14837
|
ctx.schemaErrorMap,
|
|
14851
|
-
|
|
14852
|
-
|
|
14838
|
+
(0, errors_1.getErrorMap)(),
|
|
14839
|
+
errors_1.defaultErrorMap,
|
|
14853
14840
|
].filter((x) => !!x),
|
|
14854
14841
|
issueData: {
|
|
14855
14842
|
code: ZodError_1.ZodIssueCode.invalid_arguments,
|
|
@@ -14858,14 +14845,14 @@ class ZodFunction extends ZodType {
|
|
|
14858
14845
|
});
|
|
14859
14846
|
}
|
|
14860
14847
|
function makeReturnsIssue(returns, error) {
|
|
14861
|
-
return parseUtil_1.makeIssue({
|
|
14848
|
+
return (0, parseUtil_1.makeIssue)({
|
|
14862
14849
|
data: returns,
|
|
14863
14850
|
path: ctx.path,
|
|
14864
14851
|
errorMaps: [
|
|
14865
14852
|
ctx.common.contextualErrorMap,
|
|
14866
14853
|
ctx.schemaErrorMap,
|
|
14867
|
-
|
|
14868
|
-
|
|
14854
|
+
(0, errors_1.getErrorMap)(),
|
|
14855
|
+
errors_1.defaultErrorMap,
|
|
14869
14856
|
].filter((x) => !!x),
|
|
14870
14857
|
issueData: {
|
|
14871
14858
|
code: ZodError_1.ZodIssueCode.invalid_return_type,
|
|
@@ -14876,7 +14863,7 @@ class ZodFunction extends ZodType {
|
|
|
14876
14863
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
14877
14864
|
const fn = ctx.data;
|
|
14878
14865
|
if (this._def.returns instanceof ZodPromise) {
|
|
14879
|
-
return parseUtil_1.OK(async (...args) => {
|
|
14866
|
+
return (0, parseUtil_1.OK)(async (...args) => {
|
|
14880
14867
|
const error = new ZodError_1.ZodError([]);
|
|
14881
14868
|
const parsedArgs = await this._def.args
|
|
14882
14869
|
.parseAsync(args, params)
|
|
@@ -14895,7 +14882,7 @@ class ZodFunction extends ZodType {
|
|
|
14895
14882
|
});
|
|
14896
14883
|
}
|
|
14897
14884
|
else {
|
|
14898
|
-
return parseUtil_1.OK((...args) => {
|
|
14885
|
+
return (0, parseUtil_1.OK)((...args) => {
|
|
14899
14886
|
const parsedArgs = this._def.args.safeParse(args, params);
|
|
14900
14887
|
if (!parsedArgs.success) {
|
|
14901
14888
|
throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
@@ -14935,18 +14922,18 @@ class ZodFunction extends ZodType {
|
|
|
14935
14922
|
const validatedFunc = this.parse(func);
|
|
14936
14923
|
return validatedFunc;
|
|
14937
14924
|
}
|
|
14925
|
+
static create(args, returns, params) {
|
|
14926
|
+
return new ZodFunction({
|
|
14927
|
+
args: (args
|
|
14928
|
+
? args
|
|
14929
|
+
: ZodTuple.create([]).rest(ZodUnknown.create())),
|
|
14930
|
+
returns: returns || ZodUnknown.create(),
|
|
14931
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
14932
|
+
...processCreateParams(params),
|
|
14933
|
+
});
|
|
14934
|
+
}
|
|
14938
14935
|
}
|
|
14939
14936
|
exports.ZodFunction = ZodFunction;
|
|
14940
|
-
ZodFunction.create = (args, returns, params) => {
|
|
14941
|
-
return new ZodFunction({
|
|
14942
|
-
args: (args
|
|
14943
|
-
? args.rest(ZodUnknown.create())
|
|
14944
|
-
: ZodTuple.create([]).rest(ZodUnknown.create())),
|
|
14945
|
-
returns: returns || ZodUnknown.create(),
|
|
14946
|
-
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
14947
|
-
...processCreateParams(params),
|
|
14948
|
-
});
|
|
14949
|
-
};
|
|
14950
14937
|
class ZodLazy extends ZodType {
|
|
14951
14938
|
get schema() {
|
|
14952
14939
|
return this._def.getter();
|
|
@@ -14969,7 +14956,7 @@ class ZodLiteral extends ZodType {
|
|
|
14969
14956
|
_parse(input) {
|
|
14970
14957
|
if (input.data !== this._def.value) {
|
|
14971
14958
|
const ctx = this._getOrReturnCtx(input);
|
|
14972
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14959
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14973
14960
|
code: ZodError_1.ZodIssueCode.invalid_literal,
|
|
14974
14961
|
expected: this._def.value,
|
|
14975
14962
|
});
|
|
@@ -15001,7 +14988,7 @@ class ZodEnum extends ZodType {
|
|
|
15001
14988
|
if (typeof input.data !== "string") {
|
|
15002
14989
|
const ctx = this._getOrReturnCtx(input);
|
|
15003
14990
|
const expectedValues = this._def.values;
|
|
15004
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14991
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
15005
14992
|
expected: util_1.util.joinValues(expectedValues),
|
|
15006
14993
|
received: ctx.parsedType,
|
|
15007
14994
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
@@ -15011,14 +14998,14 @@ class ZodEnum extends ZodType {
|
|
|
15011
14998
|
if (this._def.values.indexOf(input.data) === -1) {
|
|
15012
14999
|
const ctx = this._getOrReturnCtx(input);
|
|
15013
15000
|
const expectedValues = this._def.values;
|
|
15014
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
15001
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
15015
15002
|
received: ctx.data,
|
|
15016
15003
|
code: ZodError_1.ZodIssueCode.invalid_enum_value,
|
|
15017
15004
|
options: expectedValues,
|
|
15018
15005
|
});
|
|
15019
15006
|
return parseUtil_1.INVALID;
|
|
15020
15007
|
}
|
|
15021
|
-
return parseUtil_1.OK(input.data);
|
|
15008
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
15022
15009
|
}
|
|
15023
15010
|
get options() {
|
|
15024
15011
|
return this._def.values;
|
|
@@ -15054,7 +15041,7 @@ class ZodNativeEnum extends ZodType {
|
|
|
15054
15041
|
if (ctx.parsedType !== util_1.ZodParsedType.string &&
|
|
15055
15042
|
ctx.parsedType !== util_1.ZodParsedType.number) {
|
|
15056
15043
|
const expectedValues = util_1.util.objectValues(nativeEnumValues);
|
|
15057
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
15044
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
15058
15045
|
expected: util_1.util.joinValues(expectedValues),
|
|
15059
15046
|
received: ctx.parsedType,
|
|
15060
15047
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
@@ -15063,14 +15050,14 @@ class ZodNativeEnum extends ZodType {
|
|
|
15063
15050
|
}
|
|
15064
15051
|
if (nativeEnumValues.indexOf(input.data) === -1) {
|
|
15065
15052
|
const expectedValues = util_1.util.objectValues(nativeEnumValues);
|
|
15066
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
15053
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
15067
15054
|
received: ctx.data,
|
|
15068
15055
|
code: ZodError_1.ZodIssueCode.invalid_enum_value,
|
|
15069
15056
|
options: expectedValues,
|
|
15070
15057
|
});
|
|
15071
15058
|
return parseUtil_1.INVALID;
|
|
15072
15059
|
}
|
|
15073
|
-
return parseUtil_1.OK(input.data);
|
|
15060
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
15074
15061
|
}
|
|
15075
15062
|
get enum() {
|
|
15076
15063
|
return this._def.values;
|
|
@@ -15089,7 +15076,7 @@ class ZodPromise extends ZodType {
|
|
|
15089
15076
|
const { ctx } = this._processInputParams(input);
|
|
15090
15077
|
if (ctx.parsedType !== util_1.ZodParsedType.promise &&
|
|
15091
15078
|
ctx.common.async === false) {
|
|
15092
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
15079
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
15093
15080
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
15094
15081
|
expected: util_1.ZodParsedType.promise,
|
|
15095
15082
|
received: ctx.parsedType,
|
|
@@ -15099,7 +15086,7 @@ class ZodPromise extends ZodType {
|
|
|
15099
15086
|
const promisified = ctx.parsedType === util_1.ZodParsedType.promise
|
|
15100
15087
|
? ctx.data
|
|
15101
15088
|
: Promise.resolve(ctx.data);
|
|
15102
|
-
return parseUtil_1.OK(promisified.then((data) => {
|
|
15089
|
+
return (0, parseUtil_1.OK)(promisified.then((data) => {
|
|
15103
15090
|
return this._def.type.parseAsync(data, {
|
|
15104
15091
|
path: ctx.path,
|
|
15105
15092
|
errorMap: ctx.common.contextualErrorMap,
|
|
@@ -15119,6 +15106,11 @@ class ZodEffects extends ZodType {
|
|
|
15119
15106
|
innerType() {
|
|
15120
15107
|
return this._def.schema;
|
|
15121
15108
|
}
|
|
15109
|
+
sourceType() {
|
|
15110
|
+
return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
|
|
15111
|
+
? this._def.schema.sourceType()
|
|
15112
|
+
: this._def.schema;
|
|
15113
|
+
}
|
|
15122
15114
|
_parse(input) {
|
|
15123
15115
|
const { status, ctx } = this._processInputParams(input);
|
|
15124
15116
|
const effect = this._def.effect || null;
|
|
@@ -15143,7 +15135,7 @@ class ZodEffects extends ZodType {
|
|
|
15143
15135
|
}
|
|
15144
15136
|
const checkCtx = {
|
|
15145
15137
|
addIssue: (arg) => {
|
|
15146
|
-
parseUtil_1.addIssueToContext(ctx, arg);
|
|
15138
|
+
(0, parseUtil_1.addIssueToContext)(ctx, arg);
|
|
15147
15139
|
if (arg.fatal) {
|
|
15148
15140
|
status.abort();
|
|
15149
15141
|
}
|
|
@@ -15208,7 +15200,7 @@ class ZodEffects extends ZodType {
|
|
|
15208
15200
|
// if (base.status === "dirty") {
|
|
15209
15201
|
// return { status: "dirty", value: base.value };
|
|
15210
15202
|
// }
|
|
15211
|
-
if (!parseUtil_1.isValid(base))
|
|
15203
|
+
if (!(0, parseUtil_1.isValid)(base))
|
|
15212
15204
|
return base;
|
|
15213
15205
|
const result = effect.transform(base.value, checkCtx);
|
|
15214
15206
|
if (result instanceof Promise) {
|
|
@@ -15220,7 +15212,7 @@ class ZodEffects extends ZodType {
|
|
|
15220
15212
|
return this._def.schema
|
|
15221
15213
|
._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
|
|
15222
15214
|
.then((base) => {
|
|
15223
|
-
if (!parseUtil_1.isValid(base))
|
|
15215
|
+
if (!(0, parseUtil_1.isValid)(base))
|
|
15224
15216
|
return base;
|
|
15225
15217
|
// if (base.status === "aborted") return INVALID;
|
|
15226
15218
|
// if (base.status === "dirty") {
|
|
@@ -15255,7 +15247,7 @@ class ZodOptional extends ZodType {
|
|
|
15255
15247
|
_parse(input) {
|
|
15256
15248
|
const parsedType = this._getType(input);
|
|
15257
15249
|
if (parsedType === util_1.ZodParsedType.undefined) {
|
|
15258
|
-
return parseUtil_1.OK(undefined);
|
|
15250
|
+
return (0, parseUtil_1.OK)(undefined);
|
|
15259
15251
|
}
|
|
15260
15252
|
return this._def.innerType._parse(input);
|
|
15261
15253
|
}
|
|
@@ -15275,7 +15267,7 @@ class ZodNullable extends ZodType {
|
|
|
15275
15267
|
_parse(input) {
|
|
15276
15268
|
const parsedType = this._getType(input);
|
|
15277
15269
|
if (parsedType === util_1.ZodParsedType.null) {
|
|
15278
|
-
return parseUtil_1.OK(null);
|
|
15270
|
+
return (0, parseUtil_1.OK)(null);
|
|
15279
15271
|
}
|
|
15280
15272
|
return this._def.innerType._parse(input);
|
|
15281
15273
|
}
|
|
@@ -15310,9 +15302,50 @@ class ZodDefault extends ZodType {
|
|
|
15310
15302
|
}
|
|
15311
15303
|
exports.ZodDefault = ZodDefault;
|
|
15312
15304
|
ZodDefault.create = (type, params) => {
|
|
15313
|
-
return new
|
|
15305
|
+
return new ZodDefault({
|
|
15314
15306
|
innerType: type,
|
|
15315
|
-
typeName: ZodFirstPartyTypeKind.
|
|
15307
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault,
|
|
15308
|
+
defaultValue: typeof params.default === "function"
|
|
15309
|
+
? params.default
|
|
15310
|
+
: () => params.default,
|
|
15311
|
+
...processCreateParams(params),
|
|
15312
|
+
});
|
|
15313
|
+
};
|
|
15314
|
+
class ZodCatch extends ZodType {
|
|
15315
|
+
_parse(input) {
|
|
15316
|
+
const { ctx } = this._processInputParams(input);
|
|
15317
|
+
const result = this._def.innerType._parse({
|
|
15318
|
+
data: ctx.data,
|
|
15319
|
+
path: ctx.path,
|
|
15320
|
+
parent: ctx,
|
|
15321
|
+
});
|
|
15322
|
+
if ((0, parseUtil_1.isAsync)(result)) {
|
|
15323
|
+
return result.then((result) => {
|
|
15324
|
+
return {
|
|
15325
|
+
status: "valid",
|
|
15326
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue(),
|
|
15327
|
+
};
|
|
15328
|
+
});
|
|
15329
|
+
}
|
|
15330
|
+
else {
|
|
15331
|
+
return {
|
|
15332
|
+
status: "valid",
|
|
15333
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue(),
|
|
15334
|
+
};
|
|
15335
|
+
}
|
|
15336
|
+
}
|
|
15337
|
+
removeDefault() {
|
|
15338
|
+
return this._def.innerType;
|
|
15339
|
+
}
|
|
15340
|
+
}
|
|
15341
|
+
exports.ZodCatch = ZodCatch;
|
|
15342
|
+
ZodCatch.create = (type, params) => {
|
|
15343
|
+
return new ZodCatch({
|
|
15344
|
+
innerType: type,
|
|
15345
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
15346
|
+
defaultValue: typeof params.default === "function"
|
|
15347
|
+
? params.default
|
|
15348
|
+
: () => params.default,
|
|
15316
15349
|
...processCreateParams(params),
|
|
15317
15350
|
});
|
|
15318
15351
|
};
|
|
@@ -15321,7 +15354,7 @@ class ZodNaN extends ZodType {
|
|
|
15321
15354
|
const parsedType = this._getType(input);
|
|
15322
15355
|
if (parsedType !== util_1.ZodParsedType.nan) {
|
|
15323
15356
|
const ctx = this._getOrReturnCtx(input);
|
|
15324
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
15357
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
15325
15358
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
15326
15359
|
expected: util_1.ZodParsedType.nan,
|
|
15327
15360
|
received: ctx.parsedType,
|
|
@@ -15354,6 +15387,65 @@ class ZodBranded extends ZodType {
|
|
|
15354
15387
|
}
|
|
15355
15388
|
}
|
|
15356
15389
|
exports.ZodBranded = ZodBranded;
|
|
15390
|
+
class ZodPipeline extends ZodType {
|
|
15391
|
+
_parse(input) {
|
|
15392
|
+
const { status, ctx } = this._processInputParams(input);
|
|
15393
|
+
if (ctx.common.async) {
|
|
15394
|
+
const handleAsync = async () => {
|
|
15395
|
+
const inResult = await this._def.in._parseAsync({
|
|
15396
|
+
data: ctx.data,
|
|
15397
|
+
path: ctx.path,
|
|
15398
|
+
parent: ctx,
|
|
15399
|
+
});
|
|
15400
|
+
if (inResult.status === "aborted")
|
|
15401
|
+
return parseUtil_1.INVALID;
|
|
15402
|
+
if (inResult.status === "dirty") {
|
|
15403
|
+
status.dirty();
|
|
15404
|
+
return (0, parseUtil_1.DIRTY)(inResult.value);
|
|
15405
|
+
}
|
|
15406
|
+
else {
|
|
15407
|
+
return this._def.out._parseAsync({
|
|
15408
|
+
data: inResult.value,
|
|
15409
|
+
path: ctx.path,
|
|
15410
|
+
parent: ctx,
|
|
15411
|
+
});
|
|
15412
|
+
}
|
|
15413
|
+
};
|
|
15414
|
+
return handleAsync();
|
|
15415
|
+
}
|
|
15416
|
+
else {
|
|
15417
|
+
const inResult = this._def.in._parseSync({
|
|
15418
|
+
data: ctx.data,
|
|
15419
|
+
path: ctx.path,
|
|
15420
|
+
parent: ctx,
|
|
15421
|
+
});
|
|
15422
|
+
if (inResult.status === "aborted")
|
|
15423
|
+
return parseUtil_1.INVALID;
|
|
15424
|
+
if (inResult.status === "dirty") {
|
|
15425
|
+
status.dirty();
|
|
15426
|
+
return {
|
|
15427
|
+
status: "dirty",
|
|
15428
|
+
value: inResult.value,
|
|
15429
|
+
};
|
|
15430
|
+
}
|
|
15431
|
+
else {
|
|
15432
|
+
return this._def.out._parseSync({
|
|
15433
|
+
data: inResult.value,
|
|
15434
|
+
path: ctx.path,
|
|
15435
|
+
parent: ctx,
|
|
15436
|
+
});
|
|
15437
|
+
}
|
|
15438
|
+
}
|
|
15439
|
+
}
|
|
15440
|
+
static create(a, b) {
|
|
15441
|
+
return new ZodPipeline({
|
|
15442
|
+
in: a,
|
|
15443
|
+
out: b,
|
|
15444
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline,
|
|
15445
|
+
});
|
|
15446
|
+
}
|
|
15447
|
+
}
|
|
15448
|
+
exports.ZodPipeline = ZodPipeline;
|
|
15357
15449
|
const custom = (check, params = {}, fatal) => {
|
|
15358
15450
|
if (check)
|
|
15359
15451
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
@@ -15377,6 +15469,7 @@ var ZodFirstPartyTypeKind;
|
|
|
15377
15469
|
ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
|
|
15378
15470
|
ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
|
|
15379
15471
|
ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
|
|
15472
|
+
ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
|
|
15380
15473
|
ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
|
|
15381
15474
|
ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
|
|
15382
15475
|
ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
|
|
@@ -15401,12 +15494,21 @@ var ZodFirstPartyTypeKind;
|
|
|
15401
15494
|
ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
|
|
15402
15495
|
ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
|
|
15403
15496
|
ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
|
|
15497
|
+
ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
|
|
15404
15498
|
ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
|
|
15405
15499
|
ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
|
|
15500
|
+
ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
|
|
15406
15501
|
})(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {}));
|
|
15407
|
-
|
|
15502
|
+
// new approach that works for abstract classes
|
|
15503
|
+
// but requires TS 4.4+
|
|
15504
|
+
class Class {
|
|
15505
|
+
constructor(..._) { }
|
|
15506
|
+
}
|
|
15507
|
+
const instanceOfType = (
|
|
15508
|
+
// const instanceOfType = <T extends new (...args: any[]) => any>(
|
|
15509
|
+
cls, params = {
|
|
15408
15510
|
message: `Input not instance of ${cls.name}`,
|
|
15409
|
-
}) => exports.custom((data) => data instanceof cls, params, true);
|
|
15511
|
+
}) => (0, exports.custom)((data) => data instanceof cls, params, true);
|
|
15410
15512
|
exports["instanceof"] = instanceOfType;
|
|
15411
15513
|
const stringType = ZodString.create;
|
|
15412
15514
|
exports.string = stringType;
|
|
@@ -15420,6 +15522,8 @@ const booleanType = ZodBoolean.create;
|
|
|
15420
15522
|
exports.boolean = booleanType;
|
|
15421
15523
|
const dateType = ZodDate.create;
|
|
15422
15524
|
exports.date = dateType;
|
|
15525
|
+
const symbolType = ZodSymbol.create;
|
|
15526
|
+
exports.symbol = symbolType;
|
|
15423
15527
|
const undefinedType = ZodUndefined.create;
|
|
15424
15528
|
exports.undefined = undefinedType;
|
|
15425
15529
|
const nullType = ZodNull.create;
|
|
@@ -15473,24 +15577,34 @@ const nullableType = ZodNullable.create;
|
|
|
15473
15577
|
exports.nullable = nullableType;
|
|
15474
15578
|
const preprocessType = ZodEffects.createWithPreprocess;
|
|
15475
15579
|
exports.preprocess = preprocessType;
|
|
15580
|
+
const pipelineType = ZodPipeline.create;
|
|
15581
|
+
exports.pipeline = pipelineType;
|
|
15476
15582
|
const ostring = () => stringType().optional();
|
|
15477
15583
|
exports.ostring = ostring;
|
|
15478
15584
|
const onumber = () => numberType().optional();
|
|
15479
15585
|
exports.onumber = onumber;
|
|
15480
15586
|
const oboolean = () => booleanType().optional();
|
|
15481
15587
|
exports.oboolean = oboolean;
|
|
15588
|
+
exports.coerce = {
|
|
15589
|
+
string: ((arg) => ZodString.create({ ...arg, coerce: true })),
|
|
15590
|
+
number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
|
|
15591
|
+
boolean: ((arg) => ZodBoolean.create({ ...arg, coerce: true })),
|
|
15592
|
+
bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
|
|
15593
|
+
date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
|
|
15594
|
+
};
|
|
15595
|
+
exports.NEVER = parseUtil_1.INVALID;
|
|
15482
15596
|
|
|
15483
15597
|
|
|
15484
15598
|
/***/ }),
|
|
15485
15599
|
|
|
15486
|
-
/***/
|
|
15600
|
+
/***/ 2124:
|
|
15487
15601
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15488
15602
|
|
|
15489
15603
|
"use strict";
|
|
15490
15604
|
|
|
15491
15605
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15492
15606
|
exports.defaultTimeout = exports.defaultMetadata = exports.userInfoEndpoint = exports.accessTokenEndpoint = exports.scope = exports.authorizationEndpoint = void 0;
|
|
15493
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
15607
|
+
const connector_kit_1 = __nccwpck_require__(4758);
|
|
15494
15608
|
exports.authorizationEndpoint = 'https://github.com/login/oauth/authorize';
|
|
15495
15609
|
exports.scope = 'read:user';
|
|
15496
15610
|
exports.accessTokenEndpoint = 'https://github.com/login/oauth/access_token';
|
|
@@ -15521,7 +15635,7 @@ exports.defaultTimeout = 5000;
|
|
|
15521
15635
|
|
|
15522
15636
|
/***/ }),
|
|
15523
15637
|
|
|
15524
|
-
/***/
|
|
15638
|
+
/***/ 616:
|
|
15525
15639
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
15526
15640
|
|
|
15527
15641
|
"use strict";
|
|
@@ -15551,12 +15665,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
15551
15665
|
};
|
|
15552
15666
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15553
15667
|
exports.getAccessToken = void 0;
|
|
15554
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
15555
|
-
const essentials_1 = __nccwpck_require__(
|
|
15556
|
-
const got_1 = __importStar(__nccwpck_require__(
|
|
15557
|
-
const qs = __importStar(__nccwpck_require__(
|
|
15558
|
-
const constant_1 = __nccwpck_require__(
|
|
15559
|
-
const types_1 = __nccwpck_require__(
|
|
15668
|
+
const connector_kit_1 = __nccwpck_require__(4758);
|
|
15669
|
+
const essentials_1 = __nccwpck_require__(5254);
|
|
15670
|
+
const got_1 = __importStar(__nccwpck_require__(9235));
|
|
15671
|
+
const qs = __importStar(__nccwpck_require__(2024));
|
|
15672
|
+
const constant_1 = __nccwpck_require__(2124);
|
|
15673
|
+
const types_1 = __nccwpck_require__(2174);
|
|
15560
15674
|
const getAuthorizationUri = (getConfig) => async ({ state, redirectUri }) => {
|
|
15561
15675
|
const config = await getConfig(constant_1.defaultMetadata.id);
|
|
15562
15676
|
(0, connector_kit_1.validateConfig)(config, types_1.githubConfigGuard);
|
|
@@ -15657,14 +15771,14 @@ exports["default"] = createGithubConnector;
|
|
|
15657
15771
|
|
|
15658
15772
|
/***/ }),
|
|
15659
15773
|
|
|
15660
|
-
/***/
|
|
15774
|
+
/***/ 2174:
|
|
15661
15775
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15662
15776
|
|
|
15663
15777
|
"use strict";
|
|
15664
15778
|
|
|
15665
15779
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15666
15780
|
exports.authResponseGuard = exports.authorizationCallbackErrorGuard = exports.userInfoResponseGuard = exports.accessTokenResponseGuard = exports.githubConfigGuard = void 0;
|
|
15667
|
-
const zod_1 = __nccwpck_require__(
|
|
15781
|
+
const zod_1 = __nccwpck_require__(6319);
|
|
15668
15782
|
exports.githubConfigGuard = zod_1.z.object({
|
|
15669
15783
|
clientId: zod_1.z.string(),
|
|
15670
15784
|
clientSecret: zod_1.z.string(),
|
|
@@ -15698,107 +15812,438 @@ module.exports = require("buffer");
|
|
|
15698
15812
|
|
|
15699
15813
|
/***/ }),
|
|
15700
15814
|
|
|
15701
|
-
/***/ 9523:
|
|
15702
|
-
/***/ ((module) => {
|
|
15815
|
+
/***/ 9523:
|
|
15816
|
+
/***/ ((module) => {
|
|
15817
|
+
|
|
15818
|
+
"use strict";
|
|
15819
|
+
module.exports = require("dns");
|
|
15820
|
+
|
|
15821
|
+
/***/ }),
|
|
15822
|
+
|
|
15823
|
+
/***/ 2361:
|
|
15824
|
+
/***/ ((module) => {
|
|
15825
|
+
|
|
15826
|
+
"use strict";
|
|
15827
|
+
module.exports = require("events");
|
|
15828
|
+
|
|
15829
|
+
/***/ }),
|
|
15830
|
+
|
|
15831
|
+
/***/ 7147:
|
|
15832
|
+
/***/ ((module) => {
|
|
15833
|
+
|
|
15834
|
+
"use strict";
|
|
15835
|
+
module.exports = require("fs");
|
|
15836
|
+
|
|
15837
|
+
/***/ }),
|
|
15838
|
+
|
|
15839
|
+
/***/ 3685:
|
|
15840
|
+
/***/ ((module) => {
|
|
15841
|
+
|
|
15842
|
+
"use strict";
|
|
15843
|
+
module.exports = require("http");
|
|
15844
|
+
|
|
15845
|
+
/***/ }),
|
|
15846
|
+
|
|
15847
|
+
/***/ 5158:
|
|
15848
|
+
/***/ ((module) => {
|
|
15849
|
+
|
|
15850
|
+
"use strict";
|
|
15851
|
+
module.exports = require("http2");
|
|
15852
|
+
|
|
15853
|
+
/***/ }),
|
|
15854
|
+
|
|
15855
|
+
/***/ 5687:
|
|
15856
|
+
/***/ ((module) => {
|
|
15857
|
+
|
|
15858
|
+
"use strict";
|
|
15859
|
+
module.exports = require("https");
|
|
15860
|
+
|
|
15861
|
+
/***/ }),
|
|
15862
|
+
|
|
15863
|
+
/***/ 1808:
|
|
15864
|
+
/***/ ((module) => {
|
|
15865
|
+
|
|
15866
|
+
"use strict";
|
|
15867
|
+
module.exports = require("net");
|
|
15868
|
+
|
|
15869
|
+
/***/ }),
|
|
15870
|
+
|
|
15871
|
+
/***/ 2037:
|
|
15872
|
+
/***/ ((module) => {
|
|
15873
|
+
|
|
15874
|
+
"use strict";
|
|
15875
|
+
module.exports = require("os");
|
|
15876
|
+
|
|
15877
|
+
/***/ }),
|
|
15878
|
+
|
|
15879
|
+
/***/ 2781:
|
|
15880
|
+
/***/ ((module) => {
|
|
15881
|
+
|
|
15882
|
+
"use strict";
|
|
15883
|
+
module.exports = require("stream");
|
|
15884
|
+
|
|
15885
|
+
/***/ }),
|
|
15886
|
+
|
|
15887
|
+
/***/ 6821:
|
|
15888
|
+
/***/ ((module) => {
|
|
15889
|
+
|
|
15890
|
+
"use strict";
|
|
15891
|
+
module.exports = require("tls");
|
|
15892
|
+
|
|
15893
|
+
/***/ }),
|
|
15894
|
+
|
|
15895
|
+
/***/ 7310:
|
|
15896
|
+
/***/ ((module) => {
|
|
15897
|
+
|
|
15898
|
+
"use strict";
|
|
15899
|
+
module.exports = require("url");
|
|
15900
|
+
|
|
15901
|
+
/***/ }),
|
|
15902
|
+
|
|
15903
|
+
/***/ 3837:
|
|
15904
|
+
/***/ ((module) => {
|
|
15905
|
+
|
|
15906
|
+
"use strict";
|
|
15907
|
+
module.exports = require("util");
|
|
15908
|
+
|
|
15909
|
+
/***/ }),
|
|
15910
|
+
|
|
15911
|
+
/***/ 9796:
|
|
15912
|
+
/***/ ((module) => {
|
|
15913
|
+
|
|
15914
|
+
"use strict";
|
|
15915
|
+
module.exports = require("zlib");
|
|
15916
|
+
|
|
15917
|
+
/***/ }),
|
|
15918
|
+
|
|
15919
|
+
/***/ 4758:
|
|
15920
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15921
|
+
|
|
15922
|
+
"use strict";
|
|
15923
|
+
|
|
15924
|
+
|
|
15925
|
+
var types = __nccwpck_require__(1876);
|
|
15926
|
+
|
|
15927
|
+
function validateConfig(config, guard) {
|
|
15928
|
+
const result = guard.safeParse(config);
|
|
15929
|
+
if (!result.success) {
|
|
15930
|
+
throw new types.ConnectorError(types.ConnectorErrorCodes.InvalidConfig, result.error);
|
|
15931
|
+
}
|
|
15932
|
+
}
|
|
15933
|
+
const parseJson = (jsonString, errorCode = types.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
|
|
15934
|
+
try {
|
|
15935
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
15936
|
+
return JSON.parse(jsonString);
|
|
15937
|
+
}
|
|
15938
|
+
catch {
|
|
15939
|
+
throw new types.ConnectorError(errorCode, errorPayload ?? jsonString);
|
|
15940
|
+
}
|
|
15941
|
+
};
|
|
15942
|
+
|
|
15943
|
+
exports.ConnectorError = types.ConnectorError;
|
|
15944
|
+
Object.defineProperty(exports, "ConnectorErrorCodes", ({
|
|
15945
|
+
enumerable: true,
|
|
15946
|
+
get: function () { return types.ConnectorErrorCodes; }
|
|
15947
|
+
}));
|
|
15948
|
+
Object.defineProperty(exports, "ConnectorPlatform", ({
|
|
15949
|
+
enumerable: true,
|
|
15950
|
+
get: function () { return types.ConnectorPlatform; }
|
|
15951
|
+
}));
|
|
15952
|
+
Object.defineProperty(exports, "ConnectorType", ({
|
|
15953
|
+
enumerable: true,
|
|
15954
|
+
get: function () { return types.ConnectorType; }
|
|
15955
|
+
}));
|
|
15956
|
+
Object.defineProperty(exports, "MessageTypes", ({
|
|
15957
|
+
enumerable: true,
|
|
15958
|
+
get: function () { return types.MessageTypes; }
|
|
15959
|
+
}));
|
|
15960
|
+
exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
|
|
15961
|
+
exports.connectorSessionGuard = types.connectorSessionGuard;
|
|
15962
|
+
exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
|
|
15963
|
+
exports.messageTypesGuard = types.messageTypesGuard;
|
|
15964
|
+
exports.parseJson = parseJson;
|
|
15965
|
+
exports.validateConfig = validateConfig;
|
|
15703
15966
|
|
|
15704
|
-
"use strict";
|
|
15705
|
-
module.exports = require("dns");
|
|
15706
15967
|
|
|
15707
15968
|
/***/ }),
|
|
15708
15969
|
|
|
15709
|
-
/***/
|
|
15710
|
-
/***/ ((
|
|
15970
|
+
/***/ 1876:
|
|
15971
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15711
15972
|
|
|
15712
15973
|
"use strict";
|
|
15713
|
-
module.exports = require("events");
|
|
15714
15974
|
|
|
15715
|
-
/***/ }),
|
|
15716
|
-
|
|
15717
|
-
/***/ 7147:
|
|
15718
|
-
/***/ ((module) => {
|
|
15719
15975
|
|
|
15720
|
-
|
|
15721
|
-
|
|
15976
|
+
var languageKit = __nccwpck_require__(1230);
|
|
15977
|
+
var zod = __nccwpck_require__(6319);
|
|
15722
15978
|
|
|
15723
|
-
|
|
15979
|
+
// MARK: Foundation
|
|
15980
|
+
exports.ConnectorType = void 0;
|
|
15981
|
+
(function (ConnectorType) {
|
|
15982
|
+
ConnectorType["Email"] = "Email";
|
|
15983
|
+
ConnectorType["Sms"] = "Sms";
|
|
15984
|
+
ConnectorType["Social"] = "Social";
|
|
15985
|
+
})(exports.ConnectorType || (exports.ConnectorType = {}));
|
|
15986
|
+
exports.ConnectorPlatform = void 0;
|
|
15987
|
+
(function (ConnectorPlatform) {
|
|
15988
|
+
ConnectorPlatform["Native"] = "Native";
|
|
15989
|
+
ConnectorPlatform["Universal"] = "Universal";
|
|
15990
|
+
ConnectorPlatform["Web"] = "Web";
|
|
15991
|
+
})(exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
|
|
15992
|
+
const i18nPhrasesGuard = zod.z
|
|
15993
|
+
.object({ en: zod.z.string() })
|
|
15994
|
+
.and(zod.z.record(zod.z.string()))
|
|
15995
|
+
.refine((i18nObject) => {
|
|
15996
|
+
const keys = Object.keys(i18nObject);
|
|
15997
|
+
if (!keys.includes('en')) {
|
|
15998
|
+
return false;
|
|
15999
|
+
}
|
|
16000
|
+
for (const value of keys) {
|
|
16001
|
+
if (!languageKit.isLanguageTag(value)) {
|
|
16002
|
+
return false;
|
|
16003
|
+
}
|
|
16004
|
+
}
|
|
16005
|
+
return true;
|
|
16006
|
+
});
|
|
16007
|
+
exports.ConnectorErrorCodes = void 0;
|
|
16008
|
+
(function (ConnectorErrorCodes) {
|
|
16009
|
+
ConnectorErrorCodes["General"] = "general";
|
|
16010
|
+
ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
|
|
16011
|
+
ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
|
|
16012
|
+
ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
|
|
16013
|
+
ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
|
|
16014
|
+
ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
|
|
16015
|
+
ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
|
|
16016
|
+
ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
|
|
16017
|
+
ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
|
|
16018
|
+
ConnectorErrorCodes["NotImplemented"] = "not_implemented";
|
|
16019
|
+
ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
|
|
16020
|
+
ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
|
|
16021
|
+
ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
|
|
16022
|
+
ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
|
|
16023
|
+
})(exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
|
|
16024
|
+
class ConnectorError extends Error {
|
|
16025
|
+
constructor(code, data) {
|
|
16026
|
+
const message = typeof data === 'string' ? data : 'Connector error occurred.';
|
|
16027
|
+
super(message);
|
|
16028
|
+
this.code = code;
|
|
16029
|
+
this.data = typeof data === 'string' ? { message: data } : data;
|
|
16030
|
+
}
|
|
16031
|
+
}
|
|
16032
|
+
exports.MessageTypes = void 0;
|
|
16033
|
+
(function (MessageTypes) {
|
|
16034
|
+
MessageTypes["SignIn"] = "SignIn";
|
|
16035
|
+
MessageTypes["Register"] = "Register";
|
|
16036
|
+
MessageTypes["ForgotPassword"] = "ForgotPassword";
|
|
16037
|
+
MessageTypes["Continue"] = "Continue";
|
|
16038
|
+
MessageTypes["Test"] = "Test";
|
|
16039
|
+
})(exports.MessageTypes || (exports.MessageTypes = {}));
|
|
16040
|
+
const messageTypesGuard = zod.z.nativeEnum(exports.MessageTypes);
|
|
16041
|
+
const connectorMetadataGuard = zod.z.object({
|
|
16042
|
+
id: zod.z.string(),
|
|
16043
|
+
target: zod.z.string(),
|
|
16044
|
+
platform: zod.z.nativeEnum(exports.ConnectorPlatform).nullable(),
|
|
16045
|
+
name: i18nPhrasesGuard,
|
|
16046
|
+
logo: zod.z.string(),
|
|
16047
|
+
logoDark: zod.z.string().nullable(),
|
|
16048
|
+
description: i18nPhrasesGuard,
|
|
16049
|
+
isStandard: zod.z.boolean().optional(),
|
|
16050
|
+
readme: zod.z.string(),
|
|
16051
|
+
configTemplate: zod.z.string(),
|
|
16052
|
+
});
|
|
16053
|
+
const configurableConnectorMetadataGuard = connectorMetadataGuard
|
|
16054
|
+
.pick({
|
|
16055
|
+
target: true,
|
|
16056
|
+
name: true,
|
|
16057
|
+
logo: true,
|
|
16058
|
+
logoDark: true,
|
|
16059
|
+
})
|
|
16060
|
+
.partial();
|
|
16061
|
+
const connectorSessionGuard = zod.z.object({
|
|
16062
|
+
nonce: zod.z.string().optional(),
|
|
16063
|
+
redirectUri: zod.z.string().optional(),
|
|
16064
|
+
});
|
|
15724
16065
|
|
|
15725
|
-
|
|
15726
|
-
|
|
16066
|
+
exports.ConnectorError = ConnectorError;
|
|
16067
|
+
exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
|
|
16068
|
+
exports.connectorSessionGuard = connectorSessionGuard;
|
|
16069
|
+
exports.i18nPhrasesGuard = i18nPhrasesGuard;
|
|
16070
|
+
exports.messageTypesGuard = messageTypesGuard;
|
|
15727
16071
|
|
|
15728
|
-
"use strict";
|
|
15729
|
-
module.exports = require("http");
|
|
15730
16072
|
|
|
15731
16073
|
/***/ }),
|
|
15732
16074
|
|
|
15733
|
-
/***/
|
|
15734
|
-
/***/ ((
|
|
16075
|
+
/***/ 8670:
|
|
16076
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
15735
16077
|
|
|
15736
16078
|
"use strict";
|
|
15737
|
-
module.exports = require("http2");
|
|
15738
|
-
|
|
15739
|
-
/***/ }),
|
|
15740
|
-
|
|
15741
|
-
/***/ 5687:
|
|
15742
|
-
/***/ ((module) => {
|
|
15743
16079
|
|
|
15744
|
-
"use strict";
|
|
15745
|
-
module.exports = require("https");
|
|
15746
16080
|
|
|
15747
|
-
|
|
16081
|
+
const languages = Object.freeze({
|
|
16082
|
+
'af-ZA': 'Afrikaans',
|
|
16083
|
+
'am-ET': 'አማርኛ',
|
|
16084
|
+
'ar-AR': 'العربية',
|
|
16085
|
+
'as-IN': 'অসমীয়া',
|
|
16086
|
+
'az-AZ': 'Azərbaycan dili',
|
|
16087
|
+
'be-BY': 'Беларуская',
|
|
16088
|
+
'bg-BG': 'Български',
|
|
16089
|
+
'bn-IN': 'বাংলা',
|
|
16090
|
+
'br-FR': 'Brezhoneg',
|
|
16091
|
+
'bs-BA': 'Bosanski',
|
|
16092
|
+
'ca-ES': 'Català',
|
|
16093
|
+
'cb-IQ': 'کوردیی ناوەندی',
|
|
16094
|
+
'co-FR': 'Corsu',
|
|
16095
|
+
'cs-CZ': 'Čeština',
|
|
16096
|
+
'cx-PH': 'Bisaya',
|
|
16097
|
+
'cy-GB': 'Cymraeg',
|
|
16098
|
+
'da-DK': 'Dansk',
|
|
16099
|
+
de: 'Deutsch',
|
|
16100
|
+
'de-DE': 'Deutsch (Deutschland)',
|
|
16101
|
+
'el-GR': 'Ελληνικά',
|
|
16102
|
+
en: 'English',
|
|
16103
|
+
'en-GB': 'English (UK)',
|
|
16104
|
+
'en-US': 'English (US)',
|
|
16105
|
+
'eo-EO': 'Esperanto',
|
|
16106
|
+
es: 'Español',
|
|
16107
|
+
'es-ES': 'Español (España)',
|
|
16108
|
+
'es-419': 'Español (Latinoamérica)',
|
|
16109
|
+
'et-EE': 'Eesti',
|
|
16110
|
+
'eu-ES': 'Euskara',
|
|
16111
|
+
'fa-IR': 'فارسی',
|
|
16112
|
+
'ff-NG': 'Fula',
|
|
16113
|
+
'fi-FI': 'Suomi',
|
|
16114
|
+
'fo-FO': 'Føroyskt',
|
|
16115
|
+
fr: 'Français',
|
|
16116
|
+
'fr-CA': 'Français (Canada)',
|
|
16117
|
+
'fr-FR': 'Français (France)',
|
|
16118
|
+
'fy-NL': 'Frysk',
|
|
16119
|
+
'ga-IE': 'Gaeilge',
|
|
16120
|
+
'gl-ES': 'Galego',
|
|
16121
|
+
'gn-PY': 'Guarani',
|
|
16122
|
+
'gu-IN': 'ગુજરાતી',
|
|
16123
|
+
'ha-NG': 'Hausa',
|
|
16124
|
+
'he-IL': 'עברית',
|
|
16125
|
+
'hi-IN': 'हिन्दी',
|
|
16126
|
+
'hr-HR': 'Hrvatski',
|
|
16127
|
+
'ht-HT': 'Kreyòl Ayisyen',
|
|
16128
|
+
'hu-HU': 'Magyar',
|
|
16129
|
+
'hy-AM': 'Հայերեն',
|
|
16130
|
+
'id-ID': 'Bahasa Indonesia',
|
|
16131
|
+
'ik-US': 'Iñupiatun',
|
|
16132
|
+
'is-IS': 'Íslenska',
|
|
16133
|
+
it: 'Italiano',
|
|
16134
|
+
'it-IT': 'italiano (Italia)',
|
|
16135
|
+
'iu-CA': 'Inuktitut',
|
|
16136
|
+
ja: '日本語',
|
|
16137
|
+
'ja-JP': '日本語',
|
|
16138
|
+
'ja-KS': '日本語(関西)',
|
|
16139
|
+
'jv-ID': 'Basa Jawa',
|
|
16140
|
+
'ka-GE': 'ქართული',
|
|
16141
|
+
'kk-KZ': 'Қазақша',
|
|
16142
|
+
'km-KH': 'ភាសាខ្មែរ',
|
|
16143
|
+
'kn-IN': 'ಕನ್ನಡ',
|
|
16144
|
+
ko: '한국어',
|
|
16145
|
+
'ko-KR': '한국어',
|
|
16146
|
+
'ku-TR': 'Kurdî (Kurmancî)',
|
|
16147
|
+
'ky-KG': 'кыргызча',
|
|
16148
|
+
'lo-LA': 'ພາສາລາວ',
|
|
16149
|
+
'lt-LT': 'Lietuvių',
|
|
16150
|
+
'lv-LV': 'Latviešu',
|
|
16151
|
+
'mg-MG': 'Malagasy',
|
|
16152
|
+
'mk-MK': 'Македонски',
|
|
16153
|
+
'ml-IN': 'മലയാളം',
|
|
16154
|
+
'mn-MN': 'Монгол',
|
|
16155
|
+
'mr-IN': 'मराठी',
|
|
16156
|
+
'ms-MY': 'Bahasa Melayu',
|
|
16157
|
+
'mt-MT': 'Malti',
|
|
16158
|
+
'my-MM': 'မြန်မာဘာသာ',
|
|
16159
|
+
'nb-NO': 'Norsk (bokmål)',
|
|
16160
|
+
'ne-NP': 'नेपाली',
|
|
16161
|
+
'nl-BE': 'Vlaams',
|
|
16162
|
+
'nl-NL': 'Nederlands',
|
|
16163
|
+
'nn-NO': 'Norsk (nynorsk)',
|
|
16164
|
+
'or-IN': 'ଓଡ଼ିଆ',
|
|
16165
|
+
'pa-IN': 'ਪੰਜਾਬੀ',
|
|
16166
|
+
'pl-PL': 'Polski',
|
|
16167
|
+
'ps-AF': 'پښتو',
|
|
16168
|
+
pt: 'português',
|
|
16169
|
+
'pt-BR': 'Português (Brasil)',
|
|
16170
|
+
'pt-PT': 'português (Portugal)',
|
|
16171
|
+
'ro-RO': 'Română',
|
|
16172
|
+
ru: 'Русский',
|
|
16173
|
+
'ru-RU': 'Русский',
|
|
16174
|
+
'rw-RW': 'Ikinyarwanda',
|
|
16175
|
+
'sc-IT': 'Sardu',
|
|
16176
|
+
'si-LK': 'සිංහල',
|
|
16177
|
+
'sk-SK': 'Slovenčina',
|
|
16178
|
+
'sl-SI': 'Slovenščina',
|
|
16179
|
+
'sn-ZW': 'Shona',
|
|
16180
|
+
'sq-AL': 'Shqip',
|
|
16181
|
+
'sr-RS': 'Српски',
|
|
16182
|
+
'sv-SE': 'Svenska',
|
|
16183
|
+
'sw-KE': 'Kiswahili',
|
|
16184
|
+
'sy-SY': 'ܣܘܪܝܝܐ',
|
|
16185
|
+
'sz-PL': 'ślōnskŏ gŏdka',
|
|
16186
|
+
'ta-IN': 'தமிழ்',
|
|
16187
|
+
'te-IN': 'తెలుగు',
|
|
16188
|
+
'tg-TJ': 'Тоҷикӣ',
|
|
16189
|
+
'th-TH': 'ภาษาไทย',
|
|
16190
|
+
'tl-PH': 'Filipino',
|
|
16191
|
+
tr: 'Türkçe',
|
|
16192
|
+
'tr-TR': 'Türkçe',
|
|
16193
|
+
'tt-RU': 'Татарча',
|
|
16194
|
+
'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
|
|
16195
|
+
'uk-UA': 'Українська',
|
|
16196
|
+
'ur-PK': 'اردو',
|
|
16197
|
+
'uz-UZ': "O'zbek",
|
|
16198
|
+
'vi-VN': 'Tiếng Việt',
|
|
16199
|
+
zh: '中文',
|
|
16200
|
+
'zh-CN': '简体中文',
|
|
16201
|
+
'zh-HK': '繁體中文(香港)',
|
|
16202
|
+
'zh-MO': '繁體中文(澳門)',
|
|
16203
|
+
'zh-TW': '繁體中文(台灣)',
|
|
16204
|
+
'zz-TR': 'Zaza',
|
|
16205
|
+
});
|
|
15748
16206
|
|
|
15749
|
-
|
|
15750
|
-
/***/ ((module) => {
|
|
16207
|
+
exports.languages = languages;
|
|
15751
16208
|
|
|
15752
|
-
"use strict";
|
|
15753
|
-
module.exports = require("net");
|
|
15754
16209
|
|
|
15755
16210
|
/***/ }),
|
|
15756
16211
|
|
|
15757
|
-
/***/
|
|
15758
|
-
/***/ ((
|
|
16212
|
+
/***/ 1230:
|
|
16213
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15759
16214
|
|
|
15760
16215
|
"use strict";
|
|
15761
|
-
module.exports = require("os");
|
|
15762
16216
|
|
|
15763
|
-
/***/ }),
|
|
15764
16217
|
|
|
15765
|
-
|
|
15766
|
-
|
|
16218
|
+
var _const = __nccwpck_require__(8670);
|
|
16219
|
+
var utility = __nccwpck_require__(2304);
|
|
15767
16220
|
|
|
15768
|
-
"use strict";
|
|
15769
|
-
module.exports = require("stream");
|
|
15770
16221
|
|
|
15771
|
-
/***/ }),
|
|
15772
16222
|
|
|
15773
|
-
|
|
15774
|
-
|
|
16223
|
+
exports.languages = _const.languages;
|
|
16224
|
+
exports.isLanguageTag = utility.isLanguageTag;
|
|
16225
|
+
exports.languageTagGuard = utility.languageTagGuard;
|
|
15775
16226
|
|
|
15776
|
-
"use strict";
|
|
15777
|
-
module.exports = require("tls");
|
|
15778
16227
|
|
|
15779
16228
|
/***/ }),
|
|
15780
16229
|
|
|
15781
|
-
/***/
|
|
15782
|
-
/***/ ((
|
|
16230
|
+
/***/ 2304:
|
|
16231
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15783
16232
|
|
|
15784
16233
|
"use strict";
|
|
15785
|
-
module.exports = require("url");
|
|
15786
|
-
|
|
15787
|
-
/***/ }),
|
|
15788
16234
|
|
|
15789
|
-
/***/ 3837:
|
|
15790
|
-
/***/ ((module) => {
|
|
15791
16235
|
|
|
15792
|
-
|
|
15793
|
-
|
|
16236
|
+
var zod = __nccwpck_require__(6319);
|
|
16237
|
+
var _const = __nccwpck_require__(8670);
|
|
15794
16238
|
|
|
15795
|
-
|
|
16239
|
+
const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
|
|
16240
|
+
const languageTagGuard = zod.z
|
|
16241
|
+
.any()
|
|
16242
|
+
.refine((value) => isLanguageTag(value));
|
|
15796
16243
|
|
|
15797
|
-
|
|
15798
|
-
|
|
16244
|
+
exports.isLanguageTag = isLanguageTag;
|
|
16245
|
+
exports.languageTagGuard = languageTagGuard;
|
|
15799
16246
|
|
|
15800
|
-
"use strict";
|
|
15801
|
-
module.exports = require("zlib");
|
|
15802
16247
|
|
|
15803
16248
|
/***/ })
|
|
15804
16249
|
|
|
@@ -15856,7 +16301,7 @@ module.exports = require("zlib");
|
|
|
15856
16301
|
/******/ // startup
|
|
15857
16302
|
/******/ // Load entry module and return exports
|
|
15858
16303
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
15859
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
16304
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(616);
|
|
15860
16305
|
/******/ module.exports = __webpack_exports__;
|
|
15861
16306
|
/******/
|
|
15862
16307
|
/******/ })()
|