@burdenoff/microfe-admin 2026.1030.2 → 2026.1109.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/AdminRoot.d.ts +29 -0
- package/dist/admin/AdminRoot.js +34 -31
- package/dist/admin/AdminRoot.js.map +1 -1
- package/dist/admin/AdminRoutes.d.ts +28 -0
- package/dist/admin/AdminRoutes.js +17 -18
- package/dist/admin/AdminRoutes.js.map +1 -1
- package/dist/admin/components/AccessDenied.d.ts +6 -0
- package/dist/admin/components/AccessDenied.js +1 -2
- package/dist/admin/components/AccessDenied.js.map +1 -1
- package/dist/admin/components/ActivityFeed.d.ts +18 -0
- package/dist/admin/components/ActivityFeed.js +23 -24
- package/dist/admin/components/ActivityFeed.js.map +1 -1
- package/dist/admin/components/Charts.d.ts +31 -0
- package/dist/admin/components/Charts.js +14 -15
- package/dist/admin/components/Charts.js.map +1 -1
- package/dist/admin/components/ConfirmDialog.d.ts +43 -0
- package/dist/admin/components/ConfirmDialog.js +7 -8
- package/dist/admin/components/ConfirmDialog.js.map +1 -1
- package/dist/admin/components/DataTable.d.ts +62 -0
- package/dist/admin/components/DataTable.js +37 -38
- package/dist/admin/components/DataTable.js.map +1 -1
- package/dist/admin/components/FormSheet.d.ts +78 -0
- package/dist/admin/components/FormSheet.js +1 -2
- package/dist/admin/components/FormSheet.js.map +1 -1
- package/dist/admin/components/MarkdownEditor.d.ts +27 -0
- package/dist/admin/components/MarkdownEditor.js +1 -2
- package/dist/admin/components/MarkdownEditor.js.map +1 -1
- package/dist/admin/components/MetricCard.d.ts +43 -0
- package/dist/admin/components/MetricCard.js +9 -10
- package/dist/admin/components/MetricCard.js.map +1 -1
- package/dist/admin/components/PageLayout.d.ts +43 -0
- package/dist/admin/components/PageLayout.js +1 -2
- package/dist/admin/components/PageLayout.js.map +1 -1
- package/dist/admin/components/PermissionGuard.d.ts +10 -0
- package/dist/admin/components/PermissionGuard.js +1 -2
- package/dist/admin/components/PermissionGuard.js.map +1 -1
- package/dist/admin/components/RowActions.d.ts +39 -0
- package/dist/admin/components/RowActions.js +13 -14
- package/dist/admin/components/RowActions.js.map +1 -1
- package/dist/admin/components/StatusBadge.d.ts +33 -0
- package/dist/admin/components/StatusBadge.js +11 -12
- package/dist/admin/components/StatusBadge.js.map +1 -1
- package/dist/admin/components/TenantMembersPanel.d.ts +12 -0
- package/dist/admin/components/TenantMembersPanel.js +25 -26
- package/dist/admin/components/TenantMembersPanel.js.map +1 -1
- package/dist/admin/components/TenantSsoPanel.d.ts +6 -0
- package/dist/admin/components/TenantSsoPanel.js +21 -22
- package/dist/admin/components/TenantSsoPanel.js.map +1 -1
- package/dist/admin/components/Toast.d.ts +24 -0
- package/dist/admin/components/Toast.js +1 -2
- package/dist/admin/components/Toast.js.map +1 -1
- package/dist/admin/components/forms/SubscriptionForm.d.ts +56 -0
- package/dist/admin/components/forms/SubscriptionForm.js +22 -23
- package/dist/admin/components/forms/SubscriptionForm.js.map +1 -1
- package/dist/admin/components/forms/TenantForm.d.ts +67 -0
- package/dist/admin/components/forms/TenantForm.js +52 -50
- package/dist/admin/components/forms/TenantForm.js.map +1 -1
- package/dist/admin/components/forms/TicketForm.d.ts +66 -0
- package/dist/admin/components/forms/TicketForm.js +4 -5
- package/dist/admin/components/forms/TicketForm.js.map +1 -1
- package/dist/admin/components/forms/UserForm.d.ts +56 -0
- package/dist/admin/components/forms/UserForm.js +39 -40
- package/dist/admin/components/forms/UserForm.js.map +1 -1
- package/dist/admin/components/forms/index.d.ts +4 -0
- package/dist/admin/components/forms/index.js +4 -3
- package/dist/admin/components/index.d.ts +15 -0
- package/dist/admin/components/index.js +18 -17
- package/dist/admin/components/ui.d.ts +58 -0
- package/dist/admin/components/ui.js +1 -2
- package/dist/admin/components/ui.js.map +1 -1
- package/dist/admin/constants/featureFlags.d.ts +8 -0
- package/dist/admin/constants/featureFlags.js +1 -2
- package/dist/admin/constants/featureFlags.js.map +1 -1
- package/dist/admin/constants/index.d.ts +75 -0
- package/dist/admin/constants/index.js +1 -2
- package/dist/admin/constants/index.js.map +1 -1
- package/dist/admin/constants/permissions.d.ts +28 -0
- package/dist/admin/constants/permissions.js +1 -2
- package/dist/admin/constants/permissions.js.map +1 -1
- package/dist/admin/hooks/useAdminPermissions.d.ts +40 -0
- package/dist/admin/hooks/useAdminPermissions.js +2 -3
- package/dist/admin/hooks/useAdminPermissions.js.map +1 -1
- package/dist/admin/hooks/useTr.d.ts +16 -0
- package/dist/admin/hooks/useTr.js +1 -2
- package/dist/admin/hooks/useTr.js.map +1 -1
- package/dist/admin/index.d.ts +30 -0
- package/dist/admin/index.js +9 -8
- package/dist/admin/pages/AiSpendPage.d.ts +1 -0
- package/dist/admin/pages/AiSpendPage.js +130 -131
- package/dist/admin/pages/AiSpendPage.js.map +1 -1
- package/dist/admin/pages/AuditLogsPage.d.ts +4 -0
- package/dist/admin/pages/AuditLogsPage.js +17 -18
- package/dist/admin/pages/AuditLogsPage.js.map +1 -1
- package/dist/admin/pages/BillingPage.d.ts +1 -0
- package/dist/admin/pages/BillingPage.js +17 -18
- package/dist/admin/pages/BillingPage.js.map +1 -1
- package/dist/admin/pages/CommunicationsPage.d.ts +1 -0
- package/dist/admin/pages/CommunicationsPage.js +15 -16
- package/dist/admin/pages/CommunicationsPage.js.map +1 -1
- package/dist/admin/pages/ContentPagesPage.d.ts +1 -0
- package/dist/admin/pages/ContentPagesPage.js +120 -121
- package/dist/admin/pages/ContentPagesPage.js.map +1 -1
- package/dist/admin/pages/DashboardPage.d.ts +4 -0
- package/dist/admin/pages/DashboardPage.js +1 -2
- package/dist/admin/pages/DashboardPage.js.map +1 -1
- package/dist/admin/pages/ExploreConversationsPage.d.ts +12 -0
- package/dist/admin/pages/ExploreConversationsPage.js +48 -46
- package/dist/admin/pages/ExploreConversationsPage.js.map +1 -1
- package/dist/admin/pages/FeatureFlagsPage.d.ts +1 -0
- package/dist/admin/pages/FeatureFlagsPage.js +1 -2
- package/dist/admin/pages/FeatureFlagsPage.js.map +1 -1
- package/dist/admin/pages/OrganizationsListPage.d.ts +1 -0
- package/dist/admin/pages/OrganizationsListPage.js +1 -2
- package/dist/admin/pages/OrganizationsListPage.js.map +1 -1
- package/dist/admin/pages/ProductsPage.d.ts +4 -0
- package/dist/admin/pages/ProductsPage.js +27 -28
- package/dist/admin/pages/ProductsPage.js.map +1 -1
- package/dist/admin/pages/ReferralsPage.d.ts +1 -0
- package/dist/admin/pages/ReferralsPage.js +20 -25
- package/dist/admin/pages/ReferralsPage.js.map +1 -1
- package/dist/admin/pages/RolesPermissionsPage.d.ts +1 -0
- package/dist/admin/pages/RolesPermissionsPage.js +1 -2
- package/dist/admin/pages/RolesPermissionsPage.js.map +1 -1
- package/dist/admin/pages/SREPage.d.ts +4 -0
- package/dist/admin/pages/SREPage.js +22 -23
- package/dist/admin/pages/SREPage.js.map +1 -1
- package/dist/admin/pages/SandboxSettingsPage.d.ts +6 -0
- package/dist/admin/pages/SandboxSettingsPage.js +79 -84
- package/dist/admin/pages/SandboxSettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage.d.ts +4 -0
- package/dist/admin/pages/SettingsPage.js +39 -40
- package/dist/admin/pages/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SyncFailuresPage.d.ts +13 -0
- package/dist/admin/pages/SyncFailuresPage.js +121 -122
- package/dist/admin/pages/SyncFailuresPage.js.map +1 -1
- package/dist/admin/pages/TenantDetailPage.d.ts +4 -0
- package/dist/admin/pages/TenantDetailPage.js +53 -54
- package/dist/admin/pages/TenantDetailPage.js.map +1 -1
- package/dist/admin/pages/TenantFormRoutePage.d.ts +5 -0
- package/dist/admin/pages/TenantFormRoutePage.js +45 -47
- package/dist/admin/pages/TenantFormRoutePage.js.map +1 -1
- package/dist/admin/pages/TenantsListPage.d.ts +4 -0
- package/dist/admin/pages/TenantsListPage.js +35 -36
- package/dist/admin/pages/TenantsListPage.js.map +1 -1
- package/dist/admin/pages/UsersListPage.d.ts +4 -0
- package/dist/admin/pages/UsersListPage.js +29 -30
- package/dist/admin/pages/UsersListPage.js.map +1 -1
- package/dist/admin/pages/WaitlistPage.d.ts +1 -0
- package/dist/admin/pages/WaitlistPage.js +9 -10
- package/dist/admin/pages/WaitlistPage.js.map +1 -1
- package/dist/admin/pages/WorkflowsPage.d.ts +1 -0
- package/dist/admin/pages/WorkflowsPage.js +13 -14
- package/dist/admin/pages/WorkflowsPage.js.map +1 -1
- package/dist/admin/pages/WorkspacesListPage.d.ts +2 -0
- package/dist/admin/pages/WorkspacesListPage.js +25 -26
- package/dist/admin/pages/WorkspacesListPage.js.map +1 -1
- package/dist/admin/pages/aiSpend/aiSpendFormat.d.ts +34 -0
- package/dist/admin/pages/aiSpend/aiSpendFormat.js +2 -3
- package/dist/admin/pages/aiSpend/aiSpendFormat.js.map +1 -1
- package/dist/admin/pages/index.d.ts +23 -0
- package/dist/admin/pages/index.js +1 -1
- package/dist/admin/providers/AdminProvider.d.ts +11 -0
- package/dist/admin/providers/AdminProvider.js +8 -9
- package/dist/admin/providers/AdminProvider.js.map +1 -1
- package/dist/admin/schemas/index.d.ts +337 -0
- package/dist/admin/schemas/index.js +2 -3
- package/dist/admin/schemas/index.js.map +1 -1
- package/dist/admin/store/adminStore.d.ts +26 -0
- package/dist/admin/store/adminStore.js +1 -2
- package/dist/admin/store/adminStore.js.map +1 -1
- package/dist/admin/types/index.d.ts +323 -0
- package/dist/admin/utils/cn.d.ts +5 -0
- package/dist/admin/utils/cn.js +2 -3
- package/dist/admin/utils/cn.js.map +1 -1
- package/dist/admin/utils/directActivityGraphql.d.ts +10 -0
- package/dist/admin/utils/directActivityGraphql.js +1 -2
- package/dist/admin/utils/directActivityGraphql.js.map +1 -1
- package/dist/admin/utils/formatters.d.ts +32 -0
- package/dist/admin/utils/formatters.js +12 -11
- package/dist/admin/utils/formatters.js.map +1 -1
- package/dist/admin/utils/i18n.d.ts +4 -0
- package/dist/admin/utils/i18n.js +1 -2
- package/dist/admin/utils/i18n.js.map +1 -1
- package/dist/admin/utils/mappers.d.ts +13 -0
- package/dist/admin/utils/mappers.js +2 -3
- package/dist/admin/utils/mappers.js.map +1 -1
- package/dist/admin/utils/navigation.d.ts +8 -0
- package/dist/admin/utils/navigation.js +1 -2
- package/dist/admin/utils/navigation.js.map +1 -1
- package/dist/admin/utils/tenantEvents.d.ts +9 -0
- package/dist/admin/utils/tenantEvents.js +1 -2
- package/dist/admin/utils/tenantEvents.js.map +1 -1
- package/dist/dev/main.d.ts +0 -0
- package/dist/generated/global-operations.d.ts +3410 -0
- package/dist/generated/global-operations.js +137 -138
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +27174 -0
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +224 -0
- package/dist/generated/wspace-operations.js +2 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +123963 -0
- package/dist/index.d.ts +5 -0
- package/dist/node_modules/@hookform/resolvers/dist/resolvers.js +4 -5
- package/dist/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js +83 -75
- package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -2
- package/dist/node_modules/date-fns/_lib/defaultOptions.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/formatters.js +27 -21
- package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +3 -4
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +2 -5
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +1 -2
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +2 -3
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +2 -3
- package/dist/node_modules/date-fns/_lib/normalizeDates.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -2
- package/dist/node_modules/date-fns/_lib/protectedTokens.js.map +1 -1
- package/dist/node_modules/date-fns/compareAsc.js +3 -4
- package/dist/node_modules/date-fns/compareAsc.js.map +1 -1
- package/dist/node_modules/date-fns/constants.js +5 -6
- package/dist/node_modules/date-fns/constants.js.map +1 -1
- package/dist/node_modules/date-fns/constructFrom.js +2 -3
- package/dist/node_modules/date-fns/constructFrom.js.map +1 -1
- package/dist/node_modules/date-fns/constructNow.js +3 -4
- package/dist/node_modules/date-fns/constructNow.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +7 -8
- package/dist/node_modules/date-fns/differenceInCalendarDays.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +2 -3
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInMilliseconds.js +3 -4
- package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInMonths.js +3 -4
- package/dist/node_modules/date-fns/differenceInMonths.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInSeconds.js +2 -3
- package/dist/node_modules/date-fns/differenceInSeconds.js.map +1 -1
- package/dist/node_modules/date-fns/endOfDay.js +2 -3
- package/dist/node_modules/date-fns/endOfDay.js.map +1 -1
- package/dist/node_modules/date-fns/endOfMonth.js +2 -3
- package/dist/node_modules/date-fns/endOfMonth.js.map +1 -1
- package/dist/node_modules/date-fns/format.js +15 -16
- package/dist/node_modules/date-fns/format.js.map +1 -1
- package/dist/node_modules/date-fns/formatDistance.js +23 -21
- package/dist/node_modules/date-fns/formatDistance.js.map +1 -1
- package/dist/node_modules/date-fns/formatDistanceToNow.js +3 -4
- package/dist/node_modules/date-fns/formatDistanceToNow.js.map +1 -1
- package/dist/node_modules/date-fns/getDayOfYear.js +7 -8
- package/dist/node_modules/date-fns/getDayOfYear.js.map +1 -1
- package/dist/node_modules/date-fns/getISOWeek.js +6 -7
- package/dist/node_modules/date-fns/getISOWeek.js.map +1 -1
- package/dist/node_modules/date-fns/getISOWeekYear.js +8 -9
- package/dist/node_modules/date-fns/getISOWeekYear.js.map +1 -1
- package/dist/node_modules/date-fns/getWeek.js +6 -7
- package/dist/node_modules/date-fns/getWeek.js.map +1 -1
- package/dist/node_modules/date-fns/getWeekYear.js +9 -10
- package/dist/node_modules/date-fns/getWeekYear.js.map +1 -1
- package/dist/node_modules/date-fns/isDate.js +2 -3
- package/dist/node_modules/date-fns/isDate.js.map +1 -1
- package/dist/node_modules/date-fns/isLastDayOfMonth.js +7 -8
- package/dist/node_modules/date-fns/isLastDayOfMonth.js.map +1 -1
- package/dist/node_modules/date-fns/isValid.js +5 -6
- package/dist/node_modules/date-fns/isValid.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -1
- package/dist/node_modules/date-fns/locale/en-US.js +2 -3
- package/dist/node_modules/date-fns/locale/en-US.js.map +1 -1
- package/dist/node_modules/date-fns/parseISO.js +3 -4
- package/dist/node_modules/date-fns/parseISO.js.map +1 -1
- package/dist/node_modules/date-fns/startOfDay.js +2 -3
- package/dist/node_modules/date-fns/startOfDay.js.map +1 -1
- package/dist/node_modules/date-fns/startOfISOWeek.js +2 -3
- package/dist/node_modules/date-fns/startOfISOWeek.js.map +1 -1
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +7 -8
- package/dist/node_modules/date-fns/startOfISOWeekYear.js.map +1 -1
- package/dist/node_modules/date-fns/startOfWeek.js +5 -6
- package/dist/node_modules/date-fns/startOfWeek.js.map +1 -1
- package/dist/node_modules/date-fns/startOfWeekYear.js +8 -9
- package/dist/node_modules/date-fns/startOfWeekYear.js.map +1 -1
- package/dist/node_modules/date-fns/startOfYear.js +2 -3
- package/dist/node_modules/date-fns/startOfYear.js.map +1 -1
- package/dist/node_modules/date-fns/toDate.js +3 -4
- package/dist/node_modules/date-fns/toDate.js.map +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js +1145 -861
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/zod/v3/ZodError.js +1 -2
- package/dist/node_modules/zod/v3/ZodError.js.map +1 -1
- package/dist/node_modules/zod/v3/errors.js +2 -3
- package/dist/node_modules/zod/v3/errors.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/errorUtil.js +1 -2
- package/dist/node_modules/zod/v3/helpers/errorUtil.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/parseUtil.js +5 -6
- package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/util.js +2 -3
- package/dist/node_modules/zod/v3/helpers/util.js.map +1 -1
- package/dist/node_modules/zod/v3/locales/en.js +26 -27
- package/dist/node_modules/zod/v3/locales/en.js.map +1 -1
- package/dist/node_modules/zod/v3/types.js +966 -956
- package/dist/node_modules/zod/v3/types.js.map +1 -1
- package/package.json +66 -59
- package/dist/node_modules/zod/v4/core/core.js +0 -35
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -24
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -29
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -20
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { DIRTY as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
var
|
|
1
|
+
import { ZodError as e, ZodIssueCode as t } from "./ZodError.js";
|
|
2
|
+
import { getErrorMap as n } from "./errors.js";
|
|
3
|
+
import r from "./locales/en.js";
|
|
4
|
+
import { errorUtil as i } from "./helpers/errorUtil.js";
|
|
5
|
+
import { DIRTY as a, INVALID as o, OK as s, ParseStatus as c, addIssueToContext as l, isAborted as u, isAsync as d, isDirty as f, isValid as p, makeIssue as ee } from "./helpers/parseUtil.js";
|
|
6
|
+
import { ZodParsedType as m, getParsedType as h, util as g } from "./helpers/util.js";
|
|
7
|
+
// node_modules/zod/v3/types.js
|
|
8
|
+
var _ = class {
|
|
9
9
|
constructor(e, t, n, r) {
|
|
10
10
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
11
11
|
}
|
|
12
12
|
get path() {
|
|
13
13
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
14
14
|
}
|
|
15
|
-
},
|
|
16
|
-
if (
|
|
15
|
+
}, te = (t, n) => {
|
|
16
|
+
if (p(n)) return {
|
|
17
17
|
success: !0,
|
|
18
|
-
data:
|
|
18
|
+
data: n.value
|
|
19
19
|
};
|
|
20
|
-
if (!
|
|
20
|
+
if (!t.common.issues.length) throw Error("Validation failed but no issues detected.");
|
|
21
21
|
return {
|
|
22
22
|
success: !1,
|
|
23
23
|
get error() {
|
|
24
|
-
|
|
24
|
+
if (this._error) return this._error;
|
|
25
|
+
let n = new e(t.common.issues);
|
|
26
|
+
return this._error = n, this._error;
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
29
|
};
|
|
28
|
-
function
|
|
30
|
+
function v(e) {
|
|
29
31
|
if (!e) return {};
|
|
30
32
|
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
31
33
|
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
@@ -40,18 +42,18 @@ function _(e) {
|
|
|
40
42
|
description: i
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
|
-
var
|
|
45
|
+
var y = class {
|
|
44
46
|
get description() {
|
|
45
47
|
return this._def.description;
|
|
46
48
|
}
|
|
47
49
|
_getType(e) {
|
|
48
|
-
return
|
|
50
|
+
return h(e.data);
|
|
49
51
|
}
|
|
50
|
-
_getOrReturnCtx(e,
|
|
51
|
-
return
|
|
52
|
+
_getOrReturnCtx(e, t) {
|
|
53
|
+
return t || {
|
|
52
54
|
common: e.parent.common,
|
|
53
55
|
data: e.data,
|
|
54
|
-
parsedType:
|
|
56
|
+
parsedType: h(e.data),
|
|
55
57
|
schemaErrorMap: this._def.errorMap,
|
|
56
58
|
path: e.path,
|
|
57
59
|
parent: e.parent
|
|
@@ -59,11 +61,11 @@ var v = class {
|
|
|
59
61
|
}
|
|
60
62
|
_processInputParams(e) {
|
|
61
63
|
return {
|
|
62
|
-
status: new
|
|
64
|
+
status: new c(),
|
|
63
65
|
ctx: {
|
|
64
66
|
common: e.parent.common,
|
|
65
67
|
data: e.data,
|
|
66
|
-
parsedType:
|
|
68
|
+
parsedType: h(e.data),
|
|
67
69
|
schemaErrorMap: this._def.errorMap,
|
|
68
70
|
path: e.path,
|
|
69
71
|
parent: e.parent
|
|
@@ -72,7 +74,7 @@ var v = class {
|
|
|
72
74
|
}
|
|
73
75
|
_parseSync(e) {
|
|
74
76
|
let t = this._parse(e);
|
|
75
|
-
if (
|
|
77
|
+
if (d(t)) throw Error("Synchronous parse encountered promise.");
|
|
76
78
|
return t;
|
|
77
79
|
}
|
|
78
80
|
_parseAsync(e) {
|
|
@@ -84,27 +86,27 @@ var v = class {
|
|
|
84
86
|
if (n.success) return n.data;
|
|
85
87
|
throw n.error;
|
|
86
88
|
}
|
|
87
|
-
safeParse(e,
|
|
88
|
-
let
|
|
89
|
+
safeParse(e, t) {
|
|
90
|
+
let n = {
|
|
89
91
|
common: {
|
|
90
92
|
issues: [],
|
|
91
|
-
async:
|
|
92
|
-
contextualErrorMap:
|
|
93
|
+
async: t?.async ?? !1,
|
|
94
|
+
contextualErrorMap: t?.errorMap
|
|
93
95
|
},
|
|
94
|
-
path:
|
|
96
|
+
path: t?.path || [],
|
|
95
97
|
schemaErrorMap: this._def.errorMap,
|
|
96
98
|
parent: null,
|
|
97
99
|
data: e,
|
|
98
|
-
parsedType:
|
|
100
|
+
parsedType: h(e)
|
|
99
101
|
};
|
|
100
|
-
return
|
|
102
|
+
return te(n, this._parseSync({
|
|
101
103
|
data: e,
|
|
102
|
-
path:
|
|
103
|
-
parent:
|
|
104
|
+
path: n.path,
|
|
105
|
+
parent: n
|
|
104
106
|
}));
|
|
105
107
|
}
|
|
106
108
|
"~validate"(e) {
|
|
107
|
-
let
|
|
109
|
+
let t = {
|
|
108
110
|
common: {
|
|
109
111
|
issues: [],
|
|
110
112
|
async: !!this["~standard"].async
|
|
@@ -113,17 +115,17 @@ var v = class {
|
|
|
113
115
|
schemaErrorMap: this._def.errorMap,
|
|
114
116
|
parent: null,
|
|
115
117
|
data: e,
|
|
116
|
-
parsedType:
|
|
118
|
+
parsedType: h(e)
|
|
117
119
|
};
|
|
118
120
|
if (!this["~standard"].async) try {
|
|
119
|
-
let
|
|
121
|
+
let n = this._parseSync({
|
|
120
122
|
data: e,
|
|
121
123
|
path: [],
|
|
122
|
-
parent:
|
|
124
|
+
parent: t
|
|
123
125
|
});
|
|
124
|
-
return
|
|
126
|
+
return p(n) ? { value: n.value } : { issues: t.common.issues };
|
|
125
127
|
} catch (e) {
|
|
126
|
-
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0),
|
|
128
|
+
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
127
129
|
issues: [],
|
|
128
130
|
async: !0
|
|
129
131
|
};
|
|
@@ -131,39 +133,39 @@ var v = class {
|
|
|
131
133
|
return this._parseAsync({
|
|
132
134
|
data: e,
|
|
133
135
|
path: [],
|
|
134
|
-
parent:
|
|
135
|
-
}).then((e) =>
|
|
136
|
+
parent: t
|
|
137
|
+
}).then((e) => p(e) ? { value: e.value } : { issues: t.common.issues });
|
|
136
138
|
}
|
|
137
139
|
async parseAsync(e, t) {
|
|
138
140
|
let n = await this.safeParseAsync(e, t);
|
|
139
141
|
if (n.success) return n.data;
|
|
140
142
|
throw n.error;
|
|
141
143
|
}
|
|
142
|
-
async safeParseAsync(e,
|
|
143
|
-
let
|
|
144
|
+
async safeParseAsync(e, t) {
|
|
145
|
+
let n = {
|
|
144
146
|
common: {
|
|
145
147
|
issues: [],
|
|
146
|
-
contextualErrorMap:
|
|
148
|
+
contextualErrorMap: t?.errorMap,
|
|
147
149
|
async: !0
|
|
148
150
|
},
|
|
149
|
-
path:
|
|
151
|
+
path: t?.path || [],
|
|
150
152
|
schemaErrorMap: this._def.errorMap,
|
|
151
153
|
parent: null,
|
|
152
154
|
data: e,
|
|
153
|
-
parsedType:
|
|
154
|
-
},
|
|
155
|
+
parsedType: h(e)
|
|
156
|
+
}, r = this._parse({
|
|
155
157
|
data: e,
|
|
156
|
-
path:
|
|
157
|
-
parent:
|
|
158
|
+
path: n.path,
|
|
159
|
+
parent: n
|
|
158
160
|
});
|
|
159
|
-
return
|
|
161
|
+
return te(n, await (d(r) ? r : Promise.resolve(r)));
|
|
160
162
|
}
|
|
161
|
-
refine(e,
|
|
162
|
-
let
|
|
163
|
-
return this._refinement((
|
|
164
|
-
let a = e(
|
|
165
|
-
code:
|
|
166
|
-
...n
|
|
163
|
+
refine(e, n) {
|
|
164
|
+
let r = (e) => typeof n == "string" || n === void 0 ? { message: n } : typeof n == "function" ? n(e) : n;
|
|
165
|
+
return this._refinement((n, i) => {
|
|
166
|
+
let a = e(n), o = () => i.addIssue({
|
|
167
|
+
code: t.custom,
|
|
168
|
+
...r(n)
|
|
167
169
|
});
|
|
168
170
|
return typeof Promise < "u" && a instanceof Promise ? a.then((e) => e ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
169
171
|
});
|
|
@@ -201,20 +203,20 @@ var v = class {
|
|
|
201
203
|
return this.nullable().optional();
|
|
202
204
|
}
|
|
203
205
|
array() {
|
|
204
|
-
return
|
|
206
|
+
return M.create(this);
|
|
205
207
|
}
|
|
206
208
|
promise() {
|
|
207
209
|
return G.create(this, this._def);
|
|
208
210
|
}
|
|
209
211
|
or(e) {
|
|
210
|
-
return
|
|
212
|
+
return F.create([this, e], this._def);
|
|
211
213
|
}
|
|
212
214
|
and(e) {
|
|
213
215
|
return L.create(this, e, this._def);
|
|
214
216
|
}
|
|
215
217
|
transform(e) {
|
|
216
218
|
return new K({
|
|
217
|
-
...
|
|
219
|
+
...v(this._def),
|
|
218
220
|
schema: this,
|
|
219
221
|
typeName: $.ZodEffects,
|
|
220
222
|
effect: {
|
|
@@ -226,7 +228,7 @@ var v = class {
|
|
|
226
228
|
default(e) {
|
|
227
229
|
let t = typeof e == "function" ? e : () => e;
|
|
228
230
|
return new Y({
|
|
229
|
-
...
|
|
231
|
+
...v(this._def),
|
|
230
232
|
innerType: this,
|
|
231
233
|
defaultValue: t,
|
|
232
234
|
typeName: $.ZodDefault
|
|
@@ -236,13 +238,13 @@ var v = class {
|
|
|
236
238
|
return new Me({
|
|
237
239
|
typeName: $.ZodBranded,
|
|
238
240
|
type: this,
|
|
239
|
-
...
|
|
241
|
+
...v(this._def)
|
|
240
242
|
});
|
|
241
243
|
}
|
|
242
244
|
catch(e) {
|
|
243
245
|
let t = typeof e == "function" ? e : () => e;
|
|
244
246
|
return new X({
|
|
245
|
-
...
|
|
247
|
+
...v(this._def),
|
|
246
248
|
innerType: this,
|
|
247
249
|
catchValue: t,
|
|
248
250
|
typeName: $.ZodCatch
|
|
@@ -267,25 +269,25 @@ var v = class {
|
|
|
267
269
|
isNullable() {
|
|
268
270
|
return this.safeParse(null).success;
|
|
269
271
|
}
|
|
270
|
-
},
|
|
271
|
-
function
|
|
272
|
+
}, ne = /^c[^\s-]{8,}$/i, re = /^[0-9a-z]+$/, ie = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ae = /^[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, oe = /^[a-z0-9_-]{21}$/i, se = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ce = /^[-+]?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)?)??$/, le = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ue = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", de, fe = /^(?:(?: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])$/, pe = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, me = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, he = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ge = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, _e = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ve = "((\\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])))", ye = RegExp(`^${ve}$`);
|
|
273
|
+
function be(e) {
|
|
272
274
|
let t = "[0-5]\\d";
|
|
273
275
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
274
276
|
let n = e.precision ? "+" : "?";
|
|
275
277
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
276
278
|
}
|
|
277
|
-
function
|
|
278
|
-
return RegExp(`^${
|
|
279
|
+
function xe(e) {
|
|
280
|
+
return RegExp(`^${be(e)}$`);
|
|
279
281
|
}
|
|
280
|
-
function
|
|
281
|
-
let t = `${
|
|
282
|
+
function Se(e) {
|
|
283
|
+
let t = `${ve}T${be(e)}`, n = [];
|
|
282
284
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
283
285
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
286
|
+
function Ce(e, t) {
|
|
287
|
+
return !((t !== "v4" && t || !fe.test(e)) && (t !== "v6" && t || !me.test(e)));
|
|
286
288
|
}
|
|
287
|
-
function
|
|
288
|
-
if (!
|
|
289
|
+
function we(e, t) {
|
|
290
|
+
if (!se.test(e)) return !1;
|
|
289
291
|
try {
|
|
290
292
|
let [n] = e.split(".");
|
|
291
293
|
if (!n) return !1;
|
|
@@ -295,247 +297,247 @@ function Te(e, t) {
|
|
|
295
297
|
return !1;
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
|
-
function
|
|
299
|
-
return
|
|
300
|
+
function Te(e, t) {
|
|
301
|
+
return !((t !== "v4" && t || !pe.test(e)) && (t !== "v6" && t || !he.test(e)));
|
|
300
302
|
}
|
|
301
|
-
var
|
|
302
|
-
_parse(
|
|
303
|
-
if (this._def.coerce && (
|
|
304
|
-
let n = this._getOrReturnCtx(
|
|
305
|
-
return
|
|
306
|
-
code:
|
|
307
|
-
expected:
|
|
303
|
+
var b = class e extends y {
|
|
304
|
+
_parse(e) {
|
|
305
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== m.string) {
|
|
306
|
+
let n = this._getOrReturnCtx(e);
|
|
307
|
+
return l(n, {
|
|
308
|
+
code: t.invalid_type,
|
|
309
|
+
expected: m.string,
|
|
308
310
|
received: n.parsedType
|
|
309
|
-
}),
|
|
311
|
+
}), o;
|
|
310
312
|
}
|
|
311
|
-
let
|
|
312
|
-
for (let
|
|
313
|
-
code:
|
|
314
|
-
minimum:
|
|
313
|
+
let n = new c(), r;
|
|
314
|
+
for (let i of this._def.checks) if (i.kind === "min") e.data.length < i.value && (r = this._getOrReturnCtx(e, r), l(r, {
|
|
315
|
+
code: t.too_small,
|
|
316
|
+
minimum: i.value,
|
|
315
317
|
type: "string",
|
|
316
318
|
inclusive: !0,
|
|
317
319
|
exact: !1,
|
|
318
|
-
message:
|
|
319
|
-
}),
|
|
320
|
-
else if (
|
|
321
|
-
code:
|
|
322
|
-
maximum:
|
|
320
|
+
message: i.message
|
|
321
|
+
}), n.dirty());
|
|
322
|
+
else if (i.kind === "max") e.data.length > i.value && (r = this._getOrReturnCtx(e, r), l(r, {
|
|
323
|
+
code: t.too_big,
|
|
324
|
+
maximum: i.value,
|
|
323
325
|
type: "string",
|
|
324
326
|
inclusive: !0,
|
|
325
327
|
exact: !1,
|
|
326
|
-
message:
|
|
327
|
-
}),
|
|
328
|
-
else if (
|
|
329
|
-
let
|
|
330
|
-
(
|
|
331
|
-
code:
|
|
332
|
-
maximum:
|
|
328
|
+
message: i.message
|
|
329
|
+
}), n.dirty());
|
|
330
|
+
else if (i.kind === "length") {
|
|
331
|
+
let a = e.data.length > i.value, o = e.data.length < i.value;
|
|
332
|
+
(a || o) && (r = this._getOrReturnCtx(e, r), a ? l(r, {
|
|
333
|
+
code: t.too_big,
|
|
334
|
+
maximum: i.value,
|
|
333
335
|
type: "string",
|
|
334
336
|
inclusive: !0,
|
|
335
337
|
exact: !0,
|
|
336
|
-
message:
|
|
337
|
-
}) : o &&
|
|
338
|
-
code:
|
|
339
|
-
minimum:
|
|
338
|
+
message: i.message
|
|
339
|
+
}) : o && l(r, {
|
|
340
|
+
code: t.too_small,
|
|
341
|
+
minimum: i.value,
|
|
340
342
|
type: "string",
|
|
341
343
|
inclusive: !0,
|
|
342
344
|
exact: !0,
|
|
343
|
-
message:
|
|
344
|
-
}),
|
|
345
|
-
} else if (
|
|
345
|
+
message: i.message
|
|
346
|
+
}), n.dirty());
|
|
347
|
+
} else if (i.kind === "email") le.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
346
348
|
validation: "email",
|
|
347
|
-
code:
|
|
348
|
-
message:
|
|
349
|
-
}),
|
|
350
|
-
else if (
|
|
349
|
+
code: t.invalid_string,
|
|
350
|
+
message: i.message
|
|
351
|
+
}), n.dirty());
|
|
352
|
+
else if (i.kind === "emoji") de ||= new RegExp(ue, "u"), de.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
351
353
|
validation: "emoji",
|
|
352
|
-
code:
|
|
353
|
-
message:
|
|
354
|
-
}),
|
|
355
|
-
else if (
|
|
354
|
+
code: t.invalid_string,
|
|
355
|
+
message: i.message
|
|
356
|
+
}), n.dirty());
|
|
357
|
+
else if (i.kind === "uuid") ae.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
356
358
|
validation: "uuid",
|
|
357
|
-
code:
|
|
358
|
-
message:
|
|
359
|
-
}),
|
|
360
|
-
else if (
|
|
359
|
+
code: t.invalid_string,
|
|
360
|
+
message: i.message
|
|
361
|
+
}), n.dirty());
|
|
362
|
+
else if (i.kind === "nanoid") oe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
361
363
|
validation: "nanoid",
|
|
362
|
-
code:
|
|
363
|
-
message:
|
|
364
|
-
}),
|
|
365
|
-
else if (
|
|
364
|
+
code: t.invalid_string,
|
|
365
|
+
message: i.message
|
|
366
|
+
}), n.dirty());
|
|
367
|
+
else if (i.kind === "cuid") ne.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
366
368
|
validation: "cuid",
|
|
367
|
-
code:
|
|
368
|
-
message:
|
|
369
|
-
}),
|
|
370
|
-
else if (
|
|
369
|
+
code: t.invalid_string,
|
|
370
|
+
message: i.message
|
|
371
|
+
}), n.dirty());
|
|
372
|
+
else if (i.kind === "cuid2") re.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
371
373
|
validation: "cuid2",
|
|
372
|
-
code:
|
|
373
|
-
message:
|
|
374
|
-
}),
|
|
375
|
-
else if (
|
|
374
|
+
code: t.invalid_string,
|
|
375
|
+
message: i.message
|
|
376
|
+
}), n.dirty());
|
|
377
|
+
else if (i.kind === "ulid") ie.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
376
378
|
validation: "ulid",
|
|
377
|
-
code:
|
|
378
|
-
message:
|
|
379
|
-
}),
|
|
380
|
-
else if (
|
|
381
|
-
new URL(
|
|
379
|
+
code: t.invalid_string,
|
|
380
|
+
message: i.message
|
|
381
|
+
}), n.dirty());
|
|
382
|
+
else if (i.kind === "url") try {
|
|
383
|
+
new URL(e.data);
|
|
382
384
|
} catch {
|
|
383
|
-
|
|
385
|
+
r = this._getOrReturnCtx(e, r), l(r, {
|
|
384
386
|
validation: "url",
|
|
385
|
-
code:
|
|
386
|
-
message:
|
|
387
|
-
}),
|
|
387
|
+
code: t.invalid_string,
|
|
388
|
+
message: i.message
|
|
389
|
+
}), n.dirty();
|
|
388
390
|
}
|
|
389
|
-
else
|
|
391
|
+
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
390
392
|
validation: "regex",
|
|
391
|
-
code:
|
|
392
|
-
message:
|
|
393
|
-
}),
|
|
394
|
-
code:
|
|
393
|
+
code: t.invalid_string,
|
|
394
|
+
message: i.message
|
|
395
|
+
}), n.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
396
|
+
code: t.invalid_string,
|
|
395
397
|
validation: {
|
|
396
|
-
includes:
|
|
397
|
-
position:
|
|
398
|
+
includes: i.value,
|
|
399
|
+
position: i.position
|
|
398
400
|
},
|
|
399
|
-
message:
|
|
400
|
-
}),
|
|
401
|
-
code:
|
|
402
|
-
validation: { startsWith:
|
|
403
|
-
message:
|
|
404
|
-
}),
|
|
405
|
-
code:
|
|
406
|
-
validation: { endsWith:
|
|
407
|
-
message:
|
|
408
|
-
}),
|
|
409
|
-
code:
|
|
401
|
+
message: i.message
|
|
402
|
+
}), n.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
403
|
+
code: t.invalid_string,
|
|
404
|
+
validation: { startsWith: i.value },
|
|
405
|
+
message: i.message
|
|
406
|
+
}), n.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
407
|
+
code: t.invalid_string,
|
|
408
|
+
validation: { endsWith: i.value },
|
|
409
|
+
message: i.message
|
|
410
|
+
}), n.dirty()) : i.kind === "datetime" ? Se(i).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
411
|
+
code: t.invalid_string,
|
|
410
412
|
validation: "datetime",
|
|
411
|
-
message:
|
|
412
|
-
}),
|
|
413
|
-
code:
|
|
413
|
+
message: i.message
|
|
414
|
+
}), n.dirty()) : i.kind === "date" ? ye.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
415
|
+
code: t.invalid_string,
|
|
414
416
|
validation: "date",
|
|
415
|
-
message:
|
|
416
|
-
}),
|
|
417
|
-
code:
|
|
417
|
+
message: i.message
|
|
418
|
+
}), n.dirty()) : i.kind === "time" ? xe(i).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
419
|
+
code: t.invalid_string,
|
|
418
420
|
validation: "time",
|
|
419
|
-
message:
|
|
420
|
-
}),
|
|
421
|
+
message: i.message
|
|
422
|
+
}), n.dirty()) : i.kind === "duration" ? ce.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
421
423
|
validation: "duration",
|
|
422
|
-
code:
|
|
423
|
-
message:
|
|
424
|
-
}),
|
|
424
|
+
code: t.invalid_string,
|
|
425
|
+
message: i.message
|
|
426
|
+
}), n.dirty()) : i.kind === "ip" ? Ce(e.data, i.version) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
425
427
|
validation: "ip",
|
|
426
|
-
code:
|
|
427
|
-
message:
|
|
428
|
-
}),
|
|
428
|
+
code: t.invalid_string,
|
|
429
|
+
message: i.message
|
|
430
|
+
}), n.dirty()) : i.kind === "jwt" ? we(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
429
431
|
validation: "jwt",
|
|
430
|
-
code:
|
|
431
|
-
message:
|
|
432
|
-
}),
|
|
432
|
+
code: t.invalid_string,
|
|
433
|
+
message: i.message
|
|
434
|
+
}), n.dirty()) : i.kind === "cidr" ? Te(e.data, i.version) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
433
435
|
validation: "cidr",
|
|
434
|
-
code:
|
|
435
|
-
message:
|
|
436
|
-
}),
|
|
436
|
+
code: t.invalid_string,
|
|
437
|
+
message: i.message
|
|
438
|
+
}), n.dirty()) : i.kind === "base64" ? ge.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
437
439
|
validation: "base64",
|
|
438
|
-
code:
|
|
439
|
-
message:
|
|
440
|
-
}),
|
|
440
|
+
code: t.invalid_string,
|
|
441
|
+
message: i.message
|
|
442
|
+
}), n.dirty()) : i.kind === "base64url" ? _e.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
|
|
441
443
|
validation: "base64url",
|
|
442
|
-
code:
|
|
443
|
-
message:
|
|
444
|
-
}),
|
|
444
|
+
code: t.invalid_string,
|
|
445
|
+
message: i.message
|
|
446
|
+
}), n.dirty()) : g.assertNever(i);
|
|
445
447
|
return {
|
|
446
|
-
status:
|
|
447
|
-
value:
|
|
448
|
+
status: n.value,
|
|
449
|
+
value: e.data
|
|
448
450
|
};
|
|
449
451
|
}
|
|
450
|
-
_regex(e,
|
|
452
|
+
_regex(e, n, r) {
|
|
451
453
|
return this.refinement((t) => e.test(t), {
|
|
452
|
-
validation:
|
|
453
|
-
code:
|
|
454
|
-
...
|
|
454
|
+
validation: n,
|
|
455
|
+
code: t.invalid_string,
|
|
456
|
+
...i.errToObj(r)
|
|
455
457
|
});
|
|
456
458
|
}
|
|
457
|
-
_addCheck(
|
|
458
|
-
return new
|
|
459
|
+
_addCheck(t) {
|
|
460
|
+
return new e({
|
|
459
461
|
...this._def,
|
|
460
|
-
checks: [...this._def.checks,
|
|
462
|
+
checks: [...this._def.checks, t]
|
|
461
463
|
});
|
|
462
464
|
}
|
|
463
465
|
email(e) {
|
|
464
466
|
return this._addCheck({
|
|
465
467
|
kind: "email",
|
|
466
|
-
...
|
|
468
|
+
...i.errToObj(e)
|
|
467
469
|
});
|
|
468
470
|
}
|
|
469
471
|
url(e) {
|
|
470
472
|
return this._addCheck({
|
|
471
473
|
kind: "url",
|
|
472
|
-
...
|
|
474
|
+
...i.errToObj(e)
|
|
473
475
|
});
|
|
474
476
|
}
|
|
475
477
|
emoji(e) {
|
|
476
478
|
return this._addCheck({
|
|
477
479
|
kind: "emoji",
|
|
478
|
-
...
|
|
480
|
+
...i.errToObj(e)
|
|
479
481
|
});
|
|
480
482
|
}
|
|
481
483
|
uuid(e) {
|
|
482
484
|
return this._addCheck({
|
|
483
485
|
kind: "uuid",
|
|
484
|
-
...
|
|
486
|
+
...i.errToObj(e)
|
|
485
487
|
});
|
|
486
488
|
}
|
|
487
489
|
nanoid(e) {
|
|
488
490
|
return this._addCheck({
|
|
489
491
|
kind: "nanoid",
|
|
490
|
-
...
|
|
492
|
+
...i.errToObj(e)
|
|
491
493
|
});
|
|
492
494
|
}
|
|
493
495
|
cuid(e) {
|
|
494
496
|
return this._addCheck({
|
|
495
497
|
kind: "cuid",
|
|
496
|
-
...
|
|
498
|
+
...i.errToObj(e)
|
|
497
499
|
});
|
|
498
500
|
}
|
|
499
501
|
cuid2(e) {
|
|
500
502
|
return this._addCheck({
|
|
501
503
|
kind: "cuid2",
|
|
502
|
-
...
|
|
504
|
+
...i.errToObj(e)
|
|
503
505
|
});
|
|
504
506
|
}
|
|
505
507
|
ulid(e) {
|
|
506
508
|
return this._addCheck({
|
|
507
509
|
kind: "ulid",
|
|
508
|
-
...
|
|
510
|
+
...i.errToObj(e)
|
|
509
511
|
});
|
|
510
512
|
}
|
|
511
513
|
base64(e) {
|
|
512
514
|
return this._addCheck({
|
|
513
515
|
kind: "base64",
|
|
514
|
-
...
|
|
516
|
+
...i.errToObj(e)
|
|
515
517
|
});
|
|
516
518
|
}
|
|
517
519
|
base64url(e) {
|
|
518
520
|
return this._addCheck({
|
|
519
521
|
kind: "base64url",
|
|
520
|
-
...
|
|
522
|
+
...i.errToObj(e)
|
|
521
523
|
});
|
|
522
524
|
}
|
|
523
525
|
jwt(e) {
|
|
524
526
|
return this._addCheck({
|
|
525
527
|
kind: "jwt",
|
|
526
|
-
...
|
|
528
|
+
...i.errToObj(e)
|
|
527
529
|
});
|
|
528
530
|
}
|
|
529
531
|
ip(e) {
|
|
530
532
|
return this._addCheck({
|
|
531
533
|
kind: "ip",
|
|
532
|
-
...
|
|
534
|
+
...i.errToObj(e)
|
|
533
535
|
});
|
|
534
536
|
}
|
|
535
537
|
cidr(e) {
|
|
536
538
|
return this._addCheck({
|
|
537
539
|
kind: "cidr",
|
|
538
|
-
...
|
|
540
|
+
...i.errToObj(e)
|
|
539
541
|
});
|
|
540
542
|
}
|
|
541
543
|
datetime(e) {
|
|
@@ -550,7 +552,7 @@ var y = class t extends v {
|
|
|
550
552
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
551
553
|
offset: e?.offset ?? !1,
|
|
552
554
|
local: e?.local ?? !1,
|
|
553
|
-
...
|
|
555
|
+
...i.errToObj(e?.message)
|
|
554
556
|
});
|
|
555
557
|
}
|
|
556
558
|
date(e) {
|
|
@@ -567,20 +569,20 @@ var y = class t extends v {
|
|
|
567
569
|
}) : this._addCheck({
|
|
568
570
|
kind: "time",
|
|
569
571
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
570
|
-
...
|
|
572
|
+
...i.errToObj(e?.message)
|
|
571
573
|
});
|
|
572
574
|
}
|
|
573
575
|
duration(e) {
|
|
574
576
|
return this._addCheck({
|
|
575
577
|
kind: "duration",
|
|
576
|
-
...
|
|
578
|
+
...i.errToObj(e)
|
|
577
579
|
});
|
|
578
580
|
}
|
|
579
581
|
regex(e, t) {
|
|
580
582
|
return this._addCheck({
|
|
581
583
|
kind: "regex",
|
|
582
584
|
regex: e,
|
|
583
|
-
...
|
|
585
|
+
...i.errToObj(t)
|
|
584
586
|
});
|
|
585
587
|
}
|
|
586
588
|
includes(e, t) {
|
|
@@ -588,61 +590,61 @@ var y = class t extends v {
|
|
|
588
590
|
kind: "includes",
|
|
589
591
|
value: e,
|
|
590
592
|
position: t?.position,
|
|
591
|
-
...
|
|
593
|
+
...i.errToObj(t?.message)
|
|
592
594
|
});
|
|
593
595
|
}
|
|
594
596
|
startsWith(e, t) {
|
|
595
597
|
return this._addCheck({
|
|
596
598
|
kind: "startsWith",
|
|
597
599
|
value: e,
|
|
598
|
-
...
|
|
600
|
+
...i.errToObj(t)
|
|
599
601
|
});
|
|
600
602
|
}
|
|
601
603
|
endsWith(e, t) {
|
|
602
604
|
return this._addCheck({
|
|
603
605
|
kind: "endsWith",
|
|
604
606
|
value: e,
|
|
605
|
-
...
|
|
607
|
+
...i.errToObj(t)
|
|
606
608
|
});
|
|
607
609
|
}
|
|
608
610
|
min(e, t) {
|
|
609
611
|
return this._addCheck({
|
|
610
612
|
kind: "min",
|
|
611
613
|
value: e,
|
|
612
|
-
...
|
|
614
|
+
...i.errToObj(t)
|
|
613
615
|
});
|
|
614
616
|
}
|
|
615
617
|
max(e, t) {
|
|
616
618
|
return this._addCheck({
|
|
617
619
|
kind: "max",
|
|
618
620
|
value: e,
|
|
619
|
-
...
|
|
621
|
+
...i.errToObj(t)
|
|
620
622
|
});
|
|
621
623
|
}
|
|
622
624
|
length(e, t) {
|
|
623
625
|
return this._addCheck({
|
|
624
626
|
kind: "length",
|
|
625
627
|
value: e,
|
|
626
|
-
...
|
|
628
|
+
...i.errToObj(t)
|
|
627
629
|
});
|
|
628
630
|
}
|
|
629
631
|
nonempty(e) {
|
|
630
|
-
return this.min(1,
|
|
632
|
+
return this.min(1, i.errToObj(e));
|
|
631
633
|
}
|
|
632
634
|
trim() {
|
|
633
|
-
return new
|
|
635
|
+
return new e({
|
|
634
636
|
...this._def,
|
|
635
637
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
636
638
|
});
|
|
637
639
|
}
|
|
638
640
|
toLowerCase() {
|
|
639
|
-
return new
|
|
641
|
+
return new e({
|
|
640
642
|
...this._def,
|
|
641
643
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
642
644
|
});
|
|
643
645
|
}
|
|
644
646
|
toUpperCase() {
|
|
645
|
-
return new
|
|
647
|
+
return new e({
|
|
646
648
|
...this._def,
|
|
647
649
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
648
650
|
});
|
|
@@ -706,95 +708,95 @@ var y = class t extends v {
|
|
|
706
708
|
return e;
|
|
707
709
|
}
|
|
708
710
|
};
|
|
709
|
-
|
|
711
|
+
b.create = (e) => new b({
|
|
710
712
|
checks: [],
|
|
711
713
|
typeName: $.ZodString,
|
|
712
714
|
coerce: e?.coerce ?? !1,
|
|
713
|
-
...
|
|
715
|
+
...v(e)
|
|
714
716
|
});
|
|
715
|
-
function
|
|
717
|
+
function Ee(e, t) {
|
|
716
718
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
717
719
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
718
720
|
}
|
|
719
|
-
var
|
|
721
|
+
var x = class e extends y {
|
|
720
722
|
constructor() {
|
|
721
723
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
722
724
|
}
|
|
723
|
-
_parse(
|
|
724
|
-
if (this._def.coerce && (
|
|
725
|
-
let n = this._getOrReturnCtx(
|
|
726
|
-
return
|
|
727
|
-
code:
|
|
728
|
-
expected:
|
|
725
|
+
_parse(e) {
|
|
726
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== m.number) {
|
|
727
|
+
let n = this._getOrReturnCtx(e);
|
|
728
|
+
return l(n, {
|
|
729
|
+
code: t.invalid_type,
|
|
730
|
+
expected: m.number,
|
|
729
731
|
received: n.parsedType
|
|
730
|
-
}),
|
|
732
|
+
}), o;
|
|
731
733
|
}
|
|
732
|
-
let
|
|
733
|
-
for (let
|
|
734
|
-
code:
|
|
734
|
+
let n, r = new c();
|
|
735
|
+
for (let i of this._def.checks) i.kind === "int" ? g.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
736
|
+
code: t.invalid_type,
|
|
735
737
|
expected: "integer",
|
|
736
738
|
received: "float",
|
|
737
|
-
message:
|
|
738
|
-
}),
|
|
739
|
-
code:
|
|
740
|
-
minimum:
|
|
739
|
+
message: i.message
|
|
740
|
+
}), r.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
741
|
+
code: t.too_small,
|
|
742
|
+
minimum: i.value,
|
|
741
743
|
type: "number",
|
|
742
|
-
inclusive:
|
|
744
|
+
inclusive: i.inclusive,
|
|
743
745
|
exact: !1,
|
|
744
|
-
message:
|
|
745
|
-
}),
|
|
746
|
-
code:
|
|
747
|
-
maximum:
|
|
746
|
+
message: i.message
|
|
747
|
+
}), r.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
748
|
+
code: t.too_big,
|
|
749
|
+
maximum: i.value,
|
|
748
750
|
type: "number",
|
|
749
|
-
inclusive:
|
|
751
|
+
inclusive: i.inclusive,
|
|
750
752
|
exact: !1,
|
|
751
|
-
message:
|
|
752
|
-
}),
|
|
753
|
-
code:
|
|
754
|
-
multipleOf:
|
|
755
|
-
message:
|
|
756
|
-
}),
|
|
757
|
-
code:
|
|
758
|
-
message:
|
|
759
|
-
}),
|
|
753
|
+
message: i.message
|
|
754
|
+
}), r.dirty()) : i.kind === "multipleOf" ? Ee(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
755
|
+
code: t.not_multiple_of,
|
|
756
|
+
multipleOf: i.value,
|
|
757
|
+
message: i.message
|
|
758
|
+
}), r.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
759
|
+
code: t.not_finite,
|
|
760
|
+
message: i.message
|
|
761
|
+
}), r.dirty()) : g.assertNever(i);
|
|
760
762
|
return {
|
|
761
|
-
status:
|
|
762
|
-
value:
|
|
763
|
+
status: r.value,
|
|
764
|
+
value: e.data
|
|
763
765
|
};
|
|
764
766
|
}
|
|
765
767
|
gte(e, t) {
|
|
766
|
-
return this.setLimit("min", e, !0,
|
|
768
|
+
return this.setLimit("min", e, !0, i.toString(t));
|
|
767
769
|
}
|
|
768
770
|
gt(e, t) {
|
|
769
|
-
return this.setLimit("min", e, !1,
|
|
771
|
+
return this.setLimit("min", e, !1, i.toString(t));
|
|
770
772
|
}
|
|
771
773
|
lte(e, t) {
|
|
772
|
-
return this.setLimit("max", e, !0,
|
|
774
|
+
return this.setLimit("max", e, !0, i.toString(t));
|
|
773
775
|
}
|
|
774
776
|
lt(e, t) {
|
|
775
|
-
return this.setLimit("max", e, !1,
|
|
777
|
+
return this.setLimit("max", e, !1, i.toString(t));
|
|
776
778
|
}
|
|
777
|
-
setLimit(
|
|
778
|
-
return new
|
|
779
|
+
setLimit(t, n, r, a) {
|
|
780
|
+
return new e({
|
|
779
781
|
...this._def,
|
|
780
782
|
checks: [...this._def.checks, {
|
|
781
|
-
kind:
|
|
783
|
+
kind: t,
|
|
782
784
|
value: n,
|
|
783
785
|
inclusive: r,
|
|
784
|
-
message:
|
|
786
|
+
message: i.toString(a)
|
|
785
787
|
}]
|
|
786
788
|
});
|
|
787
789
|
}
|
|
788
|
-
_addCheck(
|
|
789
|
-
return new
|
|
790
|
+
_addCheck(t) {
|
|
791
|
+
return new e({
|
|
790
792
|
...this._def,
|
|
791
|
-
checks: [...this._def.checks,
|
|
793
|
+
checks: [...this._def.checks, t]
|
|
792
794
|
});
|
|
793
795
|
}
|
|
794
796
|
int(e) {
|
|
795
797
|
return this._addCheck({
|
|
796
798
|
kind: "int",
|
|
797
|
-
message:
|
|
799
|
+
message: i.toString(e)
|
|
798
800
|
});
|
|
799
801
|
}
|
|
800
802
|
positive(e) {
|
|
@@ -802,7 +804,7 @@ var b = class t extends v {
|
|
|
802
804
|
kind: "min",
|
|
803
805
|
value: 0,
|
|
804
806
|
inclusive: !1,
|
|
805
|
-
message:
|
|
807
|
+
message: i.toString(e)
|
|
806
808
|
});
|
|
807
809
|
}
|
|
808
810
|
negative(e) {
|
|
@@ -810,7 +812,7 @@ var b = class t extends v {
|
|
|
810
812
|
kind: "max",
|
|
811
813
|
value: 0,
|
|
812
814
|
inclusive: !1,
|
|
813
|
-
message:
|
|
815
|
+
message: i.toString(e)
|
|
814
816
|
});
|
|
815
817
|
}
|
|
816
818
|
nonpositive(e) {
|
|
@@ -818,7 +820,7 @@ var b = class t extends v {
|
|
|
818
820
|
kind: "max",
|
|
819
821
|
value: 0,
|
|
820
822
|
inclusive: !0,
|
|
821
|
-
message:
|
|
823
|
+
message: i.toString(e)
|
|
822
824
|
});
|
|
823
825
|
}
|
|
824
826
|
nonnegative(e) {
|
|
@@ -826,20 +828,20 @@ var b = class t extends v {
|
|
|
826
828
|
kind: "min",
|
|
827
829
|
value: 0,
|
|
828
830
|
inclusive: !0,
|
|
829
|
-
message:
|
|
831
|
+
message: i.toString(e)
|
|
830
832
|
});
|
|
831
833
|
}
|
|
832
834
|
multipleOf(e, t) {
|
|
833
835
|
return this._addCheck({
|
|
834
836
|
kind: "multipleOf",
|
|
835
837
|
value: e,
|
|
836
|
-
message:
|
|
838
|
+
message: i.toString(t)
|
|
837
839
|
});
|
|
838
840
|
}
|
|
839
841
|
finite(e) {
|
|
840
842
|
return this._addCheck({
|
|
841
843
|
kind: "finite",
|
|
842
|
-
message:
|
|
844
|
+
message: i.toString(e)
|
|
843
845
|
});
|
|
844
846
|
}
|
|
845
847
|
safe(e) {
|
|
@@ -847,12 +849,12 @@ var b = class t extends v {
|
|
|
847
849
|
kind: "min",
|
|
848
850
|
inclusive: !0,
|
|
849
851
|
value: -(2 ** 53 - 1),
|
|
850
|
-
message:
|
|
852
|
+
message: i.toString(e)
|
|
851
853
|
})._addCheck({
|
|
852
854
|
kind: "max",
|
|
853
855
|
inclusive: !0,
|
|
854
856
|
value: 2 ** 53 - 1,
|
|
855
|
-
message:
|
|
857
|
+
message: i.toString(e)
|
|
856
858
|
});
|
|
857
859
|
}
|
|
858
860
|
get minValue() {
|
|
@@ -866,7 +868,7 @@ var b = class t extends v {
|
|
|
866
868
|
return e;
|
|
867
869
|
}
|
|
868
870
|
get isInt() {
|
|
869
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
871
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && g.isInteger(e.value));
|
|
870
872
|
}
|
|
871
873
|
get isFinite() {
|
|
872
874
|
let e = null, t = null;
|
|
@@ -875,81 +877,81 @@ var b = class t extends v {
|
|
|
875
877
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
876
878
|
}
|
|
877
879
|
};
|
|
878
|
-
|
|
880
|
+
x.create = (e) => new x({
|
|
879
881
|
checks: [],
|
|
880
882
|
typeName: $.ZodNumber,
|
|
881
883
|
coerce: e?.coerce || !1,
|
|
882
|
-
...
|
|
884
|
+
...v(e)
|
|
883
885
|
});
|
|
884
|
-
var
|
|
886
|
+
var S = class e extends y {
|
|
885
887
|
constructor() {
|
|
886
888
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
887
889
|
}
|
|
888
|
-
_parse(
|
|
890
|
+
_parse(e) {
|
|
889
891
|
if (this._def.coerce) try {
|
|
890
|
-
|
|
892
|
+
e.data = BigInt(e.data);
|
|
891
893
|
} catch {
|
|
892
|
-
return this._getInvalidInput(
|
|
894
|
+
return this._getInvalidInput(e);
|
|
893
895
|
}
|
|
894
|
-
if (this._getType(
|
|
895
|
-
let
|
|
896
|
-
for (let
|
|
897
|
-
code:
|
|
896
|
+
if (this._getType(e) !== m.bigint) return this._getInvalidInput(e);
|
|
897
|
+
let n, r = new c();
|
|
898
|
+
for (let i of this._def.checks) i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
899
|
+
code: t.too_small,
|
|
898
900
|
type: "bigint",
|
|
899
|
-
minimum:
|
|
900
|
-
inclusive:
|
|
901
|
-
message:
|
|
902
|
-
}),
|
|
903
|
-
code:
|
|
901
|
+
minimum: i.value,
|
|
902
|
+
inclusive: i.inclusive,
|
|
903
|
+
message: i.message
|
|
904
|
+
}), r.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
905
|
+
code: t.too_big,
|
|
904
906
|
type: "bigint",
|
|
905
|
-
maximum:
|
|
906
|
-
inclusive:
|
|
907
|
-
message:
|
|
908
|
-
}),
|
|
909
|
-
code:
|
|
910
|
-
multipleOf:
|
|
911
|
-
message:
|
|
912
|
-
}),
|
|
907
|
+
maximum: i.value,
|
|
908
|
+
inclusive: i.inclusive,
|
|
909
|
+
message: i.message
|
|
910
|
+
}), r.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
911
|
+
code: t.not_multiple_of,
|
|
912
|
+
multipleOf: i.value,
|
|
913
|
+
message: i.message
|
|
914
|
+
}), r.dirty()) : g.assertNever(i);
|
|
913
915
|
return {
|
|
914
|
-
status:
|
|
915
|
-
value:
|
|
916
|
+
status: r.value,
|
|
917
|
+
value: e.data
|
|
916
918
|
};
|
|
917
919
|
}
|
|
918
|
-
_getInvalidInput(
|
|
919
|
-
let n = this._getOrReturnCtx(
|
|
920
|
-
return
|
|
921
|
-
code:
|
|
922
|
-
expected:
|
|
920
|
+
_getInvalidInput(e) {
|
|
921
|
+
let n = this._getOrReturnCtx(e);
|
|
922
|
+
return l(n, {
|
|
923
|
+
code: t.invalid_type,
|
|
924
|
+
expected: m.bigint,
|
|
923
925
|
received: n.parsedType
|
|
924
|
-
}),
|
|
926
|
+
}), o;
|
|
925
927
|
}
|
|
926
928
|
gte(e, t) {
|
|
927
|
-
return this.setLimit("min", e, !0,
|
|
929
|
+
return this.setLimit("min", e, !0, i.toString(t));
|
|
928
930
|
}
|
|
929
931
|
gt(e, t) {
|
|
930
|
-
return this.setLimit("min", e, !1,
|
|
932
|
+
return this.setLimit("min", e, !1, i.toString(t));
|
|
931
933
|
}
|
|
932
934
|
lte(e, t) {
|
|
933
|
-
return this.setLimit("max", e, !0,
|
|
935
|
+
return this.setLimit("max", e, !0, i.toString(t));
|
|
934
936
|
}
|
|
935
937
|
lt(e, t) {
|
|
936
|
-
return this.setLimit("max", e, !1,
|
|
938
|
+
return this.setLimit("max", e, !1, i.toString(t));
|
|
937
939
|
}
|
|
938
|
-
setLimit(
|
|
939
|
-
return new
|
|
940
|
+
setLimit(t, n, r, a) {
|
|
941
|
+
return new e({
|
|
940
942
|
...this._def,
|
|
941
943
|
checks: [...this._def.checks, {
|
|
942
|
-
kind:
|
|
944
|
+
kind: t,
|
|
943
945
|
value: n,
|
|
944
946
|
inclusive: r,
|
|
945
|
-
message:
|
|
947
|
+
message: i.toString(a)
|
|
946
948
|
}]
|
|
947
949
|
});
|
|
948
950
|
}
|
|
949
|
-
_addCheck(
|
|
950
|
-
return new
|
|
951
|
+
_addCheck(t) {
|
|
952
|
+
return new e({
|
|
951
953
|
...this._def,
|
|
952
|
-
checks: [...this._def.checks,
|
|
954
|
+
checks: [...this._def.checks, t]
|
|
953
955
|
});
|
|
954
956
|
}
|
|
955
957
|
positive(e) {
|
|
@@ -957,7 +959,7 @@ var x = class t extends v {
|
|
|
957
959
|
kind: "min",
|
|
958
960
|
value: BigInt(0),
|
|
959
961
|
inclusive: !1,
|
|
960
|
-
message:
|
|
962
|
+
message: i.toString(e)
|
|
961
963
|
});
|
|
962
964
|
}
|
|
963
965
|
negative(e) {
|
|
@@ -965,7 +967,7 @@ var x = class t extends v {
|
|
|
965
967
|
kind: "max",
|
|
966
968
|
value: BigInt(0),
|
|
967
969
|
inclusive: !1,
|
|
968
|
-
message:
|
|
970
|
+
message: i.toString(e)
|
|
969
971
|
});
|
|
970
972
|
}
|
|
971
973
|
nonpositive(e) {
|
|
@@ -973,7 +975,7 @@ var x = class t extends v {
|
|
|
973
975
|
kind: "max",
|
|
974
976
|
value: BigInt(0),
|
|
975
977
|
inclusive: !0,
|
|
976
|
-
message:
|
|
978
|
+
message: i.toString(e)
|
|
977
979
|
});
|
|
978
980
|
}
|
|
979
981
|
nonnegative(e) {
|
|
@@ -981,14 +983,14 @@ var x = class t extends v {
|
|
|
981
983
|
kind: "min",
|
|
982
984
|
value: BigInt(0),
|
|
983
985
|
inclusive: !0,
|
|
984
|
-
message:
|
|
986
|
+
message: i.toString(e)
|
|
985
987
|
});
|
|
986
988
|
}
|
|
987
989
|
multipleOf(e, t) {
|
|
988
990
|
return this._addCheck({
|
|
989
991
|
kind: "multipleOf",
|
|
990
992
|
value: e,
|
|
991
|
-
message:
|
|
993
|
+
message: i.toString(t)
|
|
992
994
|
});
|
|
993
995
|
}
|
|
994
996
|
get minValue() {
|
|
@@ -1002,80 +1004,83 @@ var x = class t extends v {
|
|
|
1002
1004
|
return e;
|
|
1003
1005
|
}
|
|
1004
1006
|
};
|
|
1005
|
-
|
|
1007
|
+
S.create = (e) => new S({
|
|
1006
1008
|
checks: [],
|
|
1007
1009
|
typeName: $.ZodBigInt,
|
|
1008
1010
|
coerce: e?.coerce ?? !1,
|
|
1009
|
-
...
|
|
1011
|
+
...v(e)
|
|
1010
1012
|
});
|
|
1011
|
-
var
|
|
1012
|
-
_parse(
|
|
1013
|
-
if (this._def.coerce && (
|
|
1014
|
-
let n = this._getOrReturnCtx(
|
|
1015
|
-
return
|
|
1016
|
-
code:
|
|
1017
|
-
expected:
|
|
1013
|
+
var C = class extends y {
|
|
1014
|
+
_parse(e) {
|
|
1015
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== m.boolean) {
|
|
1016
|
+
let n = this._getOrReturnCtx(e);
|
|
1017
|
+
return l(n, {
|
|
1018
|
+
code: t.invalid_type,
|
|
1019
|
+
expected: m.boolean,
|
|
1018
1020
|
received: n.parsedType
|
|
1019
|
-
}),
|
|
1021
|
+
}), o;
|
|
1020
1022
|
}
|
|
1021
|
-
return
|
|
1023
|
+
return s(e.data);
|
|
1022
1024
|
}
|
|
1023
1025
|
};
|
|
1024
|
-
|
|
1026
|
+
C.create = (e) => new C({
|
|
1025
1027
|
typeName: $.ZodBoolean,
|
|
1026
1028
|
coerce: e?.coerce || !1,
|
|
1027
|
-
...
|
|
1029
|
+
...v(e)
|
|
1028
1030
|
});
|
|
1029
|
-
var
|
|
1030
|
-
_parse(
|
|
1031
|
-
if (this._def.coerce && (
|
|
1032
|
-
let n = this._getOrReturnCtx(
|
|
1033
|
-
return
|
|
1034
|
-
code:
|
|
1035
|
-
expected:
|
|
1031
|
+
var w = class e extends y {
|
|
1032
|
+
_parse(e) {
|
|
1033
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== m.date) {
|
|
1034
|
+
let n = this._getOrReturnCtx(e);
|
|
1035
|
+
return l(n, {
|
|
1036
|
+
code: t.invalid_type,
|
|
1037
|
+
expected: m.date,
|
|
1036
1038
|
received: n.parsedType
|
|
1037
|
-
}),
|
|
1039
|
+
}), o;
|
|
1038
1040
|
}
|
|
1039
|
-
if (Number.isNaN(
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1041
|
+
if (Number.isNaN(e.data.getTime())) {
|
|
1042
|
+
let n = this._getOrReturnCtx(e);
|
|
1043
|
+
return l(n, { code: t.invalid_date }), o;
|
|
1044
|
+
}
|
|
1045
|
+
let n = new c(), r;
|
|
1046
|
+
for (let i of this._def.checks) i.kind === "min" ? e.data.getTime() < i.value && (r = this._getOrReturnCtx(e, r), l(r, {
|
|
1047
|
+
code: t.too_small,
|
|
1048
|
+
message: i.message,
|
|
1044
1049
|
inclusive: !0,
|
|
1045
1050
|
exact: !1,
|
|
1046
|
-
minimum:
|
|
1051
|
+
minimum: i.value,
|
|
1047
1052
|
type: "date"
|
|
1048
|
-
}),
|
|
1049
|
-
code:
|
|
1050
|
-
message:
|
|
1053
|
+
}), n.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (r = this._getOrReturnCtx(e, r), l(r, {
|
|
1054
|
+
code: t.too_big,
|
|
1055
|
+
message: i.message,
|
|
1051
1056
|
inclusive: !0,
|
|
1052
1057
|
exact: !1,
|
|
1053
|
-
maximum:
|
|
1058
|
+
maximum: i.value,
|
|
1054
1059
|
type: "date"
|
|
1055
|
-
}),
|
|
1060
|
+
}), n.dirty()) : g.assertNever(i);
|
|
1056
1061
|
return {
|
|
1057
|
-
status:
|
|
1058
|
-
value: new Date(
|
|
1062
|
+
status: n.value,
|
|
1063
|
+
value: new Date(e.data.getTime())
|
|
1059
1064
|
};
|
|
1060
1065
|
}
|
|
1061
|
-
_addCheck(
|
|
1062
|
-
return new
|
|
1066
|
+
_addCheck(t) {
|
|
1067
|
+
return new e({
|
|
1063
1068
|
...this._def,
|
|
1064
|
-
checks: [...this._def.checks,
|
|
1069
|
+
checks: [...this._def.checks, t]
|
|
1065
1070
|
});
|
|
1066
1071
|
}
|
|
1067
1072
|
min(e, t) {
|
|
1068
1073
|
return this._addCheck({
|
|
1069
1074
|
kind: "min",
|
|
1070
1075
|
value: e.getTime(),
|
|
1071
|
-
message:
|
|
1076
|
+
message: i.toString(t)
|
|
1072
1077
|
});
|
|
1073
1078
|
}
|
|
1074
1079
|
max(e, t) {
|
|
1075
1080
|
return this._addCheck({
|
|
1076
1081
|
kind: "max",
|
|
1077
1082
|
value: e.getTime(),
|
|
1078
|
-
message:
|
|
1083
|
+
message: i.toString(t)
|
|
1079
1084
|
});
|
|
1080
1085
|
}
|
|
1081
1086
|
get minDate() {
|
|
@@ -1089,183 +1094,183 @@ var C = class t extends v {
|
|
|
1089
1094
|
return e == null ? null : new Date(e);
|
|
1090
1095
|
}
|
|
1091
1096
|
};
|
|
1092
|
-
|
|
1097
|
+
w.create = (e) => new w({
|
|
1093
1098
|
checks: [],
|
|
1094
1099
|
coerce: e?.coerce || !1,
|
|
1095
1100
|
typeName: $.ZodDate,
|
|
1096
|
-
...
|
|
1101
|
+
...v(e)
|
|
1097
1102
|
});
|
|
1098
|
-
var
|
|
1099
|
-
_parse(
|
|
1100
|
-
if (this._getType(
|
|
1101
|
-
let n = this._getOrReturnCtx(
|
|
1102
|
-
return
|
|
1103
|
-
code:
|
|
1104
|
-
expected:
|
|
1103
|
+
var T = class extends y {
|
|
1104
|
+
_parse(e) {
|
|
1105
|
+
if (this._getType(e) !== m.symbol) {
|
|
1106
|
+
let n = this._getOrReturnCtx(e);
|
|
1107
|
+
return l(n, {
|
|
1108
|
+
code: t.invalid_type,
|
|
1109
|
+
expected: m.symbol,
|
|
1105
1110
|
received: n.parsedType
|
|
1106
|
-
}),
|
|
1111
|
+
}), o;
|
|
1107
1112
|
}
|
|
1108
|
-
return
|
|
1113
|
+
return s(e.data);
|
|
1109
1114
|
}
|
|
1110
1115
|
};
|
|
1111
|
-
|
|
1116
|
+
T.create = (e) => new T({
|
|
1112
1117
|
typeName: $.ZodSymbol,
|
|
1113
|
-
...
|
|
1118
|
+
...v(e)
|
|
1114
1119
|
});
|
|
1115
|
-
var
|
|
1116
|
-
_parse(
|
|
1117
|
-
if (this._getType(
|
|
1118
|
-
let n = this._getOrReturnCtx(
|
|
1119
|
-
return
|
|
1120
|
-
code:
|
|
1121
|
-
expected:
|
|
1120
|
+
var E = class extends y {
|
|
1121
|
+
_parse(e) {
|
|
1122
|
+
if (this._getType(e) !== m.undefined) {
|
|
1123
|
+
let n = this._getOrReturnCtx(e);
|
|
1124
|
+
return l(n, {
|
|
1125
|
+
code: t.invalid_type,
|
|
1126
|
+
expected: m.undefined,
|
|
1122
1127
|
received: n.parsedType
|
|
1123
|
-
}),
|
|
1128
|
+
}), o;
|
|
1124
1129
|
}
|
|
1125
|
-
return
|
|
1130
|
+
return s(e.data);
|
|
1126
1131
|
}
|
|
1127
1132
|
};
|
|
1128
|
-
|
|
1133
|
+
E.create = (e) => new E({
|
|
1129
1134
|
typeName: $.ZodUndefined,
|
|
1130
|
-
...
|
|
1135
|
+
...v(e)
|
|
1131
1136
|
});
|
|
1132
|
-
var
|
|
1133
|
-
_parse(
|
|
1134
|
-
if (this._getType(
|
|
1135
|
-
let n = this._getOrReturnCtx(
|
|
1136
|
-
return
|
|
1137
|
-
code:
|
|
1138
|
-
expected:
|
|
1137
|
+
var D = class extends y {
|
|
1138
|
+
_parse(e) {
|
|
1139
|
+
if (this._getType(e) !== m.null) {
|
|
1140
|
+
let n = this._getOrReturnCtx(e);
|
|
1141
|
+
return l(n, {
|
|
1142
|
+
code: t.invalid_type,
|
|
1143
|
+
expected: m.null,
|
|
1139
1144
|
received: n.parsedType
|
|
1140
|
-
}),
|
|
1145
|
+
}), o;
|
|
1141
1146
|
}
|
|
1142
|
-
return
|
|
1147
|
+
return s(e.data);
|
|
1143
1148
|
}
|
|
1144
1149
|
};
|
|
1145
|
-
|
|
1150
|
+
D.create = (e) => new D({
|
|
1146
1151
|
typeName: $.ZodNull,
|
|
1147
|
-
...
|
|
1152
|
+
...v(e)
|
|
1148
1153
|
});
|
|
1149
|
-
var
|
|
1154
|
+
var O = class extends y {
|
|
1150
1155
|
constructor() {
|
|
1151
1156
|
super(...arguments), this._any = !0;
|
|
1152
1157
|
}
|
|
1153
1158
|
_parse(e) {
|
|
1154
|
-
return
|
|
1159
|
+
return s(e.data);
|
|
1155
1160
|
}
|
|
1156
1161
|
};
|
|
1157
|
-
|
|
1162
|
+
O.create = (e) => new O({
|
|
1158
1163
|
typeName: $.ZodAny,
|
|
1159
|
-
...
|
|
1164
|
+
...v(e)
|
|
1160
1165
|
});
|
|
1161
|
-
var
|
|
1166
|
+
var k = class extends y {
|
|
1162
1167
|
constructor() {
|
|
1163
1168
|
super(...arguments), this._unknown = !0;
|
|
1164
1169
|
}
|
|
1165
1170
|
_parse(e) {
|
|
1166
|
-
return
|
|
1171
|
+
return s(e.data);
|
|
1167
1172
|
}
|
|
1168
1173
|
};
|
|
1169
|
-
|
|
1174
|
+
k.create = (e) => new k({
|
|
1170
1175
|
typeName: $.ZodUnknown,
|
|
1171
|
-
...
|
|
1176
|
+
...v(e)
|
|
1172
1177
|
});
|
|
1173
|
-
var
|
|
1174
|
-
_parse(
|
|
1175
|
-
let n = this._getOrReturnCtx(
|
|
1176
|
-
return
|
|
1177
|
-
code:
|
|
1178
|
-
expected:
|
|
1178
|
+
var A = class extends y {
|
|
1179
|
+
_parse(e) {
|
|
1180
|
+
let n = this._getOrReturnCtx(e);
|
|
1181
|
+
return l(n, {
|
|
1182
|
+
code: t.invalid_type,
|
|
1183
|
+
expected: m.never,
|
|
1179
1184
|
received: n.parsedType
|
|
1180
|
-
}),
|
|
1185
|
+
}), o;
|
|
1181
1186
|
}
|
|
1182
1187
|
};
|
|
1183
|
-
|
|
1188
|
+
A.create = (e) => new A({
|
|
1184
1189
|
typeName: $.ZodNever,
|
|
1185
|
-
...
|
|
1190
|
+
...v(e)
|
|
1186
1191
|
});
|
|
1187
|
-
var
|
|
1188
|
-
_parse(
|
|
1189
|
-
if (this._getType(
|
|
1190
|
-
let n = this._getOrReturnCtx(
|
|
1191
|
-
return
|
|
1192
|
-
code:
|
|
1193
|
-
expected:
|
|
1192
|
+
var j = class extends y {
|
|
1193
|
+
_parse(e) {
|
|
1194
|
+
if (this._getType(e) !== m.undefined) {
|
|
1195
|
+
let n = this._getOrReturnCtx(e);
|
|
1196
|
+
return l(n, {
|
|
1197
|
+
code: t.invalid_type,
|
|
1198
|
+
expected: m.void,
|
|
1194
1199
|
received: n.parsedType
|
|
1195
|
-
}),
|
|
1200
|
+
}), o;
|
|
1196
1201
|
}
|
|
1197
|
-
return
|
|
1202
|
+
return s(e.data);
|
|
1198
1203
|
}
|
|
1199
1204
|
};
|
|
1200
|
-
|
|
1205
|
+
j.create = (e) => new j({
|
|
1201
1206
|
typeName: $.ZodVoid,
|
|
1202
|
-
...
|
|
1207
|
+
...v(e)
|
|
1203
1208
|
});
|
|
1204
|
-
var
|
|
1205
|
-
_parse(
|
|
1206
|
-
let { ctx: n, status: r } = this._processInputParams(
|
|
1207
|
-
if (n.parsedType !==
|
|
1208
|
-
code:
|
|
1209
|
-
expected:
|
|
1209
|
+
var M = class e extends y {
|
|
1210
|
+
_parse(e) {
|
|
1211
|
+
let { ctx: n, status: r } = this._processInputParams(e), i = this._def;
|
|
1212
|
+
if (n.parsedType !== m.array) return l(n, {
|
|
1213
|
+
code: t.invalid_type,
|
|
1214
|
+
expected: m.array,
|
|
1210
1215
|
received: n.parsedType
|
|
1211
|
-
}),
|
|
1212
|
-
if (
|
|
1213
|
-
let e = n.data.length >
|
|
1214
|
-
(e ||
|
|
1215
|
-
code: e ?
|
|
1216
|
-
minimum:
|
|
1217
|
-
maximum: e ?
|
|
1216
|
+
}), o;
|
|
1217
|
+
if (i.exactLength !== null) {
|
|
1218
|
+
let e = n.data.length > i.exactLength.value, a = n.data.length < i.exactLength.value;
|
|
1219
|
+
(e || a) && (l(n, {
|
|
1220
|
+
code: e ? t.too_big : t.too_small,
|
|
1221
|
+
minimum: a ? i.exactLength.value : void 0,
|
|
1222
|
+
maximum: e ? i.exactLength.value : void 0,
|
|
1218
1223
|
type: "array",
|
|
1219
1224
|
inclusive: !0,
|
|
1220
1225
|
exact: !0,
|
|
1221
|
-
message:
|
|
1226
|
+
message: i.exactLength.message
|
|
1222
1227
|
}), r.dirty());
|
|
1223
1228
|
}
|
|
1224
|
-
if (
|
|
1225
|
-
code:
|
|
1226
|
-
minimum:
|
|
1229
|
+
if (i.minLength !== null && n.data.length < i.minLength.value && (l(n, {
|
|
1230
|
+
code: t.too_small,
|
|
1231
|
+
minimum: i.minLength.value,
|
|
1227
1232
|
type: "array",
|
|
1228
1233
|
inclusive: !0,
|
|
1229
1234
|
exact: !1,
|
|
1230
|
-
message:
|
|
1231
|
-
}), r.dirty()),
|
|
1232
|
-
code:
|
|
1233
|
-
maximum:
|
|
1235
|
+
message: i.minLength.message
|
|
1236
|
+
}), r.dirty()), i.maxLength !== null && n.data.length > i.maxLength.value && (l(n, {
|
|
1237
|
+
code: t.too_big,
|
|
1238
|
+
maximum: i.maxLength.value,
|
|
1234
1239
|
type: "array",
|
|
1235
1240
|
inclusive: !0,
|
|
1236
1241
|
exact: !1,
|
|
1237
|
-
message:
|
|
1238
|
-
}), r.dirty()), n.common.async) return Promise.all([...n.data].map((e, t) =>
|
|
1239
|
-
let
|
|
1240
|
-
return
|
|
1242
|
+
message: i.maxLength.message
|
|
1243
|
+
}), r.dirty()), n.common.async) return Promise.all([...n.data].map((e, t) => i.type._parseAsync(new _(n, e, n.path, t)))).then((e) => c.mergeArray(r, e));
|
|
1244
|
+
let a = [...n.data].map((e, t) => i.type._parseSync(new _(n, e, n.path, t)));
|
|
1245
|
+
return c.mergeArray(r, a);
|
|
1241
1246
|
}
|
|
1242
1247
|
get element() {
|
|
1243
1248
|
return this._def.type;
|
|
1244
1249
|
}
|
|
1245
|
-
min(
|
|
1246
|
-
return new
|
|
1250
|
+
min(t, n) {
|
|
1251
|
+
return new e({
|
|
1247
1252
|
...this._def,
|
|
1248
1253
|
minLength: {
|
|
1249
|
-
value:
|
|
1250
|
-
message:
|
|
1254
|
+
value: t,
|
|
1255
|
+
message: i.toString(n)
|
|
1251
1256
|
}
|
|
1252
1257
|
});
|
|
1253
1258
|
}
|
|
1254
|
-
max(
|
|
1255
|
-
return new
|
|
1259
|
+
max(t, n) {
|
|
1260
|
+
return new e({
|
|
1256
1261
|
...this._def,
|
|
1257
1262
|
maxLength: {
|
|
1258
|
-
value:
|
|
1259
|
-
message:
|
|
1263
|
+
value: t,
|
|
1264
|
+
message: i.toString(n)
|
|
1260
1265
|
}
|
|
1261
1266
|
});
|
|
1262
1267
|
}
|
|
1263
|
-
length(
|
|
1264
|
-
return new
|
|
1268
|
+
length(t, n) {
|
|
1269
|
+
return new e({
|
|
1265
1270
|
...this._def,
|
|
1266
1271
|
exactLength: {
|
|
1267
|
-
value:
|
|
1268
|
-
message:
|
|
1272
|
+
value: t,
|
|
1273
|
+
message: i.toString(n)
|
|
1269
1274
|
}
|
|
1270
1275
|
});
|
|
1271
1276
|
}
|
|
@@ -1273,72 +1278,69 @@ var j = class t extends v {
|
|
|
1273
1278
|
return this.min(1, e);
|
|
1274
1279
|
}
|
|
1275
1280
|
};
|
|
1276
|
-
|
|
1281
|
+
M.create = (e, t) => new M({
|
|
1277
1282
|
type: e,
|
|
1278
1283
|
minLength: null,
|
|
1279
1284
|
maxLength: null,
|
|
1280
1285
|
exactLength: null,
|
|
1281
1286
|
typeName: $.ZodArray,
|
|
1282
|
-
...
|
|
1287
|
+
...v(t)
|
|
1283
1288
|
});
|
|
1284
|
-
function
|
|
1285
|
-
if (e instanceof
|
|
1289
|
+
function N(e) {
|
|
1290
|
+
if (e instanceof P) {
|
|
1286
1291
|
let t = {};
|
|
1287
1292
|
for (let n in e.shape) {
|
|
1288
1293
|
let r = e.shape[n];
|
|
1289
|
-
t[n] = q.create(
|
|
1294
|
+
t[n] = q.create(N(r));
|
|
1290
1295
|
}
|
|
1291
|
-
return new
|
|
1296
|
+
return new P({
|
|
1292
1297
|
...e._def,
|
|
1293
1298
|
shape: () => t
|
|
1294
1299
|
});
|
|
1295
|
-
}
|
|
1300
|
+
}
|
|
1301
|
+
return e instanceof M ? new M({
|
|
1296
1302
|
...e._def,
|
|
1297
|
-
type:
|
|
1298
|
-
});
|
|
1299
|
-
else if (e instanceof q) return q.create(M(e.unwrap()));
|
|
1300
|
-
else if (e instanceof J) return J.create(M(e.unwrap()));
|
|
1301
|
-
else if (e instanceof R) return R.create(e.items.map((e) => M(e)));
|
|
1302
|
-
else return e;
|
|
1303
|
+
type: N(e.element)
|
|
1304
|
+
}) : e instanceof q ? q.create(N(e.unwrap())) : e instanceof J ? J.create(N(e.unwrap())) : e instanceof R ? R.create(e.items.map((e) => N(e))) : e;
|
|
1303
1305
|
}
|
|
1304
|
-
var
|
|
1306
|
+
var P = class e extends y {
|
|
1305
1307
|
constructor() {
|
|
1306
1308
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1307
1309
|
}
|
|
1308
1310
|
_getCached() {
|
|
1309
1311
|
if (this._cached !== null) return this._cached;
|
|
1310
|
-
let e = this._def.shape();
|
|
1312
|
+
let e = this._def.shape(), t = g.objectKeys(e);
|
|
1311
1313
|
return this._cached = {
|
|
1312
1314
|
shape: e,
|
|
1313
|
-
keys:
|
|
1315
|
+
keys: t
|
|
1314
1316
|
}, this._cached;
|
|
1315
1317
|
}
|
|
1316
|
-
_parse(
|
|
1317
|
-
if (this._getType(
|
|
1318
|
-
let n = this._getOrReturnCtx(
|
|
1319
|
-
return
|
|
1320
|
-
code:
|
|
1321
|
-
expected:
|
|
1318
|
+
_parse(e) {
|
|
1319
|
+
if (this._getType(e) !== m.object) {
|
|
1320
|
+
let n = this._getOrReturnCtx(e);
|
|
1321
|
+
return l(n, {
|
|
1322
|
+
code: t.invalid_type,
|
|
1323
|
+
expected: m.object,
|
|
1322
1324
|
received: n.parsedType
|
|
1323
|
-
}),
|
|
1325
|
+
}), o;
|
|
1324
1326
|
}
|
|
1325
|
-
let { status: n, ctx: r } = this._processInputParams(
|
|
1326
|
-
if (!(this._def.catchall instanceof
|
|
1327
|
-
let
|
|
1328
|
-
for (let e of
|
|
1329
|
-
let t =
|
|
1330
|
-
|
|
1327
|
+
let { status: n, ctx: r } = this._processInputParams(e), { shape: i, keys: a } = this._getCached(), s = [];
|
|
1328
|
+
if (!(this._def.catchall instanceof A && this._def.unknownKeys === "strip")) for (let e in r.data) a.includes(e) || s.push(e);
|
|
1329
|
+
let u = [];
|
|
1330
|
+
for (let e of a) {
|
|
1331
|
+
let t = i[e], n = r.data[e];
|
|
1332
|
+
u.push({
|
|
1331
1333
|
key: {
|
|
1332
1334
|
status: "valid",
|
|
1333
1335
|
value: e
|
|
1334
1336
|
},
|
|
1335
|
-
value: t._parse(new
|
|
1337
|
+
value: t._parse(new _(r, n, r.path, e)),
|
|
1336
1338
|
alwaysSet: e in r.data
|
|
1337
1339
|
});
|
|
1338
1340
|
}
|
|
1339
|
-
if (this._def.catchall instanceof
|
|
1341
|
+
if (this._def.catchall instanceof A) {
|
|
1340
1342
|
let e = this._def.unknownKeys;
|
|
1341
|
-
if (e === "passthrough") for (let e of s)
|
|
1343
|
+
if (e === "passthrough") for (let e of s) u.push({
|
|
1342
1344
|
key: {
|
|
1343
1345
|
status: "valid",
|
|
1344
1346
|
value: e
|
|
@@ -1348,8 +1350,8 @@ var N = class t extends v {
|
|
|
1348
1350
|
value: r.data[e]
|
|
1349
1351
|
}
|
|
1350
1352
|
});
|
|
1351
|
-
else if (e === "strict") s.length > 0 && (
|
|
1352
|
-
code:
|
|
1353
|
+
else if (e === "strict") s.length > 0 && (l(r, {
|
|
1354
|
+
code: t.unrecognized_keys,
|
|
1353
1355
|
keys: s
|
|
1354
1356
|
}), n.dirty());
|
|
1355
1357
|
else if (e !== "strip") throw Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
@@ -1357,19 +1359,19 @@ var N = class t extends v {
|
|
|
1357
1359
|
let e = this._def.catchall;
|
|
1358
1360
|
for (let t of s) {
|
|
1359
1361
|
let n = r.data[t];
|
|
1360
|
-
|
|
1362
|
+
u.push({
|
|
1361
1363
|
key: {
|
|
1362
1364
|
status: "valid",
|
|
1363
1365
|
value: t
|
|
1364
1366
|
},
|
|
1365
|
-
value: e._parse(new
|
|
1367
|
+
value: e._parse(new _(r, n, r.path, t)),
|
|
1366
1368
|
alwaysSet: t in r.data
|
|
1367
1369
|
});
|
|
1368
1370
|
}
|
|
1369
1371
|
}
|
|
1370
1372
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
1371
1373
|
let e = [];
|
|
1372
|
-
for (let t of
|
|
1374
|
+
for (let t of u) {
|
|
1373
1375
|
let n = await t.key, r = await t.value;
|
|
1374
1376
|
e.push({
|
|
1375
1377
|
key: n,
|
|
@@ -1378,49 +1380,49 @@ var N = class t extends v {
|
|
|
1378
1380
|
});
|
|
1379
1381
|
}
|
|
1380
1382
|
return e;
|
|
1381
|
-
}).then((e) =>
|
|
1383
|
+
}).then((e) => c.mergeObjectSync(n, e)) : c.mergeObjectSync(n, u);
|
|
1382
1384
|
}
|
|
1383
1385
|
get shape() {
|
|
1384
1386
|
return this._def.shape();
|
|
1385
1387
|
}
|
|
1386
|
-
strict(
|
|
1387
|
-
return
|
|
1388
|
+
strict(t) {
|
|
1389
|
+
return i.errToObj, new e({
|
|
1388
1390
|
...this._def,
|
|
1389
1391
|
unknownKeys: "strict",
|
|
1390
|
-
...
|
|
1391
|
-
let r = this._def.errorMap?.(
|
|
1392
|
-
return
|
|
1392
|
+
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
1393
|
+
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
1394
|
+
return e.code === "unrecognized_keys" ? { message: i.errToObj(t).message ?? r } : { message: r };
|
|
1393
1395
|
} }
|
|
1394
1396
|
});
|
|
1395
1397
|
}
|
|
1396
1398
|
strip() {
|
|
1397
|
-
return new
|
|
1399
|
+
return new e({
|
|
1398
1400
|
...this._def,
|
|
1399
1401
|
unknownKeys: "strip"
|
|
1400
1402
|
});
|
|
1401
1403
|
}
|
|
1402
1404
|
passthrough() {
|
|
1403
|
-
return new
|
|
1405
|
+
return new e({
|
|
1404
1406
|
...this._def,
|
|
1405
1407
|
unknownKeys: "passthrough"
|
|
1406
1408
|
});
|
|
1407
1409
|
}
|
|
1408
|
-
extend(
|
|
1409
|
-
return new
|
|
1410
|
+
extend(t) {
|
|
1411
|
+
return new e({
|
|
1410
1412
|
...this._def,
|
|
1411
1413
|
shape: () => ({
|
|
1412
1414
|
...this._def.shape(),
|
|
1413
|
-
...
|
|
1415
|
+
...t
|
|
1414
1416
|
})
|
|
1415
1417
|
});
|
|
1416
1418
|
}
|
|
1417
|
-
merge(
|
|
1418
|
-
return new
|
|
1419
|
-
unknownKeys:
|
|
1420
|
-
catchall:
|
|
1419
|
+
merge(t) {
|
|
1420
|
+
return new e({
|
|
1421
|
+
unknownKeys: t._def.unknownKeys,
|
|
1422
|
+
catchall: t._def.catchall,
|
|
1421
1423
|
shape: () => ({
|
|
1422
1424
|
...this._def.shape(),
|
|
1423
|
-
...
|
|
1425
|
+
...t._def.shape()
|
|
1424
1426
|
}),
|
|
1425
1427
|
typeName: $.ZodObject
|
|
1426
1428
|
});
|
|
@@ -1428,168 +1430,168 @@ var N = class t extends v {
|
|
|
1428
1430
|
setKey(e, t) {
|
|
1429
1431
|
return this.augment({ [e]: t });
|
|
1430
1432
|
}
|
|
1431
|
-
catchall(
|
|
1432
|
-
return new
|
|
1433
|
+
catchall(t) {
|
|
1434
|
+
return new e({
|
|
1433
1435
|
...this._def,
|
|
1434
|
-
catchall:
|
|
1436
|
+
catchall: t
|
|
1435
1437
|
});
|
|
1436
1438
|
}
|
|
1437
|
-
pick(
|
|
1438
|
-
let
|
|
1439
|
-
for (let
|
|
1440
|
-
return new
|
|
1439
|
+
pick(t) {
|
|
1440
|
+
let n = {};
|
|
1441
|
+
for (let e of g.objectKeys(t)) t[e] && this.shape[e] && (n[e] = this.shape[e]);
|
|
1442
|
+
return new e({
|
|
1441
1443
|
...this._def,
|
|
1442
|
-
shape: () =>
|
|
1444
|
+
shape: () => n
|
|
1443
1445
|
});
|
|
1444
1446
|
}
|
|
1445
|
-
omit(
|
|
1446
|
-
let
|
|
1447
|
-
for (let
|
|
1448
|
-
return new
|
|
1447
|
+
omit(t) {
|
|
1448
|
+
let n = {};
|
|
1449
|
+
for (let e of g.objectKeys(this.shape)) t[e] || (n[e] = this.shape[e]);
|
|
1450
|
+
return new e({
|
|
1449
1451
|
...this._def,
|
|
1450
|
-
shape: () =>
|
|
1452
|
+
shape: () => n
|
|
1451
1453
|
});
|
|
1452
1454
|
}
|
|
1453
1455
|
deepPartial() {
|
|
1454
|
-
return
|
|
1456
|
+
return N(this);
|
|
1455
1457
|
}
|
|
1456
|
-
partial(
|
|
1457
|
-
let
|
|
1458
|
-
for (let
|
|
1459
|
-
let
|
|
1460
|
-
e && !e
|
|
1458
|
+
partial(t) {
|
|
1459
|
+
let n = {};
|
|
1460
|
+
for (let e of g.objectKeys(this.shape)) {
|
|
1461
|
+
let r = this.shape[e];
|
|
1462
|
+
n[e] = t && !t[e] ? r : r.optional();
|
|
1461
1463
|
}
|
|
1462
|
-
return new
|
|
1464
|
+
return new e({
|
|
1463
1465
|
...this._def,
|
|
1464
|
-
shape: () =>
|
|
1466
|
+
shape: () => n
|
|
1465
1467
|
});
|
|
1466
1468
|
}
|
|
1467
|
-
required(
|
|
1468
|
-
let
|
|
1469
|
-
for (let
|
|
1469
|
+
required(t) {
|
|
1470
|
+
let n = {};
|
|
1471
|
+
for (let e of g.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
1470
1472
|
else {
|
|
1471
|
-
let
|
|
1472
|
-
for (;
|
|
1473
|
-
|
|
1473
|
+
let t = this.shape[e];
|
|
1474
|
+
for (; t instanceof q;) t = t._def.innerType;
|
|
1475
|
+
n[e] = t;
|
|
1474
1476
|
}
|
|
1475
|
-
return new
|
|
1477
|
+
return new e({
|
|
1476
1478
|
...this._def,
|
|
1477
|
-
shape: () =>
|
|
1479
|
+
shape: () => n
|
|
1478
1480
|
});
|
|
1479
1481
|
}
|
|
1480
1482
|
keyof() {
|
|
1481
|
-
return je(
|
|
1483
|
+
return je(g.objectKeys(this.shape));
|
|
1482
1484
|
}
|
|
1483
1485
|
};
|
|
1484
|
-
|
|
1486
|
+
P.create = (e, t) => new P({
|
|
1485
1487
|
shape: () => e,
|
|
1486
1488
|
unknownKeys: "strip",
|
|
1487
|
-
catchall:
|
|
1489
|
+
catchall: A.create(),
|
|
1488
1490
|
typeName: $.ZodObject,
|
|
1489
|
-
...
|
|
1490
|
-
}),
|
|
1491
|
+
...v(t)
|
|
1492
|
+
}), P.strictCreate = (e, t) => new P({
|
|
1491
1493
|
shape: () => e,
|
|
1492
1494
|
unknownKeys: "strict",
|
|
1493
|
-
catchall:
|
|
1495
|
+
catchall: A.create(),
|
|
1494
1496
|
typeName: $.ZodObject,
|
|
1495
|
-
...
|
|
1496
|
-
}),
|
|
1497
|
+
...v(t)
|
|
1498
|
+
}), P.lazycreate = (e, t) => new P({
|
|
1497
1499
|
shape: e,
|
|
1498
1500
|
unknownKeys: "strip",
|
|
1499
|
-
catchall:
|
|
1501
|
+
catchall: A.create(),
|
|
1500
1502
|
typeName: $.ZodObject,
|
|
1501
|
-
...
|
|
1503
|
+
...v(t)
|
|
1502
1504
|
});
|
|
1503
|
-
var
|
|
1504
|
-
_parse(
|
|
1505
|
-
let { ctx:
|
|
1506
|
-
function a(
|
|
1507
|
-
for (let
|
|
1508
|
-
for (let
|
|
1509
|
-
let
|
|
1510
|
-
return
|
|
1511
|
-
code:
|
|
1512
|
-
unionErrors:
|
|
1513
|
-
}),
|
|
1505
|
+
var F = class extends y {
|
|
1506
|
+
_parse(n) {
|
|
1507
|
+
let { ctx: r } = this._processInputParams(n), i = this._def.options;
|
|
1508
|
+
function a(n) {
|
|
1509
|
+
for (let e of n) if (e.result.status === "valid") return e.result;
|
|
1510
|
+
for (let e of n) if (e.result.status === "dirty") return r.common.issues.push(...e.ctx.common.issues), e.result;
|
|
1511
|
+
let i = n.map((t) => new e(t.ctx.common.issues));
|
|
1512
|
+
return l(r, {
|
|
1513
|
+
code: t.invalid_union,
|
|
1514
|
+
unionErrors: i
|
|
1515
|
+
}), o;
|
|
1514
1516
|
}
|
|
1515
|
-
if (
|
|
1516
|
-
let
|
|
1517
|
-
...
|
|
1517
|
+
if (r.common.async) return Promise.all(i.map(async (e) => {
|
|
1518
|
+
let t = {
|
|
1519
|
+
...r,
|
|
1518
1520
|
common: {
|
|
1519
|
-
...
|
|
1521
|
+
...r.common,
|
|
1520
1522
|
issues: []
|
|
1521
1523
|
},
|
|
1522
1524
|
parent: null
|
|
1523
1525
|
};
|
|
1524
1526
|
return {
|
|
1525
1527
|
result: await e._parseAsync({
|
|
1526
|
-
data:
|
|
1527
|
-
path:
|
|
1528
|
-
parent:
|
|
1528
|
+
data: r.data,
|
|
1529
|
+
path: r.path,
|
|
1530
|
+
parent: t
|
|
1529
1531
|
}),
|
|
1530
|
-
ctx:
|
|
1532
|
+
ctx: t
|
|
1531
1533
|
};
|
|
1532
1534
|
})).then(a);
|
|
1533
1535
|
{
|
|
1534
|
-
let
|
|
1535
|
-
for (let
|
|
1536
|
-
let
|
|
1537
|
-
...
|
|
1536
|
+
let n, a = [];
|
|
1537
|
+
for (let e of i) {
|
|
1538
|
+
let t = {
|
|
1539
|
+
...r,
|
|
1538
1540
|
common: {
|
|
1539
|
-
...
|
|
1541
|
+
...r.common,
|
|
1540
1542
|
issues: []
|
|
1541
1543
|
},
|
|
1542
1544
|
parent: null
|
|
1543
|
-
}, i =
|
|
1544
|
-
data:
|
|
1545
|
-
path:
|
|
1546
|
-
parent:
|
|
1545
|
+
}, i = e._parseSync({
|
|
1546
|
+
data: r.data,
|
|
1547
|
+
path: r.path,
|
|
1548
|
+
parent: t
|
|
1547
1549
|
});
|
|
1548
1550
|
if (i.status === "valid") return i;
|
|
1549
|
-
i.status === "dirty" && !
|
|
1551
|
+
i.status === "dirty" && !n && (n = {
|
|
1550
1552
|
result: i,
|
|
1551
|
-
ctx:
|
|
1552
|
-
}),
|
|
1553
|
+
ctx: t
|
|
1554
|
+
}), t.common.issues.length && a.push(t.common.issues);
|
|
1553
1555
|
}
|
|
1554
|
-
if (
|
|
1555
|
-
let
|
|
1556
|
-
return
|
|
1557
|
-
code:
|
|
1558
|
-
unionErrors:
|
|
1559
|
-
}),
|
|
1556
|
+
if (n) return r.common.issues.push(...n.ctx.common.issues), n.result;
|
|
1557
|
+
let s = a.map((t) => new e(t));
|
|
1558
|
+
return l(r, {
|
|
1559
|
+
code: t.invalid_union,
|
|
1560
|
+
unionErrors: s
|
|
1561
|
+
}), o;
|
|
1560
1562
|
}
|
|
1561
1563
|
}
|
|
1562
1564
|
get options() {
|
|
1563
1565
|
return this._def.options;
|
|
1564
1566
|
}
|
|
1565
1567
|
};
|
|
1566
|
-
|
|
1568
|
+
F.create = (e, t) => new F({
|
|
1567
1569
|
options: e,
|
|
1568
1570
|
typeName: $.ZodUnion,
|
|
1569
|
-
...
|
|
1571
|
+
...v(t)
|
|
1570
1572
|
});
|
|
1571
|
-
var
|
|
1572
|
-
_parse(
|
|
1573
|
-
let { ctx: n } = this._processInputParams(
|
|
1574
|
-
if (n.parsedType !==
|
|
1575
|
-
code:
|
|
1576
|
-
expected:
|
|
1573
|
+
var I = (e) => e instanceof V ? I(e.schema) : e instanceof K ? I(e.innerType()) : e instanceof H ? [e.value] : e instanceof U ? e.options : e instanceof W ? g.objectValues(e.enum) : e instanceof Y ? I(e._def.innerType) : e instanceof E ? [void 0] : e instanceof D ? [null] : e instanceof q ? [void 0, ...I(e.unwrap())] : e instanceof J ? [null, ...I(e.unwrap())] : e instanceof Me || e instanceof Q ? I(e.unwrap()) : e instanceof X ? I(e._def.innerType) : [], De = class e extends y {
|
|
1574
|
+
_parse(e) {
|
|
1575
|
+
let { ctx: n } = this._processInputParams(e);
|
|
1576
|
+
if (n.parsedType !== m.object) return l(n, {
|
|
1577
|
+
code: t.invalid_type,
|
|
1578
|
+
expected: m.object,
|
|
1577
1579
|
received: n.parsedType
|
|
1578
|
-
}),
|
|
1579
|
-
let r = this.discriminator,
|
|
1580
|
-
return
|
|
1580
|
+
}), o;
|
|
1581
|
+
let r = this.discriminator, i = n.data[r], a = this.optionsMap.get(i);
|
|
1582
|
+
return a ? n.common.async ? a._parseAsync({
|
|
1581
1583
|
data: n.data,
|
|
1582
1584
|
path: n.path,
|
|
1583
1585
|
parent: n
|
|
1584
|
-
}) :
|
|
1586
|
+
}) : a._parseSync({
|
|
1585
1587
|
data: n.data,
|
|
1586
1588
|
path: n.path,
|
|
1587
1589
|
parent: n
|
|
1588
|
-
}) : (
|
|
1589
|
-
code:
|
|
1590
|
+
}) : (l(n, {
|
|
1591
|
+
code: t.invalid_union_discriminator,
|
|
1590
1592
|
options: Array.from(this.optionsMap.keys()),
|
|
1591
1593
|
path: [r]
|
|
1592
|
-
}),
|
|
1594
|
+
}), o);
|
|
1593
1595
|
}
|
|
1594
1596
|
get discriminator() {
|
|
1595
1597
|
return this._def.discriminator;
|
|
@@ -1600,89 +1602,90 @@ var F = (e) => e instanceof V ? F(e.schema) : e instanceof K ? F(e.innerType())
|
|
|
1600
1602
|
get optionsMap() {
|
|
1601
1603
|
return this._def.optionsMap;
|
|
1602
1604
|
}
|
|
1603
|
-
static create(
|
|
1605
|
+
static create(t, n, r) {
|
|
1604
1606
|
let i = /* @__PURE__ */ new Map();
|
|
1605
|
-
for (let
|
|
1606
|
-
let n =
|
|
1607
|
-
if (!n.length) throw Error(`A discriminator value for key \`${
|
|
1607
|
+
for (let e of n) {
|
|
1608
|
+
let n = I(e.shape[t]);
|
|
1609
|
+
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1608
1610
|
for (let r of n) {
|
|
1609
|
-
if (i.has(r)) throw Error(`Discriminator property ${String(
|
|
1610
|
-
i.set(r,
|
|
1611
|
+
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
1612
|
+
i.set(r, e);
|
|
1611
1613
|
}
|
|
1612
1614
|
}
|
|
1613
|
-
return new
|
|
1615
|
+
return new e({
|
|
1614
1616
|
typeName: $.ZodDiscriminatedUnion,
|
|
1615
|
-
discriminator:
|
|
1617
|
+
discriminator: t,
|
|
1616
1618
|
options: n,
|
|
1617
1619
|
optionsMap: i,
|
|
1618
|
-
...
|
|
1620
|
+
...v(r)
|
|
1619
1621
|
});
|
|
1620
1622
|
}
|
|
1621
1623
|
};
|
|
1622
|
-
function
|
|
1623
|
-
let
|
|
1624
|
-
if (
|
|
1624
|
+
function Oe(e, t) {
|
|
1625
|
+
let n = h(e), r = h(t);
|
|
1626
|
+
if (e === t) return {
|
|
1625
1627
|
valid: !0,
|
|
1626
|
-
data:
|
|
1628
|
+
data: e
|
|
1627
1629
|
};
|
|
1628
|
-
if (
|
|
1629
|
-
let
|
|
1630
|
-
...
|
|
1631
|
-
...
|
|
1630
|
+
if (n === m.object && r === m.object) {
|
|
1631
|
+
let n = g.objectKeys(t), r = g.objectKeys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
1632
|
+
...e,
|
|
1633
|
+
...t
|
|
1632
1634
|
};
|
|
1633
|
-
for (let
|
|
1634
|
-
let
|
|
1635
|
-
if (!
|
|
1636
|
-
|
|
1635
|
+
for (let n of r) {
|
|
1636
|
+
let r = Oe(e[n], t[n]);
|
|
1637
|
+
if (!r.valid) return { valid: !1 };
|
|
1638
|
+
i[n] = r.data;
|
|
1637
1639
|
}
|
|
1638
1640
|
return {
|
|
1639
1641
|
valid: !0,
|
|
1640
|
-
data:
|
|
1642
|
+
data: i
|
|
1641
1643
|
};
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1644
|
+
}
|
|
1645
|
+
if (n === m.array && r === m.array) {
|
|
1646
|
+
if (e.length !== t.length) return { valid: !1 };
|
|
1647
|
+
let n = [];
|
|
1648
|
+
for (let r = 0; r < e.length; r++) {
|
|
1649
|
+
let i = e[r], a = t[r], o = Oe(i, a);
|
|
1647
1650
|
if (!o.valid) return { valid: !1 };
|
|
1648
|
-
|
|
1651
|
+
n.push(o.data);
|
|
1649
1652
|
}
|
|
1650
1653
|
return {
|
|
1651
1654
|
valid: !0,
|
|
1652
|
-
data:
|
|
1655
|
+
data: n
|
|
1653
1656
|
};
|
|
1654
|
-
}
|
|
1657
|
+
}
|
|
1658
|
+
return n === m.date && r === m.date && +e == +t ? {
|
|
1655
1659
|
valid: !0,
|
|
1656
|
-
data:
|
|
1657
|
-
};
|
|
1658
|
-
else return { valid: !1 };
|
|
1660
|
+
data: e
|
|
1661
|
+
} : { valid: !1 };
|
|
1659
1662
|
}
|
|
1660
|
-
var L = class extends
|
|
1663
|
+
var L = class extends y {
|
|
1661
1664
|
_parse(e) {
|
|
1662
|
-
let { status:
|
|
1663
|
-
if (
|
|
1664
|
-
let a =
|
|
1665
|
-
return a.valid ? ((
|
|
1666
|
-
status:
|
|
1665
|
+
let { status: n, ctx: r } = this._processInputParams(e), i = (e, i) => {
|
|
1666
|
+
if (u(e) || u(i)) return o;
|
|
1667
|
+
let a = Oe(e.value, i.value);
|
|
1668
|
+
return a.valid ? ((f(e) || f(i)) && n.dirty(), {
|
|
1669
|
+
status: n.value,
|
|
1667
1670
|
value: a.data
|
|
1668
|
-
}) : (
|
|
1671
|
+
}) : (l(r, { code: t.invalid_intersection_types }), o);
|
|
1669
1672
|
};
|
|
1670
|
-
return
|
|
1671
|
-
data:
|
|
1672
|
-
path:
|
|
1673
|
-
parent:
|
|
1673
|
+
return r.common.async ? Promise.all([this._def.left._parseAsync({
|
|
1674
|
+
data: r.data,
|
|
1675
|
+
path: r.path,
|
|
1676
|
+
parent: r
|
|
1674
1677
|
}), this._def.right._parseAsync({
|
|
1675
|
-
data:
|
|
1676
|
-
path:
|
|
1677
|
-
parent:
|
|
1678
|
-
})]).then(([e, t]) =>
|
|
1679
|
-
data:
|
|
1680
|
-
path:
|
|
1681
|
-
parent:
|
|
1678
|
+
data: r.data,
|
|
1679
|
+
path: r.path,
|
|
1680
|
+
parent: r
|
|
1681
|
+
})]).then(([e, t]) => i(e, t)) : i(this._def.left._parseSync({
|
|
1682
|
+
data: r.data,
|
|
1683
|
+
path: r.path,
|
|
1684
|
+
parent: r
|
|
1682
1685
|
}), this._def.right._parseSync({
|
|
1683
|
-
data:
|
|
1684
|
-
path:
|
|
1685
|
-
parent:
|
|
1686
|
+
data: r.data,
|
|
1687
|
+
path: r.path,
|
|
1688
|
+
parent: r
|
|
1686
1689
|
}));
|
|
1687
1690
|
}
|
|
1688
1691
|
};
|
|
@@ -1690,43 +1693,43 @@ L.create = (e, t, n) => new L({
|
|
|
1690
1693
|
left: e,
|
|
1691
1694
|
right: t,
|
|
1692
1695
|
typeName: $.ZodIntersection,
|
|
1693
|
-
...
|
|
1696
|
+
...v(n)
|
|
1694
1697
|
});
|
|
1695
|
-
var R = class
|
|
1696
|
-
_parse(
|
|
1697
|
-
let { status: n, ctx: r } = this._processInputParams(
|
|
1698
|
-
if (r.parsedType !==
|
|
1699
|
-
code:
|
|
1700
|
-
expected:
|
|
1698
|
+
var R = class e extends y {
|
|
1699
|
+
_parse(e) {
|
|
1700
|
+
let { status: n, ctx: r } = this._processInputParams(e);
|
|
1701
|
+
if (r.parsedType !== m.array) return l(r, {
|
|
1702
|
+
code: t.invalid_type,
|
|
1703
|
+
expected: m.array,
|
|
1701
1704
|
received: r.parsedType
|
|
1702
|
-
}),
|
|
1703
|
-
if (r.data.length < this._def.items.length) return
|
|
1704
|
-
code:
|
|
1705
|
+
}), o;
|
|
1706
|
+
if (r.data.length < this._def.items.length) return l(r, {
|
|
1707
|
+
code: t.too_small,
|
|
1705
1708
|
minimum: this._def.items.length,
|
|
1706
1709
|
inclusive: !0,
|
|
1707
1710
|
exact: !1,
|
|
1708
1711
|
type: "array"
|
|
1709
|
-
}),
|
|
1710
|
-
!this._def.rest && r.data.length > this._def.items.length && (
|
|
1711
|
-
code:
|
|
1712
|
+
}), o;
|
|
1713
|
+
!this._def.rest && r.data.length > this._def.items.length && (l(r, {
|
|
1714
|
+
code: t.too_big,
|
|
1712
1715
|
maximum: this._def.items.length,
|
|
1713
1716
|
inclusive: !0,
|
|
1714
1717
|
exact: !1,
|
|
1715
1718
|
type: "array"
|
|
1716
1719
|
}), n.dirty());
|
|
1717
|
-
let
|
|
1720
|
+
let i = [...r.data].map((e, t) => {
|
|
1718
1721
|
let n = this._def.items[t] || this._def.rest;
|
|
1719
|
-
return n ? n._parse(new
|
|
1722
|
+
return n ? n._parse(new _(r, e, r.path, t)) : null;
|
|
1720
1723
|
}).filter((e) => !!e);
|
|
1721
|
-
return r.common.async ? Promise.all(
|
|
1724
|
+
return r.common.async ? Promise.all(i).then((e) => c.mergeArray(n, e)) : c.mergeArray(n, i);
|
|
1722
1725
|
}
|
|
1723
1726
|
get items() {
|
|
1724
1727
|
return this._def.items;
|
|
1725
1728
|
}
|
|
1726
|
-
rest(
|
|
1727
|
-
return new
|
|
1729
|
+
rest(t) {
|
|
1730
|
+
return new e({
|
|
1728
1731
|
...this._def,
|
|
1729
|
-
rest:
|
|
1732
|
+
rest: t
|
|
1730
1733
|
});
|
|
1731
1734
|
}
|
|
1732
1735
|
};
|
|
@@ -1736,71 +1739,71 @@ R.create = (e, t) => {
|
|
|
1736
1739
|
items: e,
|
|
1737
1740
|
typeName: $.ZodTuple,
|
|
1738
1741
|
rest: null,
|
|
1739
|
-
...
|
|
1742
|
+
...v(t)
|
|
1740
1743
|
});
|
|
1741
1744
|
};
|
|
1742
|
-
var ke = class
|
|
1745
|
+
var ke = class e extends y {
|
|
1743
1746
|
get keySchema() {
|
|
1744
1747
|
return this._def.keyType;
|
|
1745
1748
|
}
|
|
1746
1749
|
get valueSchema() {
|
|
1747
1750
|
return this._def.valueType;
|
|
1748
1751
|
}
|
|
1749
|
-
_parse(
|
|
1750
|
-
let { status: n, ctx: r } = this._processInputParams(
|
|
1751
|
-
if (r.parsedType !==
|
|
1752
|
-
code:
|
|
1753
|
-
expected:
|
|
1752
|
+
_parse(e) {
|
|
1753
|
+
let { status: n, ctx: r } = this._processInputParams(e);
|
|
1754
|
+
if (r.parsedType !== m.object) return l(r, {
|
|
1755
|
+
code: t.invalid_type,
|
|
1756
|
+
expected: m.object,
|
|
1754
1757
|
received: r.parsedType
|
|
1755
|
-
}),
|
|
1756
|
-
let
|
|
1757
|
-
for (let e in r.data)
|
|
1758
|
-
key:
|
|
1759
|
-
value: s._parse(new
|
|
1758
|
+
}), o;
|
|
1759
|
+
let i = [], a = this._def.keyType, s = this._def.valueType;
|
|
1760
|
+
for (let e in r.data) i.push({
|
|
1761
|
+
key: a._parse(new _(r, e, r.path, e)),
|
|
1762
|
+
value: s._parse(new _(r, r.data[e], r.path, e)),
|
|
1760
1763
|
alwaysSet: e in r.data
|
|
1761
1764
|
});
|
|
1762
|
-
return r.common.async ?
|
|
1765
|
+
return r.common.async ? c.mergeObjectAsync(n, i) : c.mergeObjectSync(n, i);
|
|
1763
1766
|
}
|
|
1764
1767
|
get element() {
|
|
1765
1768
|
return this._def.valueType;
|
|
1766
1769
|
}
|
|
1767
|
-
static create(
|
|
1768
|
-
return n instanceof
|
|
1769
|
-
keyType:
|
|
1770
|
+
static create(t, n, r) {
|
|
1771
|
+
return n instanceof y ? new e({
|
|
1772
|
+
keyType: t,
|
|
1770
1773
|
valueType: n,
|
|
1771
1774
|
typeName: $.ZodRecord,
|
|
1772
|
-
...
|
|
1773
|
-
}) : new
|
|
1774
|
-
keyType:
|
|
1775
|
-
valueType:
|
|
1775
|
+
...v(r)
|
|
1776
|
+
}) : new e({
|
|
1777
|
+
keyType: b.create(),
|
|
1778
|
+
valueType: t,
|
|
1776
1779
|
typeName: $.ZodRecord,
|
|
1777
|
-
...
|
|
1780
|
+
...v(n)
|
|
1778
1781
|
});
|
|
1779
1782
|
}
|
|
1780
|
-
}, z = class extends
|
|
1783
|
+
}, z = class extends y {
|
|
1781
1784
|
get keySchema() {
|
|
1782
1785
|
return this._def.keyType;
|
|
1783
1786
|
}
|
|
1784
1787
|
get valueSchema() {
|
|
1785
1788
|
return this._def.valueType;
|
|
1786
1789
|
}
|
|
1787
|
-
_parse(
|
|
1788
|
-
let { status: n, ctx: r } = this._processInputParams(
|
|
1789
|
-
if (r.parsedType !==
|
|
1790
|
-
code:
|
|
1791
|
-
expected:
|
|
1790
|
+
_parse(e) {
|
|
1791
|
+
let { status: n, ctx: r } = this._processInputParams(e);
|
|
1792
|
+
if (r.parsedType !== m.map) return l(r, {
|
|
1793
|
+
code: t.invalid_type,
|
|
1794
|
+
expected: m.map,
|
|
1792
1795
|
received: r.parsedType
|
|
1793
|
-
}),
|
|
1794
|
-
let
|
|
1795
|
-
key:
|
|
1796
|
-
value:
|
|
1796
|
+
}), o;
|
|
1797
|
+
let i = this._def.keyType, a = this._def.valueType, s = [...r.data.entries()].map(([e, t], n) => ({
|
|
1798
|
+
key: i._parse(new _(r, e, r.path, [n, "key"])),
|
|
1799
|
+
value: a._parse(new _(r, t, r.path, [n, "value"]))
|
|
1797
1800
|
}));
|
|
1798
1801
|
if (r.common.async) {
|
|
1799
1802
|
let e = /* @__PURE__ */ new Map();
|
|
1800
1803
|
return Promise.resolve().then(async () => {
|
|
1801
1804
|
for (let t of s) {
|
|
1802
1805
|
let r = await t.key, i = await t.value;
|
|
1803
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
1806
|
+
if (r.status === "aborted" || i.status === "aborted") return o;
|
|
1804
1807
|
(r.status === "dirty" || i.status === "dirty") && n.dirty(), e.set(r.value, i.value);
|
|
1805
1808
|
}
|
|
1806
1809
|
return {
|
|
@@ -1808,11 +1811,12 @@ var ke = class t extends v {
|
|
|
1808
1811
|
value: e
|
|
1809
1812
|
};
|
|
1810
1813
|
});
|
|
1811
|
-
}
|
|
1814
|
+
}
|
|
1815
|
+
{
|
|
1812
1816
|
let e = /* @__PURE__ */ new Map();
|
|
1813
1817
|
for (let t of s) {
|
|
1814
1818
|
let r = t.key, i = t.value;
|
|
1815
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
1819
|
+
if (r.status === "aborted" || i.status === "aborted") return o;
|
|
1816
1820
|
(r.status === "dirty" || i.status === "dirty") && n.dirty(), e.set(r.value, i.value);
|
|
1817
1821
|
}
|
|
1818
1822
|
return {
|
|
@@ -1826,37 +1830,37 @@ z.create = (e, t, n) => new z({
|
|
|
1826
1830
|
valueType: t,
|
|
1827
1831
|
keyType: e,
|
|
1828
1832
|
typeName: $.ZodMap,
|
|
1829
|
-
...
|
|
1833
|
+
...v(n)
|
|
1830
1834
|
});
|
|
1831
|
-
var B = class
|
|
1832
|
-
_parse(
|
|
1833
|
-
let { status: n, ctx: r } = this._processInputParams(
|
|
1834
|
-
if (r.parsedType !==
|
|
1835
|
-
code:
|
|
1836
|
-
expected:
|
|
1835
|
+
var B = class e extends y {
|
|
1836
|
+
_parse(e) {
|
|
1837
|
+
let { status: n, ctx: r } = this._processInputParams(e);
|
|
1838
|
+
if (r.parsedType !== m.set) return l(r, {
|
|
1839
|
+
code: t.invalid_type,
|
|
1840
|
+
expected: m.set,
|
|
1837
1841
|
received: r.parsedType
|
|
1838
|
-
}),
|
|
1839
|
-
let
|
|
1840
|
-
|
|
1841
|
-
code:
|
|
1842
|
-
minimum:
|
|
1842
|
+
}), o;
|
|
1843
|
+
let i = this._def;
|
|
1844
|
+
i.minSize !== null && r.data.size < i.minSize.value && (l(r, {
|
|
1845
|
+
code: t.too_small,
|
|
1846
|
+
minimum: i.minSize.value,
|
|
1843
1847
|
type: "set",
|
|
1844
1848
|
inclusive: !0,
|
|
1845
1849
|
exact: !1,
|
|
1846
|
-
message:
|
|
1847
|
-
}), n.dirty()),
|
|
1848
|
-
code:
|
|
1849
|
-
maximum:
|
|
1850
|
+
message: i.minSize.message
|
|
1851
|
+
}), n.dirty()), i.maxSize !== null && r.data.size > i.maxSize.value && (l(r, {
|
|
1852
|
+
code: t.too_big,
|
|
1853
|
+
maximum: i.maxSize.value,
|
|
1850
1854
|
type: "set",
|
|
1851
1855
|
inclusive: !0,
|
|
1852
1856
|
exact: !1,
|
|
1853
|
-
message:
|
|
1857
|
+
message: i.maxSize.message
|
|
1854
1858
|
}), n.dirty());
|
|
1855
|
-
let
|
|
1859
|
+
let a = this._def.valueType;
|
|
1856
1860
|
function s(e) {
|
|
1857
1861
|
let t = /* @__PURE__ */ new Set();
|
|
1858
1862
|
for (let r of e) {
|
|
1859
|
-
if (r.status === "aborted") return
|
|
1863
|
+
if (r.status === "aborted") return o;
|
|
1860
1864
|
r.status === "dirty" && n.dirty(), t.add(r.value);
|
|
1861
1865
|
}
|
|
1862
1866
|
return {
|
|
@@ -1864,24 +1868,24 @@ var B = class t extends v {
|
|
|
1864
1868
|
value: t
|
|
1865
1869
|
};
|
|
1866
1870
|
}
|
|
1867
|
-
let
|
|
1868
|
-
return r.common.async ? Promise.all(
|
|
1871
|
+
let c = [...r.data.values()].map((e, t) => a._parse(new _(r, e, r.path, t)));
|
|
1872
|
+
return r.common.async ? Promise.all(c).then((e) => s(e)) : s(c);
|
|
1869
1873
|
}
|
|
1870
|
-
min(
|
|
1871
|
-
return new
|
|
1874
|
+
min(t, n) {
|
|
1875
|
+
return new e({
|
|
1872
1876
|
...this._def,
|
|
1873
1877
|
minSize: {
|
|
1874
|
-
value:
|
|
1875
|
-
message:
|
|
1878
|
+
value: t,
|
|
1879
|
+
message: i.toString(n)
|
|
1876
1880
|
}
|
|
1877
1881
|
});
|
|
1878
1882
|
}
|
|
1879
|
-
max(
|
|
1880
|
-
return new
|
|
1883
|
+
max(t, n) {
|
|
1884
|
+
return new e({
|
|
1881
1885
|
...this._def,
|
|
1882
1886
|
maxSize: {
|
|
1883
|
-
value:
|
|
1884
|
-
message:
|
|
1887
|
+
value: t,
|
|
1888
|
+
message: i.toString(n)
|
|
1885
1889
|
}
|
|
1886
1890
|
});
|
|
1887
1891
|
}
|
|
@@ -1897,69 +1901,70 @@ B.create = (e, t) => new B({
|
|
|
1897
1901
|
minSize: null,
|
|
1898
1902
|
maxSize: null,
|
|
1899
1903
|
typeName: $.ZodSet,
|
|
1900
|
-
...
|
|
1904
|
+
...v(t)
|
|
1901
1905
|
});
|
|
1902
|
-
var Ae = class
|
|
1906
|
+
var Ae = class i extends y {
|
|
1903
1907
|
constructor() {
|
|
1904
1908
|
super(...arguments), this.validate = this.implement;
|
|
1905
1909
|
}
|
|
1906
|
-
_parse(
|
|
1907
|
-
let { ctx:
|
|
1908
|
-
if (
|
|
1909
|
-
code:
|
|
1910
|
-
expected:
|
|
1911
|
-
received:
|
|
1912
|
-
}),
|
|
1913
|
-
function
|
|
1914
|
-
return
|
|
1910
|
+
_parse(i) {
|
|
1911
|
+
let { ctx: a } = this._processInputParams(i);
|
|
1912
|
+
if (a.parsedType !== m.function) return l(a, {
|
|
1913
|
+
code: t.invalid_type,
|
|
1914
|
+
expected: m.function,
|
|
1915
|
+
received: a.parsedType
|
|
1916
|
+
}), o;
|
|
1917
|
+
function c(e, i) {
|
|
1918
|
+
return ee({
|
|
1915
1919
|
data: e,
|
|
1916
|
-
path:
|
|
1920
|
+
path: a.path,
|
|
1917
1921
|
errorMaps: [
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
+
a.common.contextualErrorMap,
|
|
1923
|
+
a.schemaErrorMap,
|
|
1924
|
+
n(),
|
|
1925
|
+
r
|
|
1922
1926
|
].filter((e) => !!e),
|
|
1923
1927
|
issueData: {
|
|
1924
|
-
code:
|
|
1925
|
-
argumentsError:
|
|
1928
|
+
code: t.invalid_arguments,
|
|
1929
|
+
argumentsError: i
|
|
1926
1930
|
}
|
|
1927
1931
|
});
|
|
1928
1932
|
}
|
|
1929
|
-
function u(e,
|
|
1930
|
-
return
|
|
1933
|
+
function u(e, i) {
|
|
1934
|
+
return ee({
|
|
1931
1935
|
data: e,
|
|
1932
|
-
path:
|
|
1936
|
+
path: a.path,
|
|
1933
1937
|
errorMaps: [
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
+
a.common.contextualErrorMap,
|
|
1939
|
+
a.schemaErrorMap,
|
|
1940
|
+
n(),
|
|
1941
|
+
r
|
|
1938
1942
|
].filter((e) => !!e),
|
|
1939
1943
|
issueData: {
|
|
1940
|
-
code:
|
|
1941
|
-
returnTypeError:
|
|
1944
|
+
code: t.invalid_return_type,
|
|
1945
|
+
returnTypeError: i
|
|
1942
1946
|
}
|
|
1943
1947
|
});
|
|
1944
1948
|
}
|
|
1945
|
-
let
|
|
1949
|
+
let d = { errorMap: a.common.contextualErrorMap }, f = a.data;
|
|
1946
1950
|
if (this._def.returns instanceof G) {
|
|
1947
|
-
let
|
|
1948
|
-
return
|
|
1949
|
-
let
|
|
1950
|
-
throw
|
|
1951
|
-
}), a = await Reflect.apply(
|
|
1952
|
-
return await
|
|
1953
|
-
throw
|
|
1951
|
+
let t = this;
|
|
1952
|
+
return s(async function(...n) {
|
|
1953
|
+
let r = new e([]), i = await t._def.args.parseAsync(n, d).catch((e) => {
|
|
1954
|
+
throw r.addIssue(c(n, e)), r;
|
|
1955
|
+
}), a = await Reflect.apply(f, this, i);
|
|
1956
|
+
return await t._def.returns._def.type.parseAsync(a, d).catch((e) => {
|
|
1957
|
+
throw r.addIssue(u(a, e)), r;
|
|
1954
1958
|
});
|
|
1955
1959
|
});
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1960
|
+
}
|
|
1961
|
+
{
|
|
1962
|
+
let t = this;
|
|
1963
|
+
return s(function(...n) {
|
|
1964
|
+
let r = t._def.args.safeParse(n, d);
|
|
1965
|
+
if (!r.success) throw new e([c(n, r.error)]);
|
|
1966
|
+
let i = Reflect.apply(f, this, r.data), a = t._def.returns.safeParse(i, d);
|
|
1967
|
+
if (!a.success) throw new e([u(i, a.error)]);
|
|
1963
1968
|
return a.data;
|
|
1964
1969
|
});
|
|
1965
1970
|
}
|
|
@@ -1971,13 +1976,13 @@ var Ae = class t extends v {
|
|
|
1971
1976
|
return this._def.returns;
|
|
1972
1977
|
}
|
|
1973
1978
|
args(...e) {
|
|
1974
|
-
return new
|
|
1979
|
+
return new i({
|
|
1975
1980
|
...this._def,
|
|
1976
|
-
args: R.create(e).rest(
|
|
1981
|
+
args: R.create(e).rest(k.create())
|
|
1977
1982
|
});
|
|
1978
1983
|
}
|
|
1979
1984
|
returns(e) {
|
|
1980
|
-
return new
|
|
1985
|
+
return new i({
|
|
1981
1986
|
...this._def,
|
|
1982
1987
|
returns: e
|
|
1983
1988
|
});
|
|
@@ -1988,15 +1993,15 @@ var Ae = class t extends v {
|
|
|
1988
1993
|
strictImplement(e) {
|
|
1989
1994
|
return this.parse(e);
|
|
1990
1995
|
}
|
|
1991
|
-
static create(e,
|
|
1992
|
-
return new
|
|
1993
|
-
args: e || R.create([]).rest(
|
|
1994
|
-
returns:
|
|
1996
|
+
static create(e, t, n) {
|
|
1997
|
+
return new i({
|
|
1998
|
+
args: e || R.create([]).rest(k.create()),
|
|
1999
|
+
returns: t || k.create(),
|
|
1995
2000
|
typeName: $.ZodFunction,
|
|
1996
|
-
...
|
|
2001
|
+
...v(n)
|
|
1997
2002
|
});
|
|
1998
2003
|
}
|
|
1999
|
-
}, V = class extends
|
|
2004
|
+
}, V = class extends y {
|
|
2000
2005
|
get schema() {
|
|
2001
2006
|
return this._def.getter();
|
|
2002
2007
|
}
|
|
@@ -2012,17 +2017,17 @@ var Ae = class t extends v {
|
|
|
2012
2017
|
V.create = (e, t) => new V({
|
|
2013
2018
|
getter: e,
|
|
2014
2019
|
typeName: $.ZodLazy,
|
|
2015
|
-
...
|
|
2020
|
+
...v(t)
|
|
2016
2021
|
});
|
|
2017
|
-
var H = class extends
|
|
2022
|
+
var H = class extends y {
|
|
2018
2023
|
_parse(e) {
|
|
2019
2024
|
if (e.data !== this._def.value) {
|
|
2020
|
-
let
|
|
2021
|
-
return
|
|
2022
|
-
received:
|
|
2023
|
-
code:
|
|
2025
|
+
let n = this._getOrReturnCtx(e);
|
|
2026
|
+
return l(n, {
|
|
2027
|
+
received: n.data,
|
|
2028
|
+
code: t.invalid_literal,
|
|
2024
2029
|
expected: this._def.value
|
|
2025
|
-
}),
|
|
2030
|
+
}), o;
|
|
2026
2031
|
}
|
|
2027
2032
|
return {
|
|
2028
2033
|
status: "valid",
|
|
@@ -2036,34 +2041,34 @@ var H = class extends v {
|
|
|
2036
2041
|
H.create = (e, t) => new H({
|
|
2037
2042
|
value: e,
|
|
2038
2043
|
typeName: $.ZodLiteral,
|
|
2039
|
-
...
|
|
2044
|
+
...v(t)
|
|
2040
2045
|
});
|
|
2041
2046
|
function je(e, t) {
|
|
2042
2047
|
return new U({
|
|
2043
2048
|
values: e,
|
|
2044
2049
|
typeName: $.ZodEnum,
|
|
2045
|
-
...
|
|
2050
|
+
...v(t)
|
|
2046
2051
|
});
|
|
2047
2052
|
}
|
|
2048
|
-
var U = class e extends
|
|
2053
|
+
var U = class e extends y {
|
|
2049
2054
|
_parse(e) {
|
|
2050
2055
|
if (typeof e.data != "string") {
|
|
2051
|
-
let
|
|
2052
|
-
return
|
|
2053
|
-
expected:
|
|
2054
|
-
received:
|
|
2055
|
-
code:
|
|
2056
|
-
}),
|
|
2056
|
+
let n = this._getOrReturnCtx(e), r = this._def.values;
|
|
2057
|
+
return l(n, {
|
|
2058
|
+
expected: g.joinValues(r),
|
|
2059
|
+
received: n.parsedType,
|
|
2060
|
+
code: t.invalid_type
|
|
2061
|
+
}), o;
|
|
2057
2062
|
}
|
|
2058
2063
|
if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
|
|
2059
|
-
let
|
|
2060
|
-
return
|
|
2061
|
-
received:
|
|
2062
|
-
code:
|
|
2063
|
-
options:
|
|
2064
|
-
}),
|
|
2064
|
+
let n = this._getOrReturnCtx(e), r = this._def.values;
|
|
2065
|
+
return l(n, {
|
|
2066
|
+
received: n.data,
|
|
2067
|
+
code: t.invalid_enum_value,
|
|
2068
|
+
options: r
|
|
2069
|
+
}), o;
|
|
2065
2070
|
}
|
|
2066
|
-
return
|
|
2071
|
+
return s(e.data);
|
|
2067
2072
|
}
|
|
2068
2073
|
get options() {
|
|
2069
2074
|
return this._def.values;
|
|
@@ -2097,26 +2102,26 @@ var U = class e extends v {
|
|
|
2097
2102
|
}
|
|
2098
2103
|
};
|
|
2099
2104
|
U.create = je;
|
|
2100
|
-
var W = class extends
|
|
2101
|
-
_parse(
|
|
2102
|
-
let
|
|
2103
|
-
if (
|
|
2104
|
-
let e =
|
|
2105
|
-
return
|
|
2106
|
-
expected:
|
|
2107
|
-
received:
|
|
2108
|
-
code:
|
|
2109
|
-
}),
|
|
2105
|
+
var W = class extends y {
|
|
2106
|
+
_parse(e) {
|
|
2107
|
+
let n = g.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
2108
|
+
if (r.parsedType !== m.string && r.parsedType !== m.number) {
|
|
2109
|
+
let e = g.objectValues(n);
|
|
2110
|
+
return l(r, {
|
|
2111
|
+
expected: g.joinValues(e),
|
|
2112
|
+
received: r.parsedType,
|
|
2113
|
+
code: t.invalid_type
|
|
2114
|
+
}), o;
|
|
2110
2115
|
}
|
|
2111
|
-
if (this._cache ||= new Set(
|
|
2112
|
-
let e =
|
|
2113
|
-
return
|
|
2114
|
-
received:
|
|
2115
|
-
code:
|
|
2116
|
+
if (this._cache ||= new Set(g.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
|
|
2117
|
+
let e = g.objectValues(n);
|
|
2118
|
+
return l(r, {
|
|
2119
|
+
received: r.data,
|
|
2120
|
+
code: t.invalid_enum_value,
|
|
2116
2121
|
options: e
|
|
2117
|
-
}),
|
|
2122
|
+
}), o;
|
|
2118
2123
|
}
|
|
2119
|
-
return
|
|
2124
|
+
return s(e.data);
|
|
2120
2125
|
}
|
|
2121
2126
|
get enum() {
|
|
2122
2127
|
return this._def.values;
|
|
@@ -2125,19 +2130,21 @@ var W = class extends v {
|
|
|
2125
2130
|
W.create = (e, t) => new W({
|
|
2126
2131
|
values: e,
|
|
2127
2132
|
typeName: $.ZodNativeEnum,
|
|
2128
|
-
...
|
|
2133
|
+
...v(t)
|
|
2129
2134
|
});
|
|
2130
|
-
var G = class extends
|
|
2135
|
+
var G = class extends y {
|
|
2131
2136
|
unwrap() {
|
|
2132
2137
|
return this._def.type;
|
|
2133
2138
|
}
|
|
2134
|
-
_parse(
|
|
2135
|
-
let { ctx: n } = this._processInputParams(
|
|
2136
|
-
|
|
2137
|
-
code:
|
|
2138
|
-
expected:
|
|
2139
|
+
_parse(e) {
|
|
2140
|
+
let { ctx: n } = this._processInputParams(e);
|
|
2141
|
+
if (n.parsedType !== m.promise && n.common.async === !1) return l(n, {
|
|
2142
|
+
code: t.invalid_type,
|
|
2143
|
+
expected: m.promise,
|
|
2139
2144
|
received: n.parsedType
|
|
2140
|
-
}),
|
|
2145
|
+
}), o;
|
|
2146
|
+
let r = n.parsedType === m.promise ? n.data : Promise.resolve(n.data);
|
|
2147
|
+
return s(r.then((e) => this._def.type.parseAsync(e, {
|
|
2141
2148
|
path: n.path,
|
|
2142
2149
|
errorMap: n.common.contextualErrorMap
|
|
2143
2150
|
})));
|
|
@@ -2146,9 +2153,9 @@ var G = class extends v {
|
|
|
2146
2153
|
G.create = (e, t) => new G({
|
|
2147
2154
|
type: e,
|
|
2148
2155
|
typeName: $.ZodPromise,
|
|
2149
|
-
...
|
|
2156
|
+
...v(t)
|
|
2150
2157
|
});
|
|
2151
|
-
var K = class extends
|
|
2158
|
+
var K = class extends y {
|
|
2152
2159
|
innerType() {
|
|
2153
2160
|
return this._def.schema;
|
|
2154
2161
|
}
|
|
@@ -2156,90 +2163,94 @@ var K = class extends v {
|
|
|
2156
2163
|
return this._def.schema._def.typeName === $.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2157
2164
|
}
|
|
2158
2165
|
_parse(e) {
|
|
2159
|
-
let { status: t, ctx:
|
|
2166
|
+
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
2160
2167
|
addIssue: (e) => {
|
|
2161
|
-
|
|
2168
|
+
l(n, e), e.fatal ? t.abort() : t.dirty();
|
|
2162
2169
|
},
|
|
2163
2170
|
get path() {
|
|
2164
|
-
return
|
|
2171
|
+
return n.path;
|
|
2165
2172
|
}
|
|
2166
2173
|
};
|
|
2167
|
-
if (
|
|
2168
|
-
let e =
|
|
2169
|
-
if (
|
|
2170
|
-
if (t.value === "aborted") return
|
|
2171
|
-
let
|
|
2174
|
+
if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
|
|
2175
|
+
let e = r.transform(n.data, i);
|
|
2176
|
+
if (n.common.async) return Promise.resolve(e).then(async (e) => {
|
|
2177
|
+
if (t.value === "aborted") return o;
|
|
2178
|
+
let r = await this._def.schema._parseAsync({
|
|
2172
2179
|
data: e,
|
|
2173
|
-
path:
|
|
2174
|
-
parent:
|
|
2180
|
+
path: n.path,
|
|
2181
|
+
parent: n
|
|
2175
2182
|
});
|
|
2176
|
-
return
|
|
2183
|
+
return r.status === "aborted" ? o : r.status === "dirty" || t.value === "dirty" ? a(r.value) : r;
|
|
2177
2184
|
});
|
|
2178
2185
|
{
|
|
2179
|
-
if (t.value === "aborted") return
|
|
2180
|
-
let
|
|
2186
|
+
if (t.value === "aborted") return o;
|
|
2187
|
+
let r = this._def.schema._parseSync({
|
|
2181
2188
|
data: e,
|
|
2182
|
-
path:
|
|
2183
|
-
parent:
|
|
2189
|
+
path: n.path,
|
|
2190
|
+
parent: n
|
|
2184
2191
|
});
|
|
2185
|
-
return
|
|
2192
|
+
return r.status === "aborted" ? o : r.status === "dirty" || t.value === "dirty" ? a(r.value) : r;
|
|
2186
2193
|
}
|
|
2187
2194
|
}
|
|
2188
|
-
if (
|
|
2195
|
+
if (r.type === "refinement") {
|
|
2189
2196
|
let e = (e) => {
|
|
2190
|
-
let t =
|
|
2191
|
-
if (
|
|
2197
|
+
let t = r.refinement(e, i);
|
|
2198
|
+
if (n.common.async) return Promise.resolve(t);
|
|
2192
2199
|
if (t instanceof Promise) throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2193
2200
|
return e;
|
|
2194
2201
|
};
|
|
2195
|
-
if (
|
|
2196
|
-
let
|
|
2197
|
-
data:
|
|
2198
|
-
path:
|
|
2199
|
-
parent:
|
|
2202
|
+
if (n.common.async === !1) {
|
|
2203
|
+
let r = this._def.schema._parseSync({
|
|
2204
|
+
data: n.data,
|
|
2205
|
+
path: n.path,
|
|
2206
|
+
parent: n
|
|
2200
2207
|
});
|
|
2201
|
-
return
|
|
2208
|
+
return r.status === "aborted" ? o : (r.status === "dirty" && t.dirty(), e(r.value), {
|
|
2202
2209
|
status: t.value,
|
|
2203
|
-
value:
|
|
2210
|
+
value: r.value
|
|
2204
2211
|
});
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2212
|
+
}
|
|
2213
|
+
return this._def.schema._parseAsync({
|
|
2214
|
+
data: n.data,
|
|
2215
|
+
path: n.path,
|
|
2216
|
+
parent: n
|
|
2217
|
+
}).then((n) => n.status === "aborted" ? o : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
|
|
2210
2218
|
status: t.value,
|
|
2211
2219
|
value: n.value
|
|
2212
2220
|
}))));
|
|
2213
2221
|
}
|
|
2214
|
-
if (
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2222
|
+
if (r.type === "transform") {
|
|
2223
|
+
if (n.common.async === !1) {
|
|
2224
|
+
let e = this._def.schema._parseSync({
|
|
2225
|
+
data: n.data,
|
|
2226
|
+
path: n.path,
|
|
2227
|
+
parent: n
|
|
2228
|
+
});
|
|
2229
|
+
if (!p(e)) return o;
|
|
2230
|
+
let a = r.transform(e.value, i);
|
|
2231
|
+
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2232
|
+
return {
|
|
2233
|
+
status: t.value,
|
|
2234
|
+
value: a
|
|
2235
|
+
};
|
|
2236
|
+
}
|
|
2237
|
+
return this._def.schema._parseAsync({
|
|
2238
|
+
data: n.data,
|
|
2239
|
+
path: n.path,
|
|
2240
|
+
parent: n
|
|
2241
|
+
}).then((e) => p(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2224
2242
|
status: t.value,
|
|
2225
|
-
value:
|
|
2226
|
-
};
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
path: r.path,
|
|
2230
|
-
parent: r
|
|
2231
|
-
}).then((e) => m(e) ? Promise.resolve(i.transform(e.value, a)).then((e) => ({
|
|
2232
|
-
status: t.value,
|
|
2233
|
-
value: e
|
|
2234
|
-
})) : c);
|
|
2235
|
-
n.assertNever(i);
|
|
2243
|
+
value: e
|
|
2244
|
+
})) : o);
|
|
2245
|
+
}
|
|
2246
|
+
g.assertNever(r);
|
|
2236
2247
|
}
|
|
2237
2248
|
};
|
|
2238
2249
|
K.create = (e, t, n) => new K({
|
|
2239
2250
|
schema: e,
|
|
2240
2251
|
typeName: $.ZodEffects,
|
|
2241
2252
|
effect: t,
|
|
2242
|
-
...
|
|
2253
|
+
...v(n)
|
|
2243
2254
|
}), K.createWithPreprocess = (e, t, n) => new K({
|
|
2244
2255
|
schema: t,
|
|
2245
2256
|
effect: {
|
|
@@ -2247,11 +2258,11 @@ K.create = (e, t, n) => new K({
|
|
|
2247
2258
|
transform: e
|
|
2248
2259
|
},
|
|
2249
2260
|
typeName: $.ZodEffects,
|
|
2250
|
-
...
|
|
2261
|
+
...v(n)
|
|
2251
2262
|
});
|
|
2252
|
-
var q = class extends
|
|
2253
|
-
_parse(
|
|
2254
|
-
return this._getType(
|
|
2263
|
+
var q = class extends y {
|
|
2264
|
+
_parse(e) {
|
|
2265
|
+
return this._getType(e) === m.undefined ? s(void 0) : this._def.innerType._parse(e);
|
|
2255
2266
|
}
|
|
2256
2267
|
unwrap() {
|
|
2257
2268
|
return this._def.innerType;
|
|
@@ -2260,11 +2271,11 @@ var q = class extends v {
|
|
|
2260
2271
|
q.create = (e, t) => new q({
|
|
2261
2272
|
innerType: e,
|
|
2262
2273
|
typeName: $.ZodOptional,
|
|
2263
|
-
...
|
|
2274
|
+
...v(t)
|
|
2264
2275
|
});
|
|
2265
|
-
var J = class extends
|
|
2266
|
-
_parse(
|
|
2267
|
-
return this._getType(
|
|
2276
|
+
var J = class extends y {
|
|
2277
|
+
_parse(e) {
|
|
2278
|
+
return this._getType(e) === m.null ? s(null) : this._def.innerType._parse(e);
|
|
2268
2279
|
}
|
|
2269
2280
|
unwrap() {
|
|
2270
2281
|
return this._def.innerType;
|
|
@@ -2273,15 +2284,15 @@ var J = class extends v {
|
|
|
2273
2284
|
J.create = (e, t) => new J({
|
|
2274
2285
|
innerType: e,
|
|
2275
2286
|
typeName: $.ZodNullable,
|
|
2276
|
-
...
|
|
2287
|
+
...v(t)
|
|
2277
2288
|
});
|
|
2278
|
-
var Y = class extends
|
|
2279
|
-
_parse(
|
|
2280
|
-
let { ctx:
|
|
2281
|
-
return
|
|
2282
|
-
data:
|
|
2283
|
-
path:
|
|
2284
|
-
parent:
|
|
2289
|
+
var Y = class extends y {
|
|
2290
|
+
_parse(e) {
|
|
2291
|
+
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2292
|
+
return t.parsedType === m.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
2293
|
+
data: n,
|
|
2294
|
+
path: t.path,
|
|
2295
|
+
parent: t
|
|
2285
2296
|
});
|
|
2286
2297
|
}
|
|
2287
2298
|
removeDefault() {
|
|
@@ -2292,36 +2303,36 @@ Y.create = (e, t) => new Y({
|
|
|
2292
2303
|
innerType: e,
|
|
2293
2304
|
typeName: $.ZodDefault,
|
|
2294
2305
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2295
|
-
...
|
|
2306
|
+
...v(t)
|
|
2296
2307
|
});
|
|
2297
|
-
var X = class extends
|
|
2298
|
-
_parse(
|
|
2299
|
-
let { ctx:
|
|
2300
|
-
...
|
|
2308
|
+
var X = class extends y {
|
|
2309
|
+
_parse(t) {
|
|
2310
|
+
let { ctx: n } = this._processInputParams(t), r = {
|
|
2311
|
+
...n,
|
|
2301
2312
|
common: {
|
|
2302
|
-
...
|
|
2313
|
+
...n.common,
|
|
2303
2314
|
issues: []
|
|
2304
2315
|
}
|
|
2305
2316
|
}, i = this._def.innerType._parse({
|
|
2306
|
-
data:
|
|
2307
|
-
path:
|
|
2308
|
-
parent: { ...
|
|
2317
|
+
data: r.data,
|
|
2318
|
+
path: r.path,
|
|
2319
|
+
parent: { ...r }
|
|
2309
2320
|
});
|
|
2310
|
-
return
|
|
2321
|
+
return d(i) ? i.then((t) => ({
|
|
2311
2322
|
status: "valid",
|
|
2312
|
-
value:
|
|
2323
|
+
value: t.status === "valid" ? t.value : this._def.catchValue({
|
|
2313
2324
|
get error() {
|
|
2314
|
-
return new r
|
|
2325
|
+
return new e(r.common.issues);
|
|
2315
2326
|
},
|
|
2316
|
-
input:
|
|
2327
|
+
input: r.data
|
|
2317
2328
|
})
|
|
2318
2329
|
})) : {
|
|
2319
2330
|
status: "valid",
|
|
2320
2331
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
2321
2332
|
get error() {
|
|
2322
|
-
return new r
|
|
2333
|
+
return new e(r.common.issues);
|
|
2323
2334
|
},
|
|
2324
|
-
input:
|
|
2335
|
+
input: r.data
|
|
2325
2336
|
})
|
|
2326
2337
|
};
|
|
2327
2338
|
}
|
|
@@ -2333,29 +2344,29 @@ X.create = (e, t) => new X({
|
|
|
2333
2344
|
innerType: e,
|
|
2334
2345
|
typeName: $.ZodCatch,
|
|
2335
2346
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2336
|
-
...
|
|
2347
|
+
...v(t)
|
|
2337
2348
|
});
|
|
2338
|
-
var Z = class extends
|
|
2339
|
-
_parse(
|
|
2340
|
-
if (this._getType(
|
|
2341
|
-
let n = this._getOrReturnCtx(
|
|
2342
|
-
return
|
|
2343
|
-
code:
|
|
2344
|
-
expected:
|
|
2349
|
+
var Z = class extends y {
|
|
2350
|
+
_parse(e) {
|
|
2351
|
+
if (this._getType(e) !== m.nan) {
|
|
2352
|
+
let n = this._getOrReturnCtx(e);
|
|
2353
|
+
return l(n, {
|
|
2354
|
+
code: t.invalid_type,
|
|
2355
|
+
expected: m.nan,
|
|
2345
2356
|
received: n.parsedType
|
|
2346
|
-
}),
|
|
2357
|
+
}), o;
|
|
2347
2358
|
}
|
|
2348
2359
|
return {
|
|
2349
2360
|
status: "valid",
|
|
2350
|
-
value:
|
|
2361
|
+
value: e.data
|
|
2351
2362
|
};
|
|
2352
2363
|
}
|
|
2353
2364
|
};
|
|
2354
2365
|
Z.create = (e) => new Z({
|
|
2355
2366
|
typeName: $.ZodNaN,
|
|
2356
|
-
...
|
|
2367
|
+
...v(e)
|
|
2357
2368
|
});
|
|
2358
|
-
var Me = class extends
|
|
2369
|
+
var Me = class extends y {
|
|
2359
2370
|
_parse(e) {
|
|
2360
2371
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2361
2372
|
return this._def.type._parse({
|
|
@@ -2367,7 +2378,7 @@ var Me = class extends v {
|
|
|
2367
2378
|
unwrap() {
|
|
2368
2379
|
return this._def.type;
|
|
2369
2380
|
}
|
|
2370
|
-
}, Ne = class e extends
|
|
2381
|
+
}, Ne = class e extends y {
|
|
2371
2382
|
_parse(e) {
|
|
2372
2383
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2373
2384
|
if (n.common.async) return (async () => {
|
|
@@ -2376,7 +2387,7 @@ var Me = class extends v {
|
|
|
2376
2387
|
path: n.path,
|
|
2377
2388
|
parent: n
|
|
2378
2389
|
});
|
|
2379
|
-
return e.status === "aborted" ?
|
|
2390
|
+
return e.status === "aborted" ? o : e.status === "dirty" ? (t.dirty(), a(e.value)) : this._def.out._parseAsync({
|
|
2380
2391
|
data: e.value,
|
|
2381
2392
|
path: n.path,
|
|
2382
2393
|
parent: n
|
|
@@ -2388,7 +2399,7 @@ var Me = class extends v {
|
|
|
2388
2399
|
path: n.path,
|
|
2389
2400
|
parent: n
|
|
2390
2401
|
});
|
|
2391
|
-
return e.status === "aborted" ?
|
|
2402
|
+
return e.status === "aborted" ? o : e.status === "dirty" ? (t.dirty(), {
|
|
2392
2403
|
status: "dirty",
|
|
2393
2404
|
value: e.value
|
|
2394
2405
|
}) : this._def.out._parseSync({
|
|
@@ -2405,10 +2416,10 @@ var Me = class extends v {
|
|
|
2405
2416
|
typeName: $.ZodPipeline
|
|
2406
2417
|
});
|
|
2407
2418
|
}
|
|
2408
|
-
}, Q = class extends
|
|
2419
|
+
}, Q = class extends y {
|
|
2409
2420
|
_parse(e) {
|
|
2410
|
-
let t = this._def.innerType._parse(e), n = (e) => (
|
|
2411
|
-
return
|
|
2421
|
+
let t = this._def.innerType._parse(e), n = (e) => (p(e) && (e.value = Object.freeze(e.value)), e);
|
|
2422
|
+
return d(t) ? t.then((e) => n(e)) : n(t);
|
|
2412
2423
|
}
|
|
2413
2424
|
unwrap() {
|
|
2414
2425
|
return this._def.innerType;
|
|
@@ -2417,43 +2428,42 @@ var Me = class extends v {
|
|
|
2417
2428
|
Q.create = (e, t) => new Q({
|
|
2418
2429
|
innerType: e,
|
|
2419
2430
|
typeName: $.ZodReadonly,
|
|
2420
|
-
...
|
|
2421
|
-
}),
|
|
2431
|
+
...v(t)
|
|
2432
|
+
}), P.lazycreate;
|
|
2422
2433
|
var $;
|
|
2423
2434
|
(function(e) {
|
|
2424
2435
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
2425
2436
|
})($ ||= {});
|
|
2426
|
-
var Pe =
|
|
2427
|
-
Z.create,
|
|
2428
|
-
var Ie =
|
|
2429
|
-
|
|
2430
|
-
var Le =
|
|
2431
|
-
|
|
2437
|
+
var Pe = b.create, Fe = x.create;
|
|
2438
|
+
Z.create, S.create;
|
|
2439
|
+
var Ie = C.create;
|
|
2440
|
+
w.create, T.create, E.create, D.create, O.create, k.create, A.create, j.create, M.create;
|
|
2441
|
+
var Le = P.create;
|
|
2442
|
+
P.strictCreate, F.create, De.create, L.create, R.create, ke.create, z.create, B.create, Ae.create, V.create;
|
|
2432
2443
|
var Re = H.create, ze = U.create;
|
|
2433
2444
|
W.create, G.create, K.create, q.create, J.create, K.createWithPreprocess, Ne.create;
|
|
2434
2445
|
var Be = {
|
|
2435
|
-
string: ((e) =>
|
|
2446
|
+
string: ((e) => b.create({
|
|
2436
2447
|
...e,
|
|
2437
2448
|
coerce: !0
|
|
2438
2449
|
})),
|
|
2439
|
-
number: ((e) =>
|
|
2450
|
+
number: ((e) => x.create({
|
|
2440
2451
|
...e,
|
|
2441
2452
|
coerce: !0
|
|
2442
2453
|
})),
|
|
2443
|
-
boolean: ((e) =>
|
|
2454
|
+
boolean: ((e) => C.create({
|
|
2444
2455
|
...e,
|
|
2445
2456
|
coerce: !0
|
|
2446
2457
|
})),
|
|
2447
|
-
bigint: ((e) =>
|
|
2458
|
+
bigint: ((e) => S.create({
|
|
2448
2459
|
...e,
|
|
2449
2460
|
coerce: !0
|
|
2450
2461
|
})),
|
|
2451
|
-
date: ((e) =>
|
|
2462
|
+
date: ((e) => w.create({
|
|
2452
2463
|
...e,
|
|
2453
2464
|
coerce: !0
|
|
2454
2465
|
}))
|
|
2455
2466
|
};
|
|
2456
|
-
|
|
2457
|
-
export { Ie as booleanType, Be as coerce, ze as enumType, Re as literalType, Fe as numberType, Le as objectType, Pe as stringType };
|
|
2467
|
+
export { y as Schema, y as ZodSchema, y as ZodType, O as ZodAny, M as ZodArray, S as ZodBigInt, C as ZodBoolean, Me as ZodBranded, X as ZodCatch, w as ZodDate, Y as ZodDefault, De as ZodDiscriminatedUnion, K as ZodEffects, K as ZodTransformer, U as ZodEnum, $ as ZodFirstPartyTypeKind, Ae as ZodFunction, L as ZodIntersection, V as ZodLazy, H as ZodLiteral, z as ZodMap, Z as ZodNaN, W as ZodNativeEnum, A as ZodNever, D as ZodNull, J as ZodNullable, x as ZodNumber, P as ZodObject, q as ZodOptional, Ne as ZodPipeline, G as ZodPromise, Q as ZodReadonly, ke as ZodRecord, B as ZodSet, b as ZodString, T as ZodSymbol, R as ZodTuple, E as ZodUndefined, F as ZodUnion, k as ZodUnknown, j as ZodVoid, Ie as boolean, Be as coerce, Se as datetimeRegex, ze as enum, Re as literal, Fe as number, Le as object, Pe as string };
|
|
2458
2468
|
|
|
2459
2469
|
//# sourceMappingURL=types.js.map
|