@wise/dynamic-flow-client 3.11.5 → 3.11.6
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/build/main.js +253 -74
- package/build/main.min.js +1 -1
- package/build/main.mjs +253 -74
- package/build/types/common/errorBoundary/ErrorBoundary.d.ts +1 -1
- package/build/types/common/errorBoundary/ErrorBoundaryAlert.d.ts +1 -1
- package/build/types/common/httpClientContext/HttpClientContext.d.ts +2 -2
- package/build/types/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +1 -1
- package/build/types/legacy/common/contexts/eventsContext/EventsContext.d.ts +1 -1
- package/build/types/legacy/common/contexts/featureContext/FeatureContext.d.ts +1 -1
- package/build/types/legacy/common/contexts/logContext/LogContext.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/BackButton.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/DynamicFlow.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/DynamicFlowStep.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/utils/useLoader.d.ts +1 -1
- package/build/types/legacy/formControl/FormControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/help/Help.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +5 -5
- package/build/types/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +1 -1
- package/build/types/legacy/layout/DynamicLayout.d.ts +1 -1
- package/build/types/legacy/layout/alert/DynamicAlert.d.ts +1 -1
- package/build/types/legacy/layout/box/DynamicBox.d.ts +1 -1
- package/build/types/legacy/layout/button/DynamicButton.d.ts +1 -1
- package/build/types/legacy/layout/columns/DynamicColumns.d.ts +1 -1
- package/build/types/legacy/layout/decision/DynamicDecision.d.ts +1 -1
- package/build/types/legacy/layout/divider/DynamicDivider.d.ts +1 -1
- package/build/types/legacy/layout/external/DynamicExternal.d.ts +1 -1
- package/build/types/legacy/layout/form/DynamicForm.d.ts +1 -1
- package/build/types/legacy/layout/heading/DynamicHeading.d.ts +1 -1
- package/build/types/legacy/layout/icon/DynamicIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/FlagIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/NamedIcon.d.ts +1 -1
- package/build/types/legacy/layout/image/DynamicImage.d.ts +1 -1
- package/build/types/legacy/layout/instructions/DynamicInstructions.d.ts +1 -1
- package/build/types/legacy/layout/list/DynamicStatusList.d.ts +1 -1
- package/build/types/legacy/layout/loadingIndicator/DynamicLoadingIndicator.d.ts +1 -1
- package/build/types/legacy/layout/markdown/DynamicMarkdown.d.ts +2 -2
- package/build/types/legacy/layout/modal/DynamicModal.d.ts +1 -1
- package/build/types/legacy/layout/paragraph/DynamicParagraph.d.ts +1 -1
- package/build/types/legacy/layout/review/DynamicReview.d.ts +1 -1
- package/build/types/legacy/layout/search/DynamicSearch.d.ts +1 -1
- package/build/types/legacy/layout/search/SearchInput.d.ts +1 -1
- package/build/types/legacy/layout/search/SearchResults.d.ts +2 -2
- package/build/types/legacy/layout/utils/getNavigationOptionMedia.d.ts +3 -3
- package/build/types/legacy/step/cameraStep/CameraStep.d.ts +1 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/CameraCapture.d.ts +1 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.d.ts +2 -2
- package/build/types/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.d.ts +1 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +1 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.d.ts +1 -1
- package/build/types/legacy/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +1 -1
- package/build/types/legacy/step/layoutStep/LayoutStep.d.ts +1 -1
- package/build/types/legacy/test-utils/DynamicFlowProviders.d.ts +1 -1
- package/build/types/legacy/test-utils/legacy-utils.d.ts +1 -1
- package/build/types/revamp/DynamicFlowCore.d.ts +1 -1
- package/build/types/revamp/DynamicFlowWise.d.ts +1 -1
- package/build/types/revamp/domain/components/AllOfComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ConstComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/StepDomainComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +3 -3
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +1 -1
- package/build/types/revamp/domain/features/validationAsync/getPerformValidationAsync.d.ts +1 -1
- package/build/types/revamp/flow/executeRefresh.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +3 -3
- package/build/types/revamp/wise/renderers/MultiSelectInputRenderer.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.d.ts +2 -2
- package/build/types/revamp/wise/renderers/SearchRenderer/ErrorResult.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/OptionMedia.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/Help.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/LabelContentWithHelp.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/UploadFieldInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/VariableDateInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/VariableTextInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/DynamicIcon.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/FlagIcon.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/NamedIcon.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/NavigationOptionMedia.d.ts +1 -1
- package/build/types/revamp/wise/renderers/step/BackButton.d.ts +1 -1
- package/build/types/revamp/wise/renderers/step/ExternalConfirmationDialog.d.ts +1 -1
- package/build/types/test-utils/NeptuneProviders.d.ts +1 -1
- package/package.json +28 -28
package/build/main.mjs
CHANGED
|
@@ -2002,7 +2002,7 @@ var quotelessJson = (obj) => {
|
|
|
2002
2002
|
const json = JSON.stringify(obj, null, 2);
|
|
2003
2003
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
2004
2004
|
};
|
|
2005
|
-
var ZodError = class extends Error {
|
|
2005
|
+
var ZodError = class _ZodError extends Error {
|
|
2006
2006
|
constructor(issues) {
|
|
2007
2007
|
super();
|
|
2008
2008
|
this.issues = [];
|
|
@@ -2060,6 +2060,11 @@ var ZodError = class extends Error {
|
|
|
2060
2060
|
processError(this);
|
|
2061
2061
|
return fieldErrors;
|
|
2062
2062
|
}
|
|
2063
|
+
static assert(value) {
|
|
2064
|
+
if (!(value instanceof _ZodError)) {
|
|
2065
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2063
2068
|
toString() {
|
|
2064
2069
|
return this.message;
|
|
2065
2070
|
}
|
|
@@ -2201,6 +2206,12 @@ var makeIssue = (params) => {
|
|
|
2201
2206
|
const fullIssue = __spreadProps2(__spreadValues2({}, issueData), {
|
|
2202
2207
|
path: fullPath
|
|
2203
2208
|
});
|
|
2209
|
+
if (issueData.message !== void 0) {
|
|
2210
|
+
return __spreadProps2(__spreadValues2({}, issueData), {
|
|
2211
|
+
path: fullPath,
|
|
2212
|
+
message: issueData.message
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2204
2215
|
let errorMessage = "";
|
|
2205
2216
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
2206
2217
|
for (const map of maps) {
|
|
@@ -2208,11 +2219,12 @@ var makeIssue = (params) => {
|
|
|
2208
2219
|
}
|
|
2209
2220
|
return __spreadProps2(__spreadValues2({}, issueData), {
|
|
2210
2221
|
path: fullPath,
|
|
2211
|
-
message:
|
|
2222
|
+
message: errorMessage
|
|
2212
2223
|
});
|
|
2213
2224
|
};
|
|
2214
2225
|
var EMPTY_PATH = [];
|
|
2215
2226
|
function addIssueToContext(ctx, issueData) {
|
|
2227
|
+
const overrideMap = getErrorMap();
|
|
2216
2228
|
const issue = makeIssue({
|
|
2217
2229
|
issueData,
|
|
2218
2230
|
data: ctx.data,
|
|
@@ -2220,8 +2232,8 @@ function addIssueToContext(ctx, issueData) {
|
|
|
2220
2232
|
errorMaps: [
|
|
2221
2233
|
ctx.common.contextualErrorMap,
|
|
2222
2234
|
ctx.schemaErrorMap,
|
|
2223
|
-
|
|
2224
|
-
errorMap
|
|
2235
|
+
overrideMap,
|
|
2236
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
2225
2237
|
// then global default map
|
|
2226
2238
|
].filter((x) => !!x)
|
|
2227
2239
|
});
|
|
@@ -2253,9 +2265,11 @@ var ParseStatus = class _ParseStatus {
|
|
|
2253
2265
|
static async mergeObjectAsync(status, pairs) {
|
|
2254
2266
|
const syncPairs = [];
|
|
2255
2267
|
for (const pair of pairs) {
|
|
2268
|
+
const key = await pair.key;
|
|
2269
|
+
const value = await pair.value;
|
|
2256
2270
|
syncPairs.push({
|
|
2257
|
-
key
|
|
2258
|
-
value
|
|
2271
|
+
key,
|
|
2272
|
+
value
|
|
2259
2273
|
});
|
|
2260
2274
|
}
|
|
2261
2275
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
|
@@ -2288,11 +2302,29 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
2288
2302
|
var isDirty = (x) => x.status === "dirty";
|
|
2289
2303
|
var isValid = (x) => x.status === "valid";
|
|
2290
2304
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2305
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2306
|
+
if (kind === "a" && !f)
|
|
2307
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
2308
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2309
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2310
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2311
|
+
}
|
|
2312
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2313
|
+
if (kind === "m")
|
|
2314
|
+
throw new TypeError("Private method is not writable");
|
|
2315
|
+
if (kind === "a" && !f)
|
|
2316
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
2317
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2318
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2319
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
2320
|
+
}
|
|
2291
2321
|
var errorUtil;
|
|
2292
2322
|
(function(errorUtil2) {
|
|
2293
2323
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2294
2324
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
2295
2325
|
})(errorUtil || (errorUtil = {}));
|
|
2326
|
+
var _ZodEnum_cache;
|
|
2327
|
+
var _ZodNativeEnum_cache;
|
|
2296
2328
|
var ParseInputLazyPath = class {
|
|
2297
2329
|
constructor(parent, value, path, key) {
|
|
2298
2330
|
this._cachedPath = [];
|
|
@@ -2341,12 +2373,17 @@ function processCreateParams(params) {
|
|
|
2341
2373
|
if (errorMap2)
|
|
2342
2374
|
return { errorMap: errorMap2, description };
|
|
2343
2375
|
const customMap = (iss, ctx) => {
|
|
2344
|
-
|
|
2345
|
-
|
|
2376
|
+
var _a, _b;
|
|
2377
|
+
const { message } = params;
|
|
2378
|
+
if (iss.code === "invalid_enum_value") {
|
|
2379
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
2380
|
+
}
|
|
2346
2381
|
if (typeof ctx.data === "undefined") {
|
|
2347
|
-
return { message:
|
|
2382
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
2348
2383
|
}
|
|
2349
|
-
|
|
2384
|
+
if (iss.code !== "invalid_type")
|
|
2385
|
+
return { message: ctx.defaultError };
|
|
2386
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
2350
2387
|
};
|
|
2351
2388
|
return { errorMap: customMap, description };
|
|
2352
2389
|
}
|
|
@@ -2588,35 +2625,40 @@ var ZodType = class {
|
|
|
2588
2625
|
}
|
|
2589
2626
|
};
|
|
2590
2627
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
2591
|
-
var cuid2Regex = /^[
|
|
2628
|
+
var cuid2Regex = /^[0-9a-z]+$/;
|
|
2592
2629
|
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
2593
2630
|
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
|
2594
|
-
var
|
|
2631
|
+
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
2632
|
+
var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
2633
|
+
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
2595
2634
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
2596
2635
|
var emojiRegex;
|
|
2597
|
-
var ipv4Regex = /^((
|
|
2636
|
+
var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
2598
2637
|
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
|
2599
|
-
var
|
|
2638
|
+
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
2639
|
+
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
2640
|
+
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2641
|
+
function timeRegexSource(args) {
|
|
2642
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
2600
2643
|
if (args.precision) {
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
2605
|
-
}
|
|
2606
|
-
} else if (args.precision === 0) {
|
|
2607
|
-
if (args.offset) {
|
|
2608
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
|
|
2609
|
-
} else {
|
|
2610
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
2611
|
-
}
|
|
2612
|
-
} else {
|
|
2613
|
-
if (args.offset) {
|
|
2614
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
|
|
2615
|
-
} else {
|
|
2616
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
2617
|
-
}
|
|
2644
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
|
2645
|
+
} else if (args.precision == null) {
|
|
2646
|
+
regex = `${regex}(\\.\\d+)?`;
|
|
2618
2647
|
}
|
|
2619
|
-
|
|
2648
|
+
return regex;
|
|
2649
|
+
}
|
|
2650
|
+
function timeRegex(args) {
|
|
2651
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
2652
|
+
}
|
|
2653
|
+
function datetimeRegex(args) {
|
|
2654
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
2655
|
+
const opts = [];
|
|
2656
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
2657
|
+
if (args.offset)
|
|
2658
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
2659
|
+
regex = `${regex}(${opts.join("|")})`;
|
|
2660
|
+
return new RegExp(`^${regex}$`);
|
|
2661
|
+
}
|
|
2620
2662
|
function isValidIP(ip, version) {
|
|
2621
2663
|
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
|
2622
2664
|
return true;
|
|
@@ -2634,15 +2676,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2634
2676
|
const parsedType = this._getType(input);
|
|
2635
2677
|
if (parsedType !== ZodParsedType.string) {
|
|
2636
2678
|
const ctx2 = this._getOrReturnCtx(input);
|
|
2637
|
-
addIssueToContext(
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
received: ctx2.parsedType
|
|
2643
|
-
}
|
|
2644
|
-
//
|
|
2645
|
-
);
|
|
2679
|
+
addIssueToContext(ctx2, {
|
|
2680
|
+
code: ZodIssueCode.invalid_type,
|
|
2681
|
+
expected: ZodParsedType.string,
|
|
2682
|
+
received: ctx2.parsedType
|
|
2683
|
+
});
|
|
2646
2684
|
return INVALID;
|
|
2647
2685
|
}
|
|
2648
2686
|
const status = new ParseStatus();
|
|
@@ -2733,6 +2771,16 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2733
2771
|
});
|
|
2734
2772
|
status.dirty();
|
|
2735
2773
|
}
|
|
2774
|
+
} else if (check.kind === "nanoid") {
|
|
2775
|
+
if (!nanoidRegex.test(input.data)) {
|
|
2776
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2777
|
+
addIssueToContext(ctx, {
|
|
2778
|
+
validation: "nanoid",
|
|
2779
|
+
code: ZodIssueCode.invalid_string,
|
|
2780
|
+
message: check.message
|
|
2781
|
+
});
|
|
2782
|
+
status.dirty();
|
|
2783
|
+
}
|
|
2736
2784
|
} else if (check.kind === "cuid") {
|
|
2737
2785
|
if (!cuidRegex.test(input.data)) {
|
|
2738
2786
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2834,6 +2882,38 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2834
2882
|
});
|
|
2835
2883
|
status.dirty();
|
|
2836
2884
|
}
|
|
2885
|
+
} else if (check.kind === "date") {
|
|
2886
|
+
const regex = dateRegex;
|
|
2887
|
+
if (!regex.test(input.data)) {
|
|
2888
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2889
|
+
addIssueToContext(ctx, {
|
|
2890
|
+
code: ZodIssueCode.invalid_string,
|
|
2891
|
+
validation: "date",
|
|
2892
|
+
message: check.message
|
|
2893
|
+
});
|
|
2894
|
+
status.dirty();
|
|
2895
|
+
}
|
|
2896
|
+
} else if (check.kind === "time") {
|
|
2897
|
+
const regex = timeRegex(check);
|
|
2898
|
+
if (!regex.test(input.data)) {
|
|
2899
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2900
|
+
addIssueToContext(ctx, {
|
|
2901
|
+
code: ZodIssueCode.invalid_string,
|
|
2902
|
+
validation: "time",
|
|
2903
|
+
message: check.message
|
|
2904
|
+
});
|
|
2905
|
+
status.dirty();
|
|
2906
|
+
}
|
|
2907
|
+
} else if (check.kind === "duration") {
|
|
2908
|
+
if (!durationRegex.test(input.data)) {
|
|
2909
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2910
|
+
addIssueToContext(ctx, {
|
|
2911
|
+
validation: "duration",
|
|
2912
|
+
code: ZodIssueCode.invalid_string,
|
|
2913
|
+
message: check.message
|
|
2914
|
+
});
|
|
2915
|
+
status.dirty();
|
|
2916
|
+
}
|
|
2837
2917
|
} else if (check.kind === "ip") {
|
|
2838
2918
|
if (!isValidIP(input.data, check.version)) {
|
|
2839
2919
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2844,6 +2924,16 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2844
2924
|
});
|
|
2845
2925
|
status.dirty();
|
|
2846
2926
|
}
|
|
2927
|
+
} else if (check.kind === "base64") {
|
|
2928
|
+
if (!base64Regex.test(input.data)) {
|
|
2929
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2930
|
+
addIssueToContext(ctx, {
|
|
2931
|
+
validation: "base64",
|
|
2932
|
+
code: ZodIssueCode.invalid_string,
|
|
2933
|
+
message: check.message
|
|
2934
|
+
});
|
|
2935
|
+
status.dirty();
|
|
2936
|
+
}
|
|
2847
2937
|
} else {
|
|
2848
2938
|
util.assertNever(check);
|
|
2849
2939
|
}
|
|
@@ -2873,6 +2963,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2873
2963
|
uuid(message) {
|
|
2874
2964
|
return this._addCheck(__spreadValues2({ kind: "uuid" }, errorUtil.errToObj(message)));
|
|
2875
2965
|
}
|
|
2966
|
+
nanoid(message) {
|
|
2967
|
+
return this._addCheck(__spreadValues2({ kind: "nanoid" }, errorUtil.errToObj(message)));
|
|
2968
|
+
}
|
|
2876
2969
|
cuid(message) {
|
|
2877
2970
|
return this._addCheck(__spreadValues2({ kind: "cuid" }, errorUtil.errToObj(message)));
|
|
2878
2971
|
}
|
|
@@ -2882,25 +2975,49 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2882
2975
|
ulid(message) {
|
|
2883
2976
|
return this._addCheck(__spreadValues2({ kind: "ulid" }, errorUtil.errToObj(message)));
|
|
2884
2977
|
}
|
|
2978
|
+
base64(message) {
|
|
2979
|
+
return this._addCheck(__spreadValues2({ kind: "base64" }, errorUtil.errToObj(message)));
|
|
2980
|
+
}
|
|
2885
2981
|
ip(options) {
|
|
2886
2982
|
return this._addCheck(__spreadValues2({ kind: "ip" }, errorUtil.errToObj(options)));
|
|
2887
2983
|
}
|
|
2888
2984
|
datetime(options) {
|
|
2889
|
-
var _a;
|
|
2985
|
+
var _a, _b;
|
|
2890
2986
|
if (typeof options === "string") {
|
|
2891
2987
|
return this._addCheck({
|
|
2892
2988
|
kind: "datetime",
|
|
2893
2989
|
precision: null,
|
|
2894
2990
|
offset: false,
|
|
2991
|
+
local: false,
|
|
2895
2992
|
message: options
|
|
2896
2993
|
});
|
|
2897
2994
|
}
|
|
2898
2995
|
return this._addCheck(__spreadValues2({
|
|
2899
2996
|
kind: "datetime",
|
|
2900
2997
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
2901
|
-
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false
|
|
2998
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
2999
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false
|
|
2902
3000
|
}, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
|
|
2903
3001
|
}
|
|
3002
|
+
date(message) {
|
|
3003
|
+
return this._addCheck({ kind: "date", message });
|
|
3004
|
+
}
|
|
3005
|
+
time(options) {
|
|
3006
|
+
if (typeof options === "string") {
|
|
3007
|
+
return this._addCheck({
|
|
3008
|
+
kind: "time",
|
|
3009
|
+
precision: null,
|
|
3010
|
+
message: options
|
|
3011
|
+
});
|
|
3012
|
+
}
|
|
3013
|
+
return this._addCheck(__spreadValues2({
|
|
3014
|
+
kind: "time",
|
|
3015
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision
|
|
3016
|
+
}, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
|
|
3017
|
+
}
|
|
3018
|
+
duration(message) {
|
|
3019
|
+
return this._addCheck(__spreadValues2({ kind: "duration" }, errorUtil.errToObj(message)));
|
|
3020
|
+
}
|
|
2904
3021
|
regex(regex, message) {
|
|
2905
3022
|
return this._addCheck(__spreadValues2({
|
|
2906
3023
|
kind: "regex",
|
|
@@ -2969,6 +3086,15 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2969
3086
|
get isDatetime() {
|
|
2970
3087
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
2971
3088
|
}
|
|
3089
|
+
get isDate() {
|
|
3090
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
|
3091
|
+
}
|
|
3092
|
+
get isTime() {
|
|
3093
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
|
3094
|
+
}
|
|
3095
|
+
get isDuration() {
|
|
3096
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
|
3097
|
+
}
|
|
2972
3098
|
get isEmail() {
|
|
2973
3099
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
2974
3100
|
}
|
|
@@ -2981,6 +3107,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2981
3107
|
get isUUID() {
|
|
2982
3108
|
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
|
2983
3109
|
}
|
|
3110
|
+
get isNANOID() {
|
|
3111
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
|
3112
|
+
}
|
|
2984
3113
|
get isCUID() {
|
|
2985
3114
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
2986
3115
|
}
|
|
@@ -2993,6 +3122,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2993
3122
|
get isIP() {
|
|
2994
3123
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
2995
3124
|
}
|
|
3125
|
+
get isBase64() {
|
|
3126
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
3127
|
+
}
|
|
2996
3128
|
get minLength() {
|
|
2997
3129
|
let min = null;
|
|
2998
3130
|
for (const ch of this._def.checks) {
|
|
@@ -3883,9 +4015,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3883
4015
|
const syncPairs = [];
|
|
3884
4016
|
for (const pair of pairs) {
|
|
3885
4017
|
const key = await pair.key;
|
|
4018
|
+
const value = await pair.value;
|
|
3886
4019
|
syncPairs.push({
|
|
3887
4020
|
key,
|
|
3888
|
-
value
|
|
4021
|
+
value,
|
|
3889
4022
|
alwaysSet: pair.alwaysSet
|
|
3890
4023
|
});
|
|
3891
4024
|
}
|
|
@@ -4212,15 +4345,25 @@ var getDiscriminator = (type) => {
|
|
|
4212
4345
|
} else if (type instanceof ZodEnum) {
|
|
4213
4346
|
return type.options;
|
|
4214
4347
|
} else if (type instanceof ZodNativeEnum) {
|
|
4215
|
-
return
|
|
4348
|
+
return util.objectValues(type.enum);
|
|
4216
4349
|
} else if (type instanceof ZodDefault) {
|
|
4217
4350
|
return getDiscriminator(type._def.innerType);
|
|
4218
4351
|
} else if (type instanceof ZodUndefined) {
|
|
4219
4352
|
return [void 0];
|
|
4220
4353
|
} else if (type instanceof ZodNull) {
|
|
4221
4354
|
return [null];
|
|
4355
|
+
} else if (type instanceof ZodOptional) {
|
|
4356
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
4357
|
+
} else if (type instanceof ZodNullable) {
|
|
4358
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
|
4359
|
+
} else if (type instanceof ZodBranded) {
|
|
4360
|
+
return getDiscriminator(type.unwrap());
|
|
4361
|
+
} else if (type instanceof ZodReadonly) {
|
|
4362
|
+
return getDiscriminator(type.unwrap());
|
|
4363
|
+
} else if (type instanceof ZodCatch) {
|
|
4364
|
+
return getDiscriminator(type._def.innerType);
|
|
4222
4365
|
} else {
|
|
4223
|
-
return
|
|
4366
|
+
return [];
|
|
4224
4367
|
}
|
|
4225
4368
|
};
|
|
4226
4369
|
var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
@@ -4280,7 +4423,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
4280
4423
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
4281
4424
|
for (const type of options) {
|
|
4282
4425
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
4283
|
-
if (!discriminatorValues) {
|
|
4426
|
+
if (!discriminatorValues.length) {
|
|
4284
4427
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
4285
4428
|
}
|
|
4286
4429
|
for (const value of discriminatorValues) {
|
|
@@ -4476,7 +4619,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
|
|
|
4476
4619
|
for (const key in ctx.data) {
|
|
4477
4620
|
pairs.push({
|
|
4478
4621
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
4479
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
|
4622
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
4623
|
+
alwaysSet: key in ctx.data
|
|
4480
4624
|
});
|
|
4481
4625
|
}
|
|
4482
4626
|
if (ctx.common.async) {
|
|
@@ -4808,6 +4952,10 @@ function createZodEnum(values, params) {
|
|
|
4808
4952
|
}, processCreateParams(params)));
|
|
4809
4953
|
}
|
|
4810
4954
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4955
|
+
constructor() {
|
|
4956
|
+
super(...arguments);
|
|
4957
|
+
_ZodEnum_cache.set(this, void 0);
|
|
4958
|
+
}
|
|
4811
4959
|
_parse(input) {
|
|
4812
4960
|
if (typeof input.data !== "string") {
|
|
4813
4961
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4819,7 +4967,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4819
4967
|
});
|
|
4820
4968
|
return INVALID;
|
|
4821
4969
|
}
|
|
4822
|
-
if (this
|
|
4970
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
|
4971
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
4972
|
+
}
|
|
4973
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
4823
4974
|
const ctx = this._getOrReturnCtx(input);
|
|
4824
4975
|
const expectedValues = this._def.values;
|
|
4825
4976
|
addIssueToContext(ctx, {
|
|
@@ -4855,15 +5006,20 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4855
5006
|
}
|
|
4856
5007
|
return enumValues;
|
|
4857
5008
|
}
|
|
4858
|
-
extract(values) {
|
|
4859
|
-
return _ZodEnum.create(values);
|
|
5009
|
+
extract(values, newDef = this._def) {
|
|
5010
|
+
return _ZodEnum.create(values, __spreadValues2(__spreadValues2({}, this._def), newDef));
|
|
4860
5011
|
}
|
|
4861
|
-
exclude(values) {
|
|
4862
|
-
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
|
|
5012
|
+
exclude(values, newDef = this._def) {
|
|
5013
|
+
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), __spreadValues2(__spreadValues2({}, this._def), newDef));
|
|
4863
5014
|
}
|
|
4864
5015
|
};
|
|
5016
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4865
5017
|
ZodEnum.create = createZodEnum;
|
|
4866
5018
|
var ZodNativeEnum = class extends ZodType {
|
|
5019
|
+
constructor() {
|
|
5020
|
+
super(...arguments);
|
|
5021
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
5022
|
+
}
|
|
4867
5023
|
_parse(input) {
|
|
4868
5024
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
4869
5025
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4876,7 +5032,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4876
5032
|
});
|
|
4877
5033
|
return INVALID;
|
|
4878
5034
|
}
|
|
4879
|
-
if (
|
|
5035
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
|
5036
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
5037
|
+
}
|
|
5038
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
4880
5039
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
4881
5040
|
addIssueToContext(ctx, {
|
|
4882
5041
|
received: ctx.data,
|
|
@@ -4891,6 +5050,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4891
5050
|
return this._def.values;
|
|
4892
5051
|
}
|
|
4893
5052
|
};
|
|
5053
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4894
5054
|
ZodNativeEnum.create = (values, params) => {
|
|
4895
5055
|
return new ZodNativeEnum(__spreadValues2({
|
|
4896
5056
|
values,
|
|
@@ -4952,26 +5112,38 @@ var ZodEffects = class extends ZodType {
|
|
|
4952
5112
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
4953
5113
|
if (effect.type === "preprocess") {
|
|
4954
5114
|
const processed = effect.transform(ctx.data, checkCtx);
|
|
4955
|
-
if (ctx.common.issues.length) {
|
|
4956
|
-
return {
|
|
4957
|
-
status: "dirty",
|
|
4958
|
-
value: ctx.data
|
|
4959
|
-
};
|
|
4960
|
-
}
|
|
4961
5115
|
if (ctx.common.async) {
|
|
4962
|
-
return Promise.resolve(processed).then((processed2) => {
|
|
4963
|
-
|
|
5116
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
|
5117
|
+
if (status.value === "aborted")
|
|
5118
|
+
return INVALID;
|
|
5119
|
+
const result = await this._def.schema._parseAsync({
|
|
4964
5120
|
data: processed2,
|
|
4965
5121
|
path: ctx.path,
|
|
4966
5122
|
parent: ctx
|
|
4967
5123
|
});
|
|
5124
|
+
if (result.status === "aborted")
|
|
5125
|
+
return INVALID;
|
|
5126
|
+
if (result.status === "dirty")
|
|
5127
|
+
return DIRTY(result.value);
|
|
5128
|
+
if (status.value === "dirty")
|
|
5129
|
+
return DIRTY(result.value);
|
|
5130
|
+
return result;
|
|
4968
5131
|
});
|
|
4969
5132
|
} else {
|
|
4970
|
-
|
|
5133
|
+
if (status.value === "aborted")
|
|
5134
|
+
return INVALID;
|
|
5135
|
+
const result = this._def.schema._parseSync({
|
|
4971
5136
|
data: processed,
|
|
4972
5137
|
path: ctx.path,
|
|
4973
5138
|
parent: ctx
|
|
4974
5139
|
});
|
|
5140
|
+
if (result.status === "aborted")
|
|
5141
|
+
return INVALID;
|
|
5142
|
+
if (result.status === "dirty")
|
|
5143
|
+
return DIRTY(result.value);
|
|
5144
|
+
if (status.value === "dirty")
|
|
5145
|
+
return DIRTY(result.value);
|
|
5146
|
+
return result;
|
|
4975
5147
|
}
|
|
4976
5148
|
}
|
|
4977
5149
|
if (effect.type === "refinement") {
|
|
@@ -5249,10 +5421,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
|
5249
5421
|
var ZodReadonly = class extends ZodType {
|
|
5250
5422
|
_parse(input) {
|
|
5251
5423
|
const result = this._def.innerType._parse(input);
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5424
|
+
const freeze = (data) => {
|
|
5425
|
+
if (isValid(data)) {
|
|
5426
|
+
data.value = Object.freeze(data.value);
|
|
5427
|
+
}
|
|
5428
|
+
return data;
|
|
5429
|
+
};
|
|
5430
|
+
return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
|
|
5431
|
+
}
|
|
5432
|
+
unwrap() {
|
|
5433
|
+
return this._def.innerType;
|
|
5256
5434
|
}
|
|
5257
5435
|
};
|
|
5258
5436
|
ZodReadonly.create = (type, params) => {
|
|
@@ -5261,7 +5439,7 @@ ZodReadonly.create = (type, params) => {
|
|
|
5261
5439
|
typeName: ZodFirstPartyTypeKind.ZodReadonly
|
|
5262
5440
|
}, processCreateParams(params)));
|
|
5263
5441
|
};
|
|
5264
|
-
|
|
5442
|
+
function custom(check, params = {}, fatal) {
|
|
5265
5443
|
if (check)
|
|
5266
5444
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5267
5445
|
var _a, _b;
|
|
@@ -5273,7 +5451,7 @@ var custom = (check, params = {}, fatal) => {
|
|
|
5273
5451
|
}
|
|
5274
5452
|
});
|
|
5275
5453
|
return ZodAny.create();
|
|
5276
|
-
}
|
|
5454
|
+
}
|
|
5277
5455
|
var late = {
|
|
5278
5456
|
object: ZodObject.lazycreate
|
|
5279
5457
|
};
|
|
@@ -5391,6 +5569,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5391
5569
|
ZodParsedType,
|
|
5392
5570
|
getParsedType,
|
|
5393
5571
|
ZodType,
|
|
5572
|
+
datetimeRegex,
|
|
5394
5573
|
ZodString,
|
|
5395
5574
|
ZodNumber,
|
|
5396
5575
|
ZodBigInt,
|
|
@@ -10399,15 +10578,15 @@ var AlertRenderer = {
|
|
|
10399
10578
|
};
|
|
10400
10579
|
var AlertRenderer_default = AlertRenderer;
|
|
10401
10580
|
|
|
10402
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.
|
|
10581
|
+
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
10403
10582
|
import * as $2AODx$react from "react";
|
|
10404
10583
|
|
|
10405
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.
|
|
10584
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
10406
10585
|
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
|
|
10407
10586
|
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : () => {
|
|
10408
10587
|
};
|
|
10409
10588
|
|
|
10410
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.
|
|
10589
|
+
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
10411
10590
|
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
|
|
10412
10591
|
var $1746a345f3d73bb7$var$count = 0;
|
|
10413
10592
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
@@ -10423,7 +10602,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
10423
10602
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
10424
10603
|
}
|
|
10425
10604
|
|
|
10426
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.36.0_@types+react@18.
|
|
10605
|
+
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.36.0_@types+react@18.3.3_react@18.3.1/node_modules/@wise/forms/dist/index.mjs
|
|
10427
10606
|
var import_classnames = __toESM(require_classnames(), 1);
|
|
10428
10607
|
import { InlineAlert, Sentiment as Sentiment2, Input, TextArea } from "@transferwise/components";
|
|
10429
10608
|
import { createContext as createContext2, useContext as useContext2, forwardRef } from "react";
|
|
@@ -10794,7 +10973,7 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
10794
10973
|
// src/revamp/wise/renderers/DecisionRenderer.tsx
|
|
10795
10974
|
import { NavigationOptionsList, NavigationOption } from "@transferwise/components";
|
|
10796
10975
|
|
|
10797
|
-
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.
|
|
10976
|
+
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.3.1_react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
10798
10977
|
import { useState as useState3, useEffect as useEffect2, forwardRef as forwardRef2 } from "react";
|
|
10799
10978
|
import { jsx as jsx18, jsxs as jsxs5, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
10800
10979
|
var unknownFlagName = "wise";
|
|
@@ -15,6 +15,6 @@ declare class ErrorBoundary extends Component<Props, State> {
|
|
|
15
15
|
constructor(props: Props);
|
|
16
16
|
componentDidCatch(error: Error): void;
|
|
17
17
|
handleErrorReset: () => void;
|
|
18
|
-
render(): JSX.Element;
|
|
18
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
}
|
|
20
20
|
export default ErrorBoundary;
|
|
@@ -4,12 +4,12 @@ type ProviderProps = {
|
|
|
4
4
|
httpClient: HttpClient;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare function HttpClientProvider({ httpClient, children }: ProviderProps): JSX.Element;
|
|
7
|
+
export declare function HttpClientProvider({ httpClient, children }: ProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
type ProviderFromBaseUrlProps = {
|
|
9
9
|
baseUrl: string;
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
};
|
|
12
|
-
export declare function HttpClientProviderFromBaseUrl({ baseUrl, children }: ProviderFromBaseUrlProps): JSX.Element;
|
|
12
|
+
export declare function HttpClientProviderFromBaseUrl({ baseUrl, children }: ProviderFromBaseUrlProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
/**
|
|
14
14
|
* Provides the fetch(er) function for dynamic flows asynchronous operations.
|
|
15
15
|
*/
|
|
@@ -3,7 +3,7 @@ type Props = {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
};
|
|
6
|
-
export declare const DynamicFlowProvider: ({ loading, children }: Props) => JSX.Element;
|
|
6
|
+
export declare const DynamicFlowProvider: ({ loading, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const useDynamicFlow: () => {
|
|
8
8
|
loading: boolean;
|
|
9
9
|
registerPersistAsyncPromise: (promise: Promise<unknown>) => void;
|