@logto/connector-google 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 +1291 -846
- package/lib/jest.config.d.ts +1 -1
- package/lib/src/types.d.ts +3 -3
- package/package.json +29 -26
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,14 +1666,14 @@ module.exports = (defaultOptions = {}, options = {}) => {
|
|
|
1996
1666
|
|
|
1997
1667
|
/***/ }),
|
|
1998
1668
|
|
|
1999
|
-
/***/
|
|
1669
|
+
/***/ 1331:
|
|
2000
1670
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2001
1671
|
|
|
2002
1672
|
"use strict";
|
|
2003
1673
|
|
|
2004
1674
|
const {Transform, PassThrough} = __nccwpck_require__(2781);
|
|
2005
1675
|
const zlib = __nccwpck_require__(9796);
|
|
2006
|
-
const mimicResponse = __nccwpck_require__(
|
|
1676
|
+
const mimicResponse = __nccwpck_require__(9443);
|
|
2007
1677
|
|
|
2008
1678
|
module.exports = response => {
|
|
2009
1679
|
const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();
|
|
@@ -2062,7 +1732,7 @@ module.exports = response => {
|
|
|
2062
1732
|
|
|
2063
1733
|
/***/ }),
|
|
2064
1734
|
|
|
2065
|
-
/***/
|
|
1735
|
+
/***/ 8836:
|
|
2066
1736
|
/***/ ((module, exports) => {
|
|
2067
1737
|
|
|
2068
1738
|
"use strict";
|
|
@@ -2117,10 +1787,10 @@ module.exports["default"] = deferToConnect;
|
|
|
2117
1787
|
|
|
2118
1788
|
/***/ }),
|
|
2119
1789
|
|
|
2120
|
-
/***/
|
|
1790
|
+
/***/ 1243:
|
|
2121
1791
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2122
1792
|
|
|
2123
|
-
var once = __nccwpck_require__(
|
|
1793
|
+
var once = __nccwpck_require__(2469);
|
|
2124
1794
|
|
|
2125
1795
|
var noop = function() {};
|
|
2126
1796
|
|
|
@@ -2218,7 +1888,7 @@ module.exports = eos;
|
|
|
2218
1888
|
|
|
2219
1889
|
/***/ }),
|
|
2220
1890
|
|
|
2221
|
-
/***/
|
|
1891
|
+
/***/ 6957:
|
|
2222
1892
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2223
1893
|
|
|
2224
1894
|
"use strict";
|
|
@@ -2278,14 +1948,14 @@ module.exports = options => {
|
|
|
2278
1948
|
|
|
2279
1949
|
/***/ }),
|
|
2280
1950
|
|
|
2281
|
-
/***/
|
|
1951
|
+
/***/ 3421:
|
|
2282
1952
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2283
1953
|
|
|
2284
1954
|
"use strict";
|
|
2285
1955
|
|
|
2286
1956
|
const {constants: BufferConstants} = __nccwpck_require__(4300);
|
|
2287
|
-
const pump = __nccwpck_require__(
|
|
2288
|
-
const bufferStream = __nccwpck_require__(
|
|
1957
|
+
const pump = __nccwpck_require__(1216);
|
|
1958
|
+
const bufferStream = __nccwpck_require__(6957);
|
|
2289
1959
|
|
|
2290
1960
|
class MaxBufferError extends Error {
|
|
2291
1961
|
constructor() {
|
|
@@ -2346,13 +2016,13 @@ module.exports.MaxBufferError = MaxBufferError;
|
|
|
2346
2016
|
|
|
2347
2017
|
/***/ }),
|
|
2348
2018
|
|
|
2349
|
-
/***/
|
|
2019
|
+
/***/ 4827:
|
|
2350
2020
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2351
2021
|
|
|
2352
2022
|
"use strict";
|
|
2353
2023
|
|
|
2354
2024
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2355
|
-
const types_1 = __nccwpck_require__(
|
|
2025
|
+
const types_1 = __nccwpck_require__(2554);
|
|
2356
2026
|
function createRejection(error, ...beforeErrorGroups) {
|
|
2357
2027
|
const promise = (async () => {
|
|
2358
2028
|
if (error instanceof types_1.RequestError) {
|
|
@@ -2384,7 +2054,7 @@ exports["default"] = createRejection;
|
|
|
2384
2054
|
|
|
2385
2055
|
/***/ }),
|
|
2386
2056
|
|
|
2387
|
-
/***/
|
|
2057
|
+
/***/ 6894:
|
|
2388
2058
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
2389
2059
|
|
|
2390
2060
|
"use strict";
|
|
@@ -2401,14 +2071,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
2401
2071
|
};
|
|
2402
2072
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2403
2073
|
const events_1 = __nccwpck_require__(2361);
|
|
2404
|
-
const is_1 = __nccwpck_require__(
|
|
2405
|
-
const PCancelable = __nccwpck_require__(
|
|
2406
|
-
const types_1 = __nccwpck_require__(
|
|
2407
|
-
const parse_body_1 = __nccwpck_require__(
|
|
2408
|
-
const core_1 = __nccwpck_require__(
|
|
2409
|
-
const proxy_events_1 = __nccwpck_require__(
|
|
2410
|
-
const get_buffer_1 = __nccwpck_require__(
|
|
2411
|
-
const is_response_ok_1 = __nccwpck_require__(
|
|
2074
|
+
const is_1 = __nccwpck_require__(6198);
|
|
2075
|
+
const PCancelable = __nccwpck_require__(5323);
|
|
2076
|
+
const types_1 = __nccwpck_require__(2554);
|
|
2077
|
+
const parse_body_1 = __nccwpck_require__(3544);
|
|
2078
|
+
const core_1 = __nccwpck_require__(8525);
|
|
2079
|
+
const proxy_events_1 = __nccwpck_require__(8423);
|
|
2080
|
+
const get_buffer_1 = __nccwpck_require__(5444);
|
|
2081
|
+
const is_response_ok_1 = __nccwpck_require__(3117);
|
|
2412
2082
|
const proxiedRequestEvents = [
|
|
2413
2083
|
'request',
|
|
2414
2084
|
'response',
|
|
@@ -2562,18 +2232,18 @@ function asPromise(normalizedOptions) {
|
|
|
2562
2232
|
return promise;
|
|
2563
2233
|
}
|
|
2564
2234
|
exports["default"] = asPromise;
|
|
2565
|
-
__exportStar(__nccwpck_require__(
|
|
2235
|
+
__exportStar(__nccwpck_require__(2554), exports);
|
|
2566
2236
|
|
|
2567
2237
|
|
|
2568
2238
|
/***/ }),
|
|
2569
2239
|
|
|
2570
|
-
/***/
|
|
2240
|
+
/***/ 5040:
|
|
2571
2241
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2572
2242
|
|
|
2573
2243
|
"use strict";
|
|
2574
2244
|
|
|
2575
2245
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2576
|
-
const is_1 = __nccwpck_require__(
|
|
2246
|
+
const is_1 = __nccwpck_require__(6198);
|
|
2577
2247
|
const normalizeArguments = (options, defaults) => {
|
|
2578
2248
|
if (is_1.default.null_(options.encoding)) {
|
|
2579
2249
|
throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead');
|
|
@@ -2653,13 +2323,13 @@ exports["default"] = normalizeArguments;
|
|
|
2653
2323
|
|
|
2654
2324
|
/***/ }),
|
|
2655
2325
|
|
|
2656
|
-
/***/
|
|
2326
|
+
/***/ 3544:
|
|
2657
2327
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2658
2328
|
|
|
2659
2329
|
"use strict";
|
|
2660
2330
|
|
|
2661
2331
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2662
|
-
const types_1 = __nccwpck_require__(
|
|
2332
|
+
const types_1 = __nccwpck_require__(2554);
|
|
2663
2333
|
const parseBody = (response, responseType, parseJson, encoding) => {
|
|
2664
2334
|
const { rawBody } = response;
|
|
2665
2335
|
try {
|
|
@@ -2686,7 +2356,7 @@ exports["default"] = parseBody;
|
|
|
2686
2356
|
|
|
2687
2357
|
/***/ }),
|
|
2688
2358
|
|
|
2689
|
-
/***/
|
|
2359
|
+
/***/ 2554:
|
|
2690
2360
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
2691
2361
|
|
|
2692
2362
|
"use strict";
|
|
@@ -2703,7 +2373,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
2703
2373
|
};
|
|
2704
2374
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2705
2375
|
exports.CancelError = exports.ParseError = void 0;
|
|
2706
|
-
const core_1 = __nccwpck_require__(
|
|
2376
|
+
const core_1 = __nccwpck_require__(8525);
|
|
2707
2377
|
/**
|
|
2708
2378
|
An error to be thrown when server response code is 2xx, and parsing body fails.
|
|
2709
2379
|
Includes a `response` property.
|
|
@@ -2731,12 +2401,12 @@ class CancelError extends core_1.RequestError {
|
|
|
2731
2401
|
}
|
|
2732
2402
|
}
|
|
2733
2403
|
exports.CancelError = CancelError;
|
|
2734
|
-
__exportStar(__nccwpck_require__(
|
|
2404
|
+
__exportStar(__nccwpck_require__(8525), exports);
|
|
2735
2405
|
|
|
2736
2406
|
|
|
2737
2407
|
/***/ }),
|
|
2738
2408
|
|
|
2739
|
-
/***/
|
|
2409
|
+
/***/ 9388:
|
|
2740
2410
|
/***/ ((__unused_webpack_module, exports) => {
|
|
2741
2411
|
|
|
2742
2412
|
"use strict";
|
|
@@ -2773,7 +2443,7 @@ exports["default"] = calculateRetryDelay;
|
|
|
2773
2443
|
|
|
2774
2444
|
/***/ }),
|
|
2775
2445
|
|
|
2776
|
-
/***/
|
|
2446
|
+
/***/ 8525:
|
|
2777
2447
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2778
2448
|
|
|
2779
2449
|
"use strict";
|
|
@@ -2787,27 +2457,27 @@ const url_1 = __nccwpck_require__(7310);
|
|
|
2787
2457
|
const http = __nccwpck_require__(3685);
|
|
2788
2458
|
const http_1 = __nccwpck_require__(3685);
|
|
2789
2459
|
const https = __nccwpck_require__(5687);
|
|
2790
|
-
const http_timer_1 = __nccwpck_require__(
|
|
2791
|
-
const cacheable_lookup_1 = __nccwpck_require__(
|
|
2792
|
-
const CacheableRequest = __nccwpck_require__(
|
|
2793
|
-
const decompressResponse = __nccwpck_require__(
|
|
2460
|
+
const http_timer_1 = __nccwpck_require__(3632);
|
|
2461
|
+
const cacheable_lookup_1 = __nccwpck_require__(2074);
|
|
2462
|
+
const CacheableRequest = __nccwpck_require__(5967);
|
|
2463
|
+
const decompressResponse = __nccwpck_require__(1331);
|
|
2794
2464
|
// @ts-expect-error Missing types
|
|
2795
|
-
const http2wrapper = __nccwpck_require__(
|
|
2796
|
-
const lowercaseKeys = __nccwpck_require__(
|
|
2797
|
-
const is_1 = __nccwpck_require__(
|
|
2798
|
-
const get_body_size_1 = __nccwpck_require__(
|
|
2799
|
-
const is_form_data_1 = __nccwpck_require__(
|
|
2800
|
-
const proxy_events_1 = __nccwpck_require__(
|
|
2801
|
-
const timed_out_1 = __nccwpck_require__(
|
|
2802
|
-
const url_to_options_1 = __nccwpck_require__(
|
|
2803
|
-
const options_to_url_1 = __nccwpck_require__(
|
|
2804
|
-
const weakable_map_1 = __nccwpck_require__(
|
|
2805
|
-
const get_buffer_1 = __nccwpck_require__(
|
|
2806
|
-
const dns_ip_version_1 = __nccwpck_require__(
|
|
2807
|
-
const is_response_ok_1 = __nccwpck_require__(
|
|
2808
|
-
const deprecation_warning_1 = __nccwpck_require__(
|
|
2809
|
-
const normalize_arguments_1 = __nccwpck_require__(
|
|
2810
|
-
const calculate_retry_delay_1 = __nccwpck_require__(
|
|
2465
|
+
const http2wrapper = __nccwpck_require__(739);
|
|
2466
|
+
const lowercaseKeys = __nccwpck_require__(2893);
|
|
2467
|
+
const is_1 = __nccwpck_require__(6198);
|
|
2468
|
+
const get_body_size_1 = __nccwpck_require__(7408);
|
|
2469
|
+
const is_form_data_1 = __nccwpck_require__(9502);
|
|
2470
|
+
const proxy_events_1 = __nccwpck_require__(8423);
|
|
2471
|
+
const timed_out_1 = __nccwpck_require__(6843);
|
|
2472
|
+
const url_to_options_1 = __nccwpck_require__(4003);
|
|
2473
|
+
const options_to_url_1 = __nccwpck_require__(8124);
|
|
2474
|
+
const weakable_map_1 = __nccwpck_require__(7849);
|
|
2475
|
+
const get_buffer_1 = __nccwpck_require__(5444);
|
|
2476
|
+
const dns_ip_version_1 = __nccwpck_require__(4254);
|
|
2477
|
+
const is_response_ok_1 = __nccwpck_require__(3117);
|
|
2478
|
+
const deprecation_warning_1 = __nccwpck_require__(5531);
|
|
2479
|
+
const normalize_arguments_1 = __nccwpck_require__(5040);
|
|
2480
|
+
const calculate_retry_delay_1 = __nccwpck_require__(9388);
|
|
2811
2481
|
let globalDnsCache;
|
|
2812
2482
|
const kRequest = Symbol('request');
|
|
2813
2483
|
const kResponse = Symbol('response');
|
|
@@ -4286,7 +3956,7 @@ exports["default"] = Request;
|
|
|
4286
3956
|
|
|
4287
3957
|
/***/ }),
|
|
4288
3958
|
|
|
4289
|
-
/***/
|
|
3959
|
+
/***/ 4254:
|
|
4290
3960
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4291
3961
|
|
|
4292
3962
|
"use strict";
|
|
@@ -4311,7 +3981,7 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {
|
|
|
4311
3981
|
|
|
4312
3982
|
/***/ }),
|
|
4313
3983
|
|
|
4314
|
-
/***/
|
|
3984
|
+
/***/ 7408:
|
|
4315
3985
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4316
3986
|
|
|
4317
3987
|
"use strict";
|
|
@@ -4319,8 +3989,8 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {
|
|
|
4319
3989
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4320
3990
|
const fs_1 = __nccwpck_require__(7147);
|
|
4321
3991
|
const util_1 = __nccwpck_require__(3837);
|
|
4322
|
-
const is_1 = __nccwpck_require__(
|
|
4323
|
-
const is_form_data_1 = __nccwpck_require__(
|
|
3992
|
+
const is_1 = __nccwpck_require__(6198);
|
|
3993
|
+
const is_form_data_1 = __nccwpck_require__(9502);
|
|
4324
3994
|
const statAsync = util_1.promisify(fs_1.stat);
|
|
4325
3995
|
exports["default"] = async (body, headers) => {
|
|
4326
3996
|
if (headers && 'content-length' in headers) {
|
|
@@ -4351,7 +4021,7 @@ exports["default"] = async (body, headers) => {
|
|
|
4351
4021
|
|
|
4352
4022
|
/***/ }),
|
|
4353
4023
|
|
|
4354
|
-
/***/
|
|
4024
|
+
/***/ 5444:
|
|
4355
4025
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4356
4026
|
|
|
4357
4027
|
"use strict";
|
|
@@ -4375,19 +4045,19 @@ exports["default"] = getBuffer;
|
|
|
4375
4045
|
|
|
4376
4046
|
/***/ }),
|
|
4377
4047
|
|
|
4378
|
-
/***/
|
|
4048
|
+
/***/ 9502:
|
|
4379
4049
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4380
4050
|
|
|
4381
4051
|
"use strict";
|
|
4382
4052
|
|
|
4383
4053
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4384
|
-
const is_1 = __nccwpck_require__(
|
|
4054
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4385
4055
|
exports["default"] = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary);
|
|
4386
4056
|
|
|
4387
4057
|
|
|
4388
4058
|
/***/ }),
|
|
4389
4059
|
|
|
4390
|
-
/***/
|
|
4060
|
+
/***/ 3117:
|
|
4391
4061
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4392
4062
|
|
|
4393
4063
|
"use strict";
|
|
@@ -4403,7 +4073,7 @@ exports.isResponseOk = (response) => {
|
|
|
4403
4073
|
|
|
4404
4074
|
/***/ }),
|
|
4405
4075
|
|
|
4406
|
-
/***/
|
|
4076
|
+
/***/ 8124:
|
|
4407
4077
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4408
4078
|
|
|
4409
4079
|
"use strict";
|
|
@@ -4464,7 +4134,7 @@ exports["default"] = (origin, options) => {
|
|
|
4464
4134
|
|
|
4465
4135
|
/***/ }),
|
|
4466
4136
|
|
|
4467
|
-
/***/
|
|
4137
|
+
/***/ 8423:
|
|
4468
4138
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4469
4139
|
|
|
4470
4140
|
"use strict";
|
|
@@ -4489,7 +4159,7 @@ exports["default"] = default_1;
|
|
|
4489
4159
|
|
|
4490
4160
|
/***/ }),
|
|
4491
4161
|
|
|
4492
|
-
/***/
|
|
4162
|
+
/***/ 6843:
|
|
4493
4163
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4494
4164
|
|
|
4495
4165
|
"use strict";
|
|
@@ -4497,7 +4167,7 @@ exports["default"] = default_1;
|
|
|
4497
4167
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4498
4168
|
exports.TimeoutError = void 0;
|
|
4499
4169
|
const net = __nccwpck_require__(1808);
|
|
4500
|
-
const unhandle_1 = __nccwpck_require__(
|
|
4170
|
+
const unhandle_1 = __nccwpck_require__(6922);
|
|
4501
4171
|
const reentry = Symbol('reentry');
|
|
4502
4172
|
const noop = () => { };
|
|
4503
4173
|
class TimeoutError extends Error {
|
|
@@ -4618,7 +4288,7 @@ exports["default"] = (request, delays, options) => {
|
|
|
4618
4288
|
|
|
4619
4289
|
/***/ }),
|
|
4620
4290
|
|
|
4621
|
-
/***/
|
|
4291
|
+
/***/ 6922:
|
|
4622
4292
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4623
4293
|
|
|
4624
4294
|
"use strict";
|
|
@@ -4648,13 +4318,13 @@ exports["default"] = () => {
|
|
|
4648
4318
|
|
|
4649
4319
|
/***/ }),
|
|
4650
4320
|
|
|
4651
|
-
/***/
|
|
4321
|
+
/***/ 4003:
|
|
4652
4322
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4653
4323
|
|
|
4654
4324
|
"use strict";
|
|
4655
4325
|
|
|
4656
4326
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4657
|
-
const is_1 = __nccwpck_require__(
|
|
4327
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4658
4328
|
exports["default"] = (url) => {
|
|
4659
4329
|
// Cast to URL
|
|
4660
4330
|
url = url;
|
|
@@ -4680,7 +4350,7 @@ exports["default"] = (url) => {
|
|
|
4680
4350
|
|
|
4681
4351
|
/***/ }),
|
|
4682
4352
|
|
|
4683
|
-
/***/
|
|
4353
|
+
/***/ 7849:
|
|
4684
4354
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4685
4355
|
|
|
4686
4356
|
"use strict";
|
|
@@ -4717,7 +4387,7 @@ exports["default"] = WeakableMap;
|
|
|
4717
4387
|
|
|
4718
4388
|
/***/ }),
|
|
4719
4389
|
|
|
4720
|
-
/***/
|
|
4390
|
+
/***/ 9162:
|
|
4721
4391
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4722
4392
|
|
|
4723
4393
|
"use strict";
|
|
@@ -4734,11 +4404,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
4734
4404
|
};
|
|
4735
4405
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4736
4406
|
exports.defaultHandler = void 0;
|
|
4737
|
-
const is_1 = __nccwpck_require__(
|
|
4738
|
-
const as_promise_1 = __nccwpck_require__(
|
|
4739
|
-
const create_rejection_1 = __nccwpck_require__(
|
|
4740
|
-
const core_1 = __nccwpck_require__(
|
|
4741
|
-
const deep_freeze_1 = __nccwpck_require__(
|
|
4407
|
+
const is_1 = __nccwpck_require__(6198);
|
|
4408
|
+
const as_promise_1 = __nccwpck_require__(6894);
|
|
4409
|
+
const create_rejection_1 = __nccwpck_require__(4827);
|
|
4410
|
+
const core_1 = __nccwpck_require__(8525);
|
|
4411
|
+
const deep_freeze_1 = __nccwpck_require__(2982);
|
|
4742
4412
|
const errors = {
|
|
4743
4413
|
RequestError: as_promise_1.RequestError,
|
|
4744
4414
|
CacheError: as_promise_1.CacheError,
|
|
@@ -4960,12 +4630,12 @@ const create = (defaults) => {
|
|
|
4960
4630
|
return got;
|
|
4961
4631
|
};
|
|
4962
4632
|
exports["default"] = create;
|
|
4963
|
-
__exportStar(__nccwpck_require__(
|
|
4633
|
+
__exportStar(__nccwpck_require__(9239), exports);
|
|
4964
4634
|
|
|
4965
4635
|
|
|
4966
4636
|
/***/ }),
|
|
4967
4637
|
|
|
4968
|
-
/***/
|
|
4638
|
+
/***/ 9235:
|
|
4969
4639
|
/***/ (function(module, exports, __nccwpck_require__) {
|
|
4970
4640
|
|
|
4971
4641
|
"use strict";
|
|
@@ -4982,7 +4652,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
4982
4652
|
};
|
|
4983
4653
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4984
4654
|
const url_1 = __nccwpck_require__(7310);
|
|
4985
|
-
const create_1 = __nccwpck_require__(
|
|
4655
|
+
const create_1 = __nccwpck_require__(9162);
|
|
4986
4656
|
const defaults = {
|
|
4987
4657
|
options: {
|
|
4988
4658
|
method: 'GET',
|
|
@@ -5099,13 +4769,13 @@ exports["default"] = got;
|
|
|
5099
4769
|
module.exports = got;
|
|
5100
4770
|
module.exports["default"] = got;
|
|
5101
4771
|
module.exports.__esModule = true; // Workaround for TS issue: https://github.com/sindresorhus/got/pull/1267
|
|
5102
|
-
__exportStar(__nccwpck_require__(
|
|
5103
|
-
__exportStar(__nccwpck_require__(
|
|
4772
|
+
__exportStar(__nccwpck_require__(9162), exports);
|
|
4773
|
+
__exportStar(__nccwpck_require__(6894), exports);
|
|
5104
4774
|
|
|
5105
4775
|
|
|
5106
4776
|
/***/ }),
|
|
5107
4777
|
|
|
5108
|
-
/***/
|
|
4778
|
+
/***/ 9239:
|
|
5109
4779
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5110
4780
|
|
|
5111
4781
|
"use strict";
|
|
@@ -5115,13 +4785,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5115
4785
|
|
|
5116
4786
|
/***/ }),
|
|
5117
4787
|
|
|
5118
|
-
/***/
|
|
4788
|
+
/***/ 2982:
|
|
5119
4789
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5120
4790
|
|
|
5121
4791
|
"use strict";
|
|
5122
4792
|
|
|
5123
4793
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5124
|
-
const is_1 = __nccwpck_require__(
|
|
4794
|
+
const is_1 = __nccwpck_require__(6198);
|
|
5125
4795
|
function deepFreeze(object) {
|
|
5126
4796
|
for (const value of Object.values(object)) {
|
|
5127
4797
|
if (is_1.default.plainObject(value) || is_1.default.array(value)) {
|
|
@@ -5135,7 +4805,7 @@ exports["default"] = deepFreeze;
|
|
|
5135
4805
|
|
|
5136
4806
|
/***/ }),
|
|
5137
4807
|
|
|
5138
|
-
/***/
|
|
4808
|
+
/***/ 5531:
|
|
5139
4809
|
/***/ ((__unused_webpack_module, exports) => {
|
|
5140
4810
|
|
|
5141
4811
|
"use strict";
|
|
@@ -5156,7 +4826,7 @@ exports["default"] = (message) => {
|
|
|
5156
4826
|
|
|
5157
4827
|
/***/ }),
|
|
5158
4828
|
|
|
5159
|
-
/***/
|
|
4829
|
+
/***/ 8412:
|
|
5160
4830
|
/***/ ((module) => {
|
|
5161
4831
|
|
|
5162
4832
|
"use strict";
|
|
@@ -5837,15 +5507,15 @@ module.exports = class CachePolicy {
|
|
|
5837
5507
|
|
|
5838
5508
|
/***/ }),
|
|
5839
5509
|
|
|
5840
|
-
/***/
|
|
5510
|
+
/***/ 6495:
|
|
5841
5511
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5842
5512
|
|
|
5843
5513
|
"use strict";
|
|
5844
5514
|
|
|
5845
5515
|
const EventEmitter = __nccwpck_require__(2361);
|
|
5846
|
-
const tls = __nccwpck_require__(
|
|
5516
|
+
const tls = __nccwpck_require__(6821);
|
|
5847
5517
|
const http2 = __nccwpck_require__(5158);
|
|
5848
|
-
const QuickLRU = __nccwpck_require__(
|
|
5518
|
+
const QuickLRU = __nccwpck_require__(4225);
|
|
5849
5519
|
|
|
5850
5520
|
const kCurrentStreamsCount = Symbol('currentStreamsCount');
|
|
5851
5521
|
const kRequest = Symbol('request');
|
|
@@ -6515,18 +6185,18 @@ module.exports = {
|
|
|
6515
6185
|
|
|
6516
6186
|
/***/ }),
|
|
6517
6187
|
|
|
6518
|
-
/***/
|
|
6188
|
+
/***/ 229:
|
|
6519
6189
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6520
6190
|
|
|
6521
6191
|
"use strict";
|
|
6522
6192
|
|
|
6523
6193
|
const http = __nccwpck_require__(3685);
|
|
6524
6194
|
const https = __nccwpck_require__(5687);
|
|
6525
|
-
const resolveALPN = __nccwpck_require__(
|
|
6526
|
-
const QuickLRU = __nccwpck_require__(
|
|
6527
|
-
const Http2ClientRequest = __nccwpck_require__(
|
|
6528
|
-
const calculateServerName = __nccwpck_require__(
|
|
6529
|
-
const urlToOptions = __nccwpck_require__(
|
|
6195
|
+
const resolveALPN = __nccwpck_require__(6354);
|
|
6196
|
+
const QuickLRU = __nccwpck_require__(4225);
|
|
6197
|
+
const Http2ClientRequest = __nccwpck_require__(3674);
|
|
6198
|
+
const calculateServerName = __nccwpck_require__(5502);
|
|
6199
|
+
const urlToOptions = __nccwpck_require__(5142);
|
|
6530
6200
|
|
|
6531
6201
|
const cache = new QuickLRU({maxSize: 100});
|
|
6532
6202
|
const queue = new Map();
|
|
@@ -6672,18 +6342,18 @@ module.exports.protocolCache = cache;
|
|
|
6672
6342
|
|
|
6673
6343
|
/***/ }),
|
|
6674
6344
|
|
|
6675
|
-
/***/
|
|
6345
|
+
/***/ 3674:
|
|
6676
6346
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6677
6347
|
|
|
6678
6348
|
"use strict";
|
|
6679
6349
|
|
|
6680
6350
|
const http2 = __nccwpck_require__(5158);
|
|
6681
6351
|
const {Writable} = __nccwpck_require__(2781);
|
|
6682
|
-
const {Agent, globalAgent} = __nccwpck_require__(
|
|
6683
|
-
const IncomingMessage = __nccwpck_require__(
|
|
6684
|
-
const urlToOptions = __nccwpck_require__(
|
|
6685
|
-
const proxyEvents = __nccwpck_require__(
|
|
6686
|
-
const isRequestPseudoHeader = __nccwpck_require__(
|
|
6352
|
+
const {Agent, globalAgent} = __nccwpck_require__(6495);
|
|
6353
|
+
const IncomingMessage = __nccwpck_require__(6877);
|
|
6354
|
+
const urlToOptions = __nccwpck_require__(5142);
|
|
6355
|
+
const proxyEvents = __nccwpck_require__(6993);
|
|
6356
|
+
const isRequestPseudoHeader = __nccwpck_require__(7708);
|
|
6687
6357
|
const {
|
|
6688
6358
|
ERR_INVALID_ARG_TYPE,
|
|
6689
6359
|
ERR_INVALID_PROTOCOL,
|
|
@@ -6691,7 +6361,7 @@ const {
|
|
|
6691
6361
|
ERR_INVALID_HTTP_TOKEN,
|
|
6692
6362
|
ERR_HTTP_INVALID_HEADER_VALUE,
|
|
6693
6363
|
ERR_INVALID_CHAR
|
|
6694
|
-
} = __nccwpck_require__(
|
|
6364
|
+
} = __nccwpck_require__(3223);
|
|
6695
6365
|
|
|
6696
6366
|
const {
|
|
6697
6367
|
HTTP2_HEADER_STATUS,
|
|
@@ -7125,7 +6795,7 @@ module.exports = ClientRequest;
|
|
|
7125
6795
|
|
|
7126
6796
|
/***/ }),
|
|
7127
6797
|
|
|
7128
|
-
/***/
|
|
6798
|
+
/***/ 6877:
|
|
7129
6799
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7130
6800
|
|
|
7131
6801
|
"use strict";
|
|
@@ -7191,16 +6861,16 @@ module.exports = IncomingMessage;
|
|
|
7191
6861
|
|
|
7192
6862
|
/***/ }),
|
|
7193
6863
|
|
|
7194
|
-
/***/
|
|
6864
|
+
/***/ 739:
|
|
7195
6865
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7196
6866
|
|
|
7197
6867
|
"use strict";
|
|
7198
6868
|
|
|
7199
6869
|
const http2 = __nccwpck_require__(5158);
|
|
7200
|
-
const agent = __nccwpck_require__(
|
|
7201
|
-
const ClientRequest = __nccwpck_require__(
|
|
7202
|
-
const IncomingMessage = __nccwpck_require__(
|
|
7203
|
-
const auto = __nccwpck_require__(
|
|
6870
|
+
const agent = __nccwpck_require__(6495);
|
|
6871
|
+
const ClientRequest = __nccwpck_require__(3674);
|
|
6872
|
+
const IncomingMessage = __nccwpck_require__(6877);
|
|
6873
|
+
const auto = __nccwpck_require__(229);
|
|
7204
6874
|
|
|
7205
6875
|
const request = (url, options, callback) => {
|
|
7206
6876
|
return new ClientRequest(url, options, callback);
|
|
@@ -7227,7 +6897,7 @@ module.exports = {
|
|
|
7227
6897
|
|
|
7228
6898
|
/***/ }),
|
|
7229
6899
|
|
|
7230
|
-
/***/
|
|
6900
|
+
/***/ 5502:
|
|
7231
6901
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7232
6902
|
|
|
7233
6903
|
"use strict";
|
|
@@ -7262,7 +6932,7 @@ module.exports = options => {
|
|
|
7262
6932
|
|
|
7263
6933
|
/***/ }),
|
|
7264
6934
|
|
|
7265
|
-
/***/
|
|
6935
|
+
/***/ 3223:
|
|
7266
6936
|
/***/ ((module) => {
|
|
7267
6937
|
|
|
7268
6938
|
"use strict";
|
|
@@ -7315,7 +6985,7 @@ makeError(TypeError, 'ERR_INVALID_CHAR', args => {
|
|
|
7315
6985
|
|
|
7316
6986
|
/***/ }),
|
|
7317
6987
|
|
|
7318
|
-
/***/
|
|
6988
|
+
/***/ 7708:
|
|
7319
6989
|
/***/ ((module) => {
|
|
7320
6990
|
|
|
7321
6991
|
"use strict";
|
|
@@ -7336,7 +7006,7 @@ module.exports = header => {
|
|
|
7336
7006
|
|
|
7337
7007
|
/***/ }),
|
|
7338
7008
|
|
|
7339
|
-
/***/
|
|
7009
|
+
/***/ 6993:
|
|
7340
7010
|
/***/ ((module) => {
|
|
7341
7011
|
|
|
7342
7012
|
"use strict";
|
|
@@ -7351,7 +7021,7 @@ module.exports = (from, to, events) => {
|
|
|
7351
7021
|
|
|
7352
7022
|
/***/ }),
|
|
7353
7023
|
|
|
7354
|
-
/***/
|
|
7024
|
+
/***/ 5142:
|
|
7355
7025
|
/***/ ((module) => {
|
|
7356
7026
|
|
|
7357
7027
|
"use strict";
|
|
@@ -7384,7 +7054,7 @@ module.exports = url => {
|
|
|
7384
7054
|
|
|
7385
7055
|
/***/ }),
|
|
7386
7056
|
|
|
7387
|
-
/***/
|
|
7057
|
+
/***/ 3180:
|
|
7388
7058
|
/***/ ((__unused_webpack_module, exports) => {
|
|
7389
7059
|
|
|
7390
7060
|
//TODO: handle reviver/dehydrate function like normal
|
|
@@ -7449,15 +7119,15 @@ exports.parse = function (s) {
|
|
|
7449
7119
|
|
|
7450
7120
|
/***/ }),
|
|
7451
7121
|
|
|
7452
|
-
/***/
|
|
7122
|
+
/***/ 6474:
|
|
7453
7123
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7454
7124
|
|
|
7455
7125
|
"use strict";
|
|
7456
7126
|
|
|
7457
7127
|
|
|
7458
7128
|
const EventEmitter = __nccwpck_require__(2361);
|
|
7459
|
-
const JSONB = __nccwpck_require__(
|
|
7460
|
-
const compressBrotli = __nccwpck_require__(
|
|
7129
|
+
const JSONB = __nccwpck_require__(3180);
|
|
7130
|
+
const compressBrotli = __nccwpck_require__(996);
|
|
7461
7131
|
|
|
7462
7132
|
const loadStore = options => {
|
|
7463
7133
|
const adapters = {
|
|
@@ -7725,7 +7395,7 @@ module.exports = Keyv;
|
|
|
7725
7395
|
|
|
7726
7396
|
/***/ }),
|
|
7727
7397
|
|
|
7728
|
-
/***/
|
|
7398
|
+
/***/ 1128:
|
|
7729
7399
|
/***/ ((module, exports, __nccwpck_require__) => {
|
|
7730
7400
|
|
|
7731
7401
|
/* module decorator */ module = __nccwpck_require__.nmd(module);
|
|
@@ -10219,7 +9889,7 @@ module.exports = orderBy;
|
|
|
10219
9889
|
|
|
10220
9890
|
/***/ }),
|
|
10221
9891
|
|
|
10222
|
-
/***/
|
|
9892
|
+
/***/ 9103:
|
|
10223
9893
|
/***/ ((module) => {
|
|
10224
9894
|
|
|
10225
9895
|
/**
|
|
@@ -10729,7 +10399,7 @@ module.exports = pick;
|
|
|
10729
10399
|
|
|
10730
10400
|
/***/ }),
|
|
10731
10401
|
|
|
10732
|
-
/***/
|
|
10402
|
+
/***/ 2893:
|
|
10733
10403
|
/***/ ((module) => {
|
|
10734
10404
|
|
|
10735
10405
|
"use strict";
|
|
@@ -10747,7 +10417,7 @@ module.exports = object => {
|
|
|
10747
10417
|
|
|
10748
10418
|
/***/ }),
|
|
10749
10419
|
|
|
10750
|
-
/***/
|
|
10420
|
+
/***/ 7642:
|
|
10751
10421
|
/***/ ((module) => {
|
|
10752
10422
|
|
|
10753
10423
|
"use strict";
|
|
@@ -10787,7 +10457,7 @@ module.exports = (fromStream, toStream) => {
|
|
|
10787
10457
|
|
|
10788
10458
|
/***/ }),
|
|
10789
10459
|
|
|
10790
|
-
/***/
|
|
10460
|
+
/***/ 9443:
|
|
10791
10461
|
/***/ ((module) => {
|
|
10792
10462
|
|
|
10793
10463
|
"use strict";
|
|
@@ -10872,7 +10542,7 @@ module.exports = (fromStream, toStream) => {
|
|
|
10872
10542
|
|
|
10873
10543
|
/***/ }),
|
|
10874
10544
|
|
|
10875
|
-
/***/
|
|
10545
|
+
/***/ 5797:
|
|
10876
10546
|
/***/ ((module) => {
|
|
10877
10547
|
|
|
10878
10548
|
"use strict";
|
|
@@ -11096,10 +10766,10 @@ module.exports = normalizeUrl;
|
|
|
11096
10766
|
|
|
11097
10767
|
/***/ }),
|
|
11098
10768
|
|
|
11099
|
-
/***/
|
|
10769
|
+
/***/ 2469:
|
|
11100
10770
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
11101
10771
|
|
|
11102
|
-
var wrappy = __nccwpck_require__(
|
|
10772
|
+
var wrappy = __nccwpck_require__(6540)
|
|
11103
10773
|
module.exports = wrappy(once)
|
|
11104
10774
|
module.exports.strict = wrappy(onceStrict)
|
|
11105
10775
|
|
|
@@ -11145,7 +10815,7 @@ function onceStrict (fn) {
|
|
|
11145
10815
|
|
|
11146
10816
|
/***/ }),
|
|
11147
10817
|
|
|
11148
|
-
/***/
|
|
10818
|
+
/***/ 5323:
|
|
11149
10819
|
/***/ ((module) => {
|
|
11150
10820
|
|
|
11151
10821
|
"use strict";
|
|
@@ -11264,11 +10934,11 @@ module.exports.CancelError = CancelError;
|
|
|
11264
10934
|
|
|
11265
10935
|
/***/ }),
|
|
11266
10936
|
|
|
11267
|
-
/***/
|
|
10937
|
+
/***/ 1216:
|
|
11268
10938
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
11269
10939
|
|
|
11270
|
-
var once = __nccwpck_require__(
|
|
11271
|
-
var eos = __nccwpck_require__(
|
|
10940
|
+
var once = __nccwpck_require__(2469)
|
|
10941
|
+
var eos = __nccwpck_require__(1243)
|
|
11272
10942
|
var fs = __nccwpck_require__(7147) // we only need fs to get the ReadStream and WriteStream prototypes
|
|
11273
10943
|
|
|
11274
10944
|
var noop = function () {}
|
|
@@ -11353,7 +11023,7 @@ module.exports = pump
|
|
|
11353
11023
|
|
|
11354
11024
|
/***/ }),
|
|
11355
11025
|
|
|
11356
|
-
/***/
|
|
11026
|
+
/***/ 4225:
|
|
11357
11027
|
/***/ ((module) => {
|
|
11358
11028
|
|
|
11359
11029
|
"use strict";
|
|
@@ -11484,12 +11154,12 @@ module.exports = QuickLRU;
|
|
|
11484
11154
|
|
|
11485
11155
|
/***/ }),
|
|
11486
11156
|
|
|
11487
|
-
/***/
|
|
11157
|
+
/***/ 6354:
|
|
11488
11158
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
11489
11159
|
|
|
11490
11160
|
"use strict";
|
|
11491
11161
|
|
|
11492
|
-
const tls = __nccwpck_require__(
|
|
11162
|
+
const tls = __nccwpck_require__(6821);
|
|
11493
11163
|
|
|
11494
11164
|
module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, reject) => {
|
|
11495
11165
|
let timeout = false;
|
|
@@ -11535,14 +11205,14 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve,
|
|
|
11535
11205
|
|
|
11536
11206
|
/***/ }),
|
|
11537
11207
|
|
|
11538
|
-
/***/
|
|
11208
|
+
/***/ 4404:
|
|
11539
11209
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
11540
11210
|
|
|
11541
11211
|
"use strict";
|
|
11542
11212
|
|
|
11543
11213
|
|
|
11544
11214
|
const Readable = (__nccwpck_require__(2781).Readable);
|
|
11545
|
-
const lowercaseKeys = __nccwpck_require__(
|
|
11215
|
+
const lowercaseKeys = __nccwpck_require__(2893);
|
|
11546
11216
|
|
|
11547
11217
|
class Response extends Readable {
|
|
11548
11218
|
constructor(statusCode, headers, body, url) {
|
|
@@ -11577,7 +11247,7 @@ module.exports = Response;
|
|
|
11577
11247
|
|
|
11578
11248
|
/***/ }),
|
|
11579
11249
|
|
|
11580
|
-
/***/
|
|
11250
|
+
/***/ 6540:
|
|
11581
11251
|
/***/ ((module) => {
|
|
11582
11252
|
|
|
11583
11253
|
// Returns a wrapper function that returns a wrapped callback
|
|
@@ -11617,15 +11287,14 @@ function wrappy (fn, cb) {
|
|
|
11617
11287
|
|
|
11618
11288
|
/***/ }),
|
|
11619
11289
|
|
|
11620
|
-
/***/
|
|
11290
|
+
/***/ 3933:
|
|
11621
11291
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11622
11292
|
|
|
11623
11293
|
"use strict";
|
|
11624
11294
|
|
|
11625
11295
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11626
|
-
exports.
|
|
11627
|
-
const
|
|
11628
|
-
const util_1 = __nccwpck_require__(809);
|
|
11296
|
+
exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
|
|
11297
|
+
const util_1 = __nccwpck_require__(9973);
|
|
11629
11298
|
exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
11630
11299
|
"invalid_type",
|
|
11631
11300
|
"invalid_literal",
|
|
@@ -11642,6 +11311,7 @@ exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
|
11642
11311
|
"too_big",
|
|
11643
11312
|
"invalid_intersection_types",
|
|
11644
11313
|
"not_multiple_of",
|
|
11314
|
+
"not_finite",
|
|
11645
11315
|
]);
|
|
11646
11316
|
const quotelessJson = (obj) => {
|
|
11647
11317
|
const json = JSON.stringify(obj, null, 2);
|
|
@@ -11725,7 +11395,7 @@ class ZodError extends Error {
|
|
|
11725
11395
|
return this.message;
|
|
11726
11396
|
}
|
|
11727
11397
|
get message() {
|
|
11728
|
-
return JSON.stringify(this.issues,
|
|
11398
|
+
return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
|
|
11729
11399
|
}
|
|
11730
11400
|
get isEmpty() {
|
|
11731
11401
|
return this.issues.length === 0;
|
|
@@ -11753,101 +11423,23 @@ ZodError.create = (issues) => {
|
|
|
11753
11423
|
const error = new ZodError(issues);
|
|
11754
11424
|
return error;
|
|
11755
11425
|
};
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
case exports.ZodIssueCode.invalid_literal:
|
|
11768
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, parseUtil_1.jsonStringifyReplacer)}`;
|
|
11769
|
-
break;
|
|
11770
|
-
case exports.ZodIssueCode.unrecognized_keys:
|
|
11771
|
-
message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
|
|
11772
|
-
break;
|
|
11773
|
-
case exports.ZodIssueCode.invalid_union:
|
|
11774
|
-
message = `Invalid input`;
|
|
11775
|
-
break;
|
|
11776
|
-
case exports.ZodIssueCode.invalid_union_discriminator:
|
|
11777
|
-
message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
|
|
11778
|
-
break;
|
|
11779
|
-
case exports.ZodIssueCode.invalid_enum_value:
|
|
11780
|
-
message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
11781
|
-
break;
|
|
11782
|
-
case exports.ZodIssueCode.invalid_arguments:
|
|
11783
|
-
message = `Invalid function arguments`;
|
|
11784
|
-
break;
|
|
11785
|
-
case exports.ZodIssueCode.invalid_return_type:
|
|
11786
|
-
message = `Invalid function return type`;
|
|
11787
|
-
break;
|
|
11788
|
-
case exports.ZodIssueCode.invalid_date:
|
|
11789
|
-
message = `Invalid date`;
|
|
11790
|
-
break;
|
|
11791
|
-
case exports.ZodIssueCode.invalid_string:
|
|
11792
|
-
if (typeof issue.validation === "object") {
|
|
11793
|
-
if ("startsWith" in issue.validation) {
|
|
11794
|
-
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
11795
|
-
}
|
|
11796
|
-
else if ("endsWith" in issue.validation) {
|
|
11797
|
-
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
11798
|
-
}
|
|
11799
|
-
else {
|
|
11800
|
-
util_1.util.assertNever(issue.validation);
|
|
11801
|
-
}
|
|
11802
|
-
}
|
|
11803
|
-
else if (issue.validation !== "regex") {
|
|
11804
|
-
message = `Invalid ${issue.validation}`;
|
|
11805
|
-
}
|
|
11806
|
-
else {
|
|
11807
|
-
message = "Invalid";
|
|
11808
|
-
}
|
|
11809
|
-
break;
|
|
11810
|
-
case exports.ZodIssueCode.too_small:
|
|
11811
|
-
if (issue.type === "array")
|
|
11812
|
-
message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
11813
|
-
else if (issue.type === "string")
|
|
11814
|
-
message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
11815
|
-
else if (issue.type === "number")
|
|
11816
|
-
message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
|
|
11817
|
-
else if (issue.type === "date")
|
|
11818
|
-
message = `Date must be greater than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.minimum)}`;
|
|
11819
|
-
else
|
|
11820
|
-
message = "Invalid input";
|
|
11821
|
-
break;
|
|
11822
|
-
case exports.ZodIssueCode.too_big:
|
|
11823
|
-
if (issue.type === "array")
|
|
11824
|
-
message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
11825
|
-
else if (issue.type === "string")
|
|
11826
|
-
message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
11827
|
-
else if (issue.type === "number")
|
|
11828
|
-
message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
|
|
11829
|
-
else if (issue.type === "date")
|
|
11830
|
-
message = `Date must be smaller than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.maximum)}`;
|
|
11831
|
-
else
|
|
11832
|
-
message = "Invalid input";
|
|
11833
|
-
break;
|
|
11834
|
-
case exports.ZodIssueCode.custom:
|
|
11835
|
-
message = `Invalid input`;
|
|
11836
|
-
break;
|
|
11837
|
-
case exports.ZodIssueCode.invalid_intersection_types:
|
|
11838
|
-
message = `Intersection results could not be merged`;
|
|
11839
|
-
break;
|
|
11840
|
-
case exports.ZodIssueCode.not_multiple_of:
|
|
11841
|
-
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
11842
|
-
break;
|
|
11843
|
-
default:
|
|
11844
|
-
message = _ctx.defaultError;
|
|
11845
|
-
util_1.util.assertNever(issue);
|
|
11846
|
-
}
|
|
11847
|
-
return { message };
|
|
11426
|
+
|
|
11427
|
+
|
|
11428
|
+
/***/ }),
|
|
11429
|
+
|
|
11430
|
+
/***/ 5391:
|
|
11431
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
11432
|
+
|
|
11433
|
+
"use strict";
|
|
11434
|
+
|
|
11435
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11436
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11848
11437
|
};
|
|
11849
|
-
exports
|
|
11850
|
-
|
|
11438
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11439
|
+
exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
|
|
11440
|
+
const en_1 = __importDefault(__nccwpck_require__(184));
|
|
11441
|
+
exports.defaultErrorMap = en_1.default;
|
|
11442
|
+
let overrideErrorMap = en_1.default;
|
|
11851
11443
|
function setErrorMap(map) {
|
|
11852
11444
|
overrideErrorMap = map;
|
|
11853
11445
|
}
|
|
@@ -11860,7 +11452,7 @@ exports.getErrorMap = getErrorMap;
|
|
|
11860
11452
|
|
|
11861
11453
|
/***/ }),
|
|
11862
11454
|
|
|
11863
|
-
/***/
|
|
11455
|
+
/***/ 7365:
|
|
11864
11456
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
11865
11457
|
|
|
11866
11458
|
"use strict";
|
|
@@ -11876,19 +11468,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11876
11468
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11877
11469
|
};
|
|
11878
11470
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11879
|
-
|
|
11880
|
-
__exportStar(__nccwpck_require__(
|
|
11881
|
-
__exportStar(__nccwpck_require__(
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
__exportStar(__nccwpck_require__(54), exports);
|
|
11886
|
-
__exportStar(__nccwpck_require__(6597), exports);
|
|
11471
|
+
__exportStar(__nccwpck_require__(5391), exports);
|
|
11472
|
+
__exportStar(__nccwpck_require__(3636), exports);
|
|
11473
|
+
__exportStar(__nccwpck_require__(9599), exports);
|
|
11474
|
+
__exportStar(__nccwpck_require__(9973), exports);
|
|
11475
|
+
__exportStar(__nccwpck_require__(7889), exports);
|
|
11476
|
+
__exportStar(__nccwpck_require__(3933), exports);
|
|
11887
11477
|
|
|
11888
11478
|
|
|
11889
11479
|
/***/ }),
|
|
11890
11480
|
|
|
11891
|
-
/***/
|
|
11481
|
+
/***/ 9849:
|
|
11892
11482
|
/***/ ((__unused_webpack_module, exports) => {
|
|
11893
11483
|
|
|
11894
11484
|
"use strict";
|
|
@@ -11904,14 +11494,18 @@ var errorUtil;
|
|
|
11904
11494
|
|
|
11905
11495
|
/***/ }),
|
|
11906
11496
|
|
|
11907
|
-
/***/
|
|
11908
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__)
|
|
11497
|
+
/***/ 3636:
|
|
11498
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
11909
11499
|
|
|
11910
11500
|
"use strict";
|
|
11911
11501
|
|
|
11502
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11503
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11504
|
+
};
|
|
11912
11505
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11913
|
-
exports.
|
|
11914
|
-
const
|
|
11506
|
+
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;
|
|
11507
|
+
const errors_1 = __nccwpck_require__(5391);
|
|
11508
|
+
const en_1 = __importDefault(__nccwpck_require__(184));
|
|
11915
11509
|
const makeIssue = (params) => {
|
|
11916
11510
|
const { data, path, errorMaps, issueData } = params;
|
|
11917
11511
|
const fullPath = [...path, ...(issueData.path || [])];
|
|
@@ -11936,15 +11530,15 @@ const makeIssue = (params) => {
|
|
|
11936
11530
|
exports.makeIssue = makeIssue;
|
|
11937
11531
|
exports.EMPTY_PATH = [];
|
|
11938
11532
|
function addIssueToContext(ctx, issueData) {
|
|
11939
|
-
const issue = exports.makeIssue({
|
|
11533
|
+
const issue = (0, exports.makeIssue)({
|
|
11940
11534
|
issueData: issueData,
|
|
11941
11535
|
data: ctx.data,
|
|
11942
11536
|
path: ctx.path,
|
|
11943
11537
|
errorMaps: [
|
|
11944
11538
|
ctx.common.contextualErrorMap,
|
|
11945
11539
|
ctx.schemaErrorMap,
|
|
11946
|
-
|
|
11947
|
-
|
|
11540
|
+
(0, errors_1.getErrorMap)(),
|
|
11541
|
+
en_1.default, // then global default map
|
|
11948
11542
|
].filter((x) => !!x),
|
|
11949
11543
|
});
|
|
11950
11544
|
ctx.common.issues.push(issue);
|
|
@@ -12018,18 +11612,11 @@ const isValid = (x) => x.status === "valid";
|
|
|
12018
11612
|
exports.isValid = isValid;
|
|
12019
11613
|
const isAsync = (x) => typeof Promise !== undefined && x instanceof Promise;
|
|
12020
11614
|
exports.isAsync = isAsync;
|
|
12021
|
-
const jsonStringifyReplacer = (_, value) => {
|
|
12022
|
-
if (typeof value === "bigint") {
|
|
12023
|
-
return value.toString();
|
|
12024
|
-
}
|
|
12025
|
-
return value;
|
|
12026
|
-
};
|
|
12027
|
-
exports.jsonStringifyReplacer = jsonStringifyReplacer;
|
|
12028
11615
|
|
|
12029
11616
|
|
|
12030
11617
|
/***/ }),
|
|
12031
11618
|
|
|
12032
|
-
/***/
|
|
11619
|
+
/***/ 9599:
|
|
12033
11620
|
/***/ ((__unused_webpack_module, exports) => {
|
|
12034
11621
|
|
|
12035
11622
|
"use strict";
|
|
@@ -12039,7 +11626,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
12039
11626
|
|
|
12040
11627
|
/***/ }),
|
|
12041
11628
|
|
|
12042
|
-
/***/
|
|
11629
|
+
/***/ 9973:
|
|
12043
11630
|
/***/ ((__unused_webpack_module, exports) => {
|
|
12044
11631
|
|
|
12045
11632
|
"use strict";
|
|
@@ -12102,6 +11689,12 @@ var util;
|
|
|
12102
11689
|
.join(separator);
|
|
12103
11690
|
}
|
|
12104
11691
|
util.joinValues = joinValues;
|
|
11692
|
+
util.jsonStringifyReplacer = (_, value) => {
|
|
11693
|
+
if (typeof value === "bigint") {
|
|
11694
|
+
return value.toString();
|
|
11695
|
+
}
|
|
11696
|
+
return value;
|
|
11697
|
+
};
|
|
12105
11698
|
})(util = exports.util || (exports.util = {}));
|
|
12106
11699
|
exports.ZodParsedType = util.arrayToEnum([
|
|
12107
11700
|
"string",
|
|
@@ -12140,6 +11733,8 @@ const getParsedType = (data) => {
|
|
|
12140
11733
|
return exports.ZodParsedType.function;
|
|
12141
11734
|
case "bigint":
|
|
12142
11735
|
return exports.ZodParsedType.bigint;
|
|
11736
|
+
case "symbol":
|
|
11737
|
+
return exports.ZodParsedType.symbol;
|
|
12143
11738
|
case "object":
|
|
12144
11739
|
if (Array.isArray(data)) {
|
|
12145
11740
|
return exports.ZodParsedType.array;
|
|
@@ -12172,7 +11767,7 @@ exports.getParsedType = getParsedType;
|
|
|
12172
11767
|
|
|
12173
11768
|
/***/ }),
|
|
12174
11769
|
|
|
12175
|
-
/***/
|
|
11770
|
+
/***/ 6319:
|
|
12176
11771
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
12177
11772
|
|
|
12178
11773
|
"use strict";
|
|
@@ -12201,26 +11796,152 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12201
11796
|
};
|
|
12202
11797
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12203
11798
|
exports.z = void 0;
|
|
12204
|
-
const mod = __importStar(__nccwpck_require__(
|
|
11799
|
+
const mod = __importStar(__nccwpck_require__(7365));
|
|
12205
11800
|
exports.z = mod;
|
|
12206
|
-
__exportStar(__nccwpck_require__(
|
|
11801
|
+
__exportStar(__nccwpck_require__(7365), exports);
|
|
12207
11802
|
exports["default"] = mod;
|
|
12208
11803
|
|
|
12209
11804
|
|
|
12210
11805
|
/***/ }),
|
|
12211
11806
|
|
|
12212
|
-
/***/
|
|
11807
|
+
/***/ 184:
|
|
11808
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11809
|
+
|
|
11810
|
+
"use strict";
|
|
11811
|
+
|
|
11812
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11813
|
+
const util_1 = __nccwpck_require__(9973);
|
|
11814
|
+
const ZodError_1 = __nccwpck_require__(3933);
|
|
11815
|
+
const errorMap = (issue, _ctx) => {
|
|
11816
|
+
let message;
|
|
11817
|
+
switch (issue.code) {
|
|
11818
|
+
case ZodError_1.ZodIssueCode.invalid_type:
|
|
11819
|
+
if (issue.received === util_1.ZodParsedType.undefined) {
|
|
11820
|
+
message = "Required";
|
|
11821
|
+
}
|
|
11822
|
+
else {
|
|
11823
|
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
11824
|
+
}
|
|
11825
|
+
break;
|
|
11826
|
+
case ZodError_1.ZodIssueCode.invalid_literal:
|
|
11827
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;
|
|
11828
|
+
break;
|
|
11829
|
+
case ZodError_1.ZodIssueCode.unrecognized_keys:
|
|
11830
|
+
message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
|
|
11831
|
+
break;
|
|
11832
|
+
case ZodError_1.ZodIssueCode.invalid_union:
|
|
11833
|
+
message = `Invalid input`;
|
|
11834
|
+
break;
|
|
11835
|
+
case ZodError_1.ZodIssueCode.invalid_union_discriminator:
|
|
11836
|
+
message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
|
|
11837
|
+
break;
|
|
11838
|
+
case ZodError_1.ZodIssueCode.invalid_enum_value:
|
|
11839
|
+
message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
11840
|
+
break;
|
|
11841
|
+
case ZodError_1.ZodIssueCode.invalid_arguments:
|
|
11842
|
+
message = `Invalid function arguments`;
|
|
11843
|
+
break;
|
|
11844
|
+
case ZodError_1.ZodIssueCode.invalid_return_type:
|
|
11845
|
+
message = `Invalid function return type`;
|
|
11846
|
+
break;
|
|
11847
|
+
case ZodError_1.ZodIssueCode.invalid_date:
|
|
11848
|
+
message = `Invalid date`;
|
|
11849
|
+
break;
|
|
11850
|
+
case ZodError_1.ZodIssueCode.invalid_string:
|
|
11851
|
+
if (typeof issue.validation === "object") {
|
|
11852
|
+
if ("startsWith" in issue.validation) {
|
|
11853
|
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
11854
|
+
}
|
|
11855
|
+
else if ("endsWith" in issue.validation) {
|
|
11856
|
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
11857
|
+
}
|
|
11858
|
+
else {
|
|
11859
|
+
util_1.util.assertNever(issue.validation);
|
|
11860
|
+
}
|
|
11861
|
+
}
|
|
11862
|
+
else if (issue.validation !== "regex") {
|
|
11863
|
+
message = `Invalid ${issue.validation}`;
|
|
11864
|
+
}
|
|
11865
|
+
else {
|
|
11866
|
+
message = "Invalid";
|
|
11867
|
+
}
|
|
11868
|
+
break;
|
|
11869
|
+
case ZodError_1.ZodIssueCode.too_small:
|
|
11870
|
+
if (issue.type === "array")
|
|
11871
|
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
11872
|
+
else if (issue.type === "string")
|
|
11873
|
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
11874
|
+
else if (issue.type === "number")
|
|
11875
|
+
message = `Number must be ${issue.exact
|
|
11876
|
+
? `exactly equal to `
|
|
11877
|
+
: issue.inclusive
|
|
11878
|
+
? `greater than or equal to `
|
|
11879
|
+
: `greater than `}${issue.minimum}`;
|
|
11880
|
+
else if (issue.type === "date")
|
|
11881
|
+
message = `Date must be ${issue.exact
|
|
11882
|
+
? `exactly equal to `
|
|
11883
|
+
: issue.inclusive
|
|
11884
|
+
? `greater than or equal to `
|
|
11885
|
+
: `greater than `}${new Date(issue.minimum)}`;
|
|
11886
|
+
else
|
|
11887
|
+
message = "Invalid input";
|
|
11888
|
+
break;
|
|
11889
|
+
case ZodError_1.ZodIssueCode.too_big:
|
|
11890
|
+
if (issue.type === "array")
|
|
11891
|
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
11892
|
+
else if (issue.type === "string")
|
|
11893
|
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
11894
|
+
else if (issue.type === "number")
|
|
11895
|
+
message = `Number must be ${issue.exact
|
|
11896
|
+
? `exactly`
|
|
11897
|
+
: issue.inclusive
|
|
11898
|
+
? `less than or equal to`
|
|
11899
|
+
: `less than`} ${issue.maximum}`;
|
|
11900
|
+
else if (issue.type === "date")
|
|
11901
|
+
message = `Date must be ${issue.exact
|
|
11902
|
+
? `exactly`
|
|
11903
|
+
: issue.inclusive
|
|
11904
|
+
? `smaller than or equal to`
|
|
11905
|
+
: `smaller than`} ${new Date(issue.maximum)}`;
|
|
11906
|
+
else
|
|
11907
|
+
message = "Invalid input";
|
|
11908
|
+
break;
|
|
11909
|
+
case ZodError_1.ZodIssueCode.custom:
|
|
11910
|
+
message = `Invalid input`;
|
|
11911
|
+
break;
|
|
11912
|
+
case ZodError_1.ZodIssueCode.invalid_intersection_types:
|
|
11913
|
+
message = `Intersection results could not be merged`;
|
|
11914
|
+
break;
|
|
11915
|
+
case ZodError_1.ZodIssueCode.not_multiple_of:
|
|
11916
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
11917
|
+
break;
|
|
11918
|
+
case ZodError_1.ZodIssueCode.not_finite:
|
|
11919
|
+
message = "Number must be finite";
|
|
11920
|
+
break;
|
|
11921
|
+
default:
|
|
11922
|
+
message = _ctx.defaultError;
|
|
11923
|
+
util_1.util.assertNever(issue);
|
|
11924
|
+
}
|
|
11925
|
+
return { message };
|
|
11926
|
+
};
|
|
11927
|
+
exports["default"] = errorMap;
|
|
11928
|
+
|
|
11929
|
+
|
|
11930
|
+
/***/ }),
|
|
11931
|
+
|
|
11932
|
+
/***/ 7889:
|
|
12213
11933
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
12214
11934
|
|
|
12215
11935
|
"use strict";
|
|
12216
11936
|
|
|
12217
11937
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12218
|
-
exports
|
|
12219
|
-
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;
|
|
12220
|
-
const
|
|
12221
|
-
const
|
|
12222
|
-
const
|
|
12223
|
-
const
|
|
11938
|
+
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;
|
|
11939
|
+
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;
|
|
11940
|
+
const errors_1 = __nccwpck_require__(5391);
|
|
11941
|
+
const errorUtil_1 = __nccwpck_require__(9849);
|
|
11942
|
+
const parseUtil_1 = __nccwpck_require__(3636);
|
|
11943
|
+
const util_1 = __nccwpck_require__(9973);
|
|
11944
|
+
const ZodError_1 = __nccwpck_require__(3933);
|
|
12224
11945
|
class ParseInputLazyPath {
|
|
12225
11946
|
constructor(parent, value, path, key) {
|
|
12226
11947
|
this.parent = parent;
|
|
@@ -12233,7 +11954,7 @@ class ParseInputLazyPath {
|
|
|
12233
11954
|
}
|
|
12234
11955
|
}
|
|
12235
11956
|
const handleResult = (ctx, result) => {
|
|
12236
|
-
if (parseUtil_1.isValid(result)) {
|
|
11957
|
+
if ((0, parseUtil_1.isValid)(result)) {
|
|
12237
11958
|
return { success: true, data: result.value };
|
|
12238
11959
|
}
|
|
12239
11960
|
else {
|
|
@@ -12249,7 +11970,7 @@ function processCreateParams(params) {
|
|
|
12249
11970
|
return {};
|
|
12250
11971
|
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
12251
11972
|
if (errorMap && (invalid_type_error || required_error)) {
|
|
12252
|
-
throw new Error(`Can't use "
|
|
11973
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
12253
11974
|
}
|
|
12254
11975
|
if (errorMap)
|
|
12255
11976
|
return { errorMap: errorMap, description };
|
|
@@ -12267,7 +11988,6 @@ class ZodType {
|
|
|
12267
11988
|
constructor(def) {
|
|
12268
11989
|
/** Alias of safeParseAsync */
|
|
12269
11990
|
this.spa = this.safeParseAsync;
|
|
12270
|
-
this.superRefine = this._refinement;
|
|
12271
11991
|
this._def = def;
|
|
12272
11992
|
this.parse = this.parse.bind(this);
|
|
12273
11993
|
this.safeParse = this.safeParse.bind(this);
|
|
@@ -12285,8 +12005,11 @@ class ZodType {
|
|
|
12285
12005
|
this.or = this.or.bind(this);
|
|
12286
12006
|
this.and = this.and.bind(this);
|
|
12287
12007
|
this.transform = this.transform.bind(this);
|
|
12008
|
+
this.brand = this.brand.bind(this);
|
|
12288
12009
|
this.default = this.default.bind(this);
|
|
12010
|
+
this.catch = this.catch.bind(this);
|
|
12289
12011
|
this.describe = this.describe.bind(this);
|
|
12012
|
+
this.pipe = this.pipe.bind(this);
|
|
12290
12013
|
this.isNullable = this.isNullable.bind(this);
|
|
12291
12014
|
this.isOptional = this.isOptional.bind(this);
|
|
12292
12015
|
}
|
|
@@ -12294,13 +12017,13 @@ class ZodType {
|
|
|
12294
12017
|
return this._def.description;
|
|
12295
12018
|
}
|
|
12296
12019
|
_getType(input) {
|
|
12297
|
-
return util_1.getParsedType(input.data);
|
|
12020
|
+
return (0, util_1.getParsedType)(input.data);
|
|
12298
12021
|
}
|
|
12299
12022
|
_getOrReturnCtx(input, ctx) {
|
|
12300
12023
|
return (ctx || {
|
|
12301
12024
|
common: input.parent.common,
|
|
12302
12025
|
data: input.data,
|
|
12303
|
-
parsedType: util_1.getParsedType(input.data),
|
|
12026
|
+
parsedType: (0, util_1.getParsedType)(input.data),
|
|
12304
12027
|
schemaErrorMap: this._def.errorMap,
|
|
12305
12028
|
path: input.path,
|
|
12306
12029
|
parent: input.parent,
|
|
@@ -12312,7 +12035,7 @@ class ZodType {
|
|
|
12312
12035
|
ctx: {
|
|
12313
12036
|
common: input.parent.common,
|
|
12314
12037
|
data: input.data,
|
|
12315
|
-
parsedType: util_1.getParsedType(input.data),
|
|
12038
|
+
parsedType: (0, util_1.getParsedType)(input.data),
|
|
12316
12039
|
schemaErrorMap: this._def.errorMap,
|
|
12317
12040
|
path: input.path,
|
|
12318
12041
|
parent: input.parent,
|
|
@@ -12321,7 +12044,7 @@ class ZodType {
|
|
|
12321
12044
|
}
|
|
12322
12045
|
_parseSync(input) {
|
|
12323
12046
|
const result = this._parse(input);
|
|
12324
|
-
if (parseUtil_1.isAsync(result)) {
|
|
12047
|
+
if ((0, parseUtil_1.isAsync)(result)) {
|
|
12325
12048
|
throw new Error("Synchronous parse encountered promise.");
|
|
12326
12049
|
}
|
|
12327
12050
|
return result;
|
|
@@ -12348,7 +12071,7 @@ class ZodType {
|
|
|
12348
12071
|
schemaErrorMap: this._def.errorMap,
|
|
12349
12072
|
parent: null,
|
|
12350
12073
|
data,
|
|
12351
|
-
parsedType: util_1.getParsedType(data),
|
|
12074
|
+
parsedType: (0, util_1.getParsedType)(data),
|
|
12352
12075
|
};
|
|
12353
12076
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
12354
12077
|
return handleResult(ctx, result);
|
|
@@ -12370,10 +12093,10 @@ class ZodType {
|
|
|
12370
12093
|
schemaErrorMap: this._def.errorMap,
|
|
12371
12094
|
parent: null,
|
|
12372
12095
|
data,
|
|
12373
|
-
parsedType: util_1.getParsedType(data),
|
|
12096
|
+
parsedType: (0, util_1.getParsedType)(data),
|
|
12374
12097
|
};
|
|
12375
|
-
const maybeAsyncResult = this._parse({ data, path:
|
|
12376
|
-
const result = await (parseUtil_1.isAsync(maybeAsyncResult)
|
|
12098
|
+
const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
|
|
12099
|
+
const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)
|
|
12377
12100
|
? maybeAsyncResult
|
|
12378
12101
|
: Promise.resolve(maybeAsyncResult));
|
|
12379
12102
|
return handleResult(ctx, result);
|
|
@@ -12436,6 +12159,9 @@ class ZodType {
|
|
|
12436
12159
|
effect: { type: "refinement", refinement },
|
|
12437
12160
|
});
|
|
12438
12161
|
}
|
|
12162
|
+
superRefine(refinement) {
|
|
12163
|
+
return this._refinement(refinement);
|
|
12164
|
+
}
|
|
12439
12165
|
optional() {
|
|
12440
12166
|
return ZodOptional.create(this);
|
|
12441
12167
|
}
|
|
@@ -12479,6 +12205,14 @@ class ZodType {
|
|
|
12479
12205
|
...processCreateParams(undefined),
|
|
12480
12206
|
});
|
|
12481
12207
|
}
|
|
12208
|
+
catch(def) {
|
|
12209
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
12210
|
+
return new ZodCatch({
|
|
12211
|
+
innerType: this,
|
|
12212
|
+
defaultValue: defaultValueFunc,
|
|
12213
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
12214
|
+
});
|
|
12215
|
+
}
|
|
12482
12216
|
describe(description) {
|
|
12483
12217
|
const This = this.constructor;
|
|
12484
12218
|
return new This({
|
|
@@ -12486,6 +12220,9 @@ class ZodType {
|
|
|
12486
12220
|
description,
|
|
12487
12221
|
});
|
|
12488
12222
|
}
|
|
12223
|
+
pipe(target) {
|
|
12224
|
+
return ZodPipeline.create(this, target);
|
|
12225
|
+
}
|
|
12489
12226
|
isOptional() {
|
|
12490
12227
|
return this.safeParse(undefined).success;
|
|
12491
12228
|
}
|
|
@@ -12503,6 +12240,39 @@ const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-
|
|
|
12503
12240
|
// 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;
|
|
12504
12241
|
// eslint-disable-next-line
|
|
12505
12242
|
const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
|
12243
|
+
// interface IsDateStringOptions extends StringDateOptions {
|
|
12244
|
+
/**
|
|
12245
|
+
* Match any configuration
|
|
12246
|
+
*/
|
|
12247
|
+
// any?: boolean;
|
|
12248
|
+
// }
|
|
12249
|
+
// Adapted from https://stackoverflow.com/a/3143231
|
|
12250
|
+
const datetimeRegex = (args) => {
|
|
12251
|
+
if (args.precision) {
|
|
12252
|
+
if (args.offset) {
|
|
12253
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
12254
|
+
}
|
|
12255
|
+
else {
|
|
12256
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
12257
|
+
}
|
|
12258
|
+
}
|
|
12259
|
+
else if (args.precision === 0) {
|
|
12260
|
+
if (args.offset) {
|
|
12261
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
12262
|
+
}
|
|
12263
|
+
else {
|
|
12264
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
12265
|
+
}
|
|
12266
|
+
}
|
|
12267
|
+
else {
|
|
12268
|
+
if (args.offset) {
|
|
12269
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
12270
|
+
}
|
|
12271
|
+
else {
|
|
12272
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
12273
|
+
}
|
|
12274
|
+
}
|
|
12275
|
+
};
|
|
12506
12276
|
class ZodString extends ZodType {
|
|
12507
12277
|
constructor() {
|
|
12508
12278
|
super(...arguments);
|
|
@@ -12522,10 +12292,13 @@ class ZodString extends ZodType {
|
|
|
12522
12292
|
});
|
|
12523
12293
|
}
|
|
12524
12294
|
_parse(input) {
|
|
12295
|
+
if (this._def.coerce) {
|
|
12296
|
+
input.data = String(input.data);
|
|
12297
|
+
}
|
|
12525
12298
|
const parsedType = this._getType(input);
|
|
12526
12299
|
if (parsedType !== util_1.ZodParsedType.string) {
|
|
12527
12300
|
const ctx = this._getOrReturnCtx(input);
|
|
12528
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12301
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12529
12302
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
12530
12303
|
expected: util_1.ZodParsedType.string,
|
|
12531
12304
|
received: ctx.parsedType,
|
|
@@ -12540,11 +12313,12 @@ class ZodString extends ZodType {
|
|
|
12540
12313
|
if (check.kind === "min") {
|
|
12541
12314
|
if (input.data.length < check.value) {
|
|
12542
12315
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12543
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12316
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12544
12317
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
12545
12318
|
minimum: check.value,
|
|
12546
12319
|
type: "string",
|
|
12547
12320
|
inclusive: true,
|
|
12321
|
+
exact: false,
|
|
12548
12322
|
message: check.message,
|
|
12549
12323
|
});
|
|
12550
12324
|
status.dirty();
|
|
@@ -12553,20 +12327,49 @@ class ZodString extends ZodType {
|
|
|
12553
12327
|
else if (check.kind === "max") {
|
|
12554
12328
|
if (input.data.length > check.value) {
|
|
12555
12329
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12556
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12330
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12557
12331
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
12558
12332
|
maximum: check.value,
|
|
12559
12333
|
type: "string",
|
|
12560
12334
|
inclusive: true,
|
|
12335
|
+
exact: false,
|
|
12561
12336
|
message: check.message,
|
|
12562
12337
|
});
|
|
12563
12338
|
status.dirty();
|
|
12564
12339
|
}
|
|
12565
12340
|
}
|
|
12341
|
+
else if (check.kind === "length") {
|
|
12342
|
+
const tooBig = input.data.length > check.value;
|
|
12343
|
+
const tooSmall = input.data.length < check.value;
|
|
12344
|
+
if (tooBig || tooSmall) {
|
|
12345
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
12346
|
+
if (tooBig) {
|
|
12347
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12348
|
+
code: ZodError_1.ZodIssueCode.too_big,
|
|
12349
|
+
maximum: check.value,
|
|
12350
|
+
type: "string",
|
|
12351
|
+
inclusive: true,
|
|
12352
|
+
exact: true,
|
|
12353
|
+
message: check.message,
|
|
12354
|
+
});
|
|
12355
|
+
}
|
|
12356
|
+
else if (tooSmall) {
|
|
12357
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12358
|
+
code: ZodError_1.ZodIssueCode.too_small,
|
|
12359
|
+
minimum: check.value,
|
|
12360
|
+
type: "string",
|
|
12361
|
+
inclusive: true,
|
|
12362
|
+
exact: true,
|
|
12363
|
+
message: check.message,
|
|
12364
|
+
});
|
|
12365
|
+
}
|
|
12366
|
+
status.dirty();
|
|
12367
|
+
}
|
|
12368
|
+
}
|
|
12566
12369
|
else if (check.kind === "email") {
|
|
12567
12370
|
if (!emailRegex.test(input.data)) {
|
|
12568
12371
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12569
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12372
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12570
12373
|
validation: "email",
|
|
12571
12374
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12572
12375
|
message: check.message,
|
|
@@ -12577,7 +12380,7 @@ class ZodString extends ZodType {
|
|
|
12577
12380
|
else if (check.kind === "uuid") {
|
|
12578
12381
|
if (!uuidRegex.test(input.data)) {
|
|
12579
12382
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12580
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12383
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12581
12384
|
validation: "uuid",
|
|
12582
12385
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12583
12386
|
message: check.message,
|
|
@@ -12588,7 +12391,7 @@ class ZodString extends ZodType {
|
|
|
12588
12391
|
else if (check.kind === "cuid") {
|
|
12589
12392
|
if (!cuidRegex.test(input.data)) {
|
|
12590
12393
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12591
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12394
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12592
12395
|
validation: "cuid",
|
|
12593
12396
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12594
12397
|
message: check.message,
|
|
@@ -12602,7 +12405,7 @@ class ZodString extends ZodType {
|
|
|
12602
12405
|
}
|
|
12603
12406
|
catch (_a) {
|
|
12604
12407
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12605
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12408
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12606
12409
|
validation: "url",
|
|
12607
12410
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12608
12411
|
message: check.message,
|
|
@@ -12615,7 +12418,7 @@ class ZodString extends ZodType {
|
|
|
12615
12418
|
const testResult = check.regex.test(input.data);
|
|
12616
12419
|
if (!testResult) {
|
|
12617
12420
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12618
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12421
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12619
12422
|
validation: "regex",
|
|
12620
12423
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12621
12424
|
message: check.message,
|
|
@@ -12629,7 +12432,7 @@ class ZodString extends ZodType {
|
|
|
12629
12432
|
else if (check.kind === "startsWith") {
|
|
12630
12433
|
if (!input.data.startsWith(check.value)) {
|
|
12631
12434
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12632
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12435
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12633
12436
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12634
12437
|
validation: { startsWith: check.value },
|
|
12635
12438
|
message: check.message,
|
|
@@ -12640,7 +12443,7 @@ class ZodString extends ZodType {
|
|
|
12640
12443
|
else if (check.kind === "endsWith") {
|
|
12641
12444
|
if (!input.data.endsWith(check.value)) {
|
|
12642
12445
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12643
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12446
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12644
12447
|
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12645
12448
|
validation: { endsWith: check.value },
|
|
12646
12449
|
message: check.message,
|
|
@@ -12648,6 +12451,18 @@ class ZodString extends ZodType {
|
|
|
12648
12451
|
status.dirty();
|
|
12649
12452
|
}
|
|
12650
12453
|
}
|
|
12454
|
+
else if (check.kind === "datetime") {
|
|
12455
|
+
const regex = datetimeRegex(check);
|
|
12456
|
+
if (!regex.test(input.data)) {
|
|
12457
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
12458
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12459
|
+
code: ZodError_1.ZodIssueCode.invalid_string,
|
|
12460
|
+
validation: "datetime",
|
|
12461
|
+
message: check.message,
|
|
12462
|
+
});
|
|
12463
|
+
status.dirty();
|
|
12464
|
+
}
|
|
12465
|
+
}
|
|
12651
12466
|
else {
|
|
12652
12467
|
util_1.util.assertNever(check);
|
|
12653
12468
|
}
|
|
@@ -12672,6 +12487,23 @@ class ZodString extends ZodType {
|
|
|
12672
12487
|
cuid(message) {
|
|
12673
12488
|
return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
|
|
12674
12489
|
}
|
|
12490
|
+
datetime(options) {
|
|
12491
|
+
var _a;
|
|
12492
|
+
if (typeof options === "string") {
|
|
12493
|
+
return this._addCheck({
|
|
12494
|
+
kind: "datetime",
|
|
12495
|
+
precision: null,
|
|
12496
|
+
offset: false,
|
|
12497
|
+
message: options,
|
|
12498
|
+
});
|
|
12499
|
+
}
|
|
12500
|
+
return this._addCheck({
|
|
12501
|
+
kind: "datetime",
|
|
12502
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
12503
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
12504
|
+
...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
|
|
12505
|
+
});
|
|
12506
|
+
}
|
|
12675
12507
|
regex(regex, message) {
|
|
12676
12508
|
return this._addCheck({
|
|
12677
12509
|
kind: "regex",
|
|
@@ -12708,7 +12540,14 @@ class ZodString extends ZodType {
|
|
|
12708
12540
|
});
|
|
12709
12541
|
}
|
|
12710
12542
|
length(len, message) {
|
|
12711
|
-
return this.
|
|
12543
|
+
return this._addCheck({
|
|
12544
|
+
kind: "length",
|
|
12545
|
+
value: len,
|
|
12546
|
+
...errorUtil_1.errorUtil.errToObj(message),
|
|
12547
|
+
});
|
|
12548
|
+
}
|
|
12549
|
+
get isDatetime() {
|
|
12550
|
+
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
12712
12551
|
}
|
|
12713
12552
|
get isEmail() {
|
|
12714
12553
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
@@ -12745,9 +12584,11 @@ class ZodString extends ZodType {
|
|
|
12745
12584
|
}
|
|
12746
12585
|
exports.ZodString = ZodString;
|
|
12747
12586
|
ZodString.create = (params) => {
|
|
12587
|
+
var _a;
|
|
12748
12588
|
return new ZodString({
|
|
12749
12589
|
checks: [],
|
|
12750
12590
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
12591
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
12751
12592
|
...processCreateParams(params),
|
|
12752
12593
|
});
|
|
12753
12594
|
};
|
|
@@ -12768,10 +12609,13 @@ class ZodNumber extends ZodType {
|
|
|
12768
12609
|
this.step = this.multipleOf;
|
|
12769
12610
|
}
|
|
12770
12611
|
_parse(input) {
|
|
12612
|
+
if (this._def.coerce) {
|
|
12613
|
+
input.data = Number(input.data);
|
|
12614
|
+
}
|
|
12771
12615
|
const parsedType = this._getType(input);
|
|
12772
12616
|
if (parsedType !== util_1.ZodParsedType.number) {
|
|
12773
12617
|
const ctx = this._getOrReturnCtx(input);
|
|
12774
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12618
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12775
12619
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
12776
12620
|
expected: util_1.ZodParsedType.number,
|
|
12777
12621
|
received: ctx.parsedType,
|
|
@@ -12784,7 +12628,7 @@ class ZodNumber extends ZodType {
|
|
|
12784
12628
|
if (check.kind === "int") {
|
|
12785
12629
|
if (!util_1.util.isInteger(input.data)) {
|
|
12786
12630
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12787
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12631
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12788
12632
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
12789
12633
|
expected: "integer",
|
|
12790
12634
|
received: "float",
|
|
@@ -12799,11 +12643,12 @@ class ZodNumber extends ZodType {
|
|
|
12799
12643
|
: input.data <= check.value;
|
|
12800
12644
|
if (tooSmall) {
|
|
12801
12645
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12802
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12646
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12803
12647
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
12804
12648
|
minimum: check.value,
|
|
12805
12649
|
type: "number",
|
|
12806
12650
|
inclusive: check.inclusive,
|
|
12651
|
+
exact: false,
|
|
12807
12652
|
message: check.message,
|
|
12808
12653
|
});
|
|
12809
12654
|
status.dirty();
|
|
@@ -12815,11 +12660,12 @@ class ZodNumber extends ZodType {
|
|
|
12815
12660
|
: input.data >= check.value;
|
|
12816
12661
|
if (tooBig) {
|
|
12817
12662
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12818
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12663
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12819
12664
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
12820
12665
|
maximum: check.value,
|
|
12821
12666
|
type: "number",
|
|
12822
12667
|
inclusive: check.inclusive,
|
|
12668
|
+
exact: false,
|
|
12823
12669
|
message: check.message,
|
|
12824
12670
|
});
|
|
12825
12671
|
status.dirty();
|
|
@@ -12828,7 +12674,7 @@ class ZodNumber extends ZodType {
|
|
|
12828
12674
|
else if (check.kind === "multipleOf") {
|
|
12829
12675
|
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
|
12830
12676
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
12831
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12677
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12832
12678
|
code: ZodError_1.ZodIssueCode.not_multiple_of,
|
|
12833
12679
|
multipleOf: check.value,
|
|
12834
12680
|
message: check.message,
|
|
@@ -12836,6 +12682,16 @@ class ZodNumber extends ZodType {
|
|
|
12836
12682
|
status.dirty();
|
|
12837
12683
|
}
|
|
12838
12684
|
}
|
|
12685
|
+
else if (check.kind === "finite") {
|
|
12686
|
+
if (!Number.isFinite(input.data)) {
|
|
12687
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
12688
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12689
|
+
code: ZodError_1.ZodIssueCode.not_finite,
|
|
12690
|
+
message: check.message,
|
|
12691
|
+
});
|
|
12692
|
+
status.dirty();
|
|
12693
|
+
}
|
|
12694
|
+
}
|
|
12839
12695
|
else {
|
|
12840
12696
|
util_1.util.assertNever(check);
|
|
12841
12697
|
}
|
|
@@ -12919,6 +12775,12 @@ class ZodNumber extends ZodType {
|
|
|
12919
12775
|
message: errorUtil_1.errorUtil.toString(message),
|
|
12920
12776
|
});
|
|
12921
12777
|
}
|
|
12778
|
+
finite(message) {
|
|
12779
|
+
return this._addCheck({
|
|
12780
|
+
kind: "finite",
|
|
12781
|
+
message: errorUtil_1.errorUtil.toString(message),
|
|
12782
|
+
});
|
|
12783
|
+
}
|
|
12922
12784
|
get minValue() {
|
|
12923
12785
|
let min = null;
|
|
12924
12786
|
for (const ch of this._def.checks) {
|
|
@@ -12948,59 +12810,72 @@ ZodNumber.create = (params) => {
|
|
|
12948
12810
|
return new ZodNumber({
|
|
12949
12811
|
checks: [],
|
|
12950
12812
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
12813
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
12951
12814
|
...processCreateParams(params),
|
|
12952
12815
|
});
|
|
12953
12816
|
};
|
|
12954
12817
|
class ZodBigInt extends ZodType {
|
|
12955
12818
|
_parse(input) {
|
|
12819
|
+
if (this._def.coerce) {
|
|
12820
|
+
input.data = BigInt(input.data);
|
|
12821
|
+
}
|
|
12956
12822
|
const parsedType = this._getType(input);
|
|
12957
12823
|
if (parsedType !== util_1.ZodParsedType.bigint) {
|
|
12958
12824
|
const ctx = this._getOrReturnCtx(input);
|
|
12959
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12825
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12960
12826
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
12961
12827
|
expected: util_1.ZodParsedType.bigint,
|
|
12962
12828
|
received: ctx.parsedType,
|
|
12963
12829
|
});
|
|
12964
12830
|
return parseUtil_1.INVALID;
|
|
12965
12831
|
}
|
|
12966
|
-
return parseUtil_1.OK(input.data);
|
|
12832
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
12967
12833
|
}
|
|
12968
12834
|
}
|
|
12969
12835
|
exports.ZodBigInt = ZodBigInt;
|
|
12970
12836
|
ZodBigInt.create = (params) => {
|
|
12837
|
+
var _a;
|
|
12971
12838
|
return new ZodBigInt({
|
|
12972
12839
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
12840
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
12973
12841
|
...processCreateParams(params),
|
|
12974
12842
|
});
|
|
12975
12843
|
};
|
|
12976
12844
|
class ZodBoolean extends ZodType {
|
|
12977
12845
|
_parse(input) {
|
|
12846
|
+
if (this._def.coerce) {
|
|
12847
|
+
input.data = Boolean(input.data);
|
|
12848
|
+
}
|
|
12978
12849
|
const parsedType = this._getType(input);
|
|
12979
12850
|
if (parsedType !== util_1.ZodParsedType.boolean) {
|
|
12980
12851
|
const ctx = this._getOrReturnCtx(input);
|
|
12981
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12852
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12982
12853
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
12983
12854
|
expected: util_1.ZodParsedType.boolean,
|
|
12984
12855
|
received: ctx.parsedType,
|
|
12985
12856
|
});
|
|
12986
12857
|
return parseUtil_1.INVALID;
|
|
12987
12858
|
}
|
|
12988
|
-
return parseUtil_1.OK(input.data);
|
|
12859
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
12989
12860
|
}
|
|
12990
12861
|
}
|
|
12991
12862
|
exports.ZodBoolean = ZodBoolean;
|
|
12992
12863
|
ZodBoolean.create = (params) => {
|
|
12993
12864
|
return new ZodBoolean({
|
|
12994
12865
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
12866
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
12995
12867
|
...processCreateParams(params),
|
|
12996
12868
|
});
|
|
12997
12869
|
};
|
|
12998
12870
|
class ZodDate extends ZodType {
|
|
12999
12871
|
_parse(input) {
|
|
12872
|
+
if (this._def.coerce) {
|
|
12873
|
+
input.data = new Date(input.data);
|
|
12874
|
+
}
|
|
13000
12875
|
const parsedType = this._getType(input);
|
|
13001
12876
|
if (parsedType !== util_1.ZodParsedType.date) {
|
|
13002
12877
|
const ctx = this._getOrReturnCtx(input);
|
|
13003
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12878
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13004
12879
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13005
12880
|
expected: util_1.ZodParsedType.date,
|
|
13006
12881
|
received: ctx.parsedType,
|
|
@@ -13009,7 +12884,7 @@ class ZodDate extends ZodType {
|
|
|
13009
12884
|
}
|
|
13010
12885
|
if (isNaN(input.data.getTime())) {
|
|
13011
12886
|
const ctx = this._getOrReturnCtx(input);
|
|
13012
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12887
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13013
12888
|
code: ZodError_1.ZodIssueCode.invalid_date,
|
|
13014
12889
|
});
|
|
13015
12890
|
return parseUtil_1.INVALID;
|
|
@@ -13020,10 +12895,11 @@ class ZodDate extends ZodType {
|
|
|
13020
12895
|
if (check.kind === "min") {
|
|
13021
12896
|
if (input.data.getTime() < check.value) {
|
|
13022
12897
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13023
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12898
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13024
12899
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13025
12900
|
message: check.message,
|
|
13026
12901
|
inclusive: true,
|
|
12902
|
+
exact: false,
|
|
13027
12903
|
minimum: check.value,
|
|
13028
12904
|
type: "date",
|
|
13029
12905
|
});
|
|
@@ -13033,10 +12909,11 @@ class ZodDate extends ZodType {
|
|
|
13033
12909
|
else if (check.kind === "max") {
|
|
13034
12910
|
if (input.data.getTime() > check.value) {
|
|
13035
12911
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
13036
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
12912
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13037
12913
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13038
12914
|
message: check.message,
|
|
13039
12915
|
inclusive: true,
|
|
12916
|
+
exact: false,
|
|
13040
12917
|
maximum: check.value,
|
|
13041
12918
|
type: "date",
|
|
13042
12919
|
});
|
|
@@ -13097,23 +12974,46 @@ exports.ZodDate = ZodDate;
|
|
|
13097
12974
|
ZodDate.create = (params) => {
|
|
13098
12975
|
return new ZodDate({
|
|
13099
12976
|
checks: [],
|
|
12977
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
13100
12978
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
13101
12979
|
...processCreateParams(params),
|
|
13102
12980
|
});
|
|
13103
12981
|
};
|
|
12982
|
+
class ZodSymbol extends ZodType {
|
|
12983
|
+
_parse(input) {
|
|
12984
|
+
const parsedType = this._getType(input);
|
|
12985
|
+
if (parsedType !== util_1.ZodParsedType.symbol) {
|
|
12986
|
+
const ctx = this._getOrReturnCtx(input);
|
|
12987
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
12988
|
+
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
12989
|
+
expected: util_1.ZodParsedType.symbol,
|
|
12990
|
+
received: ctx.parsedType,
|
|
12991
|
+
});
|
|
12992
|
+
return parseUtil_1.INVALID;
|
|
12993
|
+
}
|
|
12994
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
12995
|
+
}
|
|
12996
|
+
}
|
|
12997
|
+
exports.ZodSymbol = ZodSymbol;
|
|
12998
|
+
ZodSymbol.create = (params) => {
|
|
12999
|
+
return new ZodSymbol({
|
|
13000
|
+
typeName: ZodFirstPartyTypeKind.ZodSymbol,
|
|
13001
|
+
...processCreateParams(params),
|
|
13002
|
+
});
|
|
13003
|
+
};
|
|
13104
13004
|
class ZodUndefined extends ZodType {
|
|
13105
13005
|
_parse(input) {
|
|
13106
13006
|
const parsedType = this._getType(input);
|
|
13107
13007
|
if (parsedType !== util_1.ZodParsedType.undefined) {
|
|
13108
13008
|
const ctx = this._getOrReturnCtx(input);
|
|
13109
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13009
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13110
13010
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13111
13011
|
expected: util_1.ZodParsedType.undefined,
|
|
13112
13012
|
received: ctx.parsedType,
|
|
13113
13013
|
});
|
|
13114
13014
|
return parseUtil_1.INVALID;
|
|
13115
13015
|
}
|
|
13116
|
-
return parseUtil_1.OK(input.data);
|
|
13016
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13117
13017
|
}
|
|
13118
13018
|
}
|
|
13119
13019
|
exports.ZodUndefined = ZodUndefined;
|
|
@@ -13128,14 +13028,14 @@ class ZodNull extends ZodType {
|
|
|
13128
13028
|
const parsedType = this._getType(input);
|
|
13129
13029
|
if (parsedType !== util_1.ZodParsedType.null) {
|
|
13130
13030
|
const ctx = this._getOrReturnCtx(input);
|
|
13131
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13031
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13132
13032
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13133
13033
|
expected: util_1.ZodParsedType.null,
|
|
13134
13034
|
received: ctx.parsedType,
|
|
13135
13035
|
});
|
|
13136
13036
|
return parseUtil_1.INVALID;
|
|
13137
13037
|
}
|
|
13138
|
-
return parseUtil_1.OK(input.data);
|
|
13038
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13139
13039
|
}
|
|
13140
13040
|
}
|
|
13141
13041
|
exports.ZodNull = ZodNull;
|
|
@@ -13152,7 +13052,7 @@ class ZodAny extends ZodType {
|
|
|
13152
13052
|
this._any = true;
|
|
13153
13053
|
}
|
|
13154
13054
|
_parse(input) {
|
|
13155
|
-
return parseUtil_1.OK(input.data);
|
|
13055
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13156
13056
|
}
|
|
13157
13057
|
}
|
|
13158
13058
|
exports.ZodAny = ZodAny;
|
|
@@ -13169,7 +13069,7 @@ class ZodUnknown extends ZodType {
|
|
|
13169
13069
|
this._unknown = true;
|
|
13170
13070
|
}
|
|
13171
13071
|
_parse(input) {
|
|
13172
|
-
return parseUtil_1.OK(input.data);
|
|
13072
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13173
13073
|
}
|
|
13174
13074
|
}
|
|
13175
13075
|
exports.ZodUnknown = ZodUnknown;
|
|
@@ -13182,7 +13082,7 @@ ZodUnknown.create = (params) => {
|
|
|
13182
13082
|
class ZodNever extends ZodType {
|
|
13183
13083
|
_parse(input) {
|
|
13184
13084
|
const ctx = this._getOrReturnCtx(input);
|
|
13185
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13085
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13186
13086
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13187
13087
|
expected: util_1.ZodParsedType.never,
|
|
13188
13088
|
received: ctx.parsedType,
|
|
@@ -13202,14 +13102,14 @@ class ZodVoid extends ZodType {
|
|
|
13202
13102
|
const parsedType = this._getType(input);
|
|
13203
13103
|
if (parsedType !== util_1.ZodParsedType.undefined) {
|
|
13204
13104
|
const ctx = this._getOrReturnCtx(input);
|
|
13205
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13105
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13206
13106
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13207
13107
|
expected: util_1.ZodParsedType.void,
|
|
13208
13108
|
received: ctx.parsedType,
|
|
13209
13109
|
});
|
|
13210
13110
|
return parseUtil_1.INVALID;
|
|
13211
13111
|
}
|
|
13212
|
-
return parseUtil_1.OK(input.data);
|
|
13112
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
13213
13113
|
}
|
|
13214
13114
|
}
|
|
13215
13115
|
exports.ZodVoid = ZodVoid;
|
|
@@ -13224,20 +13124,37 @@ class ZodArray extends ZodType {
|
|
|
13224
13124
|
const { ctx, status } = this._processInputParams(input);
|
|
13225
13125
|
const def = this._def;
|
|
13226
13126
|
if (ctx.parsedType !== util_1.ZodParsedType.array) {
|
|
13227
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13127
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13228
13128
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13229
13129
|
expected: util_1.ZodParsedType.array,
|
|
13230
13130
|
received: ctx.parsedType,
|
|
13231
13131
|
});
|
|
13232
13132
|
return parseUtil_1.INVALID;
|
|
13233
13133
|
}
|
|
13134
|
+
if (def.exactLength !== null) {
|
|
13135
|
+
const tooBig = ctx.data.length > def.exactLength.value;
|
|
13136
|
+
const tooSmall = ctx.data.length < def.exactLength.value;
|
|
13137
|
+
if (tooBig || tooSmall) {
|
|
13138
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13139
|
+
code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
|
|
13140
|
+
minimum: (tooSmall ? def.exactLength.value : undefined),
|
|
13141
|
+
maximum: (tooBig ? def.exactLength.value : undefined),
|
|
13142
|
+
type: "array",
|
|
13143
|
+
inclusive: true,
|
|
13144
|
+
exact: true,
|
|
13145
|
+
message: def.exactLength.message,
|
|
13146
|
+
});
|
|
13147
|
+
status.dirty();
|
|
13148
|
+
}
|
|
13149
|
+
}
|
|
13234
13150
|
if (def.minLength !== null) {
|
|
13235
13151
|
if (ctx.data.length < def.minLength.value) {
|
|
13236
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13152
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13237
13153
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13238
13154
|
minimum: def.minLength.value,
|
|
13239
13155
|
type: "array",
|
|
13240
13156
|
inclusive: true,
|
|
13157
|
+
exact: false,
|
|
13241
13158
|
message: def.minLength.message,
|
|
13242
13159
|
});
|
|
13243
13160
|
status.dirty();
|
|
@@ -13245,11 +13162,12 @@ class ZodArray extends ZodType {
|
|
|
13245
13162
|
}
|
|
13246
13163
|
if (def.maxLength !== null) {
|
|
13247
13164
|
if (ctx.data.length > def.maxLength.value) {
|
|
13248
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13165
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13249
13166
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13250
13167
|
maximum: def.maxLength.value,
|
|
13251
13168
|
type: "array",
|
|
13252
13169
|
inclusive: true,
|
|
13170
|
+
exact: false,
|
|
13253
13171
|
message: def.maxLength.message,
|
|
13254
13172
|
});
|
|
13255
13173
|
status.dirty();
|
|
@@ -13283,7 +13201,10 @@ class ZodArray extends ZodType {
|
|
|
13283
13201
|
});
|
|
13284
13202
|
}
|
|
13285
13203
|
length(len, message) {
|
|
13286
|
-
return
|
|
13204
|
+
return new ZodArray({
|
|
13205
|
+
...this._def,
|
|
13206
|
+
exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },
|
|
13207
|
+
});
|
|
13287
13208
|
}
|
|
13288
13209
|
nonempty(message) {
|
|
13289
13210
|
return this.min(1, message);
|
|
@@ -13295,6 +13216,7 @@ ZodArray.create = (schema, params) => {
|
|
|
13295
13216
|
type: schema,
|
|
13296
13217
|
minLength: null,
|
|
13297
13218
|
maxLength: null,
|
|
13219
|
+
exactLength: null,
|
|
13298
13220
|
typeName: ZodFirstPartyTypeKind.ZodArray,
|
|
13299
13221
|
...processCreateParams(params),
|
|
13300
13222
|
});
|
|
@@ -13311,7 +13233,7 @@ var objectUtil;
|
|
|
13311
13233
|
objectUtil.mergeShapes = (first, second) => {
|
|
13312
13234
|
return {
|
|
13313
13235
|
...first,
|
|
13314
|
-
...second,
|
|
13236
|
+
...second, // second overwrites first
|
|
13315
13237
|
};
|
|
13316
13238
|
};
|
|
13317
13239
|
})(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
|
|
@@ -13375,7 +13297,7 @@ class ZodObject extends ZodType {
|
|
|
13375
13297
|
const parsedType = this._getType(input);
|
|
13376
13298
|
if (parsedType !== util_1.ZodParsedType.object) {
|
|
13377
13299
|
const ctx = this._getOrReturnCtx(input);
|
|
13378
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13300
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13379
13301
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13380
13302
|
expected: util_1.ZodParsedType.object,
|
|
13381
13303
|
received: ctx.parsedType,
|
|
@@ -13385,9 +13307,12 @@ class ZodObject extends ZodType {
|
|
|
13385
13307
|
const { status, ctx } = this._processInputParams(input);
|
|
13386
13308
|
const { shape, keys: shapeKeys } = this._getCached();
|
|
13387
13309
|
const extraKeys = [];
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13310
|
+
if (!(this._def.catchall instanceof ZodNever &&
|
|
13311
|
+
this._def.unknownKeys === "strip")) {
|
|
13312
|
+
for (const key in ctx.data) {
|
|
13313
|
+
if (!shapeKeys.includes(key)) {
|
|
13314
|
+
extraKeys.push(key);
|
|
13315
|
+
}
|
|
13391
13316
|
}
|
|
13392
13317
|
}
|
|
13393
13318
|
const pairs = [];
|
|
@@ -13412,7 +13337,7 @@ class ZodObject extends ZodType {
|
|
|
13412
13337
|
}
|
|
13413
13338
|
else if (unknownKeys === "strict") {
|
|
13414
13339
|
if (extraKeys.length > 0) {
|
|
13415
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13340
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13416
13341
|
code: ZodError_1.ZodIssueCode.unrecognized_keys,
|
|
13417
13342
|
keys: extraKeys,
|
|
13418
13343
|
});
|
|
@@ -13578,15 +13503,32 @@ class ZodObject extends ZodType {
|
|
|
13578
13503
|
shape: () => newShape,
|
|
13579
13504
|
});
|
|
13580
13505
|
}
|
|
13581
|
-
required() {
|
|
13506
|
+
required(mask) {
|
|
13582
13507
|
const newShape = {};
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13508
|
+
if (mask) {
|
|
13509
|
+
util_1.util.objectKeys(this.shape).map((key) => {
|
|
13510
|
+
if (util_1.util.objectKeys(mask).indexOf(key) === -1) {
|
|
13511
|
+
newShape[key] = this.shape[key];
|
|
13512
|
+
}
|
|
13513
|
+
else {
|
|
13514
|
+
const fieldSchema = this.shape[key];
|
|
13515
|
+
let newField = fieldSchema;
|
|
13516
|
+
while (newField instanceof ZodOptional) {
|
|
13517
|
+
newField = newField._def.innerType;
|
|
13518
|
+
}
|
|
13519
|
+
newShape[key] = newField;
|
|
13520
|
+
}
|
|
13521
|
+
});
|
|
13522
|
+
}
|
|
13523
|
+
else {
|
|
13524
|
+
for (const key in this.shape) {
|
|
13525
|
+
const fieldSchema = this.shape[key];
|
|
13526
|
+
let newField = fieldSchema;
|
|
13527
|
+
while (newField instanceof ZodOptional) {
|
|
13528
|
+
newField = newField._def.innerType;
|
|
13529
|
+
}
|
|
13530
|
+
newShape[key] = newField;
|
|
13588
13531
|
}
|
|
13589
|
-
newShape[key] = newField;
|
|
13590
13532
|
}
|
|
13591
13533
|
return new ZodObject({
|
|
13592
13534
|
...this._def,
|
|
@@ -13645,7 +13587,7 @@ class ZodUnion extends ZodType {
|
|
|
13645
13587
|
}
|
|
13646
13588
|
// return invalid
|
|
13647
13589
|
const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
|
|
13648
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13590
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13649
13591
|
code: ZodError_1.ZodIssueCode.invalid_union,
|
|
13650
13592
|
unionErrors,
|
|
13651
13593
|
});
|
|
@@ -13703,7 +13645,7 @@ class ZodUnion extends ZodType {
|
|
|
13703
13645
|
return dirty.result;
|
|
13704
13646
|
}
|
|
13705
13647
|
const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));
|
|
13706
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13648
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13707
13649
|
code: ZodError_1.ZodIssueCode.invalid_union,
|
|
13708
13650
|
unionErrors,
|
|
13709
13651
|
});
|
|
@@ -13722,11 +13664,48 @@ ZodUnion.create = (types, params) => {
|
|
|
13722
13664
|
...processCreateParams(params),
|
|
13723
13665
|
});
|
|
13724
13666
|
};
|
|
13667
|
+
/////////////////////////////////////////////////////
|
|
13668
|
+
/////////////////////////////////////////////////////
|
|
13669
|
+
////////// //////////
|
|
13670
|
+
////////// ZodDiscriminatedUnion //////////
|
|
13671
|
+
////////// //////////
|
|
13672
|
+
/////////////////////////////////////////////////////
|
|
13673
|
+
/////////////////////////////////////////////////////
|
|
13674
|
+
const getDiscriminator = (type) => {
|
|
13675
|
+
if (type instanceof ZodLazy) {
|
|
13676
|
+
return getDiscriminator(type.schema);
|
|
13677
|
+
}
|
|
13678
|
+
else if (type instanceof ZodEffects) {
|
|
13679
|
+
return getDiscriminator(type.innerType());
|
|
13680
|
+
}
|
|
13681
|
+
else if (type instanceof ZodLiteral) {
|
|
13682
|
+
return [type.value];
|
|
13683
|
+
}
|
|
13684
|
+
else if (type instanceof ZodEnum) {
|
|
13685
|
+
return type.options;
|
|
13686
|
+
}
|
|
13687
|
+
else if (type instanceof ZodNativeEnum) {
|
|
13688
|
+
// eslint-disable-next-line ban/ban
|
|
13689
|
+
return Object.keys(type.enum);
|
|
13690
|
+
}
|
|
13691
|
+
else if (type instanceof ZodDefault) {
|
|
13692
|
+
return getDiscriminator(type._def.innerType);
|
|
13693
|
+
}
|
|
13694
|
+
else if (type instanceof ZodUndefined) {
|
|
13695
|
+
return [undefined];
|
|
13696
|
+
}
|
|
13697
|
+
else if (type instanceof ZodNull) {
|
|
13698
|
+
return [null];
|
|
13699
|
+
}
|
|
13700
|
+
else {
|
|
13701
|
+
return null;
|
|
13702
|
+
}
|
|
13703
|
+
};
|
|
13725
13704
|
class ZodDiscriminatedUnion extends ZodType {
|
|
13726
13705
|
_parse(input) {
|
|
13727
13706
|
const { ctx } = this._processInputParams(input);
|
|
13728
13707
|
if (ctx.parsedType !== util_1.ZodParsedType.object) {
|
|
13729
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13708
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13730
13709
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13731
13710
|
expected: util_1.ZodParsedType.object,
|
|
13732
13711
|
received: ctx.parsedType,
|
|
@@ -13735,11 +13714,11 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
13735
13714
|
}
|
|
13736
13715
|
const discriminator = this.discriminator;
|
|
13737
13716
|
const discriminatorValue = ctx.data[discriminator];
|
|
13738
|
-
const option = this.
|
|
13717
|
+
const option = this.optionsMap.get(discriminatorValue);
|
|
13739
13718
|
if (!option) {
|
|
13740
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13719
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13741
13720
|
code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
|
|
13742
|
-
options: this.
|
|
13721
|
+
options: Array.from(this.optionsMap.keys()),
|
|
13743
13722
|
path: [discriminator],
|
|
13744
13723
|
});
|
|
13745
13724
|
return parseUtil_1.INVALID;
|
|
@@ -13762,12 +13741,12 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
13762
13741
|
get discriminator() {
|
|
13763
13742
|
return this._def.discriminator;
|
|
13764
13743
|
}
|
|
13765
|
-
get validDiscriminatorValues() {
|
|
13766
|
-
return Array.from(this.options.keys());
|
|
13767
|
-
}
|
|
13768
13744
|
get options() {
|
|
13769
13745
|
return this._def.options;
|
|
13770
13746
|
}
|
|
13747
|
+
get optionsMap() {
|
|
13748
|
+
return this._def.optionsMap;
|
|
13749
|
+
}
|
|
13771
13750
|
/**
|
|
13772
13751
|
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
13773
13752
|
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
@@ -13776,34 +13755,35 @@ class ZodDiscriminatedUnion extends ZodType {
|
|
|
13776
13755
|
* @param types an array of object schemas
|
|
13777
13756
|
* @param params
|
|
13778
13757
|
*/
|
|
13779
|
-
static create(discriminator,
|
|
13758
|
+
static create(discriminator, options, params) {
|
|
13780
13759
|
// Get all the valid discriminator values
|
|
13781
|
-
const
|
|
13782
|
-
try {
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
13790
|
-
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
|
|
13760
|
+
const optionsMap = new Map();
|
|
13761
|
+
// try {
|
|
13762
|
+
for (const type of options) {
|
|
13763
|
+
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
13764
|
+
if (!discriminatorValues) {
|
|
13765
|
+
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
13766
|
+
}
|
|
13767
|
+
for (const value of discriminatorValues) {
|
|
13768
|
+
if (optionsMap.has(value)) {
|
|
13769
|
+
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
13770
|
+
}
|
|
13771
|
+
optionsMap.set(value, type);
|
|
13772
|
+
}
|
|
13794
13773
|
}
|
|
13795
13774
|
return new ZodDiscriminatedUnion({
|
|
13796
13775
|
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
13797
13776
|
discriminator,
|
|
13798
13777
|
options,
|
|
13778
|
+
optionsMap,
|
|
13799
13779
|
...processCreateParams(params),
|
|
13800
13780
|
});
|
|
13801
13781
|
}
|
|
13802
13782
|
}
|
|
13803
13783
|
exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
|
|
13804
13784
|
function mergeValues(a, b) {
|
|
13805
|
-
const aType = util_1.getParsedType(a);
|
|
13806
|
-
const bType = util_1.getParsedType(b);
|
|
13785
|
+
const aType = (0, util_1.getParsedType)(a);
|
|
13786
|
+
const bType = (0, util_1.getParsedType)(b);
|
|
13807
13787
|
if (a === b) {
|
|
13808
13788
|
return { valid: true, data: a };
|
|
13809
13789
|
}
|
|
@@ -13851,17 +13831,17 @@ class ZodIntersection extends ZodType {
|
|
|
13851
13831
|
_parse(input) {
|
|
13852
13832
|
const { status, ctx } = this._processInputParams(input);
|
|
13853
13833
|
const handleParsed = (parsedLeft, parsedRight) => {
|
|
13854
|
-
if (parseUtil_1.isAborted(parsedLeft) || parseUtil_1.isAborted(parsedRight)) {
|
|
13834
|
+
if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
|
|
13855
13835
|
return parseUtil_1.INVALID;
|
|
13856
13836
|
}
|
|
13857
13837
|
const merged = mergeValues(parsedLeft.value, parsedRight.value);
|
|
13858
13838
|
if (!merged.valid) {
|
|
13859
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13839
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13860
13840
|
code: ZodError_1.ZodIssueCode.invalid_intersection_types,
|
|
13861
13841
|
});
|
|
13862
13842
|
return parseUtil_1.INVALID;
|
|
13863
13843
|
}
|
|
13864
|
-
if (parseUtil_1.isDirty(parsedLeft) || parseUtil_1.isDirty(parsedRight)) {
|
|
13844
|
+
if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
|
|
13865
13845
|
status.dirty();
|
|
13866
13846
|
}
|
|
13867
13847
|
return { status: status.value, value: merged.data };
|
|
@@ -13906,7 +13886,7 @@ class ZodTuple extends ZodType {
|
|
|
13906
13886
|
_parse(input) {
|
|
13907
13887
|
const { status, ctx } = this._processInputParams(input);
|
|
13908
13888
|
if (ctx.parsedType !== util_1.ZodParsedType.array) {
|
|
13909
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13889
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13910
13890
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13911
13891
|
expected: util_1.ZodParsedType.array,
|
|
13912
13892
|
received: ctx.parsedType,
|
|
@@ -13914,20 +13894,22 @@ class ZodTuple extends ZodType {
|
|
|
13914
13894
|
return parseUtil_1.INVALID;
|
|
13915
13895
|
}
|
|
13916
13896
|
if (ctx.data.length < this._def.items.length) {
|
|
13917
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13897
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13918
13898
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
13919
13899
|
minimum: this._def.items.length,
|
|
13920
13900
|
inclusive: true,
|
|
13901
|
+
exact: false,
|
|
13921
13902
|
type: "array",
|
|
13922
13903
|
});
|
|
13923
13904
|
return parseUtil_1.INVALID;
|
|
13924
13905
|
}
|
|
13925
13906
|
const rest = this._def.rest;
|
|
13926
13907
|
if (!rest && ctx.data.length > this._def.items.length) {
|
|
13927
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13908
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13928
13909
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
13929
13910
|
maximum: this._def.items.length,
|
|
13930
13911
|
inclusive: true,
|
|
13912
|
+
exact: false,
|
|
13931
13913
|
type: "array",
|
|
13932
13914
|
});
|
|
13933
13915
|
status.dirty();
|
|
@@ -13961,6 +13943,9 @@ class ZodTuple extends ZodType {
|
|
|
13961
13943
|
}
|
|
13962
13944
|
exports.ZodTuple = ZodTuple;
|
|
13963
13945
|
ZodTuple.create = (schemas, params) => {
|
|
13946
|
+
if (!Array.isArray(schemas)) {
|
|
13947
|
+
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
13948
|
+
}
|
|
13964
13949
|
return new ZodTuple({
|
|
13965
13950
|
items: schemas,
|
|
13966
13951
|
typeName: ZodFirstPartyTypeKind.ZodTuple,
|
|
@@ -13978,7 +13963,7 @@ class ZodRecord extends ZodType {
|
|
|
13978
13963
|
_parse(input) {
|
|
13979
13964
|
const { status, ctx } = this._processInputParams(input);
|
|
13980
13965
|
if (ctx.parsedType !== util_1.ZodParsedType.object) {
|
|
13981
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
13966
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
13982
13967
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
13983
13968
|
expected: util_1.ZodParsedType.object,
|
|
13984
13969
|
received: ctx.parsedType,
|
|
@@ -14026,7 +14011,7 @@ class ZodMap extends ZodType {
|
|
|
14026
14011
|
_parse(input) {
|
|
14027
14012
|
const { status, ctx } = this._processInputParams(input);
|
|
14028
14013
|
if (ctx.parsedType !== util_1.ZodParsedType.map) {
|
|
14029
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14014
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14030
14015
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14031
14016
|
expected: util_1.ZodParsedType.map,
|
|
14032
14017
|
received: ctx.parsedType,
|
|
@@ -14088,7 +14073,7 @@ class ZodSet extends ZodType {
|
|
|
14088
14073
|
_parse(input) {
|
|
14089
14074
|
const { status, ctx } = this._processInputParams(input);
|
|
14090
14075
|
if (ctx.parsedType !== util_1.ZodParsedType.set) {
|
|
14091
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14076
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14092
14077
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14093
14078
|
expected: util_1.ZodParsedType.set,
|
|
14094
14079
|
received: ctx.parsedType,
|
|
@@ -14098,11 +14083,12 @@ class ZodSet extends ZodType {
|
|
|
14098
14083
|
const def = this._def;
|
|
14099
14084
|
if (def.minSize !== null) {
|
|
14100
14085
|
if (ctx.data.size < def.minSize.value) {
|
|
14101
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14086
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14102
14087
|
code: ZodError_1.ZodIssueCode.too_small,
|
|
14103
14088
|
minimum: def.minSize.value,
|
|
14104
14089
|
type: "set",
|
|
14105
14090
|
inclusive: true,
|
|
14091
|
+
exact: false,
|
|
14106
14092
|
message: def.minSize.message,
|
|
14107
14093
|
});
|
|
14108
14094
|
status.dirty();
|
|
@@ -14110,11 +14096,12 @@ class ZodSet extends ZodType {
|
|
|
14110
14096
|
}
|
|
14111
14097
|
if (def.maxSize !== null) {
|
|
14112
14098
|
if (ctx.data.size > def.maxSize.value) {
|
|
14113
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14099
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14114
14100
|
code: ZodError_1.ZodIssueCode.too_big,
|
|
14115
14101
|
maximum: def.maxSize.value,
|
|
14116
14102
|
type: "set",
|
|
14117
14103
|
inclusive: true,
|
|
14104
|
+
exact: false,
|
|
14118
14105
|
message: def.maxSize.message,
|
|
14119
14106
|
});
|
|
14120
14107
|
status.dirty();
|
|
@@ -14177,7 +14164,7 @@ class ZodFunction extends ZodType {
|
|
|
14177
14164
|
_parse(input) {
|
|
14178
14165
|
const { ctx } = this._processInputParams(input);
|
|
14179
14166
|
if (ctx.parsedType !== util_1.ZodParsedType.function) {
|
|
14180
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14167
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14181
14168
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14182
14169
|
expected: util_1.ZodParsedType.function,
|
|
14183
14170
|
received: ctx.parsedType,
|
|
@@ -14185,14 +14172,14 @@ class ZodFunction extends ZodType {
|
|
|
14185
14172
|
return parseUtil_1.INVALID;
|
|
14186
14173
|
}
|
|
14187
14174
|
function makeArgsIssue(args, error) {
|
|
14188
|
-
return parseUtil_1.makeIssue({
|
|
14175
|
+
return (0, parseUtil_1.makeIssue)({
|
|
14189
14176
|
data: args,
|
|
14190
14177
|
path: ctx.path,
|
|
14191
14178
|
errorMaps: [
|
|
14192
14179
|
ctx.common.contextualErrorMap,
|
|
14193
14180
|
ctx.schemaErrorMap,
|
|
14194
|
-
|
|
14195
|
-
|
|
14181
|
+
(0, errors_1.getErrorMap)(),
|
|
14182
|
+
errors_1.defaultErrorMap,
|
|
14196
14183
|
].filter((x) => !!x),
|
|
14197
14184
|
issueData: {
|
|
14198
14185
|
code: ZodError_1.ZodIssueCode.invalid_arguments,
|
|
@@ -14201,14 +14188,14 @@ class ZodFunction extends ZodType {
|
|
|
14201
14188
|
});
|
|
14202
14189
|
}
|
|
14203
14190
|
function makeReturnsIssue(returns, error) {
|
|
14204
|
-
return parseUtil_1.makeIssue({
|
|
14191
|
+
return (0, parseUtil_1.makeIssue)({
|
|
14205
14192
|
data: returns,
|
|
14206
14193
|
path: ctx.path,
|
|
14207
14194
|
errorMaps: [
|
|
14208
14195
|
ctx.common.contextualErrorMap,
|
|
14209
14196
|
ctx.schemaErrorMap,
|
|
14210
|
-
|
|
14211
|
-
|
|
14197
|
+
(0, errors_1.getErrorMap)(),
|
|
14198
|
+
errors_1.defaultErrorMap,
|
|
14212
14199
|
].filter((x) => !!x),
|
|
14213
14200
|
issueData: {
|
|
14214
14201
|
code: ZodError_1.ZodIssueCode.invalid_return_type,
|
|
@@ -14219,7 +14206,7 @@ class ZodFunction extends ZodType {
|
|
|
14219
14206
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
14220
14207
|
const fn = ctx.data;
|
|
14221
14208
|
if (this._def.returns instanceof ZodPromise) {
|
|
14222
|
-
return parseUtil_1.OK(async (...args) => {
|
|
14209
|
+
return (0, parseUtil_1.OK)(async (...args) => {
|
|
14223
14210
|
const error = new ZodError_1.ZodError([]);
|
|
14224
14211
|
const parsedArgs = await this._def.args
|
|
14225
14212
|
.parseAsync(args, params)
|
|
@@ -14238,7 +14225,7 @@ class ZodFunction extends ZodType {
|
|
|
14238
14225
|
});
|
|
14239
14226
|
}
|
|
14240
14227
|
else {
|
|
14241
|
-
return parseUtil_1.OK((...args) => {
|
|
14228
|
+
return (0, parseUtil_1.OK)((...args) => {
|
|
14242
14229
|
const parsedArgs = this._def.args.safeParse(args, params);
|
|
14243
14230
|
if (!parsedArgs.success) {
|
|
14244
14231
|
throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
@@ -14278,18 +14265,18 @@ class ZodFunction extends ZodType {
|
|
|
14278
14265
|
const validatedFunc = this.parse(func);
|
|
14279
14266
|
return validatedFunc;
|
|
14280
14267
|
}
|
|
14268
|
+
static create(args, returns, params) {
|
|
14269
|
+
return new ZodFunction({
|
|
14270
|
+
args: (args
|
|
14271
|
+
? args
|
|
14272
|
+
: ZodTuple.create([]).rest(ZodUnknown.create())),
|
|
14273
|
+
returns: returns || ZodUnknown.create(),
|
|
14274
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
14275
|
+
...processCreateParams(params),
|
|
14276
|
+
});
|
|
14277
|
+
}
|
|
14281
14278
|
}
|
|
14282
14279
|
exports.ZodFunction = ZodFunction;
|
|
14283
|
-
ZodFunction.create = (args, returns, params) => {
|
|
14284
|
-
return new ZodFunction({
|
|
14285
|
-
args: (args
|
|
14286
|
-
? args.rest(ZodUnknown.create())
|
|
14287
|
-
: ZodTuple.create([]).rest(ZodUnknown.create())),
|
|
14288
|
-
returns: returns || ZodUnknown.create(),
|
|
14289
|
-
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
14290
|
-
...processCreateParams(params),
|
|
14291
|
-
});
|
|
14292
|
-
};
|
|
14293
14280
|
class ZodLazy extends ZodType {
|
|
14294
14281
|
get schema() {
|
|
14295
14282
|
return this._def.getter();
|
|
@@ -14312,7 +14299,7 @@ class ZodLiteral extends ZodType {
|
|
|
14312
14299
|
_parse(input) {
|
|
14313
14300
|
if (input.data !== this._def.value) {
|
|
14314
14301
|
const ctx = this._getOrReturnCtx(input);
|
|
14315
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14302
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14316
14303
|
code: ZodError_1.ZodIssueCode.invalid_literal,
|
|
14317
14304
|
expected: this._def.value,
|
|
14318
14305
|
});
|
|
@@ -14344,7 +14331,7 @@ class ZodEnum extends ZodType {
|
|
|
14344
14331
|
if (typeof input.data !== "string") {
|
|
14345
14332
|
const ctx = this._getOrReturnCtx(input);
|
|
14346
14333
|
const expectedValues = this._def.values;
|
|
14347
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14334
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14348
14335
|
expected: util_1.util.joinValues(expectedValues),
|
|
14349
14336
|
received: ctx.parsedType,
|
|
14350
14337
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
@@ -14354,14 +14341,14 @@ class ZodEnum extends ZodType {
|
|
|
14354
14341
|
if (this._def.values.indexOf(input.data) === -1) {
|
|
14355
14342
|
const ctx = this._getOrReturnCtx(input);
|
|
14356
14343
|
const expectedValues = this._def.values;
|
|
14357
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14344
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14358
14345
|
received: ctx.data,
|
|
14359
14346
|
code: ZodError_1.ZodIssueCode.invalid_enum_value,
|
|
14360
14347
|
options: expectedValues,
|
|
14361
14348
|
});
|
|
14362
14349
|
return parseUtil_1.INVALID;
|
|
14363
14350
|
}
|
|
14364
|
-
return parseUtil_1.OK(input.data);
|
|
14351
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
14365
14352
|
}
|
|
14366
14353
|
get options() {
|
|
14367
14354
|
return this._def.values;
|
|
@@ -14397,7 +14384,7 @@ class ZodNativeEnum extends ZodType {
|
|
|
14397
14384
|
if (ctx.parsedType !== util_1.ZodParsedType.string &&
|
|
14398
14385
|
ctx.parsedType !== util_1.ZodParsedType.number) {
|
|
14399
14386
|
const expectedValues = util_1.util.objectValues(nativeEnumValues);
|
|
14400
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14387
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14401
14388
|
expected: util_1.util.joinValues(expectedValues),
|
|
14402
14389
|
received: ctx.parsedType,
|
|
14403
14390
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
@@ -14406,14 +14393,14 @@ class ZodNativeEnum extends ZodType {
|
|
|
14406
14393
|
}
|
|
14407
14394
|
if (nativeEnumValues.indexOf(input.data) === -1) {
|
|
14408
14395
|
const expectedValues = util_1.util.objectValues(nativeEnumValues);
|
|
14409
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14396
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14410
14397
|
received: ctx.data,
|
|
14411
14398
|
code: ZodError_1.ZodIssueCode.invalid_enum_value,
|
|
14412
14399
|
options: expectedValues,
|
|
14413
14400
|
});
|
|
14414
14401
|
return parseUtil_1.INVALID;
|
|
14415
14402
|
}
|
|
14416
|
-
return parseUtil_1.OK(input.data);
|
|
14403
|
+
return (0, parseUtil_1.OK)(input.data);
|
|
14417
14404
|
}
|
|
14418
14405
|
get enum() {
|
|
14419
14406
|
return this._def.values;
|
|
@@ -14432,7 +14419,7 @@ class ZodPromise extends ZodType {
|
|
|
14432
14419
|
const { ctx } = this._processInputParams(input);
|
|
14433
14420
|
if (ctx.parsedType !== util_1.ZodParsedType.promise &&
|
|
14434
14421
|
ctx.common.async === false) {
|
|
14435
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14422
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14436
14423
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14437
14424
|
expected: util_1.ZodParsedType.promise,
|
|
14438
14425
|
received: ctx.parsedType,
|
|
@@ -14442,7 +14429,7 @@ class ZodPromise extends ZodType {
|
|
|
14442
14429
|
const promisified = ctx.parsedType === util_1.ZodParsedType.promise
|
|
14443
14430
|
? ctx.data
|
|
14444
14431
|
: Promise.resolve(ctx.data);
|
|
14445
|
-
return parseUtil_1.OK(promisified.then((data) => {
|
|
14432
|
+
return (0, parseUtil_1.OK)(promisified.then((data) => {
|
|
14446
14433
|
return this._def.type.parseAsync(data, {
|
|
14447
14434
|
path: ctx.path,
|
|
14448
14435
|
errorMap: ctx.common.contextualErrorMap,
|
|
@@ -14462,6 +14449,11 @@ class ZodEffects extends ZodType {
|
|
|
14462
14449
|
innerType() {
|
|
14463
14450
|
return this._def.schema;
|
|
14464
14451
|
}
|
|
14452
|
+
sourceType() {
|
|
14453
|
+
return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
|
|
14454
|
+
? this._def.schema.sourceType()
|
|
14455
|
+
: this._def.schema;
|
|
14456
|
+
}
|
|
14465
14457
|
_parse(input) {
|
|
14466
14458
|
const { status, ctx } = this._processInputParams(input);
|
|
14467
14459
|
const effect = this._def.effect || null;
|
|
@@ -14486,7 +14478,7 @@ class ZodEffects extends ZodType {
|
|
|
14486
14478
|
}
|
|
14487
14479
|
const checkCtx = {
|
|
14488
14480
|
addIssue: (arg) => {
|
|
14489
|
-
parseUtil_1.addIssueToContext(ctx, arg);
|
|
14481
|
+
(0, parseUtil_1.addIssueToContext)(ctx, arg);
|
|
14490
14482
|
if (arg.fatal) {
|
|
14491
14483
|
status.abort();
|
|
14492
14484
|
}
|
|
@@ -14551,7 +14543,7 @@ class ZodEffects extends ZodType {
|
|
|
14551
14543
|
// if (base.status === "dirty") {
|
|
14552
14544
|
// return { status: "dirty", value: base.value };
|
|
14553
14545
|
// }
|
|
14554
|
-
if (!parseUtil_1.isValid(base))
|
|
14546
|
+
if (!(0, parseUtil_1.isValid)(base))
|
|
14555
14547
|
return base;
|
|
14556
14548
|
const result = effect.transform(base.value, checkCtx);
|
|
14557
14549
|
if (result instanceof Promise) {
|
|
@@ -14563,7 +14555,7 @@ class ZodEffects extends ZodType {
|
|
|
14563
14555
|
return this._def.schema
|
|
14564
14556
|
._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
|
|
14565
14557
|
.then((base) => {
|
|
14566
|
-
if (!parseUtil_1.isValid(base))
|
|
14558
|
+
if (!(0, parseUtil_1.isValid)(base))
|
|
14567
14559
|
return base;
|
|
14568
14560
|
// if (base.status === "aborted") return INVALID;
|
|
14569
14561
|
// if (base.status === "dirty") {
|
|
@@ -14598,7 +14590,7 @@ class ZodOptional extends ZodType {
|
|
|
14598
14590
|
_parse(input) {
|
|
14599
14591
|
const parsedType = this._getType(input);
|
|
14600
14592
|
if (parsedType === util_1.ZodParsedType.undefined) {
|
|
14601
|
-
return parseUtil_1.OK(undefined);
|
|
14593
|
+
return (0, parseUtil_1.OK)(undefined);
|
|
14602
14594
|
}
|
|
14603
14595
|
return this._def.innerType._parse(input);
|
|
14604
14596
|
}
|
|
@@ -14618,7 +14610,7 @@ class ZodNullable extends ZodType {
|
|
|
14618
14610
|
_parse(input) {
|
|
14619
14611
|
const parsedType = this._getType(input);
|
|
14620
14612
|
if (parsedType === util_1.ZodParsedType.null) {
|
|
14621
|
-
return parseUtil_1.OK(null);
|
|
14613
|
+
return (0, parseUtil_1.OK)(null);
|
|
14622
14614
|
}
|
|
14623
14615
|
return this._def.innerType._parse(input);
|
|
14624
14616
|
}
|
|
@@ -14653,9 +14645,50 @@ class ZodDefault extends ZodType {
|
|
|
14653
14645
|
}
|
|
14654
14646
|
exports.ZodDefault = ZodDefault;
|
|
14655
14647
|
ZodDefault.create = (type, params) => {
|
|
14656
|
-
return new
|
|
14648
|
+
return new ZodDefault({
|
|
14657
14649
|
innerType: type,
|
|
14658
|
-
typeName: ZodFirstPartyTypeKind.
|
|
14650
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault,
|
|
14651
|
+
defaultValue: typeof params.default === "function"
|
|
14652
|
+
? params.default
|
|
14653
|
+
: () => params.default,
|
|
14654
|
+
...processCreateParams(params),
|
|
14655
|
+
});
|
|
14656
|
+
};
|
|
14657
|
+
class ZodCatch extends ZodType {
|
|
14658
|
+
_parse(input) {
|
|
14659
|
+
const { ctx } = this._processInputParams(input);
|
|
14660
|
+
const result = this._def.innerType._parse({
|
|
14661
|
+
data: ctx.data,
|
|
14662
|
+
path: ctx.path,
|
|
14663
|
+
parent: ctx,
|
|
14664
|
+
});
|
|
14665
|
+
if ((0, parseUtil_1.isAsync)(result)) {
|
|
14666
|
+
return result.then((result) => {
|
|
14667
|
+
return {
|
|
14668
|
+
status: "valid",
|
|
14669
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue(),
|
|
14670
|
+
};
|
|
14671
|
+
});
|
|
14672
|
+
}
|
|
14673
|
+
else {
|
|
14674
|
+
return {
|
|
14675
|
+
status: "valid",
|
|
14676
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue(),
|
|
14677
|
+
};
|
|
14678
|
+
}
|
|
14679
|
+
}
|
|
14680
|
+
removeDefault() {
|
|
14681
|
+
return this._def.innerType;
|
|
14682
|
+
}
|
|
14683
|
+
}
|
|
14684
|
+
exports.ZodCatch = ZodCatch;
|
|
14685
|
+
ZodCatch.create = (type, params) => {
|
|
14686
|
+
return new ZodCatch({
|
|
14687
|
+
innerType: type,
|
|
14688
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
14689
|
+
defaultValue: typeof params.default === "function"
|
|
14690
|
+
? params.default
|
|
14691
|
+
: () => params.default,
|
|
14659
14692
|
...processCreateParams(params),
|
|
14660
14693
|
});
|
|
14661
14694
|
};
|
|
@@ -14664,7 +14697,7 @@ class ZodNaN extends ZodType {
|
|
|
14664
14697
|
const parsedType = this._getType(input);
|
|
14665
14698
|
if (parsedType !== util_1.ZodParsedType.nan) {
|
|
14666
14699
|
const ctx = this._getOrReturnCtx(input);
|
|
14667
|
-
parseUtil_1.addIssueToContext(ctx, {
|
|
14700
|
+
(0, parseUtil_1.addIssueToContext)(ctx, {
|
|
14668
14701
|
code: ZodError_1.ZodIssueCode.invalid_type,
|
|
14669
14702
|
expected: util_1.ZodParsedType.nan,
|
|
14670
14703
|
received: ctx.parsedType,
|
|
@@ -14697,6 +14730,65 @@ class ZodBranded extends ZodType {
|
|
|
14697
14730
|
}
|
|
14698
14731
|
}
|
|
14699
14732
|
exports.ZodBranded = ZodBranded;
|
|
14733
|
+
class ZodPipeline extends ZodType {
|
|
14734
|
+
_parse(input) {
|
|
14735
|
+
const { status, ctx } = this._processInputParams(input);
|
|
14736
|
+
if (ctx.common.async) {
|
|
14737
|
+
const handleAsync = async () => {
|
|
14738
|
+
const inResult = await this._def.in._parseAsync({
|
|
14739
|
+
data: ctx.data,
|
|
14740
|
+
path: ctx.path,
|
|
14741
|
+
parent: ctx,
|
|
14742
|
+
});
|
|
14743
|
+
if (inResult.status === "aborted")
|
|
14744
|
+
return parseUtil_1.INVALID;
|
|
14745
|
+
if (inResult.status === "dirty") {
|
|
14746
|
+
status.dirty();
|
|
14747
|
+
return (0, parseUtil_1.DIRTY)(inResult.value);
|
|
14748
|
+
}
|
|
14749
|
+
else {
|
|
14750
|
+
return this._def.out._parseAsync({
|
|
14751
|
+
data: inResult.value,
|
|
14752
|
+
path: ctx.path,
|
|
14753
|
+
parent: ctx,
|
|
14754
|
+
});
|
|
14755
|
+
}
|
|
14756
|
+
};
|
|
14757
|
+
return handleAsync();
|
|
14758
|
+
}
|
|
14759
|
+
else {
|
|
14760
|
+
const inResult = this._def.in._parseSync({
|
|
14761
|
+
data: ctx.data,
|
|
14762
|
+
path: ctx.path,
|
|
14763
|
+
parent: ctx,
|
|
14764
|
+
});
|
|
14765
|
+
if (inResult.status === "aborted")
|
|
14766
|
+
return parseUtil_1.INVALID;
|
|
14767
|
+
if (inResult.status === "dirty") {
|
|
14768
|
+
status.dirty();
|
|
14769
|
+
return {
|
|
14770
|
+
status: "dirty",
|
|
14771
|
+
value: inResult.value,
|
|
14772
|
+
};
|
|
14773
|
+
}
|
|
14774
|
+
else {
|
|
14775
|
+
return this._def.out._parseSync({
|
|
14776
|
+
data: inResult.value,
|
|
14777
|
+
path: ctx.path,
|
|
14778
|
+
parent: ctx,
|
|
14779
|
+
});
|
|
14780
|
+
}
|
|
14781
|
+
}
|
|
14782
|
+
}
|
|
14783
|
+
static create(a, b) {
|
|
14784
|
+
return new ZodPipeline({
|
|
14785
|
+
in: a,
|
|
14786
|
+
out: b,
|
|
14787
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline,
|
|
14788
|
+
});
|
|
14789
|
+
}
|
|
14790
|
+
}
|
|
14791
|
+
exports.ZodPipeline = ZodPipeline;
|
|
14700
14792
|
const custom = (check, params = {}, fatal) => {
|
|
14701
14793
|
if (check)
|
|
14702
14794
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
@@ -14720,6 +14812,7 @@ var ZodFirstPartyTypeKind;
|
|
|
14720
14812
|
ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
|
|
14721
14813
|
ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
|
|
14722
14814
|
ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
|
|
14815
|
+
ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
|
|
14723
14816
|
ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
|
|
14724
14817
|
ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
|
|
14725
14818
|
ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
|
|
@@ -14744,12 +14837,21 @@ var ZodFirstPartyTypeKind;
|
|
|
14744
14837
|
ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
|
|
14745
14838
|
ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
|
|
14746
14839
|
ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
|
|
14840
|
+
ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
|
|
14747
14841
|
ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
|
|
14748
14842
|
ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
|
|
14843
|
+
ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
|
|
14749
14844
|
})(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {}));
|
|
14750
|
-
|
|
14845
|
+
// new approach that works for abstract classes
|
|
14846
|
+
// but requires TS 4.4+
|
|
14847
|
+
class Class {
|
|
14848
|
+
constructor(..._) { }
|
|
14849
|
+
}
|
|
14850
|
+
const instanceOfType = (
|
|
14851
|
+
// const instanceOfType = <T extends new (...args: any[]) => any>(
|
|
14852
|
+
cls, params = {
|
|
14751
14853
|
message: `Input not instance of ${cls.name}`,
|
|
14752
|
-
}) => exports.custom((data) => data instanceof cls, params, true);
|
|
14854
|
+
}) => (0, exports.custom)((data) => data instanceof cls, params, true);
|
|
14753
14855
|
exports["instanceof"] = instanceOfType;
|
|
14754
14856
|
const stringType = ZodString.create;
|
|
14755
14857
|
exports.string = stringType;
|
|
@@ -14763,6 +14865,8 @@ const booleanType = ZodBoolean.create;
|
|
|
14763
14865
|
exports.boolean = booleanType;
|
|
14764
14866
|
const dateType = ZodDate.create;
|
|
14765
14867
|
exports.date = dateType;
|
|
14868
|
+
const symbolType = ZodSymbol.create;
|
|
14869
|
+
exports.symbol = symbolType;
|
|
14766
14870
|
const undefinedType = ZodUndefined.create;
|
|
14767
14871
|
exports.undefined = undefinedType;
|
|
14768
14872
|
const nullType = ZodNull.create;
|
|
@@ -14816,24 +14920,34 @@ const nullableType = ZodNullable.create;
|
|
|
14816
14920
|
exports.nullable = nullableType;
|
|
14817
14921
|
const preprocessType = ZodEffects.createWithPreprocess;
|
|
14818
14922
|
exports.preprocess = preprocessType;
|
|
14923
|
+
const pipelineType = ZodPipeline.create;
|
|
14924
|
+
exports.pipeline = pipelineType;
|
|
14819
14925
|
const ostring = () => stringType().optional();
|
|
14820
14926
|
exports.ostring = ostring;
|
|
14821
14927
|
const onumber = () => numberType().optional();
|
|
14822
14928
|
exports.onumber = onumber;
|
|
14823
14929
|
const oboolean = () => booleanType().optional();
|
|
14824
14930
|
exports.oboolean = oboolean;
|
|
14931
|
+
exports.coerce = {
|
|
14932
|
+
string: ((arg) => ZodString.create({ ...arg, coerce: true })),
|
|
14933
|
+
number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
|
|
14934
|
+
boolean: ((arg) => ZodBoolean.create({ ...arg, coerce: true })),
|
|
14935
|
+
bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
|
|
14936
|
+
date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
|
|
14937
|
+
};
|
|
14938
|
+
exports.NEVER = parseUtil_1.INVALID;
|
|
14825
14939
|
|
|
14826
14940
|
|
|
14827
14941
|
/***/ }),
|
|
14828
14942
|
|
|
14829
|
-
/***/
|
|
14943
|
+
/***/ 2124:
|
|
14830
14944
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
14831
14945
|
|
|
14832
14946
|
"use strict";
|
|
14833
14947
|
|
|
14834
14948
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14835
14949
|
exports.defaultTimeout = exports.defaultMetadata = exports.scope = exports.userInfoEndpoint = exports.accessTokenEndpoint = exports.authorizationEndpoint = void 0;
|
|
14836
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
14950
|
+
const connector_kit_1 = __nccwpck_require__(4758);
|
|
14837
14951
|
exports.authorizationEndpoint = 'https://accounts.google.com/o/oauth2/v2/auth';
|
|
14838
14952
|
exports.accessTokenEndpoint = 'https://oauth2.googleapis.com/token';
|
|
14839
14953
|
exports.userInfoEndpoint = 'https://openidconnect.googleapis.com/v1/userinfo';
|
|
@@ -14864,7 +14978,7 @@ exports.defaultTimeout = 5000;
|
|
|
14864
14978
|
|
|
14865
14979
|
/***/ }),
|
|
14866
14980
|
|
|
14867
|
-
/***/
|
|
14981
|
+
/***/ 616:
|
|
14868
14982
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
14869
14983
|
|
|
14870
14984
|
"use strict";
|
|
@@ -14894,11 +15008,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
14894
15008
|
};
|
|
14895
15009
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14896
15010
|
exports.getAccessToken = void 0;
|
|
14897
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
14898
|
-
const essentials_1 = __nccwpck_require__(
|
|
14899
|
-
const got_1 = __importStar(__nccwpck_require__(
|
|
14900
|
-
const constant_1 = __nccwpck_require__(
|
|
14901
|
-
const types_1 = __nccwpck_require__(
|
|
15011
|
+
const connector_kit_1 = __nccwpck_require__(4758);
|
|
15012
|
+
const essentials_1 = __nccwpck_require__(5254);
|
|
15013
|
+
const got_1 = __importStar(__nccwpck_require__(9235));
|
|
15014
|
+
const constant_1 = __nccwpck_require__(2124);
|
|
15015
|
+
const types_1 = __nccwpck_require__(2174);
|
|
14902
15016
|
const getAuthorizationUri = (getConfig) => async ({ state, redirectUri }) => {
|
|
14903
15017
|
const config = await getConfig(constant_1.defaultMetadata.id);
|
|
14904
15018
|
(0, connector_kit_1.validateConfig)(config, types_1.googleConfigGuard);
|
|
@@ -14994,14 +15108,14 @@ exports["default"] = createGoogleConnector;
|
|
|
14994
15108
|
|
|
14995
15109
|
/***/ }),
|
|
14996
15110
|
|
|
14997
|
-
/***/
|
|
15111
|
+
/***/ 2174:
|
|
14998
15112
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
14999
15113
|
|
|
15000
15114
|
"use strict";
|
|
15001
15115
|
|
|
15002
15116
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15003
15117
|
exports.authResponseGuard = exports.userInfoResponseGuard = exports.accessTokenResponseGuard = exports.googleConfigGuard = void 0;
|
|
15004
|
-
const zod_1 = __nccwpck_require__(
|
|
15118
|
+
const zod_1 = __nccwpck_require__(6319);
|
|
15005
15119
|
exports.googleConfigGuard = zod_1.z.object({
|
|
15006
15120
|
clientId: zod_1.z.string(),
|
|
15007
15121
|
clientSecret: zod_1.z.string(),
|
|
@@ -15037,107 +15151,438 @@ module.exports = require("buffer");
|
|
|
15037
15151
|
|
|
15038
15152
|
/***/ }),
|
|
15039
15153
|
|
|
15040
|
-
/***/ 9523:
|
|
15041
|
-
/***/ ((module) => {
|
|
15154
|
+
/***/ 9523:
|
|
15155
|
+
/***/ ((module) => {
|
|
15156
|
+
|
|
15157
|
+
"use strict";
|
|
15158
|
+
module.exports = require("dns");
|
|
15159
|
+
|
|
15160
|
+
/***/ }),
|
|
15161
|
+
|
|
15162
|
+
/***/ 2361:
|
|
15163
|
+
/***/ ((module) => {
|
|
15164
|
+
|
|
15165
|
+
"use strict";
|
|
15166
|
+
module.exports = require("events");
|
|
15167
|
+
|
|
15168
|
+
/***/ }),
|
|
15169
|
+
|
|
15170
|
+
/***/ 7147:
|
|
15171
|
+
/***/ ((module) => {
|
|
15172
|
+
|
|
15173
|
+
"use strict";
|
|
15174
|
+
module.exports = require("fs");
|
|
15175
|
+
|
|
15176
|
+
/***/ }),
|
|
15177
|
+
|
|
15178
|
+
/***/ 3685:
|
|
15179
|
+
/***/ ((module) => {
|
|
15180
|
+
|
|
15181
|
+
"use strict";
|
|
15182
|
+
module.exports = require("http");
|
|
15183
|
+
|
|
15184
|
+
/***/ }),
|
|
15185
|
+
|
|
15186
|
+
/***/ 5158:
|
|
15187
|
+
/***/ ((module) => {
|
|
15188
|
+
|
|
15189
|
+
"use strict";
|
|
15190
|
+
module.exports = require("http2");
|
|
15191
|
+
|
|
15192
|
+
/***/ }),
|
|
15193
|
+
|
|
15194
|
+
/***/ 5687:
|
|
15195
|
+
/***/ ((module) => {
|
|
15196
|
+
|
|
15197
|
+
"use strict";
|
|
15198
|
+
module.exports = require("https");
|
|
15199
|
+
|
|
15200
|
+
/***/ }),
|
|
15201
|
+
|
|
15202
|
+
/***/ 1808:
|
|
15203
|
+
/***/ ((module) => {
|
|
15204
|
+
|
|
15205
|
+
"use strict";
|
|
15206
|
+
module.exports = require("net");
|
|
15207
|
+
|
|
15208
|
+
/***/ }),
|
|
15209
|
+
|
|
15210
|
+
/***/ 2037:
|
|
15211
|
+
/***/ ((module) => {
|
|
15212
|
+
|
|
15213
|
+
"use strict";
|
|
15214
|
+
module.exports = require("os");
|
|
15215
|
+
|
|
15216
|
+
/***/ }),
|
|
15217
|
+
|
|
15218
|
+
/***/ 2781:
|
|
15219
|
+
/***/ ((module) => {
|
|
15220
|
+
|
|
15221
|
+
"use strict";
|
|
15222
|
+
module.exports = require("stream");
|
|
15223
|
+
|
|
15224
|
+
/***/ }),
|
|
15225
|
+
|
|
15226
|
+
/***/ 6821:
|
|
15227
|
+
/***/ ((module) => {
|
|
15228
|
+
|
|
15229
|
+
"use strict";
|
|
15230
|
+
module.exports = require("tls");
|
|
15231
|
+
|
|
15232
|
+
/***/ }),
|
|
15233
|
+
|
|
15234
|
+
/***/ 7310:
|
|
15235
|
+
/***/ ((module) => {
|
|
15236
|
+
|
|
15237
|
+
"use strict";
|
|
15238
|
+
module.exports = require("url");
|
|
15239
|
+
|
|
15240
|
+
/***/ }),
|
|
15241
|
+
|
|
15242
|
+
/***/ 3837:
|
|
15243
|
+
/***/ ((module) => {
|
|
15244
|
+
|
|
15245
|
+
"use strict";
|
|
15246
|
+
module.exports = require("util");
|
|
15247
|
+
|
|
15248
|
+
/***/ }),
|
|
15249
|
+
|
|
15250
|
+
/***/ 9796:
|
|
15251
|
+
/***/ ((module) => {
|
|
15252
|
+
|
|
15253
|
+
"use strict";
|
|
15254
|
+
module.exports = require("zlib");
|
|
15255
|
+
|
|
15256
|
+
/***/ }),
|
|
15257
|
+
|
|
15258
|
+
/***/ 4758:
|
|
15259
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15260
|
+
|
|
15261
|
+
"use strict";
|
|
15262
|
+
|
|
15263
|
+
|
|
15264
|
+
var types = __nccwpck_require__(1876);
|
|
15265
|
+
|
|
15266
|
+
function validateConfig(config, guard) {
|
|
15267
|
+
const result = guard.safeParse(config);
|
|
15268
|
+
if (!result.success) {
|
|
15269
|
+
throw new types.ConnectorError(types.ConnectorErrorCodes.InvalidConfig, result.error);
|
|
15270
|
+
}
|
|
15271
|
+
}
|
|
15272
|
+
const parseJson = (jsonString, errorCode = types.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
|
|
15273
|
+
try {
|
|
15274
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
15275
|
+
return JSON.parse(jsonString);
|
|
15276
|
+
}
|
|
15277
|
+
catch {
|
|
15278
|
+
throw new types.ConnectorError(errorCode, errorPayload ?? jsonString);
|
|
15279
|
+
}
|
|
15280
|
+
};
|
|
15281
|
+
|
|
15282
|
+
exports.ConnectorError = types.ConnectorError;
|
|
15283
|
+
Object.defineProperty(exports, "ConnectorErrorCodes", ({
|
|
15284
|
+
enumerable: true,
|
|
15285
|
+
get: function () { return types.ConnectorErrorCodes; }
|
|
15286
|
+
}));
|
|
15287
|
+
Object.defineProperty(exports, "ConnectorPlatform", ({
|
|
15288
|
+
enumerable: true,
|
|
15289
|
+
get: function () { return types.ConnectorPlatform; }
|
|
15290
|
+
}));
|
|
15291
|
+
Object.defineProperty(exports, "ConnectorType", ({
|
|
15292
|
+
enumerable: true,
|
|
15293
|
+
get: function () { return types.ConnectorType; }
|
|
15294
|
+
}));
|
|
15295
|
+
Object.defineProperty(exports, "MessageTypes", ({
|
|
15296
|
+
enumerable: true,
|
|
15297
|
+
get: function () { return types.MessageTypes; }
|
|
15298
|
+
}));
|
|
15299
|
+
exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
|
|
15300
|
+
exports.connectorSessionGuard = types.connectorSessionGuard;
|
|
15301
|
+
exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
|
|
15302
|
+
exports.messageTypesGuard = types.messageTypesGuard;
|
|
15303
|
+
exports.parseJson = parseJson;
|
|
15304
|
+
exports.validateConfig = validateConfig;
|
|
15042
15305
|
|
|
15043
|
-
"use strict";
|
|
15044
|
-
module.exports = require("dns");
|
|
15045
15306
|
|
|
15046
15307
|
/***/ }),
|
|
15047
15308
|
|
|
15048
|
-
/***/
|
|
15049
|
-
/***/ ((
|
|
15309
|
+
/***/ 1876:
|
|
15310
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15050
15311
|
|
|
15051
15312
|
"use strict";
|
|
15052
|
-
module.exports = require("events");
|
|
15053
15313
|
|
|
15054
|
-
/***/ }),
|
|
15055
|
-
|
|
15056
|
-
/***/ 7147:
|
|
15057
|
-
/***/ ((module) => {
|
|
15058
15314
|
|
|
15059
|
-
|
|
15060
|
-
|
|
15315
|
+
var languageKit = __nccwpck_require__(1230);
|
|
15316
|
+
var zod = __nccwpck_require__(6319);
|
|
15061
15317
|
|
|
15062
|
-
|
|
15318
|
+
// MARK: Foundation
|
|
15319
|
+
exports.ConnectorType = void 0;
|
|
15320
|
+
(function (ConnectorType) {
|
|
15321
|
+
ConnectorType["Email"] = "Email";
|
|
15322
|
+
ConnectorType["Sms"] = "Sms";
|
|
15323
|
+
ConnectorType["Social"] = "Social";
|
|
15324
|
+
})(exports.ConnectorType || (exports.ConnectorType = {}));
|
|
15325
|
+
exports.ConnectorPlatform = void 0;
|
|
15326
|
+
(function (ConnectorPlatform) {
|
|
15327
|
+
ConnectorPlatform["Native"] = "Native";
|
|
15328
|
+
ConnectorPlatform["Universal"] = "Universal";
|
|
15329
|
+
ConnectorPlatform["Web"] = "Web";
|
|
15330
|
+
})(exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
|
|
15331
|
+
const i18nPhrasesGuard = zod.z
|
|
15332
|
+
.object({ en: zod.z.string() })
|
|
15333
|
+
.and(zod.z.record(zod.z.string()))
|
|
15334
|
+
.refine((i18nObject) => {
|
|
15335
|
+
const keys = Object.keys(i18nObject);
|
|
15336
|
+
if (!keys.includes('en')) {
|
|
15337
|
+
return false;
|
|
15338
|
+
}
|
|
15339
|
+
for (const value of keys) {
|
|
15340
|
+
if (!languageKit.isLanguageTag(value)) {
|
|
15341
|
+
return false;
|
|
15342
|
+
}
|
|
15343
|
+
}
|
|
15344
|
+
return true;
|
|
15345
|
+
});
|
|
15346
|
+
exports.ConnectorErrorCodes = void 0;
|
|
15347
|
+
(function (ConnectorErrorCodes) {
|
|
15348
|
+
ConnectorErrorCodes["General"] = "general";
|
|
15349
|
+
ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
|
|
15350
|
+
ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
|
|
15351
|
+
ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
|
|
15352
|
+
ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
|
|
15353
|
+
ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
|
|
15354
|
+
ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
|
|
15355
|
+
ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
|
|
15356
|
+
ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
|
|
15357
|
+
ConnectorErrorCodes["NotImplemented"] = "not_implemented";
|
|
15358
|
+
ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
|
|
15359
|
+
ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
|
|
15360
|
+
ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
|
|
15361
|
+
ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
|
|
15362
|
+
})(exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
|
|
15363
|
+
class ConnectorError extends Error {
|
|
15364
|
+
constructor(code, data) {
|
|
15365
|
+
const message = typeof data === 'string' ? data : 'Connector error occurred.';
|
|
15366
|
+
super(message);
|
|
15367
|
+
this.code = code;
|
|
15368
|
+
this.data = typeof data === 'string' ? { message: data } : data;
|
|
15369
|
+
}
|
|
15370
|
+
}
|
|
15371
|
+
exports.MessageTypes = void 0;
|
|
15372
|
+
(function (MessageTypes) {
|
|
15373
|
+
MessageTypes["SignIn"] = "SignIn";
|
|
15374
|
+
MessageTypes["Register"] = "Register";
|
|
15375
|
+
MessageTypes["ForgotPassword"] = "ForgotPassword";
|
|
15376
|
+
MessageTypes["Continue"] = "Continue";
|
|
15377
|
+
MessageTypes["Test"] = "Test";
|
|
15378
|
+
})(exports.MessageTypes || (exports.MessageTypes = {}));
|
|
15379
|
+
const messageTypesGuard = zod.z.nativeEnum(exports.MessageTypes);
|
|
15380
|
+
const connectorMetadataGuard = zod.z.object({
|
|
15381
|
+
id: zod.z.string(),
|
|
15382
|
+
target: zod.z.string(),
|
|
15383
|
+
platform: zod.z.nativeEnum(exports.ConnectorPlatform).nullable(),
|
|
15384
|
+
name: i18nPhrasesGuard,
|
|
15385
|
+
logo: zod.z.string(),
|
|
15386
|
+
logoDark: zod.z.string().nullable(),
|
|
15387
|
+
description: i18nPhrasesGuard,
|
|
15388
|
+
isStandard: zod.z.boolean().optional(),
|
|
15389
|
+
readme: zod.z.string(),
|
|
15390
|
+
configTemplate: zod.z.string(),
|
|
15391
|
+
});
|
|
15392
|
+
const configurableConnectorMetadataGuard = connectorMetadataGuard
|
|
15393
|
+
.pick({
|
|
15394
|
+
target: true,
|
|
15395
|
+
name: true,
|
|
15396
|
+
logo: true,
|
|
15397
|
+
logoDark: true,
|
|
15398
|
+
})
|
|
15399
|
+
.partial();
|
|
15400
|
+
const connectorSessionGuard = zod.z.object({
|
|
15401
|
+
nonce: zod.z.string().optional(),
|
|
15402
|
+
redirectUri: zod.z.string().optional(),
|
|
15403
|
+
});
|
|
15063
15404
|
|
|
15064
|
-
|
|
15065
|
-
|
|
15405
|
+
exports.ConnectorError = ConnectorError;
|
|
15406
|
+
exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
|
|
15407
|
+
exports.connectorSessionGuard = connectorSessionGuard;
|
|
15408
|
+
exports.i18nPhrasesGuard = i18nPhrasesGuard;
|
|
15409
|
+
exports.messageTypesGuard = messageTypesGuard;
|
|
15066
15410
|
|
|
15067
|
-
"use strict";
|
|
15068
|
-
module.exports = require("http");
|
|
15069
15411
|
|
|
15070
15412
|
/***/ }),
|
|
15071
15413
|
|
|
15072
|
-
/***/
|
|
15073
|
-
/***/ ((
|
|
15414
|
+
/***/ 8670:
|
|
15415
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
15074
15416
|
|
|
15075
15417
|
"use strict";
|
|
15076
|
-
module.exports = require("http2");
|
|
15077
|
-
|
|
15078
|
-
/***/ }),
|
|
15079
|
-
|
|
15080
|
-
/***/ 5687:
|
|
15081
|
-
/***/ ((module) => {
|
|
15082
15418
|
|
|
15083
|
-
"use strict";
|
|
15084
|
-
module.exports = require("https");
|
|
15085
15419
|
|
|
15086
|
-
|
|
15420
|
+
const languages = Object.freeze({
|
|
15421
|
+
'af-ZA': 'Afrikaans',
|
|
15422
|
+
'am-ET': 'አማርኛ',
|
|
15423
|
+
'ar-AR': 'العربية',
|
|
15424
|
+
'as-IN': 'অসমীয়া',
|
|
15425
|
+
'az-AZ': 'Azərbaycan dili',
|
|
15426
|
+
'be-BY': 'Беларуская',
|
|
15427
|
+
'bg-BG': 'Български',
|
|
15428
|
+
'bn-IN': 'বাংলা',
|
|
15429
|
+
'br-FR': 'Brezhoneg',
|
|
15430
|
+
'bs-BA': 'Bosanski',
|
|
15431
|
+
'ca-ES': 'Català',
|
|
15432
|
+
'cb-IQ': 'کوردیی ناوەندی',
|
|
15433
|
+
'co-FR': 'Corsu',
|
|
15434
|
+
'cs-CZ': 'Čeština',
|
|
15435
|
+
'cx-PH': 'Bisaya',
|
|
15436
|
+
'cy-GB': 'Cymraeg',
|
|
15437
|
+
'da-DK': 'Dansk',
|
|
15438
|
+
de: 'Deutsch',
|
|
15439
|
+
'de-DE': 'Deutsch (Deutschland)',
|
|
15440
|
+
'el-GR': 'Ελληνικά',
|
|
15441
|
+
en: 'English',
|
|
15442
|
+
'en-GB': 'English (UK)',
|
|
15443
|
+
'en-US': 'English (US)',
|
|
15444
|
+
'eo-EO': 'Esperanto',
|
|
15445
|
+
es: 'Español',
|
|
15446
|
+
'es-ES': 'Español (España)',
|
|
15447
|
+
'es-419': 'Español (Latinoamérica)',
|
|
15448
|
+
'et-EE': 'Eesti',
|
|
15449
|
+
'eu-ES': 'Euskara',
|
|
15450
|
+
'fa-IR': 'فارسی',
|
|
15451
|
+
'ff-NG': 'Fula',
|
|
15452
|
+
'fi-FI': 'Suomi',
|
|
15453
|
+
'fo-FO': 'Føroyskt',
|
|
15454
|
+
fr: 'Français',
|
|
15455
|
+
'fr-CA': 'Français (Canada)',
|
|
15456
|
+
'fr-FR': 'Français (France)',
|
|
15457
|
+
'fy-NL': 'Frysk',
|
|
15458
|
+
'ga-IE': 'Gaeilge',
|
|
15459
|
+
'gl-ES': 'Galego',
|
|
15460
|
+
'gn-PY': 'Guarani',
|
|
15461
|
+
'gu-IN': 'ગુજરાતી',
|
|
15462
|
+
'ha-NG': 'Hausa',
|
|
15463
|
+
'he-IL': 'עברית',
|
|
15464
|
+
'hi-IN': 'हिन्दी',
|
|
15465
|
+
'hr-HR': 'Hrvatski',
|
|
15466
|
+
'ht-HT': 'Kreyòl Ayisyen',
|
|
15467
|
+
'hu-HU': 'Magyar',
|
|
15468
|
+
'hy-AM': 'Հայերեն',
|
|
15469
|
+
'id-ID': 'Bahasa Indonesia',
|
|
15470
|
+
'ik-US': 'Iñupiatun',
|
|
15471
|
+
'is-IS': 'Íslenska',
|
|
15472
|
+
it: 'Italiano',
|
|
15473
|
+
'it-IT': 'italiano (Italia)',
|
|
15474
|
+
'iu-CA': 'Inuktitut',
|
|
15475
|
+
ja: '日本語',
|
|
15476
|
+
'ja-JP': '日本語',
|
|
15477
|
+
'ja-KS': '日本語(関西)',
|
|
15478
|
+
'jv-ID': 'Basa Jawa',
|
|
15479
|
+
'ka-GE': 'ქართული',
|
|
15480
|
+
'kk-KZ': 'Қазақша',
|
|
15481
|
+
'km-KH': 'ភាសាខ្មែរ',
|
|
15482
|
+
'kn-IN': 'ಕನ್ನಡ',
|
|
15483
|
+
ko: '한국어',
|
|
15484
|
+
'ko-KR': '한국어',
|
|
15485
|
+
'ku-TR': 'Kurdî (Kurmancî)',
|
|
15486
|
+
'ky-KG': 'кыргызча',
|
|
15487
|
+
'lo-LA': 'ພາສາລາວ',
|
|
15488
|
+
'lt-LT': 'Lietuvių',
|
|
15489
|
+
'lv-LV': 'Latviešu',
|
|
15490
|
+
'mg-MG': 'Malagasy',
|
|
15491
|
+
'mk-MK': 'Македонски',
|
|
15492
|
+
'ml-IN': 'മലയാളം',
|
|
15493
|
+
'mn-MN': 'Монгол',
|
|
15494
|
+
'mr-IN': 'मराठी',
|
|
15495
|
+
'ms-MY': 'Bahasa Melayu',
|
|
15496
|
+
'mt-MT': 'Malti',
|
|
15497
|
+
'my-MM': 'မြန်မာဘာသာ',
|
|
15498
|
+
'nb-NO': 'Norsk (bokmål)',
|
|
15499
|
+
'ne-NP': 'नेपाली',
|
|
15500
|
+
'nl-BE': 'Vlaams',
|
|
15501
|
+
'nl-NL': 'Nederlands',
|
|
15502
|
+
'nn-NO': 'Norsk (nynorsk)',
|
|
15503
|
+
'or-IN': 'ଓଡ଼ିଆ',
|
|
15504
|
+
'pa-IN': 'ਪੰਜਾਬੀ',
|
|
15505
|
+
'pl-PL': 'Polski',
|
|
15506
|
+
'ps-AF': 'پښتو',
|
|
15507
|
+
pt: 'português',
|
|
15508
|
+
'pt-BR': 'Português (Brasil)',
|
|
15509
|
+
'pt-PT': 'português (Portugal)',
|
|
15510
|
+
'ro-RO': 'Română',
|
|
15511
|
+
ru: 'Русский',
|
|
15512
|
+
'ru-RU': 'Русский',
|
|
15513
|
+
'rw-RW': 'Ikinyarwanda',
|
|
15514
|
+
'sc-IT': 'Sardu',
|
|
15515
|
+
'si-LK': 'සිංහල',
|
|
15516
|
+
'sk-SK': 'Slovenčina',
|
|
15517
|
+
'sl-SI': 'Slovenščina',
|
|
15518
|
+
'sn-ZW': 'Shona',
|
|
15519
|
+
'sq-AL': 'Shqip',
|
|
15520
|
+
'sr-RS': 'Српски',
|
|
15521
|
+
'sv-SE': 'Svenska',
|
|
15522
|
+
'sw-KE': 'Kiswahili',
|
|
15523
|
+
'sy-SY': 'ܣܘܪܝܝܐ',
|
|
15524
|
+
'sz-PL': 'ślōnskŏ gŏdka',
|
|
15525
|
+
'ta-IN': 'தமிழ்',
|
|
15526
|
+
'te-IN': 'తెలుగు',
|
|
15527
|
+
'tg-TJ': 'Тоҷикӣ',
|
|
15528
|
+
'th-TH': 'ภาษาไทย',
|
|
15529
|
+
'tl-PH': 'Filipino',
|
|
15530
|
+
tr: 'Türkçe',
|
|
15531
|
+
'tr-TR': 'Türkçe',
|
|
15532
|
+
'tt-RU': 'Татарча',
|
|
15533
|
+
'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
|
|
15534
|
+
'uk-UA': 'Українська',
|
|
15535
|
+
'ur-PK': 'اردو',
|
|
15536
|
+
'uz-UZ': "O'zbek",
|
|
15537
|
+
'vi-VN': 'Tiếng Việt',
|
|
15538
|
+
zh: '中文',
|
|
15539
|
+
'zh-CN': '简体中文',
|
|
15540
|
+
'zh-HK': '繁體中文(香港)',
|
|
15541
|
+
'zh-MO': '繁體中文(澳門)',
|
|
15542
|
+
'zh-TW': '繁體中文(台灣)',
|
|
15543
|
+
'zz-TR': 'Zaza',
|
|
15544
|
+
});
|
|
15087
15545
|
|
|
15088
|
-
|
|
15089
|
-
/***/ ((module) => {
|
|
15546
|
+
exports.languages = languages;
|
|
15090
15547
|
|
|
15091
|
-
"use strict";
|
|
15092
|
-
module.exports = require("net");
|
|
15093
15548
|
|
|
15094
15549
|
/***/ }),
|
|
15095
15550
|
|
|
15096
|
-
/***/
|
|
15097
|
-
/***/ ((
|
|
15551
|
+
/***/ 1230:
|
|
15552
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15098
15553
|
|
|
15099
15554
|
"use strict";
|
|
15100
|
-
module.exports = require("os");
|
|
15101
15555
|
|
|
15102
|
-
/***/ }),
|
|
15103
15556
|
|
|
15104
|
-
|
|
15105
|
-
|
|
15557
|
+
var _const = __nccwpck_require__(8670);
|
|
15558
|
+
var utility = __nccwpck_require__(2304);
|
|
15106
15559
|
|
|
15107
|
-
"use strict";
|
|
15108
|
-
module.exports = require("stream");
|
|
15109
15560
|
|
|
15110
|
-
/***/ }),
|
|
15111
15561
|
|
|
15112
|
-
|
|
15113
|
-
|
|
15562
|
+
exports.languages = _const.languages;
|
|
15563
|
+
exports.isLanguageTag = utility.isLanguageTag;
|
|
15564
|
+
exports.languageTagGuard = utility.languageTagGuard;
|
|
15114
15565
|
|
|
15115
|
-
"use strict";
|
|
15116
|
-
module.exports = require("tls");
|
|
15117
15566
|
|
|
15118
15567
|
/***/ }),
|
|
15119
15568
|
|
|
15120
|
-
/***/
|
|
15121
|
-
/***/ ((
|
|
15569
|
+
/***/ 2304:
|
|
15570
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15122
15571
|
|
|
15123
15572
|
"use strict";
|
|
15124
|
-
module.exports = require("url");
|
|
15125
|
-
|
|
15126
|
-
/***/ }),
|
|
15127
15573
|
|
|
15128
|
-
/***/ 3837:
|
|
15129
|
-
/***/ ((module) => {
|
|
15130
15574
|
|
|
15131
|
-
|
|
15132
|
-
|
|
15575
|
+
var zod = __nccwpck_require__(6319);
|
|
15576
|
+
var _const = __nccwpck_require__(8670);
|
|
15133
15577
|
|
|
15134
|
-
|
|
15578
|
+
const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
|
|
15579
|
+
const languageTagGuard = zod.z
|
|
15580
|
+
.any()
|
|
15581
|
+
.refine((value) => isLanguageTag(value));
|
|
15135
15582
|
|
|
15136
|
-
|
|
15137
|
-
|
|
15583
|
+
exports.isLanguageTag = isLanguageTag;
|
|
15584
|
+
exports.languageTagGuard = languageTagGuard;
|
|
15138
15585
|
|
|
15139
|
-
"use strict";
|
|
15140
|
-
module.exports = require("zlib");
|
|
15141
15586
|
|
|
15142
15587
|
/***/ })
|
|
15143
15588
|
|
|
@@ -15195,7 +15640,7 @@ module.exports = require("zlib");
|
|
|
15195
15640
|
/******/ // startup
|
|
15196
15641
|
/******/ // Load entry module and return exports
|
|
15197
15642
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
15198
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
15643
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(616);
|
|
15199
15644
|
/******/ module.exports = __webpack_exports__;
|
|
15200
15645
|
/******/
|
|
15201
15646
|
/******/ })()
|