fastapi-rtk 2.8.0 → 2.9.0
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/.external/cjs/yup@1.7.1/yup/index.esm.cjs +1 -435
- package/dist/.external/esm/yup@1.7.1/yup/index.esm.mjs +2 -436
- 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 +26 -25
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideBulk.cjs +5 -3
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideForm.cjs +1 -1
- 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 +2 -2
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/getValidationSchema.cjs +1 -1
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/LangContext.cjs +20 -6
- package/dist/api/cjs/Provider/Provider.cjs +51 -0
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/hooks/useProvideAuth.cjs +18 -17
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/hooks/useProvideInfo.cjs +6 -4
- package/dist/api/cjs/Provider/hooks/useProvideLang.cjs +76 -0
- package/dist/api/cjs/_virtual/_commonjsHelpers.cjs +6 -0
- package/dist/api/cjs/_virtual/index.cjs +5 -0
- package/dist/api/cjs/_virtual/index2.cjs +5 -0
- package/dist/api/cjs/_virtual/index3.cjs +6 -0
- package/dist/api/cjs/_virtual/index4.cjs +4 -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 +75 -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 +19 -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 +1 -1
- 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 +2 -2
- package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/LangContext.mjs +21 -7
- package/dist/api/esm/Provider/Provider.mjs +51 -0
- package/dist/{core/esm/Wrappers → api/esm}/Provider/hooks/useProvideAuth.mjs +16 -15
- package/dist/{core/esm/Wrappers → api/esm}/Provider/hooks/useProvideInfo.mjs +5 -3
- package/dist/api/esm/Provider/hooks/useProvideLang.mjs +76 -0
- package/dist/api/esm/_virtual/_commonjsHelpers.mjs +6 -0
- package/dist/api/esm/_virtual/index.mjs +5 -0
- package/dist/api/esm/_virtual/index2.mjs +5 -0
- package/dist/api/esm/_virtual/index3.mjs +7 -0
- package/dist/api/esm/_virtual/index4.mjs +4 -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 +75 -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 +2 -0
- package/dist/api/lib/ApiProvider/hooks/utils/useApiActions.d.ts +11 -0
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/hooks/utils/useStreamingData.d.ts +26 -26
- 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 +69 -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 +2 -39
- 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 +35 -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 -2
- package/dist/constants/esm/index.mjs +16 -2
- package/dist/core/cjs/Dialogs/AddDialog.cjs +2 -2
- package/dist/core/cjs/Dialogs/EditDialog.cjs +2 -2
- package/dist/core/cjs/Menu/UserMenu/UserMenu.cjs +2 -2
- package/dist/core/cjs/Modals/CommonModal.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/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/adapters/web/cookieTransport.cjs +15 -0
- package/dist/core/cjs/adapters/web/index.cjs +23 -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/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 +83 -6
- package/dist/core/esm/Dialogs/AddDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/EditDialog.mjs +1 -1
- package/dist/core/esm/Menu/UserMenu/UserMenu.mjs +1 -1
- package/dist/core/esm/Modals/CommonModal.mjs +1 -1
- 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/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/adapters/web/cookieTransport.mjs +15 -0
- package/dist/core/esm/adapters/web/index.mjs +23 -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/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 +21 -4
- package/dist/core/lib/Tables/NextGenDataGrid/types.d.ts +1 -1
- 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 +9 -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/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 +5 -6
- package/dist/core/lib/test-helpers/types.d.ts +1 -1
- 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/index.cjs +2 -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/index.mjs +2 -6
- package/dist/utils/esm/randomId/randomId.mjs +4 -0
- package/dist/utils/lib/index.d.ts +1 -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/package.json +11 -1
- 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/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/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/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/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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
|
|
3
|
+
|
|
4
|
+
@category Array
|
|
5
|
+
*/
|
|
6
|
+
export type TypedArray =
|
|
7
|
+
| Int8Array
|
|
8
|
+
| Uint8Array
|
|
9
|
+
| Uint8ClampedArray
|
|
10
|
+
| Int16Array
|
|
11
|
+
| Uint16Array
|
|
12
|
+
| Int32Array
|
|
13
|
+
| Uint32Array
|
|
14
|
+
| Float32Array
|
|
15
|
+
| Float64Array
|
|
16
|
+
| BigInt64Array
|
|
17
|
+
| BigUint64Array;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
3
|
+
|
|
4
|
+
Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```
|
|
8
|
+
import type {UnionToIntersection} from '..';
|
|
9
|
+
|
|
10
|
+
type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};
|
|
11
|
+
|
|
12
|
+
type Intersection = UnionToIntersection<Union>;
|
|
13
|
+
//=> {the(): void; great(arg: string): void; escape: boolean};
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
A more applicable example which could make its way into your library code follows.
|
|
17
|
+
|
|
18
|
+
@example
|
|
19
|
+
```
|
|
20
|
+
import type {UnionToIntersection} from '..';
|
|
21
|
+
|
|
22
|
+
class CommandOne {
|
|
23
|
+
commands: {
|
|
24
|
+
a1: () => undefined,
|
|
25
|
+
b1: () => undefined,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class CommandTwo {
|
|
30
|
+
commands: {
|
|
31
|
+
a2: (argA: string) => undefined,
|
|
32
|
+
b2: (argB: string) => undefined,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
|
|
37
|
+
type Union = typeof union;
|
|
38
|
+
//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
|
|
39
|
+
|
|
40
|
+
type Intersection = UnionToIntersection<Union>;
|
|
41
|
+
//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
@category Type
|
|
45
|
+
*/
|
|
46
|
+
export type UnionToIntersection<Union> = (
|
|
47
|
+
// `extends unknown` is always going to be the case and is used to convert the
|
|
48
|
+
// `Union` into a [distributive conditional
|
|
49
|
+
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
50
|
+
Union extends unknown
|
|
51
|
+
// The union type is used as the only argument to a function since the union
|
|
52
|
+
// of function arguments is an intersection.
|
|
53
|
+
? (distributedUnion: Union) => void
|
|
54
|
+
// This won't happen.
|
|
55
|
+
: never
|
|
56
|
+
// Infer the `Intersection` type since TypeScript represents the positional
|
|
57
|
+
// arguments of unions of functions as an intersection of the union.
|
|
58
|
+
) extends ((mergedIntersection: infer Intersection) => void)
|
|
59
|
+
? Intersection
|
|
60
|
+
: never;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Create a union of the given object's values, and optionally specify which keys to get the values from.
|
|
3
|
+
|
|
4
|
+
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```
|
|
8
|
+
// data.json
|
|
9
|
+
{
|
|
10
|
+
'foo': 1,
|
|
11
|
+
'bar': 2,
|
|
12
|
+
'biz': 3
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// main.ts
|
|
16
|
+
import type {ValueOf} from '..';
|
|
17
|
+
import data = require('./data.json');
|
|
18
|
+
|
|
19
|
+
export function getData(name: string): ValueOf<typeof data> {
|
|
20
|
+
return data[name];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function onlyBar(name: string): ValueOf<typeof data, 'bar'> {
|
|
24
|
+
return data[name];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// file.ts
|
|
28
|
+
import {getData, onlyBar} from './main';
|
|
29
|
+
|
|
30
|
+
getData('foo');
|
|
31
|
+
//=> 1
|
|
32
|
+
|
|
33
|
+
onlyBar('foo');
|
|
34
|
+
//=> TypeError ...
|
|
35
|
+
|
|
36
|
+
onlyBar('bar');
|
|
37
|
+
//=> 2
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
@category Object
|
|
41
|
+
*/
|
|
42
|
+
export type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type {Except} from './except';
|
|
2
|
+
import type {Simplify} from './simplify';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly<T>`.
|
|
6
|
+
|
|
7
|
+
This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are writable.
|
|
8
|
+
|
|
9
|
+
@example
|
|
10
|
+
```
|
|
11
|
+
import type {Writable} from '..';
|
|
12
|
+
|
|
13
|
+
type Foo = {
|
|
14
|
+
readonly a: number;
|
|
15
|
+
readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected.
|
|
16
|
+
readonly c: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const writableFoo: Writable<Foo> = {a: 1, b: ['2'], c: true};
|
|
20
|
+
writableFoo.a = 3;
|
|
21
|
+
writableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type.
|
|
22
|
+
writableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly.
|
|
23
|
+
|
|
24
|
+
type SomeWritable = Writable<Foo, 'b' | 'c'>;
|
|
25
|
+
// type SomeWritable = {
|
|
26
|
+
// readonly a: number;
|
|
27
|
+
// b: readonly string[]; // It's now writable. The type of the property remains unaffected.
|
|
28
|
+
// c: boolean; // It's now writable.
|
|
29
|
+
// }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
@category Object
|
|
33
|
+
*/
|
|
34
|
+
export type Writable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
|
|
35
|
+
Simplify<
|
|
36
|
+
// Pick just the keys that are not writable from the base type.
|
|
37
|
+
Except<BaseType, Keys> &
|
|
38
|
+
// Pick the keys that should be writable from the base type and make them writable by removing the `readonly` modifier from the key.
|
|
39
|
+
{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
|
|
40
|
+
>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const utils = require("fastapi-rtk/utils");
|
|
5
|
+
const zustand = require("fastapi-rtk/zustand");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const useInfo = require("../hooks/auth/useInfo.cjs");
|
|
8
|
+
const contexts = require("fastapi-rtk/contexts");
|
|
9
|
+
const BulkActionsContext = require("./Contexts/BulkActionsContext.cjs");
|
|
10
|
+
const FormContext = require("./Contexts/FormContext.cjs");
|
|
11
|
+
const useProvideApi = require("./hooks/useProvideApi.cjs");
|
|
12
|
+
const useProvideBulk = require("./hooks/useProvideBulk.cjs");
|
|
13
|
+
const useProvideForm = require("./hooks/useProvideForm.cjs");
|
|
14
|
+
function ApiProvider(props) {
|
|
15
|
+
const {
|
|
16
|
+
resource_name = "",
|
|
17
|
+
initialQueryParams,
|
|
18
|
+
relation,
|
|
19
|
+
fetchInfo,
|
|
20
|
+
clearInfoOnRefetch,
|
|
21
|
+
clearDataOnRefetch,
|
|
22
|
+
refetchInfoBasedOnLang,
|
|
23
|
+
refetchDataBasedOnLang,
|
|
24
|
+
resetQueryParamsOnPathChange,
|
|
25
|
+
infoQueryProps,
|
|
26
|
+
dataQueryProps,
|
|
27
|
+
streamingQueryProps,
|
|
28
|
+
streaming,
|
|
29
|
+
apiParams,
|
|
30
|
+
bulkParams,
|
|
31
|
+
children
|
|
32
|
+
} = props;
|
|
33
|
+
const info = useInfo.useInfo();
|
|
34
|
+
const { baseUrl } = info;
|
|
35
|
+
const api = useProvideApi.useProvideApi(
|
|
36
|
+
{
|
|
37
|
+
path: utils.urlJoin(baseUrl, resource_name),
|
|
38
|
+
initialQueryParams,
|
|
39
|
+
relation,
|
|
40
|
+
fetchInfo,
|
|
41
|
+
clearInfoOnRefetch,
|
|
42
|
+
clearDataOnRefetch,
|
|
43
|
+
refetchInfoBasedOnLang,
|
|
44
|
+
refetchDataBasedOnLang,
|
|
45
|
+
resetQueryParamsOnPathChange,
|
|
46
|
+
infoQueryProps,
|
|
47
|
+
dataQueryProps,
|
|
48
|
+
streamingQueryProps,
|
|
49
|
+
streaming
|
|
50
|
+
},
|
|
51
|
+
apiParams
|
|
52
|
+
);
|
|
53
|
+
const apiProxy = zustand.useProxy(api);
|
|
54
|
+
const bulkActions = useProvideBulk.useProvideBulk(apiProxy, bulkParams);
|
|
55
|
+
const bulkActionsProxy = zustand.useProxy(bulkActions);
|
|
56
|
+
const formView = useProvideForm.useProvideForm();
|
|
57
|
+
const [formViewProxy] = React.useState(() => zustand.createProxy(formView));
|
|
58
|
+
const formAdd = useProvideForm.useProvideForm();
|
|
59
|
+
const [formAddProxy] = React.useState(() => zustand.createProxy(formAdd));
|
|
60
|
+
const formEdit = useProvideForm.useProvideForm();
|
|
61
|
+
const [formEditProxy] = React.useState(() => zustand.createProxy(formEdit));
|
|
62
|
+
const formDelete = useProvideForm.useProvideForm();
|
|
63
|
+
const [formDeleteProxy] = React.useState(() => zustand.createProxy(formDelete));
|
|
64
|
+
return /* @__PURE__ */ jsxRuntime.jsx(contexts.ApiContextProvider, { value: apiProxy, children: /* @__PURE__ */ jsxRuntime.jsx(BulkActionsContext.BulkActionsContextProvider, { value: bulkActionsProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextViewProvider, { value: formViewProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextAddProvider, { value: formAddProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextEditProvider, { value: formEditProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextDeleteProvider, { value: formDeleteProxy, children }) }) }) }) }) });
|
|
65
|
+
}
|
|
66
|
+
const withApiProvider = (apiProviderProps, Component, options = {}) => {
|
|
67
|
+
const { displayName, forwardRef: shouldForwardRef = false } = options;
|
|
68
|
+
const renderComponent = (props, ref) => {
|
|
69
|
+
const resolvedProps = utils.parseFromValuesOrFunc(apiProviderProps, props);
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ApiProvider, { ...resolvedProps, children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props, ref }) });
|
|
71
|
+
};
|
|
72
|
+
const WrappedComponent = shouldForwardRef ? (
|
|
73
|
+
// #MUSTANY #MUSTUNKNOWN forwardRef's PropsWithoutRef widening over the generic P is inexpressible; the result is re-typed through unknown to ComponentType<P>
|
|
74
|
+
React.forwardRef(renderComponent)
|
|
75
|
+
) : (props) => renderComponent(props, null);
|
|
76
|
+
WrappedComponent.displayName = displayName || `withApiProvider(${Component.displayName || Component.name || "Component"})`;
|
|
77
|
+
return WrappedComponent;
|
|
78
|
+
};
|
|
79
|
+
exports.ApiProvider = ApiProvider;
|
|
80
|
+
exports.withApiProvider = withApiProvider;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const utils = require("fastapi-rtk/utils");
|
|
5
|
-
const hooks = require("@mantine/hooks");
|
|
6
|
-
const utils$1 = require("../../../../../.external/cjs/@tanstack_query-core@5.90.20/@tanstack/query-core/build/modern/utils.cjs");
|
|
7
|
-
const useQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.90.20_react@19.2.3/@tanstack/react-query/build/modern/useQuery.cjs");
|
|
8
|
-
const useInfiniteQuery = require("../../../../../.external/cjs/@tanstack_react-query@5.90.20_react@19.2.3/@tanstack/react-query/build/modern/useInfiniteQuery.cjs");
|
|
9
4
|
const contexts = require("fastapi-rtk/contexts");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
5
|
+
const utils = require("fastapi-rtk/utils");
|
|
6
|
+
const reactQuery = require("@tanstack/react-query");
|
|
7
|
+
const AdaptersContext = require("../../adapters/AdaptersContext.cjs");
|
|
8
|
+
const createItem = require("../../fetchers/createItem.cjs");
|
|
9
|
+
const deleteItem = require("../../fetchers/deleteItem.cjs");
|
|
10
|
+
const downloadItems = require("../../fetchers/downloadItems.cjs");
|
|
11
|
+
const formCreateItem = require("../../fetchers/formCreateItem.cjs");
|
|
12
|
+
const formUpdateItem = require("../../fetchers/formUpdateItem.cjs");
|
|
13
|
+
const getInfo = require("../../fetchers/getInfo.cjs");
|
|
14
|
+
const getItem = require("../../fetchers/getItem.cjs");
|
|
15
|
+
const getItems = require("../../fetchers/getItems.cjs");
|
|
16
|
+
const updateItem = require("../../fetchers/updateItem.cjs");
|
|
17
|
+
const uploadItems = require("../../fetchers/uploadItems.cjs");
|
|
18
|
+
const useDidUpdate = require("../../hooks/useDidUpdate.cjs");
|
|
20
19
|
const convertInfo = require("../utils/convertInfo.cjs");
|
|
21
20
|
const createQueryParams = require("../utils/createQueryParams.cjs");
|
|
22
21
|
const useApiActions = require("./utils/useApiActions.cjs");
|
|
@@ -59,6 +58,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
59
58
|
streamingQueryProps,
|
|
60
59
|
streaming: streamingMode = false
|
|
61
60
|
} = params;
|
|
61
|
+
const adapters = AdaptersContext.useAdapters();
|
|
62
62
|
const [queryParams, setQueryParams] = React.useState(
|
|
63
63
|
initialQueryParams ? createQueryParams.createQueryParams(null, initialQueryParams) : null
|
|
64
64
|
);
|
|
@@ -112,9 +112,9 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
112
112
|
const [error, setError] = React.useState();
|
|
113
113
|
const resetError = React.useCallback(() => setError(void 0), []);
|
|
114
114
|
const { currentLanguage } = contexts.useLang();
|
|
115
|
-
const infoQuery =
|
|
115
|
+
const infoQuery = reactQuery.useQuery({
|
|
116
116
|
queryKey: [`info`, path, refetchInfoBasedOnLang ? currentLanguage : ""],
|
|
117
|
-
queryFn: ({ signal }) => api.getInfo(utils.urlJoin(path, "_info"), { signal, headers: { "Accept-Language": currentLanguage } }).then((data) => {
|
|
117
|
+
queryFn: ({ signal }) => api.getInfo(adapters, utils.urlJoin(path, "_info"), { signal, headers: { "Accept-Language": currentLanguage } }).then((data) => {
|
|
118
118
|
const converted = convertInfo.convertInfo(data);
|
|
119
119
|
if (!converted) {
|
|
120
120
|
throw new Error("Empty /_info response");
|
|
@@ -122,7 +122,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
122
122
|
return { ...converted, path };
|
|
123
123
|
}),
|
|
124
124
|
// #MUSTASSERT #MUSTANY null clears the placeholder at runtime; react-query's placeholderData type does not include null
|
|
125
|
-
placeholderData: clearInfoOnRefetch ? null :
|
|
125
|
+
placeholderData: clearInfoOnRefetch ? null : reactQuery.keepPreviousData,
|
|
126
126
|
enabled: fetchInfo,
|
|
127
127
|
retry: false,
|
|
128
128
|
refetchOnMount: false,
|
|
@@ -131,14 +131,14 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
131
131
|
...infoQueryProps
|
|
132
132
|
});
|
|
133
133
|
const infoRef = useLatest.useLatest(infoQuery.data);
|
|
134
|
-
const dataQuery =
|
|
134
|
+
const dataQuery = reactQuery.useQuery({
|
|
135
135
|
queryKey: [
|
|
136
136
|
`data`,
|
|
137
137
|
memoizedQueryParamsPathRef.current,
|
|
138
138
|
JSON.stringify(memoizedQueryParams),
|
|
139
139
|
refetchDataBasedOnLang ? currentLanguage : ""
|
|
140
140
|
],
|
|
141
|
-
queryFn: ({ signal }) => memoizedQueryParams ? api.getItems(utils.urlJoin(memoizedQueryParamsPathRef.current, "/"), memoizedQueryParams, {
|
|
141
|
+
queryFn: ({ signal }) => memoizedQueryParams ? api.getItems(adapters, utils.urlJoin(memoizedQueryParamsPathRef.current, "/"), memoizedQueryParams, {
|
|
142
142
|
signal,
|
|
143
143
|
headers: { "Accept-Language": currentLanguage }
|
|
144
144
|
}).then(
|
|
@@ -154,7 +154,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
154
154
|
})
|
|
155
155
|
) : null,
|
|
156
156
|
// #MUSTASSERT #MUSTANY null clears the placeholder at runtime; react-query's placeholderData type does not include null
|
|
157
|
-
placeholderData: clearDataOnRefetch ? null :
|
|
157
|
+
placeholderData: clearDataOnRefetch ? null : reactQuery.keepPreviousData,
|
|
158
158
|
retry: false,
|
|
159
159
|
enabled: !streamingMode,
|
|
160
160
|
...dataQueryProps
|
|
@@ -169,7 +169,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
169
169
|
],
|
|
170
170
|
[currentLanguage, refetchDataBasedOnLang, streamingQuerySignature]
|
|
171
171
|
);
|
|
172
|
-
const streamingQuery =
|
|
172
|
+
const streamingQuery = reactQuery.useInfiniteQuery({
|
|
173
173
|
queryKey: streamingQueryKey,
|
|
174
174
|
queryFn: ({ signal, pageParam }) => {
|
|
175
175
|
if (!memoizedQueryParams) {
|
|
@@ -177,7 +177,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
177
177
|
}
|
|
178
178
|
const page = pageParam ?? memoizedQueryParams.page ?? 0;
|
|
179
179
|
const params2 = { ...memoizedQueryParams, page };
|
|
180
|
-
return api.getItems(utils.urlJoin(memoizedQueryParamsPathRef.current, "/"), params2, {
|
|
180
|
+
return api.getItems(adapters, utils.urlJoin(memoizedQueryParamsPathRef.current, "/"), params2, {
|
|
181
181
|
signal,
|
|
182
182
|
headers: { "Accept-Language": currentLanguage }
|
|
183
183
|
}).then(
|
|
@@ -207,7 +207,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
207
207
|
return currentPage + 1;
|
|
208
208
|
},
|
|
209
209
|
// #MUSTASSERT #MUSTANY null clears the placeholder at runtime; react-query's placeholderData type does not include null
|
|
210
|
-
placeholderData: clearDataOnRefetch ? null :
|
|
210
|
+
placeholderData: clearDataOnRefetch ? null : reactQuery.keepPreviousData,
|
|
211
211
|
retry: false,
|
|
212
212
|
enabled: streamingMode && !!memoizedQueryParams,
|
|
213
213
|
...streamingQueryProps
|
|
@@ -229,7 +229,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
229
229
|
}
|
|
230
230
|
resetError();
|
|
231
231
|
}, [activeDataQuery.error, infoQuery.error, resetError]);
|
|
232
|
-
|
|
232
|
+
useDidUpdate.useDidUpdate(() => {
|
|
233
233
|
if (!resetQueryParamsOnPathChange) {
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
@@ -241,6 +241,7 @@ function useProvideApi(params, api = defaultApi) {
|
|
|
241
241
|
}, [path]);
|
|
242
242
|
const { getEntry, addEntry, updateEntry, deleteEntry, download, upload, getItemURL } = useApiActions.useApiActions({
|
|
243
243
|
api,
|
|
244
|
+
adapters,
|
|
244
245
|
path,
|
|
245
246
|
pathRef,
|
|
246
247
|
infoRef,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const AdaptersContext = require("../../adapters/AdaptersContext.cjs");
|
|
5
|
+
const postBulkAction = require("../../fetchers/postBulkAction.cjs");
|
|
5
6
|
const defaultBulk = { postBulk: postBulkAction.postBulk };
|
|
6
7
|
const useProvideBulk = (params, bulk = defaultBulk) => {
|
|
7
8
|
const { path } = params;
|
|
9
|
+
const adapters = AdaptersContext.useAdapters();
|
|
8
10
|
const [selectedIds, setSelectedIds] = React.useState([]);
|
|
9
11
|
const [error, setError] = React.useState();
|
|
10
12
|
const resetError = React.useCallback(() => setError(void 0), []);
|
|
@@ -15,13 +17,13 @@ const useProvideBulk = (params, bulk = defaultBulk) => {
|
|
|
15
17
|
if (data === void 0) {
|
|
16
18
|
data = selectedIds;
|
|
17
19
|
}
|
|
18
|
-
const response = await bulk.postBulk(path, handler, data);
|
|
20
|
+
const response = await bulk.postBulk(adapters, path, handler, data);
|
|
19
21
|
return response;
|
|
20
22
|
} catch (error2) {
|
|
21
23
|
setError({ message: `Could not perform bulk action`, originalError: error2 });
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
|
-
[bulk, path, resetError, selectedIds]
|
|
26
|
+
[adapters, bulk, path, resetError, selectedIds]
|
|
25
27
|
);
|
|
26
28
|
const bulkActions = React.useMemo(() => ({ selectedIds, setSelectedIds }), [selectedIds, setSelectedIds]);
|
|
27
29
|
return { bulkActions, dispatchBulkActions, error, resetError };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const constants = require("fastapi-rtk/constants");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const react = require("
|
|
5
|
+
const react = require("../../../../.external/cjs/zustand@5.0.10_@types_react@19.2.9_react@19.2.3/zustand/esm/react.cjs");
|
|
6
6
|
const useProvideForm = () => {
|
|
7
7
|
const [storeAdd] = React.useState(
|
|
8
8
|
() => react.create((set, get) => ({
|
|
@@ -3,61 +3,61 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const utils = require("fastapi-rtk/utils");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const useApiActions = (params) => {
|
|
6
|
-
const { api, path, pathRef, infoRef, queryParamsRef, currentLanguage } = params;
|
|
6
|
+
const { api, adapters, path, pathRef, infoRef, queryParamsRef, currentLanguage } = params;
|
|
7
7
|
const getEntry = React.useCallback(
|
|
8
8
|
async (id) => (
|
|
9
9
|
// #MUSTASSERT convertId returns a broad union; ids resolve to a string/number at runtime
|
|
10
|
-
api.getItem(pathRef.current, utils.convertId(id), {
|
|
10
|
+
api.getItem(adapters, pathRef.current, utils.convertId(id), {
|
|
11
11
|
headers: { "Accept-Language": currentLanguage }
|
|
12
12
|
})
|
|
13
13
|
),
|
|
14
|
-
[api, currentLanguage, pathRef]
|
|
14
|
+
[adapters, api, currentLanguage, pathRef]
|
|
15
15
|
);
|
|
16
16
|
const addEntry = React.useCallback(
|
|
17
17
|
async (item) => {
|
|
18
18
|
var _a;
|
|
19
19
|
const func = ((_a = infoRef.current) == null ? void 0 : _a.add_type) === "form" ? api.formCreateItem : api.createItem;
|
|
20
|
-
return func(pathRef.current, item, {
|
|
20
|
+
return func(adapters, pathRef.current, item, {
|
|
21
21
|
headers: { "Accept-Language": currentLanguage }
|
|
22
22
|
});
|
|
23
23
|
},
|
|
24
|
-
[api.createItem, api.formCreateItem, currentLanguage, infoRef, pathRef]
|
|
24
|
+
[adapters, api.createItem, api.formCreateItem, currentLanguage, infoRef, pathRef]
|
|
25
25
|
);
|
|
26
26
|
const updateEntry = React.useCallback(
|
|
27
27
|
async (id, item) => {
|
|
28
28
|
var _a;
|
|
29
29
|
const func = ((_a = infoRef.current) == null ? void 0 : _a.edit_type) === "form" ? api.formUpdateItem : api.updateItem;
|
|
30
|
-
return func(pathRef.current, utils.convertId(id), item, {
|
|
30
|
+
return func(adapters, pathRef.current, utils.convertId(id), item, {
|
|
31
31
|
headers: { "Accept-Language": currentLanguage }
|
|
32
32
|
});
|
|
33
33
|
},
|
|
34
|
-
[api.formUpdateItem, api.updateItem, currentLanguage, infoRef, pathRef]
|
|
34
|
+
[adapters, api.formUpdateItem, api.updateItem, currentLanguage, infoRef, pathRef]
|
|
35
35
|
);
|
|
36
36
|
const deleteEntry = React.useCallback(
|
|
37
37
|
async (id) => (
|
|
38
38
|
// #MUSTASSERT convertId returns a broad union; ids resolve to a string/number at runtime
|
|
39
|
-
api.deleteItem(pathRef.current, utils.convertId(id), {
|
|
39
|
+
api.deleteItem(adapters, pathRef.current, utils.convertId(id), {
|
|
40
40
|
headers: { "Accept-Language": currentLanguage }
|
|
41
41
|
})
|
|
42
42
|
),
|
|
43
|
-
[api, currentLanguage, pathRef]
|
|
43
|
+
[adapters, api, currentLanguage, pathRef]
|
|
44
44
|
);
|
|
45
45
|
const download = React.useCallback(
|
|
46
|
-
async (label, { export_mode, delimiter, quotechar } = {}) => api.downloadItems(pathRef.current, queryParamsRef.current ?? void 0, {
|
|
46
|
+
async (label, { export_mode, delimiter, quotechar } = {}) => api.downloadItems(adapters, pathRef.current, queryParamsRef.current ?? void 0, {
|
|
47
47
|
label,
|
|
48
48
|
export_mode,
|
|
49
49
|
delimiter,
|
|
50
50
|
quotechar
|
|
51
51
|
}),
|
|
52
|
-
[api, pathRef, queryParamsRef]
|
|
52
|
+
[adapters, api, pathRef, queryParamsRef]
|
|
53
53
|
);
|
|
54
54
|
const upload = React.useCallback(
|
|
55
|
-
async (file, { delimiter, quotechar } = {}) => api.uploadItems(pathRef.current, file, { delimiter, quotechar }),
|
|
56
|
-
[api, pathRef]
|
|
55
|
+
async (file, { delimiter, quotechar } = {}) => api.uploadItems(adapters, pathRef.current, file, { delimiter, quotechar }),
|
|
56
|
+
[adapters, api, pathRef]
|
|
57
57
|
);
|
|
58
58
|
const getItemURL = React.useCallback(
|
|
59
|
-
(type, item) => typeof item === "string" ? utils.urlJoin(path, `_${type}`, item) :
|
|
60
|
-
[path]
|
|
59
|
+
(type, item) => typeof item === "string" ? utils.urlJoin(path, `_${type}`, item) : adapters.fileDownload.objectUrl(item),
|
|
60
|
+
[adapters, path]
|
|
61
61
|
);
|
|
62
62
|
return {
|
|
63
63
|
getEntry,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const reactQuery = require("@tanstack/react-query");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const useStreamingData = (params) => {
|
|
6
6
|
var _a;
|
|
7
7
|
const { streamingMode, dataQuery, streamingQuery, streamingQueryKey } = params;
|
|
8
|
-
const queryClient =
|
|
8
|
+
const queryClient = reactQuery.useQueryClient();
|
|
9
9
|
const streamingPages = React.useMemo(() => {
|
|
10
10
|
var _a2;
|
|
11
11
|
return ((_a2 = streamingQuery.data) == null ? void 0 : _a2.pages) || [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index_esm = require("
|
|
3
|
+
const index_esm = require("../../../../.external/cjs/yup@1.7.1/yup/index.esm.cjs");
|
|
4
4
|
const getValidationSchema = (columns) => {
|
|
5
5
|
const schema = columns.reduce((schema2, column) => {
|
|
6
6
|
const { name, required } = column;
|
|
@@ -5,13 +5,13 @@ const constants = require("fastapi-rtk/constants");
|
|
|
5
5
|
const contexts = require("fastapi-rtk/contexts");
|
|
6
6
|
const utils = require("fastapi-rtk/utils");
|
|
7
7
|
const zustand = require("fastapi-rtk/zustand");
|
|
8
|
-
const
|
|
9
|
-
const i18next = require("../../../../../.external/cjs/i18next@25.8.0_typescript@5.9.3/i18next/dist/esm/i18next.cjs");
|
|
8
|
+
const i18next = require("../../../../.external/cjs/i18next@25.8.0_typescript@5.9.3/i18next/dist/esm/i18next.cjs");
|
|
10
9
|
const React = require("react");
|
|
11
|
-
const
|
|
10
|
+
const AdaptersContext = require("../../adapters/AdaptersContext.cjs");
|
|
11
|
+
const de = require("../../translations/de.cjs");
|
|
12
12
|
const useProvideLang = require("../hooks/useProvideLang.cjs");
|
|
13
|
-
const I18nextProvider = require("
|
|
14
|
-
const initReactI18next = require("
|
|
13
|
+
const I18nextProvider = require("../../../../.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");
|
|
14
|
+
const initReactI18next = require("../../../../.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/initReactI18next.cjs");
|
|
15
15
|
const getI18n = (props = {}) => {
|
|
16
16
|
var _a, _b, _c, _d;
|
|
17
17
|
const { initProps, callback, translations } = props;
|
|
@@ -62,7 +62,21 @@ const InnerLangContextProvider = (props) => {
|
|
|
62
62
|
const LangContextProvider = (props) => {
|
|
63
63
|
const { children, langProps, props: contextProps } = props;
|
|
64
64
|
const i18nRef = React.useRef((langProps == null ? void 0 : langProps.i18n) ?? getI18n(langProps == null ? void 0 : langProps.getI18nProps));
|
|
65
|
-
const
|
|
65
|
+
const adapters = AdaptersContext.useAdapters();
|
|
66
|
+
const [localStorageLanguage, setLocalStorageLanguage] = React.useState(constants.LANG_LOCAL_STORAGE_PROPS.defaultValue);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
Promise.resolve(adapters.storage.get(constants.LANG_LOCAL_STORAGE_PROPS.key)).then((v) => {
|
|
70
|
+
if (v) {
|
|
71
|
+
setLocalStorageLanguage(v);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return (_b = (_a = adapters.storage).subscribe) == null ? void 0 : _b.call(_a, constants.LANG_LOCAL_STORAGE_PROPS.key, (v) => {
|
|
75
|
+
if (v) {
|
|
76
|
+
setLocalStorageLanguage(v);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}, [adapters.storage]);
|
|
66
80
|
const language = React.useMemo(
|
|
67
81
|
() => utils.parseFromValuesOrFunc(langProps == null ? void 0 : langProps.lang, i18nRef.current) ?? localStorageLanguage,
|
|
68
82
|
[langProps == null ? void 0 : langProps.lang, localStorageLanguage]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const constants = require("fastapi-rtk/constants");
|
|
5
|
+
const utils = require("fastapi-rtk/utils");
|
|
6
|
+
const zustand = require("fastapi-rtk/zustand");
|
|
7
|
+
const reactQuery = require("@tanstack/react-query");
|
|
8
|
+
const React = require("react");
|
|
9
|
+
const AdaptersContext = require("../adapters/AdaptersContext.cjs");
|
|
10
|
+
const AuthContext = require("./Contexts/AuthContext.cjs");
|
|
11
|
+
const InfoContext = require("./Contexts/InfoContext.cjs");
|
|
12
|
+
const LangContext = require("./Contexts/LangContext.cjs");
|
|
13
|
+
const useProvideAuth = require("./hooks/useProvideAuth.cjs");
|
|
14
|
+
const useProvideInfo = require("./hooks/useProvideInfo.cjs");
|
|
15
|
+
function InnerProvider(props) {
|
|
16
|
+
const defaultproviderProps = { baseUrl: "", inheritMantineTheme: false };
|
|
17
|
+
const { baseUrl, authParams, infoParams, authQueryProps, children } = {
|
|
18
|
+
...defaultproviderProps,
|
|
19
|
+
...props
|
|
20
|
+
};
|
|
21
|
+
const auth = useProvideAuth.useProvideAuth(baseUrl, authQueryProps, authParams);
|
|
22
|
+
const authProxy = zustand.useProxy(auth);
|
|
23
|
+
const info = useProvideInfo.useProvideInfo(baseUrl, auth, infoParams);
|
|
24
|
+
const infoProxy = zustand.useProxy(info);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
constants.setDebugMode(props.debug ?? false);
|
|
27
|
+
}, []);
|
|
28
|
+
return (
|
|
29
|
+
// #MUSTASSERT #MUSTUNKNOWN useProvideAuth exposes error as a string and a deprecated oauth_signin alias, diverging from the AuthContextValue shape consumed downstream
|
|
30
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthContext.AuthContextProvider, { value: authProxy, children: /* @__PURE__ */ jsxRuntime.jsx(InfoContext.InfoContextProvider, { value: infoProxy, children: /* @__PURE__ */ jsxRuntime.jsx(LangContext.LangContextProvider, { langProps: props.langProps, children }) }) })
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const Provider = (props) => {
|
|
34
|
+
const [queryClient] = React.useState(() => new reactQuery.QueryClient(props.queryClientProps));
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(AdaptersContext.AdaptersProvider, { value: props.adapters, children: /* @__PURE__ */ jsxRuntime.jsx(InnerProvider, { ...props }) }) });
|
|
36
|
+
};
|
|
37
|
+
const withProvider = (providerProps, Component, options = {}) => {
|
|
38
|
+
const { displayName, forwardRef: shouldForwardRef = false } = options;
|
|
39
|
+
const renderComponent = (props, ref) => {
|
|
40
|
+
const resolvedProps = utils.parseFromValuesOrFunc(providerProps, props);
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Provider, { ...resolvedProps, children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props, ref }) });
|
|
42
|
+
};
|
|
43
|
+
const WrappedComponent = shouldForwardRef ? (
|
|
44
|
+
// #MUSTANY ComponentProps<typeof Component> does not line up with forwardRef's PropsWithoutRef inference; the runtime render fn is correct
|
|
45
|
+
React.forwardRef(renderComponent)
|
|
46
|
+
) : (props) => renderComponent(props, null);
|
|
47
|
+
WrappedComponent.displayName = displayName || `withProvider(${Component.displayName || Component.name || "Component"})`;
|
|
48
|
+
return WrappedComponent;
|
|
49
|
+
};
|
|
50
|
+
exports.Provider = Provider;
|
|
51
|
+
exports.withProvider = withProvider;
|