fastapi-rtk 2.8.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineObjectInput.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +6 -11
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +3 -5
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/utils/layout.cjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineObjectInput.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +7 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +3 -5
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/utils/layout.mjs +2 -2
- package/dist/.external/cjs/html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.cjs +59 -0
- package/dist/.external/cjs/lodash@4.17.23/lodash/_cloneBuffer.cjs +1 -1
- package/dist/.external/cjs/lodash@4.17.23/lodash/_freeGlobal.cjs +1 -1
- package/dist/.external/cjs/lodash@4.17.23/lodash/_nodeUtil.cjs +1 -1
- package/dist/.external/cjs/lodash@4.17.23/lodash/isBuffer.cjs +1 -1
- package/dist/.external/cjs/lodash@4.17.23/lodash/lodash.cjs +2 -2
- package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/de/index.cjs +1 -1
- package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/en/index.cjs +1 -1
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/I18nextProvider.cjs +3 -3
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Trans.cjs +48 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/TransWithoutContext.cjs +331 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Translation.cjs +15 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/context.cjs +32 -2
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/index.cjs +42 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useSSR.cjs +32 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useTranslation.cjs +9 -9
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/utils.cjs +2 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withSSR.cjs +23 -0
- package/dist/.external/cjs/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withTranslation.cjs +35 -0
- package/dist/.external/cjs/toposort@2.0.2/toposort/index.cjs +1 -1
- package/dist/.external/cjs/void-elements@3.1.0/void-elements/index.cjs +26 -0
- package/dist/.external/cjs/yup@1.7.1/yup/index.esm.cjs +3 -1224
- package/dist/.external/cjs/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/index.cjs +7 -0
- package/dist/.external/esm/html-parse-stringify@3.0.1/html-parse-stringify/dist/html-parse-stringify.module.mjs +60 -0
- package/dist/.external/esm/lodash@4.17.23/lodash/_cloneBuffer.mjs +1 -1
- package/dist/.external/esm/lodash@4.17.23/lodash/_freeGlobal.mjs +1 -1
- package/dist/.external/esm/lodash@4.17.23/lodash/_nodeUtil.mjs +1 -1
- package/dist/.external/esm/lodash@4.17.23/lodash/isBuffer.mjs +1 -1
- package/dist/.external/esm/lodash@4.17.23/lodash/lodash.mjs +2 -2
- package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/de/index.mjs +1 -1
- package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_b9fcaf5fc0698f1949127d6bfb1f154a5bd28d0d1fe_7b4bd73d03bc0c4b3e9706b344be0f5a/mantine-react-table/locales/en/index.mjs +1 -1
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Trans.mjs +49 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/TransWithoutContext.mjs +331 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/Translation.mjs +15 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/context.mjs +32 -1
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/index.mjs +42 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/useSSR.mjs +32 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/utils.mjs +2 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withSSR.mjs +23 -0
- package/dist/.external/esm/react-i18next@15.7.4_i18next@25.8.0_typescript@5.9.3__react-dom@19.2.3_react@19.2.3__react@19.2.3_typescript@5.9.3/react-i18next/dist/es/withTranslation.mjs +35 -0
- package/dist/.external/esm/toposort@2.0.2/toposort/index.mjs +1 -1
- package/dist/.external/esm/void-elements@3.1.0/void-elements/index.mjs +26 -0
- package/dist/.external/esm/yup@1.7.1/yup/index.esm.mjs +4 -1225
- package/dist/.external/esm/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/index.mjs +7 -0
- package/dist/.external/esm/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/react.mjs +5 -5
- package/dist/.external/lib/type-fest/index.d.ts +95 -0
- package/dist/.external/lib/type-fest/source/async-return-type.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/asyncify.d.ts +33 -0
- package/dist/.external/lib/type-fest/source/basic.d.ts +45 -0
- package/dist/.external/lib/type-fest/source/camel-case.d.ts +73 -0
- package/dist/.external/lib/type-fest/source/camel-cased-properties-deep.d.ts +54 -0
- package/dist/.external/lib/type-fest/source/camel-cased-properties.d.ts +36 -0
- package/dist/.external/lib/type-fest/source/conditional-except.d.ts +45 -0
- package/dist/.external/lib/type-fest/source/conditional-keys.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/conditional-pick.d.ts +44 -0
- package/dist/.external/lib/type-fest/source/delimiter-case.d.ts +93 -0
- package/dist/.external/lib/type-fest/source/delimiter-cased-properties-deep.d.ts +60 -0
- package/dist/.external/lib/type-fest/source/delimiter-cased-properties.d.ts +37 -0
- package/dist/.external/lib/type-fest/source/entries.d.ts +62 -0
- package/dist/.external/lib/type-fest/source/entry.d.ts +65 -0
- package/dist/.external/lib/type-fest/source/exact.d.ts +73 -0
- package/dist/.external/lib/type-fest/source/except.d.ts +57 -0
- package/dist/.external/lib/type-fest/source/fixed-length-array.d.ts +43 -0
- package/dist/.external/lib/type-fest/source/get.d.ts +184 -0
- package/dist/.external/lib/type-fest/source/has-optional-keys.d.ts +21 -0
- package/dist/.external/lib/type-fest/source/has-required-keys.d.ts +59 -0
- package/dist/.external/lib/type-fest/source/includes.d.ts +22 -0
- package/dist/.external/lib/type-fest/source/internal.d.ts +59 -0
- package/dist/.external/lib/type-fest/source/invariant-of.d.ts +76 -0
- package/dist/.external/lib/type-fest/source/iterable-element.d.ts +54 -0
- package/dist/.external/lib/type-fest/source/join.d.ts +30 -0
- package/dist/.external/lib/type-fest/source/jsonify.d.ts +90 -0
- package/dist/.external/lib/type-fest/source/kebab-case.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/kebab-cased-properties-deep.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/kebab-cased-properties.d.ts +30 -0
- package/dist/.external/lib/type-fest/source/last-array-element.d.ts +28 -0
- package/dist/.external/lib/type-fest/source/literal-to-primitive.d.ts +36 -0
- package/dist/.external/lib/type-fest/source/literal-union.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/merge-exclusive.d.ts +41 -0
- package/dist/.external/lib/type-fest/source/merge.d.ts +27 -0
- package/dist/.external/lib/type-fest/source/multidimensional-array.d.ts +43 -0
- package/dist/.external/lib/type-fest/source/multidimensional-readonly-array.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/mutable.d.ts +5 -0
- package/dist/.external/lib/type-fest/source/numeric.d.ts +170 -0
- package/dist/.external/lib/type-fest/source/observable-like.d.ts +62 -0
- package/dist/.external/lib/type-fest/source/opaque.d.ts +107 -0
- package/dist/.external/lib/type-fest/source/optional-keys-of.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/package-json.d.ts +663 -0
- package/dist/.external/lib/type-fest/source/partial-deep.d.ts +113 -0
- package/dist/.external/lib/type-fest/source/partial-on-undefined-deep.d.ts +70 -0
- package/dist/.external/lib/type-fest/source/pascal-case.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/pascal-cased-properties-deep.d.ts +54 -0
- package/dist/.external/lib/type-fest/source/pascal-cased-properties.d.ts +34 -0
- package/dist/.external/lib/type-fest/source/primitive.d.ts +13 -0
- package/dist/.external/lib/type-fest/source/promisable.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/promise-value.d.ts +29 -0
- package/dist/.external/lib/type-fest/source/readonly-deep.d.ts +85 -0
- package/dist/.external/lib/type-fest/source/readonly-tuple.d.ts +41 -0
- package/dist/.external/lib/type-fest/source/remove-index-signature.d.ts +104 -0
- package/dist/.external/lib/type-fest/source/replace.d.ts +67 -0
- package/dist/.external/lib/type-fest/source/require-all-or-none.d.ts +36 -0
- package/dist/.external/lib/type-fest/source/require-at-least-one.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/require-exactly-one.d.ts +34 -0
- package/dist/.external/lib/type-fest/source/required-keys-of.d.ts +29 -0
- package/dist/.external/lib/type-fest/source/schema.d.ts +72 -0
- package/dist/.external/lib/type-fest/source/screaming-snake-case.d.ts +33 -0
- package/dist/.external/lib/type-fest/source/set-non-nullable.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/set-optional.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/set-required.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/set-return-type.d.ts +31 -0
- package/dist/.external/lib/type-fest/source/simplify.d.ts +83 -0
- package/dist/.external/lib/type-fest/source/snake-case.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/snake-cased-properties-deep.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/snake-cased-properties.d.ts +30 -0
- package/dist/.external/lib/type-fest/source/split.d.ts +29 -0
- package/dist/.external/lib/type-fest/source/spread.d.ts +85 -0
- package/dist/.external/lib/type-fest/source/string-key-of.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/stringified.d.ts +23 -0
- package/dist/.external/lib/type-fest/source/trim.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/tsconfig-json.d.ts +1172 -0
- package/dist/.external/lib/type-fest/source/typed-array.d.ts +17 -0
- package/dist/.external/lib/type-fest/source/union-to-intersection.d.ts +60 -0
- package/dist/.external/lib/type-fest/source/value-of.d.ts +42 -0
- package/dist/.external/lib/type-fest/source/writable.d.ts +40 -0
- package/dist/api/cjs/ApiProvider/ApiProvider.cjs +80 -0
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideApi.cjs +22 -19
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideBulk.cjs +5 -3
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideForm.cjs +2 -2
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/utils/useApiActions.cjs +15 -15
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/utils/useStreamingData.cjs +1 -1
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/getValidationSchema.cjs +3 -3
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/LangContext.cjs +20 -8
- package/dist/api/cjs/Provider/Provider.cjs +52 -0
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/hooks/useProvideAuth.cjs +17 -15
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/hooks/useProvideInfo.cjs +5 -3
- package/dist/api/cjs/Provider/hooks/useProvideLang.cjs +78 -0
- package/dist/api/cjs/adapters/AdaptersContext.cjs +10 -0
- package/dist/api/cjs/auth/authFetch.cjs +63 -0
- package/dist/api/cjs/auth/userCRUD.cjs +20 -0
- package/dist/api/cjs/fetchers/createItem.cjs +14 -0
- package/dist/api/cjs/fetchers/deleteItem.cjs +14 -0
- package/dist/api/cjs/fetchers/downloadItems.cjs +33 -0
- package/dist/api/cjs/fetchers/formCreateItem.cjs +18 -0
- package/dist/api/cjs/fetchers/formUpdateItem.cjs +18 -0
- package/dist/api/cjs/fetchers/getInfo.cjs +10 -0
- package/dist/api/cjs/fetchers/getItem.cjs +14 -0
- package/dist/api/cjs/fetchers/getItems.cjs +13 -0
- package/dist/api/cjs/fetchers/postBulkAction.cjs +14 -0
- package/dist/api/cjs/fetchers/request.cjs +9 -0
- package/dist/api/cjs/fetchers/updateItem.cjs +14 -0
- package/dist/api/cjs/fetchers/uploadItems.cjs +24 -0
- package/dist/{core → api}/cjs/hooks/auth/useAuth.cjs +1 -1
- package/dist/{core → api}/cjs/hooks/auth/useInfo.cjs +1 -1
- package/dist/api/cjs/hooks/useDidUpdate.cjs +20 -0
- package/dist/api/cjs/index.cjs +77 -0
- package/dist/{utils/cjs → api/cjs/utils}/convertToFormData/convertToFormData.cjs +5 -5
- package/dist/{utils/cjs → api/cjs/utils}/createFetchParams/createFetchParams.cjs +1 -3
- package/dist/api/esm/ApiProvider/ApiProvider.mjs +80 -0
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/useProvideApi.mjs +21 -18
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/useProvideBulk.mjs +5 -3
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/useProvideForm.mjs +2 -2
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/utils/useApiActions.mjs +15 -15
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/utils/useStreamingData.mjs +1 -1
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/getValidationSchema.mjs +3 -4
- package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/LangContext.mjs +22 -10
- package/dist/api/esm/Provider/Provider.mjs +52 -0
- package/dist/{core/esm/Wrappers → api/esm}/Provider/hooks/useProvideAuth.mjs +17 -15
- package/dist/{core/esm/Wrappers → api/esm}/Provider/hooks/useProvideInfo.mjs +5 -3
- package/dist/api/esm/Provider/hooks/useProvideLang.mjs +78 -0
- package/dist/api/esm/adapters/AdaptersContext.mjs +10 -0
- package/dist/api/esm/auth/authFetch.mjs +63 -0
- package/dist/api/esm/auth/userCRUD.mjs +20 -0
- package/dist/api/esm/fetchers/createItem.mjs +14 -0
- package/dist/api/esm/fetchers/deleteItem.mjs +14 -0
- package/dist/api/esm/fetchers/downloadItems.mjs +33 -0
- package/dist/api/esm/fetchers/formCreateItem.mjs +18 -0
- package/dist/api/esm/fetchers/formUpdateItem.mjs +18 -0
- package/dist/api/esm/fetchers/getInfo.mjs +10 -0
- package/dist/api/esm/fetchers/getItem.mjs +14 -0
- package/dist/api/esm/fetchers/getItems.mjs +13 -0
- package/dist/api/esm/fetchers/postBulkAction.mjs +14 -0
- package/dist/api/esm/fetchers/request.mjs +9 -0
- package/dist/api/esm/fetchers/updateItem.mjs +14 -0
- package/dist/api/esm/fetchers/uploadItems.mjs +24 -0
- package/dist/{core → api}/esm/hooks/auth/useAuth.mjs +1 -1
- package/dist/{core → api}/esm/hooks/auth/useInfo.mjs +1 -1
- package/dist/api/esm/hooks/useDidUpdate.mjs +20 -0
- package/dist/api/esm/index.mjs +77 -0
- package/dist/{utils/esm → api/esm/utils}/convertToFormData/convertToFormData.mjs +5 -5
- package/dist/{utils/esm → api/esm/utils}/createFetchParams/createFetchParams.mjs +1 -3
- package/dist/api/lib/ApiProvider/ApiProvider.d.ts +17 -0
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/Contexts/BulkActionsContext.d.ts +1 -1
- package/dist/api/lib/ApiProvider/Contexts/FormContext.d.ts +5 -0
- package/dist/api/lib/ApiProvider/hooks/types.d.ts +150 -0
- package/dist/api/lib/ApiProvider/hooks/useProvideBulk.d.ts +7 -0
- package/dist/api/lib/ApiProvider/hooks/useProvideForm.d.ts +3 -0
- package/dist/api/lib/ApiProvider/hooks/utils/useApiActions.d.ts +11 -0
- package/dist/api/lib/ApiProvider/hooks/utils/useStreamingData.d.ts +193 -0
- package/dist/api/lib/ApiProvider/types.d.ts +51 -0
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getDefaultValues.d.ts +2 -2
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getValidationSchema.d.ts +1 -1
- package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/AuthContext.d.ts +1 -1
- package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/InfoContext.d.ts +1 -1
- package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/types.d.ts +5 -4
- package/dist/api/lib/Provider/Provider.d.ts +14 -0
- package/dist/api/lib/Provider/hooks/types.d.ts +22 -0
- package/dist/api/lib/Provider/hooks/useProvideAuth.d.ts +17 -0
- package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideInfo.d.ts +2 -2
- package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideLang.d.ts +1 -2
- package/dist/api/lib/Provider/types.d.ts +35 -0
- package/dist/api/lib/adapters/AdaptersContext.d.ts +10 -0
- package/dist/api/lib/adapters/types.d.ts +79 -0
- package/dist/{core/lib/Wrappers/Provider/utils → api/lib/auth}/authFetch.d.ts +13 -7
- package/dist/api/lib/auth/types.d.ts +40 -0
- package/dist/api/lib/auth/userCRUD.d.ts +22 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/bulkActions/types.d.ts → api/lib/fetchers/bulkActions.types.d.ts} +3 -3
- package/dist/api/lib/fetchers/createItem.d.ts +4 -0
- package/dist/api/lib/fetchers/deleteItem.d.ts +4 -0
- package/dist/api/lib/fetchers/downloadItems.d.ts +4 -0
- package/dist/api/lib/fetchers/formCreateItem.d.ts +4 -0
- package/dist/api/lib/fetchers/formUpdateItem.d.ts +4 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/api → api/lib/fetchers}/getInfo.d.ts +3 -1
- package/dist/api/lib/fetchers/getItem.d.ts +4 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/api → api/lib/fetchers}/getItems.d.ts +3 -1
- package/dist/api/lib/fetchers/postBulkAction.d.ts +4 -0
- package/dist/api/lib/fetchers/request.d.ts +7 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/api → api/lib/fetchers}/types.d.ts +3 -7
- package/dist/api/lib/fetchers/updateItem.d.ts +4 -0
- package/dist/api/lib/fetchers/uploadItems.d.ts +3 -0
- package/dist/api/lib/fetchers/uploadItems.test.d.ts +1 -0
- package/dist/{core → api}/lib/hooks/auth/types.d.ts +1 -38
- package/dist/api/lib/hooks/auth/useAuth.test.d.ts +1 -0
- package/dist/api/lib/hooks/auth/useInfo.test.d.ts +1 -0
- package/dist/api/lib/hooks/useDidUpdate.d.ts +3 -0
- package/dist/api/lib/index.d.ts +36 -0
- package/dist/api/lib/utils/convertToFormData/convertToFormData.d.ts +17 -0
- package/dist/api/lib/utils/convertToFormData/convertToFormData.test.d.ts +1 -0
- package/dist/{utils/lib → api/lib/utils}/createFetchParams/createFetchParams.d.ts +3 -4
- package/dist/api/lib/utils/createFetchParams/createFetchParams.test.d.ts +1 -0
- package/dist/{utils/lib → api/lib/utils}/parseResponse/parseResponse.d.ts +1 -2
- package/dist/api/lib/utils/parseResponse/parseResponse.test.d.ts +1 -0
- package/dist/constants/cjs/index.cjs +16 -7
- package/dist/constants/esm/index.mjs +16 -7
- package/dist/constants/lib/index.d.ts +1 -6
- package/dist/{jsonforms → contexts}/cjs/_virtual/_commonjsHelpers.cjs +0 -2
- package/dist/contexts/cjs/_virtual/index.cjs +5 -0
- package/dist/contexts/cjs/_virtual/index2.cjs +5 -0
- package/dist/contexts/cjs/_virtual/index3.cjs +6 -0
- package/dist/{constants → contexts}/cjs/_virtual/index4.cjs +2 -2
- package/dist/contexts/cjs/_virtual/index5.cjs +6 -0
- package/dist/contexts/cjs/index.cjs +4 -0
- package/dist/contexts/esm/_virtual/_commonjsHelpers.mjs +6 -0
- package/dist/contexts/esm/_virtual/index.mjs +5 -0
- package/dist/contexts/esm/_virtual/index2.mjs +5 -0
- package/dist/contexts/esm/_virtual/index3.mjs +7 -0
- package/dist/contexts/esm/_virtual/index4.mjs +4 -0
- package/dist/contexts/esm/_virtual/index5.mjs +7 -0
- package/dist/contexts/esm/index.mjs +5 -1
- package/dist/contexts/lib/index.d.ts +2 -0
- package/dist/core/cjs/Dialogs/AddDialog.cjs +2 -2
- package/dist/core/cjs/Dialogs/EditDialog.cjs +3 -4
- package/dist/core/cjs/Menu/UserMenu/UserMenu.cjs +2 -2
- package/dist/core/cjs/Modals/CommonModal.cjs +2 -2
- package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +8 -9
- package/dist/core/cjs/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.cjs +2 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useActions.cjs +5 -5
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/Cell.cjs +4 -4
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter.cjs +4 -4
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.cjs +4 -4
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/useColumns.cjs +5 -5
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useOptimizations.cjs +1 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbar/useToolbar.cjs +9 -9
- package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +8 -74
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +18 -47
- package/dist/core/cjs/_virtual/index.cjs +25 -3
- package/dist/core/cjs/_virtual/index2.cjs +25 -3
- package/dist/core/cjs/_virtual/index3.cjs +3 -5
- package/dist/core/cjs/_virtual/index4.cjs +2 -2
- package/dist/core/cjs/_virtual/index5.cjs +5 -0
- package/dist/core/cjs/_virtual/index6.cjs +3 -0
- package/dist/core/cjs/_virtual/{isBuffer.cjs → index7.cjs} +2 -2
- package/dist/core/cjs/adapters/web/cookieTransport.cjs +15 -0
- package/dist/core/cjs/adapters/web/index.cjs +26 -0
- package/dist/core/cjs/adapters/web/webFileDownloadAdapter.cjs +16 -0
- package/dist/core/cjs/adapters/web/webFormDataAdapter.cjs +8 -0
- package/dist/core/cjs/adapters/web/webLocalizationAdapter.cjs +13 -0
- package/dist/core/cjs/adapters/web/webNetworkAdapter.cjs +6 -0
- package/dist/core/cjs/adapters/web/webOAuthOpener.cjs +26 -0
- package/dist/core/cjs/adapters/web/webStorageAdapter.cjs +21 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideApi.cjs +7 -12
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideBulk.cjs +2 -2
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/downloadItems.cjs +5 -3
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItems.cjs +6 -5
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/authFetch.cjs +19 -15
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/userCRUD.cjs +9 -6
- package/dist/core/cjs/hooks/api/useBulkActions.cjs +2 -5
- package/dist/core/cjs/hooks/api/useForms.cjs +5 -5
- package/dist/core/cjs/index.cjs +91 -9
- package/dist/core/esm/Dialogs/AddDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/EditDialog.mjs +3 -4
- package/dist/core/esm/Menu/UserMenu/UserMenu.mjs +1 -1
- package/dist/core/esm/Modals/CommonModal.mjs +1 -1
- package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +8 -9
- package/dist/core/esm/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.mjs +2 -2
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useActions.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/Cell.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/useColumns.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useOptimizations.mjs +2 -3
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbar/useToolbar.mjs +1 -1
- package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +5 -73
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +15 -46
- package/dist/core/esm/_virtual/index.mjs +25 -3
- package/dist/core/esm/_virtual/index2.mjs +25 -3
- package/dist/core/esm/_virtual/index3.mjs +2 -5
- package/dist/core/esm/_virtual/index4.mjs +2 -2
- package/dist/core/esm/_virtual/index5.mjs +5 -0
- package/dist/core/esm/_virtual/index6.mjs +2 -0
- package/dist/core/esm/_virtual/index7.mjs +4 -0
- package/dist/core/esm/adapters/web/cookieTransport.mjs +15 -0
- package/dist/core/esm/adapters/web/index.mjs +26 -0
- package/dist/core/esm/adapters/web/webFileDownloadAdapter.mjs +16 -0
- package/dist/core/esm/adapters/web/webFormDataAdapter.mjs +8 -0
- package/dist/core/esm/adapters/web/webLocalizationAdapter.mjs +13 -0
- package/dist/core/esm/adapters/web/webNetworkAdapter.mjs +6 -0
- package/dist/core/esm/adapters/web/webOAuthOpener.mjs +26 -0
- package/dist/core/esm/adapters/web/webStorageAdapter.mjs +21 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideApi.mjs +1 -6
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideBulk.mjs +1 -1
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/downloadItems.mjs +5 -3
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItems.mjs +4 -3
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/authFetch.mjs +15 -11
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/userCRUD.mjs +8 -5
- package/dist/core/esm/hooks/api/useBulkActions.mjs +2 -5
- package/dist/core/esm/hooks/api/useForms.mjs +1 -1
- package/dist/core/esm/index.mjs +23 -7
- package/dist/core/lib/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.d.ts +3 -3
- package/dist/core/lib/Tables/NextGenDataGrid/types.d.ts +3 -3
- package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +4 -17
- package/dist/core/lib/Wrappers/ApiProvider/types.d.ts +3 -47
- package/dist/core/lib/Wrappers/Provider/Provider.d.ts +4 -14
- package/dist/core/lib/Wrappers/Provider/types.d.ts +6 -27
- package/dist/core/lib/adapters/web/cookieTransport.d.ts +2 -0
- package/dist/core/lib/adapters/web/index.d.ts +10 -0
- package/dist/core/lib/adapters/web/webAdapters.test.d.ts +1 -0
- package/dist/core/lib/adapters/web/webFileDownloadAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webFormDataAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webLocalizationAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webNetworkAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webOAuthOpener.d.ts +2 -0
- package/dist/core/lib/adapters/web/webStorageAdapter.d.ts +3 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideApi.d.ts +1 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideBulk.d.ts +1 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/downloadItems.d.ts +2 -2
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getItems.d.ts +3 -2
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/authFetch.d.ts +11 -6
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/userCRUD.d.ts +5 -3
- package/dist/core/lib/hooks/api/types.d.ts +1 -59
- package/dist/core/lib/hooks/api/useForms.d.ts +1 -1
- package/dist/core/lib/index.d.ts +7 -8
- package/dist/core/lib/test-helpers/types.d.ts +1 -1
- package/dist/jsonforms/cjs/MantineInputs/MantineObjectInput.cjs +2 -2
- package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +6 -11
- package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +2 -2
- package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +3 -5
- package/dist/jsonforms/cjs/utils/layout.cjs +2 -2
- package/dist/jsonforms/esm/MantineInputs/MantineObjectInput.mjs +2 -2
- package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +7 -12
- package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +2 -2
- package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +3 -5
- package/dist/jsonforms/esm/utils/layout.mjs +2 -2
- package/dist/jsonforms/lib/test-helpers/inputWrap.d.ts +2 -2
- package/dist/react-native-adapters/cjs/asyncStorageAdapter.cjs +8 -0
- package/dist/react-native-adapters/cjs/bearerTransport.cjs +29 -0
- package/dist/react-native-adapters/cjs/createReactNativeAdapters.cjs +24 -0
- package/dist/react-native-adapters/cjs/index.cjs +16 -0
- package/dist/react-native-adapters/cjs/rnFileDownloadAdapter.cjs +24 -0
- package/dist/react-native-adapters/cjs/rnFormDataAdapter.cjs +15 -0
- package/dist/react-native-adapters/cjs/rnNetworkAdapter.cjs +9 -0
- package/dist/react-native-adapters/cjs/rnOAuthOpener.cjs +9 -0
- package/dist/react-native-adapters/esm/asyncStorageAdapter.mjs +8 -0
- package/dist/react-native-adapters/esm/bearerTransport.mjs +29 -0
- package/dist/react-native-adapters/esm/createReactNativeAdapters.mjs +24 -0
- package/dist/react-native-adapters/esm/index.mjs +16 -0
- package/dist/react-native-adapters/esm/rnFileDownloadAdapter.mjs +24 -0
- package/dist/react-native-adapters/esm/rnFormDataAdapter.mjs +15 -0
- package/dist/react-native-adapters/esm/rnNetworkAdapter.mjs +9 -0
- package/dist/react-native-adapters/esm/rnOAuthOpener.mjs +9 -0
- package/dist/react-native-adapters/lib/asyncStorageAdapter.d.ts +7 -0
- package/dist/react-native-adapters/lib/asyncStorageAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/bearerTransport.d.ts +5 -0
- package/dist/react-native-adapters/lib/bearerTransport.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/createReactNativeAdapters.d.ts +11 -0
- package/dist/react-native-adapters/lib/createReactNativeAdapters.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/index.d.ts +8 -0
- package/dist/react-native-adapters/lib/rnFileDownloadAdapter.d.ts +7 -0
- package/dist/react-native-adapters/lib/rnFileDownloadAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/rnFormDataAdapter.d.ts +2 -0
- package/dist/react-native-adapters/lib/rnFormDataAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/rnNetworkAdapter.d.ts +4 -0
- package/dist/react-native-adapters/lib/rnNetworkAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/rnOAuthOpener.d.ts +5 -0
- package/dist/react-native-adapters/lib/rnOAuthOpener.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/types.d.ts +23 -0
- package/dist/utils/cjs/Memoizer/MemoWrapper.cjs +2 -2
- package/dist/utils/cjs/Memoizer/RenderWrapper.cjs +2 -2
- package/dist/utils/cjs/_virtual/_commonjsHelpers.cjs +4 -0
- package/dist/utils/cjs/_virtual/lodash.cjs +6 -3
- package/dist/utils/cjs/index.cjs +4 -6
- package/dist/utils/cjs/randomId/randomId.cjs +4 -0
- package/dist/utils/esm/Memoizer/MemoWrapper.mjs +1 -1
- package/dist/utils/esm/Memoizer/RenderWrapper.mjs +1 -1
- package/dist/utils/esm/_virtual/_commonjsHelpers.mjs +5 -1
- package/dist/utils/esm/_virtual/lodash.mjs +3 -0
- package/dist/utils/esm/index.mjs +4 -6
- package/dist/utils/esm/randomId/randomId.mjs +4 -0
- package/dist/utils/lib/index.d.ts +3 -3
- package/dist/utils/lib/randomId/index.d.ts +1 -0
- package/dist/utils/lib/randomId/randomId.d.ts +2 -0
- package/dist/utils/lib/randomId/randomId.test.d.ts +1 -0
- package/dist/zustand/cjs/index.cjs +2 -0
- package/dist/zustand/esm/index.mjs +3 -1
- package/dist/zustand/lib/index.d.ts +1 -0
- package/package.json +13 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/lodash.cjs +0 -5
- package/dist/.bundled/jsonforms/cjs/_virtual/lodash2.cjs +0 -4
- package/dist/.bundled/jsonforms/cjs/_virtual/map.cjs +0 -6
- package/dist/.bundled/jsonforms/cjs/_virtual/union.cjs +0 -6
- package/dist/.bundled/jsonforms/esm/_virtual/lodash.mjs +0 -5
- package/dist/.bundled/jsonforms/esm/_virtual/lodash2.mjs +0 -4
- package/dist/.bundled/jsonforms/esm/_virtual/map.mjs +0 -7
- package/dist/.bundled/jsonforms/esm/_virtual/union.mjs +0 -7
- package/dist/.external/cjs/lodash@4.17.23/lodash/_arrayIncludesWith.cjs +0 -20
- package/dist/.external/cjs/lodash@4.17.23/lodash/_baseMap.cjs +0 -21
- package/dist/.external/cjs/lodash@4.17.23/lodash/_baseUniq.cjs +0 -59
- package/dist/.external/cjs/lodash@4.17.23/lodash/_createSet.cjs +0 -19
- package/dist/.external/cjs/lodash@4.17.23/lodash/map.cjs +0 -20
- package/dist/.external/cjs/lodash@4.17.23/lodash/union.cjs +0 -19
- package/dist/.external/esm/lodash@4.17.23/lodash/_arrayIncludesWith.mjs +0 -20
- package/dist/.external/esm/lodash@4.17.23/lodash/_baseMap.mjs +0 -21
- package/dist/.external/esm/lodash@4.17.23/lodash/_baseUniq.mjs +0 -59
- package/dist/.external/esm/lodash@4.17.23/lodash/_createSet.mjs +0 -19
- package/dist/.external/esm/lodash@4.17.23/lodash/map.mjs +0 -20
- package/dist/.external/esm/lodash@4.17.23/lodash/union.mjs +0 -19
- package/dist/constants/cjs/_virtual/index.cjs +0 -27
- package/dist/constants/cjs/_virtual/index2.cjs +0 -27
- package/dist/constants/cjs/_virtual/index3.cjs +0 -4
- package/dist/constants/esm/_virtual/index.mjs +0 -27
- package/dist/constants/esm/_virtual/index2.mjs +0 -27
- package/dist/constants/esm/_virtual/index3.mjs +0 -4
- package/dist/constants/esm/_virtual/index4.mjs +0 -4
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/createItem.cjs +0 -14
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/deleteItem.cjs +0 -13
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/downloadItems.cjs +0 -39
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/formCreateItem.cjs +0 -12
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/formUpdateItem.cjs +0 -16
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getInfo.cjs +0 -9
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getItem.cjs +0 -13
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getItems.cjs +0 -9
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/updateItem.cjs +0 -14
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/uploadItems.cjs +0 -26
- package/dist/core/cjs/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.cjs +0 -14
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideLang.cjs +0 -45
- package/dist/core/cjs/Wrappers/Provider/utils/authFetch.cjs +0 -99
- package/dist/core/cjs/Wrappers/Provider/utils/userCRUD.cjs +0 -32
- package/dist/core/cjs/_virtual/_commonjsHelpers.cjs +0 -8
- package/dist/core/cjs/_virtual/_nodeUtil.cjs +0 -4
- package/dist/core/cjs/_virtual/isEqual.cjs +0 -6
- package/dist/core/cjs/_virtual/lodash.cjs +0 -5
- package/dist/core/cjs/_virtual/lodash2.cjs +0 -4
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/createItem.mjs +0 -14
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/deleteItem.mjs +0 -13
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/downloadItems.mjs +0 -39
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/formCreateItem.mjs +0 -12
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/formUpdateItem.mjs +0 -16
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getInfo.mjs +0 -9
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getItem.mjs +0 -13
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getItems.mjs +0 -9
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/updateItem.mjs +0 -14
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/uploadItems.mjs +0 -26
- package/dist/core/esm/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.mjs +0 -14
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideLang.mjs +0 -45
- package/dist/core/esm/Wrappers/Provider/utils/authFetch.mjs +0 -99
- package/dist/core/esm/Wrappers/Provider/utils/userCRUD.mjs +0 -32
- package/dist/core/esm/_virtual/_commonjsHelpers.mjs +0 -8
- package/dist/core/esm/_virtual/_nodeUtil.mjs +0 -4
- package/dist/core/esm/_virtual/isBuffer.mjs +0 -4
- package/dist/core/esm/_virtual/isEqual.mjs +0 -7
- package/dist/core/esm/_virtual/lodash.mjs +0 -5
- package/dist/core/esm/_virtual/lodash2.mjs +0 -4
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/FormContext.d.ts +0 -5
- package/dist/core/lib/Wrappers/ApiProvider/hooks/types.d.ts +0 -90
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideBulk.d.ts +0 -8
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideForm.d.ts +0 -2
- package/dist/core/lib/Wrappers/ApiProvider/hooks/utils/useApiActions.d.ts +0 -11
- package/dist/core/lib/Wrappers/ApiProvider/hooks/utils/useStreamingData.d.ts +0 -193
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/createItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/deleteItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/downloadItems.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/formCreateItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/formUpdateItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/getItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/updateItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/uploadItems.d.ts +0 -2
- package/dist/core/lib/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.d.ts +0 -3
- package/dist/core/lib/Wrappers/Provider/hooks/types.d.ts +0 -24
- package/dist/core/lib/Wrappers/Provider/hooks/useProvideAuth.d.ts +0 -17
- package/dist/core/lib/Wrappers/Provider/utils/userCRUD.d.ts +0 -19
- package/dist/jsonforms/cjs/_virtual/_cloneBuffer.cjs +0 -4
- package/dist/jsonforms/cjs/_virtual/_nodeUtil.cjs +0 -4
- package/dist/jsonforms/cjs/_virtual/isBuffer.cjs +0 -4
- package/dist/jsonforms/cjs/_virtual/isEmpty.cjs +0 -6
- package/dist/jsonforms/cjs/_virtual/lodash.cjs +0 -5
- package/dist/jsonforms/cjs/_virtual/lodash2.cjs +0 -4
- package/dist/jsonforms/cjs/_virtual/map.cjs +0 -6
- package/dist/jsonforms/cjs/_virtual/merge.cjs +0 -6
- package/dist/jsonforms/cjs/_virtual/range.cjs +0 -6
- package/dist/jsonforms/cjs/_virtual/startCase.cjs +0 -6
- package/dist/jsonforms/cjs/_virtual/union.cjs +0 -6
- package/dist/jsonforms/esm/_virtual/_cloneBuffer.mjs +0 -4
- package/dist/jsonforms/esm/_virtual/_commonjsHelpers.mjs +0 -8
- package/dist/jsonforms/esm/_virtual/_nodeUtil.mjs +0 -4
- package/dist/jsonforms/esm/_virtual/isBuffer.mjs +0 -4
- package/dist/jsonforms/esm/_virtual/isEmpty.mjs +0 -7
- package/dist/jsonforms/esm/_virtual/lodash.mjs +0 -5
- package/dist/jsonforms/esm/_virtual/lodash2.mjs +0 -4
- package/dist/jsonforms/esm/_virtual/map.mjs +0 -7
- package/dist/jsonforms/esm/_virtual/merge.mjs +0 -7
- package/dist/jsonforms/esm/_virtual/range.mjs +0 -7
- package/dist/jsonforms/esm/_virtual/startCase.mjs +0 -7
- package/dist/jsonforms/esm/_virtual/union.mjs +0 -7
- package/dist/utils/lib/convertToFormData/convertToFormData.d.ts +0 -15
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/Contexts/BulkActionsContext.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/Contexts/FormContext.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/utils/useLatest.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/convertInfo.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/createQueryParams.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/getDefaultValues.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/AuthContext.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/InfoContext.cjs +0 -0
- /package/dist/{core → api}/cjs/translations/de.cjs +0 -0
- /package/dist/{utils/cjs → api/cjs/utils}/parseResponse/parseResponse.cjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/Contexts/BulkActionsContext.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/Contexts/FormContext.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/utils/useLatest.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/convertInfo.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/createQueryParams.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/getDefaultValues.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/AuthContext.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/InfoContext.mjs +0 -0
- /package/dist/{core → api}/esm/translations/de.mjs +0 -0
- /package/dist/{utils/esm → api/esm/utils}/parseResponse/parseResponse.mjs +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/useProvideApi.test.d.ts → api/lib/ApiProvider/ApiProvider.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/Contexts/ApiContext.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/hooks/useProvideApi.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/useProvideBulk.test.d.ts → api/lib/ApiProvider/hooks/useProvideApi.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/useProvideForm.test.d.ts → api/lib/ApiProvider/hooks/useProvideBulk.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/utils/useApiActions.test.d.ts → api/lib/ApiProvider/hooks/useProvideForm.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/utils/useLatest.test.d.ts → api/lib/ApiProvider/hooks/utils/useApiActions.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/hooks/utils/useLatest.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/utils/useStreamingData.test.d.ts → api/lib/ApiProvider/hooks/utils/useLatest.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/createItem.test.d.ts → api/lib/ApiProvider/hooks/utils/useStreamingData.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/convertInfo.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/convertInfo.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/createQueryParams.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/createQueryParams.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getDefaultValues.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getValidationSchema.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/types.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/LangContext.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/deleteItem.test.d.ts → api/lib/Provider/Provider.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideAuth.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideInfo.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideLang.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/downloadItems.test.d.ts → api/lib/__tests__/purity.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/formCreateItem.test.d.ts → api/lib/__tests__/smoke.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/formUpdateItem.test.d.ts → api/lib/adapters/AdaptersContext.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/Provider/utils → api/lib/auth}/authFetch.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/Provider/utils → api/lib/auth}/userCRUD.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/getInfo.test.d.ts → api/lib/fetchers/createItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/getItem.test.d.ts → api/lib/fetchers/deleteItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/getItems.test.d.ts → api/lib/fetchers/downloadItems.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/updateItem.test.d.ts → api/lib/fetchers/formCreateItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/uploadItems.test.d.ts → api/lib/fetchers/formUpdateItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.test.d.ts → api/lib/fetchers/getInfo.test.d.ts} +0 -0
- /package/dist/{core/lib/hooks/auth/useAuth.test.d.ts → api/lib/fetchers/getItem.test.d.ts} +0 -0
- /package/dist/{core/lib/hooks/auth/useInfo.test.d.ts → api/lib/fetchers/getItems.test.d.ts} +0 -0
- /package/dist/{utils/lib/convertToFormData/convertToFormData.test.d.ts → api/lib/fetchers/postBulkAction.test.d.ts} +0 -0
- /package/dist/{utils/lib/createFetchParams/createFetchParams.test.d.ts → api/lib/fetchers/request.test.d.ts} +0 -0
- /package/dist/{utils/lib/parseResponse/parseResponse.test.d.ts → api/lib/fetchers/updateItem.test.d.ts} +0 -0
- /package/dist/{core → api}/lib/hooks/auth/useAuth.d.ts +0 -0
- /package/dist/{core → api}/lib/hooks/auth/useInfo.d.ts +0 -0
- /package/dist/{core → api}/lib/translations/de.d.ts +0 -0
- /package/dist/{utils/lib → api/lib/utils}/convertToFormData/index.d.ts +0 -0
- /package/dist/{utils/lib → api/lib/utils}/createFetchParams/index.d.ts +0 -0
- /package/dist/{utils/lib → api/lib/utils}/parseResponse/index.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { p as propertyExprExports } from "../../../../core/esm/_virtual/
|
|
2
|
-
import
|
|
3
|
-
import toposort from "../../../../core/esm/_virtual/index3.mjs";
|
|
1
|
+
import { p as propertyExprExports } from "../../../../core/esm/_virtual/index5.mjs";
|
|
2
|
+
import "../../../../core/esm/_virtual/index6.mjs";
|
|
4
3
|
const toString = Object.prototype.toString;
|
|
5
4
|
const errorToString = Error.prototype.toString;
|
|
6
5
|
const regExpToString = RegExp.prototype.toString;
|
|
@@ -184,7 +183,7 @@ let tuple = {
|
|
|
184
183
|
return ValidationError.formatError(mixed.notType, params);
|
|
185
184
|
}
|
|
186
185
|
};
|
|
187
|
-
|
|
186
|
+
Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
188
187
|
mixed,
|
|
189
188
|
string,
|
|
190
189
|
number,
|
|
@@ -234,9 +233,6 @@ const prefixes = {
|
|
|
234
233
|
context: "$",
|
|
235
234
|
value: "."
|
|
236
235
|
};
|
|
237
|
-
function create$9(key, options) {
|
|
238
|
-
return new Reference(key, options);
|
|
239
|
-
}
|
|
240
236
|
class Reference {
|
|
241
237
|
constructor(key, options = {}) {
|
|
242
238
|
this.key = void 0;
|
|
@@ -426,9 +422,6 @@ function getIn(schema, path, value, context = value) {
|
|
|
426
422
|
parentPath: lastPart
|
|
427
423
|
};
|
|
428
424
|
}
|
|
429
|
-
function reach(obj, path, value, context) {
|
|
430
|
-
return getIn(obj, path, value, context).schema;
|
|
431
|
-
}
|
|
432
425
|
class ReferenceSet extends Set {
|
|
433
426
|
describe() {
|
|
434
427
|
const description = [];
|
|
@@ -1143,96 +1136,6 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
1143
1136
|
};
|
|
1144
1137
|
for (const alias of ["equals", "is"]) Schema.prototype[alias] = Schema.prototype.oneOf;
|
|
1145
1138
|
for (const alias of ["not", "nope"]) Schema.prototype[alias] = Schema.prototype.notOneOf;
|
|
1146
|
-
const returnsTrue = () => true;
|
|
1147
|
-
function create$8(spec) {
|
|
1148
|
-
return new MixedSchema(spec);
|
|
1149
|
-
}
|
|
1150
|
-
class MixedSchema extends Schema {
|
|
1151
|
-
constructor(spec) {
|
|
1152
|
-
super(typeof spec === "function" ? {
|
|
1153
|
-
type: "mixed",
|
|
1154
|
-
check: spec
|
|
1155
|
-
} : Object.assign({
|
|
1156
|
-
type: "mixed",
|
|
1157
|
-
check: returnsTrue
|
|
1158
|
-
}, spec));
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
create$8.prototype = MixedSchema.prototype;
|
|
1162
|
-
function create$7() {
|
|
1163
|
-
return new BooleanSchema();
|
|
1164
|
-
}
|
|
1165
|
-
class BooleanSchema extends Schema {
|
|
1166
|
-
constructor() {
|
|
1167
|
-
super({
|
|
1168
|
-
type: "boolean",
|
|
1169
|
-
check(v) {
|
|
1170
|
-
if (v instanceof Boolean) v = v.valueOf();
|
|
1171
|
-
return typeof v === "boolean";
|
|
1172
|
-
}
|
|
1173
|
-
});
|
|
1174
|
-
this.withMutation(() => {
|
|
1175
|
-
this.transform((value, _raw) => {
|
|
1176
|
-
if (this.spec.coerce && !this.isType(value)) {
|
|
1177
|
-
if (/^(true|1)$/i.test(String(value))) return true;
|
|
1178
|
-
if (/^(false|0)$/i.test(String(value))) return false;
|
|
1179
|
-
}
|
|
1180
|
-
return value;
|
|
1181
|
-
});
|
|
1182
|
-
});
|
|
1183
|
-
}
|
|
1184
|
-
isTrue(message = boolean.isValue) {
|
|
1185
|
-
return this.test({
|
|
1186
|
-
message,
|
|
1187
|
-
name: "is-value",
|
|
1188
|
-
exclusive: true,
|
|
1189
|
-
params: {
|
|
1190
|
-
value: "true"
|
|
1191
|
-
},
|
|
1192
|
-
test(value) {
|
|
1193
|
-
return isAbsent(value) || value === true;
|
|
1194
|
-
}
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1197
|
-
isFalse(message = boolean.isValue) {
|
|
1198
|
-
return this.test({
|
|
1199
|
-
message,
|
|
1200
|
-
name: "is-value",
|
|
1201
|
-
exclusive: true,
|
|
1202
|
-
params: {
|
|
1203
|
-
value: "false"
|
|
1204
|
-
},
|
|
1205
|
-
test(value) {
|
|
1206
|
-
return isAbsent(value) || value === false;
|
|
1207
|
-
}
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
default(def) {
|
|
1211
|
-
return super.default(def);
|
|
1212
|
-
}
|
|
1213
|
-
defined(msg) {
|
|
1214
|
-
return super.defined(msg);
|
|
1215
|
-
}
|
|
1216
|
-
optional() {
|
|
1217
|
-
return super.optional();
|
|
1218
|
-
}
|
|
1219
|
-
required(msg) {
|
|
1220
|
-
return super.required(msg);
|
|
1221
|
-
}
|
|
1222
|
-
notRequired() {
|
|
1223
|
-
return super.notRequired();
|
|
1224
|
-
}
|
|
1225
|
-
nullable() {
|
|
1226
|
-
return super.nullable();
|
|
1227
|
-
}
|
|
1228
|
-
nonNullable(msg) {
|
|
1229
|
-
return super.nonNullable(msg);
|
|
1230
|
-
}
|
|
1231
|
-
strip(v) {
|
|
1232
|
-
return super.strip(v);
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
create$7.prototype = BooleanSchema.prototype;
|
|
1236
1139
|
const isoReg = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
|
|
1237
1140
|
function parseIsoDate(date2) {
|
|
1238
1141
|
const struct = parseDateStruct(date2);
|
|
@@ -1272,338 +1175,8 @@ function parseDateStruct(date2) {
|
|
|
1272
1175
|
function toNumber(str, defaultValue = 0) {
|
|
1273
1176
|
return Number(str) || defaultValue;
|
|
1274
1177
|
}
|
|
1275
|
-
let rEmail = (
|
|
1276
|
-
// eslint-disable-next-line
|
|
1277
|
-
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
|
|
1278
|
-
);
|
|
1279
|
-
let rUrl = (
|
|
1280
|
-
// eslint-disable-next-line
|
|
1281
|
-
/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
|
|
1282
|
-
);
|
|
1283
|
-
let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
1284
|
-
let yearMonthDay = "^\\d{4}-\\d{2}-\\d{2}";
|
|
1285
|
-
let hourMinuteSecond = "\\d{2}:\\d{2}:\\d{2}";
|
|
1286
|
-
let zOrOffset = "(([+-]\\d{2}(:?\\d{2})?)|Z)";
|
|
1287
|
-
let rIsoDateTime = new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`);
|
|
1288
|
-
let isTrimmed = (value) => isAbsent(value) || value === value.trim();
|
|
1289
|
-
let objStringTag = {}.toString();
|
|
1290
|
-
function create$6() {
|
|
1291
|
-
return new StringSchema();
|
|
1292
|
-
}
|
|
1293
|
-
class StringSchema extends Schema {
|
|
1294
|
-
constructor() {
|
|
1295
|
-
super({
|
|
1296
|
-
type: "string",
|
|
1297
|
-
check(value) {
|
|
1298
|
-
if (value instanceof String) value = value.valueOf();
|
|
1299
|
-
return typeof value === "string";
|
|
1300
|
-
}
|
|
1301
|
-
});
|
|
1302
|
-
this.withMutation(() => {
|
|
1303
|
-
this.transform((value, _raw) => {
|
|
1304
|
-
if (!this.spec.coerce || this.isType(value)) return value;
|
|
1305
|
-
if (Array.isArray(value)) return value;
|
|
1306
|
-
const strValue = value != null && value.toString ? value.toString() : value;
|
|
1307
|
-
if (strValue === objStringTag) return value;
|
|
1308
|
-
return strValue;
|
|
1309
|
-
});
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
required(message) {
|
|
1313
|
-
return super.required(message).withMutation((schema) => schema.test({
|
|
1314
|
-
message: message || mixed.required,
|
|
1315
|
-
name: "required",
|
|
1316
|
-
skipAbsent: true,
|
|
1317
|
-
test: (value) => !!value.length
|
|
1318
|
-
}));
|
|
1319
|
-
}
|
|
1320
|
-
notRequired() {
|
|
1321
|
-
return super.notRequired().withMutation((schema) => {
|
|
1322
|
-
schema.tests = schema.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
1323
|
-
return schema;
|
|
1324
|
-
});
|
|
1325
|
-
}
|
|
1326
|
-
length(length, message = string.length) {
|
|
1327
|
-
return this.test({
|
|
1328
|
-
message,
|
|
1329
|
-
name: "length",
|
|
1330
|
-
exclusive: true,
|
|
1331
|
-
params: {
|
|
1332
|
-
length
|
|
1333
|
-
},
|
|
1334
|
-
skipAbsent: true,
|
|
1335
|
-
test(value) {
|
|
1336
|
-
return value.length === this.resolve(length);
|
|
1337
|
-
}
|
|
1338
|
-
});
|
|
1339
|
-
}
|
|
1340
|
-
min(min, message = string.min) {
|
|
1341
|
-
return this.test({
|
|
1342
|
-
message,
|
|
1343
|
-
name: "min",
|
|
1344
|
-
exclusive: true,
|
|
1345
|
-
params: {
|
|
1346
|
-
min
|
|
1347
|
-
},
|
|
1348
|
-
skipAbsent: true,
|
|
1349
|
-
test(value) {
|
|
1350
|
-
return value.length >= this.resolve(min);
|
|
1351
|
-
}
|
|
1352
|
-
});
|
|
1353
|
-
}
|
|
1354
|
-
max(max, message = string.max) {
|
|
1355
|
-
return this.test({
|
|
1356
|
-
name: "max",
|
|
1357
|
-
exclusive: true,
|
|
1358
|
-
message,
|
|
1359
|
-
params: {
|
|
1360
|
-
max
|
|
1361
|
-
},
|
|
1362
|
-
skipAbsent: true,
|
|
1363
|
-
test(value) {
|
|
1364
|
-
return value.length <= this.resolve(max);
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
matches(regex, options) {
|
|
1369
|
-
let excludeEmptyString = false;
|
|
1370
|
-
let message;
|
|
1371
|
-
let name;
|
|
1372
|
-
if (options) {
|
|
1373
|
-
if (typeof options === "object") {
|
|
1374
|
-
({
|
|
1375
|
-
excludeEmptyString = false,
|
|
1376
|
-
message,
|
|
1377
|
-
name
|
|
1378
|
-
} = options);
|
|
1379
|
-
} else {
|
|
1380
|
-
message = options;
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
return this.test({
|
|
1384
|
-
name: name || "matches",
|
|
1385
|
-
message: message || string.matches,
|
|
1386
|
-
params: {
|
|
1387
|
-
regex
|
|
1388
|
-
},
|
|
1389
|
-
skipAbsent: true,
|
|
1390
|
-
test: (value) => value === "" && excludeEmptyString || value.search(regex) !== -1
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
email(message = string.email) {
|
|
1394
|
-
return this.matches(rEmail, {
|
|
1395
|
-
name: "email",
|
|
1396
|
-
message,
|
|
1397
|
-
excludeEmptyString: true
|
|
1398
|
-
});
|
|
1399
|
-
}
|
|
1400
|
-
url(message = string.url) {
|
|
1401
|
-
return this.matches(rUrl, {
|
|
1402
|
-
name: "url",
|
|
1403
|
-
message,
|
|
1404
|
-
excludeEmptyString: true
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
uuid(message = string.uuid) {
|
|
1408
|
-
return this.matches(rUUID, {
|
|
1409
|
-
name: "uuid",
|
|
1410
|
-
message,
|
|
1411
|
-
excludeEmptyString: false
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
datetime(options) {
|
|
1415
|
-
let message = "";
|
|
1416
|
-
let allowOffset;
|
|
1417
|
-
let precision;
|
|
1418
|
-
if (options) {
|
|
1419
|
-
if (typeof options === "object") {
|
|
1420
|
-
({
|
|
1421
|
-
message = "",
|
|
1422
|
-
allowOffset = false,
|
|
1423
|
-
precision = void 0
|
|
1424
|
-
} = options);
|
|
1425
|
-
} else {
|
|
1426
|
-
message = options;
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
return this.matches(rIsoDateTime, {
|
|
1430
|
-
name: "datetime",
|
|
1431
|
-
message: message || string.datetime,
|
|
1432
|
-
excludeEmptyString: true
|
|
1433
|
-
}).test({
|
|
1434
|
-
name: "datetime_offset",
|
|
1435
|
-
message: message || string.datetime_offset,
|
|
1436
|
-
params: {
|
|
1437
|
-
allowOffset
|
|
1438
|
-
},
|
|
1439
|
-
skipAbsent: true,
|
|
1440
|
-
test: (value) => {
|
|
1441
|
-
if (!value || allowOffset) return true;
|
|
1442
|
-
const struct = parseDateStruct(value);
|
|
1443
|
-
if (!struct) return false;
|
|
1444
|
-
return !!struct.z;
|
|
1445
|
-
}
|
|
1446
|
-
}).test({
|
|
1447
|
-
name: "datetime_precision",
|
|
1448
|
-
message: message || string.datetime_precision,
|
|
1449
|
-
params: {
|
|
1450
|
-
precision
|
|
1451
|
-
},
|
|
1452
|
-
skipAbsent: true,
|
|
1453
|
-
test: (value) => {
|
|
1454
|
-
if (!value || precision == void 0) return true;
|
|
1455
|
-
const struct = parseDateStruct(value);
|
|
1456
|
-
if (!struct) return false;
|
|
1457
|
-
return struct.precision === precision;
|
|
1458
|
-
}
|
|
1459
|
-
});
|
|
1460
|
-
}
|
|
1461
|
-
//-- transforms --
|
|
1462
|
-
ensure() {
|
|
1463
|
-
return this.default("").transform((val) => val === null ? "" : val);
|
|
1464
|
-
}
|
|
1465
|
-
trim(message = string.trim) {
|
|
1466
|
-
return this.transform((val) => val != null ? val.trim() : val).test({
|
|
1467
|
-
message,
|
|
1468
|
-
name: "trim",
|
|
1469
|
-
test: isTrimmed
|
|
1470
|
-
});
|
|
1471
|
-
}
|
|
1472
|
-
lowercase(message = string.lowercase) {
|
|
1473
|
-
return this.transform((value) => !isAbsent(value) ? value.toLowerCase() : value).test({
|
|
1474
|
-
message,
|
|
1475
|
-
name: "string_case",
|
|
1476
|
-
exclusive: true,
|
|
1477
|
-
skipAbsent: true,
|
|
1478
|
-
test: (value) => isAbsent(value) || value === value.toLowerCase()
|
|
1479
|
-
});
|
|
1480
|
-
}
|
|
1481
|
-
uppercase(message = string.uppercase) {
|
|
1482
|
-
return this.transform((value) => !isAbsent(value) ? value.toUpperCase() : value).test({
|
|
1483
|
-
message,
|
|
1484
|
-
name: "string_case",
|
|
1485
|
-
exclusive: true,
|
|
1486
|
-
skipAbsent: true,
|
|
1487
|
-
test: (value) => isAbsent(value) || value === value.toUpperCase()
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
create$6.prototype = StringSchema.prototype;
|
|
1492
|
-
let isNaN$1 = (value) => value != +value;
|
|
1493
|
-
function create$5() {
|
|
1494
|
-
return new NumberSchema();
|
|
1495
|
-
}
|
|
1496
|
-
class NumberSchema extends Schema {
|
|
1497
|
-
constructor() {
|
|
1498
|
-
super({
|
|
1499
|
-
type: "number",
|
|
1500
|
-
check(value) {
|
|
1501
|
-
if (value instanceof Number) value = value.valueOf();
|
|
1502
|
-
return typeof value === "number" && !isNaN$1(value);
|
|
1503
|
-
}
|
|
1504
|
-
});
|
|
1505
|
-
this.withMutation(() => {
|
|
1506
|
-
this.transform((value, _raw) => {
|
|
1507
|
-
if (!this.spec.coerce) return value;
|
|
1508
|
-
let parsed = value;
|
|
1509
|
-
if (typeof parsed === "string") {
|
|
1510
|
-
parsed = parsed.replace(/\s/g, "");
|
|
1511
|
-
if (parsed === "") return NaN;
|
|
1512
|
-
parsed = +parsed;
|
|
1513
|
-
}
|
|
1514
|
-
if (this.isType(parsed) || parsed === null) return parsed;
|
|
1515
|
-
return parseFloat(parsed);
|
|
1516
|
-
});
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
min(min, message = number.min) {
|
|
1520
|
-
return this.test({
|
|
1521
|
-
message,
|
|
1522
|
-
name: "min",
|
|
1523
|
-
exclusive: true,
|
|
1524
|
-
params: {
|
|
1525
|
-
min
|
|
1526
|
-
},
|
|
1527
|
-
skipAbsent: true,
|
|
1528
|
-
test(value) {
|
|
1529
|
-
return value >= this.resolve(min);
|
|
1530
|
-
}
|
|
1531
|
-
});
|
|
1532
|
-
}
|
|
1533
|
-
max(max, message = number.max) {
|
|
1534
|
-
return this.test({
|
|
1535
|
-
message,
|
|
1536
|
-
name: "max",
|
|
1537
|
-
exclusive: true,
|
|
1538
|
-
params: {
|
|
1539
|
-
max
|
|
1540
|
-
},
|
|
1541
|
-
skipAbsent: true,
|
|
1542
|
-
test(value) {
|
|
1543
|
-
return value <= this.resolve(max);
|
|
1544
|
-
}
|
|
1545
|
-
});
|
|
1546
|
-
}
|
|
1547
|
-
lessThan(less, message = number.lessThan) {
|
|
1548
|
-
return this.test({
|
|
1549
|
-
message,
|
|
1550
|
-
name: "max",
|
|
1551
|
-
exclusive: true,
|
|
1552
|
-
params: {
|
|
1553
|
-
less
|
|
1554
|
-
},
|
|
1555
|
-
skipAbsent: true,
|
|
1556
|
-
test(value) {
|
|
1557
|
-
return value < this.resolve(less);
|
|
1558
|
-
}
|
|
1559
|
-
});
|
|
1560
|
-
}
|
|
1561
|
-
moreThan(more, message = number.moreThan) {
|
|
1562
|
-
return this.test({
|
|
1563
|
-
message,
|
|
1564
|
-
name: "min",
|
|
1565
|
-
exclusive: true,
|
|
1566
|
-
params: {
|
|
1567
|
-
more
|
|
1568
|
-
},
|
|
1569
|
-
skipAbsent: true,
|
|
1570
|
-
test(value) {
|
|
1571
|
-
return value > this.resolve(more);
|
|
1572
|
-
}
|
|
1573
|
-
});
|
|
1574
|
-
}
|
|
1575
|
-
positive(msg = number.positive) {
|
|
1576
|
-
return this.moreThan(0, msg);
|
|
1577
|
-
}
|
|
1578
|
-
negative(msg = number.negative) {
|
|
1579
|
-
return this.lessThan(0, msg);
|
|
1580
|
-
}
|
|
1581
|
-
integer(message = number.integer) {
|
|
1582
|
-
return this.test({
|
|
1583
|
-
name: "integer",
|
|
1584
|
-
message,
|
|
1585
|
-
skipAbsent: true,
|
|
1586
|
-
test: (val) => Number.isInteger(val)
|
|
1587
|
-
});
|
|
1588
|
-
}
|
|
1589
|
-
truncate() {
|
|
1590
|
-
return this.transform((value) => !isAbsent(value) ? value | 0 : value);
|
|
1591
|
-
}
|
|
1592
|
-
round(method) {
|
|
1593
|
-
var _method;
|
|
1594
|
-
let avail = ["ceil", "floor", "round", "trunc"];
|
|
1595
|
-
method = ((_method = method) == null ? void 0 : _method.toLowerCase()) || "round";
|
|
1596
|
-
if (method === "trunc") return this.truncate();
|
|
1597
|
-
if (avail.indexOf(method.toLowerCase()) === -1) throw new TypeError("Only valid options for round() are: " + avail.join(", "));
|
|
1598
|
-
return this.transform((value) => !isAbsent(value) ? Math[method](value) : value);
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
create$5.prototype = NumberSchema.prototype;
|
|
1602
1178
|
let invalidDate = /* @__PURE__ */ new Date("");
|
|
1603
1179
|
let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]";
|
|
1604
|
-
function create$4() {
|
|
1605
|
-
return new DateSchema();
|
|
1606
|
-
}
|
|
1607
1180
|
class DateSchema extends Schema {
|
|
1608
1181
|
constructor() {
|
|
1609
1182
|
super({
|
|
@@ -1663,805 +1236,11 @@ class DateSchema extends Schema {
|
|
|
1663
1236
|
}
|
|
1664
1237
|
}
|
|
1665
1238
|
DateSchema.INVALID_DATE = invalidDate;
|
|
1666
|
-
create$4.prototype = DateSchema.prototype;
|
|
1667
|
-
create$4.INVALID_DATE = invalidDate;
|
|
1668
|
-
function sortFields(fields, excludedEdges = []) {
|
|
1669
|
-
let edges = [];
|
|
1670
|
-
let nodes = /* @__PURE__ */ new Set();
|
|
1671
|
-
let excludes = new Set(excludedEdges.map(([a, b]) => `${a}-${b}`));
|
|
1672
|
-
function addNode(depPath, key) {
|
|
1673
|
-
let node = propertyExprExports.split(depPath)[0];
|
|
1674
|
-
nodes.add(node);
|
|
1675
|
-
if (!excludes.has(`${key}-${node}`)) edges.push([key, node]);
|
|
1676
|
-
}
|
|
1677
|
-
for (const key of Object.keys(fields)) {
|
|
1678
|
-
let value = fields[key];
|
|
1679
|
-
nodes.add(key);
|
|
1680
|
-
if (Reference.isRef(value) && value.isSibling) addNode(value.path, key);
|
|
1681
|
-
else if (isSchema(value) && "deps" in value) value.deps.forEach((path) => addNode(path, key));
|
|
1682
|
-
}
|
|
1683
|
-
return toposort.array(Array.from(nodes), edges).reverse();
|
|
1684
|
-
}
|
|
1685
|
-
function findIndex(arr, err) {
|
|
1686
|
-
let idx = Infinity;
|
|
1687
|
-
arr.some((key, ii) => {
|
|
1688
|
-
var _err$path;
|
|
1689
|
-
if ((_err$path = err.path) != null && _err$path.includes(key)) {
|
|
1690
|
-
idx = ii;
|
|
1691
|
-
return true;
|
|
1692
|
-
}
|
|
1693
|
-
});
|
|
1694
|
-
return idx;
|
|
1695
|
-
}
|
|
1696
|
-
function sortByKeyOrder(keys) {
|
|
1697
|
-
return (a, b) => {
|
|
1698
|
-
return findIndex(keys, a) - findIndex(keys, b);
|
|
1699
|
-
};
|
|
1700
|
-
}
|
|
1701
|
-
const parseJson = (value, _, schema) => {
|
|
1702
|
-
if (typeof value !== "string") {
|
|
1703
|
-
return value;
|
|
1704
|
-
}
|
|
1705
|
-
let parsed = value;
|
|
1706
|
-
try {
|
|
1707
|
-
parsed = JSON.parse(value);
|
|
1708
|
-
} catch (err) {
|
|
1709
|
-
}
|
|
1710
|
-
return schema.isType(parsed) ? parsed : value;
|
|
1711
|
-
};
|
|
1712
|
-
function deepPartial(schema) {
|
|
1713
|
-
if ("fields" in schema) {
|
|
1714
|
-
const partial = {};
|
|
1715
|
-
for (const [key, fieldSchema] of Object.entries(schema.fields)) {
|
|
1716
|
-
partial[key] = deepPartial(fieldSchema);
|
|
1717
|
-
}
|
|
1718
|
-
return schema.setFields(partial);
|
|
1719
|
-
}
|
|
1720
|
-
if (schema.type === "array") {
|
|
1721
|
-
const nextArray = schema.optional();
|
|
1722
|
-
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
1723
|
-
return nextArray;
|
|
1724
|
-
}
|
|
1725
|
-
if (schema.type === "tuple") {
|
|
1726
|
-
return schema.optional().clone({
|
|
1727
|
-
types: schema.spec.types.map(deepPartial)
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1730
|
-
if ("optional" in schema) {
|
|
1731
|
-
return schema.optional();
|
|
1732
|
-
}
|
|
1733
|
-
return schema;
|
|
1734
|
-
}
|
|
1735
|
-
const deepHas = (obj, p) => {
|
|
1736
|
-
const path = [...propertyExprExports.normalizePath(p)];
|
|
1737
|
-
if (path.length === 1) return path[0] in obj;
|
|
1738
|
-
let last = path.pop();
|
|
1739
|
-
let parent = propertyExprExports.getter(propertyExprExports.join(path), true)(obj);
|
|
1740
|
-
return !!(parent && last in parent);
|
|
1741
|
-
};
|
|
1742
|
-
let isObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]";
|
|
1743
|
-
function unknown(ctx, value) {
|
|
1744
|
-
let known = Object.keys(ctx.fields);
|
|
1745
|
-
return Object.keys(value).filter((key) => known.indexOf(key) === -1);
|
|
1746
|
-
}
|
|
1747
|
-
const defaultSort = sortByKeyOrder([]);
|
|
1748
|
-
function create$3(spec) {
|
|
1749
|
-
return new ObjectSchema(spec);
|
|
1750
|
-
}
|
|
1751
|
-
class ObjectSchema extends Schema {
|
|
1752
|
-
constructor(spec) {
|
|
1753
|
-
super({
|
|
1754
|
-
type: "object",
|
|
1755
|
-
check(value) {
|
|
1756
|
-
return isObject(value) || typeof value === "function";
|
|
1757
|
-
}
|
|
1758
|
-
});
|
|
1759
|
-
this.fields = /* @__PURE__ */ Object.create(null);
|
|
1760
|
-
this._sortErrors = defaultSort;
|
|
1761
|
-
this._nodes = [];
|
|
1762
|
-
this._excludedEdges = [];
|
|
1763
|
-
this.withMutation(() => {
|
|
1764
|
-
if (spec) {
|
|
1765
|
-
this.shape(spec);
|
|
1766
|
-
}
|
|
1767
|
-
});
|
|
1768
|
-
}
|
|
1769
|
-
_cast(_value, options = {}) {
|
|
1770
|
-
var _options$stripUnknown;
|
|
1771
|
-
let value = super._cast(_value, options);
|
|
1772
|
-
if (value === void 0) return this.getDefault(options);
|
|
1773
|
-
if (!this._typeCheck(value)) return value;
|
|
1774
|
-
let fields = this.fields;
|
|
1775
|
-
let strip = (_options$stripUnknown = options.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown;
|
|
1776
|
-
let props = [].concat(this._nodes, Object.keys(value).filter((v) => !this._nodes.includes(v)));
|
|
1777
|
-
let intermediateValue = {};
|
|
1778
|
-
let innerOptions = Object.assign({}, options, {
|
|
1779
|
-
parent: intermediateValue,
|
|
1780
|
-
__validating: options.__validating || false
|
|
1781
|
-
});
|
|
1782
|
-
let isChanged = false;
|
|
1783
|
-
for (const prop of props) {
|
|
1784
|
-
let field = fields[prop];
|
|
1785
|
-
let exists = prop in value;
|
|
1786
|
-
let inputValue = value[prop];
|
|
1787
|
-
if (field) {
|
|
1788
|
-
let fieldValue;
|
|
1789
|
-
innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
|
|
1790
|
-
field = field.resolve({
|
|
1791
|
-
value: inputValue,
|
|
1792
|
-
context: options.context,
|
|
1793
|
-
parent: intermediateValue
|
|
1794
|
-
});
|
|
1795
|
-
let fieldSpec = field instanceof Schema ? field.spec : void 0;
|
|
1796
|
-
let strict = fieldSpec == null ? void 0 : fieldSpec.strict;
|
|
1797
|
-
if (fieldSpec != null && fieldSpec.strip) {
|
|
1798
|
-
isChanged = isChanged || prop in value;
|
|
1799
|
-
continue;
|
|
1800
|
-
}
|
|
1801
|
-
fieldValue = !options.__validating || !strict ? field.cast(inputValue, innerOptions) : inputValue;
|
|
1802
|
-
if (fieldValue !== void 0) {
|
|
1803
|
-
intermediateValue[prop] = fieldValue;
|
|
1804
|
-
}
|
|
1805
|
-
} else if (exists && !strip) {
|
|
1806
|
-
intermediateValue[prop] = inputValue;
|
|
1807
|
-
}
|
|
1808
|
-
if (exists !== prop in intermediateValue || intermediateValue[prop] !== inputValue) {
|
|
1809
|
-
isChanged = true;
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
return isChanged ? intermediateValue : value;
|
|
1813
|
-
}
|
|
1814
|
-
_validate(_value, options = {}, panic, next) {
|
|
1815
|
-
let {
|
|
1816
|
-
from = [],
|
|
1817
|
-
originalValue = _value,
|
|
1818
|
-
recursive = this.spec.recursive
|
|
1819
|
-
} = options;
|
|
1820
|
-
options.from = [{
|
|
1821
|
-
schema: this,
|
|
1822
|
-
value: originalValue
|
|
1823
|
-
}, ...from];
|
|
1824
|
-
options.__validating = true;
|
|
1825
|
-
options.originalValue = originalValue;
|
|
1826
|
-
super._validate(_value, options, panic, (objectErrors, value) => {
|
|
1827
|
-
if (!recursive || !isObject(value)) {
|
|
1828
|
-
next(objectErrors, value);
|
|
1829
|
-
return;
|
|
1830
|
-
}
|
|
1831
|
-
originalValue = originalValue || value;
|
|
1832
|
-
let tests = [];
|
|
1833
|
-
for (let key of this._nodes) {
|
|
1834
|
-
let field = this.fields[key];
|
|
1835
|
-
if (!field || Reference.isRef(field)) {
|
|
1836
|
-
continue;
|
|
1837
|
-
}
|
|
1838
|
-
tests.push(field.asNestedTest({
|
|
1839
|
-
options,
|
|
1840
|
-
key,
|
|
1841
|
-
parent: value,
|
|
1842
|
-
parentPath: options.path,
|
|
1843
|
-
originalParent: originalValue
|
|
1844
|
-
}));
|
|
1845
|
-
}
|
|
1846
|
-
this.runTests({
|
|
1847
|
-
tests,
|
|
1848
|
-
value,
|
|
1849
|
-
originalValue,
|
|
1850
|
-
options
|
|
1851
|
-
}, panic, (fieldErrors) => {
|
|
1852
|
-
next(fieldErrors.sort(this._sortErrors).concat(objectErrors), value);
|
|
1853
|
-
});
|
|
1854
|
-
});
|
|
1855
|
-
}
|
|
1856
|
-
clone(spec) {
|
|
1857
|
-
const next = super.clone(spec);
|
|
1858
|
-
next.fields = Object.assign({}, this.fields);
|
|
1859
|
-
next._nodes = this._nodes;
|
|
1860
|
-
next._excludedEdges = this._excludedEdges;
|
|
1861
|
-
next._sortErrors = this._sortErrors;
|
|
1862
|
-
return next;
|
|
1863
|
-
}
|
|
1864
|
-
concat(schema) {
|
|
1865
|
-
let next = super.concat(schema);
|
|
1866
|
-
let nextFields = next.fields;
|
|
1867
|
-
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
1868
|
-
const target = nextFields[field];
|
|
1869
|
-
nextFields[field] = target === void 0 ? schemaOrRef : target;
|
|
1870
|
-
}
|
|
1871
|
-
return next.withMutation((s) => (
|
|
1872
|
-
// XXX: excludes here is wrong
|
|
1873
|
-
s.setFields(nextFields, [...this._excludedEdges, ...schema._excludedEdges])
|
|
1874
|
-
));
|
|
1875
|
-
}
|
|
1876
|
-
_getDefault(options) {
|
|
1877
|
-
if ("default" in this.spec) {
|
|
1878
|
-
return super._getDefault(options);
|
|
1879
|
-
}
|
|
1880
|
-
if (!this._nodes.length) {
|
|
1881
|
-
return void 0;
|
|
1882
|
-
}
|
|
1883
|
-
let dft = {};
|
|
1884
|
-
this._nodes.forEach((key) => {
|
|
1885
|
-
var _innerOptions;
|
|
1886
|
-
const field = this.fields[key];
|
|
1887
|
-
let innerOptions = options;
|
|
1888
|
-
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
1889
|
-
innerOptions = Object.assign({}, innerOptions, {
|
|
1890
|
-
parent: innerOptions.value,
|
|
1891
|
-
value: innerOptions.value[key]
|
|
1892
|
-
});
|
|
1893
|
-
}
|
|
1894
|
-
dft[key] = field && "getDefault" in field ? field.getDefault(innerOptions) : void 0;
|
|
1895
|
-
});
|
|
1896
|
-
return dft;
|
|
1897
|
-
}
|
|
1898
|
-
setFields(shape, excludedEdges) {
|
|
1899
|
-
let next = this.clone();
|
|
1900
|
-
next.fields = shape;
|
|
1901
|
-
next._nodes = sortFields(shape, excludedEdges);
|
|
1902
|
-
next._sortErrors = sortByKeyOrder(Object.keys(shape));
|
|
1903
|
-
if (excludedEdges) next._excludedEdges = excludedEdges;
|
|
1904
|
-
return next;
|
|
1905
|
-
}
|
|
1906
|
-
shape(additions, excludes = []) {
|
|
1907
|
-
return this.clone().withMutation((next) => {
|
|
1908
|
-
let edges = next._excludedEdges;
|
|
1909
|
-
if (excludes.length) {
|
|
1910
|
-
if (!Array.isArray(excludes[0])) excludes = [excludes];
|
|
1911
|
-
edges = [...next._excludedEdges, ...excludes];
|
|
1912
|
-
}
|
|
1913
|
-
return next.setFields(Object.assign(next.fields, additions), edges);
|
|
1914
|
-
});
|
|
1915
|
-
}
|
|
1916
|
-
partial() {
|
|
1917
|
-
const partial = {};
|
|
1918
|
-
for (const [key, schema] of Object.entries(this.fields)) {
|
|
1919
|
-
partial[key] = "optional" in schema && schema.optional instanceof Function ? schema.optional() : schema;
|
|
1920
|
-
}
|
|
1921
|
-
return this.setFields(partial);
|
|
1922
|
-
}
|
|
1923
|
-
deepPartial() {
|
|
1924
|
-
const next = deepPartial(this);
|
|
1925
|
-
return next;
|
|
1926
|
-
}
|
|
1927
|
-
pick(keys) {
|
|
1928
|
-
const picked = {};
|
|
1929
|
-
for (const key of keys) {
|
|
1930
|
-
if (this.fields[key]) picked[key] = this.fields[key];
|
|
1931
|
-
}
|
|
1932
|
-
return this.setFields(picked, this._excludedEdges.filter(([a, b]) => keys.includes(a) && keys.includes(b)));
|
|
1933
|
-
}
|
|
1934
|
-
omit(keys) {
|
|
1935
|
-
const remaining = [];
|
|
1936
|
-
for (const key of Object.keys(this.fields)) {
|
|
1937
|
-
if (keys.includes(key)) continue;
|
|
1938
|
-
remaining.push(key);
|
|
1939
|
-
}
|
|
1940
|
-
return this.pick(remaining);
|
|
1941
|
-
}
|
|
1942
|
-
from(from, to, alias) {
|
|
1943
|
-
let fromGetter = propertyExprExports.getter(from, true);
|
|
1944
|
-
return this.transform((obj) => {
|
|
1945
|
-
if (!obj) return obj;
|
|
1946
|
-
let newObj = obj;
|
|
1947
|
-
if (deepHas(obj, from)) {
|
|
1948
|
-
newObj = Object.assign({}, obj);
|
|
1949
|
-
if (!alias) delete newObj[from];
|
|
1950
|
-
newObj[to] = fromGetter(obj);
|
|
1951
|
-
}
|
|
1952
|
-
return newObj;
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
/** Parse an input JSON string to an object */
|
|
1956
|
-
json() {
|
|
1957
|
-
return this.transform(parseJson);
|
|
1958
|
-
}
|
|
1959
|
-
/**
|
|
1960
|
-
* Similar to `noUnknown` but only validates that an object is the right shape without stripping the unknown keys
|
|
1961
|
-
*/
|
|
1962
|
-
exact(message) {
|
|
1963
|
-
return this.test({
|
|
1964
|
-
name: "exact",
|
|
1965
|
-
exclusive: true,
|
|
1966
|
-
message: message || object.exact,
|
|
1967
|
-
test(value) {
|
|
1968
|
-
if (value == null) return true;
|
|
1969
|
-
const unknownKeys = unknown(this.schema, value);
|
|
1970
|
-
return unknownKeys.length === 0 || this.createError({
|
|
1971
|
-
params: {
|
|
1972
|
-
properties: unknownKeys.join(", ")
|
|
1973
|
-
}
|
|
1974
|
-
});
|
|
1975
|
-
}
|
|
1976
|
-
});
|
|
1977
|
-
}
|
|
1978
|
-
stripUnknown() {
|
|
1979
|
-
return this.clone({
|
|
1980
|
-
noUnknown: true
|
|
1981
|
-
});
|
|
1982
|
-
}
|
|
1983
|
-
noUnknown(noAllow = true, message = object.noUnknown) {
|
|
1984
|
-
if (typeof noAllow !== "boolean") {
|
|
1985
|
-
message = noAllow;
|
|
1986
|
-
noAllow = true;
|
|
1987
|
-
}
|
|
1988
|
-
let next = this.test({
|
|
1989
|
-
name: "noUnknown",
|
|
1990
|
-
exclusive: true,
|
|
1991
|
-
message,
|
|
1992
|
-
test(value) {
|
|
1993
|
-
if (value == null) return true;
|
|
1994
|
-
const unknownKeys = unknown(this.schema, value);
|
|
1995
|
-
return !noAllow || unknownKeys.length === 0 || this.createError({
|
|
1996
|
-
params: {
|
|
1997
|
-
unknown: unknownKeys.join(", ")
|
|
1998
|
-
}
|
|
1999
|
-
});
|
|
2000
|
-
}
|
|
2001
|
-
});
|
|
2002
|
-
next.spec.noUnknown = noAllow;
|
|
2003
|
-
return next;
|
|
2004
|
-
}
|
|
2005
|
-
unknown(allow = true, message = object.noUnknown) {
|
|
2006
|
-
return this.noUnknown(!allow, message);
|
|
2007
|
-
}
|
|
2008
|
-
transformKeys(fn) {
|
|
2009
|
-
return this.transform((obj) => {
|
|
2010
|
-
if (!obj) return obj;
|
|
2011
|
-
const result = {};
|
|
2012
|
-
for (const key of Object.keys(obj)) result[fn(key)] = obj[key];
|
|
2013
|
-
return result;
|
|
2014
|
-
});
|
|
2015
|
-
}
|
|
2016
|
-
camelCase() {
|
|
2017
|
-
return this.transformKeys(tinyCaseExports.camelCase);
|
|
2018
|
-
}
|
|
2019
|
-
snakeCase() {
|
|
2020
|
-
return this.transformKeys(tinyCaseExports.snakeCase);
|
|
2021
|
-
}
|
|
2022
|
-
constantCase() {
|
|
2023
|
-
return this.transformKeys((key) => tinyCaseExports.snakeCase(key).toUpperCase());
|
|
2024
|
-
}
|
|
2025
|
-
describe(options) {
|
|
2026
|
-
const next = (options ? this.resolve(options) : this).clone();
|
|
2027
|
-
const base = super.describe(options);
|
|
2028
|
-
base.fields = {};
|
|
2029
|
-
for (const [key, value] of Object.entries(next.fields)) {
|
|
2030
|
-
var _innerOptions2;
|
|
2031
|
-
let innerOptions = options;
|
|
2032
|
-
if ((_innerOptions2 = innerOptions) != null && _innerOptions2.value) {
|
|
2033
|
-
innerOptions = Object.assign({}, innerOptions, {
|
|
2034
|
-
parent: innerOptions.value,
|
|
2035
|
-
value: innerOptions.value[key]
|
|
2036
|
-
});
|
|
2037
|
-
}
|
|
2038
|
-
base.fields[key] = value.describe(innerOptions);
|
|
2039
|
-
}
|
|
2040
|
-
return base;
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
create$3.prototype = ObjectSchema.prototype;
|
|
2044
|
-
function create$2(type) {
|
|
2045
|
-
return new ArraySchema(type);
|
|
2046
|
-
}
|
|
2047
|
-
class ArraySchema extends Schema {
|
|
2048
|
-
constructor(type) {
|
|
2049
|
-
super({
|
|
2050
|
-
type: "array",
|
|
2051
|
-
spec: {
|
|
2052
|
-
types: type
|
|
2053
|
-
},
|
|
2054
|
-
check(v) {
|
|
2055
|
-
return Array.isArray(v);
|
|
2056
|
-
}
|
|
2057
|
-
});
|
|
2058
|
-
this.innerType = void 0;
|
|
2059
|
-
this.innerType = type;
|
|
2060
|
-
}
|
|
2061
|
-
_cast(_value, _opts) {
|
|
2062
|
-
const value = super._cast(_value, _opts);
|
|
2063
|
-
if (!this._typeCheck(value) || !this.innerType) {
|
|
2064
|
-
return value;
|
|
2065
|
-
}
|
|
2066
|
-
let isChanged = false;
|
|
2067
|
-
const castArray = value.map((v, idx) => {
|
|
2068
|
-
const castElement = this.innerType.cast(v, Object.assign({}, _opts, {
|
|
2069
|
-
path: `${_opts.path || ""}[${idx}]`,
|
|
2070
|
-
parent: value,
|
|
2071
|
-
originalValue: v,
|
|
2072
|
-
value: v,
|
|
2073
|
-
index: idx
|
|
2074
|
-
}));
|
|
2075
|
-
if (castElement !== v) {
|
|
2076
|
-
isChanged = true;
|
|
2077
|
-
}
|
|
2078
|
-
return castElement;
|
|
2079
|
-
});
|
|
2080
|
-
return isChanged ? castArray : value;
|
|
2081
|
-
}
|
|
2082
|
-
_validate(_value, options = {}, panic, next) {
|
|
2083
|
-
var _options$recursive;
|
|
2084
|
-
let innerType = this.innerType;
|
|
2085
|
-
let recursive = (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive;
|
|
2086
|
-
options.originalValue != null ? options.originalValue : _value;
|
|
2087
|
-
super._validate(_value, options, panic, (arrayErrors, value) => {
|
|
2088
|
-
var _options$originalValu2;
|
|
2089
|
-
if (!recursive || !innerType || !this._typeCheck(value)) {
|
|
2090
|
-
next(arrayErrors, value);
|
|
2091
|
-
return;
|
|
2092
|
-
}
|
|
2093
|
-
let tests = new Array(value.length);
|
|
2094
|
-
for (let index = 0; index < value.length; index++) {
|
|
2095
|
-
var _options$originalValu;
|
|
2096
|
-
tests[index] = innerType.asNestedTest({
|
|
2097
|
-
options,
|
|
2098
|
-
index,
|
|
2099
|
-
parent: value,
|
|
2100
|
-
parentPath: options.path,
|
|
2101
|
-
originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value
|
|
2102
|
-
});
|
|
2103
|
-
}
|
|
2104
|
-
this.runTests({
|
|
2105
|
-
value,
|
|
2106
|
-
tests,
|
|
2107
|
-
originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,
|
|
2108
|
-
options
|
|
2109
|
-
}, panic, (innerTypeErrors) => next(innerTypeErrors.concat(arrayErrors), value));
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
clone(spec) {
|
|
2113
|
-
const next = super.clone(spec);
|
|
2114
|
-
next.innerType = this.innerType;
|
|
2115
|
-
return next;
|
|
2116
|
-
}
|
|
2117
|
-
/** Parse an input JSON string to an object */
|
|
2118
|
-
json() {
|
|
2119
|
-
return this.transform(parseJson);
|
|
2120
|
-
}
|
|
2121
|
-
concat(schema) {
|
|
2122
|
-
let next = super.concat(schema);
|
|
2123
|
-
next.innerType = this.innerType;
|
|
2124
|
-
if (schema.innerType)
|
|
2125
|
-
next.innerType = next.innerType ? (
|
|
2126
|
-
// @ts-expect-error Lazy doesn't have concat and will break
|
|
2127
|
-
next.innerType.concat(schema.innerType)
|
|
2128
|
-
) : schema.innerType;
|
|
2129
|
-
return next;
|
|
2130
|
-
}
|
|
2131
|
-
of(schema) {
|
|
2132
|
-
let next = this.clone();
|
|
2133
|
-
if (!isSchema(schema)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema));
|
|
2134
|
-
next.innerType = schema;
|
|
2135
|
-
next.spec = Object.assign({}, next.spec, {
|
|
2136
|
-
types: schema
|
|
2137
|
-
});
|
|
2138
|
-
return next;
|
|
2139
|
-
}
|
|
2140
|
-
length(length, message = array.length) {
|
|
2141
|
-
return this.test({
|
|
2142
|
-
message,
|
|
2143
|
-
name: "length",
|
|
2144
|
-
exclusive: true,
|
|
2145
|
-
params: {
|
|
2146
|
-
length
|
|
2147
|
-
},
|
|
2148
|
-
skipAbsent: true,
|
|
2149
|
-
test(value) {
|
|
2150
|
-
return value.length === this.resolve(length);
|
|
2151
|
-
}
|
|
2152
|
-
});
|
|
2153
|
-
}
|
|
2154
|
-
min(min, message) {
|
|
2155
|
-
message = message || array.min;
|
|
2156
|
-
return this.test({
|
|
2157
|
-
message,
|
|
2158
|
-
name: "min",
|
|
2159
|
-
exclusive: true,
|
|
2160
|
-
params: {
|
|
2161
|
-
min
|
|
2162
|
-
},
|
|
2163
|
-
skipAbsent: true,
|
|
2164
|
-
// FIXME(ts): Array<typeof T>
|
|
2165
|
-
test(value) {
|
|
2166
|
-
return value.length >= this.resolve(min);
|
|
2167
|
-
}
|
|
2168
|
-
});
|
|
2169
|
-
}
|
|
2170
|
-
max(max, message) {
|
|
2171
|
-
message = message || array.max;
|
|
2172
|
-
return this.test({
|
|
2173
|
-
message,
|
|
2174
|
-
name: "max",
|
|
2175
|
-
exclusive: true,
|
|
2176
|
-
params: {
|
|
2177
|
-
max
|
|
2178
|
-
},
|
|
2179
|
-
skipAbsent: true,
|
|
2180
|
-
test(value) {
|
|
2181
|
-
return value.length <= this.resolve(max);
|
|
2182
|
-
}
|
|
2183
|
-
});
|
|
2184
|
-
}
|
|
2185
|
-
ensure() {
|
|
2186
|
-
return this.default(() => []).transform((val, original) => {
|
|
2187
|
-
if (this._typeCheck(val)) return val;
|
|
2188
|
-
return original == null ? [] : [].concat(original);
|
|
2189
|
-
});
|
|
2190
|
-
}
|
|
2191
|
-
compact(rejector) {
|
|
2192
|
-
let reject = !rejector ? (v) => !!v : (v, i, a) => !rejector(v, i, a);
|
|
2193
|
-
return this.transform((values) => values != null ? values.filter(reject) : values);
|
|
2194
|
-
}
|
|
2195
|
-
describe(options) {
|
|
2196
|
-
const next = (options ? this.resolve(options) : this).clone();
|
|
2197
|
-
const base = super.describe(options);
|
|
2198
|
-
if (next.innerType) {
|
|
2199
|
-
var _innerOptions;
|
|
2200
|
-
let innerOptions = options;
|
|
2201
|
-
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
2202
|
-
innerOptions = Object.assign({}, innerOptions, {
|
|
2203
|
-
parent: innerOptions.value,
|
|
2204
|
-
value: innerOptions.value[0]
|
|
2205
|
-
});
|
|
2206
|
-
}
|
|
2207
|
-
base.innerType = next.innerType.describe(innerOptions);
|
|
2208
|
-
}
|
|
2209
|
-
return base;
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
create$2.prototype = ArraySchema.prototype;
|
|
2213
|
-
function create$1(schemas) {
|
|
2214
|
-
return new TupleSchema(schemas);
|
|
2215
|
-
}
|
|
2216
|
-
class TupleSchema extends Schema {
|
|
2217
|
-
constructor(schemas) {
|
|
2218
|
-
super({
|
|
2219
|
-
type: "tuple",
|
|
2220
|
-
spec: {
|
|
2221
|
-
types: schemas
|
|
2222
|
-
},
|
|
2223
|
-
check(v) {
|
|
2224
|
-
const types = this.spec.types;
|
|
2225
|
-
return Array.isArray(v) && v.length === types.length;
|
|
2226
|
-
}
|
|
2227
|
-
});
|
|
2228
|
-
this.withMutation(() => {
|
|
2229
|
-
this.typeError(tuple.notType);
|
|
2230
|
-
});
|
|
2231
|
-
}
|
|
2232
|
-
_cast(inputValue, options) {
|
|
2233
|
-
const {
|
|
2234
|
-
types
|
|
2235
|
-
} = this.spec;
|
|
2236
|
-
const value = super._cast(inputValue, options);
|
|
2237
|
-
if (!this._typeCheck(value)) {
|
|
2238
|
-
return value;
|
|
2239
|
-
}
|
|
2240
|
-
let isChanged = false;
|
|
2241
|
-
const castArray = types.map((type, idx) => {
|
|
2242
|
-
const castElement = type.cast(value[idx], Object.assign({}, options, {
|
|
2243
|
-
path: `${options.path || ""}[${idx}]`,
|
|
2244
|
-
parent: value,
|
|
2245
|
-
originalValue: value[idx],
|
|
2246
|
-
value: value[idx],
|
|
2247
|
-
index: idx
|
|
2248
|
-
}));
|
|
2249
|
-
if (castElement !== value[idx]) isChanged = true;
|
|
2250
|
-
return castElement;
|
|
2251
|
-
});
|
|
2252
|
-
return isChanged ? castArray : value;
|
|
2253
|
-
}
|
|
2254
|
-
_validate(_value, options = {}, panic, next) {
|
|
2255
|
-
let itemTypes = this.spec.types;
|
|
2256
|
-
super._validate(_value, options, panic, (tupleErrors, value) => {
|
|
2257
|
-
var _options$originalValu2;
|
|
2258
|
-
if (!this._typeCheck(value)) {
|
|
2259
|
-
next(tupleErrors, value);
|
|
2260
|
-
return;
|
|
2261
|
-
}
|
|
2262
|
-
let tests = [];
|
|
2263
|
-
for (let [index, itemSchema] of itemTypes.entries()) {
|
|
2264
|
-
var _options$originalValu;
|
|
2265
|
-
tests[index] = itemSchema.asNestedTest({
|
|
2266
|
-
options,
|
|
2267
|
-
index,
|
|
2268
|
-
parent: value,
|
|
2269
|
-
parentPath: options.path,
|
|
2270
|
-
originalParent: (_options$originalValu = options.originalValue) != null ? _options$originalValu : _value
|
|
2271
|
-
});
|
|
2272
|
-
}
|
|
2273
|
-
this.runTests({
|
|
2274
|
-
value,
|
|
2275
|
-
tests,
|
|
2276
|
-
originalValue: (_options$originalValu2 = options.originalValue) != null ? _options$originalValu2 : _value,
|
|
2277
|
-
options
|
|
2278
|
-
}, panic, (innerTypeErrors) => next(innerTypeErrors.concat(tupleErrors), value));
|
|
2279
|
-
});
|
|
2280
|
-
}
|
|
2281
|
-
describe(options) {
|
|
2282
|
-
const next = (options ? this.resolve(options) : this).clone();
|
|
2283
|
-
const base = super.describe(options);
|
|
2284
|
-
base.innerType = next.spec.types.map((schema, index) => {
|
|
2285
|
-
var _innerOptions;
|
|
2286
|
-
let innerOptions = options;
|
|
2287
|
-
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
2288
|
-
innerOptions = Object.assign({}, innerOptions, {
|
|
2289
|
-
parent: innerOptions.value,
|
|
2290
|
-
value: innerOptions.value[index]
|
|
2291
|
-
});
|
|
2292
|
-
}
|
|
2293
|
-
return schema.describe(innerOptions);
|
|
2294
|
-
});
|
|
2295
|
-
return base;
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
create$1.prototype = TupleSchema.prototype;
|
|
2299
|
-
function create(builder) {
|
|
2300
|
-
return new Lazy(builder);
|
|
2301
|
-
}
|
|
2302
|
-
function catchValidationError(fn) {
|
|
2303
|
-
try {
|
|
2304
|
-
return fn();
|
|
2305
|
-
} catch (err) {
|
|
2306
|
-
if (ValidationError.isError(err)) return Promise.reject(err);
|
|
2307
|
-
throw err;
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
class Lazy {
|
|
2311
|
-
constructor(builder) {
|
|
2312
|
-
this.type = "lazy";
|
|
2313
|
-
this.__isYupSchema__ = true;
|
|
2314
|
-
this.spec = void 0;
|
|
2315
|
-
this._resolve = (value, options = {}) => {
|
|
2316
|
-
let schema = this.builder(value, options);
|
|
2317
|
-
if (!isSchema(schema)) throw new TypeError("lazy() functions must return a valid schema");
|
|
2318
|
-
if (this.spec.optional) schema = schema.optional();
|
|
2319
|
-
return schema.resolve(options);
|
|
2320
|
-
};
|
|
2321
|
-
this.builder = builder;
|
|
2322
|
-
this.spec = {
|
|
2323
|
-
meta: void 0,
|
|
2324
|
-
optional: false
|
|
2325
|
-
};
|
|
2326
|
-
}
|
|
2327
|
-
clone(spec) {
|
|
2328
|
-
const next = new Lazy(this.builder);
|
|
2329
|
-
next.spec = Object.assign({}, this.spec, spec);
|
|
2330
|
-
return next;
|
|
2331
|
-
}
|
|
2332
|
-
optionality(optional) {
|
|
2333
|
-
const next = this.clone({
|
|
2334
|
-
optional
|
|
2335
|
-
});
|
|
2336
|
-
return next;
|
|
2337
|
-
}
|
|
2338
|
-
optional() {
|
|
2339
|
-
return this.optionality(true);
|
|
2340
|
-
}
|
|
2341
|
-
resolve(options) {
|
|
2342
|
-
return this._resolve(options.value, options);
|
|
2343
|
-
}
|
|
2344
|
-
cast(value, options) {
|
|
2345
|
-
return this._resolve(value, options).cast(value, options);
|
|
2346
|
-
}
|
|
2347
|
-
asNestedTest(config) {
|
|
2348
|
-
let {
|
|
2349
|
-
key,
|
|
2350
|
-
index,
|
|
2351
|
-
parent,
|
|
2352
|
-
options
|
|
2353
|
-
} = config;
|
|
2354
|
-
let value = parent[index != null ? index : key];
|
|
2355
|
-
return this._resolve(value, Object.assign({}, options, {
|
|
2356
|
-
value,
|
|
2357
|
-
parent
|
|
2358
|
-
})).asNestedTest(config);
|
|
2359
|
-
}
|
|
2360
|
-
validate(value, options) {
|
|
2361
|
-
return catchValidationError(() => this._resolve(value, options).validate(value, options));
|
|
2362
|
-
}
|
|
2363
|
-
validateSync(value, options) {
|
|
2364
|
-
return this._resolve(value, options).validateSync(value, options);
|
|
2365
|
-
}
|
|
2366
|
-
validateAt(path, value, options) {
|
|
2367
|
-
return catchValidationError(() => this._resolve(value, options).validateAt(path, value, options));
|
|
2368
|
-
}
|
|
2369
|
-
validateSyncAt(path, value, options) {
|
|
2370
|
-
return this._resolve(value, options).validateSyncAt(path, value, options);
|
|
2371
|
-
}
|
|
2372
|
-
isValid(value, options) {
|
|
2373
|
-
try {
|
|
2374
|
-
return this._resolve(value, options).isValid(value, options);
|
|
2375
|
-
} catch (err) {
|
|
2376
|
-
if (ValidationError.isError(err)) {
|
|
2377
|
-
return Promise.resolve(false);
|
|
2378
|
-
}
|
|
2379
|
-
throw err;
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
isValidSync(value, options) {
|
|
2383
|
-
return this._resolve(value, options).isValidSync(value, options);
|
|
2384
|
-
}
|
|
2385
|
-
describe(options) {
|
|
2386
|
-
return options ? this.resolve(options).describe(options) : {
|
|
2387
|
-
type: "lazy",
|
|
2388
|
-
meta: this.spec.meta,
|
|
2389
|
-
label: void 0
|
|
2390
|
-
};
|
|
2391
|
-
}
|
|
2392
|
-
meta(...args) {
|
|
2393
|
-
if (args.length === 0) return this.spec.meta;
|
|
2394
|
-
let next = this.clone();
|
|
2395
|
-
next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);
|
|
2396
|
-
return next;
|
|
2397
|
-
}
|
|
2398
|
-
get ["~standard"]() {
|
|
2399
|
-
const schema = this;
|
|
2400
|
-
const standard = {
|
|
2401
|
-
version: 1,
|
|
2402
|
-
vendor: "yup",
|
|
2403
|
-
async validate(value) {
|
|
2404
|
-
try {
|
|
2405
|
-
const result = await schema.validate(value, {
|
|
2406
|
-
abortEarly: false
|
|
2407
|
-
});
|
|
2408
|
-
return {
|
|
2409
|
-
value: result
|
|
2410
|
-
};
|
|
2411
|
-
} catch (err) {
|
|
2412
|
-
if (ValidationError.isError(err)) {
|
|
2413
|
-
return {
|
|
2414
|
-
issues: issuesFromValidationError(err)
|
|
2415
|
-
};
|
|
2416
|
-
}
|
|
2417
|
-
throw err;
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
};
|
|
2421
|
-
return standard;
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
function setLocale(custom) {
|
|
2425
|
-
Object.keys(custom).forEach((type) => {
|
|
2426
|
-
Object.keys(custom[type]).forEach((method) => {
|
|
2427
|
-
locale[type][method] = custom[type][method];
|
|
2428
|
-
});
|
|
2429
|
-
});
|
|
2430
|
-
}
|
|
2431
|
-
function addMethod(schemaType, name, fn) {
|
|
2432
|
-
if (!schemaType || !isSchema(schemaType.prototype)) throw new TypeError("You must provide a yup schema constructor function");
|
|
2433
|
-
if (typeof name !== "string") throw new TypeError("A Method name must be provided");
|
|
2434
|
-
if (typeof fn !== "function") throw new TypeError("Method function must be provided");
|
|
2435
|
-
schemaType.prototype[name] = fn;
|
|
2436
|
-
}
|
|
2437
1239
|
export {
|
|
2438
|
-
ArraySchema,
|
|
2439
|
-
BooleanSchema,
|
|
2440
1240
|
DateSchema,
|
|
2441
|
-
Lazy as LazySchema,
|
|
2442
|
-
MixedSchema,
|
|
2443
|
-
NumberSchema,
|
|
2444
|
-
ObjectSchema,
|
|
2445
1241
|
Schema,
|
|
2446
|
-
StringSchema,
|
|
2447
|
-
TupleSchema,
|
|
2448
1242
|
ValidationError,
|
|
2449
|
-
addMethod,
|
|
2450
|
-
create$2 as array,
|
|
2451
|
-
create$7 as bool,
|
|
2452
|
-
create$7 as boolean,
|
|
2453
|
-
create$4 as date,
|
|
2454
|
-
locale as defaultLocale,
|
|
2455
1243
|
getIn,
|
|
2456
1244
|
isSchema,
|
|
2457
|
-
|
|
2458
|
-
create$8 as mixed,
|
|
2459
|
-
create$5 as number,
|
|
2460
|
-
create$3 as object,
|
|
2461
|
-
printValue,
|
|
2462
|
-
reach,
|
|
2463
|
-
create$9 as ref,
|
|
2464
|
-
setLocale,
|
|
2465
|
-
create$6 as string,
|
|
2466
|
-
create$1 as tuple
|
|
1245
|
+
printValue
|
|
2467
1246
|
};
|