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
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils = require("fastapi-rtk/utils");
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const api = require("fastapi-rtk/api");
|
|
5
|
+
async function getUser(adapters, baseUrl, signal) {
|
|
6
|
+
const { fetchPath, options } = api.createFetchParams({
|
|
6
7
|
path: utils.urlJoin(baseUrl, "auth/user"),
|
|
7
8
|
method: "GET"
|
|
8
9
|
});
|
|
9
|
-
const
|
|
10
|
+
const decorated = await adapters.authTransport.decorateRequest(options);
|
|
11
|
+
const res = await fetch(fetchPath, { signal, ...decorated });
|
|
10
12
|
const data = await res.json();
|
|
11
13
|
if (!res.ok) {
|
|
12
14
|
const errorMessage = typeof data.message === "string" ? data.message : JSON.stringify(data.message, null, 2);
|
|
@@ -14,13 +16,14 @@ async function getUser(baseUrl, signal) {
|
|
|
14
16
|
}
|
|
15
17
|
return data;
|
|
16
18
|
}
|
|
17
|
-
async function updateUser(baseUrl, userData) {
|
|
18
|
-
const { fetchPath, options } =
|
|
19
|
+
async function updateUser(adapters, baseUrl, userData) {
|
|
20
|
+
const { fetchPath, options } = api.createFetchParams({
|
|
19
21
|
path: utils.urlJoin(baseUrl, "auth/user"),
|
|
20
22
|
method: "PUT",
|
|
21
23
|
body: userData
|
|
22
24
|
});
|
|
23
|
-
const
|
|
25
|
+
const decorated = await adapters.authTransport.decorateRequest(options);
|
|
26
|
+
const res = await fetch(fetchPath, decorated);
|
|
24
27
|
const data = await res.json();
|
|
25
28
|
if (!res.ok) {
|
|
26
29
|
const errorMessage = typeof data.message === "string" ? data.message : JSON.stringify(data.message, null, 2);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const useBulkActions = (options) => (
|
|
5
|
-
// #MUSTASSERT the BulkActionsContext is created from an untyped createSafeContext, so the provider hook returns unknown
|
|
6
|
-
BulkActionsContext.useBulkActionsProvider(options)
|
|
7
|
-
);
|
|
3
|
+
const api = require("fastapi-rtk/api");
|
|
4
|
+
const useBulkActions = (options) => api.useBulkActionsProvider(options);
|
|
8
5
|
exports.useBulkActions = useBulkActions;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const api = require("fastapi-rtk/api");
|
|
4
4
|
function useForms(type, options) {
|
|
5
5
|
switch (type) {
|
|
6
6
|
case "view":
|
|
7
|
-
return
|
|
7
|
+
return api.useFormViewProvider(options);
|
|
8
8
|
case "add":
|
|
9
|
-
return
|
|
9
|
+
return api.useFormAddProvider(options);
|
|
10
10
|
case "edit":
|
|
11
|
-
return
|
|
11
|
+
return api.useFormEditProvider(options);
|
|
12
12
|
case "delete":
|
|
13
|
-
return
|
|
13
|
+
return api.useFormDeleteProvider(options);
|
|
14
14
|
default:
|
|
15
15
|
throw new Error(`useForms: Unknown form type '${type}'. Expected 'view', 'add', 'edit', or 'delete'.`);
|
|
16
16
|
}
|
package/dist/core/cjs/index.cjs
CHANGED
|
@@ -15,8 +15,7 @@ const ViewDialog = require("./Dialogs/ViewDialog.cjs");
|
|
|
15
15
|
const contexts = require("fastapi-rtk/contexts");
|
|
16
16
|
const useBulkActions = require("./hooks/api/useBulkActions.cjs");
|
|
17
17
|
const useForms = require("./hooks/api/useForms.cjs");
|
|
18
|
-
const
|
|
19
|
-
const useInfo = require("./hooks/auth/useInfo.cjs");
|
|
18
|
+
const api = require("fastapi-rtk/api");
|
|
20
19
|
const components = require("fastapi-rtk/components");
|
|
21
20
|
const UserMenu = require("./Menu/UserMenu/UserMenu.cjs");
|
|
22
21
|
const Filter = require("./Tables/DataGrid/Toolbar/Filter/Filter.cjs");
|
|
@@ -31,6 +30,7 @@ const ApiProvider = require("./Wrappers/ApiProvider/ApiProvider.cjs");
|
|
|
31
30
|
const InfiniteScroll = require("./Wrappers/InfiniteScroll/InfiniteScroll.cjs");
|
|
32
31
|
const LazyLoadWrapper = require("./Wrappers/LazyLoadWrapper/LazyLoadWrapper.cjs");
|
|
33
32
|
const Provider = require("./Wrappers/Provider/Provider.cjs");
|
|
33
|
+
const index$1 = require("./adapters/web/index.cjs");
|
|
34
34
|
const _bundledJsonforms = require("fastapi-rtk/.bundled-jsonforms");
|
|
35
35
|
const apiTypes = require("fastapi-rtk/api-types");
|
|
36
36
|
const constants = require("fastapi-rtk/constants");
|
|
@@ -66,8 +66,86 @@ Object.defineProperty(exports, "useTranslation", {
|
|
|
66
66
|
});
|
|
67
67
|
exports.useBulkActions = useBulkActions.useBulkActions;
|
|
68
68
|
exports.useForms = useForms.useForms;
|
|
69
|
-
exports
|
|
70
|
-
|
|
69
|
+
Object.defineProperty(exports, "buildRequest", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: () => api.buildRequest
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "convertToFormData", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: () => api.convertToFormData
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "createFetchParams", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: () => api.createFetchParams
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "createItem", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: () => api.createItem
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "deleteItem", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: () => api.deleteItem
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "downloadItems", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: () => api.downloadItems
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "formCreateItem", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: () => api.formCreateItem
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "formUpdateItem", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: () => api.formUpdateItem
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "getInfo", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: () => api.getInfo
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "getItem", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: () => api.getItem
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "getItems", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: () => api.getItems
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(exports, "parseResponse", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: () => api.parseResponse
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "postBulk", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: () => api.postBulk
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "updateItem", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: () => api.updateItem
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(exports, "uploadItems", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: () => api.uploadItems
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, "useAdapters", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: () => api.useAdapters
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "useAuth", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: () => api.useAuth
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(exports, "useInfo", {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: () => api.useInfo
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, "withApiProvider", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: () => api.withApiProvider
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "withProvider", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: () => api.withProvider
|
|
148
|
+
});
|
|
71
149
|
Object.defineProperty(exports, "DateTimePicker", {
|
|
72
150
|
enumerable: true,
|
|
73
151
|
get: () => components.DateTimePicker
|
|
@@ -91,11 +169,10 @@ exports.Nextgendatagrid = NextGenDataGrid.NextGenDataGrid;
|
|
|
91
169
|
exports.AutoSizeColumn = usePatchProps.AutoSizeColumn;
|
|
92
170
|
exports.usePatchProps = usePatchProps.usePatchProps;
|
|
93
171
|
exports.ApiProvider = ApiProvider.ApiProvider;
|
|
94
|
-
exports.withApiProvider = ApiProvider.withApiProvider;
|
|
95
172
|
exports.InfiniteScroll = InfiniteScroll.InfiniteScroll;
|
|
96
173
|
exports.LazyLoadWrapper = LazyLoadWrapper.LazyLoadWrapper;
|
|
97
174
|
exports.Provider = Provider.Provider;
|
|
98
|
-
exports.
|
|
175
|
+
exports.webAdapters = index$1.webAdapters;
|
|
99
176
|
exports.reactQuery = index;
|
|
100
177
|
exports.rq = index;
|
|
101
178
|
exports.mantineReactTable = index_esm;
|
|
@@ -9,7 +9,7 @@ import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.
|
|
|
9
9
|
import { useMemo, useCallback, useEffect } from "react";
|
|
10
10
|
import { useApi, useTranslation } from "fastapi-rtk/contexts";
|
|
11
11
|
import { useForms } from "../hooks/api/useForms.mjs";
|
|
12
|
-
import { useInfo } from "
|
|
12
|
+
import { useInfo } from "fastapi-rtk/api";
|
|
13
13
|
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
14
14
|
import { normalProps } from "../Modals/normalProps.mjs";
|
|
15
15
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
@@ -12,7 +12,7 @@ import { convertToFormInputs as convertToFormInputs$1 } from "../ActionIcons/uti
|
|
|
12
12
|
import { convertToFormInputs } from "../fab-react-toolkit-patch/utils/convertToFormInputs.mjs";
|
|
13
13
|
import { useApi, useTranslation } from "fastapi-rtk/contexts";
|
|
14
14
|
import { useForms } from "../hooks/api/useForms.mjs";
|
|
15
|
-
import { useInfo } from "
|
|
15
|
+
import { useInfo } from "fastapi-rtk/api";
|
|
16
16
|
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
17
17
|
import { normalProps } from "../Modals/normalProps.mjs";
|
|
18
18
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
@@ -8,7 +8,7 @@ import ForwardRef$1 from "../../_virtual/id-badge-2.mjs";
|
|
|
8
8
|
import ForwardRef$2 from "../../_virtual/lock.mjs";
|
|
9
9
|
import ForwardRef$5 from "../../_virtual/logout.mjs";
|
|
10
10
|
import ForwardRef from "../../_virtual/users.mjs";
|
|
11
|
-
import { useAuth } from "
|
|
11
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
12
12
|
import classes from "./user.module.css.mjs";
|
|
13
13
|
function UserMenu(props) {
|
|
14
14
|
const { basePath = "/security", Target, children } = props;
|
|
@@ -6,7 +6,7 @@ import ForwardRef$2 from "../_virtual/maximize.mjs";
|
|
|
6
6
|
import ForwardRef$3 from "../_virtual/minimize.mjs";
|
|
7
7
|
import ForwardRef$1 from "../_virtual/stack.mjs";
|
|
8
8
|
import ForwardRef from "../_virtual/stack-forward.mjs";
|
|
9
|
-
import { useInfo } from "
|
|
9
|
+
import { useInfo } from "fastapi-rtk/api";
|
|
10
10
|
import { useTranslation } from "fastapi-rtk/contexts";
|
|
11
11
|
function CommonModal(props) {
|
|
12
12
|
const {
|
|
@@ -3,7 +3,7 @@ import { getItemId } from "fastapi-rtk/utils";
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import { Actions } from "../../../ActionIcons/Actions.mjs";
|
|
5
5
|
import { useApi } from "fastapi-rtk/contexts";
|
|
6
|
-
import { useAuth } from "
|
|
6
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
7
7
|
import { FallbackWrapper } from "../FallbackWrapper.mjs";
|
|
8
8
|
import { AutoSizeColumn } from "./usePatchProps.mjs";
|
|
9
9
|
const ROW_ACTIONS_COLUMN_ID = "mrt-row-actions";
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { mergeProps, parseFromValuesOrFunc } from "fastapi-rtk/utils";
|
|
3
3
|
import { memo, useMemo } from "react";
|
|
4
4
|
import { useApi } from "fastapi-rtk/contexts";
|
|
5
|
-
import { useAuth } from "
|
|
5
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
6
6
|
import { FallbackWrapper } from "../../FallbackWrapper.mjs";
|
|
7
7
|
import { MultiLineHighlight } from "./MultiLineHighlight.mjs";
|
|
8
8
|
const Cell = (props) => {
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack, Flex } from "@mantine/core";
|
|
3
3
|
import { memo, useMemo } from "react";
|
|
4
4
|
import { useApi } from "fastapi-rtk/contexts";
|
|
5
|
-
import { useAuth } from "
|
|
5
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
6
6
|
import { fromFilterFnToFilter } from "../../utils.mjs";
|
|
7
7
|
import { BasicFilters } from "./BasicFilters.mjs";
|
|
8
8
|
import { ColumnHeaderFilterInput } from "./ColumnHeaderFilterInput/ColumnHeaderFilterInput.mjs";
|
package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Center, Tooltip, Badge } from "@mantine/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useTranslation, useApi } from "fastapi-rtk/contexts";
|
|
5
|
-
import { useAuth } from "
|
|
5
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
6
6
|
import { AdvancedFilters } from "./AdvancedFilters.mjs";
|
|
7
7
|
import { FilterMenuButton } from "./FilterMenuButton.mjs";
|
|
8
8
|
const HeaderAdvancedFiltersMenuButton = (props) => {
|
|
@@ -4,7 +4,7 @@ import { Flex } from "@mantine/core";
|
|
|
4
4
|
import { useMap } from "@mantine/hooks";
|
|
5
5
|
import { useEffect, useMemo } from "react";
|
|
6
6
|
import { useApi } from "fastapi-rtk/contexts";
|
|
7
|
-
import { useAuth } from "
|
|
7
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
8
8
|
import { fromFilterToFilterFn } from "../../utils.mjs";
|
|
9
9
|
import { MemoCell, Cell } from "./Cell.mjs";
|
|
10
10
|
import { MemoColumnHeaderFilter, ColumnHeaderFilter } from "./ColumnHeaderFilter.mjs";
|
|
@@ -3,7 +3,7 @@ import { parseFromValuesOrFunc } from "fastapi-rtk/utils";
|
|
|
3
3
|
import { SegmentedControl, Group, Box, Flex } from "@mantine/core";
|
|
4
4
|
import { useMemo, useCallback, isValidElement } from "react";
|
|
5
5
|
import { useApi } from "fastapi-rtk/contexts";
|
|
6
|
-
import { useAuth } from "
|
|
6
|
+
import { useAuth } from "fastapi-rtk/api";
|
|
7
7
|
import { FallbackWrapper } from "../../FallbackWrapper.mjs";
|
|
8
8
|
import { getBasicToolbarRules, getBasicToolbars } from "./basicToolbars.mjs";
|
|
9
9
|
const isCustomizerObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && !isValidElement(value);
|
|
@@ -1,79 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useMemo, useState, forwardRef } from "react";
|
|
2
|
+
import { useInfo, ApiProvider as ApiProvider$1 } from "fastapi-rtk/api";
|
|
3
|
+
import { withApiProvider } from "fastapi-rtk/api";
|
|
5
4
|
import { defaultApi } from "../../fab-react-toolkit-patch/api/hooks/useProvideApi.mjs";
|
|
6
5
|
import { defaultBulk } from "../../fab-react-toolkit-patch/api/hooks/useProvideBulk.mjs";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { FormContextViewProvider, FormContextAddProvider, FormContextEditProvider, FormContextDeleteProvider } from "./Contexts/FormContext.mjs";
|
|
11
|
-
import { useProvideApi } from "./hooks/useProvideApi.mjs";
|
|
12
|
-
import { useProvideBulk } from "./hooks/useProvideBulk.mjs";
|
|
13
|
-
import { useProvideForm } from "./hooks/useProvideForm.mjs";
|
|
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
|
-
children
|
|
30
|
-
} = props;
|
|
31
|
-
const info = useInfo();
|
|
32
|
-
const { baseUrl, fab } = info;
|
|
33
|
-
const { apiParams, bulkParams } = useMemo(() => fab ? { apiParams: defaultApi, bulkParams: defaultBulk } : {}, [fab]);
|
|
34
|
-
const api = useProvideApi(
|
|
35
|
-
{
|
|
36
|
-
path: urlJoin(baseUrl, resource_name),
|
|
37
|
-
initialQueryParams,
|
|
38
|
-
relation,
|
|
39
|
-
fetchInfo,
|
|
40
|
-
clearInfoOnRefetch,
|
|
41
|
-
clearDataOnRefetch,
|
|
42
|
-
refetchInfoBasedOnLang,
|
|
43
|
-
refetchDataBasedOnLang,
|
|
44
|
-
resetQueryParamsOnPathChange,
|
|
45
|
-
infoQueryProps,
|
|
46
|
-
dataQueryProps,
|
|
47
|
-
streamingQueryProps,
|
|
48
|
-
streaming
|
|
49
|
-
},
|
|
50
|
-
apiParams
|
|
51
|
-
);
|
|
52
|
-
const apiProxy = useProxy(api);
|
|
53
|
-
const bulkActions = useProvideBulk(apiProxy, bulkParams);
|
|
54
|
-
const bulkActionsProxy = useProxy(bulkActions);
|
|
55
|
-
const formView = useProvideForm();
|
|
56
|
-
const [formViewProxy] = useState(() => createProxy(formView));
|
|
57
|
-
const formAdd = useProvideForm();
|
|
58
|
-
const [formAddProxy] = useState(() => createProxy(formAdd));
|
|
59
|
-
const formEdit = useProvideForm();
|
|
60
|
-
const [formEditProxy] = useState(() => createProxy(formEdit));
|
|
61
|
-
const formDelete = useProvideForm();
|
|
62
|
-
const [formDeleteProxy] = useState(() => createProxy(formDelete));
|
|
63
|
-
return /* @__PURE__ */ jsx(ApiContextProvider, { value: apiProxy, children: /* @__PURE__ */ jsx(BulkActionsContextProvider, { value: bulkActionsProxy, children: /* @__PURE__ */ jsx(FormContextViewProvider, { value: formViewProxy, children: /* @__PURE__ */ jsx(FormContextAddProvider, { value: formAddProxy, children: /* @__PURE__ */ jsx(FormContextEditProvider, { value: formEditProxy, children: /* @__PURE__ */ jsx(FormContextDeleteProvider, { value: formDeleteProxy, children }) }) }) }) }) });
|
|
64
|
-
}
|
|
65
|
-
const withApiProvider = (apiProviderProps, Component, options = {}) => {
|
|
66
|
-
const { displayName, forwardRef: shouldForwardRef = false } = options;
|
|
67
|
-
const renderComponent = (props, ref) => {
|
|
68
|
-
const resolvedProps = parseFromValuesOrFunc(apiProviderProps, props);
|
|
69
|
-
return /* @__PURE__ */ jsx(ApiProvider, { ...resolvedProps, children: /* @__PURE__ */ jsx(Component, { ...props, ref }) });
|
|
70
|
-
};
|
|
71
|
-
const WrappedComponent = shouldForwardRef ? (
|
|
72
|
-
// #MUSTANY #MUSTUNKNOWN forwardRef's PropsWithoutRef widening over the generic P is inexpressible; the result is re-typed through unknown to ComponentType<P>
|
|
73
|
-
forwardRef(renderComponent)
|
|
74
|
-
) : (props) => renderComponent(props, null);
|
|
75
|
-
WrappedComponent.displayName = displayName || `withApiProvider(${Component.displayName || Component.name || "Component"})`;
|
|
76
|
-
return WrappedComponent;
|
|
6
|
+
const ApiProvider = (props) => {
|
|
7
|
+
const { fab } = useInfo();
|
|
8
|
+
return /* @__PURE__ */ jsx(ApiProvider$1, { ...props, apiParams: fab ? defaultApi : void 0, bulkParams: fab ? defaultBulk : void 0 });
|
|
77
9
|
};
|
|
78
10
|
export {
|
|
79
11
|
ApiProvider,
|
|
@@ -1,53 +1,22 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { QueryClient } from "../../../../.external/esm/@tanstack_query-core@5.90.20/@tanstack/query-core/build/modern/queryClient.mjs";
|
|
6
|
-
import { QueryClientProvider } from "../../../../.external/esm/@tanstack_react-query@5.90.20_react@19.2.3/@tanstack/react-query/build/modern/QueryClientProvider.mjs";
|
|
7
|
-
import { useState, forwardRef, useMemo, useEffect } from "react";
|
|
2
|
+
import { Provider as Provider$1 } from "fastapi-rtk/api";
|
|
3
|
+
import { withProvider } from "fastapi-rtk/api";
|
|
4
|
+
import { webAdapters } from "../../adapters/web/index.mjs";
|
|
8
5
|
import { defaultAuth } from "../../fab-react-toolkit-patch/auth/hooks/useProvideAuth.mjs";
|
|
9
6
|
import { defaultInfo } from "../../fab-react-toolkit-patch/auth/hooks/useProvideInfo.mjs";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
const Provider = ({ fab, ...props }) => {
|
|
8
|
+
const baseUrl = props.baseUrl ?? new URL(document.baseURI).pathname + "/api/v1";
|
|
9
|
+
const adapters = { ...webAdapters, ...props.adapters };
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Provider$1,
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
baseUrl,
|
|
15
|
+
adapters,
|
|
16
|
+
authParams: fab ? defaultAuth : void 0,
|
|
17
|
+
infoParams: fab ? defaultInfo : void 0
|
|
18
|
+
}
|
|
22
19
|
);
|
|
23
|
-
const auth = useProvideAuth(baseUrl, authQueryProps, authParams);
|
|
24
|
-
const authProxy = useProxy(auth);
|
|
25
|
-
const info = useProvideInfo(baseUrl, auth, infoParams);
|
|
26
|
-
const infoProxy = useProxy(info);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
setDebugMode(props.debug ?? false);
|
|
29
|
-
}, []);
|
|
30
|
-
return (
|
|
31
|
-
// #MUSTASSERT #MUSTUNKNOWN useProvideAuth exposes error as a string and a deprecated oauth_signin alias, diverging from the AuthContextValue shape consumed downstream
|
|
32
|
-
/* @__PURE__ */ jsx(AuthContextProvider, { value: authProxy, children: /* @__PURE__ */ jsx(InfoContextProvider, { value: infoProxy, children: /* @__PURE__ */ jsx(LangContextProvider, { langProps: props.langProps, children }) }) })
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
const Provider = (props) => {
|
|
36
|
-
const [queryClient] = useState(() => new QueryClient(props.queryClientProps));
|
|
37
|
-
return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(InnerProvider, { ...props }) });
|
|
38
|
-
};
|
|
39
|
-
const withProvider = (providerProps, Component, options = {}) => {
|
|
40
|
-
const { displayName, forwardRef: shouldForwardRef = false } = options;
|
|
41
|
-
const renderComponent = (props, ref) => {
|
|
42
|
-
const resolvedProps = parseFromValuesOrFunc(providerProps, props);
|
|
43
|
-
return /* @__PURE__ */ jsx(Provider, { ...resolvedProps, children: /* @__PURE__ */ jsx(Component, { ...props, ref }) });
|
|
44
|
-
};
|
|
45
|
-
const WrappedComponent = shouldForwardRef ? (
|
|
46
|
-
// #MUSTANY ComponentProps<typeof Component> does not line up with forwardRef's PropsWithoutRef inference; the runtime render fn is correct
|
|
47
|
-
forwardRef(renderComponent)
|
|
48
|
-
) : (props) => renderComponent(props, null);
|
|
49
|
-
WrappedComponent.displayName = displayName || `withProvider(${Component.displayName || Component.name || "Component"})`;
|
|
50
|
-
return WrappedComponent;
|
|
51
20
|
};
|
|
52
21
|
export {
|
|
53
22
|
Provider,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const cookieTransport = {
|
|
2
|
+
loginPath: "login",
|
|
3
|
+
buildLoginBody: (creds) => new URLSearchParams({
|
|
4
|
+
username: creds.username,
|
|
5
|
+
password: creds.password
|
|
6
|
+
}),
|
|
7
|
+
decorateRequest: (options) => ({ ...options, credentials: "include" }),
|
|
8
|
+
persistLogin: () => {
|
|
9
|
+
},
|
|
10
|
+
clearLogin: () => {
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
cookieTransport
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cookieTransport } from "./cookieTransport.mjs";
|
|
2
|
+
import { webFileDownloadAdapter } from "./webFileDownloadAdapter.mjs";
|
|
3
|
+
import { webFormDataAdapter } from "./webFormDataAdapter.mjs";
|
|
4
|
+
import { webNetworkAdapter } from "./webNetworkAdapter.mjs";
|
|
5
|
+
import { webOAuthOpener } from "./webOAuthOpener.mjs";
|
|
6
|
+
import { webStorageAdapter } from "./webStorageAdapter.mjs";
|
|
7
|
+
const webAdapters = {
|
|
8
|
+
storage: webStorageAdapter,
|
|
9
|
+
network: webNetworkAdapter,
|
|
10
|
+
authTransport: cookieTransport,
|
|
11
|
+
fileDownload: webFileDownloadAdapter,
|
|
12
|
+
oauthOpener: webOAuthOpener,
|
|
13
|
+
formData: webFormDataAdapter
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
cookieTransport,
|
|
17
|
+
webAdapters,
|
|
18
|
+
webFileDownloadAdapter,
|
|
19
|
+
webFormDataAdapter,
|
|
20
|
+
webNetworkAdapter,
|
|
21
|
+
webOAuthOpener,
|
|
22
|
+
webStorageAdapter
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const webFileDownloadAdapter = {
|
|
2
|
+
save: async ({ url, filename }) => {
|
|
3
|
+
const a = document.createElement("a");
|
|
4
|
+
a.href = url;
|
|
5
|
+
a.download = filename ?? "";
|
|
6
|
+
a.style.display = "none";
|
|
7
|
+
document.body.appendChild(a);
|
|
8
|
+
a.click();
|
|
9
|
+
document.body.removeChild(a);
|
|
10
|
+
},
|
|
11
|
+
// #MUSTASSERT web callers pass a Blob/File; URL.createObjectURL's DOM overloads accept exactly that
|
|
12
|
+
objectUrl: (file) => URL.createObjectURL(file)
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
webFileDownloadAdapter
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const webFormDataAdapter = {
|
|
2
|
+
isFilePart: (value) => value instanceof File,
|
|
3
|
+
// #MUSTASSERT the FormDataAdapter types the file handle as unknown (platform-agnostic); on web it is always a File
|
|
4
|
+
appendFile: (fd, key, file) => fd.append(key, file)
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
webFormDataAdapter
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const webOAuthOpener = {
|
|
2
|
+
open: (url, { popup, onClose }) => {
|
|
3
|
+
if (!popup) {
|
|
4
|
+
window.location.href = url;
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const width = 500;
|
|
8
|
+
const height = 500;
|
|
9
|
+
const left = window.screenLeft + window.outerWidth / 2 - width / 2;
|
|
10
|
+
const top = window.screenTop + window.outerHeight / 2 - height / 2;
|
|
11
|
+
const authWindow = window.open(
|
|
12
|
+
url + "?popup=true",
|
|
13
|
+
"auth",
|
|
14
|
+
`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=${width}, height=${height}, top=${top}, left=${left}`
|
|
15
|
+
);
|
|
16
|
+
const pollTimer = window.setInterval(() => {
|
|
17
|
+
if (authWindow.closed !== false) {
|
|
18
|
+
window.clearInterval(pollTimer);
|
|
19
|
+
onClose == null ? void 0 : onClose();
|
|
20
|
+
}
|
|
21
|
+
}, 200);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
webOAuthOpener
|
|
26
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const webStorageAdapter = {
|
|
2
|
+
get: (key) => localStorage.getItem(key),
|
|
3
|
+
set: (key, value) => {
|
|
4
|
+
localStorage.setItem(key, value);
|
|
5
|
+
},
|
|
6
|
+
remove: (key) => {
|
|
7
|
+
localStorage.removeItem(key);
|
|
8
|
+
},
|
|
9
|
+
subscribe: (key, cb) => {
|
|
10
|
+
const handler = (e) => {
|
|
11
|
+
if (e.key === key) {
|
|
12
|
+
cb(e.newValue);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
window.addEventListener("storage", handler);
|
|
16
|
+
return () => window.removeEventListener("storage", handler);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
webStorageAdapter
|
|
21
|
+
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { createItem } from "
|
|
2
|
-
import { deleteItem } from "../../../Wrappers/ApiProvider/utils/api/deleteItem.mjs";
|
|
3
|
-
import { getInfo } from "../../../Wrappers/ApiProvider/utils/api/getInfo.mjs";
|
|
4
|
-
import { getItem } from "../../../Wrappers/ApiProvider/utils/api/getItem.mjs";
|
|
5
|
-
import { updateItem } from "../../../Wrappers/ApiProvider/utils/api/updateItem.mjs";
|
|
6
|
-
import { uploadItems } from "../../../Wrappers/ApiProvider/utils/api/uploadItems.mjs";
|
|
1
|
+
import { getInfo, uploadItems, deleteItem, updateItem, createItem, getItem } from "fastapi-rtk/api";
|
|
7
2
|
import { downloadItems } from "../utils/api/downloadItems.mjs";
|
|
8
3
|
import { getItems } from "../utils/api/getItems.mjs";
|
|
9
4
|
const defaultApi = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { urlJoin } from "fastapi-rtk/utils";
|
|
2
|
+
import { createFetchParams } from "fastapi-rtk/api";
|
|
3
|
+
const downloadItems = async (adapters, path, queryParams, { label, export_mode, delimiter, quotechar } = {}) => {
|
|
3
4
|
const _queryParams = { ...queryParams, check_validity: true };
|
|
4
5
|
if (label) {
|
|
5
6
|
_queryParams.label = label;
|
|
@@ -22,7 +23,8 @@ const downloadItems = async (path, queryParams, { label, export_mode, delimiter,
|
|
|
22
23
|
queryParams
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
|
-
const
|
|
26
|
+
const decorated = await adapters.authTransport.decorateRequest(options);
|
|
27
|
+
const response = await fetch(fetchPath, decorated);
|
|
26
28
|
if (!response.ok) {
|
|
27
29
|
throw new Error(response.statusText);
|
|
28
30
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { createFetchParams, parseResponse } from "fastapi-rtk/
|
|
2
|
-
const getItems = async (path, queryParams, options) => {
|
|
1
|
+
import { createFetchParams, parseResponse } from "fastapi-rtk/api";
|
|
2
|
+
const getItems = async (adapters, path, queryParams, options) => {
|
|
3
3
|
const { fetchPath, options: fetchOptions } = createFetchParams({
|
|
4
4
|
path,
|
|
5
5
|
method: "GET",
|
|
6
6
|
queryParams: { q: JSON.stringify(queryParams ?? {}) },
|
|
7
7
|
options
|
|
8
8
|
});
|
|
9
|
-
const
|
|
9
|
+
const decorated = await adapters.authTransport.decorateRequest(fetchOptions);
|
|
10
|
+
const response = await fetch(fetchPath, decorated);
|
|
10
11
|
return await parseResponse(response);
|
|
11
12
|
};
|
|
12
13
|
export {
|