@ozdao/prometheus-framework 0.2.128 → 0.2.129
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +1 -1
- package/dist/auth.server.js +12 -14
- package/dist/auth.server.mjs +12 -14
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +6 -2
- package/dist/gallery.server.mjs +6 -2
- package/dist/{index-BCCiEK_u.js → index-BshfsiQG.js} +8 -4
- package/dist/{index-B6a1mPgp.mjs → index-DKtnWDNC.mjs} +8 -4
- package/dist/{main-CmL_j3wv.mjs → main-DvdaURTh.mjs} +3261 -3154
- package/dist/main-hLtpe4Hr.js +92 -0
- package/dist/main.css +1 -1
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/node_modules/zod/lib/index.cjs +1 -1
- package/dist/node_modules/zod/lib/index.js +1162 -1033
- package/dist/orders.server.js +1 -1
- package/dist/orders.server.mjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue.js +89 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +1 -89
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/BottomSheet/BottomSheet.vue.cjs +1 -0
- package/dist/prometheus-framework/src/components/BottomSheet/BottomSheet.vue.js +73 -0
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +23 -22
- package/dist/prometheus-framework/src/components/Chips/Chips.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue.js +1 -27
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js +27 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +1 -58
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +58 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +144 -112
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +5 -5
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +127 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +1 -127
- package/dist/prometheus-framework/src/components/Menu/MenuItem.vue.cjs +1 -0
- package/dist/prometheus-framework/src/{modules/mobile/components → components}/Menu/MenuItem.vue.js +1 -1
- package/dist/prometheus-framework/src/components/PhotoViewer/PhotoViewer.vue.cjs +1 -0
- package/dist/prometheus-framework/src/{modules/gallery/components/blocks → components/PhotoViewer}/PhotoViewer.vue.js +6 -6
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +77 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -77
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +7 -6
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +114 -77
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +7 -22
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +62 -70
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +17 -16
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +9 -9
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.backoffice.router.cjs +1 -0
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.backoffice.router.js +18 -0
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockFilter.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockFilter.vue.js +46 -0
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +20 -16
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/landing/components/sections/SubscribeNewsletter.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/SubscribeNewsletter.vue.js +10 -10
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
- package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +27 -4
- package/dist/prometheus-framework/src/modules/middlewares/client/auth.validation.cjs +1 -1
- package/dist/prometheus-framework/src/modules/middlewares/client/auth.validation.js +14 -12
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +111 -93
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.js +13 -14
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +20 -22
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +5 -4
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +154 -0
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/router/backoffice.router.cjs +1 -0
- package/dist/prometheus-framework/src/modules/organizations/router/backoffice.router.js +27 -0
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +9 -7
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +26 -27
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +22 -23
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +30 -29
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +72 -51
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +51 -53
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +22 -22
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +62 -48
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +43 -44
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -5
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +24 -25
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/wallet.server.js +1 -1
- package/dist/wallet.server.mjs +1 -1
- package/dist/{web-Bk_OtXgv.js → web-CVIepGUM.js} +1 -1
- package/dist/{web-BHzpMOmk.mjs → web-Dt2JR41o.mjs} +1 -1
- package/package.json +3 -2
- package/src/{modules/mobile/components → components}/BottomSheet/BottomSheet.vue +24 -21
- package/src/components/Button/Button.vue +20 -3
- package/src/components/Feed/Feed.vue +28 -3
- package/src/components/FieldBig/FieldBig.vue +2 -2
- package/src/components/Sidebar/Sidebar.vue +13 -5
- package/src/components/index.js +0 -1
- package/src/main.js +0 -4
- package/src/modules/auth/controllers/auth.controller.js +14 -16
- package/src/modules/auth/router/auth.js +1 -4
- package/src/modules/auth/store/auth.js +28 -24
- package/src/modules/backoffice/components/pages/Dashboard.vue +29 -56
- package/src/modules/backoffice/router/backoffice.js +4 -15
- package/src/modules/community/components/blocks/CardBlogpost.vue +28 -26
- package/src/modules/community/components/layouts/Community.vue +1 -1
- package/src/modules/events/components/pages/EditEvent.vue +1 -1
- package/src/modules/gallery/components/pages/Gallery.vue +1 -2
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
- package/src/modules/gallery/router/gallery.backoffice.router.js +14 -0
- package/src/modules/globals/components/blocks/BlockFilter.vue +44 -0
- package/src/modules/globals/components/blocks/CardHeader.vue +5 -3
- package/src/modules/globals/components/layouts/Client.vue +99 -43
- package/src/modules/globals/components/pages/401.vue +5 -0
- package/src/modules/globals/components/pages/404.vue +5 -0
- package/src/modules/globals/components/partials/Footer.vue +17 -5
- package/src/modules/globals/components/partials/Header.vue +37 -18
- package/src/modules/globals/components/partials/Navigation.vue +7 -2
- package/src/modules/landing/components/sections/MobileApp.vue +2 -2
- package/src/modules/landing/components/sections/SubscribeNewsletter.vue +1 -1
- package/src/modules/landing/router/landing.js +2 -12
- package/src/modules/legal/components/pages/Legal.vue +2 -2
- package/src/modules/marketplace/components/layouts/Marketplace.vue +30 -13
- package/src/modules/marketplace/components/pages/Catalog.vue +2 -1
- package/src/modules/marketplace/router/marketplace.js +12 -10
- package/src/modules/marketplace/store/marketplace.js +25 -1
- package/src/modules/middlewares/client/auth.validation.js +5 -2
- package/src/modules/middlewares/server/authJwt.js +12 -6
- package/src/modules/middlewares/server/verifyAccesses.js +7 -3
- package/src/modules/orders/components/pages/OrderCreate.vue +34 -22
- package/src/modules/orders/components/sections/AskToLogin.vue +8 -7
- package/src/modules/orders/components/sections/FormDelivery.vue +6 -6
- package/src/modules/orders/router/orders.router.js +6 -3
- package/src/modules/organizations/components/pages/Members.vue +2 -2
- package/src/modules/organizations/components/pages/Organization.vue +2 -2
- package/src/modules/organizations/components/pages/OrganizationBackoffice.vue +204 -0
- package/src/modules/organizations/router/backoffice.router.js +25 -0
- package/src/modules/organizations/router/organizations.js +3 -1
- package/src/modules/pages/router/pages.router.js +15 -0
- package/src/modules/products/components/blocks/ImagesThumbnails.vue +11 -12
- package/src/modules/products/components/pages/Product.vue +7 -3
- package/src/modules/products/components/pages/ProductRecommmendation.vue +6 -5
- package/src/modules/products/components/sections/FilterProducts.vue +6 -6
- package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
- package/src/modules/products/components/sections/PopularProducts.vue +1 -3
- package/src/modules/products/components/sections/SectionProduct.vue +8 -8
- package/src/modules/spots/components/layouts/Spots.vue +33 -31
- package/src/modules/spots/components/pages/Map.vue +380 -353
- package/src/modules/spots/router/spots.js +3 -1
- package/src/modules/users/components/pages/Profile.vue +4 -4
- package/src/modules/users/components/pages/ProfileEdit.vue +4 -3
- package/src/modules/wallet/controllers/routes/payments.routes.js +0 -1
- package/src/styles/base/all.scss +4 -0
- package/src/styles/config.scss +2 -1
- package/src/styles/layout.scss +0 -1
- package/dist/credentials.schema-CDZCKfEI.mjs +0 -106
- package/dist/credentials.schema-CfhPcsuI.js +0 -105
- package/dist/index-CGIn4v5E.mjs +0 -217
- package/dist/index-CL9l0HRS.js +0 -216
- package/dist/main-8APITHuW.mjs +0 -14201
- package/dist/main-8N2Jmsuk.js +0 -91
- package/dist/main-BJvlNekm.mjs +0 -13631
- package/dist/main-BQisDfLk.js +0 -92
- package/dist/main-BV1Yv9Hy.js +0 -92
- package/dist/main-Ba3zK8PO.js +0 -92
- package/dist/main-Btlny-89.mjs +0 -14207
- package/dist/main-Bw0PvTs-.mjs +0 -13616
- package/dist/main-ByCtZbHD.mjs +0 -13752
- package/dist/main-CF35oB7q.js +0 -92
- package/dist/main-CX2ISR43.mjs +0 -13629
- package/dist/main-CXObXjv-.js +0 -92
- package/dist/main-CkeuHuCY.mjs +0 -13619
- package/dist/main-CnfcBov2.mjs +0 -13740
- package/dist/main-D0va05OD.js +0 -92
- package/dist/main-D50VqYhy.js +0 -91
- package/dist/main-D8gNZLSa.js +0 -92
- package/dist/main-DL3vRQCi.js +0 -92
- package/dist/main-DPsHxX0l.mjs +0 -13633
- package/dist/main-DTlUA63C.mjs +0 -13617
- package/dist/main-DfD5hLQo.mjs +0 -13633
- package/dist/main-Dh6Zfei9.js +0 -92
- package/dist/main-DmNP-t33.mjs +0 -13625
- package/dist/main-Ds3Z5x5d.mjs +0 -14206
- package/dist/main-DwyUYWFX.js +0 -92
- package/dist/main-VcxO-jAt.js +0 -92
- package/dist/main-cffh4bbv.js +0 -92
- package/dist/main-o_2eO2tP.mjs +0 -14208
- package/dist/main-pGo7JpSP.js +0 -92
- package/dist/metadata.schema-BLGSCSmy.mjs +0 -55
- package/dist/metadata.schema-Cu_mPkjE.js +0 -77
- package/dist/metadata.schema-DWR97jhW.js +0 -54
- package/dist/metadata.schema-cbFgazeK.mjs +0 -78
- package/dist/node_modules/@noble/hashes/esm/sha512.cjs +0 -1
- package/dist/node_modules/@noble/hashes/esm/sha512.js +0 -126
- package/dist/node_modules/vue-meta/dist/vue-meta.esm-browser.min.cjs +0 -7
- package/dist/node_modules/vue-meta/dist/vue-meta.esm-browser.min.js +0 -38
- package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/mergeArrays.cjs +0 -2
- package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js +0 -43
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +0 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +0 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +0 -373
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +0 -1
- package/dist/prometheus-framework/src/components/FieldPhone/utils.cjs +0 -1
- package/dist/prometheus-framework/src/components/FieldPhone/utils.js +0 -259
- package/dist/prometheus-framework/src/components/Magnifier/Magnifier.vue.cjs +0 -1
- package/dist/prometheus-framework/src/components/Magnifier/Magnifier.vue.js +0 -62
- package/dist/prometheus-framework/src/components/Magnifier/Magnifier.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/components/Magnifier/Magnifier.vue2.js +0 -1
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue2.js +0 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +0 -110
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue2.js +0 -1
- package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue2.js +0 -27
- package/dist/prometheus-framework/src/modules/globals/components/sections/Title.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/Title.vue.js +0 -29
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/MenuItem.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +0 -65
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +0 -87
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue2.js +0 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +0 -51
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue2.js +0 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SortProducts.vue.cjs +0 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SortProducts.vue.js +0 -53
- package/dist/queryProcessor-BJdKh0Ow.mjs +0 -162
- package/dist/queryProcessor-BJoJAetd.mjs +0 -162
- package/dist/queryProcessor-BUDoM96e.js +0 -148
- package/dist/queryProcessor-Cl6sU582.mjs +0 -149
- package/dist/queryProcessor-DRMo_GWK.js +0 -161
- package/dist/queryProcessor-DWf9tsis.js +0 -161
- package/dist/web-B2xhKZNK.js +0 -1
- package/dist/web-B8tq3Fda.mjs +0 -54
- package/dist/web-BDaOF322.js +0 -1
- package/dist/web-BEJCRWop.mjs +0 -54
- package/dist/web-BNKN7kk3.mjs +0 -54
- package/dist/web-BX5um81l.js +0 -1
- package/dist/web-ByJkgGrt.js +0 -1
- package/dist/web-C0sFgeYh.mjs +0 -54
- package/dist/web-CQQEUA9l.js +0 -1
- package/dist/web-CQiHBOEN.mjs +0 -54
- package/dist/web-CXzcKdk4.mjs +0 -54
- package/dist/web-CciQvENI.js +0 -1
- package/dist/web-CkrMHYIU.js +0 -1
- package/dist/web-CtVocufd.js +0 -1
- package/dist/web-CvRd3N_J.mjs +0 -54
- package/dist/web-D0ugI6ra.js +0 -1
- package/dist/web-D2Em-p-C.mjs +0 -54
- package/dist/web-D9Cfcy5k.js +0 -1
- package/dist/web-DEysqj0n.js +0 -1
- package/dist/web-DNq1tHCE.mjs +0 -54
- package/dist/web-DTzbVshr.mjs +0 -54
- package/dist/web-Douq6xn6.js +0 -1
- package/dist/web-DtWmpLE-.mjs +0 -54
- package/dist/web-TGdVOTnw.js +0 -1
- package/dist/web-VFuzUsNl.mjs +0 -54
- package/dist/web-_W9a_nWD.mjs +0 -54
- package/dist/web-kg3KgbAF.js +0 -1
- package/dist/web-nVxTNRH4.mjs +0 -54
- package/src/components/Magnifier/Magnifier.vue +0 -89
- /package/dist/prometheus-framework/src/{modules/mobile/components → components}/Menu/Menu.vue.cjs +0 -0
- /package/dist/prometheus-framework/src/{modules/mobile/components → components}/Menu/Menu.vue.js +0 -0
- /package/dist/prometheus-framework/src/{modules/mobile/components → components}/Menu/Menu.vue2.cjs +0 -0
- /package/dist/prometheus-framework/src/{modules/mobile/components → components}/Menu/Menu.vue2.js +0 -0
- /package/dist/prometheus-framework/src/{modules/gallery/components/blocks → components/PhotoViewer}/PhotoViewer.vue2.cjs +0 -0
- /package/dist/prometheus-framework/src/{modules/gallery/components/blocks → components/PhotoViewer}/PhotoViewer.vue2.js +0 -0
- /package/src/{modules/mobile/components → components}/Menu/Menu.vue +0 -0
- /package/src/{modules/mobile/components → components}/Menu/MenuItem.vue +0 -0
- /package/src/{modules/gallery/components/blocks → components/PhotoViewer}/PhotoViewer.vue +0 -0
- /package/src/modules/{mobile/components/BottomNavigation → globals/components/partials}/BottomNavigation.vue +0 -0
- /package/src/modules/{mobile/components/NavigationBar → globals/components/partials}/NavigationBar.vue +0 -0
- /package/src/modules/{mobile/components/Walkthrough → globals/components/sections}/Walkthrough.vue +0 -0
- /package/src/modules/{landing → pages}/components/pages/Page.vue +0 -0
- /package/src/modules/{backoffice/components/admin → pages/components/pages}/PageEdit.vue +0 -0
- /package/src/modules/{backoffice/components/admin → pages/components/pages}/Pages.vue +0 -0
@@ -1,48 +1,48 @@
|
|
1
1
|
var g;
|
2
|
-
(function(
|
3
|
-
|
2
|
+
(function(r) {
|
3
|
+
r.assertEqual = (n) => n;
|
4
4
|
function e(n) {
|
5
5
|
}
|
6
|
-
|
6
|
+
r.assertIs = e;
|
7
7
|
function t(n) {
|
8
8
|
throw new Error();
|
9
9
|
}
|
10
|
-
|
10
|
+
r.assertNever = t, r.arrayToEnum = (n) => {
|
11
11
|
const a = {};
|
12
12
|
for (const i of n)
|
13
13
|
a[i] = i;
|
14
14
|
return a;
|
15
|
-
},
|
16
|
-
const a =
|
15
|
+
}, r.getValidEnumValues = (n) => {
|
16
|
+
const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
|
17
17
|
for (const o of a)
|
18
18
|
i[o] = n[o];
|
19
|
-
return
|
20
|
-
},
|
19
|
+
return r.objectValues(i);
|
20
|
+
}, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
|
21
21
|
return n[a];
|
22
|
-
}),
|
22
|
+
}), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
|
23
23
|
const a = [];
|
24
24
|
for (const i in n)
|
25
25
|
Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
|
26
26
|
return a;
|
27
|
-
},
|
27
|
+
}, r.find = (n, a) => {
|
28
28
|
for (const i of n)
|
29
29
|
if (a(i))
|
30
30
|
return i;
|
31
|
-
},
|
32
|
-
function
|
31
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
|
32
|
+
function s(n, a = " | ") {
|
33
33
|
return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
34
34
|
}
|
35
|
-
|
35
|
+
r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
|
36
36
|
})(g || (g = {}));
|
37
|
-
var
|
38
|
-
(function(
|
39
|
-
|
37
|
+
var xe;
|
38
|
+
(function(r) {
|
39
|
+
r.mergeShapes = (e, t) => ({
|
40
40
|
...e,
|
41
41
|
...t
|
42
42
|
// second overwrites first
|
43
43
|
});
|
44
|
-
})(
|
45
|
-
const
|
44
|
+
})(xe || (xe = {}));
|
45
|
+
const f = g.arrayToEnum([
|
46
46
|
"string",
|
47
47
|
"nan",
|
48
48
|
"number",
|
@@ -63,28 +63,28 @@ const u = g.arrayToEnum([
|
|
63
63
|
"never",
|
64
64
|
"map",
|
65
65
|
"set"
|
66
|
-
]),
|
67
|
-
switch (typeof
|
66
|
+
]), j = (r) => {
|
67
|
+
switch (typeof r) {
|
68
68
|
case "undefined":
|
69
|
-
return
|
69
|
+
return f.undefined;
|
70
70
|
case "string":
|
71
|
-
return
|
71
|
+
return f.string;
|
72
72
|
case "number":
|
73
|
-
return isNaN(
|
73
|
+
return isNaN(r) ? f.nan : f.number;
|
74
74
|
case "boolean":
|
75
|
-
return
|
75
|
+
return f.boolean;
|
76
76
|
case "function":
|
77
|
-
return
|
77
|
+
return f.function;
|
78
78
|
case "bigint":
|
79
|
-
return
|
79
|
+
return f.bigint;
|
80
80
|
case "symbol":
|
81
|
-
return
|
81
|
+
return f.symbol;
|
82
82
|
case "object":
|
83
|
-
return Array.isArray(
|
83
|
+
return Array.isArray(r) ? f.array : r === null ? f.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? f.promise : typeof Map < "u" && r instanceof Map ? f.map : typeof Set < "u" && r instanceof Set ? f.set : typeof Date < "u" && r instanceof Date ? f.date : f.object;
|
84
84
|
default:
|
85
|
-
return
|
85
|
+
return f.unknown;
|
86
86
|
}
|
87
|
-
},
|
87
|
+
}, d = g.arrayToEnum([
|
88
88
|
"invalid_type",
|
89
89
|
"invalid_literal",
|
90
90
|
"custom",
|
@@ -101,13 +101,13 @@ const u = g.arrayToEnum([
|
|
101
101
|
"invalid_intersection_types",
|
102
102
|
"not_multiple_of",
|
103
103
|
"not_finite"
|
104
|
-
]),
|
105
|
-
class
|
104
|
+
]), Ve = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
105
|
+
class w extends Error {
|
106
106
|
constructor(e) {
|
107
|
-
super(), this.issues = [], this.addIssue = (
|
108
|
-
this.issues = [...this.issues,
|
109
|
-
}, this.addIssues = (
|
110
|
-
this.issues = [...this.issues, ...
|
107
|
+
super(), this.issues = [], this.addIssue = (s) => {
|
108
|
+
this.issues = [...this.issues, s];
|
109
|
+
}, this.addIssues = (s = []) => {
|
110
|
+
this.issues = [...this.issues, ...s];
|
111
111
|
};
|
112
112
|
const t = new.target.prototype;
|
113
113
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
@@ -118,7 +118,7 @@ class Z extends Error {
|
|
118
118
|
format(e) {
|
119
119
|
const t = e || function(a) {
|
120
120
|
return a.message;
|
121
|
-
},
|
121
|
+
}, s = { _errors: [] }, n = (a) => {
|
122
122
|
for (const i of a.issues)
|
123
123
|
if (i.code === "invalid_union")
|
124
124
|
i.unionErrors.map(n);
|
@@ -127,16 +127,20 @@ class Z extends Error {
|
|
127
127
|
else if (i.code === "invalid_arguments")
|
128
128
|
n(i.argumentsError);
|
129
129
|
else if (i.path.length === 0)
|
130
|
-
|
130
|
+
s._errors.push(t(i));
|
131
131
|
else {
|
132
|
-
let o =
|
133
|
-
for (;
|
134
|
-
const
|
135
|
-
|
132
|
+
let o = s, l = 0;
|
133
|
+
for (; l < i.path.length; ) {
|
134
|
+
const c = i.path[l];
|
135
|
+
l === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], l++;
|
136
136
|
}
|
137
137
|
}
|
138
138
|
};
|
139
|
-
return n(this),
|
139
|
+
return n(this), s;
|
140
|
+
}
|
141
|
+
static assert(e) {
|
142
|
+
if (!(e instanceof w))
|
143
|
+
throw new Error(`Not a ZodError: ${e}`);
|
140
144
|
}
|
141
145
|
toString() {
|
142
146
|
return this.message;
|
@@ -148,108 +152,114 @@ class Z extends Error {
|
|
148
152
|
return this.issues.length === 0;
|
149
153
|
}
|
150
154
|
flatten(e = (t) => t.message) {
|
151
|
-
const t = {},
|
155
|
+
const t = {}, s = [];
|
152
156
|
for (const n of this.issues)
|
153
|
-
n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) :
|
154
|
-
return { formErrors:
|
157
|
+
n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
|
158
|
+
return { formErrors: s, fieldErrors: t };
|
155
159
|
}
|
156
160
|
get formErrors() {
|
157
161
|
return this.flatten();
|
158
162
|
}
|
159
163
|
}
|
160
|
-
|
161
|
-
const W = (
|
164
|
+
w.create = (r) => new w(r);
|
165
|
+
const W = (r, e) => {
|
162
166
|
let t;
|
163
|
-
switch (
|
164
|
-
case
|
165
|
-
|
167
|
+
switch (r.code) {
|
168
|
+
case d.invalid_type:
|
169
|
+
r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
166
170
|
break;
|
167
|
-
case
|
168
|
-
t = `Invalid literal value, expected ${JSON.stringify(
|
171
|
+
case d.invalid_literal:
|
172
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, g.jsonStringifyReplacer)}`;
|
169
173
|
break;
|
170
|
-
case
|
171
|
-
t = `Unrecognized key(s) in object: ${g.joinValues(
|
174
|
+
case d.unrecognized_keys:
|
175
|
+
t = `Unrecognized key(s) in object: ${g.joinValues(r.keys, ", ")}`;
|
172
176
|
break;
|
173
|
-
case
|
177
|
+
case d.invalid_union:
|
174
178
|
t = "Invalid input";
|
175
179
|
break;
|
176
|
-
case
|
177
|
-
t = `Invalid discriminator value. Expected ${g.joinValues(
|
180
|
+
case d.invalid_union_discriminator:
|
181
|
+
t = `Invalid discriminator value. Expected ${g.joinValues(r.options)}`;
|
178
182
|
break;
|
179
|
-
case
|
180
|
-
t = `Invalid enum value. Expected ${g.joinValues(
|
183
|
+
case d.invalid_enum_value:
|
184
|
+
t = `Invalid enum value. Expected ${g.joinValues(r.options)}, received '${r.received}'`;
|
181
185
|
break;
|
182
|
-
case
|
186
|
+
case d.invalid_arguments:
|
183
187
|
t = "Invalid function arguments";
|
184
188
|
break;
|
185
|
-
case
|
189
|
+
case d.invalid_return_type:
|
186
190
|
t = "Invalid function return type";
|
187
191
|
break;
|
188
|
-
case
|
192
|
+
case d.invalid_date:
|
189
193
|
t = "Invalid date";
|
190
194
|
break;
|
191
|
-
case
|
192
|
-
typeof
|
195
|
+
case d.invalid_string:
|
196
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : g.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
193
197
|
break;
|
194
|
-
case
|
195
|
-
|
198
|
+
case d.too_small:
|
199
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
196
200
|
break;
|
197
|
-
case
|
198
|
-
|
201
|
+
case d.too_big:
|
202
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
|
199
203
|
break;
|
200
|
-
case
|
204
|
+
case d.custom:
|
201
205
|
t = "Invalid input";
|
202
206
|
break;
|
203
|
-
case
|
207
|
+
case d.invalid_intersection_types:
|
204
208
|
t = "Intersection results could not be merged";
|
205
209
|
break;
|
206
|
-
case
|
207
|
-
t = `Number must be a multiple of ${
|
210
|
+
case d.not_multiple_of:
|
211
|
+
t = `Number must be a multiple of ${r.multipleOf}`;
|
208
212
|
break;
|
209
|
-
case
|
213
|
+
case d.not_finite:
|
210
214
|
t = "Number must be finite";
|
211
215
|
break;
|
212
216
|
default:
|
213
|
-
t = e.defaultError, g.assertNever(
|
217
|
+
t = e.defaultError, g.assertNever(r);
|
214
218
|
}
|
215
219
|
return { message: t };
|
216
220
|
};
|
217
|
-
let
|
218
|
-
function
|
219
|
-
|
221
|
+
let Ne = W;
|
222
|
+
function De(r) {
|
223
|
+
Ne = r;
|
220
224
|
}
|
221
|
-
function
|
222
|
-
return
|
225
|
+
function ue() {
|
226
|
+
return Ne;
|
223
227
|
}
|
224
|
-
const
|
225
|
-
const { data: e, path: t, errorMaps:
|
228
|
+
const le = (r) => {
|
229
|
+
const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
|
226
230
|
...n,
|
227
231
|
path: a
|
228
232
|
};
|
233
|
+
if (n.message !== void 0)
|
234
|
+
return {
|
235
|
+
...n,
|
236
|
+
path: a,
|
237
|
+
message: n.message
|
238
|
+
};
|
229
239
|
let o = "";
|
230
|
-
const
|
231
|
-
for (const
|
232
|
-
o =
|
240
|
+
const l = s.filter((c) => !!c).slice().reverse();
|
241
|
+
for (const c of l)
|
242
|
+
o = c(i, { data: e, defaultError: o }).message;
|
233
243
|
return {
|
234
244
|
...n,
|
235
245
|
path: a,
|
236
|
-
message:
|
246
|
+
message: o
|
237
247
|
};
|
238
|
-
},
|
239
|
-
function
|
240
|
-
const t =
|
248
|
+
}, Le = [];
|
249
|
+
function u(r, e) {
|
250
|
+
const t = ue(), s = le({
|
241
251
|
issueData: e,
|
242
|
-
data:
|
243
|
-
path:
|
252
|
+
data: r.data,
|
253
|
+
path: r.path,
|
244
254
|
errorMaps: [
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
W
|
255
|
+
r.common.contextualErrorMap,
|
256
|
+
r.schemaErrorMap,
|
257
|
+
t,
|
258
|
+
t === W ? void 0 : W
|
249
259
|
// then global default map
|
250
|
-
].filter((
|
260
|
+
].filter((n) => !!n)
|
251
261
|
});
|
252
|
-
|
262
|
+
r.common.issues.push(s);
|
253
263
|
}
|
254
264
|
class k {
|
255
265
|
constructor() {
|
@@ -262,73 +272,90 @@ class k {
|
|
262
272
|
this.value !== "aborted" && (this.value = "aborted");
|
263
273
|
}
|
264
274
|
static mergeArray(e, t) {
|
265
|
-
const
|
275
|
+
const s = [];
|
266
276
|
for (const n of t) {
|
267
277
|
if (n.status === "aborted")
|
268
278
|
return m;
|
269
|
-
n.status === "dirty" && e.dirty(),
|
279
|
+
n.status === "dirty" && e.dirty(), s.push(n.value);
|
270
280
|
}
|
271
|
-
return { status: e.value, value:
|
281
|
+
return { status: e.value, value: s };
|
272
282
|
}
|
273
283
|
static async mergeObjectAsync(e, t) {
|
274
|
-
const
|
275
|
-
for (const n of t)
|
276
|
-
|
277
|
-
|
278
|
-
|
284
|
+
const s = [];
|
285
|
+
for (const n of t) {
|
286
|
+
const a = await n.key, i = await n.value;
|
287
|
+
s.push({
|
288
|
+
key: a,
|
289
|
+
value: i
|
279
290
|
});
|
280
|
-
|
291
|
+
}
|
292
|
+
return k.mergeObjectSync(e, s);
|
281
293
|
}
|
282
294
|
static mergeObjectSync(e, t) {
|
283
|
-
const
|
295
|
+
const s = {};
|
284
296
|
for (const n of t) {
|
285
297
|
const { key: a, value: i } = n;
|
286
298
|
if (a.status === "aborted" || i.status === "aborted")
|
287
299
|
return m;
|
288
|
-
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (
|
300
|
+
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (s[a.value] = i.value);
|
289
301
|
}
|
290
|
-
return { status: e.value, value:
|
302
|
+
return { status: e.value, value: s };
|
291
303
|
}
|
292
304
|
}
|
293
305
|
const m = Object.freeze({
|
294
306
|
status: "aborted"
|
295
|
-
}),
|
307
|
+
}), U = (r) => ({ status: "dirty", value: r }), b = (r) => ({ status: "valid", value: r }), ke = (r) => r.status === "aborted", be = (r) => r.status === "dirty", G = (r) => r.status === "valid", X = (r) => typeof Promise < "u" && r instanceof Promise;
|
308
|
+
function fe(r, e, t, s) {
|
309
|
+
if (typeof e == "function" ? r !== e || !s : !e.has(r))
|
310
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
311
|
+
return e.get(r);
|
312
|
+
}
|
313
|
+
function Oe(r, e, t, s, n) {
|
314
|
+
if (typeof e == "function" ? r !== e || !n : !e.has(r))
|
315
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
316
|
+
return e.set(r, t), t;
|
317
|
+
}
|
296
318
|
var h;
|
297
|
-
(function(
|
298
|
-
|
319
|
+
(function(r) {
|
320
|
+
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
299
321
|
})(h || (h = {}));
|
322
|
+
var J, H;
|
300
323
|
class O {
|
301
|
-
constructor(e, t,
|
302
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path =
|
324
|
+
constructor(e, t, s, n) {
|
325
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
303
326
|
}
|
304
327
|
get path() {
|
305
328
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
306
329
|
}
|
307
330
|
}
|
308
|
-
const
|
309
|
-
if (
|
331
|
+
const Se = (r, e) => {
|
332
|
+
if (G(e))
|
310
333
|
return { success: !0, data: e.value };
|
311
|
-
if (!
|
334
|
+
if (!r.common.issues.length)
|
312
335
|
throw new Error("Validation failed but no issues detected.");
|
313
336
|
return {
|
314
337
|
success: !1,
|
315
338
|
get error() {
|
316
339
|
if (this._error)
|
317
340
|
return this._error;
|
318
|
-
const t = new
|
341
|
+
const t = new w(r.common.issues);
|
319
342
|
return this._error = t, this._error;
|
320
343
|
}
|
321
344
|
};
|
322
345
|
};
|
323
|
-
function
|
324
|
-
if (!
|
346
|
+
function v(r) {
|
347
|
+
if (!r)
|
325
348
|
return {};
|
326
|
-
const { errorMap: e, invalid_type_error: t, required_error:
|
327
|
-
if (e && (t ||
|
349
|
+
const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
|
350
|
+
if (e && (t || s))
|
328
351
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
329
|
-
return e ? { errorMap: e, description: n } : { errorMap: (i, o) =>
|
352
|
+
return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
|
353
|
+
var l, c;
|
354
|
+
const { message: y } = r;
|
355
|
+
return i.code === "invalid_enum_value" ? { message: y ?? o.defaultError } : typeof o.data > "u" ? { message: (l = y ?? s) !== null && l !== void 0 ? l : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = y ?? t) !== null && c !== void 0 ? c : o.defaultError };
|
356
|
+
}, description: n };
|
330
357
|
}
|
331
|
-
class
|
358
|
+
class _ {
|
332
359
|
constructor(e) {
|
333
360
|
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
334
361
|
}
|
@@ -336,13 +363,13 @@ class v {
|
|
336
363
|
return this._def.description;
|
337
364
|
}
|
338
365
|
_getType(e) {
|
339
|
-
return
|
366
|
+
return j(e.data);
|
340
367
|
}
|
341
368
|
_getOrReturnCtx(e, t) {
|
342
369
|
return t || {
|
343
370
|
common: e.parent.common,
|
344
371
|
data: e.data,
|
345
|
-
parsedType:
|
372
|
+
parsedType: j(e.data),
|
346
373
|
schemaErrorMap: this._def.errorMap,
|
347
374
|
path: e.path,
|
348
375
|
parent: e.parent
|
@@ -354,7 +381,7 @@ class v {
|
|
354
381
|
ctx: {
|
355
382
|
common: e.parent.common,
|
356
383
|
data: e.data,
|
357
|
-
parsedType:
|
384
|
+
parsedType: j(e.data),
|
358
385
|
schemaErrorMap: this._def.errorMap,
|
359
386
|
path: e.path,
|
360
387
|
parent: e.parent
|
@@ -363,7 +390,7 @@ class v {
|
|
363
390
|
}
|
364
391
|
_parseSync(e) {
|
365
392
|
const t = this._parse(e);
|
366
|
-
if (
|
393
|
+
if (X(t))
|
367
394
|
throw new Error("Synchronous parse encountered promise.");
|
368
395
|
return t;
|
369
396
|
}
|
@@ -372,35 +399,35 @@ class v {
|
|
372
399
|
return Promise.resolve(t);
|
373
400
|
}
|
374
401
|
parse(e, t) {
|
375
|
-
const
|
376
|
-
if (
|
377
|
-
return
|
378
|
-
throw
|
402
|
+
const s = this.safeParse(e, t);
|
403
|
+
if (s.success)
|
404
|
+
return s.data;
|
405
|
+
throw s.error;
|
379
406
|
}
|
380
407
|
safeParse(e, t) {
|
381
|
-
var
|
408
|
+
var s;
|
382
409
|
const n = {
|
383
410
|
common: {
|
384
411
|
issues: [],
|
385
|
-
async: (
|
412
|
+
async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
|
386
413
|
contextualErrorMap: t == null ? void 0 : t.errorMap
|
387
414
|
},
|
388
415
|
path: (t == null ? void 0 : t.path) || [],
|
389
416
|
schemaErrorMap: this._def.errorMap,
|
390
417
|
parent: null,
|
391
418
|
data: e,
|
392
|
-
parsedType:
|
419
|
+
parsedType: j(e)
|
393
420
|
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
394
|
-
return
|
421
|
+
return Se(n, a);
|
395
422
|
}
|
396
423
|
async parseAsync(e, t) {
|
397
|
-
const
|
398
|
-
if (
|
399
|
-
return
|
400
|
-
throw
|
424
|
+
const s = await this.safeParseAsync(e, t);
|
425
|
+
if (s.success)
|
426
|
+
return s.data;
|
427
|
+
throw s.error;
|
401
428
|
}
|
402
429
|
async safeParseAsync(e, t) {
|
403
|
-
const
|
430
|
+
const s = {
|
404
431
|
common: {
|
405
432
|
issues: [],
|
406
433
|
contextualErrorMap: t == null ? void 0 : t.errorMap,
|
@@ -410,25 +437,25 @@ class v {
|
|
410
437
|
schemaErrorMap: this._def.errorMap,
|
411
438
|
parent: null,
|
412
439
|
data: e,
|
413
|
-
parsedType:
|
414
|
-
}, n = this._parse({ data: e, path:
|
415
|
-
return
|
440
|
+
parsedType: j(e)
|
441
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (X(n) ? n : Promise.resolve(n));
|
442
|
+
return Se(s, a);
|
416
443
|
}
|
417
444
|
refine(e, t) {
|
418
|
-
const
|
445
|
+
const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
|
419
446
|
return this._refinement((n, a) => {
|
420
447
|
const i = e(n), o = () => a.addIssue({
|
421
|
-
code:
|
422
|
-
...
|
448
|
+
code: d.custom,
|
449
|
+
...s(n)
|
423
450
|
});
|
424
|
-
return typeof Promise < "u" && i instanceof Promise ? i.then((
|
451
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((l) => l ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
425
452
|
});
|
426
453
|
}
|
427
454
|
refinement(e, t) {
|
428
|
-
return this._refinement((
|
455
|
+
return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
|
429
456
|
}
|
430
457
|
_refinement(e) {
|
431
|
-
return new
|
458
|
+
return new C({
|
432
459
|
schema: this,
|
433
460
|
typeName: p.ZodEffects,
|
434
461
|
effect: { type: "refinement", refinement: e }
|
@@ -438,10 +465,10 @@ class v {
|
|
438
465
|
return this._refinement(e);
|
439
466
|
}
|
440
467
|
optional() {
|
441
|
-
return
|
468
|
+
return N.create(this, this._def);
|
442
469
|
}
|
443
470
|
nullable() {
|
444
|
-
return
|
471
|
+
return P.create(this, this._def);
|
445
472
|
}
|
446
473
|
nullish() {
|
447
474
|
return this.nullable().optional();
|
@@ -450,17 +477,17 @@ class v {
|
|
450
477
|
return S.create(this, this._def);
|
451
478
|
}
|
452
479
|
promise() {
|
453
|
-
return
|
480
|
+
return Y.create(this, this._def);
|
454
481
|
}
|
455
482
|
or(e) {
|
456
|
-
return
|
483
|
+
return ee.create([this, e], this._def);
|
457
484
|
}
|
458
485
|
and(e) {
|
459
|
-
return
|
486
|
+
return te.create(this, e, this._def);
|
460
487
|
}
|
461
488
|
transform(e) {
|
462
|
-
return new
|
463
|
-
...
|
489
|
+
return new C({
|
490
|
+
...v(this._def),
|
464
491
|
schema: this,
|
465
492
|
typeName: p.ZodEffects,
|
466
493
|
effect: { type: "transform", transform: e }
|
@@ -468,24 +495,24 @@ class v {
|
|
468
495
|
}
|
469
496
|
default(e) {
|
470
497
|
const t = typeof e == "function" ? e : () => e;
|
471
|
-
return new
|
472
|
-
...
|
498
|
+
return new ie({
|
499
|
+
...v(this._def),
|
473
500
|
innerType: this,
|
474
501
|
defaultValue: t,
|
475
502
|
typeName: p.ZodDefault
|
476
503
|
});
|
477
504
|
}
|
478
505
|
brand() {
|
479
|
-
return new
|
506
|
+
return new Te({
|
480
507
|
typeName: p.ZodBranded,
|
481
508
|
type: this,
|
482
|
-
...
|
509
|
+
...v(this._def)
|
483
510
|
});
|
484
511
|
}
|
485
512
|
catch(e) {
|
486
513
|
const t = typeof e == "function" ? e : () => e;
|
487
|
-
return new
|
488
|
-
...
|
514
|
+
return new oe({
|
515
|
+
...v(this._def),
|
489
516
|
innerType: this,
|
490
517
|
catchValue: t,
|
491
518
|
typeName: p.ZodCatch
|
@@ -499,10 +526,10 @@ class v {
|
|
499
526
|
});
|
500
527
|
}
|
501
528
|
pipe(e) {
|
502
|
-
return
|
529
|
+
return ce.create(this, e);
|
503
530
|
}
|
504
531
|
readonly() {
|
505
|
-
return
|
532
|
+
return de.create(this);
|
506
533
|
}
|
507
534
|
isOptional() {
|
508
535
|
return this.safeParse(void 0).success;
|
@@ -511,147 +538,177 @@ class v {
|
|
511
538
|
return this.safeParse(null).success;
|
512
539
|
}
|
513
540
|
}
|
514
|
-
const
|
515
|
-
let
|
516
|
-
const
|
517
|
-
function
|
518
|
-
|
541
|
+
const ze = /^c[^\s-]{8,}$/i, Ue = /^[0-9a-z]+$/, Be = /^[0-9A-HJKMNP-TV-Z]{26}$/, We = /^[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, qe = /^[a-z0-9_-]{21}$/i, Ye = /^[-+]?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)?)??$/, Je = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, He = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
542
|
+
let ge;
|
543
|
+
const Ge = /^(?:(?: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])$/, Xe = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Qe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ee = "((\\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])))", Ke = new RegExp(`^${Ee}$`);
|
544
|
+
function Re(r) {
|
545
|
+
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
546
|
+
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
519
547
|
}
|
520
|
-
|
548
|
+
function Fe(r) {
|
549
|
+
return new RegExp(`^${Re(r)}$`);
|
550
|
+
}
|
551
|
+
function Ie(r) {
|
552
|
+
let e = `${Ee}T${Re(r)}`;
|
553
|
+
const t = [];
|
554
|
+
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
555
|
+
}
|
556
|
+
function et(r, e) {
|
557
|
+
return !!((e === "v4" || !e) && Ge.test(r) || (e === "v6" || !e) && Xe.test(r));
|
558
|
+
}
|
559
|
+
class Z extends _ {
|
521
560
|
_parse(e) {
|
522
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
561
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
523
562
|
const a = this._getOrReturnCtx(e);
|
524
|
-
return
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
received: a.parsedType
|
530
|
-
}
|
531
|
-
//
|
532
|
-
), m;
|
563
|
+
return u(a, {
|
564
|
+
code: d.invalid_type,
|
565
|
+
expected: f.string,
|
566
|
+
received: a.parsedType
|
567
|
+
}), m;
|
533
568
|
}
|
534
|
-
const
|
569
|
+
const s = new k();
|
535
570
|
let n;
|
536
571
|
for (const a of this._def.checks)
|
537
572
|
if (a.kind === "min")
|
538
|
-
e.data.length < a.value && (n = this._getOrReturnCtx(e, n),
|
539
|
-
code:
|
573
|
+
e.data.length < a.value && (n = this._getOrReturnCtx(e, n), u(n, {
|
574
|
+
code: d.too_small,
|
540
575
|
minimum: a.value,
|
541
576
|
type: "string",
|
542
577
|
inclusive: !0,
|
543
578
|
exact: !1,
|
544
579
|
message: a.message
|
545
|
-
}),
|
580
|
+
}), s.dirty());
|
546
581
|
else if (a.kind === "max")
|
547
|
-
e.data.length > a.value && (n = this._getOrReturnCtx(e, n),
|
548
|
-
code:
|
582
|
+
e.data.length > a.value && (n = this._getOrReturnCtx(e, n), u(n, {
|
583
|
+
code: d.too_big,
|
549
584
|
maximum: a.value,
|
550
585
|
type: "string",
|
551
586
|
inclusive: !0,
|
552
587
|
exact: !1,
|
553
588
|
message: a.message
|
554
|
-
}),
|
589
|
+
}), s.dirty());
|
555
590
|
else if (a.kind === "length") {
|
556
591
|
const i = e.data.length > a.value, o = e.data.length < a.value;
|
557
|
-
(i || o) && (n = this._getOrReturnCtx(e, n), i ?
|
558
|
-
code:
|
592
|
+
(i || o) && (n = this._getOrReturnCtx(e, n), i ? u(n, {
|
593
|
+
code: d.too_big,
|
559
594
|
maximum: a.value,
|
560
595
|
type: "string",
|
561
596
|
inclusive: !0,
|
562
597
|
exact: !0,
|
563
598
|
message: a.message
|
564
|
-
}) : o &&
|
565
|
-
code:
|
599
|
+
}) : o && u(n, {
|
600
|
+
code: d.too_small,
|
566
601
|
minimum: a.value,
|
567
602
|
type: "string",
|
568
603
|
inclusive: !0,
|
569
604
|
exact: !0,
|
570
605
|
message: a.message
|
571
|
-
}),
|
606
|
+
}), s.dirty());
|
572
607
|
} else if (a.kind === "email")
|
573
|
-
|
608
|
+
Je.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
574
609
|
validation: "email",
|
575
|
-
code:
|
610
|
+
code: d.invalid_string,
|
576
611
|
message: a.message
|
577
|
-
}),
|
612
|
+
}), s.dirty());
|
578
613
|
else if (a.kind === "emoji")
|
579
|
-
|
614
|
+
ge || (ge = new RegExp(He, "u")), ge.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
580
615
|
validation: "emoji",
|
581
|
-
code:
|
616
|
+
code: d.invalid_string,
|
582
617
|
message: a.message
|
583
|
-
}),
|
618
|
+
}), s.dirty());
|
584
619
|
else if (a.kind === "uuid")
|
585
|
-
|
620
|
+
We.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
586
621
|
validation: "uuid",
|
587
|
-
code:
|
622
|
+
code: d.invalid_string,
|
588
623
|
message: a.message
|
589
|
-
}),
|
624
|
+
}), s.dirty());
|
625
|
+
else if (a.kind === "nanoid")
|
626
|
+
qe.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
627
|
+
validation: "nanoid",
|
628
|
+
code: d.invalid_string,
|
629
|
+
message: a.message
|
630
|
+
}), s.dirty());
|
590
631
|
else if (a.kind === "cuid")
|
591
|
-
|
632
|
+
ze.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
592
633
|
validation: "cuid",
|
593
|
-
code:
|
634
|
+
code: d.invalid_string,
|
594
635
|
message: a.message
|
595
|
-
}),
|
636
|
+
}), s.dirty());
|
596
637
|
else if (a.kind === "cuid2")
|
597
|
-
|
638
|
+
Ue.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
598
639
|
validation: "cuid2",
|
599
|
-
code:
|
640
|
+
code: d.invalid_string,
|
600
641
|
message: a.message
|
601
|
-
}),
|
642
|
+
}), s.dirty());
|
602
643
|
else if (a.kind === "ulid")
|
603
|
-
|
644
|
+
Be.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
604
645
|
validation: "ulid",
|
605
|
-
code:
|
646
|
+
code: d.invalid_string,
|
606
647
|
message: a.message
|
607
|
-
}),
|
648
|
+
}), s.dirty());
|
608
649
|
else if (a.kind === "url")
|
609
650
|
try {
|
610
651
|
new URL(e.data);
|
611
652
|
} catch {
|
612
|
-
n = this._getOrReturnCtx(e, n),
|
653
|
+
n = this._getOrReturnCtx(e, n), u(n, {
|
613
654
|
validation: "url",
|
614
|
-
code:
|
655
|
+
code: d.invalid_string,
|
615
656
|
message: a.message
|
616
|
-
}),
|
657
|
+
}), s.dirty();
|
617
658
|
}
|
618
659
|
else
|
619
|
-
a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
660
|
+
a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
620
661
|
validation: "regex",
|
621
|
-
code:
|
662
|
+
code: d.invalid_string,
|
622
663
|
message: a.message
|
623
|
-
}),
|
624
|
-
code:
|
664
|
+
}), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), u(n, {
|
665
|
+
code: d.invalid_string,
|
625
666
|
validation: { includes: a.value, position: a.position },
|
626
667
|
message: a.message
|
627
|
-
}),
|
628
|
-
code:
|
668
|
+
}), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), u(n, {
|
669
|
+
code: d.invalid_string,
|
629
670
|
validation: { startsWith: a.value },
|
630
671
|
message: a.message
|
631
|
-
}),
|
632
|
-
code:
|
672
|
+
}), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), u(n, {
|
673
|
+
code: d.invalid_string,
|
633
674
|
validation: { endsWith: a.value },
|
634
675
|
message: a.message
|
635
|
-
}),
|
636
|
-
code:
|
676
|
+
}), s.dirty()) : a.kind === "datetime" ? Ie(a).test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
677
|
+
code: d.invalid_string,
|
637
678
|
validation: "datetime",
|
638
679
|
message: a.message
|
639
|
-
}),
|
680
|
+
}), s.dirty()) : a.kind === "date" ? Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
681
|
+
code: d.invalid_string,
|
682
|
+
validation: "date",
|
683
|
+
message: a.message
|
684
|
+
}), s.dirty()) : a.kind === "time" ? Fe(a).test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
685
|
+
code: d.invalid_string,
|
686
|
+
validation: "time",
|
687
|
+
message: a.message
|
688
|
+
}), s.dirty()) : a.kind === "duration" ? Ye.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
689
|
+
validation: "duration",
|
690
|
+
code: d.invalid_string,
|
691
|
+
message: a.message
|
692
|
+
}), s.dirty()) : a.kind === "ip" ? et(e.data, a.version) || (n = this._getOrReturnCtx(e, n), u(n, {
|
640
693
|
validation: "ip",
|
641
|
-
code:
|
694
|
+
code: d.invalid_string,
|
695
|
+
message: a.message
|
696
|
+
}), s.dirty()) : a.kind === "base64" ? Qe.test(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
|
697
|
+
validation: "base64",
|
698
|
+
code: d.invalid_string,
|
642
699
|
message: a.message
|
643
|
-
}),
|
644
|
-
return { status:
|
700
|
+
}), s.dirty()) : g.assertNever(a);
|
701
|
+
return { status: s.value, value: e.data };
|
645
702
|
}
|
646
|
-
_regex(e, t,
|
703
|
+
_regex(e, t, s) {
|
647
704
|
return this.refinement((n) => e.test(n), {
|
648
705
|
validation: t,
|
649
|
-
code:
|
650
|
-
...h.errToObj(
|
706
|
+
code: d.invalid_string,
|
707
|
+
...h.errToObj(s)
|
651
708
|
});
|
652
709
|
}
|
653
710
|
_addCheck(e) {
|
654
|
-
return new
|
711
|
+
return new Z({
|
655
712
|
...this._def,
|
656
713
|
checks: [...this._def.checks, e]
|
657
714
|
});
|
@@ -668,6 +725,9 @@ class T extends v {
|
|
668
725
|
uuid(e) {
|
669
726
|
return this._addCheck({ kind: "uuid", ...h.errToObj(e) });
|
670
727
|
}
|
728
|
+
nanoid(e) {
|
729
|
+
return this._addCheck({ kind: "nanoid", ...h.errToObj(e) });
|
730
|
+
}
|
671
731
|
cuid(e) {
|
672
732
|
return this._addCheck({ kind: "cuid", ...h.errToObj(e) });
|
673
733
|
}
|
@@ -677,23 +737,45 @@ class T extends v {
|
|
677
737
|
ulid(e) {
|
678
738
|
return this._addCheck({ kind: "ulid", ...h.errToObj(e) });
|
679
739
|
}
|
740
|
+
base64(e) {
|
741
|
+
return this._addCheck({ kind: "base64", ...h.errToObj(e) });
|
742
|
+
}
|
680
743
|
ip(e) {
|
681
744
|
return this._addCheck({ kind: "ip", ...h.errToObj(e) });
|
682
745
|
}
|
683
746
|
datetime(e) {
|
684
|
-
var t;
|
747
|
+
var t, s;
|
685
748
|
return typeof e == "string" ? this._addCheck({
|
686
749
|
kind: "datetime",
|
687
750
|
precision: null,
|
688
751
|
offset: !1,
|
752
|
+
local: !1,
|
689
753
|
message: e
|
690
754
|
}) : this._addCheck({
|
691
755
|
kind: "datetime",
|
692
756
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
693
757
|
offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
|
758
|
+
local: (s = e == null ? void 0 : e.local) !== null && s !== void 0 ? s : !1,
|
694
759
|
...h.errToObj(e == null ? void 0 : e.message)
|
695
760
|
});
|
696
761
|
}
|
762
|
+
date(e) {
|
763
|
+
return this._addCheck({ kind: "date", message: e });
|
764
|
+
}
|
765
|
+
time(e) {
|
766
|
+
return typeof e == "string" ? this._addCheck({
|
767
|
+
kind: "time",
|
768
|
+
precision: null,
|
769
|
+
message: e
|
770
|
+
}) : this._addCheck({
|
771
|
+
kind: "time",
|
772
|
+
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
773
|
+
...h.errToObj(e == null ? void 0 : e.message)
|
774
|
+
});
|
775
|
+
}
|
776
|
+
duration(e) {
|
777
|
+
return this._addCheck({ kind: "duration", ...h.errToObj(e) });
|
778
|
+
}
|
697
779
|
regex(e, t) {
|
698
780
|
return this._addCheck({
|
699
781
|
kind: "regex",
|
@@ -752,19 +834,19 @@ class T extends v {
|
|
752
834
|
return this.min(1, h.errToObj(e));
|
753
835
|
}
|
754
836
|
trim() {
|
755
|
-
return new
|
837
|
+
return new Z({
|
756
838
|
...this._def,
|
757
839
|
checks: [...this._def.checks, { kind: "trim" }]
|
758
840
|
});
|
759
841
|
}
|
760
842
|
toLowerCase() {
|
761
|
-
return new
|
843
|
+
return new Z({
|
762
844
|
...this._def,
|
763
845
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
764
846
|
});
|
765
847
|
}
|
766
848
|
toUpperCase() {
|
767
|
-
return new
|
849
|
+
return new Z({
|
768
850
|
...this._def,
|
769
851
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
770
852
|
});
|
@@ -772,6 +854,15 @@ class T extends v {
|
|
772
854
|
get isDatetime() {
|
773
855
|
return !!this._def.checks.find((e) => e.kind === "datetime");
|
774
856
|
}
|
857
|
+
get isDate() {
|
858
|
+
return !!this._def.checks.find((e) => e.kind === "date");
|
859
|
+
}
|
860
|
+
get isTime() {
|
861
|
+
return !!this._def.checks.find((e) => e.kind === "time");
|
862
|
+
}
|
863
|
+
get isDuration() {
|
864
|
+
return !!this._def.checks.find((e) => e.kind === "duration");
|
865
|
+
}
|
775
866
|
get isEmail() {
|
776
867
|
return !!this._def.checks.find((e) => e.kind === "email");
|
777
868
|
}
|
@@ -784,6 +875,9 @@ class T extends v {
|
|
784
875
|
get isUUID() {
|
785
876
|
return !!this._def.checks.find((e) => e.kind === "uuid");
|
786
877
|
}
|
878
|
+
get isNANOID() {
|
879
|
+
return !!this._def.checks.find((e) => e.kind === "nanoid");
|
880
|
+
}
|
787
881
|
get isCUID() {
|
788
882
|
return !!this._def.checks.find((e) => e.kind === "cuid");
|
789
883
|
}
|
@@ -796,6 +890,9 @@ class T extends v {
|
|
796
890
|
get isIP() {
|
797
891
|
return !!this._def.checks.find((e) => e.kind === "ip");
|
798
892
|
}
|
893
|
+
get isBase64() {
|
894
|
+
return !!this._def.checks.find((e) => e.kind === "base64");
|
895
|
+
}
|
799
896
|
get minLength() {
|
800
897
|
let e = null;
|
801
898
|
for (const t of this._def.checks)
|
@@ -809,60 +906,60 @@ class T extends v {
|
|
809
906
|
return e;
|
810
907
|
}
|
811
908
|
}
|
812
|
-
|
909
|
+
Z.create = (r) => {
|
813
910
|
var e;
|
814
|
-
return new
|
911
|
+
return new Z({
|
815
912
|
checks: [],
|
816
913
|
typeName: p.ZodString,
|
817
|
-
coerce: (e =
|
818
|
-
...
|
914
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
915
|
+
...v(r)
|
819
916
|
});
|
820
917
|
};
|
821
|
-
function
|
822
|
-
const t = (
|
918
|
+
function tt(r, e) {
|
919
|
+
const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
|
823
920
|
return a % i / Math.pow(10, n);
|
824
921
|
}
|
825
|
-
class
|
922
|
+
class A extends _ {
|
826
923
|
constructor() {
|
827
924
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
828
925
|
}
|
829
926
|
_parse(e) {
|
830
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
927
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
|
831
928
|
const a = this._getOrReturnCtx(e);
|
832
|
-
return
|
833
|
-
code:
|
834
|
-
expected:
|
929
|
+
return u(a, {
|
930
|
+
code: d.invalid_type,
|
931
|
+
expected: f.number,
|
835
932
|
received: a.parsedType
|
836
933
|
}), m;
|
837
934
|
}
|
838
|
-
let
|
935
|
+
let s;
|
839
936
|
const n = new k();
|
840
937
|
for (const a of this._def.checks)
|
841
|
-
a.kind === "int" ? g.isInteger(e.data) || (
|
842
|
-
code:
|
938
|
+
a.kind === "int" ? g.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
939
|
+
code: d.invalid_type,
|
843
940
|
expected: "integer",
|
844
941
|
received: "float",
|
845
942
|
message: a.message
|
846
|
-
}), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (
|
847
|
-
code:
|
943
|
+
}), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
|
944
|
+
code: d.too_small,
|
848
945
|
minimum: a.value,
|
849
946
|
type: "number",
|
850
947
|
inclusive: a.inclusive,
|
851
948
|
exact: !1,
|
852
949
|
message: a.message
|
853
|
-
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (
|
854
|
-
code:
|
950
|
+
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
|
951
|
+
code: d.too_big,
|
855
952
|
maximum: a.value,
|
856
953
|
type: "number",
|
857
954
|
inclusive: a.inclusive,
|
858
955
|
exact: !1,
|
859
956
|
message: a.message
|
860
|
-
}), n.dirty()) : a.kind === "multipleOf" ?
|
861
|
-
code:
|
957
|
+
}), n.dirty()) : a.kind === "multipleOf" ? tt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), u(s, {
|
958
|
+
code: d.not_multiple_of,
|
862
959
|
multipleOf: a.value,
|
863
960
|
message: a.message
|
864
|
-
}), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (
|
865
|
-
code:
|
961
|
+
}), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
|
962
|
+
code: d.not_finite,
|
866
963
|
message: a.message
|
867
964
|
}), n.dirty()) : g.assertNever(a);
|
868
965
|
return { status: n.value, value: e.data };
|
@@ -879,22 +976,22 @@ class j extends v {
|
|
879
976
|
lt(e, t) {
|
880
977
|
return this.setLimit("max", e, !1, h.toString(t));
|
881
978
|
}
|
882
|
-
setLimit(e, t,
|
883
|
-
return new
|
979
|
+
setLimit(e, t, s, n) {
|
980
|
+
return new A({
|
884
981
|
...this._def,
|
885
982
|
checks: [
|
886
983
|
...this._def.checks,
|
887
984
|
{
|
888
985
|
kind: e,
|
889
986
|
value: t,
|
890
|
-
inclusive:
|
987
|
+
inclusive: s,
|
891
988
|
message: h.toString(n)
|
892
989
|
}
|
893
990
|
]
|
894
991
|
});
|
895
992
|
}
|
896
993
|
_addCheck(e) {
|
897
|
-
return new
|
994
|
+
return new A({
|
898
995
|
...this._def,
|
899
996
|
checks: [...this._def.checks, e]
|
900
997
|
});
|
@@ -980,50 +1077,50 @@ class j extends v {
|
|
980
1077
|
}
|
981
1078
|
get isFinite() {
|
982
1079
|
let e = null, t = null;
|
983
|
-
for (const
|
984
|
-
if (
|
1080
|
+
for (const s of this._def.checks) {
|
1081
|
+
if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
|
985
1082
|
return !0;
|
986
|
-
|
1083
|
+
s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
|
987
1084
|
}
|
988
1085
|
return Number.isFinite(t) && Number.isFinite(e);
|
989
1086
|
}
|
990
1087
|
}
|
991
|
-
|
1088
|
+
A.create = (r) => new A({
|
992
1089
|
checks: [],
|
993
1090
|
typeName: p.ZodNumber,
|
994
|
-
coerce: (
|
995
|
-
...
|
1091
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
1092
|
+
...v(r)
|
996
1093
|
});
|
997
|
-
class
|
1094
|
+
class M extends _ {
|
998
1095
|
constructor() {
|
999
1096
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
1000
1097
|
}
|
1001
1098
|
_parse(e) {
|
1002
|
-
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !==
|
1099
|
+
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
|
1003
1100
|
const a = this._getOrReturnCtx(e);
|
1004
|
-
return
|
1005
|
-
code:
|
1006
|
-
expected:
|
1101
|
+
return u(a, {
|
1102
|
+
code: d.invalid_type,
|
1103
|
+
expected: f.bigint,
|
1007
1104
|
received: a.parsedType
|
1008
1105
|
}), m;
|
1009
1106
|
}
|
1010
|
-
let
|
1107
|
+
let s;
|
1011
1108
|
const n = new k();
|
1012
1109
|
for (const a of this._def.checks)
|
1013
|
-
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (
|
1014
|
-
code:
|
1110
|
+
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
|
1111
|
+
code: d.too_small,
|
1015
1112
|
type: "bigint",
|
1016
1113
|
minimum: a.value,
|
1017
1114
|
inclusive: a.inclusive,
|
1018
1115
|
message: a.message
|
1019
|
-
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (
|
1020
|
-
code:
|
1116
|
+
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), u(s, {
|
1117
|
+
code: d.too_big,
|
1021
1118
|
type: "bigint",
|
1022
1119
|
maximum: a.value,
|
1023
1120
|
inclusive: a.inclusive,
|
1024
1121
|
message: a.message
|
1025
|
-
}), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (
|
1026
|
-
code:
|
1122
|
+
}), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), u(s, {
|
1123
|
+
code: d.not_multiple_of,
|
1027
1124
|
multipleOf: a.value,
|
1028
1125
|
message: a.message
|
1029
1126
|
}), n.dirty()) : g.assertNever(a);
|
@@ -1041,22 +1138,22 @@ class A extends v {
|
|
1041
1138
|
lt(e, t) {
|
1042
1139
|
return this.setLimit("max", e, !1, h.toString(t));
|
1043
1140
|
}
|
1044
|
-
setLimit(e, t,
|
1045
|
-
return new
|
1141
|
+
setLimit(e, t, s, n) {
|
1142
|
+
return new M({
|
1046
1143
|
...this._def,
|
1047
1144
|
checks: [
|
1048
1145
|
...this._def.checks,
|
1049
1146
|
{
|
1050
1147
|
kind: e,
|
1051
1148
|
value: t,
|
1052
|
-
inclusive:
|
1149
|
+
inclusive: s,
|
1053
1150
|
message: h.toString(n)
|
1054
1151
|
}
|
1055
1152
|
]
|
1056
1153
|
});
|
1057
1154
|
}
|
1058
1155
|
_addCheck(e) {
|
1059
|
-
return new
|
1156
|
+
return new M({
|
1060
1157
|
...this._def,
|
1061
1158
|
checks: [...this._def.checks, e]
|
1062
1159
|
});
|
@@ -1113,74 +1210,74 @@ class A extends v {
|
|
1113
1210
|
return e;
|
1114
1211
|
}
|
1115
1212
|
}
|
1116
|
-
|
1213
|
+
M.create = (r) => {
|
1117
1214
|
var e;
|
1118
|
-
return new
|
1215
|
+
return new M({
|
1119
1216
|
checks: [],
|
1120
1217
|
typeName: p.ZodBigInt,
|
1121
|
-
coerce: (e =
|
1122
|
-
...
|
1218
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
1219
|
+
...v(r)
|
1123
1220
|
});
|
1124
1221
|
};
|
1125
|
-
class
|
1222
|
+
class Q extends _ {
|
1126
1223
|
_parse(e) {
|
1127
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
1128
|
-
const
|
1129
|
-
return
|
1130
|
-
code:
|
1131
|
-
expected:
|
1132
|
-
received:
|
1224
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
1225
|
+
const s = this._getOrReturnCtx(e);
|
1226
|
+
return u(s, {
|
1227
|
+
code: d.invalid_type,
|
1228
|
+
expected: f.boolean,
|
1229
|
+
received: s.parsedType
|
1133
1230
|
}), m;
|
1134
1231
|
}
|
1135
1232
|
return b(e.data);
|
1136
1233
|
}
|
1137
1234
|
}
|
1138
|
-
|
1235
|
+
Q.create = (r) => new Q({
|
1139
1236
|
typeName: p.ZodBoolean,
|
1140
|
-
coerce: (
|
1141
|
-
...
|
1237
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
1238
|
+
...v(r)
|
1142
1239
|
});
|
1143
|
-
class
|
1240
|
+
class D extends _ {
|
1144
1241
|
_parse(e) {
|
1145
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
1242
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
1146
1243
|
const a = this._getOrReturnCtx(e);
|
1147
|
-
return
|
1148
|
-
code:
|
1149
|
-
expected:
|
1244
|
+
return u(a, {
|
1245
|
+
code: d.invalid_type,
|
1246
|
+
expected: f.date,
|
1150
1247
|
received: a.parsedType
|
1151
1248
|
}), m;
|
1152
1249
|
}
|
1153
1250
|
if (isNaN(e.data.getTime())) {
|
1154
1251
|
const a = this._getOrReturnCtx(e);
|
1155
|
-
return
|
1156
|
-
code:
|
1252
|
+
return u(a, {
|
1253
|
+
code: d.invalid_date
|
1157
1254
|
}), m;
|
1158
1255
|
}
|
1159
|
-
const
|
1256
|
+
const s = new k();
|
1160
1257
|
let n;
|
1161
1258
|
for (const a of this._def.checks)
|
1162
|
-
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n),
|
1163
|
-
code:
|
1259
|
+
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), u(n, {
|
1260
|
+
code: d.too_small,
|
1164
1261
|
message: a.message,
|
1165
1262
|
inclusive: !0,
|
1166
1263
|
exact: !1,
|
1167
1264
|
minimum: a.value,
|
1168
1265
|
type: "date"
|
1169
|
-
}),
|
1170
|
-
code:
|
1266
|
+
}), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), u(n, {
|
1267
|
+
code: d.too_big,
|
1171
1268
|
message: a.message,
|
1172
1269
|
inclusive: !0,
|
1173
1270
|
exact: !1,
|
1174
1271
|
maximum: a.value,
|
1175
1272
|
type: "date"
|
1176
|
-
}),
|
1273
|
+
}), s.dirty()) : g.assertNever(a);
|
1177
1274
|
return {
|
1178
|
-
status:
|
1275
|
+
status: s.value,
|
1179
1276
|
value: new Date(e.data.getTime())
|
1180
1277
|
};
|
1181
1278
|
}
|
1182
1279
|
_addCheck(e) {
|
1183
|
-
return new
|
1280
|
+
return new D({
|
1184
1281
|
...this._def,
|
1185
1282
|
checks: [...this._def.checks, e]
|
1186
1283
|
});
|
@@ -1212,64 +1309,64 @@ class V extends v {
|
|
1212
1309
|
return e != null ? new Date(e) : null;
|
1213
1310
|
}
|
1214
1311
|
}
|
1215
|
-
|
1312
|
+
D.create = (r) => new D({
|
1216
1313
|
checks: [],
|
1217
|
-
coerce: (
|
1314
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
1218
1315
|
typeName: p.ZodDate,
|
1219
|
-
...
|
1316
|
+
...v(r)
|
1220
1317
|
});
|
1221
|
-
class
|
1318
|
+
class he extends _ {
|
1222
1319
|
_parse(e) {
|
1223
|
-
if (this._getType(e) !==
|
1224
|
-
const
|
1225
|
-
return
|
1226
|
-
code:
|
1227
|
-
expected:
|
1228
|
-
received:
|
1320
|
+
if (this._getType(e) !== f.symbol) {
|
1321
|
+
const s = this._getOrReturnCtx(e);
|
1322
|
+
return u(s, {
|
1323
|
+
code: d.invalid_type,
|
1324
|
+
expected: f.symbol,
|
1325
|
+
received: s.parsedType
|
1229
1326
|
}), m;
|
1230
1327
|
}
|
1231
1328
|
return b(e.data);
|
1232
1329
|
}
|
1233
1330
|
}
|
1234
|
-
|
1331
|
+
he.create = (r) => new he({
|
1235
1332
|
typeName: p.ZodSymbol,
|
1236
|
-
...
|
1333
|
+
...v(r)
|
1237
1334
|
});
|
1238
|
-
class
|
1335
|
+
class K extends _ {
|
1239
1336
|
_parse(e) {
|
1240
|
-
if (this._getType(e) !==
|
1241
|
-
const
|
1242
|
-
return
|
1243
|
-
code:
|
1244
|
-
expected:
|
1245
|
-
received:
|
1337
|
+
if (this._getType(e) !== f.undefined) {
|
1338
|
+
const s = this._getOrReturnCtx(e);
|
1339
|
+
return u(s, {
|
1340
|
+
code: d.invalid_type,
|
1341
|
+
expected: f.undefined,
|
1342
|
+
received: s.parsedType
|
1246
1343
|
}), m;
|
1247
1344
|
}
|
1248
1345
|
return b(e.data);
|
1249
1346
|
}
|
1250
1347
|
}
|
1251
|
-
|
1348
|
+
K.create = (r) => new K({
|
1252
1349
|
typeName: p.ZodUndefined,
|
1253
|
-
...
|
1350
|
+
...v(r)
|
1254
1351
|
});
|
1255
|
-
class
|
1352
|
+
class F extends _ {
|
1256
1353
|
_parse(e) {
|
1257
|
-
if (this._getType(e) !==
|
1258
|
-
const
|
1259
|
-
return
|
1260
|
-
code:
|
1261
|
-
expected:
|
1262
|
-
received:
|
1354
|
+
if (this._getType(e) !== f.null) {
|
1355
|
+
const s = this._getOrReturnCtx(e);
|
1356
|
+
return u(s, {
|
1357
|
+
code: d.invalid_type,
|
1358
|
+
expected: f.null,
|
1359
|
+
received: s.parsedType
|
1263
1360
|
}), m;
|
1264
1361
|
}
|
1265
1362
|
return b(e.data);
|
1266
1363
|
}
|
1267
1364
|
}
|
1268
|
-
|
1365
|
+
F.create = (r) => new F({
|
1269
1366
|
typeName: p.ZodNull,
|
1270
|
-
...
|
1367
|
+
...v(r)
|
1271
1368
|
});
|
1272
|
-
class
|
1369
|
+
class q extends _ {
|
1273
1370
|
constructor() {
|
1274
1371
|
super(...arguments), this._any = !0;
|
1275
1372
|
}
|
@@ -1277,11 +1374,11 @@ class U extends v {
|
|
1277
1374
|
return b(e.data);
|
1278
1375
|
}
|
1279
1376
|
}
|
1280
|
-
|
1377
|
+
q.create = (r) => new q({
|
1281
1378
|
typeName: p.ZodAny,
|
1282
|
-
...
|
1379
|
+
...v(r)
|
1283
1380
|
});
|
1284
|
-
class
|
1381
|
+
class V extends _ {
|
1285
1382
|
constructor() {
|
1286
1383
|
super(...arguments), this._unknown = !0;
|
1287
1384
|
}
|
@@ -1289,80 +1386,80 @@ class P extends v {
|
|
1289
1386
|
return b(e.data);
|
1290
1387
|
}
|
1291
1388
|
}
|
1292
|
-
|
1389
|
+
V.create = (r) => new V({
|
1293
1390
|
typeName: p.ZodUnknown,
|
1294
|
-
...
|
1391
|
+
...v(r)
|
1295
1392
|
});
|
1296
|
-
class I extends
|
1393
|
+
class I extends _ {
|
1297
1394
|
_parse(e) {
|
1298
1395
|
const t = this._getOrReturnCtx(e);
|
1299
|
-
return
|
1300
|
-
code:
|
1301
|
-
expected:
|
1396
|
+
return u(t, {
|
1397
|
+
code: d.invalid_type,
|
1398
|
+
expected: f.never,
|
1302
1399
|
received: t.parsedType
|
1303
1400
|
}), m;
|
1304
1401
|
}
|
1305
1402
|
}
|
1306
|
-
I.create = (
|
1403
|
+
I.create = (r) => new I({
|
1307
1404
|
typeName: p.ZodNever,
|
1308
|
-
...
|
1405
|
+
...v(r)
|
1309
1406
|
});
|
1310
|
-
class
|
1407
|
+
class pe extends _ {
|
1311
1408
|
_parse(e) {
|
1312
|
-
if (this._getType(e) !==
|
1313
|
-
const
|
1314
|
-
return
|
1315
|
-
code:
|
1316
|
-
expected:
|
1317
|
-
received:
|
1409
|
+
if (this._getType(e) !== f.undefined) {
|
1410
|
+
const s = this._getOrReturnCtx(e);
|
1411
|
+
return u(s, {
|
1412
|
+
code: d.invalid_type,
|
1413
|
+
expected: f.void,
|
1414
|
+
received: s.parsedType
|
1318
1415
|
}), m;
|
1319
1416
|
}
|
1320
1417
|
return b(e.data);
|
1321
1418
|
}
|
1322
1419
|
}
|
1323
|
-
|
1420
|
+
pe.create = (r) => new pe({
|
1324
1421
|
typeName: p.ZodVoid,
|
1325
|
-
...
|
1422
|
+
...v(r)
|
1326
1423
|
});
|
1327
|
-
class S extends
|
1424
|
+
class S extends _ {
|
1328
1425
|
_parse(e) {
|
1329
|
-
const { ctx: t, status:
|
1330
|
-
if (t.parsedType !==
|
1331
|
-
return
|
1332
|
-
code:
|
1333
|
-
expected:
|
1426
|
+
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
1427
|
+
if (t.parsedType !== f.array)
|
1428
|
+
return u(t, {
|
1429
|
+
code: d.invalid_type,
|
1430
|
+
expected: f.array,
|
1334
1431
|
received: t.parsedType
|
1335
1432
|
}), m;
|
1336
1433
|
if (n.exactLength !== null) {
|
1337
1434
|
const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
|
1338
|
-
(i || o) && (
|
1339
|
-
code: i ?
|
1435
|
+
(i || o) && (u(t, {
|
1436
|
+
code: i ? d.too_big : d.too_small,
|
1340
1437
|
minimum: o ? n.exactLength.value : void 0,
|
1341
1438
|
maximum: i ? n.exactLength.value : void 0,
|
1342
1439
|
type: "array",
|
1343
1440
|
inclusive: !0,
|
1344
1441
|
exact: !0,
|
1345
1442
|
message: n.exactLength.message
|
1346
|
-
}),
|
1443
|
+
}), s.dirty());
|
1347
1444
|
}
|
1348
|
-
if (n.minLength !== null && t.data.length < n.minLength.value && (
|
1349
|
-
code:
|
1445
|
+
if (n.minLength !== null && t.data.length < n.minLength.value && (u(t, {
|
1446
|
+
code: d.too_small,
|
1350
1447
|
minimum: n.minLength.value,
|
1351
1448
|
type: "array",
|
1352
1449
|
inclusive: !0,
|
1353
1450
|
exact: !1,
|
1354
1451
|
message: n.minLength.message
|
1355
|
-
}),
|
1356
|
-
code:
|
1452
|
+
}), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (u(t, {
|
1453
|
+
code: d.too_big,
|
1357
1454
|
maximum: n.maxLength.value,
|
1358
1455
|
type: "array",
|
1359
1456
|
inclusive: !0,
|
1360
1457
|
exact: !1,
|
1361
1458
|
message: n.maxLength.message
|
1362
|
-
}),
|
1363
|
-
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new O(t, i, t.path, o)))).then((i) => k.mergeArray(
|
1459
|
+
}), s.dirty()), t.common.async)
|
1460
|
+
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new O(t, i, t.path, o)))).then((i) => k.mergeArray(s, i));
|
1364
1461
|
const a = [...t.data].map((i, o) => n.type._parseSync(new O(t, i, t.path, o)));
|
1365
|
-
return k.mergeArray(
|
1462
|
+
return k.mergeArray(s, a);
|
1366
1463
|
}
|
1367
1464
|
get element() {
|
1368
1465
|
return this._def.type;
|
@@ -1389,32 +1486,32 @@ class S extends v {
|
|
1389
1486
|
return this.min(1, e);
|
1390
1487
|
}
|
1391
1488
|
}
|
1392
|
-
S.create = (
|
1393
|
-
type:
|
1489
|
+
S.create = (r, e) => new S({
|
1490
|
+
type: r,
|
1394
1491
|
minLength: null,
|
1395
1492
|
maxLength: null,
|
1396
1493
|
exactLength: null,
|
1397
1494
|
typeName: p.ZodArray,
|
1398
|
-
...
|
1495
|
+
...v(e)
|
1399
1496
|
});
|
1400
|
-
function
|
1401
|
-
if (
|
1497
|
+
function z(r) {
|
1498
|
+
if (r instanceof x) {
|
1402
1499
|
const e = {};
|
1403
|
-
for (const t in
|
1404
|
-
const
|
1405
|
-
e[t] =
|
1500
|
+
for (const t in r.shape) {
|
1501
|
+
const s = r.shape[t];
|
1502
|
+
e[t] = N.create(z(s));
|
1406
1503
|
}
|
1407
1504
|
return new x({
|
1408
|
-
...
|
1505
|
+
...r._def,
|
1409
1506
|
shape: () => e
|
1410
1507
|
});
|
1411
1508
|
} else
|
1412
|
-
return
|
1413
|
-
...
|
1414
|
-
type:
|
1415
|
-
}) :
|
1509
|
+
return r instanceof S ? new S({
|
1510
|
+
...r._def,
|
1511
|
+
type: z(r.element)
|
1512
|
+
}) : r instanceof N ? N.create(z(r.unwrap())) : r instanceof P ? P.create(z(r.unwrap())) : r instanceof E ? E.create(r.items.map((e) => z(e))) : r;
|
1416
1513
|
}
|
1417
|
-
class x extends
|
1514
|
+
class x extends _ {
|
1418
1515
|
constructor() {
|
1419
1516
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
1420
1517
|
}
|
@@ -1425,68 +1522,68 @@ class x extends v {
|
|
1425
1522
|
return this._cached = { shape: e, keys: t };
|
1426
1523
|
}
|
1427
1524
|
_parse(e) {
|
1428
|
-
if (this._getType(e) !==
|
1429
|
-
const
|
1430
|
-
return
|
1431
|
-
code:
|
1432
|
-
expected:
|
1433
|
-
received:
|
1525
|
+
if (this._getType(e) !== f.object) {
|
1526
|
+
const c = this._getOrReturnCtx(e);
|
1527
|
+
return u(c, {
|
1528
|
+
code: d.invalid_type,
|
1529
|
+
expected: f.object,
|
1530
|
+
received: c.parsedType
|
1434
1531
|
}), m;
|
1435
1532
|
}
|
1436
|
-
const { status:
|
1533
|
+
const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
1437
1534
|
if (!(this._def.catchall instanceof I && this._def.unknownKeys === "strip"))
|
1438
|
-
for (const
|
1439
|
-
i.includes(
|
1440
|
-
const
|
1441
|
-
for (const
|
1442
|
-
const
|
1443
|
-
|
1444
|
-
key: { status: "valid", value:
|
1445
|
-
value:
|
1446
|
-
alwaysSet:
|
1535
|
+
for (const c in n.data)
|
1536
|
+
i.includes(c) || o.push(c);
|
1537
|
+
const l = [];
|
1538
|
+
for (const c of i) {
|
1539
|
+
const y = a[c], T = n.data[c];
|
1540
|
+
l.push({
|
1541
|
+
key: { status: "valid", value: c },
|
1542
|
+
value: y._parse(new O(n, T, n.path, c)),
|
1543
|
+
alwaysSet: c in n.data
|
1447
1544
|
});
|
1448
1545
|
}
|
1449
1546
|
if (this._def.catchall instanceof I) {
|
1450
|
-
const
|
1451
|
-
if (
|
1452
|
-
for (const
|
1453
|
-
|
1454
|
-
key: { status: "valid", value:
|
1455
|
-
value: { status: "valid", value: n.data[
|
1547
|
+
const c = this._def.unknownKeys;
|
1548
|
+
if (c === "passthrough")
|
1549
|
+
for (const y of o)
|
1550
|
+
l.push({
|
1551
|
+
key: { status: "valid", value: y },
|
1552
|
+
value: { status: "valid", value: n.data[y] }
|
1456
1553
|
});
|
1457
|
-
else if (
|
1458
|
-
o.length > 0 && (
|
1459
|
-
code:
|
1554
|
+
else if (c === "strict")
|
1555
|
+
o.length > 0 && (u(n, {
|
1556
|
+
code: d.unrecognized_keys,
|
1460
1557
|
keys: o
|
1461
|
-
}),
|
1462
|
-
else if (
|
1558
|
+
}), s.dirty());
|
1559
|
+
else if (c !== "strip")
|
1463
1560
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
1464
1561
|
} else {
|
1465
|
-
const
|
1466
|
-
for (const
|
1467
|
-
const
|
1468
|
-
|
1469
|
-
key: { status: "valid", value:
|
1470
|
-
value:
|
1471
|
-
new O(n,
|
1562
|
+
const c = this._def.catchall;
|
1563
|
+
for (const y of o) {
|
1564
|
+
const T = n.data[y];
|
1565
|
+
l.push({
|
1566
|
+
key: { status: "valid", value: y },
|
1567
|
+
value: c._parse(
|
1568
|
+
new O(n, T, n.path, y)
|
1472
1569
|
//, ctx.child(key), value, getParsedType(value)
|
1473
1570
|
),
|
1474
|
-
alwaysSet:
|
1571
|
+
alwaysSet: y in n.data
|
1475
1572
|
});
|
1476
1573
|
}
|
1477
1574
|
}
|
1478
1575
|
return n.common.async ? Promise.resolve().then(async () => {
|
1479
|
-
const
|
1480
|
-
for (const
|
1481
|
-
const
|
1482
|
-
|
1483
|
-
key:
|
1484
|
-
value:
|
1485
|
-
alwaysSet:
|
1576
|
+
const c = [];
|
1577
|
+
for (const y of l) {
|
1578
|
+
const T = await y.key, Ze = await y.value;
|
1579
|
+
c.push({
|
1580
|
+
key: T,
|
1581
|
+
value: Ze,
|
1582
|
+
alwaysSet: y.alwaysSet
|
1486
1583
|
});
|
1487
1584
|
}
|
1488
|
-
return
|
1489
|
-
}).then((
|
1585
|
+
return c;
|
1586
|
+
}).then((c) => k.mergeObjectSync(s, c)) : k.mergeObjectSync(s, l);
|
1490
1587
|
}
|
1491
1588
|
get shape() {
|
1492
1589
|
return this._def.shape();
|
@@ -1496,13 +1593,13 @@ class x extends v {
|
|
1496
1593
|
...this._def,
|
1497
1594
|
unknownKeys: "strict",
|
1498
1595
|
...e !== void 0 ? {
|
1499
|
-
errorMap: (t,
|
1596
|
+
errorMap: (t, s) => {
|
1500
1597
|
var n, a, i, o;
|
1501
|
-
const
|
1598
|
+
const l = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
|
1502
1599
|
return t.code === "unrecognized_keys" ? {
|
1503
|
-
message: (o = h.errToObj(e).message) !== null && o !== void 0 ? o :
|
1600
|
+
message: (o = h.errToObj(e).message) !== null && o !== void 0 ? o : l
|
1504
1601
|
} : {
|
1505
|
-
message:
|
1602
|
+
message: l
|
1506
1603
|
};
|
1507
1604
|
}
|
1508
1605
|
} : {}
|
@@ -1629,8 +1726,8 @@ class x extends v {
|
|
1629
1726
|
}
|
1630
1727
|
pick(e) {
|
1631
1728
|
const t = {};
|
1632
|
-
return g.objectKeys(e).forEach((
|
1633
|
-
e[
|
1729
|
+
return g.objectKeys(e).forEach((s) => {
|
1730
|
+
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
1634
1731
|
}), new x({
|
1635
1732
|
...this._def,
|
1636
1733
|
shape: () => t
|
@@ -1638,8 +1735,8 @@ class x extends v {
|
|
1638
1735
|
}
|
1639
1736
|
omit(e) {
|
1640
1737
|
const t = {};
|
1641
|
-
return g.objectKeys(this.shape).forEach((
|
1642
|
-
e[
|
1738
|
+
return g.objectKeys(this.shape).forEach((s) => {
|
1739
|
+
e[s] || (t[s] = this.shape[s]);
|
1643
1740
|
}), new x({
|
1644
1741
|
...this._def,
|
1645
1742
|
shape: () => t
|
@@ -1649,13 +1746,13 @@ class x extends v {
|
|
1649
1746
|
* @deprecated
|
1650
1747
|
*/
|
1651
1748
|
deepPartial() {
|
1652
|
-
return
|
1749
|
+
return z(this);
|
1653
1750
|
}
|
1654
1751
|
partial(e) {
|
1655
1752
|
const t = {};
|
1656
|
-
return g.objectKeys(this.shape).forEach((
|
1657
|
-
const n = this.shape[
|
1658
|
-
e && !e[
|
1753
|
+
return g.objectKeys(this.shape).forEach((s) => {
|
1754
|
+
const n = this.shape[s];
|
1755
|
+
e && !e[s] ? t[s] = n : t[s] = n.optional();
|
1659
1756
|
}), new x({
|
1660
1757
|
...this._def,
|
1661
1758
|
shape: () => t
|
@@ -1663,14 +1760,14 @@ class x extends v {
|
|
1663
1760
|
}
|
1664
1761
|
required(e) {
|
1665
1762
|
const t = {};
|
1666
|
-
return g.objectKeys(this.shape).forEach((
|
1667
|
-
if (e && !e[
|
1668
|
-
t[
|
1763
|
+
return g.objectKeys(this.shape).forEach((s) => {
|
1764
|
+
if (e && !e[s])
|
1765
|
+
t[s] = this.shape[s];
|
1669
1766
|
else {
|
1670
|
-
let a = this.shape[
|
1671
|
-
for (; a instanceof
|
1767
|
+
let a = this.shape[s];
|
1768
|
+
for (; a instanceof N; )
|
1672
1769
|
a = a._def.innerType;
|
1673
|
-
t[
|
1770
|
+
t[s] = a;
|
1674
1771
|
}
|
1675
1772
|
}), new x({
|
1676
1773
|
...this._def,
|
@@ -1678,33 +1775,33 @@ class x extends v {
|
|
1678
1775
|
});
|
1679
1776
|
}
|
1680
1777
|
keyof() {
|
1681
|
-
return
|
1778
|
+
return je(g.objectKeys(this.shape));
|
1682
1779
|
}
|
1683
1780
|
}
|
1684
|
-
x.create = (
|
1685
|
-
shape: () =>
|
1781
|
+
x.create = (r, e) => new x({
|
1782
|
+
shape: () => r,
|
1686
1783
|
unknownKeys: "strip",
|
1687
1784
|
catchall: I.create(),
|
1688
1785
|
typeName: p.ZodObject,
|
1689
|
-
...
|
1786
|
+
...v(e)
|
1690
1787
|
});
|
1691
|
-
x.strictCreate = (
|
1692
|
-
shape: () =>
|
1788
|
+
x.strictCreate = (r, e) => new x({
|
1789
|
+
shape: () => r,
|
1693
1790
|
unknownKeys: "strict",
|
1694
1791
|
catchall: I.create(),
|
1695
1792
|
typeName: p.ZodObject,
|
1696
|
-
...
|
1793
|
+
...v(e)
|
1697
1794
|
});
|
1698
|
-
x.lazycreate = (
|
1699
|
-
shape:
|
1795
|
+
x.lazycreate = (r, e) => new x({
|
1796
|
+
shape: r,
|
1700
1797
|
unknownKeys: "strip",
|
1701
1798
|
catchall: I.create(),
|
1702
1799
|
typeName: p.ZodObject,
|
1703
|
-
...
|
1800
|
+
...v(e)
|
1704
1801
|
});
|
1705
|
-
class
|
1802
|
+
class ee extends _ {
|
1706
1803
|
_parse(e) {
|
1707
|
-
const { ctx: t } = this._processInputParams(e),
|
1804
|
+
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
1708
1805
|
function n(a) {
|
1709
1806
|
for (const o of a)
|
1710
1807
|
if (o.result.status === "valid")
|
@@ -1712,14 +1809,14 @@ class G extends v {
|
|
1712
1809
|
for (const o of a)
|
1713
1810
|
if (o.result.status === "dirty")
|
1714
1811
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
1715
|
-
const i = a.map((o) => new
|
1716
|
-
return
|
1717
|
-
code:
|
1812
|
+
const i = a.map((o) => new w(o.ctx.common.issues));
|
1813
|
+
return u(t, {
|
1814
|
+
code: d.invalid_union,
|
1718
1815
|
unionErrors: i
|
1719
1816
|
}), m;
|
1720
1817
|
}
|
1721
1818
|
if (t.common.async)
|
1722
|
-
return Promise.all(
|
1819
|
+
return Promise.all(s.map(async (a) => {
|
1723
1820
|
const i = {
|
1724
1821
|
...t,
|
1725
1822
|
common: {
|
@@ -1740,28 +1837,28 @@ class G extends v {
|
|
1740
1837
|
{
|
1741
1838
|
let a;
|
1742
1839
|
const i = [];
|
1743
|
-
for (const
|
1744
|
-
const
|
1840
|
+
for (const l of s) {
|
1841
|
+
const c = {
|
1745
1842
|
...t,
|
1746
1843
|
common: {
|
1747
1844
|
...t.common,
|
1748
1845
|
issues: []
|
1749
1846
|
},
|
1750
1847
|
parent: null
|
1751
|
-
},
|
1848
|
+
}, y = l._parseSync({
|
1752
1849
|
data: t.data,
|
1753
1850
|
path: t.path,
|
1754
|
-
parent:
|
1851
|
+
parent: c
|
1755
1852
|
});
|
1756
|
-
if (
|
1757
|
-
return
|
1758
|
-
|
1853
|
+
if (y.status === "valid")
|
1854
|
+
return y;
|
1855
|
+
y.status === "dirty" && !a && (a = { result: y, ctx: c }), c.common.issues.length && i.push(c.common.issues);
|
1759
1856
|
}
|
1760
1857
|
if (a)
|
1761
1858
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
1762
|
-
const o = i.map((
|
1763
|
-
return
|
1764
|
-
code:
|
1859
|
+
const o = i.map((l) => new w(l));
|
1860
|
+
return u(t, {
|
1861
|
+
code: d.invalid_union,
|
1765
1862
|
unionErrors: o
|
1766
1863
|
}), m;
|
1767
1864
|
}
|
@@ -1770,22 +1867,22 @@ class G extends v {
|
|
1770
1867
|
return this._def.options;
|
1771
1868
|
}
|
1772
1869
|
}
|
1773
|
-
|
1774
|
-
options:
|
1870
|
+
ee.create = (r, e) => new ee({
|
1871
|
+
options: r,
|
1775
1872
|
typeName: p.ZodUnion,
|
1776
|
-
...
|
1873
|
+
...v(e)
|
1777
1874
|
});
|
1778
|
-
const
|
1779
|
-
class
|
1875
|
+
const R = (r) => r instanceof se ? R(r.schema) : r instanceof C ? R(r.innerType()) : r instanceof ne ? [r.value] : r instanceof $ ? r.options : r instanceof ae ? g.objectValues(r.enum) : r instanceof ie ? R(r._def.innerType) : r instanceof K ? [void 0] : r instanceof F ? [null] : r instanceof N ? [void 0, ...R(r.unwrap())] : r instanceof P ? [null, ...R(r.unwrap())] : r instanceof Te || r instanceof de ? R(r.unwrap()) : r instanceof oe ? R(r._def.innerType) : [];
|
1876
|
+
class ve extends _ {
|
1780
1877
|
_parse(e) {
|
1781
1878
|
const { ctx: t } = this._processInputParams(e);
|
1782
|
-
if (t.parsedType !==
|
1783
|
-
return
|
1784
|
-
code:
|
1785
|
-
expected:
|
1879
|
+
if (t.parsedType !== f.object)
|
1880
|
+
return u(t, {
|
1881
|
+
code: d.invalid_type,
|
1882
|
+
expected: f.object,
|
1786
1883
|
received: t.parsedType
|
1787
1884
|
}), m;
|
1788
|
-
const
|
1885
|
+
const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
|
1789
1886
|
return a ? t.common.async ? a._parseAsync({
|
1790
1887
|
data: t.data,
|
1791
1888
|
path: t.path,
|
@@ -1794,10 +1891,10 @@ class he extends v {
|
|
1794
1891
|
data: t.data,
|
1795
1892
|
path: t.path,
|
1796
1893
|
parent: t
|
1797
|
-
}) : (
|
1798
|
-
code:
|
1894
|
+
}) : (u(t, {
|
1895
|
+
code: d.invalid_union_discriminator,
|
1799
1896
|
options: Array.from(this.optionsMap.keys()),
|
1800
|
-
path: [
|
1897
|
+
path: [s]
|
1801
1898
|
}), m);
|
1802
1899
|
}
|
1803
1900
|
get discriminator() {
|
@@ -1817,11 +1914,11 @@ class he extends v {
|
|
1817
1914
|
* @param types an array of object schemas
|
1818
1915
|
* @param params
|
1819
1916
|
*/
|
1820
|
-
static create(e, t,
|
1917
|
+
static create(e, t, s) {
|
1821
1918
|
const n = /* @__PURE__ */ new Map();
|
1822
1919
|
for (const a of t) {
|
1823
|
-
const i =
|
1824
|
-
if (!i)
|
1920
|
+
const i = R(a.shape[e]);
|
1921
|
+
if (!i.length)
|
1825
1922
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
1826
1923
|
for (const o of i) {
|
1827
1924
|
if (n.has(o))
|
@@ -1829,131 +1926,131 @@ class he extends v {
|
|
1829
1926
|
n.set(o, a);
|
1830
1927
|
}
|
1831
1928
|
}
|
1832
|
-
return new
|
1929
|
+
return new ve({
|
1833
1930
|
typeName: p.ZodDiscriminatedUnion,
|
1834
1931
|
discriminator: e,
|
1835
1932
|
options: t,
|
1836
1933
|
optionsMap: n,
|
1837
|
-
...
|
1934
|
+
...v(s)
|
1838
1935
|
});
|
1839
1936
|
}
|
1840
1937
|
}
|
1841
|
-
function
|
1842
|
-
const t =
|
1843
|
-
if (
|
1844
|
-
return { valid: !0, data:
|
1845
|
-
if (t ===
|
1846
|
-
const n = g.objectKeys(e), a = g.objectKeys(
|
1938
|
+
function we(r, e) {
|
1939
|
+
const t = j(r), s = j(e);
|
1940
|
+
if (r === e)
|
1941
|
+
return { valid: !0, data: r };
|
1942
|
+
if (t === f.object && s === f.object) {
|
1943
|
+
const n = g.objectKeys(e), a = g.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
|
1847
1944
|
for (const o of a) {
|
1848
|
-
const
|
1849
|
-
if (!
|
1945
|
+
const l = we(r[o], e[o]);
|
1946
|
+
if (!l.valid)
|
1850
1947
|
return { valid: !1 };
|
1851
|
-
i[o] =
|
1948
|
+
i[o] = l.data;
|
1852
1949
|
}
|
1853
1950
|
return { valid: !0, data: i };
|
1854
|
-
} else if (t ===
|
1855
|
-
if (
|
1951
|
+
} else if (t === f.array && s === f.array) {
|
1952
|
+
if (r.length !== e.length)
|
1856
1953
|
return { valid: !1 };
|
1857
1954
|
const n = [];
|
1858
|
-
for (let a = 0; a <
|
1859
|
-
const i =
|
1860
|
-
if (!
|
1955
|
+
for (let a = 0; a < r.length; a++) {
|
1956
|
+
const i = r[a], o = e[a], l = we(i, o);
|
1957
|
+
if (!l.valid)
|
1861
1958
|
return { valid: !1 };
|
1862
|
-
n.push(
|
1959
|
+
n.push(l.data);
|
1863
1960
|
}
|
1864
1961
|
return { valid: !0, data: n };
|
1865
1962
|
} else
|
1866
|
-
return t ===
|
1963
|
+
return t === f.date && s === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
1867
1964
|
}
|
1868
|
-
class
|
1965
|
+
class te extends _ {
|
1869
1966
|
_parse(e) {
|
1870
|
-
const { status: t, ctx:
|
1871
|
-
if (
|
1967
|
+
const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
|
1968
|
+
if (ke(a) || ke(i))
|
1872
1969
|
return m;
|
1873
|
-
const o =
|
1874
|
-
return o.valid ? ((
|
1875
|
-
code:
|
1970
|
+
const o = we(a.value, i.value);
|
1971
|
+
return o.valid ? ((be(a) || be(i)) && t.dirty(), { status: t.value, value: o.data }) : (u(s, {
|
1972
|
+
code: d.invalid_intersection_types
|
1876
1973
|
}), m);
|
1877
1974
|
};
|
1878
|
-
return
|
1975
|
+
return s.common.async ? Promise.all([
|
1879
1976
|
this._def.left._parseAsync({
|
1880
|
-
data:
|
1881
|
-
path:
|
1882
|
-
parent:
|
1977
|
+
data: s.data,
|
1978
|
+
path: s.path,
|
1979
|
+
parent: s
|
1883
1980
|
}),
|
1884
1981
|
this._def.right._parseAsync({
|
1885
|
-
data:
|
1886
|
-
path:
|
1887
|
-
parent:
|
1982
|
+
data: s.data,
|
1983
|
+
path: s.path,
|
1984
|
+
parent: s
|
1888
1985
|
})
|
1889
1986
|
]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
|
1890
|
-
data:
|
1891
|
-
path:
|
1892
|
-
parent:
|
1987
|
+
data: s.data,
|
1988
|
+
path: s.path,
|
1989
|
+
parent: s
|
1893
1990
|
}), this._def.right._parseSync({
|
1894
|
-
data:
|
1895
|
-
path:
|
1896
|
-
parent:
|
1991
|
+
data: s.data,
|
1992
|
+
path: s.path,
|
1993
|
+
parent: s
|
1897
1994
|
}));
|
1898
1995
|
}
|
1899
1996
|
}
|
1900
|
-
|
1901
|
-
left:
|
1997
|
+
te.create = (r, e, t) => new te({
|
1998
|
+
left: r,
|
1902
1999
|
right: e,
|
1903
2000
|
typeName: p.ZodIntersection,
|
1904
|
-
...
|
2001
|
+
...v(t)
|
1905
2002
|
});
|
1906
|
-
class
|
2003
|
+
class E extends _ {
|
1907
2004
|
_parse(e) {
|
1908
|
-
const { status: t, ctx:
|
1909
|
-
if (
|
1910
|
-
return
|
1911
|
-
code:
|
1912
|
-
expected:
|
1913
|
-
received:
|
2005
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
2006
|
+
if (s.parsedType !== f.array)
|
2007
|
+
return u(s, {
|
2008
|
+
code: d.invalid_type,
|
2009
|
+
expected: f.array,
|
2010
|
+
received: s.parsedType
|
1914
2011
|
}), m;
|
1915
|
-
if (
|
1916
|
-
return
|
1917
|
-
code:
|
2012
|
+
if (s.data.length < this._def.items.length)
|
2013
|
+
return u(s, {
|
2014
|
+
code: d.too_small,
|
1918
2015
|
minimum: this._def.items.length,
|
1919
2016
|
inclusive: !0,
|
1920
2017
|
exact: !1,
|
1921
2018
|
type: "array"
|
1922
2019
|
}), m;
|
1923
|
-
!this._def.rest &&
|
1924
|
-
code:
|
2020
|
+
!this._def.rest && s.data.length > this._def.items.length && (u(s, {
|
2021
|
+
code: d.too_big,
|
1925
2022
|
maximum: this._def.items.length,
|
1926
2023
|
inclusive: !0,
|
1927
2024
|
exact: !1,
|
1928
2025
|
type: "array"
|
1929
2026
|
}), t.dirty());
|
1930
|
-
const a = [...
|
1931
|
-
const
|
1932
|
-
return
|
2027
|
+
const a = [...s.data].map((i, o) => {
|
2028
|
+
const l = this._def.items[o] || this._def.rest;
|
2029
|
+
return l ? l._parse(new O(s, i, s.path, o)) : null;
|
1933
2030
|
}).filter((i) => !!i);
|
1934
|
-
return
|
2031
|
+
return s.common.async ? Promise.all(a).then((i) => k.mergeArray(t, i)) : k.mergeArray(t, a);
|
1935
2032
|
}
|
1936
2033
|
get items() {
|
1937
2034
|
return this._def.items;
|
1938
2035
|
}
|
1939
2036
|
rest(e) {
|
1940
|
-
return new
|
2037
|
+
return new E({
|
1941
2038
|
...this._def,
|
1942
2039
|
rest: e
|
1943
2040
|
});
|
1944
2041
|
}
|
1945
2042
|
}
|
1946
|
-
|
1947
|
-
if (!Array.isArray(
|
2043
|
+
E.create = (r, e) => {
|
2044
|
+
if (!Array.isArray(r))
|
1948
2045
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
1949
|
-
return new
|
1950
|
-
items:
|
2046
|
+
return new E({
|
2047
|
+
items: r,
|
1951
2048
|
typeName: p.ZodTuple,
|
1952
2049
|
rest: null,
|
1953
|
-
...
|
2050
|
+
...v(e)
|
1954
2051
|
});
|
1955
2052
|
};
|
1956
|
-
class
|
2053
|
+
class re extends _ {
|
1957
2054
|
get keySchema() {
|
1958
2055
|
return this._def.keyType;
|
1959
2056
|
}
|
@@ -1961,39 +2058,40 @@ class Q extends v {
|
|
1961
2058
|
return this._def.valueType;
|
1962
2059
|
}
|
1963
2060
|
_parse(e) {
|
1964
|
-
const { status: t, ctx:
|
1965
|
-
if (
|
1966
|
-
return
|
1967
|
-
code:
|
1968
|
-
expected:
|
1969
|
-
received:
|
2061
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
2062
|
+
if (s.parsedType !== f.object)
|
2063
|
+
return u(s, {
|
2064
|
+
code: d.invalid_type,
|
2065
|
+
expected: f.object,
|
2066
|
+
received: s.parsedType
|
1970
2067
|
}), m;
|
1971
2068
|
const n = [], a = this._def.keyType, i = this._def.valueType;
|
1972
|
-
for (const o in
|
2069
|
+
for (const o in s.data)
|
1973
2070
|
n.push({
|
1974
|
-
key: a._parse(new O(
|
1975
|
-
value: i._parse(new O(
|
2071
|
+
key: a._parse(new O(s, o, s.path, o)),
|
2072
|
+
value: i._parse(new O(s, s.data[o], s.path, o)),
|
2073
|
+
alwaysSet: o in s.data
|
1976
2074
|
});
|
1977
|
-
return
|
2075
|
+
return s.common.async ? k.mergeObjectAsync(t, n) : k.mergeObjectSync(t, n);
|
1978
2076
|
}
|
1979
2077
|
get element() {
|
1980
2078
|
return this._def.valueType;
|
1981
2079
|
}
|
1982
|
-
static create(e, t,
|
1983
|
-
return t instanceof
|
2080
|
+
static create(e, t, s) {
|
2081
|
+
return t instanceof _ ? new re({
|
1984
2082
|
keyType: e,
|
1985
2083
|
valueType: t,
|
1986
2084
|
typeName: p.ZodRecord,
|
1987
|
-
...
|
1988
|
-
}) : new
|
1989
|
-
keyType:
|
2085
|
+
...v(s)
|
2086
|
+
}) : new re({
|
2087
|
+
keyType: Z.create(),
|
1990
2088
|
valueType: e,
|
1991
2089
|
typeName: p.ZodRecord,
|
1992
|
-
...
|
2090
|
+
...v(t)
|
1993
2091
|
});
|
1994
2092
|
}
|
1995
2093
|
}
|
1996
|
-
class
|
2094
|
+
class me extends _ {
|
1997
2095
|
get keySchema() {
|
1998
2096
|
return this._def.keyType;
|
1999
2097
|
}
|
@@ -2001,65 +2099,65 @@ class de extends v {
|
|
2001
2099
|
return this._def.valueType;
|
2002
2100
|
}
|
2003
2101
|
_parse(e) {
|
2004
|
-
const { status: t, ctx:
|
2005
|
-
if (
|
2006
|
-
return
|
2007
|
-
code:
|
2008
|
-
expected:
|
2009
|
-
received:
|
2102
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
2103
|
+
if (s.parsedType !== f.map)
|
2104
|
+
return u(s, {
|
2105
|
+
code: d.invalid_type,
|
2106
|
+
expected: f.map,
|
2107
|
+
received: s.parsedType
|
2010
2108
|
}), m;
|
2011
|
-
const n = this._def.keyType, a = this._def.valueType, i = [...
|
2012
|
-
key: n._parse(new O(
|
2013
|
-
value: a._parse(new O(
|
2109
|
+
const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, l], c) => ({
|
2110
|
+
key: n._parse(new O(s, o, s.path, [c, "key"])),
|
2111
|
+
value: a._parse(new O(s, l, s.path, [c, "value"]))
|
2014
2112
|
}));
|
2015
|
-
if (
|
2113
|
+
if (s.common.async) {
|
2016
2114
|
const o = /* @__PURE__ */ new Map();
|
2017
2115
|
return Promise.resolve().then(async () => {
|
2018
|
-
for (const
|
2019
|
-
const
|
2020
|
-
if (
|
2116
|
+
for (const l of i) {
|
2117
|
+
const c = await l.key, y = await l.value;
|
2118
|
+
if (c.status === "aborted" || y.status === "aborted")
|
2021
2119
|
return m;
|
2022
|
-
(
|
2120
|
+
(c.status === "dirty" || y.status === "dirty") && t.dirty(), o.set(c.value, y.value);
|
2023
2121
|
}
|
2024
2122
|
return { status: t.value, value: o };
|
2025
2123
|
});
|
2026
2124
|
} else {
|
2027
2125
|
const o = /* @__PURE__ */ new Map();
|
2028
|
-
for (const
|
2029
|
-
const
|
2030
|
-
if (
|
2126
|
+
for (const l of i) {
|
2127
|
+
const c = l.key, y = l.value;
|
2128
|
+
if (c.status === "aborted" || y.status === "aborted")
|
2031
2129
|
return m;
|
2032
|
-
(
|
2130
|
+
(c.status === "dirty" || y.status === "dirty") && t.dirty(), o.set(c.value, y.value);
|
2033
2131
|
}
|
2034
2132
|
return { status: t.value, value: o };
|
2035
2133
|
}
|
2036
2134
|
}
|
2037
2135
|
}
|
2038
|
-
|
2136
|
+
me.create = (r, e, t) => new me({
|
2039
2137
|
valueType: e,
|
2040
|
-
keyType:
|
2138
|
+
keyType: r,
|
2041
2139
|
typeName: p.ZodMap,
|
2042
|
-
...
|
2140
|
+
...v(t)
|
2043
2141
|
});
|
2044
|
-
class
|
2142
|
+
class L extends _ {
|
2045
2143
|
_parse(e) {
|
2046
|
-
const { status: t, ctx:
|
2047
|
-
if (
|
2048
|
-
return
|
2049
|
-
code:
|
2050
|
-
expected:
|
2051
|
-
received:
|
2144
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
2145
|
+
if (s.parsedType !== f.set)
|
2146
|
+
return u(s, {
|
2147
|
+
code: d.invalid_type,
|
2148
|
+
expected: f.set,
|
2149
|
+
received: s.parsedType
|
2052
2150
|
}), m;
|
2053
2151
|
const n = this._def;
|
2054
|
-
n.minSize !== null &&
|
2055
|
-
code:
|
2152
|
+
n.minSize !== null && s.data.size < n.minSize.value && (u(s, {
|
2153
|
+
code: d.too_small,
|
2056
2154
|
minimum: n.minSize.value,
|
2057
2155
|
type: "set",
|
2058
2156
|
inclusive: !0,
|
2059
2157
|
exact: !1,
|
2060
2158
|
message: n.minSize.message
|
2061
|
-
}), t.dirty()), n.maxSize !== null &&
|
2062
|
-
code:
|
2159
|
+
}), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (u(s, {
|
2160
|
+
code: d.too_big,
|
2063
2161
|
maximum: n.maxSize.value,
|
2064
2162
|
type: "set",
|
2065
2163
|
inclusive: !0,
|
@@ -2067,26 +2165,26 @@ class $ extends v {
|
|
2067
2165
|
message: n.maxSize.message
|
2068
2166
|
}), t.dirty());
|
2069
2167
|
const a = this._def.valueType;
|
2070
|
-
function i(
|
2071
|
-
const
|
2072
|
-
for (const
|
2073
|
-
if (
|
2168
|
+
function i(l) {
|
2169
|
+
const c = /* @__PURE__ */ new Set();
|
2170
|
+
for (const y of l) {
|
2171
|
+
if (y.status === "aborted")
|
2074
2172
|
return m;
|
2075
|
-
|
2173
|
+
y.status === "dirty" && t.dirty(), c.add(y.value);
|
2076
2174
|
}
|
2077
|
-
return { status: t.value, value:
|
2175
|
+
return { status: t.value, value: c };
|
2078
2176
|
}
|
2079
|
-
const o = [...
|
2080
|
-
return
|
2177
|
+
const o = [...s.data.values()].map((l, c) => a._parse(new O(s, l, s.path, c)));
|
2178
|
+
return s.common.async ? Promise.all(o).then((l) => i(l)) : i(o);
|
2081
2179
|
}
|
2082
2180
|
min(e, t) {
|
2083
|
-
return new
|
2181
|
+
return new L({
|
2084
2182
|
...this._def,
|
2085
2183
|
minSize: { value: e, message: h.toString(t) }
|
2086
2184
|
});
|
2087
2185
|
}
|
2088
2186
|
max(e, t) {
|
2089
|
-
return new
|
2187
|
+
return new L({
|
2090
2188
|
...this._def,
|
2091
2189
|
maxSize: { value: e, message: h.toString(t) }
|
2092
2190
|
});
|
@@ -2098,78 +2196,78 @@ class $ extends v {
|
|
2098
2196
|
return this.min(1, e);
|
2099
2197
|
}
|
2100
2198
|
}
|
2101
|
-
|
2102
|
-
valueType:
|
2199
|
+
L.create = (r, e) => new L({
|
2200
|
+
valueType: r,
|
2103
2201
|
minSize: null,
|
2104
2202
|
maxSize: null,
|
2105
2203
|
typeName: p.ZodSet,
|
2106
|
-
...
|
2204
|
+
...v(e)
|
2107
2205
|
});
|
2108
|
-
class
|
2206
|
+
class B extends _ {
|
2109
2207
|
constructor() {
|
2110
2208
|
super(...arguments), this.validate = this.implement;
|
2111
2209
|
}
|
2112
2210
|
_parse(e) {
|
2113
2211
|
const { ctx: t } = this._processInputParams(e);
|
2114
|
-
if (t.parsedType !==
|
2115
|
-
return
|
2116
|
-
code:
|
2117
|
-
expected:
|
2212
|
+
if (t.parsedType !== f.function)
|
2213
|
+
return u(t, {
|
2214
|
+
code: d.invalid_type,
|
2215
|
+
expected: f.function,
|
2118
2216
|
received: t.parsedType
|
2119
2217
|
}), m;
|
2120
|
-
function
|
2121
|
-
return
|
2218
|
+
function s(o, l) {
|
2219
|
+
return le({
|
2122
2220
|
data: o,
|
2123
2221
|
path: t.path,
|
2124
2222
|
errorMaps: [
|
2125
2223
|
t.common.contextualErrorMap,
|
2126
2224
|
t.schemaErrorMap,
|
2127
|
-
|
2225
|
+
ue(),
|
2128
2226
|
W
|
2129
|
-
].filter((
|
2227
|
+
].filter((c) => !!c),
|
2130
2228
|
issueData: {
|
2131
|
-
code:
|
2132
|
-
argumentsError:
|
2229
|
+
code: d.invalid_arguments,
|
2230
|
+
argumentsError: l
|
2133
2231
|
}
|
2134
2232
|
});
|
2135
2233
|
}
|
2136
|
-
function n(o,
|
2137
|
-
return
|
2234
|
+
function n(o, l) {
|
2235
|
+
return le({
|
2138
2236
|
data: o,
|
2139
2237
|
path: t.path,
|
2140
2238
|
errorMaps: [
|
2141
2239
|
t.common.contextualErrorMap,
|
2142
2240
|
t.schemaErrorMap,
|
2143
|
-
|
2241
|
+
ue(),
|
2144
2242
|
W
|
2145
|
-
].filter((
|
2243
|
+
].filter((c) => !!c),
|
2146
2244
|
issueData: {
|
2147
|
-
code:
|
2148
|
-
returnTypeError:
|
2245
|
+
code: d.invalid_return_type,
|
2246
|
+
returnTypeError: l
|
2149
2247
|
}
|
2150
2248
|
});
|
2151
2249
|
}
|
2152
2250
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
2153
|
-
if (this._def.returns instanceof
|
2251
|
+
if (this._def.returns instanceof Y) {
|
2154
2252
|
const o = this;
|
2155
|
-
return b(async function(...
|
2156
|
-
const
|
2157
|
-
throw
|
2158
|
-
}),
|
2159
|
-
return await o._def.returns._def.type.parseAsync(
|
2160
|
-
throw
|
2253
|
+
return b(async function(...l) {
|
2254
|
+
const c = new w([]), y = await o._def.args.parseAsync(l, a).catch((_e) => {
|
2255
|
+
throw c.addIssue(s(l, _e)), c;
|
2256
|
+
}), T = await Reflect.apply(i, this, y);
|
2257
|
+
return await o._def.returns._def.type.parseAsync(T, a).catch((_e) => {
|
2258
|
+
throw c.addIssue(n(T, _e)), c;
|
2161
2259
|
});
|
2162
2260
|
});
|
2163
2261
|
} else {
|
2164
2262
|
const o = this;
|
2165
|
-
return b(function(...
|
2166
|
-
const
|
2167
|
-
if (!
|
2168
|
-
throw new
|
2169
|
-
const
|
2170
|
-
if (!
|
2171
|
-
throw new
|
2172
|
-
return
|
2263
|
+
return b(function(...l) {
|
2264
|
+
const c = o._def.args.safeParse(l, a);
|
2265
|
+
if (!c.success)
|
2266
|
+
throw new w([s(l, c.error)]);
|
2267
|
+
const y = Reflect.apply(i, this, c.data), T = o._def.returns.safeParse(y, a);
|
2268
|
+
if (!T.success)
|
2269
|
+
throw new w([n(y, T.error)]);
|
2270
|
+
return T.data;
|
2173
2271
|
});
|
2174
2272
|
}
|
2175
2273
|
}
|
@@ -2180,13 +2278,13 @@ class z extends v {
|
|
2180
2278
|
return this._def.returns;
|
2181
2279
|
}
|
2182
2280
|
args(...e) {
|
2183
|
-
return new
|
2281
|
+
return new B({
|
2184
2282
|
...this._def,
|
2185
|
-
args:
|
2283
|
+
args: E.create(e).rest(V.create())
|
2186
2284
|
});
|
2187
2285
|
}
|
2188
2286
|
returns(e) {
|
2189
|
-
return new
|
2287
|
+
return new B({
|
2190
2288
|
...this._def,
|
2191
2289
|
returns: e
|
2192
2290
|
});
|
@@ -2197,16 +2295,16 @@ class z extends v {
|
|
2197
2295
|
strictImplement(e) {
|
2198
2296
|
return this.parse(e);
|
2199
2297
|
}
|
2200
|
-
static create(e, t,
|
2201
|
-
return new
|
2202
|
-
args: e ||
|
2203
|
-
returns: t ||
|
2298
|
+
static create(e, t, s) {
|
2299
|
+
return new B({
|
2300
|
+
args: e || E.create([]).rest(V.create()),
|
2301
|
+
returns: t || V.create(),
|
2204
2302
|
typeName: p.ZodFunction,
|
2205
|
-
...
|
2303
|
+
...v(s)
|
2206
2304
|
});
|
2207
2305
|
}
|
2208
2306
|
}
|
2209
|
-
class
|
2307
|
+
class se extends _ {
|
2210
2308
|
get schema() {
|
2211
2309
|
return this._def.getter();
|
2212
2310
|
}
|
@@ -2215,18 +2313,18 @@ class K extends v {
|
|
2215
2313
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
2216
2314
|
}
|
2217
2315
|
}
|
2218
|
-
|
2219
|
-
getter:
|
2316
|
+
se.create = (r, e) => new se({
|
2317
|
+
getter: r,
|
2220
2318
|
typeName: p.ZodLazy,
|
2221
|
-
...
|
2319
|
+
...v(e)
|
2222
2320
|
});
|
2223
|
-
class
|
2321
|
+
class ne extends _ {
|
2224
2322
|
_parse(e) {
|
2225
2323
|
if (e.data !== this._def.value) {
|
2226
2324
|
const t = this._getOrReturnCtx(e);
|
2227
|
-
return
|
2325
|
+
return u(t, {
|
2228
2326
|
received: t.data,
|
2229
|
-
code:
|
2327
|
+
code: d.invalid_literal,
|
2230
2328
|
expected: this._def.value
|
2231
2329
|
}), m;
|
2232
2330
|
}
|
@@ -2236,34 +2334,37 @@ class F extends v {
|
|
2236
2334
|
return this._def.value;
|
2237
2335
|
}
|
2238
2336
|
}
|
2239
|
-
|
2240
|
-
value:
|
2337
|
+
ne.create = (r, e) => new ne({
|
2338
|
+
value: r,
|
2241
2339
|
typeName: p.ZodLiteral,
|
2242
|
-
...
|
2340
|
+
...v(e)
|
2243
2341
|
});
|
2244
|
-
function
|
2245
|
-
return new
|
2246
|
-
values:
|
2342
|
+
function je(r, e) {
|
2343
|
+
return new $({
|
2344
|
+
values: r,
|
2247
2345
|
typeName: p.ZodEnum,
|
2248
|
-
...
|
2346
|
+
...v(e)
|
2249
2347
|
});
|
2250
2348
|
}
|
2251
|
-
class
|
2349
|
+
class $ extends _ {
|
2350
|
+
constructor() {
|
2351
|
+
super(...arguments), J.set(this, void 0);
|
2352
|
+
}
|
2252
2353
|
_parse(e) {
|
2253
2354
|
if (typeof e.data != "string") {
|
2254
|
-
const t = this._getOrReturnCtx(e),
|
2255
|
-
return
|
2256
|
-
expected: g.joinValues(
|
2355
|
+
const t = this._getOrReturnCtx(e), s = this._def.values;
|
2356
|
+
return u(t, {
|
2357
|
+
expected: g.joinValues(s),
|
2257
2358
|
received: t.parsedType,
|
2258
|
-
code:
|
2359
|
+
code: d.invalid_type
|
2259
2360
|
}), m;
|
2260
2361
|
}
|
2261
|
-
if (this._def.values.
|
2262
|
-
const t = this._getOrReturnCtx(e),
|
2263
|
-
return
|
2362
|
+
if (fe(this, J) || Oe(this, J, new Set(this._def.values)), !fe(this, J).has(e.data)) {
|
2363
|
+
const t = this._getOrReturnCtx(e), s = this._def.values;
|
2364
|
+
return u(t, {
|
2264
2365
|
received: t.data,
|
2265
|
-
code:
|
2266
|
-
options:
|
2366
|
+
code: d.invalid_enum_value,
|
2367
|
+
options: s
|
2267
2368
|
}), m;
|
2268
2369
|
}
|
2269
2370
|
return b(e.data);
|
@@ -2289,30 +2390,40 @@ class M extends v {
|
|
2289
2390
|
e[t] = t;
|
2290
2391
|
return e;
|
2291
2392
|
}
|
2292
|
-
extract(e) {
|
2293
|
-
return
|
2393
|
+
extract(e, t = this._def) {
|
2394
|
+
return $.create(e, {
|
2395
|
+
...this._def,
|
2396
|
+
...t
|
2397
|
+
});
|
2294
2398
|
}
|
2295
|
-
exclude(e) {
|
2296
|
-
return
|
2399
|
+
exclude(e, t = this._def) {
|
2400
|
+
return $.create(this.options.filter((s) => !e.includes(s)), {
|
2401
|
+
...this._def,
|
2402
|
+
...t
|
2403
|
+
});
|
2297
2404
|
}
|
2298
2405
|
}
|
2299
|
-
|
2300
|
-
|
2406
|
+
J = /* @__PURE__ */ new WeakMap();
|
2407
|
+
$.create = je;
|
2408
|
+
class ae extends _ {
|
2409
|
+
constructor() {
|
2410
|
+
super(...arguments), H.set(this, void 0);
|
2411
|
+
}
|
2301
2412
|
_parse(e) {
|
2302
|
-
const t = g.getValidEnumValues(this._def.values),
|
2303
|
-
if (
|
2413
|
+
const t = g.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
2414
|
+
if (s.parsedType !== f.string && s.parsedType !== f.number) {
|
2304
2415
|
const n = g.objectValues(t);
|
2305
|
-
return
|
2416
|
+
return u(s, {
|
2306
2417
|
expected: g.joinValues(n),
|
2307
|
-
received:
|
2308
|
-
code:
|
2418
|
+
received: s.parsedType,
|
2419
|
+
code: d.invalid_type
|
2309
2420
|
}), m;
|
2310
2421
|
}
|
2311
|
-
if (
|
2422
|
+
if (fe(this, H) || Oe(this, H, new Set(g.getValidEnumValues(this._def.values))), !fe(this, H).has(e.data)) {
|
2312
2423
|
const n = g.objectValues(t);
|
2313
|
-
return
|
2314
|
-
received:
|
2315
|
-
code:
|
2424
|
+
return u(s, {
|
2425
|
+
received: s.data,
|
2426
|
+
code: d.invalid_enum_value,
|
2316
2427
|
options: n
|
2317
2428
|
}), m;
|
2318
2429
|
}
|
@@ -2322,36 +2433,37 @@ class ee extends v {
|
|
2322
2433
|
return this._def.values;
|
2323
2434
|
}
|
2324
2435
|
}
|
2325
|
-
|
2326
|
-
|
2436
|
+
H = /* @__PURE__ */ new WeakMap();
|
2437
|
+
ae.create = (r, e) => new ae({
|
2438
|
+
values: r,
|
2327
2439
|
typeName: p.ZodNativeEnum,
|
2328
|
-
...
|
2440
|
+
...v(e)
|
2329
2441
|
});
|
2330
|
-
class
|
2442
|
+
class Y extends _ {
|
2331
2443
|
unwrap() {
|
2332
2444
|
return this._def.type;
|
2333
2445
|
}
|
2334
2446
|
_parse(e) {
|
2335
2447
|
const { ctx: t } = this._processInputParams(e);
|
2336
|
-
if (t.parsedType !==
|
2337
|
-
return
|
2338
|
-
code:
|
2339
|
-
expected:
|
2448
|
+
if (t.parsedType !== f.promise && t.common.async === !1)
|
2449
|
+
return u(t, {
|
2450
|
+
code: d.invalid_type,
|
2451
|
+
expected: f.promise,
|
2340
2452
|
received: t.parsedType
|
2341
2453
|
}), m;
|
2342
|
-
const
|
2343
|
-
return b(
|
2454
|
+
const s = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
|
2455
|
+
return b(s.then((n) => this._def.type.parseAsync(n, {
|
2344
2456
|
path: t.path,
|
2345
2457
|
errorMap: t.common.contextualErrorMap
|
2346
2458
|
})));
|
2347
2459
|
}
|
2348
2460
|
}
|
2349
|
-
|
2350
|
-
type:
|
2461
|
+
Y.create = (r, e) => new Y({
|
2462
|
+
type: r,
|
2351
2463
|
typeName: p.ZodPromise,
|
2352
|
-
...
|
2464
|
+
...v(e)
|
2353
2465
|
});
|
2354
|
-
class
|
2466
|
+
class C extends _ {
|
2355
2467
|
innerType() {
|
2356
2468
|
return this._def.schema;
|
2357
2469
|
}
|
@@ -2359,110 +2471,119 @@ class N extends v {
|
|
2359
2471
|
return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
2360
2472
|
}
|
2361
2473
|
_parse(e) {
|
2362
|
-
const { status: t, ctx:
|
2474
|
+
const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
|
2363
2475
|
addIssue: (i) => {
|
2364
|
-
|
2476
|
+
u(s, i), i.fatal ? t.abort() : t.dirty();
|
2365
2477
|
},
|
2366
2478
|
get path() {
|
2367
|
-
return
|
2479
|
+
return s.path;
|
2368
2480
|
}
|
2369
2481
|
};
|
2370
2482
|
if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
|
2371
|
-
const i = n.transform(
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2375
|
-
|
2376
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
2383
|
-
|
2483
|
+
const i = n.transform(s.data, a);
|
2484
|
+
if (s.common.async)
|
2485
|
+
return Promise.resolve(i).then(async (o) => {
|
2486
|
+
if (t.value === "aborted")
|
2487
|
+
return m;
|
2488
|
+
const l = await this._def.schema._parseAsync({
|
2489
|
+
data: o,
|
2490
|
+
path: s.path,
|
2491
|
+
parent: s
|
2492
|
+
});
|
2493
|
+
return l.status === "aborted" ? m : l.status === "dirty" || t.value === "dirty" ? U(l.value) : l;
|
2494
|
+
});
|
2495
|
+
{
|
2496
|
+
if (t.value === "aborted")
|
2497
|
+
return m;
|
2498
|
+
const o = this._def.schema._parseSync({
|
2499
|
+
data: i,
|
2500
|
+
path: s.path,
|
2501
|
+
parent: s
|
2502
|
+
});
|
2503
|
+
return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? U(o.value) : o;
|
2504
|
+
}
|
2384
2505
|
}
|
2385
2506
|
if (n.type === "refinement") {
|
2386
2507
|
const i = (o) => {
|
2387
|
-
const
|
2388
|
-
if (
|
2389
|
-
return Promise.resolve(
|
2390
|
-
if (
|
2508
|
+
const l = n.refinement(o, a);
|
2509
|
+
if (s.common.async)
|
2510
|
+
return Promise.resolve(l);
|
2511
|
+
if (l instanceof Promise)
|
2391
2512
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
2392
2513
|
return o;
|
2393
2514
|
};
|
2394
|
-
if (
|
2515
|
+
if (s.common.async === !1) {
|
2395
2516
|
const o = this._def.schema._parseSync({
|
2396
|
-
data:
|
2397
|
-
path:
|
2398
|
-
parent:
|
2517
|
+
data: s.data,
|
2518
|
+
path: s.path,
|
2519
|
+
parent: s
|
2399
2520
|
});
|
2400
2521
|
return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
2401
2522
|
} else
|
2402
|
-
return this._def.schema._parseAsync({ data:
|
2523
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
2403
2524
|
}
|
2404
2525
|
if (n.type === "transform")
|
2405
|
-
if (
|
2526
|
+
if (s.common.async === !1) {
|
2406
2527
|
const i = this._def.schema._parseSync({
|
2407
|
-
data:
|
2408
|
-
path:
|
2409
|
-
parent:
|
2528
|
+
data: s.data,
|
2529
|
+
path: s.path,
|
2530
|
+
parent: s
|
2410
2531
|
});
|
2411
|
-
if (!
|
2532
|
+
if (!G(i))
|
2412
2533
|
return i;
|
2413
2534
|
const o = n.transform(i.value, a);
|
2414
2535
|
if (o instanceof Promise)
|
2415
2536
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
2416
2537
|
return { status: t.value, value: o };
|
2417
2538
|
} else
|
2418
|
-
return this._def.schema._parseAsync({ data:
|
2539
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => G(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
2419
2540
|
g.assertNever(n);
|
2420
2541
|
}
|
2421
2542
|
}
|
2422
|
-
|
2423
|
-
schema:
|
2543
|
+
C.create = (r, e, t) => new C({
|
2544
|
+
schema: r,
|
2424
2545
|
typeName: p.ZodEffects,
|
2425
2546
|
effect: e,
|
2426
|
-
...
|
2547
|
+
...v(t)
|
2427
2548
|
});
|
2428
|
-
|
2549
|
+
C.createWithPreprocess = (r, e, t) => new C({
|
2429
2550
|
schema: e,
|
2430
|
-
effect: { type: "preprocess", transform:
|
2551
|
+
effect: { type: "preprocess", transform: r },
|
2431
2552
|
typeName: p.ZodEffects,
|
2432
|
-
...
|
2553
|
+
...v(t)
|
2433
2554
|
});
|
2434
|
-
class
|
2555
|
+
class N extends _ {
|
2435
2556
|
_parse(e) {
|
2436
|
-
return this._getType(e) ===
|
2557
|
+
return this._getType(e) === f.undefined ? b(void 0) : this._def.innerType._parse(e);
|
2437
2558
|
}
|
2438
2559
|
unwrap() {
|
2439
2560
|
return this._def.innerType;
|
2440
2561
|
}
|
2441
2562
|
}
|
2442
|
-
|
2443
|
-
innerType:
|
2563
|
+
N.create = (r, e) => new N({
|
2564
|
+
innerType: r,
|
2444
2565
|
typeName: p.ZodOptional,
|
2445
|
-
...
|
2566
|
+
...v(e)
|
2446
2567
|
});
|
2447
|
-
class
|
2568
|
+
class P extends _ {
|
2448
2569
|
_parse(e) {
|
2449
|
-
return this._getType(e) ===
|
2570
|
+
return this._getType(e) === f.null ? b(null) : this._def.innerType._parse(e);
|
2450
2571
|
}
|
2451
2572
|
unwrap() {
|
2452
2573
|
return this._def.innerType;
|
2453
2574
|
}
|
2454
2575
|
}
|
2455
|
-
|
2456
|
-
innerType:
|
2576
|
+
P.create = (r, e) => new P({
|
2577
|
+
innerType: r,
|
2457
2578
|
typeName: p.ZodNullable,
|
2458
|
-
...
|
2579
|
+
...v(e)
|
2459
2580
|
});
|
2460
|
-
class
|
2581
|
+
class ie extends _ {
|
2461
2582
|
_parse(e) {
|
2462
2583
|
const { ctx: t } = this._processInputParams(e);
|
2463
|
-
let
|
2464
|
-
return t.parsedType ===
|
2465
|
-
data:
|
2584
|
+
let s = t.data;
|
2585
|
+
return t.parsedType === f.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
2586
|
+
data: s,
|
2466
2587
|
path: t.path,
|
2467
2588
|
parent: t
|
2468
2589
|
});
|
@@ -2471,42 +2592,42 @@ class te extends v {
|
|
2471
2592
|
return this._def.innerType;
|
2472
2593
|
}
|
2473
2594
|
}
|
2474
|
-
|
2475
|
-
innerType:
|
2595
|
+
ie.create = (r, e) => new ie({
|
2596
|
+
innerType: r,
|
2476
2597
|
typeName: p.ZodDefault,
|
2477
2598
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
2478
|
-
...
|
2599
|
+
...v(e)
|
2479
2600
|
});
|
2480
|
-
class
|
2601
|
+
class oe extends _ {
|
2481
2602
|
_parse(e) {
|
2482
|
-
const { ctx: t } = this._processInputParams(e),
|
2603
|
+
const { ctx: t } = this._processInputParams(e), s = {
|
2483
2604
|
...t,
|
2484
2605
|
common: {
|
2485
2606
|
...t.common,
|
2486
2607
|
issues: []
|
2487
2608
|
}
|
2488
2609
|
}, n = this._def.innerType._parse({
|
2489
|
-
data:
|
2490
|
-
path:
|
2610
|
+
data: s.data,
|
2611
|
+
path: s.path,
|
2491
2612
|
parent: {
|
2492
|
-
...
|
2613
|
+
...s
|
2493
2614
|
}
|
2494
2615
|
});
|
2495
|
-
return
|
2616
|
+
return X(n) ? n.then((a) => ({
|
2496
2617
|
status: "valid",
|
2497
2618
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
2498
2619
|
get error() {
|
2499
|
-
return new
|
2620
|
+
return new w(s.common.issues);
|
2500
2621
|
},
|
2501
|
-
input:
|
2622
|
+
input: s.data
|
2502
2623
|
})
|
2503
2624
|
})) : {
|
2504
2625
|
status: "valid",
|
2505
2626
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
2506
2627
|
get error() {
|
2507
|
-
return new
|
2628
|
+
return new w(s.common.issues);
|
2508
2629
|
},
|
2509
|
-
input:
|
2630
|
+
input: s.data
|
2510
2631
|
})
|
2511
2632
|
};
|
2512
2633
|
}
|
@@ -2514,35 +2635,35 @@ class ue extends v {
|
|
2514
2635
|
return this._def.innerType;
|
2515
2636
|
}
|
2516
2637
|
}
|
2517
|
-
|
2518
|
-
innerType:
|
2638
|
+
oe.create = (r, e) => new oe({
|
2639
|
+
innerType: r,
|
2519
2640
|
typeName: p.ZodCatch,
|
2520
2641
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
2521
|
-
...
|
2642
|
+
...v(e)
|
2522
2643
|
});
|
2523
|
-
class
|
2644
|
+
class ye extends _ {
|
2524
2645
|
_parse(e) {
|
2525
|
-
if (this._getType(e) !==
|
2526
|
-
const
|
2527
|
-
return
|
2528
|
-
code:
|
2529
|
-
expected:
|
2530
|
-
received:
|
2646
|
+
if (this._getType(e) !== f.nan) {
|
2647
|
+
const s = this._getOrReturnCtx(e);
|
2648
|
+
return u(s, {
|
2649
|
+
code: d.invalid_type,
|
2650
|
+
expected: f.nan,
|
2651
|
+
received: s.parsedType
|
2531
2652
|
}), m;
|
2532
2653
|
}
|
2533
2654
|
return { status: "valid", value: e.data };
|
2534
2655
|
}
|
2535
2656
|
}
|
2536
|
-
|
2657
|
+
ye.create = (r) => new ye({
|
2537
2658
|
typeName: p.ZodNaN,
|
2538
|
-
...
|
2659
|
+
...v(r)
|
2539
2660
|
});
|
2540
|
-
const
|
2541
|
-
class
|
2661
|
+
const rt = Symbol("zod_brand");
|
2662
|
+
class Te extends _ {
|
2542
2663
|
_parse(e) {
|
2543
|
-
const { ctx: t } = this._processInputParams(e),
|
2664
|
+
const { ctx: t } = this._processInputParams(e), s = t.data;
|
2544
2665
|
return this._def.type._parse({
|
2545
|
-
data:
|
2666
|
+
data: s,
|
2546
2667
|
path: t.path,
|
2547
2668
|
parent: t
|
2548
2669
|
});
|
@@ -2551,304 +2672,312 @@ class Ze extends v {
|
|
2551
2672
|
return this._def.type;
|
2552
2673
|
}
|
2553
2674
|
}
|
2554
|
-
class
|
2675
|
+
class ce extends _ {
|
2555
2676
|
_parse(e) {
|
2556
|
-
const { status: t, ctx:
|
2557
|
-
if (
|
2677
|
+
const { status: t, ctx: s } = this._processInputParams(e);
|
2678
|
+
if (s.common.async)
|
2558
2679
|
return (async () => {
|
2559
2680
|
const a = await this._def.in._parseAsync({
|
2560
|
-
data:
|
2561
|
-
path:
|
2562
|
-
parent:
|
2681
|
+
data: s.data,
|
2682
|
+
path: s.path,
|
2683
|
+
parent: s
|
2563
2684
|
});
|
2564
|
-
return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(),
|
2685
|
+
return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), U(a.value)) : this._def.out._parseAsync({
|
2565
2686
|
data: a.value,
|
2566
|
-
path:
|
2567
|
-
parent:
|
2687
|
+
path: s.path,
|
2688
|
+
parent: s
|
2568
2689
|
});
|
2569
2690
|
})();
|
2570
2691
|
{
|
2571
2692
|
const n = this._def.in._parseSync({
|
2572
|
-
data:
|
2573
|
-
path:
|
2574
|
-
parent:
|
2693
|
+
data: s.data,
|
2694
|
+
path: s.path,
|
2695
|
+
parent: s
|
2575
2696
|
});
|
2576
2697
|
return n.status === "aborted" ? m : n.status === "dirty" ? (t.dirty(), {
|
2577
2698
|
status: "dirty",
|
2578
2699
|
value: n.value
|
2579
2700
|
}) : this._def.out._parseSync({
|
2580
2701
|
data: n.value,
|
2581
|
-
path:
|
2582
|
-
parent:
|
2702
|
+
path: s.path,
|
2703
|
+
parent: s
|
2583
2704
|
});
|
2584
2705
|
}
|
2585
2706
|
}
|
2586
2707
|
static create(e, t) {
|
2587
|
-
return new
|
2708
|
+
return new ce({
|
2588
2709
|
in: e,
|
2589
2710
|
out: t,
|
2590
2711
|
typeName: p.ZodPipeline
|
2591
2712
|
});
|
2592
2713
|
}
|
2593
2714
|
}
|
2594
|
-
class
|
2715
|
+
class de extends _ {
|
2595
2716
|
_parse(e) {
|
2596
|
-
const t = this._def.innerType._parse(e);
|
2597
|
-
return
|
2717
|
+
const t = this._def.innerType._parse(e), s = (n) => (G(n) && (n.value = Object.freeze(n.value)), n);
|
2718
|
+
return X(t) ? t.then((n) => s(n)) : s(t);
|
2719
|
+
}
|
2720
|
+
unwrap() {
|
2721
|
+
return this._def.innerType;
|
2598
2722
|
}
|
2599
2723
|
}
|
2600
|
-
|
2601
|
-
innerType:
|
2724
|
+
de.create = (r, e) => new de({
|
2725
|
+
innerType: r,
|
2602
2726
|
typeName: p.ZodReadonly,
|
2603
|
-
...
|
2727
|
+
...v(e)
|
2604
2728
|
});
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
}
|
2729
|
+
function Ae(r, e = {}, t) {
|
2730
|
+
return r ? q.create().superRefine((s, n) => {
|
2731
|
+
var a, i;
|
2732
|
+
if (!r(s)) {
|
2733
|
+
const o = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, l = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
|
2734
|
+
n.addIssue({ code: "custom", ...c, fatal: l });
|
2735
|
+
}
|
2736
|
+
}) : q.create();
|
2737
|
+
}
|
2738
|
+
const st = {
|
2612
2739
|
object: x.lazycreate
|
2613
2740
|
};
|
2614
2741
|
var p;
|
2615
|
-
(function(
|
2616
|
-
|
2742
|
+
(function(r) {
|
2743
|
+
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
2617
2744
|
})(p || (p = {}));
|
2618
|
-
const
|
2619
|
-
message: `Input not instance of ${
|
2620
|
-
}) =>
|
2621
|
-
string: (
|
2622
|
-
number: (
|
2623
|
-
boolean: (
|
2624
|
-
...
|
2745
|
+
const nt = (r, e = {
|
2746
|
+
message: `Input not instance of ${r.name}`
|
2747
|
+
}) => Ae((t) => t instanceof r, e), Me = Z.create, $e = A.create, at = ye.create, it = M.create, Pe = Q.create, ot = D.create, dt = he.create, ct = K.create, ut = F.create, lt = q.create, ft = V.create, ht = I.create, pt = pe.create, mt = S.create, yt = x.create, vt = x.strictCreate, _t = ee.create, gt = ve.create, xt = te.create, kt = E.create, bt = re.create, wt = me.create, Tt = L.create, Zt = B.create, St = se.create, Ct = ne.create, Nt = $.create, Ot = ae.create, Et = Y.create, Ce = C.create, Rt = N.create, It = P.create, jt = C.createWithPreprocess, At = ce.create, Mt = () => Me().optional(), $t = () => $e().optional(), Pt = () => Pe().optional(), Vt = {
|
2748
|
+
string: (r) => Z.create({ ...r, coerce: !0 }),
|
2749
|
+
number: (r) => A.create({ ...r, coerce: !0 }),
|
2750
|
+
boolean: (r) => Q.create({
|
2751
|
+
...r,
|
2625
2752
|
coerce: !0
|
2626
2753
|
}),
|
2627
|
-
bigint: (
|
2628
|
-
date: (
|
2629
|
-
},
|
2630
|
-
var
|
2754
|
+
bigint: (r) => M.create({ ...r, coerce: !0 }),
|
2755
|
+
date: (r) => D.create({ ...r, coerce: !0 })
|
2756
|
+
}, Dt = m;
|
2757
|
+
var Lt = /* @__PURE__ */ Object.freeze({
|
2631
2758
|
__proto__: null,
|
2632
2759
|
defaultErrorMap: W,
|
2633
|
-
setErrorMap:
|
2634
|
-
getErrorMap:
|
2635
|
-
makeIssue:
|
2636
|
-
EMPTY_PATH:
|
2637
|
-
addIssueToContext:
|
2760
|
+
setErrorMap: De,
|
2761
|
+
getErrorMap: ue,
|
2762
|
+
makeIssue: le,
|
2763
|
+
EMPTY_PATH: Le,
|
2764
|
+
addIssueToContext: u,
|
2638
2765
|
ParseStatus: k,
|
2639
2766
|
INVALID: m,
|
2640
|
-
DIRTY:
|
2767
|
+
DIRTY: U,
|
2641
2768
|
OK: b,
|
2642
|
-
isAborted:
|
2643
|
-
isDirty:
|
2644
|
-
isValid:
|
2645
|
-
isAsync:
|
2769
|
+
isAborted: ke,
|
2770
|
+
isDirty: be,
|
2771
|
+
isValid: G,
|
2772
|
+
isAsync: X,
|
2646
2773
|
get util() {
|
2647
2774
|
return g;
|
2648
2775
|
},
|
2649
2776
|
get objectUtil() {
|
2650
|
-
return
|
2777
|
+
return xe;
|
2651
2778
|
},
|
2652
|
-
ZodParsedType:
|
2653
|
-
getParsedType:
|
2654
|
-
ZodType:
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2660
|
-
|
2661
|
-
|
2662
|
-
|
2663
|
-
|
2664
|
-
|
2779
|
+
ZodParsedType: f,
|
2780
|
+
getParsedType: j,
|
2781
|
+
ZodType: _,
|
2782
|
+
datetimeRegex: Ie,
|
2783
|
+
ZodString: Z,
|
2784
|
+
ZodNumber: A,
|
2785
|
+
ZodBigInt: M,
|
2786
|
+
ZodBoolean: Q,
|
2787
|
+
ZodDate: D,
|
2788
|
+
ZodSymbol: he,
|
2789
|
+
ZodUndefined: K,
|
2790
|
+
ZodNull: F,
|
2791
|
+
ZodAny: q,
|
2792
|
+
ZodUnknown: V,
|
2665
2793
|
ZodNever: I,
|
2666
|
-
ZodVoid:
|
2794
|
+
ZodVoid: pe,
|
2667
2795
|
ZodArray: S,
|
2668
2796
|
ZodObject: x,
|
2669
|
-
ZodUnion:
|
2670
|
-
ZodDiscriminatedUnion:
|
2671
|
-
ZodIntersection:
|
2672
|
-
ZodTuple:
|
2673
|
-
ZodRecord:
|
2674
|
-
ZodMap:
|
2675
|
-
ZodSet:
|
2676
|
-
ZodFunction:
|
2677
|
-
ZodLazy:
|
2678
|
-
ZodLiteral:
|
2679
|
-
ZodEnum:
|
2680
|
-
ZodNativeEnum:
|
2681
|
-
ZodPromise:
|
2682
|
-
ZodEffects:
|
2683
|
-
ZodTransformer:
|
2684
|
-
ZodOptional:
|
2685
|
-
ZodNullable:
|
2686
|
-
ZodDefault:
|
2687
|
-
ZodCatch:
|
2688
|
-
ZodNaN:
|
2689
|
-
BRAND:
|
2690
|
-
ZodBranded:
|
2691
|
-
ZodPipeline:
|
2692
|
-
ZodReadonly:
|
2693
|
-
custom:
|
2694
|
-
Schema:
|
2695
|
-
ZodSchema:
|
2696
|
-
late:
|
2797
|
+
ZodUnion: ee,
|
2798
|
+
ZodDiscriminatedUnion: ve,
|
2799
|
+
ZodIntersection: te,
|
2800
|
+
ZodTuple: E,
|
2801
|
+
ZodRecord: re,
|
2802
|
+
ZodMap: me,
|
2803
|
+
ZodSet: L,
|
2804
|
+
ZodFunction: B,
|
2805
|
+
ZodLazy: se,
|
2806
|
+
ZodLiteral: ne,
|
2807
|
+
ZodEnum: $,
|
2808
|
+
ZodNativeEnum: ae,
|
2809
|
+
ZodPromise: Y,
|
2810
|
+
ZodEffects: C,
|
2811
|
+
ZodTransformer: C,
|
2812
|
+
ZodOptional: N,
|
2813
|
+
ZodNullable: P,
|
2814
|
+
ZodDefault: ie,
|
2815
|
+
ZodCatch: oe,
|
2816
|
+
ZodNaN: ye,
|
2817
|
+
BRAND: rt,
|
2818
|
+
ZodBranded: Te,
|
2819
|
+
ZodPipeline: ce,
|
2820
|
+
ZodReadonly: de,
|
2821
|
+
custom: Ae,
|
2822
|
+
Schema: _,
|
2823
|
+
ZodSchema: _,
|
2824
|
+
late: st,
|
2697
2825
|
get ZodFirstPartyTypeKind() {
|
2698
2826
|
return p;
|
2699
2827
|
},
|
2700
|
-
coerce:
|
2701
|
-
any:
|
2702
|
-
array:
|
2703
|
-
bigint:
|
2704
|
-
boolean:
|
2705
|
-
date:
|
2706
|
-
discriminatedUnion:
|
2707
|
-
effect:
|
2708
|
-
enum:
|
2709
|
-
function:
|
2710
|
-
instanceof:
|
2711
|
-
intersection:
|
2712
|
-
lazy:
|
2713
|
-
literal:
|
2714
|
-
map:
|
2715
|
-
nan:
|
2716
|
-
nativeEnum:
|
2717
|
-
never:
|
2718
|
-
null:
|
2719
|
-
nullable:
|
2720
|
-
number:
|
2721
|
-
object:
|
2722
|
-
oboolean:
|
2723
|
-
onumber:
|
2724
|
-
optional:
|
2725
|
-
ostring:
|
2726
|
-
pipeline:
|
2727
|
-
preprocess:
|
2728
|
-
promise:
|
2729
|
-
record:
|
2730
|
-
set:
|
2731
|
-
strictObject:
|
2732
|
-
string:
|
2733
|
-
symbol:
|
2734
|
-
transformer:
|
2735
|
-
tuple:
|
2736
|
-
undefined:
|
2737
|
-
union:
|
2738
|
-
unknown:
|
2739
|
-
void:
|
2740
|
-
NEVER:
|
2741
|
-
ZodIssueCode:
|
2742
|
-
quotelessJson:
|
2743
|
-
ZodError:
|
2828
|
+
coerce: Vt,
|
2829
|
+
any: lt,
|
2830
|
+
array: mt,
|
2831
|
+
bigint: it,
|
2832
|
+
boolean: Pe,
|
2833
|
+
date: ot,
|
2834
|
+
discriminatedUnion: gt,
|
2835
|
+
effect: Ce,
|
2836
|
+
enum: Nt,
|
2837
|
+
function: Zt,
|
2838
|
+
instanceof: nt,
|
2839
|
+
intersection: xt,
|
2840
|
+
lazy: St,
|
2841
|
+
literal: Ct,
|
2842
|
+
map: wt,
|
2843
|
+
nan: at,
|
2844
|
+
nativeEnum: Ot,
|
2845
|
+
never: ht,
|
2846
|
+
null: ut,
|
2847
|
+
nullable: It,
|
2848
|
+
number: $e,
|
2849
|
+
object: yt,
|
2850
|
+
oboolean: Pt,
|
2851
|
+
onumber: $t,
|
2852
|
+
optional: Rt,
|
2853
|
+
ostring: Mt,
|
2854
|
+
pipeline: At,
|
2855
|
+
preprocess: jt,
|
2856
|
+
promise: Et,
|
2857
|
+
record: bt,
|
2858
|
+
set: Tt,
|
2859
|
+
strictObject: vt,
|
2860
|
+
string: Me,
|
2861
|
+
symbol: dt,
|
2862
|
+
transformer: Ce,
|
2863
|
+
tuple: kt,
|
2864
|
+
undefined: ct,
|
2865
|
+
union: _t,
|
2866
|
+
unknown: ft,
|
2867
|
+
void: pt,
|
2868
|
+
NEVER: Dt,
|
2869
|
+
ZodIssueCode: d,
|
2870
|
+
quotelessJson: Ve,
|
2871
|
+
ZodError: w
|
2744
2872
|
});
|
2745
2873
|
export {
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2874
|
+
rt as BRAND,
|
2875
|
+
U as DIRTY,
|
2876
|
+
Le as EMPTY_PATH,
|
2749
2877
|
m as INVALID,
|
2750
|
-
|
2878
|
+
Dt as NEVER,
|
2751
2879
|
b as OK,
|
2752
2880
|
k as ParseStatus,
|
2753
|
-
|
2754
|
-
|
2881
|
+
_ as Schema,
|
2882
|
+
q as ZodAny,
|
2755
2883
|
S as ZodArray,
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2761
|
-
|
2762
|
-
|
2763
|
-
|
2764
|
-
|
2765
|
-
|
2884
|
+
M as ZodBigInt,
|
2885
|
+
Q as ZodBoolean,
|
2886
|
+
Te as ZodBranded,
|
2887
|
+
oe as ZodCatch,
|
2888
|
+
D as ZodDate,
|
2889
|
+
ie as ZodDefault,
|
2890
|
+
ve as ZodDiscriminatedUnion,
|
2891
|
+
C as ZodEffects,
|
2892
|
+
$ as ZodEnum,
|
2893
|
+
w as ZodError,
|
2766
2894
|
p as ZodFirstPartyTypeKind,
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
|
-
|
2771
|
-
|
2772
|
-
|
2773
|
-
|
2774
|
-
|
2895
|
+
B as ZodFunction,
|
2896
|
+
te as ZodIntersection,
|
2897
|
+
d as ZodIssueCode,
|
2898
|
+
se as ZodLazy,
|
2899
|
+
ne as ZodLiteral,
|
2900
|
+
me as ZodMap,
|
2901
|
+
ye as ZodNaN,
|
2902
|
+
ae as ZodNativeEnum,
|
2775
2903
|
I as ZodNever,
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2904
|
+
F as ZodNull,
|
2905
|
+
P as ZodNullable,
|
2906
|
+
A as ZodNumber,
|
2779
2907
|
x as ZodObject,
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
2791
|
-
|
2792
|
-
|
2793
|
-
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
2908
|
+
N as ZodOptional,
|
2909
|
+
f as ZodParsedType,
|
2910
|
+
ce as ZodPipeline,
|
2911
|
+
Y as ZodPromise,
|
2912
|
+
de as ZodReadonly,
|
2913
|
+
re as ZodRecord,
|
2914
|
+
_ as ZodSchema,
|
2915
|
+
L as ZodSet,
|
2916
|
+
Z as ZodString,
|
2917
|
+
he as ZodSymbol,
|
2918
|
+
C as ZodTransformer,
|
2919
|
+
E as ZodTuple,
|
2920
|
+
_ as ZodType,
|
2921
|
+
K as ZodUndefined,
|
2922
|
+
ee as ZodUnion,
|
2923
|
+
V as ZodUnknown,
|
2924
|
+
pe as ZodVoid,
|
2925
|
+
u as addIssueToContext,
|
2926
|
+
lt as any,
|
2927
|
+
mt as array,
|
2928
|
+
it as bigint,
|
2929
|
+
Pe as boolean,
|
2930
|
+
Vt as coerce,
|
2931
|
+
Ae as custom,
|
2932
|
+
ot as date,
|
2933
|
+
Ie as datetimeRegex,
|
2934
|
+
Lt as default,
|
2806
2935
|
W as defaultErrorMap,
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2936
|
+
gt as discriminatedUnion,
|
2937
|
+
Ce as effect,
|
2938
|
+
Nt as enum,
|
2939
|
+
Zt as function,
|
2940
|
+
ue as getErrorMap,
|
2941
|
+
j as getParsedType,
|
2942
|
+
nt as instanceof,
|
2943
|
+
xt as intersection,
|
2944
|
+
ke as isAborted,
|
2945
|
+
X as isAsync,
|
2946
|
+
be as isDirty,
|
2947
|
+
G as isValid,
|
2948
|
+
st as late,
|
2949
|
+
St as lazy,
|
2950
|
+
Ct as literal,
|
2951
|
+
le as makeIssue,
|
2952
|
+
wt as map,
|
2953
|
+
at as nan,
|
2954
|
+
Ot as nativeEnum,
|
2955
|
+
ht as never,
|
2956
|
+
ut as null,
|
2957
|
+
It as nullable,
|
2958
|
+
$e as number,
|
2959
|
+
yt as object,
|
2960
|
+
xe as objectUtil,
|
2961
|
+
Pt as oboolean,
|
2962
|
+
$t as onumber,
|
2963
|
+
Rt as optional,
|
2964
|
+
Mt as ostring,
|
2965
|
+
At as pipeline,
|
2966
|
+
jt as preprocess,
|
2967
|
+
Et as promise,
|
2968
|
+
Ve as quotelessJson,
|
2969
|
+
bt as record,
|
2970
|
+
Tt as set,
|
2971
|
+
De as setErrorMap,
|
2972
|
+
vt as strictObject,
|
2973
|
+
Me as string,
|
2974
|
+
dt as symbol,
|
2975
|
+
Ce as transformer,
|
2976
|
+
kt as tuple,
|
2977
|
+
ct as undefined,
|
2978
|
+
_t as union,
|
2979
|
+
ft as unknown,
|
2851
2980
|
g as util,
|
2852
|
-
|
2853
|
-
|
2981
|
+
pt as void,
|
2982
|
+
Lt as z
|
2854
2983
|
};
|