@edge-zuq/core 1.2.7
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/LICENSE +20 -0
- package/README.md +99 -0
- package/lib/module/assets/logo.png +0 -0
- package/lib/module/data/errors/http-client-error.js +14 -0
- package/lib/module/data/errors/http-client-error.js.map +1 -0
- package/lib/module/data/errors/index.js +6 -0
- package/lib/module/data/errors/index.js.map +1 -0
- package/lib/module/data/errors/save-file-error.js +9 -0
- package/lib/module/data/errors/save-file-error.js.map +1 -0
- package/lib/module/data/errors/unsupported-platform.js +9 -0
- package/lib/module/data/errors/unsupported-platform.js.map +1 -0
- package/lib/module/data/models/index.js +6 -0
- package/lib/module/data/models/index.js.map +1 -0
- package/lib/module/data/models/remote-get-comment-list-model.js +2 -0
- package/lib/module/data/models/remote-get-comment-list-model.js.map +1 -0
- package/lib/module/data/models/remote-get-image-list-model.js +2 -0
- package/lib/module/data/models/remote-get-image-list-model.js.map +1 -0
- package/lib/module/data/models/remote-user-model.js +2 -0
- package/lib/module/data/models/remote-user-model.js.map +1 -0
- package/lib/module/data/protocols/cookie-manager.js +2 -0
- package/lib/module/data/protocols/cookie-manager.js.map +1 -0
- package/lib/module/data/protocols/download-manager.js +4 -0
- package/lib/module/data/protocols/download-manager.js.map +1 -0
- package/lib/module/data/protocols/http-client.js +26 -0
- package/lib/module/data/protocols/http-client.js.map +1 -0
- package/lib/module/data/protocols/index.js +9 -0
- package/lib/module/data/protocols/index.js.map +1 -0
- package/lib/module/data/protocols/notification-manager.js +4 -0
- package/lib/module/data/protocols/notification-manager.js.map +1 -0
- package/lib/module/data/protocols/permission-manager.js +4 -0
- package/lib/module/data/protocols/permission-manager.js.map +1 -0
- package/lib/module/data/protocols/storage.js +4 -0
- package/lib/module/data/protocols/storage.js.map +1 -0
- package/lib/module/data/use-cases/index.js +6 -0
- package/lib/module/data/use-cases/index.js.map +1 -0
- package/lib/module/data/use-cases/remote-get-comment-list.js +29 -0
- package/lib/module/data/use-cases/remote-get-comment-list.js.map +1 -0
- package/lib/module/data/use-cases/remote-get-image-list.js +32 -0
- package/lib/module/data/use-cases/remote-get-image-list.js.map +1 -0
- package/lib/module/data/use-cases/remote-send-diagnostics.js +20 -0
- package/lib/module/data/use-cases/remote-send-diagnostics.js.map +1 -0
- package/lib/module/domain/errors/authentication-expired-error.js +9 -0
- package/lib/module/domain/errors/authentication-expired-error.js.map +1 -0
- package/lib/module/domain/errors/index.js +7 -0
- package/lib/module/domain/errors/index.js.map +1 -0
- package/lib/module/domain/errors/internal-server-error.js +9 -0
- package/lib/module/domain/errors/internal-server-error.js.map +1 -0
- package/lib/module/domain/errors/invalid-credentials-error.js +9 -0
- package/lib/module/domain/errors/invalid-credentials-error.js.map +1 -0
- package/lib/module/domain/errors/no-app-permission-error.js +9 -0
- package/lib/module/domain/errors/no-app-permission-error.js.map +1 -0
- package/lib/module/domain/models/get-comment-list-model.js +2 -0
- package/lib/module/domain/models/get-comment-list-model.js.map +1 -0
- package/lib/module/domain/models/get-image-list-model.js +2 -0
- package/lib/module/domain/models/get-image-list-model.js.map +1 -0
- package/lib/module/domain/models/index.js +6 -0
- package/lib/module/domain/models/index.js.map +1 -0
- package/lib/module/domain/models/user-model.js +2 -0
- package/lib/module/domain/models/user-model.js.map +1 -0
- package/lib/module/domain/use-cases/get-comment-list.js +4 -0
- package/lib/module/domain/use-cases/get-comment-list.js.map +1 -0
- package/lib/module/domain/use-cases/get-image-list.js +4 -0
- package/lib/module/domain/use-cases/get-image-list.js.map +1 -0
- package/lib/module/domain/use-cases/index.js +9 -0
- package/lib/module/domain/use-cases/index.js.map +1 -0
- package/lib/module/domain/use-cases/record-request.js +4 -0
- package/lib/module/domain/use-cases/record-request.js.map +1 -0
- package/lib/module/domain/use-cases/send-diagnostics.js +4 -0
- package/lib/module/domain/use-cases/send-diagnostics.js.map +1 -0
- package/lib/module/domain/use-cases/user-authentication.js +4 -0
- package/lib/module/domain/use-cases/user-authentication.js.map +1 -0
- package/lib/module/domain/use-cases/user-logout.js +4 -0
- package/lib/module/domain/use-cases/user-logout.js.map +1 -0
- package/lib/module/index.js +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/infra/axios-http-client-adapter.js +199 -0
- package/lib/module/infra/axios-http-client-adapter.js.map +1 -0
- package/lib/module/infra/index.js +10 -0
- package/lib/module/infra/index.js.map +1 -0
- package/lib/module/infra/isomorphic-id-manager.js +83 -0
- package/lib/module/infra/isomorphic-id-manager.js.map +1 -0
- package/lib/module/infra/mmkv-storage-adapter.js +62 -0
- package/lib/module/infra/mmkv-storage-adapter.js.map +1 -0
- package/lib/module/infra/notifee-notification-manager-adapter.js +69 -0
- package/lib/module/infra/notifee-notification-manager-adapter.js.map +1 -0
- package/lib/module/infra/offline-mutation-queue.js +210 -0
- package/lib/module/infra/offline-mutation-queue.js.map +1 -0
- package/lib/module/infra/rnbu-download-manager-adapter.js +31 -0
- package/lib/module/infra/rnbu-download-manager-adapter.js.map +1 -0
- package/lib/module/infra/rnp-permission-manager-adapter.js +117 -0
- package/lib/module/infra/rnp-permission-manager-adapter.js.map +1 -0
- package/lib/module/infra/storage-cookie-manager-adapter.js +24 -0
- package/lib/module/infra/storage-cookie-manager-adapter.js.map +1 -0
- package/lib/module/main/components/index.js +7 -0
- package/lib/module/main/components/index.js.map +1 -0
- package/lib/module/main/components/request-permissions.js +14 -0
- package/lib/module/main/components/request-permissions.js.map +1 -0
- package/lib/module/main/factories/infra/download-manager-factory.js +7 -0
- package/lib/module/main/factories/infra/download-manager-factory.js.map +1 -0
- package/lib/module/main/factories/infra/http-client-factory.js +7 -0
- package/lib/module/main/factories/infra/http-client-factory.js.map +1 -0
- package/lib/module/main/factories/infra/index.js +10 -0
- package/lib/module/main/factories/infra/index.js.map +1 -0
- package/lib/module/main/factories/infra/isomorphic-id-manager-factory.js +7 -0
- package/lib/module/main/factories/infra/isomorphic-id-manager-factory.js.map +1 -0
- package/lib/module/main/factories/infra/notification-manager-factory.js +7 -0
- package/lib/module/main/factories/infra/notification-manager-factory.js.map +1 -0
- package/lib/module/main/factories/infra/offline-mutation-queue-factory.js +7 -0
- package/lib/module/main/factories/infra/offline-mutation-queue-factory.js.map +1 -0
- package/lib/module/main/factories/infra/permission-manager-factory.js +7 -0
- package/lib/module/main/factories/infra/permission-manager-factory.js.map +1 -0
- package/lib/module/main/factories/infra/storage-factory.js +10 -0
- package/lib/module/main/factories/infra/storage-factory.js.map +1 -0
- package/lib/module/main/factories/use-cases/index.js +6 -0
- package/lib/module/main/factories/use-cases/index.js.map +1 -0
- package/lib/module/main/factories/use-cases/remote-get-comment-list-factory.js +7 -0
- package/lib/module/main/factories/use-cases/remote-get-comment-list-factory.js.map +1 -0
- package/lib/module/main/factories/use-cases/remote-get-image-list-factory.js +7 -0
- package/lib/module/main/factories/use-cases/remote-get-image-list-factory.js.map +1 -0
- package/lib/module/main/factories/use-cases/remote-send-diagnostics-factory.js +7 -0
- package/lib/module/main/factories/use-cases/remote-send-diagnostics-factory.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/presentation/components/atoms/UIBackdrop.js +31 -0
- package/lib/module/presentation/components/atoms/UIBackdrop.js.map +1 -0
- package/lib/module/presentation/components/atoms/UICheckbox.js +47 -0
- package/lib/module/presentation/components/atoms/UICheckbox.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIDot.js +33 -0
- package/lib/module/presentation/components/atoms/UIDot.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIIcon.js +1072 -0
- package/lib/module/presentation/components/atoms/UIIcon.js.map +1 -0
- package/lib/module/presentation/components/atoms/UILoading.js +19 -0
- package/lib/module/presentation/components/atoms/UILoading.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIPage.js +70 -0
- package/lib/module/presentation/components/atoms/UIPage.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIProgress.js +54 -0
- package/lib/module/presentation/components/atoms/UIProgress.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIScrollPage.js +72 -0
- package/lib/module/presentation/components/atoms/UIScrollPage.js.map +1 -0
- package/lib/module/presentation/components/atoms/UISeparator.js +30 -0
- package/lib/module/presentation/components/atoms/UISeparator.js.map +1 -0
- package/lib/module/presentation/components/atoms/UISpacer.js +19 -0
- package/lib/module/presentation/components/atoms/UISpacer.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIStack.js +31 -0
- package/lib/module/presentation/components/atoms/UIStack.js.map +1 -0
- package/lib/module/presentation/components/atoms/UIText.js +48 -0
- package/lib/module/presentation/components/atoms/UIText.js.map +1 -0
- package/lib/module/presentation/components/atoms/index.js +15 -0
- package/lib/module/presentation/components/atoms/index.js.map +1 -0
- package/lib/module/presentation/components/index.js +4 -0
- package/lib/module/presentation/components/index.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIActionSheet.js +199 -0
- package/lib/module/presentation/components/molecules/UIActionSheet.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIButton.js +173 -0
- package/lib/module/presentation/components/molecules/UIButton.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIButtonCTA.js +31 -0
- package/lib/module/presentation/components/molecules/UIButtonCTA.js.map +1 -0
- package/lib/module/presentation/components/molecules/UICheckboxInput.js +84 -0
- package/lib/module/presentation/components/molecules/UICheckboxInput.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIChip.js +49 -0
- package/lib/module/presentation/components/molecules/UIChip.js.map +1 -0
- package/lib/module/presentation/components/molecules/UICurrencyInput.js +32 -0
- package/lib/module/presentation/components/molecules/UICurrencyInput.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIDataList.js +26 -0
- package/lib/module/presentation/components/molecules/UIDataList.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIDataSectionList.js +26 -0
- package/lib/module/presentation/components/molecules/UIDataSectionList.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIDatetimeInput.js +202 -0
- package/lib/module/presentation/components/molecules/UIDatetimeInput.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIError.js +32 -0
- package/lib/module/presentation/components/molecules/UIError.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIImage.js +87 -0
- package/lib/module/presentation/components/molecules/UIImage.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIInlineDatePicker.js +245 -0
- package/lib/module/presentation/components/molecules/UIInlineDatePicker.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIInputIcon.js +38 -0
- package/lib/module/presentation/components/molecules/UIInputIcon.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIList.js +16 -0
- package/lib/module/presentation/components/molecules/UIList.js.map +1 -0
- package/lib/module/presentation/components/molecules/UIRadioInput.js +78 -0
- package/lib/module/presentation/components/molecules/UIRadioInput.js.map +1 -0
- package/lib/module/presentation/components/molecules/UISectionList.js +16 -0
- package/lib/module/presentation/components/molecules/UISectionList.js.map +1 -0
- package/lib/module/presentation/components/molecules/UISkeleton.js +54 -0
- package/lib/module/presentation/components/molecules/UISkeleton.js.map +1 -0
- package/lib/module/presentation/components/molecules/UISwitch.js +65 -0
- package/lib/module/presentation/components/molecules/UISwitch.js.map +1 -0
- package/lib/module/presentation/components/molecules/UITextInput.js +132 -0
- package/lib/module/presentation/components/molecules/UITextInput.js.map +1 -0
- package/lib/module/presentation/components/molecules/UITextInputMask.js +133 -0
- package/lib/module/presentation/components/molecules/UITextInputMask.js.map +1 -0
- package/lib/module/presentation/components/molecules/index.js +23 -0
- package/lib/module/presentation/components/molecules/index.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIAppBar.js +102 -0
- package/lib/module/presentation/components/organisms/UIAppBar.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIAppBarAction.js +21 -0
- package/lib/module/presentation/components/organisms/UIAppBarAction.js.map +1 -0
- package/lib/module/presentation/components/organisms/UICard.js +43 -0
- package/lib/module/presentation/components/organisms/UICard.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIComment.js +73 -0
- package/lib/module/presentation/components/organisms/UIComment.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIErrorBoundary.js +68 -0
- package/lib/module/presentation/components/organisms/UIErrorBoundary.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIForm.js +83 -0
- package/lib/module/presentation/components/organisms/UIForm.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormButton.js +43 -0
- package/lib/module/presentation/components/organisms/UIFormButton.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormCheckboxInput.js +39 -0
- package/lib/module/presentation/components/organisms/UIFormCheckboxInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormCurrencyInput.js +65 -0
- package/lib/module/presentation/components/organisms/UIFormCurrencyInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormDatetimeInput.js +54 -0
- package/lib/module/presentation/components/organisms/UIFormDatetimeInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormMultiselectInput.js +212 -0
- package/lib/module/presentation/components/organisms/UIFormMultiselectInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormRadioInput.js +36 -0
- package/lib/module/presentation/components/organisms/UIFormRadioInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormSelectInput.js +259 -0
- package/lib/module/presentation/components/organisms/UIFormSelectInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormTextInput.js +64 -0
- package/lib/module/presentation/components/organisms/UIFormTextInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIFormTextInputMask.js +69 -0
- package/lib/module/presentation/components/organisms/UIFormTextInputMask.js.map +1 -0
- package/lib/module/presentation/components/organisms/UIRow.js +55 -0
- package/lib/module/presentation/components/organisms/UIRow.js.map +1 -0
- package/lib/module/presentation/components/organisms/UISearchInput.js +33 -0
- package/lib/module/presentation/components/organisms/UISearchInput.js.map +1 -0
- package/lib/module/presentation/components/organisms/UISelectChip.js +94 -0
- package/lib/module/presentation/components/organisms/UISelectChip.js.map +1 -0
- package/lib/module/presentation/components/organisms/UISignature.js +159 -0
- package/lib/module/presentation/components/organisms/UISignature.js.map +1 -0
- package/lib/module/presentation/components/organisms/UISlideButton.js +90 -0
- package/lib/module/presentation/components/organisms/UISlideButton.js.map +1 -0
- package/lib/module/presentation/components/organisms/index.js +24 -0
- package/lib/module/presentation/components/organisms/index.js.map +1 -0
- package/lib/module/presentation/components/permissions/index.js +4 -0
- package/lib/module/presentation/components/permissions/index.js.map +1 -0
- package/lib/module/presentation/components/permissions/request-permissions.js +96 -0
- package/lib/module/presentation/components/permissions/request-permissions.js.map +1 -0
- package/lib/module/presentation/domain/metadata/index.js +5 -0
- package/lib/module/presentation/domain/metadata/index.js.map +1 -0
- package/lib/module/presentation/domain/metadata/use-comments.js +26 -0
- package/lib/module/presentation/domain/metadata/use-comments.js.map +1 -0
- package/lib/module/presentation/domain/metadata/use-images.js +26 -0
- package/lib/module/presentation/domain/metadata/use-images.js.map +1 -0
- package/lib/module/presentation/domain/offline/index.js +12 -0
- package/lib/module/presentation/domain/offline/index.js.map +1 -0
- package/lib/module/presentation/domain/offline/offline-mutation-queue-provider.js +69 -0
- package/lib/module/presentation/domain/offline/offline-mutation-queue-provider.js.map +1 -0
- package/lib/module/presentation/domain/offline/types.js +4 -0
- package/lib/module/presentation/domain/offline/types.js.map +1 -0
- package/lib/module/presentation/domain/offline/use-infinite-offline-query.js +69 -0
- package/lib/module/presentation/domain/offline/use-infinite-offline-query.js.map +1 -0
- package/lib/module/presentation/domain/offline/use-offline-id-v2.js +22 -0
- package/lib/module/presentation/domain/offline/use-offline-id-v2.js.map +1 -0
- package/lib/module/presentation/domain/offline/use-offline-id.js +11 -0
- package/lib/module/presentation/domain/offline/use-offline-id.js.map +1 -0
- package/lib/module/presentation/domain/offline/use-offline-mutation.js +115 -0
- package/lib/module/presentation/domain/offline/use-offline-mutation.js.map +1 -0
- package/lib/module/presentation/domain/offline/use-offline-query.js +33 -0
- package/lib/module/presentation/domain/offline/use-offline-query.js.map +1 -0
- package/lib/module/presentation/domain/offline/use-offline-queue.js +8 -0
- package/lib/module/presentation/domain/offline/use-offline-queue.js.map +1 -0
- package/lib/module/presentation/domain/offline/utils.js +110 -0
- package/lib/module/presentation/domain/offline/utils.js.map +1 -0
- package/lib/module/presentation/domain/provider/index.js +4 -0
- package/lib/module/presentation/domain/provider/index.js.map +1 -0
- package/lib/module/presentation/domain/provider/zuq-core-provider.js +51 -0
- package/lib/module/presentation/domain/provider/zuq-core-provider.js.map +1 -0
- package/lib/module/presentation/domain/utils/exists.js +6 -0
- package/lib/module/presentation/domain/utils/exists.js.map +1 -0
- package/lib/module/presentation/domain/utils/index.js +8 -0
- package/lib/module/presentation/domain/utils/index.js.map +1 -0
- package/lib/module/presentation/domain/utils/react-query.js +10 -0
- package/lib/module/presentation/domain/utils/react-query.js.map +1 -0
- package/lib/module/presentation/domain/utils/use-action-sheet.js +20 -0
- package/lib/module/presentation/domain/utils/use-action-sheet.js.map +1 -0
- package/lib/module/presentation/domain/utils/use-signature-ref.js +8 -0
- package/lib/module/presentation/domain/utils/use-signature-ref.js.map +1 -0
- package/lib/module/presentation/domain/utils/yup.js +5 -0
- package/lib/module/presentation/domain/utils/yup.js.map +1 -0
- package/lib/module/theme.js +211 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/data/errors/http-client-error.d.ts +13 -0
- package/lib/typescript/src/data/errors/http-client-error.d.ts.map +1 -0
- package/lib/typescript/src/data/errors/index.d.ts +4 -0
- package/lib/typescript/src/data/errors/index.d.ts.map +1 -0
- package/lib/typescript/src/data/errors/save-file-error.d.ts +4 -0
- package/lib/typescript/src/data/errors/save-file-error.d.ts.map +1 -0
- package/lib/typescript/src/data/errors/unsupported-platform.d.ts +4 -0
- package/lib/typescript/src/data/errors/unsupported-platform.d.ts.map +1 -0
- package/lib/typescript/src/data/models/index.d.ts +4 -0
- package/lib/typescript/src/data/models/index.d.ts.map +1 -0
- package/lib/typescript/src/data/models/remote-get-comment-list-model.d.ts +16 -0
- package/lib/typescript/src/data/models/remote-get-comment-list-model.d.ts.map +1 -0
- package/lib/typescript/src/data/models/remote-get-image-list-model.d.ts +16 -0
- package/lib/typescript/src/data/models/remote-get-image-list-model.d.ts.map +1 -0
- package/lib/typescript/src/data/models/remote-user-model.d.ts +14 -0
- package/lib/typescript/src/data/models/remote-user-model.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/cookie-manager.d.ts +7 -0
- package/lib/typescript/src/data/protocols/cookie-manager.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/download-manager.d.ts +12 -0
- package/lib/typescript/src/data/protocols/download-manager.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/http-client.d.ts +52 -0
- package/lib/typescript/src/data/protocols/http-client.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/index.d.ts +7 -0
- package/lib/typescript/src/data/protocols/index.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/notification-manager.d.ts +17 -0
- package/lib/typescript/src/data/protocols/notification-manager.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/permission-manager.d.ts +23 -0
- package/lib/typescript/src/data/protocols/permission-manager.d.ts.map +1 -0
- package/lib/typescript/src/data/protocols/storage.d.ts +17 -0
- package/lib/typescript/src/data/protocols/storage.d.ts.map +1 -0
- package/lib/typescript/src/data/use-cases/index.d.ts +4 -0
- package/lib/typescript/src/data/use-cases/index.d.ts.map +1 -0
- package/lib/typescript/src/data/use-cases/remote-get-comment-list.d.ts +9 -0
- package/lib/typescript/src/data/use-cases/remote-get-comment-list.d.ts.map +1 -0
- package/lib/typescript/src/data/use-cases/remote-get-image-list.d.ts +10 -0
- package/lib/typescript/src/data/use-cases/remote-get-image-list.d.ts.map +1 -0
- package/lib/typescript/src/data/use-cases/remote-send-diagnostics.d.ts +11 -0
- package/lib/typescript/src/data/use-cases/remote-send-diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/domain/errors/authentication-expired-error.d.ts +4 -0
- package/lib/typescript/src/domain/errors/authentication-expired-error.d.ts.map +1 -0
- package/lib/typescript/src/domain/errors/index.d.ts +5 -0
- package/lib/typescript/src/domain/errors/index.d.ts.map +1 -0
- package/lib/typescript/src/domain/errors/internal-server-error.d.ts +4 -0
- package/lib/typescript/src/domain/errors/internal-server-error.d.ts.map +1 -0
- package/lib/typescript/src/domain/errors/invalid-credentials-error.d.ts +4 -0
- package/lib/typescript/src/domain/errors/invalid-credentials-error.d.ts.map +1 -0
- package/lib/typescript/src/domain/errors/no-app-permission-error.d.ts +4 -0
- package/lib/typescript/src/domain/errors/no-app-permission-error.d.ts.map +1 -0
- package/lib/typescript/src/domain/models/get-comment-list-model.d.ts +10 -0
- package/lib/typescript/src/domain/models/get-comment-list-model.d.ts.map +1 -0
- package/lib/typescript/src/domain/models/get-image-list-model.d.ts +8 -0
- package/lib/typescript/src/domain/models/get-image-list-model.d.ts.map +1 -0
- package/lib/typescript/src/domain/models/index.d.ts +4 -0
- package/lib/typescript/src/domain/models/index.d.ts.map +1 -0
- package/lib/typescript/src/domain/models/user-model.d.ts +16 -0
- package/lib/typescript/src/domain/models/user-model.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/get-comment-list.d.ts +12 -0
- package/lib/typescript/src/domain/use-cases/get-comment-list.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/get-image-list.d.ts +12 -0
- package/lib/typescript/src/domain/use-cases/get-image-list.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/index.d.ts +7 -0
- package/lib/typescript/src/domain/use-cases/index.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/record-request.d.ts +14 -0
- package/lib/typescript/src/domain/use-cases/record-request.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/send-diagnostics.d.ts +15 -0
- package/lib/typescript/src/domain/use-cases/send-diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/user-authentication.d.ts +12 -0
- package/lib/typescript/src/domain/use-cases/user-authentication.d.ts.map +1 -0
- package/lib/typescript/src/domain/use-cases/user-logout.d.ts +10 -0
- package/lib/typescript/src/domain/use-cases/user-logout.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +15 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/infra/axios-http-client-adapter.d.ts +33 -0
- package/lib/typescript/src/infra/axios-http-client-adapter.d.ts.map +1 -0
- package/lib/typescript/src/infra/index.d.ts +8 -0
- package/lib/typescript/src/infra/index.d.ts.map +1 -0
- package/lib/typescript/src/infra/isomorphic-id-manager.d.ts +29 -0
- package/lib/typescript/src/infra/isomorphic-id-manager.d.ts.map +1 -0
- package/lib/typescript/src/infra/mmkv-storage-adapter.d.ts +18 -0
- package/lib/typescript/src/infra/mmkv-storage-adapter.d.ts.map +1 -0
- package/lib/typescript/src/infra/notifee-notification-manager-adapter.d.ts +17 -0
- package/lib/typescript/src/infra/notifee-notification-manager-adapter.d.ts.map +1 -0
- package/lib/typescript/src/infra/offline-mutation-queue.d.ts +56 -0
- package/lib/typescript/src/infra/offline-mutation-queue.d.ts.map +1 -0
- package/lib/typescript/src/infra/rnbu-download-manager-adapter.d.ts +7 -0
- package/lib/typescript/src/infra/rnbu-download-manager-adapter.d.ts.map +1 -0
- package/lib/typescript/src/infra/rnp-permission-manager-adapter.d.ts +20 -0
- package/lib/typescript/src/infra/rnp-permission-manager-adapter.d.ts.map +1 -0
- package/lib/typescript/src/infra/storage-cookie-manager-adapter.d.ts +12 -0
- package/lib/typescript/src/infra/storage-cookie-manager-adapter.d.ts.map +1 -0
- package/lib/typescript/src/main/components/index.d.ts +5 -0
- package/lib/typescript/src/main/components/index.d.ts.map +1 -0
- package/lib/typescript/src/main/components/request-permissions.d.ts +6 -0
- package/lib/typescript/src/main/components/request-permissions.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/download-manager-factory.d.ts +3 -0
- package/lib/typescript/src/main/factories/infra/download-manager-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/http-client-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/infra/http-client-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/index.d.ts +8 -0
- package/lib/typescript/src/main/factories/infra/index.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/isomorphic-id-manager-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/infra/isomorphic-id-manager-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/notification-manager-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/infra/notification-manager-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/offline-mutation-queue-factory.d.ts +5 -0
- package/lib/typescript/src/main/factories/infra/offline-mutation-queue-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/permission-manager-factory.d.ts +3 -0
- package/lib/typescript/src/main/factories/infra/permission-manager-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/infra/storage-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/infra/storage-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/use-cases/index.d.ts +4 -0
- package/lib/typescript/src/main/factories/use-cases/index.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/use-cases/remote-get-comment-list-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/use-cases/remote-get-comment-list-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/use-cases/remote-get-image-list-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/use-cases/remote-get-image-list-factory.d.ts.map +1 -0
- package/lib/typescript/src/main/factories/use-cases/remote-send-diagnostics-factory.d.ts +4 -0
- package/lib/typescript/src/main/factories/use-cases/remote-send-diagnostics-factory.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIBackdrop.d.ts +10 -0
- package/lib/typescript/src/presentation/components/atoms/UIBackdrop.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UICheckbox.d.ts +11 -0
- package/lib/typescript/src/presentation/components/atoms/UICheckbox.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIDot.d.ts +10 -0
- package/lib/typescript/src/presentation/components/atoms/UIDot.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIIcon.d.ts +133 -0
- package/lib/typescript/src/presentation/components/atoms/UIIcon.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UILoading.d.ts +9 -0
- package/lib/typescript/src/presentation/components/atoms/UILoading.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIPage.d.ts +20 -0
- package/lib/typescript/src/presentation/components/atoms/UIPage.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIProgress.d.ts +10 -0
- package/lib/typescript/src/presentation/components/atoms/UIProgress.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIScrollPage.d.ts +17 -0
- package/lib/typescript/src/presentation/components/atoms/UIScrollPage.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UISeparator.d.ts +10 -0
- package/lib/typescript/src/presentation/components/atoms/UISeparator.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UISpacer.d.ts +9 -0
- package/lib/typescript/src/presentation/components/atoms/UISpacer.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIStack.d.ts +14 -0
- package/lib/typescript/src/presentation/components/atoms/UIStack.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/UIText.d.ts +14 -0
- package/lib/typescript/src/presentation/components/atoms/UIText.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/atoms/index.d.ts +13 -0
- package/lib/typescript/src/presentation/components/atoms/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/index.d.ts +2 -0
- package/lib/typescript/src/presentation/components/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIActionSheet.d.ts +17 -0
- package/lib/typescript/src/presentation/components/molecules/UIActionSheet.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIButton.d.ts +18 -0
- package/lib/typescript/src/presentation/components/molecules/UIButton.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIButtonCTA.d.ts +8 -0
- package/lib/typescript/src/presentation/components/molecules/UIButtonCTA.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UICheckboxInput.d.ts +16 -0
- package/lib/typescript/src/presentation/components/molecules/UICheckboxInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIChip.d.ts +17 -0
- package/lib/typescript/src/presentation/components/molecules/UIChip.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UICurrencyInput.d.ts +11 -0
- package/lib/typescript/src/presentation/components/molecules/UICurrencyInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIDataList.d.ts +9 -0
- package/lib/typescript/src/presentation/components/molecules/UIDataList.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIDataSectionList.d.ts +9 -0
- package/lib/typescript/src/presentation/components/molecules/UIDataSectionList.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIDatetimeInput.d.ts +10 -0
- package/lib/typescript/src/presentation/components/molecules/UIDatetimeInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIError.d.ts +8 -0
- package/lib/typescript/src/presentation/components/molecules/UIError.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIImage.d.ts +11 -0
- package/lib/typescript/src/presentation/components/molecules/UIImage.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIInlineDatePicker.d.ts +15 -0
- package/lib/typescript/src/presentation/components/molecules/UIInlineDatePicker.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIInputIcon.d.ts +9 -0
- package/lib/typescript/src/presentation/components/molecules/UIInputIcon.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIList.d.ts +5 -0
- package/lib/typescript/src/presentation/components/molecules/UIList.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UIRadioInput.d.ts +12 -0
- package/lib/typescript/src/presentation/components/molecules/UIRadioInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UISectionList.d.ts +5 -0
- package/lib/typescript/src/presentation/components/molecules/UISectionList.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UISkeleton.d.ts +8 -0
- package/lib/typescript/src/presentation/components/molecules/UISkeleton.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UISwitch.d.ts +10 -0
- package/lib/typescript/src/presentation/components/molecules/UISwitch.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UITextInput.d.ts +13 -0
- package/lib/typescript/src/presentation/components/molecules/UITextInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/UITextInputMask.d.ts +16 -0
- package/lib/typescript/src/presentation/components/molecules/UITextInputMask.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/molecules/index.d.ts +21 -0
- package/lib/typescript/src/presentation/components/molecules/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIAppBar.d.ts +13 -0
- package/lib/typescript/src/presentation/components/organisms/UIAppBar.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIAppBarAction.d.ts +6 -0
- package/lib/typescript/src/presentation/components/organisms/UIAppBarAction.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UICard.d.ts +9 -0
- package/lib/typescript/src/presentation/components/organisms/UICard.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIComment.d.ts +9 -0
- package/lib/typescript/src/presentation/components/organisms/UIComment.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIErrorBoundary.d.ts +9 -0
- package/lib/typescript/src/presentation/components/organisms/UIErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIForm.d.ts +13 -0
- package/lib/typescript/src/presentation/components/organisms/UIForm.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormButton.d.ts +11 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormButton.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormCheckboxInput.d.ts +9 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormCheckboxInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormCurrencyInput.d.ts +11 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormCurrencyInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormDatetimeInput.d.ts +10 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormDatetimeInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormMultiselectInput.d.ts +30 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormMultiselectInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormRadioInput.d.ts +9 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormRadioInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormSelectInput.d.ts +44 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormSelectInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormTextInput.d.ts +11 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormTextInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormTextInputMask.d.ts +11 -0
- package/lib/typescript/src/presentation/components/organisms/UIFormTextInputMask.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UIRow.d.ts +14 -0
- package/lib/typescript/src/presentation/components/organisms/UIRow.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UISearchInput.d.ts +6 -0
- package/lib/typescript/src/presentation/components/organisms/UISearchInput.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UISelectChip.d.ts +13 -0
- package/lib/typescript/src/presentation/components/organisms/UISelectChip.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UISignature.d.ts +26 -0
- package/lib/typescript/src/presentation/components/organisms/UISignature.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/UISlideButton.d.ts +8 -0
- package/lib/typescript/src/presentation/components/organisms/UISlideButton.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/organisms/index.d.ts +22 -0
- package/lib/typescript/src/presentation/components/organisms/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/permissions/index.d.ts +2 -0
- package/lib/typescript/src/presentation/components/permissions/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/components/permissions/request-permissions.d.ts +15 -0
- package/lib/typescript/src/presentation/components/permissions/request-permissions.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/metadata/index.d.ts +3 -0
- package/lib/typescript/src/presentation/domain/metadata/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/metadata/use-comments.d.ts +11 -0
- package/lib/typescript/src/presentation/domain/metadata/use-comments.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/metadata/use-images.d.ts +11 -0
- package/lib/typescript/src/presentation/domain/metadata/use-images.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/index.d.ts +10 -0
- package/lib/typescript/src/presentation/domain/offline/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/offline-mutation-queue-provider.d.ts +18 -0
- package/lib/typescript/src/presentation/domain/offline/offline-mutation-queue-provider.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/types.d.ts +18 -0
- package/lib/typescript/src/presentation/domain/offline/types.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/use-infinite-offline-query.d.ts +78 -0
- package/lib/typescript/src/presentation/domain/offline/use-infinite-offline-query.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-id-v2.d.ts +9 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-id-v2.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-id.d.ts +3 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-id.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-mutation.d.ts +88 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-mutation.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-query.d.ts +8 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-query.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-queue.d.ts +10 -0
- package/lib/typescript/src/presentation/domain/offline/use-offline-queue.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/offline/utils.d.ts +18 -0
- package/lib/typescript/src/presentation/domain/offline/utils.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/provider/index.d.ts +2 -0
- package/lib/typescript/src/presentation/domain/provider/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/provider/zuq-core-provider.d.ts +13 -0
- package/lib/typescript/src/presentation/domain/provider/zuq-core-provider.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/utils/exists.d.ts +2 -0
- package/lib/typescript/src/presentation/domain/utils/exists.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/utils/index.d.ts +6 -0
- package/lib/typescript/src/presentation/domain/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/utils/react-query.d.ts +5 -0
- package/lib/typescript/src/presentation/domain/utils/react-query.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/utils/use-action-sheet.d.ts +6 -0
- package/lib/typescript/src/presentation/domain/utils/use-action-sheet.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/utils/use-signature-ref.d.ts +15 -0
- package/lib/typescript/src/presentation/domain/utils/use-signature-ref.d.ts.map +1 -0
- package/lib/typescript/src/presentation/domain/utils/yup.d.ts +3 -0
- package/lib/typescript/src/presentation/domain/utils/yup.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +214 -0
- package/lib/typescript/src/theme.d.ts.map +1 -0
- package/package.json +210 -0
- package/src/assets/logo.png +0 -0
- package/src/data/errors/http-client-error.ts +23 -0
- package/src/data/errors/index.ts +3 -0
- package/src/data/errors/save-file-error.ts +6 -0
- package/src/data/errors/unsupported-platform.ts +6 -0
- package/src/data/models/index.ts +3 -0
- package/src/data/models/remote-get-comment-list-model.ts +15 -0
- package/src/data/models/remote-get-image-list-model.ts +15 -0
- package/src/data/models/remote-user-model.ts +13 -0
- package/src/data/protocols/cookie-manager.ts +6 -0
- package/src/data/protocols/download-manager.ts +13 -0
- package/src/data/protocols/http-client.ts +75 -0
- package/src/data/protocols/index.ts +6 -0
- package/src/data/protocols/notification-manager.ts +17 -0
- package/src/data/protocols/permission-manager.ts +46 -0
- package/src/data/protocols/storage.ts +18 -0
- package/src/data/use-cases/index.ts +3 -0
- package/src/data/use-cases/remote-get-comment-list.ts +34 -0
- package/src/data/use-cases/remote-get-image-list.ts +40 -0
- package/src/data/use-cases/remote-send-diagnostics.ts +20 -0
- package/src/domain/errors/authentication-expired-error.ts +6 -0
- package/src/domain/errors/index.ts +4 -0
- package/src/domain/errors/internal-server-error.ts +6 -0
- package/src/domain/errors/invalid-credentials-error.ts +6 -0
- package/src/domain/errors/no-app-permission-error.ts +6 -0
- package/src/domain/models/get-comment-list-model.ts +9 -0
- package/src/domain/models/get-image-list-model.ts +7 -0
- package/src/domain/models/index.ts +3 -0
- package/src/domain/models/user-model.ts +15 -0
- package/src/domain/use-cases/get-comment-list.ts +14 -0
- package/src/domain/use-cases/get-image-list.ts +14 -0
- package/src/domain/use-cases/index.ts +6 -0
- package/src/domain/use-cases/record-request.ts +15 -0
- package/src/domain/use-cases/send-diagnostics.ts +15 -0
- package/src/domain/use-cases/user-authentication.ts +16 -0
- package/src/domain/use-cases/user-logout.ts +10 -0
- package/src/index.tsx +29 -0
- package/src/infra/axios-http-client-adapter.ts +271 -0
- package/src/infra/index.ts +7 -0
- package/src/infra/isomorphic-id-manager.ts +107 -0
- package/src/infra/mmkv-storage-adapter.ts +73 -0
- package/src/infra/notifee-notification-manager-adapter.ts +87 -0
- package/src/infra/offline-mutation-queue.ts +280 -0
- package/src/infra/rnbu-download-manager-adapter.ts +29 -0
- package/src/infra/rnp-permission-manager-adapter.ts +147 -0
- package/src/infra/storage-cookie-manager-adapter.ts +29 -0
- package/src/main/components/index.ts +4 -0
- package/src/main/components/request-permissions.tsx +17 -0
- package/src/main/factories/infra/download-manager-factory.ts +6 -0
- package/src/main/factories/infra/http-client-factory.ts +9 -0
- package/src/main/factories/infra/index.ts +7 -0
- package/src/main/factories/infra/isomorphic-id-manager-factory.ts +6 -0
- package/src/main/factories/infra/notification-manager-factory.ts +8 -0
- package/src/main/factories/infra/offline-mutation-queue-factory.ts +22 -0
- package/src/main/factories/infra/permission-manager-factory.ts +6 -0
- package/src/main/factories/infra/storage-factory.ts +11 -0
- package/src/main/factories/use-cases/index.ts +3 -0
- package/src/main/factories/use-cases/remote-get-comment-list-factory.ts +6 -0
- package/src/main/factories/use-cases/remote-get-image-list-factory.ts +6 -0
- package/src/main/factories/use-cases/remote-send-diagnostics-factory.ts +10 -0
- package/src/presentation/components/atoms/UIBackdrop.tsx +35 -0
- package/src/presentation/components/atoms/UICheckbox.tsx +58 -0
- package/src/presentation/components/atoms/UIDot.tsx +40 -0
- package/src/presentation/components/atoms/UIIcon.tsx +1091 -0
- package/src/presentation/components/atoms/UILoading.tsx +17 -0
- package/src/presentation/components/atoms/UIPage.tsx +92 -0
- package/src/presentation/components/atoms/UIProgress.tsx +60 -0
- package/src/presentation/components/atoms/UIScrollPage.tsx +87 -0
- package/src/presentation/components/atoms/UISeparator.tsx +41 -0
- package/src/presentation/components/atoms/UISpacer.tsx +21 -0
- package/src/presentation/components/atoms/UIStack.tsx +44 -0
- package/src/presentation/components/atoms/UIText.tsx +59 -0
- package/src/presentation/components/atoms/index.ts +12 -0
- package/src/presentation/components/index.ts +1 -0
- package/src/presentation/components/molecules/UIActionSheet.tsx +230 -0
- package/src/presentation/components/molecules/UIButton.tsx +192 -0
- package/src/presentation/components/molecules/UIButtonCTA.tsx +38 -0
- package/src/presentation/components/molecules/UICheckboxInput.tsx +106 -0
- package/src/presentation/components/molecules/UIChip.tsx +69 -0
- package/src/presentation/components/molecules/UICurrencyInput.tsx +43 -0
- package/src/presentation/components/molecules/UIDataList.tsx +30 -0
- package/src/presentation/components/molecules/UIDataSectionList.tsx +30 -0
- package/src/presentation/components/molecules/UIDatetimeInput.tsx +205 -0
- package/src/presentation/components/molecules/UIError.tsx +24 -0
- package/src/presentation/components/molecules/UIImage.tsx +85 -0
- package/src/presentation/components/molecules/UIInlineDatePicker.tsx +244 -0
- package/src/presentation/components/molecules/UIInputIcon.tsx +39 -0
- package/src/presentation/components/molecules/UIList.tsx +17 -0
- package/src/presentation/components/molecules/UIRadioInput.tsx +97 -0
- package/src/presentation/components/molecules/UISectionList.tsx +17 -0
- package/src/presentation/components/molecules/UISkeleton.tsx +66 -0
- package/src/presentation/components/molecules/UISwitch.tsx +72 -0
- package/src/presentation/components/molecules/UITextInput.tsx +160 -0
- package/src/presentation/components/molecules/UITextInputMask.tsx +160 -0
- package/src/presentation/components/molecules/index.ts +20 -0
- package/src/presentation/components/organisms/UIAppBar.tsx +103 -0
- package/src/presentation/components/organisms/UIAppBarAction.tsx +13 -0
- package/src/presentation/components/organisms/UICard.tsx +48 -0
- package/src/presentation/components/organisms/UIComment.tsx +64 -0
- package/src/presentation/components/organisms/UIErrorBoundary.tsx +72 -0
- package/src/presentation/components/organisms/UIForm.tsx +81 -0
- package/src/presentation/components/organisms/UIFormButton.tsx +38 -0
- package/src/presentation/components/organisms/UIFormCheckboxInput.tsx +35 -0
- package/src/presentation/components/organisms/UIFormCurrencyInput.tsx +65 -0
- package/src/presentation/components/organisms/UIFormDatetimeInput.tsx +51 -0
- package/src/presentation/components/organisms/UIFormMultiselectInput.tsx +251 -0
- package/src/presentation/components/organisms/UIFormRadioInput.tsx +32 -0
- package/src/presentation/components/organisms/UIFormSelectInput.tsx +316 -0
- package/src/presentation/components/organisms/UIFormTextInput.tsx +62 -0
- package/src/presentation/components/organisms/UIFormTextInputMask.tsx +79 -0
- package/src/presentation/components/organisms/UIRow.tsx +61 -0
- package/src/presentation/components/organisms/UISearchInput.tsx +40 -0
- package/src/presentation/components/organisms/UISelectChip.tsx +104 -0
- package/src/presentation/components/organisms/UISignature.tsx +194 -0
- package/src/presentation/components/organisms/UISlideButton.tsx +112 -0
- package/src/presentation/components/organisms/index.ts +21 -0
- package/src/presentation/components/permissions/index.ts +1 -0
- package/src/presentation/components/permissions/request-permissions.tsx +115 -0
- package/src/presentation/domain/metadata/index.ts +2 -0
- package/src/presentation/domain/metadata/use-comments.ts +27 -0
- package/src/presentation/domain/metadata/use-images.ts +27 -0
- package/src/presentation/domain/offline/index.ts +9 -0
- package/src/presentation/domain/offline/offline-mutation-queue-provider.tsx +95 -0
- package/src/presentation/domain/offline/types.ts +21 -0
- package/src/presentation/domain/offline/use-infinite-offline-query.tsx +89 -0
- package/src/presentation/domain/offline/use-offline-id-v2.ts +29 -0
- package/src/presentation/domain/offline/use-offline-id.ts +12 -0
- package/src/presentation/domain/offline/use-offline-mutation.ts +150 -0
- package/src/presentation/domain/offline/use-offline-query.ts +55 -0
- package/src/presentation/domain/offline/use-offline-queue.ts +6 -0
- package/src/presentation/domain/offline/utils.ts +139 -0
- package/src/presentation/domain/provider/index.ts +1 -0
- package/src/presentation/domain/provider/zuq-core-provider.tsx +52 -0
- package/src/presentation/domain/utils/exists.ts +3 -0
- package/src/presentation/domain/utils/index.ts +5 -0
- package/src/presentation/domain/utils/react-query.ts +10 -0
- package/src/presentation/domain/utils/use-action-sheet.ts +21 -0
- package/src/presentation/domain/utils/use-signature-ref.ts +19 -0
- package/src/presentation/domain/utils/yup.ts +3 -0
- package/src/theme.ts +240 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { UIActionSheet, UIButton, UIList } from "../molecules/index.js";
|
|
5
|
+
import { UISeparator, UIStack, UIText } from "../atoms/index.js";
|
|
6
|
+
import { StyleSheet } from 'react-native';
|
|
7
|
+
import { useActionSheet } from "../../domain/utils/index.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export const RequestPermissions = ({
|
|
10
|
+
permissionManager,
|
|
11
|
+
permissions,
|
|
12
|
+
title,
|
|
13
|
+
height
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
visible,
|
|
17
|
+
onOpen,
|
|
18
|
+
onClose
|
|
19
|
+
} = useActionSheet();
|
|
20
|
+
const [pending, setPending] = React.useState([]);
|
|
21
|
+
const check = React.useCallback(async () => {
|
|
22
|
+
const current = await Promise.all(permissions.map(async permission => ({
|
|
23
|
+
permission,
|
|
24
|
+
state: await permissionManager.get(permission.value)
|
|
25
|
+
})));
|
|
26
|
+
setPending(current.filter(item => ['denied', 'blocked'].includes(item.state)).map(item => item.permission));
|
|
27
|
+
}, [permissionManager, permissions]);
|
|
28
|
+
const onAllow = React.useCallback(async permission => {
|
|
29
|
+
const result = await permissionManager.request(permission.value, {
|
|
30
|
+
title: permission.option.title,
|
|
31
|
+
message: permission.option.message
|
|
32
|
+
});
|
|
33
|
+
if (['granted', 'limited', 'unavailable'].includes(result)) {
|
|
34
|
+
permission.onAllow?.();
|
|
35
|
+
check();
|
|
36
|
+
}
|
|
37
|
+
}, [check, permissionManager]);
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
check();
|
|
40
|
+
}, [check]);
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
if (pending.length) {
|
|
43
|
+
onOpen();
|
|
44
|
+
} else {
|
|
45
|
+
onClose();
|
|
46
|
+
}
|
|
47
|
+
}, [pending, onClose, onOpen]);
|
|
48
|
+
return /*#__PURE__*/_jsx(UIActionSheet, {
|
|
49
|
+
visible: visible,
|
|
50
|
+
onRequestClose: onClose,
|
|
51
|
+
title: title ?? 'Permissões',
|
|
52
|
+
estimatedHeight: height,
|
|
53
|
+
children: /*#__PURE__*/_jsx(UIList, {
|
|
54
|
+
data: pending,
|
|
55
|
+
style: {
|
|
56
|
+
height: height ?? 400
|
|
57
|
+
},
|
|
58
|
+
contentContainerStyle: styles.container,
|
|
59
|
+
renderItem: ({
|
|
60
|
+
item
|
|
61
|
+
}) => /*#__PURE__*/_jsxs(UIStack, {
|
|
62
|
+
size: "lg",
|
|
63
|
+
children: [/*#__PURE__*/_jsxs(UIStack, {
|
|
64
|
+
size: "md",
|
|
65
|
+
children: [/*#__PURE__*/_jsx(UIText, {
|
|
66
|
+
size: 16,
|
|
67
|
+
weight: "600",
|
|
68
|
+
children: item.option.title
|
|
69
|
+
}), /*#__PURE__*/_jsx(UIText, {
|
|
70
|
+
children: item.option.message
|
|
71
|
+
})]
|
|
72
|
+
}), /*#__PURE__*/_jsx(UIButton, {
|
|
73
|
+
variant: "contained",
|
|
74
|
+
color: "neutral-light-20",
|
|
75
|
+
textColor: "brand-violet-500",
|
|
76
|
+
onPress: () => onAllow(item),
|
|
77
|
+
children: item.option.allow ?? 'Permitir'
|
|
78
|
+
})]
|
|
79
|
+
}, item.value),
|
|
80
|
+
ItemSeparatorComponent: () => /*#__PURE__*/_jsx(UISeparator, {
|
|
81
|
+
style: styles.separator
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const styles = StyleSheet.create({
|
|
87
|
+
separator: {
|
|
88
|
+
marginTop: 16,
|
|
89
|
+
marginBottom: 12
|
|
90
|
+
},
|
|
91
|
+
container: {
|
|
92
|
+
paddingTop: 24,
|
|
93
|
+
paddingHorizontal: 24
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=request-permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","UIActionSheet","UIButton","UIList","UISeparator","UIStack","UIText","StyleSheet","useActionSheet","jsx","_jsx","jsxs","_jsxs","RequestPermissions","permissionManager","permissions","title","height","visible","onOpen","onClose","pending","setPending","useState","check","useCallback","current","Promise","all","map","permission","state","get","value","filter","item","includes","onAllow","result","request","option","message","useEffect","length","onRequestClose","estimatedHeight","children","data","style","contentContainerStyle","styles","container","renderItem","size","weight","variant","color","textColor","onPress","allow","ItemSeparatorComponent","separator","create","marginTop","marginBottom","paddingTop","paddingHorizontal"],"sourceRoot":"../../../../../src","sources":["presentation/components/permissions/request-permissions.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,aAAa,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,uBAAc;AAC9D,SAASC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,mBAAU;AACvD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,QAAQ,6BAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAepD,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,iBAAiB;EACjBC,WAAW;EACXC,KAAK;EACLC;AACK,CAAC,KAAK;EACX,MAAM;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGZ,cAAc,CAAC,CAAC;EACrD,MAAM,CAACa,OAAO,EAAEC,UAAU,CAAC,GAAGtB,KAAK,CAACuB,QAAQ,CAAe,EAAE,CAAC;EAE9D,MAAMC,KAAK,GAAGxB,KAAK,CAACyB,WAAW,CAAC,YAAY;IAC1C,MAAMC,OAAO,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC/Bb,WAAW,CAACc,GAAG,CAAC,MAAOC,UAAU,KAAM;MACrCA,UAAU;MACVC,KAAK,EAAE,MAAMjB,iBAAiB,CAACkB,GAAG,CAACF,UAAU,CAACG,KAAK;IACrD,CAAC,CAAC,CACJ,CAAC;IACDX,UAAU,CACRI,OAAO,CACJQ,MAAM,CAAEC,IAAI,IAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAACC,QAAQ,CAACD,IAAI,CAACJ,KAAK,CAAC,CAAC,CAC5DF,G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jCgC,qBAAqB,EAAEC,MAAM,CAACC,SAAU;MACxCC,UAAU,EAAEA,CAAC;QAAEjB;MAAK,CAAC,kBACnBvB,KAAA,CAACP,OAAO;QAACgD,IAAI,EAAC,IAAI;QAAAP,QAAA,gBAChBlC,KAAA,CAACP,OAAO;UAACgD,IAAI,EAAC,IAAI;UAAAP,QAAA,gBAChBpC,IAAA,CAACJ,MAAM;YAAC+C,IAAI,EAAE,EAAG;YAACC,MAAM,EAAC,KAAK;YAAAR,QAAA,EAC3BX,IAAI,CAACK,MAAM,CAACxB;UAAK,CACZ,CAAC,eACTN,IAAA,CAACJ,MAAM;YAAAwC,QAAA,EAAEX,IAAI,CAACK,MAAM,CAACC;UAAO,CAAS,CAAC;QAAA,CAC/B,CAAC,eACV/B,IAAA,CAACR,QAAQ;UACPqD,OAAO,EAAC,WAAW;UACnBC,KAAK,EAAC,kBAAkB;UACxBC,SAAS,EAAC,kBAAkB;UAC5BC,OAAO,EAAEA,CAAA,KAAMrB,OAAO,CAACF,IAAI,CAAE;UAAAW,QAAA,EAE5BX,IAAI,CAACK,MAAM,CAACmB,KAAK,IAAI;QAAU,CACxB,CAAC;MAAA,GAdWxB,IAAI,CAACF,KAepB,CACT;MACF2B,sBAAsB,EAAEA,CAAA,kBAAMlD,IAAA,CAACN,WAAW;QAAC4C,KAAK,EAAEE,MAAM,CAACW;MAAU,CAAE;IAAE,CACxE;EAAC,CACW,CAAC;AAEpB,CAAC;AAED,MAAMX,MAAM,GAAG3C,UAAU,CAACuD,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACDb,SAAS,EAAE;IACTc,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["presentation/domain/metadata/index.ts"],"mappings":";;AAAA,cAAc,iBAAc;AAC5B,cAAc,mBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useOfflineQuery } from "../offline/index.js";
|
|
4
|
+
export const useComments = ({
|
|
5
|
+
entityId,
|
|
6
|
+
entityType,
|
|
7
|
+
getMetadataComments,
|
|
8
|
+
storage
|
|
9
|
+
}) => {
|
|
10
|
+
return useOfflineQuery({
|
|
11
|
+
storage,
|
|
12
|
+
queryKey: ['Metadata', 'COMMENT', {
|
|
13
|
+
entityId,
|
|
14
|
+
entityType
|
|
15
|
+
}],
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
if (!entityId || !entityType) return [];
|
|
18
|
+
const result = await getMetadataComments.get({
|
|
19
|
+
entityId,
|
|
20
|
+
entityType
|
|
21
|
+
});
|
|
22
|
+
return result ?? [];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=use-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useOfflineQuery","useComments","entityId","entityType","getMetadataComments","storage","queryKey","queryFn","result","get"],"sourceRoot":"../../../../../src","sources":["presentation/domain/metadata/use-comments.ts"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,qBAAY;AAS5C,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC,QAAQ;EACRC,UAAU;EACVC,mBAAmB;EACnBC;AACK,CAAC,KAAK;EACX,OAAOL,eAAe,CAAC;IACrBK,OAAO;IACPC,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE;MAAEJ,QAAQ;MAAEC;IAAW,CAAC,CAAC;IAC3DI,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnB,IAAI,CAACL,QAAQ,IAAI,CAACC,UAAU,EAAE,OAAO,EAAE;MACvC,MAAMK,MAAM,GAAG,MAAMJ,mBAAmB,CAACK,GAAG,CAAC;QAAEP,QAAQ;QAAEC;MAAW,CAAC,CAAC;MACtE,OAAOK,MAAM,IAAI,EAAE;IACrB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useOfflineQuery } from "../offline/index.js";
|
|
4
|
+
export const useImages = ({
|
|
5
|
+
entityId,
|
|
6
|
+
entityType,
|
|
7
|
+
getMetadataImages,
|
|
8
|
+
storage
|
|
9
|
+
}) => {
|
|
10
|
+
return useOfflineQuery({
|
|
11
|
+
storage,
|
|
12
|
+
queryKey: ['Metadata', 'PHOTO', {
|
|
13
|
+
entityId,
|
|
14
|
+
entityType
|
|
15
|
+
}],
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
if (!entityId || !entityType) return [];
|
|
18
|
+
const result = await getMetadataImages.get({
|
|
19
|
+
entityId,
|
|
20
|
+
entityType
|
|
21
|
+
});
|
|
22
|
+
return result ?? [];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=use-images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useOfflineQuery","useImages","entityId","entityType","getMetadataImages","storage","queryKey","queryFn","result","get"],"sourceRoot":"../../../../../src","sources":["presentation/domain/metadata/use-images.ts"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,qBAAY;AAS5C,OAAO,MAAMC,SAAS,GAAGA,CAAC;EACxBC,QAAQ;EACRC,UAAU;EACVC,iBAAiB;EACjBC;AACK,CAAC,KAAK;EACX,OAAOL,eAAe,CAAC;IACrBK,OAAO;IACPC,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE;MAAEJ,QAAQ;MAAEC;IAAW,CAAC,CAAC;IACzDI,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnB,IAAI,CAACL,QAAQ,IAAI,CAACC,UAAU,EAAE,OAAO,EAAE;MACvC,MAAMK,MAAM,GAAG,MAAMJ,iBAAiB,CAACK,GAAG,CAAC;QAAEP,QAAQ;QAAEC;MAAW,CAAC,CAAC;MACpE,OAAOK,MAAM,IAAI,EAAE;IACrB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export * from "./use-offline-query.js";
|
|
4
|
+
export * from "./use-offline-mutation.js";
|
|
5
|
+
export * from "./use-infinite-offline-query.js";
|
|
6
|
+
export * from "./offline-mutation-queue-provider.js";
|
|
7
|
+
export * from "./use-offline-queue.js";
|
|
8
|
+
export * from "./use-offline-id.js";
|
|
9
|
+
export * from "./utils.js";
|
|
10
|
+
export * from "./types.js";
|
|
11
|
+
export * from "./use-offline-id-v2.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/index.ts"],"mappings":";;AAAA,cAAc,wBAAqB;AACnC,cAAc,2BAAwB;AACtC,cAAc,iCAA8B;AAC5C,cAAc,sCAAmC;AACjD,cAAc,wBAAqB;AACnC,cAAc,qBAAkB;AAChC,cAAc,YAAS;AACvB,cAAc,YAAS;AACvB,cAAc,wBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useNetInfo } from '@react-native-community/netinfo';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const OFFLINE_EXECUTION_INTERVAL_IN_MS = 10000;
|
|
7
|
+
export const OfflineMutationQueueContext = /*#__PURE__*/React.createContext({});
|
|
8
|
+
export const OfflineMutationQueueProvider = ({
|
|
9
|
+
queue,
|
|
10
|
+
children
|
|
11
|
+
}) => {
|
|
12
|
+
const {
|
|
13
|
+
isConnected,
|
|
14
|
+
isInternetReachable
|
|
15
|
+
} = useNetInfo();
|
|
16
|
+
const [queueSize, setQueueSize] = React.useState(0);
|
|
17
|
+
const [queueData, setQueueData] = React.useState([]);
|
|
18
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
19
|
+
const intervalId = React.useRef(undefined);
|
|
20
|
+
const hasConnection = React.useMemo(() => isConnected && isInternetReachable, [isConnected, isInternetReachable]);
|
|
21
|
+
const push = React.useCallback((key, offlineMutation) => {
|
|
22
|
+
if (!queue) return;
|
|
23
|
+
queue.push(key, offlineMutation);
|
|
24
|
+
}, [queue]);
|
|
25
|
+
const refetch = React.useCallback(() => {
|
|
26
|
+
if (!queue) return;
|
|
27
|
+
setIsLoading(true);
|
|
28
|
+
setQueueData(queue.list());
|
|
29
|
+
setQueueSize(queue.size());
|
|
30
|
+
setIsLoading(false);
|
|
31
|
+
}, [queue]);
|
|
32
|
+
const clearQueueData = React.useCallback(() => {
|
|
33
|
+
if (!queue) return;
|
|
34
|
+
if (queueSize) {
|
|
35
|
+
queue.clear();
|
|
36
|
+
setQueueData([]);
|
|
37
|
+
}
|
|
38
|
+
}, [queue, queueSize]);
|
|
39
|
+
const clearQueueInterval = React.useCallback(() => {
|
|
40
|
+
if (intervalId.current) {
|
|
41
|
+
clearInterval(intervalId.current);
|
|
42
|
+
intervalId.current = undefined;
|
|
43
|
+
}
|
|
44
|
+
}, []);
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (!queue) return;
|
|
47
|
+
if (!intervalId.current) {
|
|
48
|
+
intervalId.current = setInterval(async () => {
|
|
49
|
+
if (hasConnection) await queue.execute();
|
|
50
|
+
setQueueSize(queue.size());
|
|
51
|
+
setQueueData(queue.list());
|
|
52
|
+
}, OFFLINE_EXECUTION_INTERVAL_IN_MS);
|
|
53
|
+
}
|
|
54
|
+
return clearQueueInterval;
|
|
55
|
+
}, [queue, clearQueueInterval, hasConnection]);
|
|
56
|
+
return /*#__PURE__*/_jsx(OfflineMutationQueueContext.Provider, {
|
|
57
|
+
value: {
|
|
58
|
+
executing: Boolean(intervalId.current),
|
|
59
|
+
data: queueData,
|
|
60
|
+
size: queueSize,
|
|
61
|
+
clear: clearQueueData,
|
|
62
|
+
push,
|
|
63
|
+
refetch,
|
|
64
|
+
isLoading
|
|
65
|
+
},
|
|
66
|
+
children: children
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=offline-mutation-queue-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useNetInfo","jsx","_jsx","OFFLINE_EXECUTION_INTERVAL_IN_MS","OfflineMutationQueueContext","createContext","OfflineMutationQueueProvider","queue","children","isConnected","isInternetReachable","queueSize","setQueueSize","useState","queueData","setQueueData","isLoading","setIsLoading","intervalId","useRef","undefined","hasConnection","useMemo","push","useCallback","key","offlineMutation","refetch","list","size","clearQueueData","clear","clearQueueInterval","current","clearInterval","useEffect","setInterval","execute","Provider","value","executing","Boolean","data"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/offline-mutation-queue-provider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAkC,OAAO;AACrD,SAASC,UAAU,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG7D,MAAMC,gCAAgC,GAAG,KAAK;AAgB9C,OAAO,MAAMC,2BAA2B,gBACtCL,KAAK,CAACM,aAAa,CACjB,CAAC,CACH,CAAC;AAEH,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAgB,CAAC,KAAK;EAC1E,MAAM;IAAEC,WAAW;IAAEC;EAAoB,CAAC,GAAGV,UAAU,CAAC,CAAC;EACzD,MAAM,CAACW,SAAS,EAAEC,YAAY,CAAC,GAAGb,KAAK,CAACc,QAAQ,CAAC,CAAC,CAAC;EACnD,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGhB,KAAK,CAACc,QAAQ,CAAoB,EAAE,CAAC;EACvE,MAAM,CAACG,SAAS,EAAEC,YAAY,CAAC,GA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ENrB,KAAK,CAACoC,SAAS,CAAC,MAAM;IACpB,IAAI,CAAC5B,KAAK,EAAE;IACZ,IAAI,CAACW,UAAU,CAACe,OAAO,EAAE;MACvBf,UAAU,CAACe,OAAO,GAAGG,WAAW,CAAC,YAAY;QAC3C,IAAIf,aAAa,EAAE,MAAMd,KAAK,CAAC8B,OAAO,CAAC,CAAC;QACxCzB,YAAY,CAACL,KAAK,CAACsB,IAAI,CAAC,CAAC,CAAC;QAC1Bd,YAAY,CAACR,KAAK,CAACqB,IAAI,CAAC,CAAC,CAAC;MAC5B,CAAC,EAAEzB,gCAAgC,CAAC;IACtC;IACA,OAAO6B,kBAAkB;EAC3B,CAAC,EAAE,CAACzB,KAAK,EAAEyB,kBAAkB,EAAEX,aAAa,CAAC,CAAC;EAE9C,oBACEnB,IAAA,CAACE,2BAA2B,CAACkC,QAAQ;IACnCC,KAAK,EAAE;MACLC,SAAS,EAAEC,OAAO,CAACvB,UAAU,CAACe,OAAO,CAAC;MACtCS,IAAI,EAAE5B,SAAS;MACfe,IAAI,EAAElB,SAAS;MACfoB,KAAK,EAAED,cAAc;MACrBP,IAAI;MACJI,OAAO;MACPX;IACF,CAAE;IAAAR,QAAA,EAEDA;EAAQ,CAC2B,CAAC;AAE3C,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
5
|
+
import { handleInfiniteQuerySave, initialDataFallback } from "./utils.js";
|
|
6
|
+
import { UILoading } from "../../components/atoms/index.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const PAGE_SIZE = 30;
|
|
9
|
+
const MAX_STORED_PAGES = 5;
|
|
10
|
+
export const useInfiniteOfflineQuery = ({
|
|
11
|
+
queryKey,
|
|
12
|
+
initialData,
|
|
13
|
+
initialPageParam = 0,
|
|
14
|
+
queryFn,
|
|
15
|
+
storage,
|
|
16
|
+
...options
|
|
17
|
+
}) => {
|
|
18
|
+
const {
|
|
19
|
+
data: pageData,
|
|
20
|
+
fetchNextPage,
|
|
21
|
+
hasNextPage,
|
|
22
|
+
isFetching,
|
|
23
|
+
isFetchingNextPage,
|
|
24
|
+
...props
|
|
25
|
+
} = useInfiniteQuery({
|
|
26
|
+
queryKey,
|
|
27
|
+
initialPageParam,
|
|
28
|
+
queryFn: async ({
|
|
29
|
+
pageParam,
|
|
30
|
+
...context
|
|
31
|
+
}) => {
|
|
32
|
+
const data = await queryFn?.({
|
|
33
|
+
pageParam,
|
|
34
|
+
...context
|
|
35
|
+
});
|
|
36
|
+
if (pageParam <= MAX_STORED_PAGES) {
|
|
37
|
+
handleInfiniteQuerySave(queryKey, pageParam, data, storage);
|
|
38
|
+
}
|
|
39
|
+
return data ?? [];
|
|
40
|
+
},
|
|
41
|
+
getNextPageParam: (lastPage, pages) => {
|
|
42
|
+
if (!lastPage || lastPage.length < PAGE_SIZE) return undefined;
|
|
43
|
+
return pages.length + initialPageParam;
|
|
44
|
+
},
|
|
45
|
+
initialData: initialDataFallback(queryKey, initialData, storage),
|
|
46
|
+
...options
|
|
47
|
+
});
|
|
48
|
+
const data = React.useMemo(() => {
|
|
49
|
+
return pageData?.pages?.reduce((acc, item) => {
|
|
50
|
+
const value = item ?? [];
|
|
51
|
+
return [...acc, ...value];
|
|
52
|
+
}, []);
|
|
53
|
+
}, [pageData?.pages]);
|
|
54
|
+
const onEndReached = async () => {
|
|
55
|
+
if (!hasNextPage || isFetching || isFetchingNextPage) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await fetchNextPage();
|
|
59
|
+
};
|
|
60
|
+
const footer = hasNextPage ? /*#__PURE__*/_jsx(UILoading, {}) : null;
|
|
61
|
+
return {
|
|
62
|
+
data,
|
|
63
|
+
onEndReached,
|
|
64
|
+
footer,
|
|
65
|
+
isFetching,
|
|
66
|
+
...props
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=use-infinite-offline-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useInfiniteQuery","handleInfiniteQuerySave","initialDataFallback","UILoading","jsx","_jsx","PAGE_SIZE","MAX_STORED_PAGES","useInfiniteOfflineQuery","queryKey","initialData","initialPageParam","queryFn","storage","options","data","pageData","fetchNextPage","hasNextPage","isFetching","isFetchingNextPage","props","pageParam","context","getNextPageParam","lastPage","pages","length","undefined","useMemo","reduce","acc","item","value","onEndReached","footer"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/use-infinite-offline-query.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAGEC,gBAAgB,QACX,uBAAuB;AAE9B,SAASC,uBAAuB,EAAEC,mBAAmB,QAAQ,YAAS;AACtE,SAASC,SAAS,QAAQ,iCAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGnD,OAAO,MAAMC,SAAS,GAAG,EAAE;AAC3B,MAAMC,gBAAgB,GAAG,CAAC;AAkB1B,OAAO,MAAMC,uBAAuB,GAAGA,CAGrC;EACAC,QAAQ;EACRC,WAAW;EACXC,gBAAgB,GAAG,CAAC;EACpBC,OAAO;EACPC,OAAO;EACP,GAAGC;AAC+C,CAAC,KAAK;EACxD,MAAM;IACJC,IAAI,EAAEC,QAAQ;IACdC,aAAa;IACbC,WAAW;IACXC,UAAU;IACVC,kBAAkB;IAClB,GAAGC;EACL,CAAC,GAAGrB,gBAAgB,CAAC;IACnBS,QAAQ;IACRE,gBAAgB;IAChBC,OAAO,EAAE,MAAAA,CAAO;MAAEU,SAAS;MAAE,GAAGC;IAAQ,CAAC,KAAK;MAC5C,MAAMR,IAAI,GAAG,MAAOH,OAAO,GAAW;QAAEU,SAAS;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
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export const useOfflineIdV2 = ({
|
|
5
|
+
initialValue,
|
|
6
|
+
dependencies = [],
|
|
7
|
+
isomorphicIdManager
|
|
8
|
+
}) => {
|
|
9
|
+
const [id, setId] = React.useState(() => {
|
|
10
|
+
return isomorphicIdManager.create(initialValue ?? Date.now());
|
|
11
|
+
});
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
const isomorphicId = isomorphicIdManager.create(initialValue ?? Date.now());
|
|
14
|
+
setId(isomorphicId);
|
|
15
|
+
return () => {
|
|
16
|
+
isomorphicIdManager.remove(isomorphicId.get());
|
|
17
|
+
};
|
|
18
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
+
}, [isomorphicIdManager, initialValue, ...dependencies]);
|
|
20
|
+
return id;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=use-offline-id-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useOfflineIdV2","initialValue","dependencies","isomorphicIdManager","id","setId","useState","create","Date","now","useEffect","isomorphicId","remove","get"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/use-offline-id-v2.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AASzB,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAC7BC,YAAY;EACZC,YAAY,GAAG,EAAE;EACjBC;AACK,CAAC,KAAK;EACX,MAAM,CAACC,EAAE,EAAEC,KAAK,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAAmC,MAAM;IACzE,OAAOH,mBAAmB,CAACI,MAAM,CAACN,YAAY,IAAIO,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;EAC/D,CAAC,CAAC;EAEFV,KAAK,CAACW,SAAS,CAAC,MAAM;IACpB,MAAMC,YAAY,GAAGR,mBAAmB,CAACI,MAAM,CAACN,YAAY,IAAIO,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;IAC3EJ,KAAK,CAACM,YAAY,CAAC;IACnB,OAAO,MAAM;MACXR,mBAAmB,CAACS,MAAM,CAACD,YAAY,CAACE,GAAG,CAAC,CAAC,CAAC;IAChD,CAAC;IACD;EACF,CAAC,EAAE,CAACV,mBAAmB,EAAEF,YAAY,EAAE,GAAGC,YAAY,CAAC,CAAC;EAExD,OAAOE,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export const useOfflineId = initialValue => {
|
|
5
|
+
const [id, setId] = React.useState(initialValue ?? Date.now());
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
setId(initialValue ?? Date.now());
|
|
8
|
+
}, [initialValue]);
|
|
9
|
+
return id;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=use-offline-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useOfflineId","initialValue","id","setId","useState","Date","now","useEffect"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/use-offline-id.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAO,MAAMC,YAAY,GAAIC,YAAwB,IAAK;EACxD,MAAM,CAACC,EAAE,EAAEC,KAAK,CAAC,GAAGJ,KAAK,CAACK,QAAQ,CAAYH,YAAY,IAAII,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;EAEzEP,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpBJ,KAAK,CAACF,YAAY,IAAII,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;EACnC,CAAC,EAAE,CAACL,YAAY,CAAC,CAAC;EAElB,OAAOC,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import uuid from 'react-native-uuid';
|
|
5
|
+
import { useNetInfo } from '@react-native-community/netinfo';
|
|
6
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { useOfflineQueue } from "./use-offline-queue.js";
|
|
8
|
+
import { OfflineMutationStatus } from "../../../infra/index.js";
|
|
9
|
+
import { useOfflineId } from "./use-offline-id.js";
|
|
10
|
+
import { handleQueryRollback, handleQuerySuccess, isHttpClientError, isIsomorphicId } from "./utils.js";
|
|
11
|
+
const parseData = data => {
|
|
12
|
+
try {
|
|
13
|
+
return typeof data === 'string' ? JSON.parse(data) : data;
|
|
14
|
+
} catch (err) {
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export const useOfflineMutation = ({
|
|
19
|
+
type,
|
|
20
|
+
queryKeysToInvalidate = [],
|
|
21
|
+
dependencies = [],
|
|
22
|
+
multiple = false,
|
|
23
|
+
mutationFn,
|
|
24
|
+
context,
|
|
25
|
+
storage,
|
|
26
|
+
id: propsId,
|
|
27
|
+
...options
|
|
28
|
+
}) => {
|
|
29
|
+
const {
|
|
30
|
+
isConnected,
|
|
31
|
+
isInternetReachable
|
|
32
|
+
} = useNetInfo();
|
|
33
|
+
const queryClient = useQueryClient();
|
|
34
|
+
const queue = useOfflineQueue();
|
|
35
|
+
const id = useOfflineId(propsId);
|
|
36
|
+
const hasConnection = React.useMemo(() => isConnected && isInternetReachable, [isConnected, isInternetReachable]);
|
|
37
|
+
const mutation = useMutation({
|
|
38
|
+
...options,
|
|
39
|
+
mutationFn,
|
|
40
|
+
onError: (error, variables, onMutateResult, context) => {
|
|
41
|
+
pushOfflineMutation(error);
|
|
42
|
+
options?.onError?.(error, variables, onMutateResult, context);
|
|
43
|
+
if (!isHttpClientError(error) || isHttpClientError(error) && (error?.response?.statusCode || hasConnection)) {
|
|
44
|
+
for (const queryKey of queryKeysToInvalidate) {
|
|
45
|
+
handleQueryRollback({
|
|
46
|
+
queryClient,
|
|
47
|
+
queryKey,
|
|
48
|
+
storage
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
onSuccess: async (data, variables, onMutateResult, context) => {
|
|
54
|
+
await options?.onSuccess?.(data, variables, onMutateResult, context);
|
|
55
|
+
for (const queryKey of queryKeysToInvalidate) {
|
|
56
|
+
handleQuerySuccess({
|
|
57
|
+
queryClient,
|
|
58
|
+
queryKey
|
|
59
|
+
});
|
|
60
|
+
queryClient.invalidateQueries({
|
|
61
|
+
queryKey
|
|
62
|
+
});
|
|
63
|
+
queryClient.refetchQueries({
|
|
64
|
+
queryKey
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const pushOfflineMutation = React.useCallback(error => {
|
|
70
|
+
if (isHttpClientError(error) && (!error?.response?.statusCode || !hasConnection)) {
|
|
71
|
+
const {
|
|
72
|
+
url,
|
|
73
|
+
method,
|
|
74
|
+
body
|
|
75
|
+
} = error;
|
|
76
|
+
const {
|
|
77
|
+
params,
|
|
78
|
+
headers
|
|
79
|
+
} = error.config ?? {};
|
|
80
|
+
const parsedData = parseData(body);
|
|
81
|
+
const offlineMutation = {
|
|
82
|
+
id: String(id),
|
|
83
|
+
data: {
|
|
84
|
+
url: url,
|
|
85
|
+
method: method,
|
|
86
|
+
params,
|
|
87
|
+
headers,
|
|
88
|
+
body: parsedData
|
|
89
|
+
},
|
|
90
|
+
status: OfflineMutationStatus.PENDING,
|
|
91
|
+
dependencies: dependencies.map(value => isIsomorphicId(value) ? value : String(value)),
|
|
92
|
+
queryKeysToInvalidate,
|
|
93
|
+
type,
|
|
94
|
+
response: null,
|
|
95
|
+
error: error,
|
|
96
|
+
createdAt: new Date(),
|
|
97
|
+
context
|
|
98
|
+
};
|
|
99
|
+
if (multiple) {
|
|
100
|
+
const currentId = uuid.v4();
|
|
101
|
+
queue.push(String(currentId), {
|
|
102
|
+
...offlineMutation,
|
|
103
|
+
id: String(currentId)
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
queue.push(String(id), offlineMutation);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, [id, multiple, queryKeysToInvalidate, queue, type, dependencies, hasConnection, context]);
|
|
110
|
+
return {
|
|
111
|
+
id,
|
|
112
|
+
...mutation
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=use-offline-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","uuid","useNetInfo","useMutation","useQueryClient","useOfflineQueue","OfflineMutationStatus","useOfflineId","handleQueryRollback","handleQuerySuccess","isHttpClientError","isIsomorphicId","parseData","data","JSON","parse","err","useOfflineMutation","type","queryKeysToInvalidate","dependencies","multiple","mutationFn","context","storage","id","propsId","options","isConnected","isInternetReachable","queryClient","queue","hasConnection","useMemo","mutation","onError","error","variables","onMutateResult","pushOfflineMutation","response","statusCode","queryKey","onSuccess","invalidateQueries","refetchQueries","useCallback","url","method","body","params","headers","config","parsedData","offlineMutation","String","status","PENDING","map","value","createdAt","Date","currentId","v4","push"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/use-offline-mutation.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,UAAU,QAAQ,iCAAiC;AAC5D,SAGEC,WAAW,EACXC,cAAc,QACT,uBAAuB;AAE9B,SAASC,eAAe,QAAQ,wBAAqB;AACrD,SAEEC,qBAAqB,QAGhB,yBAAgB;AACvB,SAASC,YAAY,QAAQ,qBAAkB;AAC/C,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,iBAAiB,EACjBC,cAAc,QACT,YAAS;AAIhB,MAAMC,SAAS,GAAIC,IAAS,IAAK;EAC/B,IAAI;IACF,OAAO,OAAOA,IAAI,KAAK,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC,GAAGA,IAAI;EAC3D,CAAC,CAAC,OAAOG,GAAG,EAAE;I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IAAI;QACdJ,KAAK,EAAEA,KAAK;QACZwB,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC;QACrBtC;MACF,CAAC;MACD,IAAIF,QAAQ,EAAE;QACZ,MAAMyC,SAAS,GAAG7D,IAAI,CAAC8D,EAAE,CAAC,CAAC;QAC3BhC,KAAK,CAACiC,IAAI,CAACT,MAAM,CAACO,SAAS,CAAC,EAAE;UAC5B,GAAGR,eAAe;UAClB7B,EAAE,EAAE8B,MAAM,CAACO,SAAS;QACtB,CAAC,CAAC;MACJ,CAAC,MAAM;QACL/B,KAAK,CAACiC,IAAI,CAACT,MAAM,CAAC9B,EAAE,CAAC,EAAE6B,eAAe,CAAC;MACzC;IACF;EACF,CAAC,EACD,CACE7B,EAAE,EACFJ,QAAQ,EACRF,qBAAqB,EACrBY,KAAK,EACLb,IAAI,EACJE,YAAY,EACZY,aAAa,EACbT,OAAO,CAEX,CAAC;EAED,OAAO;IACLE,EAAE;IACF,GAAGS;EACL,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { hashKey, useQuery } from '@tanstack/react-query';
|
|
4
|
+
import { isInvalidData } from "./utils.js";
|
|
5
|
+
export const useOfflineQuery = ({
|
|
6
|
+
queryKey,
|
|
7
|
+
queryFn,
|
|
8
|
+
storage,
|
|
9
|
+
initialData,
|
|
10
|
+
...options
|
|
11
|
+
}) => {
|
|
12
|
+
return useQuery({
|
|
13
|
+
queryKey,
|
|
14
|
+
queryFn: async context => {
|
|
15
|
+
const data = await queryFn?.(context);
|
|
16
|
+
if (isInvalidData(data)) {
|
|
17
|
+
throw new Error('Um erro inesperado ocorreu, tente novamente mais tarde.');
|
|
18
|
+
}
|
|
19
|
+
storage.setItem(hashKey(queryKey), data);
|
|
20
|
+
return data ?? null;
|
|
21
|
+
},
|
|
22
|
+
initialData: initialData ?? (() => {
|
|
23
|
+
const data = storage.getItem(hashKey(queryKey));
|
|
24
|
+
if (isInvalidData(data)) {
|
|
25
|
+
storage.removeItem(hashKey(queryKey));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
return data ?? undefined;
|
|
29
|
+
}),
|
|
30
|
+
...options
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=use-offline-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hashKey","useQuery","isInvalidData","useOfflineQuery","queryKey","queryFn","storage","initialData","options","context","data","Error","setItem","getItem","removeItem","undefined"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/use-offline-query.ts"],"mappings":";;AAAA,SACEA,OAAO,EACPC,QAAQ,QAGH,uBAAuB;AAE9B,SAASC,aAAa,QAAQ,YAAS;AAWvC,OAAO,MAAMC,eAAe,GAAGA,CAK7B;EACAC,QAAQ;EACRC,OAAO;EACPC,OAAO;EACPC,WAAW;EACX,GAAGC;AAC2C,CAAC,KAAK;EACpD,OAAOP,QAAQ,CAAC;IACdG,QAAQ;IACRC,OAAO,EAAE,MAAOI,OAAO,IAAK;MAC1B,MAAMC,IAAI,GAAG,MAAOL,OAAO,GAAWI,OAAO,CAAC;MAC9C,IAAIP,aAAa,CAACQ,IAAI,CAAC,EAAE;QACvB,MAAM,IAAIC,KAAK,CACb,yDACF,CAAC;MACH;MACAL,OAAO,CAACM,OAAO,CAACZ,OAAO,CAACI,QAAQ,CAAC,EAAEM,IAAI,CAAC;MACxC,OAAQA,IAAI,IAAI,IAAI;IACtB,CAAC;IACDH,WAAW,EACTA,WAAW,KACV,MAAM;MACL,MAAMG,IAAI,GAAGJ,OAAO,CAACO,OAAO,CAAeb,OAAO,CAACI,QAAQ,CAAC,CAAC;MAC7D,IAAIF,aAAa,CAACQ,IAAI,CAAC,EAAE;QACvBJ,OAAO,CAACQ,UAAU,CAACd,OAAO,CAACI,QAAQ,CAAC,CAAC;QACrC;MACF;MACA,OAAOM,IAAI,IAAIK,SAAS;IAC1B,CAAC,CAAC;IACJ,GAAGP;EACL,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { OfflineMutationQueueContext } from "./offline-mutation-queue-provider.js";
|
|
5
|
+
export const useOfflineQueue = () => {
|
|
6
|
+
return React.useContext(OfflineMutationQueueContext);
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=use-offline-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","OfflineMutationQueueContext","useOfflineQueue","useContext"],"sourceRoot":"../../../../../src","sources":["presentation/domain/offline/use-offline-queue.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,2BAA2B,QAAQ,sCAAmC;AAE/E,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACnC,OAAOF,KAAK,CAACG,UAAU,CAACF,2BAA2B,CAAC;AACtD,CAAC","ignoreList":[]}
|