@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,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type InfiniteData,
|
|
5
|
+
type QueryKey,
|
|
6
|
+
useInfiniteQuery,
|
|
7
|
+
} from '@tanstack/react-query';
|
|
8
|
+
|
|
9
|
+
import { handleInfiniteQuerySave, initialDataFallback } from './utils';
|
|
10
|
+
import { UILoading } from '../../components/atoms';
|
|
11
|
+
import type { Storage } from '../../../data/protocols';
|
|
12
|
+
|
|
13
|
+
export const PAGE_SIZE = 30;
|
|
14
|
+
const MAX_STORED_PAGES = 5;
|
|
15
|
+
|
|
16
|
+
type InfiniteOfflineQueryParams<TQueryFnData, TError> = Omit<
|
|
17
|
+
Parameters<
|
|
18
|
+
typeof useInfiniteQuery<
|
|
19
|
+
TQueryFnData,
|
|
20
|
+
TError,
|
|
21
|
+
InfiniteData<TQueryFnData, number>,
|
|
22
|
+
QueryKey,
|
|
23
|
+
number
|
|
24
|
+
>
|
|
25
|
+
>[0],
|
|
26
|
+
'getNextPageParam' | 'initialPageParam'
|
|
27
|
+
> & {
|
|
28
|
+
initialPageParam?: number;
|
|
29
|
+
storage: Storage;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const useInfiniteOfflineQuery = <
|
|
33
|
+
TQueryFnData extends any,
|
|
34
|
+
TError = unknown,
|
|
35
|
+
>({
|
|
36
|
+
queryKey,
|
|
37
|
+
initialData,
|
|
38
|
+
initialPageParam = 0,
|
|
39
|
+
queryFn,
|
|
40
|
+
storage,
|
|
41
|
+
...options
|
|
42
|
+
}: InfiniteOfflineQueryParams<TQueryFnData[], TError>) => {
|
|
43
|
+
const {
|
|
44
|
+
data: pageData,
|
|
45
|
+
fetchNextPage,
|
|
46
|
+
hasNextPage,
|
|
47
|
+
isFetching,
|
|
48
|
+
isFetchingNextPage,
|
|
49
|
+
...props
|
|
50
|
+
} = useInfiniteQuery({
|
|
51
|
+
queryKey,
|
|
52
|
+
initialPageParam,
|
|
53
|
+
queryFn: async ({ pageParam, ...context }) => {
|
|
54
|
+
const data = await (queryFn as any)?.({ pageParam, ...context });
|
|
55
|
+
if (pageParam <= MAX_STORED_PAGES) {
|
|
56
|
+
handleInfiniteQuerySave(queryKey, pageParam, data, storage);
|
|
57
|
+
}
|
|
58
|
+
return (data ?? []) as TQueryFnData[];
|
|
59
|
+
},
|
|
60
|
+
getNextPageParam: (lastPage, pages) => {
|
|
61
|
+
if (!lastPage || lastPage.length < PAGE_SIZE) return undefined;
|
|
62
|
+
return pages.length + initialPageParam;
|
|
63
|
+
},
|
|
64
|
+
initialData: initialDataFallback<InfiniteData<TQueryFnData, number>>(
|
|
65
|
+
queryKey,
|
|
66
|
+
initialData,
|
|
67
|
+
storage
|
|
68
|
+
),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const data = React.useMemo(() => {
|
|
73
|
+
return pageData?.pages?.reduce<TQueryFnData[]>((acc, item) => {
|
|
74
|
+
const value = item ?? [];
|
|
75
|
+
return [...acc, ...value];
|
|
76
|
+
}, []);
|
|
77
|
+
}, [pageData?.pages]);
|
|
78
|
+
|
|
79
|
+
const onEndReached = async () => {
|
|
80
|
+
if (!hasNextPage || isFetching || isFetchingNextPage) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
await fetchNextPage();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const footer = hasNextPage ? <UILoading /> : null;
|
|
87
|
+
|
|
88
|
+
return { data, onEndReached, footer, isFetching, ...props };
|
|
89
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IsomorphicIdManager } from '../../../infra';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
initialValue?: number;
|
|
6
|
+
dependencies?: any[];
|
|
7
|
+
isomorphicIdManager: IsomorphicIdManager;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const useOfflineIdV2 = ({
|
|
11
|
+
initialValue,
|
|
12
|
+
dependencies = [],
|
|
13
|
+
isomorphicIdManager,
|
|
14
|
+
}: Props) => {
|
|
15
|
+
const [id, setId] = React.useState<IsomorphicIdManager.IsomorphicId>(() => {
|
|
16
|
+
return isomorphicIdManager.create(initialValue ?? Date.now());
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const isomorphicId = isomorphicIdManager.create(initialValue ?? Date.now());
|
|
21
|
+
setId(isomorphicId);
|
|
22
|
+
return () => {
|
|
23
|
+
isomorphicIdManager.remove(isomorphicId.get());
|
|
24
|
+
};
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, [isomorphicIdManager, initialValue, ...dependencies]);
|
|
27
|
+
|
|
28
|
+
return id;
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OfflineId } from './types';
|
|
3
|
+
|
|
4
|
+
export const useOfflineId = (initialValue?: OfflineId) => {
|
|
5
|
+
const [id, setId] = React.useState<OfflineId>(initialValue ?? Date.now());
|
|
6
|
+
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
setId(initialValue ?? Date.now());
|
|
9
|
+
}, [initialValue]);
|
|
10
|
+
|
|
11
|
+
return id;
|
|
12
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import uuid from 'react-native-uuid';
|
|
3
|
+
import { useNetInfo } from '@react-native-community/netinfo';
|
|
4
|
+
import {
|
|
5
|
+
type UseMutationOptions,
|
|
6
|
+
type QueryKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
useQueryClient,
|
|
9
|
+
} from '@tanstack/react-query';
|
|
10
|
+
|
|
11
|
+
import { useOfflineQueue } from './use-offline-queue';
|
|
12
|
+
import {
|
|
13
|
+
IsomorphicIdManager,
|
|
14
|
+
OfflineMutationStatus,
|
|
15
|
+
type OfflineActions,
|
|
16
|
+
type OfflineMutation,
|
|
17
|
+
} from '../../../infra';
|
|
18
|
+
import { useOfflineId } from './use-offline-id';
|
|
19
|
+
import {
|
|
20
|
+
handleQueryRollback,
|
|
21
|
+
handleQuerySuccess,
|
|
22
|
+
isHttpClientError,
|
|
23
|
+
isIsomorphicId,
|
|
24
|
+
} from './utils';
|
|
25
|
+
import type { Dependency, OfflineId } from './types';
|
|
26
|
+
import type { Storage } from '../../../data/protocols';
|
|
27
|
+
|
|
28
|
+
const parseData = (data: any) => {
|
|
29
|
+
try {
|
|
30
|
+
return typeof data === 'string' ? JSON.parse(data) : data;
|
|
31
|
+
} catch (err) {
|
|
32
|
+
return data;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type OfflineOptions = {
|
|
37
|
+
type: keyof OfflineActions;
|
|
38
|
+
id?: OfflineId;
|
|
39
|
+
dependencies?: Dependency[];
|
|
40
|
+
queryKeysToInvalidate?: QueryKey[];
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
context?: any;
|
|
43
|
+
storage?: Storage;
|
|
44
|
+
isomorphicIdManager?: IsomorphicIdManager;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const useOfflineMutation = <TData, TError, TVariables>({
|
|
48
|
+
type,
|
|
49
|
+
queryKeysToInvalidate = [],
|
|
50
|
+
dependencies = [],
|
|
51
|
+
multiple = false,
|
|
52
|
+
mutationFn,
|
|
53
|
+
context,
|
|
54
|
+
storage,
|
|
55
|
+
id: propsId,
|
|
56
|
+
...options
|
|
57
|
+
}: UseMutationOptions<TData, TError, TVariables, any> & OfflineOptions) => {
|
|
58
|
+
const { isConnected, isInternetReachable } = useNetInfo();
|
|
59
|
+
const queryClient = useQueryClient();
|
|
60
|
+
const queue = useOfflineQueue();
|
|
61
|
+
const id = useOfflineId(propsId);
|
|
62
|
+
|
|
63
|
+
const hasConnection = React.useMemo(
|
|
64
|
+
() => isConnected && isInternetReachable,
|
|
65
|
+
[isConnected, isInternetReachable]
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const mutation = useMutation<TData, TError, TVariables, any>({
|
|
69
|
+
...options,
|
|
70
|
+
mutationFn,
|
|
71
|
+
onError: (error, variables, onMutateResult, context) => {
|
|
72
|
+
pushOfflineMutation(error);
|
|
73
|
+
options?.onError?.(error, variables, onMutateResult, context);
|
|
74
|
+
if (
|
|
75
|
+
!isHttpClientError(error) ||
|
|
76
|
+
(isHttpClientError(error) &&
|
|
77
|
+
(error?.response?.statusCode || hasConnection))
|
|
78
|
+
) {
|
|
79
|
+
for (const queryKey of queryKeysToInvalidate) {
|
|
80
|
+
handleQueryRollback({ queryClient, queryKey, storage });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
onSuccess: async (data, variables, onMutateResult, context) => {
|
|
85
|
+
await options?.onSuccess?.(data, variables, onMutateResult, context);
|
|
86
|
+
for (const queryKey of queryKeysToInvalidate) {
|
|
87
|
+
handleQuerySuccess({ queryClient, queryKey });
|
|
88
|
+
queryClient.invalidateQueries({ queryKey });
|
|
89
|
+
queryClient.refetchQueries({ queryKey });
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const pushOfflineMutation = React.useCallback(
|
|
95
|
+
(error: any) => {
|
|
96
|
+
if (
|
|
97
|
+
isHttpClientError(error) &&
|
|
98
|
+
(!error?.response?.statusCode || !hasConnection)
|
|
99
|
+
) {
|
|
100
|
+
const { url, method, body } = error;
|
|
101
|
+
const { params, headers } = error.config ?? {};
|
|
102
|
+
const parsedData = parseData(body);
|
|
103
|
+
const offlineMutation: OfflineMutation = {
|
|
104
|
+
id: String(id),
|
|
105
|
+
data: {
|
|
106
|
+
url: url!,
|
|
107
|
+
method: method as any,
|
|
108
|
+
params,
|
|
109
|
+
headers,
|
|
110
|
+
body: parsedData,
|
|
111
|
+
},
|
|
112
|
+
status: OfflineMutationStatus.PENDING,
|
|
113
|
+
dependencies: dependencies.map((value) =>
|
|
114
|
+
isIsomorphicId(value) ? value : String(value)
|
|
115
|
+
),
|
|
116
|
+
queryKeysToInvalidate,
|
|
117
|
+
type,
|
|
118
|
+
response: null,
|
|
119
|
+
error: error,
|
|
120
|
+
createdAt: new Date(),
|
|
121
|
+
context,
|
|
122
|
+
};
|
|
123
|
+
if (multiple) {
|
|
124
|
+
const currentId = uuid.v4();
|
|
125
|
+
queue.push(String(currentId), {
|
|
126
|
+
...offlineMutation,
|
|
127
|
+
id: String(currentId),
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
queue.push(String(id), offlineMutation);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
[
|
|
135
|
+
id,
|
|
136
|
+
multiple,
|
|
137
|
+
queryKeysToInvalidate,
|
|
138
|
+
queue,
|
|
139
|
+
type,
|
|
140
|
+
dependencies,
|
|
141
|
+
hasConnection,
|
|
142
|
+
context,
|
|
143
|
+
]
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
id,
|
|
148
|
+
...mutation,
|
|
149
|
+
};
|
|
150
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hashKey,
|
|
3
|
+
useQuery,
|
|
4
|
+
type QueryKey,
|
|
5
|
+
type UseQueryOptions,
|
|
6
|
+
} from '@tanstack/react-query';
|
|
7
|
+
import type { Storage } from '../../../data/protocols';
|
|
8
|
+
import { isInvalidData } from './utils';
|
|
9
|
+
|
|
10
|
+
type Params<
|
|
11
|
+
TQueryFnData,
|
|
12
|
+
TError,
|
|
13
|
+
TData,
|
|
14
|
+
TQueryKey extends QueryKey,
|
|
15
|
+
> = UseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
16
|
+
storage: Storage;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const useOfflineQuery = <
|
|
20
|
+
TQueryFnData = unknown,
|
|
21
|
+
TError = unknown,
|
|
22
|
+
TData = TQueryFnData,
|
|
23
|
+
TQueryKey extends QueryKey = QueryKey,
|
|
24
|
+
>({
|
|
25
|
+
queryKey,
|
|
26
|
+
queryFn,
|
|
27
|
+
storage,
|
|
28
|
+
initialData,
|
|
29
|
+
...options
|
|
30
|
+
}: Params<TQueryFnData, TError, TData, TQueryKey>) => {
|
|
31
|
+
return useQuery({
|
|
32
|
+
queryKey,
|
|
33
|
+
queryFn: async (context) => {
|
|
34
|
+
const data = await (queryFn as any)?.(context);
|
|
35
|
+
if (isInvalidData(data)) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
'Um erro inesperado ocorreu, tente novamente mais tarde.'
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
storage.setItem(hashKey(queryKey), data);
|
|
41
|
+
return (data ?? null) as TQueryFnData;
|
|
42
|
+
},
|
|
43
|
+
initialData:
|
|
44
|
+
initialData ??
|
|
45
|
+
(() => {
|
|
46
|
+
const data = storage.getItem<TQueryFnData>(hashKey(queryKey));
|
|
47
|
+
if (isInvalidData(data)) {
|
|
48
|
+
storage.removeItem(hashKey(queryKey));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
return data ?? undefined;
|
|
52
|
+
}),
|
|
53
|
+
...options,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hashKey,
|
|
3
|
+
type InfiniteData,
|
|
4
|
+
type QueryKey,
|
|
5
|
+
} from '@tanstack/react-query';
|
|
6
|
+
import type { Storage } from '../../../data/protocols';
|
|
7
|
+
import type { OptimisticRollbackParams, OptimisticUpdateParams } from './types';
|
|
8
|
+
import { HttpClientError } from '../../../data/errors';
|
|
9
|
+
import { IsomorphicIdManager } from '../../../infra/isomorphic-id-manager';
|
|
10
|
+
|
|
11
|
+
export const isHttpClientError = (
|
|
12
|
+
error: any
|
|
13
|
+
): error is HttpClientError<any> => {
|
|
14
|
+
return error instanceof HttpClientError;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const isIsomorphicId = (
|
|
18
|
+
isomorphicId: any
|
|
19
|
+
): isomorphicId is IsomorphicIdManager.IsomorphicId => {
|
|
20
|
+
return isomorphicId instanceof IsomorphicIdManager.IsomorphicId;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const isOfflineId = (id: any): boolean => {
|
|
24
|
+
return isIsomorphicId(id) && id.isOffline();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const isFromOfflineId = (id: any): boolean => {
|
|
28
|
+
return isIsomorphicId(id) && id.isFromOffline();
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const isFromRealId = (id: any): boolean => {
|
|
32
|
+
return isIsomorphicId(id) && !id.isFromOffline();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const handleClearQueryRollback = ({
|
|
36
|
+
queryClient,
|
|
37
|
+
queryKey,
|
|
38
|
+
}: OptimisticRollbackParams) => {
|
|
39
|
+
if (!queryKey) return;
|
|
40
|
+
queryClient.removeQueries({ queryKey: ['__rollback', queryKey] });
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const handleQueryUpdate = async <T>({
|
|
44
|
+
queryKey,
|
|
45
|
+
queryClient,
|
|
46
|
+
handler,
|
|
47
|
+
storage,
|
|
48
|
+
fallbackData = {},
|
|
49
|
+
}: OptimisticUpdateParams<T>) => {
|
|
50
|
+
queryClient.cancelQueries({ queryKey });
|
|
51
|
+
const data =
|
|
52
|
+
queryClient.getQueryData<T>(queryKey) ??
|
|
53
|
+
storage?.getItem<T>(hashKey(queryKey));
|
|
54
|
+
queryClient.setQueryData(['__rollback', queryKey], data);
|
|
55
|
+
const result = await handler(data ?? fallbackData);
|
|
56
|
+
queryClient.setQueryData(queryKey, result);
|
|
57
|
+
storage?.setItem(hashKey(queryKey), result);
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const handleQueryRollback = <T = any>({
|
|
62
|
+
queryClient,
|
|
63
|
+
queryKey,
|
|
64
|
+
storage,
|
|
65
|
+
}: OptimisticRollbackParams) => {
|
|
66
|
+
const rollbackData = queryClient.getQueryData<T>(['__rollback', queryKey]);
|
|
67
|
+
queryClient.setQueryData(queryKey, rollbackData);
|
|
68
|
+
storage?.setItem(hashKey(queryKey), rollbackData);
|
|
69
|
+
handleClearQueryRollback({
|
|
70
|
+
queryClient,
|
|
71
|
+
queryKey,
|
|
72
|
+
});
|
|
73
|
+
return rollbackData;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const handleQuerySuccess = ({
|
|
77
|
+
queryClient,
|
|
78
|
+
queryKey,
|
|
79
|
+
}: OptimisticRollbackParams) => {
|
|
80
|
+
handleClearQueryRollback({
|
|
81
|
+
queryClient,
|
|
82
|
+
queryKey,
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const handleInfiniteQuerySave = <T>(
|
|
87
|
+
queryKey: QueryKey,
|
|
88
|
+
pageParam: number,
|
|
89
|
+
data: T[],
|
|
90
|
+
storage: Storage
|
|
91
|
+
) => {
|
|
92
|
+
const { pages: currentPages, pageParams: currentPageParams } =
|
|
93
|
+
storage.getItem<InfiniteData<T[], number>>(hashKey(queryKey)) ?? {};
|
|
94
|
+
if (isInvalidData(data)) {
|
|
95
|
+
storage?.removeItem(hashKey(queryKey));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let pages = [data];
|
|
99
|
+
let pageParams = [pageParam];
|
|
100
|
+
if (currentPages) {
|
|
101
|
+
pages = currentPages.map((page, index) => {
|
|
102
|
+
if (index === pageParam) return data;
|
|
103
|
+
return page;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (currentPageParams) {
|
|
107
|
+
pageParams = currentPageParams.map((page, index) => {
|
|
108
|
+
if (index === pageParam) return pageParam;
|
|
109
|
+
return page;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
storage.setItem<InfiniteData<T[], number>>(hashKey(queryKey), {
|
|
113
|
+
pages,
|
|
114
|
+
pageParams,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const initialDataFallback = <T>(
|
|
119
|
+
queryKey: QueryKey,
|
|
120
|
+
cb: any,
|
|
121
|
+
storage?: Storage
|
|
122
|
+
) => {
|
|
123
|
+
if (cb) return cb;
|
|
124
|
+
const data = storage?.getItem<T>(hashKey(queryKey));
|
|
125
|
+
if (isInvalidData(data)) {
|
|
126
|
+
storage?.removeItem(hashKey(queryKey));
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
return data ?? undefined;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const isInvalidData = (data: any) => {
|
|
133
|
+
return (
|
|
134
|
+
typeof data === 'string' &&
|
|
135
|
+
(data.includes('<!DOCTYPE') ||
|
|
136
|
+
data.includes('<html') ||
|
|
137
|
+
data.includes('<?xml'))
|
|
138
|
+
);
|
|
139
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './zuq-core-provider';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { PortalHost, PortalProvider } from '@gorhom/portal';
|
|
4
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
5
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
6
|
+
import { KeyboardProvider } from 'react-native-keyboard-controller';
|
|
7
|
+
import { OfflineMutationQueueProvider } from '../offline';
|
|
8
|
+
import type { OfflineMutationQueue } from '../../../infra';
|
|
9
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
10
|
+
import type { Storage } from '../../../data/protocols';
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
queue?: OfflineMutationQueue;
|
|
15
|
+
storage: Storage;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const queryClient = new QueryClient({
|
|
19
|
+
defaultOptions: {
|
|
20
|
+
queries: {
|
|
21
|
+
retry: 1,
|
|
22
|
+
refetchOnMount: true,
|
|
23
|
+
gcTime: 1000 * 60 * 60 * 24,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const ZUQCoreProvider = ({ children, queue }: Props) => {
|
|
29
|
+
return (
|
|
30
|
+
<SafeAreaProvider>
|
|
31
|
+
<KeyboardProvider>
|
|
32
|
+
<QueryClientProvider client={queryClient}>
|
|
33
|
+
<GestureHandlerRootView style={styles.root}>
|
|
34
|
+
<OfflineMutationQueueProvider queue={queue}>
|
|
35
|
+
<PortalProvider>
|
|
36
|
+
{children}
|
|
37
|
+
<PortalHost name="sheet" />
|
|
38
|
+
<PortalHost name="camera" />
|
|
39
|
+
</PortalProvider>
|
|
40
|
+
</OfflineMutationQueueProvider>
|
|
41
|
+
</GestureHandlerRootView>
|
|
42
|
+
</QueryClientProvider>
|
|
43
|
+
</KeyboardProvider>
|
|
44
|
+
</SafeAreaProvider>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
root: {
|
|
50
|
+
flex: 1,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as ReactQuery from '@tanstack/react-query';
|
|
2
|
+
import type {
|
|
3
|
+
UseMutationOptions,
|
|
4
|
+
UseQueryOptions,
|
|
5
|
+
QueryKey,
|
|
6
|
+
InfiniteData,
|
|
7
|
+
} from '@tanstack/react-query';
|
|
8
|
+
|
|
9
|
+
export const { hashKey, useMutation, useQuery, useQueryClient } = ReactQuery;
|
|
10
|
+
export type { UseMutationOptions, UseQueryOptions, QueryKey, InfiniteData };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Keyboard } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export const useActionSheet = (initialValue = false) => {
|
|
5
|
+
const [visible, setVisible] = React.useState(initialValue);
|
|
6
|
+
|
|
7
|
+
const onOpen = React.useCallback(() => {
|
|
8
|
+
setVisible(true);
|
|
9
|
+
Keyboard.dismiss();
|
|
10
|
+
}, []);
|
|
11
|
+
|
|
12
|
+
const onClose = React.useCallback(() => {
|
|
13
|
+
setVisible(false);
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
visible,
|
|
18
|
+
onOpen,
|
|
19
|
+
onClose,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type ImageType = {
|
|
4
|
+
name: string;
|
|
5
|
+
uri: string;
|
|
6
|
+
type: string;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SignatureRef = {
|
|
11
|
+
isDirty: boolean;
|
|
12
|
+
save: () => Promise<ImageType | undefined>;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const useSignatureRef = () => {
|
|
17
|
+
const ref = React.useRef<SignatureRef>(null);
|
|
18
|
+
return ref;
|
|
19
|
+
};
|