@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,271 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import axios, { AxiosError } from 'axios';
|
|
4
|
+
import type { AxiosResponse } from 'axios';
|
|
5
|
+
|
|
6
|
+
import { HttpClient, type Storage } from '../data/protocols';
|
|
7
|
+
import { HttpClientError } from '../data/errors';
|
|
8
|
+
import type {
|
|
9
|
+
RecordRequest,
|
|
10
|
+
UserAuthentication,
|
|
11
|
+
UserLogout,
|
|
12
|
+
} from '../domain/use-cases';
|
|
13
|
+
import { addEventListener } from '@react-native-community/netinfo';
|
|
14
|
+
|
|
15
|
+
export class AxiosHttpClientAdapter implements HttpClient {
|
|
16
|
+
private readonly client;
|
|
17
|
+
private readonly storage: Storage;
|
|
18
|
+
private readonly recorder: RecordRequest;
|
|
19
|
+
public readonly login?: UserAuthentication;
|
|
20
|
+
private isConnected: boolean | null = null;
|
|
21
|
+
public readonly logout?: UserLogout;
|
|
22
|
+
private hasConnection: boolean | null = null;
|
|
23
|
+
private isRefreshingAuth: Promise<any> | null = null;
|
|
24
|
+
|
|
25
|
+
constructor(url: string, params: AxiosHttpClientAdapter.Options) {
|
|
26
|
+
const { storage, recorder, login, logout } = params ?? {};
|
|
27
|
+
this.storage = storage;
|
|
28
|
+
this.recorder = recorder;
|
|
29
|
+
this.login = login;
|
|
30
|
+
this.logout = logout;
|
|
31
|
+
this.client = axios.create({
|
|
32
|
+
baseURL: url,
|
|
33
|
+
headers: {
|
|
34
|
+
'platform': Platform.OS,
|
|
35
|
+
'accept': 'application/json',
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
addEventListener((state) => {
|
|
40
|
+
this.hasConnection = Boolean(
|
|
41
|
+
state.isConnected && state.isInternetReachable
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private throwIfNotConnectedOrExecuted(
|
|
47
|
+
method: HttpClient.Method,
|
|
48
|
+
url: string,
|
|
49
|
+
body?: any,
|
|
50
|
+
config?: HttpClient.Config
|
|
51
|
+
) {
|
|
52
|
+
const isOffline = config?.offline?.id?.isOffline() ?? false;
|
|
53
|
+
if (this.hasConnection === false || isOffline) {
|
|
54
|
+
throw new HttpClientError({
|
|
55
|
+
method,
|
|
56
|
+
url,
|
|
57
|
+
body,
|
|
58
|
+
config,
|
|
59
|
+
response: {
|
|
60
|
+
statusCode: undefined,
|
|
61
|
+
data: 'NOT CONNECTED',
|
|
62
|
+
headers: {},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private needsLogin(res: AxiosResponse<any>) {
|
|
69
|
+
return (
|
|
70
|
+
res.status === 401 ||
|
|
71
|
+
(typeof res.data === 'string' &&
|
|
72
|
+
(res.data.includes('<!DOCTYPE') ||
|
|
73
|
+
res.data.includes('<html') ||
|
|
74
|
+
res.data.includes('<?xml')))
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private refreshAuth = async () => {
|
|
79
|
+
if (!this.login) return false;
|
|
80
|
+
if (this.isRefreshingAuth) {
|
|
81
|
+
await this.isRefreshingAuth;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
const [username, password] = this.storage.getItem<string[]>('__auth') ?? [];
|
|
85
|
+
if (username && password) {
|
|
86
|
+
this.isRefreshingAuth = this.login.authenticate({ username, password });
|
|
87
|
+
await this.isRefreshingAuth;
|
|
88
|
+
this.isRefreshingAuth = null;
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
private async refreshAuthIfNeeded(response: AxiosResponse<any>) {
|
|
95
|
+
const needsLogin = this.needsLogin(response);
|
|
96
|
+
if (needsLogin && this.login && this.logout) {
|
|
97
|
+
const succeded = await this.refreshAuth();
|
|
98
|
+
if (!succeded) {
|
|
99
|
+
const [username] = this.storage.getItem<string[]>('__auth') ?? [];
|
|
100
|
+
if (username) await this.logout.logout({ username });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
needsLogin,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private fromAxiosError<T>(e: AxiosError<any, T>): HttpClient.Error<T> {
|
|
109
|
+
const url = e.config?.url ?? 'no_url';
|
|
110
|
+
const method = e.config?.method as HttpClient.Method;
|
|
111
|
+
const error: HttpClient.Error<T> = {
|
|
112
|
+
url,
|
|
113
|
+
method,
|
|
114
|
+
body: e.config?.data,
|
|
115
|
+
response: {
|
|
116
|
+
headers: e.response?.headers,
|
|
117
|
+
data: e.response?.data,
|
|
118
|
+
statusCode: e.response?.status,
|
|
119
|
+
},
|
|
120
|
+
config: {
|
|
121
|
+
headers: e.config?.headers,
|
|
122
|
+
params: e.config?.params,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
return new HttpClientError(error);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private async execute<T>(
|
|
129
|
+
handler: () => Promise<AxiosResponse<T>>
|
|
130
|
+
): Promise<HttpClient.Response<T>> {
|
|
131
|
+
let response: AxiosResponse<T> | undefined;
|
|
132
|
+
let isRetry = false;
|
|
133
|
+
try {
|
|
134
|
+
response = await handler();
|
|
135
|
+
const { needsLogin } = await this.refreshAuthIfNeeded(response);
|
|
136
|
+
if (!needsLogin) {
|
|
137
|
+
return {
|
|
138
|
+
statusCode: response.status,
|
|
139
|
+
data: response.data,
|
|
140
|
+
headers: response.headers,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
isRetry = true;
|
|
144
|
+
response = await handler();
|
|
145
|
+
} catch (e) {
|
|
146
|
+
if (!(e instanceof AxiosError)) throw e;
|
|
147
|
+
if (!e.response?.status) throw e;
|
|
148
|
+
const error = this.fromAxiosError<T>(e);
|
|
149
|
+
if (isRetry) throw error;
|
|
150
|
+
try {
|
|
151
|
+
if (response) await this.refreshAuthIfNeeded(response);
|
|
152
|
+
else if (e.response) await this.refreshAuthIfNeeded(e.response);
|
|
153
|
+
response = await handler();
|
|
154
|
+
} catch (e) {
|
|
155
|
+
if (!(e instanceof AxiosError)) throw e;
|
|
156
|
+
throw this.fromAxiosError<T>(e);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (this.isConnected && this.needsLogin(response)) {
|
|
160
|
+
const [username] = this.storage.getItem<string[]>('__auth') ?? [];
|
|
161
|
+
if (username) await this.logout?.logout({ username });
|
|
162
|
+
throw new Error('Needs login');
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
statusCode: response.status,
|
|
166
|
+
data: response.data,
|
|
167
|
+
headers: response.headers,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async get<T = any>(
|
|
172
|
+
url: string,
|
|
173
|
+
config?: HttpClient.Config
|
|
174
|
+
): Promise<HttpClient.Response<T>> {
|
|
175
|
+
const response = await this.execute<T>(() => this.client.get(url, config));
|
|
176
|
+
this.recorder.record({
|
|
177
|
+
url,
|
|
178
|
+
data: response.data,
|
|
179
|
+
headers: config?.headers,
|
|
180
|
+
query: config?.params,
|
|
181
|
+
});
|
|
182
|
+
return response;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async delete(
|
|
186
|
+
url: string,
|
|
187
|
+
config?: HttpClient.Config
|
|
188
|
+
): Promise<HttpClient.Response<undefined>> {
|
|
189
|
+
this.recorder.record({
|
|
190
|
+
url,
|
|
191
|
+
headers: config?.headers,
|
|
192
|
+
query: config?.params,
|
|
193
|
+
});
|
|
194
|
+
this.throwIfNotConnectedOrExecuted(
|
|
195
|
+
HttpClient.Method.delete,
|
|
196
|
+
url,
|
|
197
|
+
undefined,
|
|
198
|
+
config
|
|
199
|
+
);
|
|
200
|
+
return this.execute<undefined>(() => this.client.delete(url, config));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
async post<T = any>(
|
|
204
|
+
url: string,
|
|
205
|
+
body: any,
|
|
206
|
+
config?: HttpClient.Config
|
|
207
|
+
): Promise<HttpClient.Response<T>> {
|
|
208
|
+
this.recorder.record({
|
|
209
|
+
url,
|
|
210
|
+
body,
|
|
211
|
+
headers: config?.headers,
|
|
212
|
+
query: config?.params,
|
|
213
|
+
});
|
|
214
|
+
this.throwIfNotConnectedOrExecuted(
|
|
215
|
+
HttpClient.Method.post,
|
|
216
|
+
url,
|
|
217
|
+
body,
|
|
218
|
+
config
|
|
219
|
+
);
|
|
220
|
+
return this.execute<T>(() => this.client.post(url, body, config));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async patch<T = any>(
|
|
224
|
+
url: string,
|
|
225
|
+
body: any,
|
|
226
|
+
config?: HttpClient.Config
|
|
227
|
+
): Promise<HttpClient.Response<T>> {
|
|
228
|
+
this.recorder.record({
|
|
229
|
+
url,
|
|
230
|
+
body,
|
|
231
|
+
headers: config?.headers,
|
|
232
|
+
query: config?.params,
|
|
233
|
+
});
|
|
234
|
+
this.throwIfNotConnectedOrExecuted(
|
|
235
|
+
HttpClient.Method.patch,
|
|
236
|
+
url,
|
|
237
|
+
body,
|
|
238
|
+
config
|
|
239
|
+
);
|
|
240
|
+
return this.execute<T>(() => this.client.patch(url, body, config));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async put<T = any>(
|
|
244
|
+
url: string,
|
|
245
|
+
body: any,
|
|
246
|
+
config?: HttpClient.Config
|
|
247
|
+
): Promise<HttpClient.Response<T>> {
|
|
248
|
+
this.recorder.record({
|
|
249
|
+
url,
|
|
250
|
+
body,
|
|
251
|
+
headers: config?.headers,
|
|
252
|
+
query: config?.params,
|
|
253
|
+
});
|
|
254
|
+
this.throwIfNotConnectedOrExecuted(
|
|
255
|
+
HttpClient.Method.put,
|
|
256
|
+
url,
|
|
257
|
+
body,
|
|
258
|
+
config
|
|
259
|
+
);
|
|
260
|
+
return this.execute<T>(() => this.client.put(url, body, config));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export namespace AxiosHttpClientAdapter {
|
|
265
|
+
export type Options = {
|
|
266
|
+
storage: Storage;
|
|
267
|
+
recorder: RecordRequest;
|
|
268
|
+
login?: UserAuthentication;
|
|
269
|
+
logout?: UserLogout;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './rnp-permission-manager-adapter';
|
|
2
|
+
export * from './axios-http-client-adapter';
|
|
3
|
+
export * from './mmkv-storage-adapter';
|
|
4
|
+
export * from './offline-mutation-queue';
|
|
5
|
+
export * from './rnbu-download-manager-adapter';
|
|
6
|
+
export * from './storage-cookie-manager-adapter';
|
|
7
|
+
export * from './isomorphic-id-manager';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { Storage } from '../data/protocols';
|
|
2
|
+
|
|
3
|
+
export class IsomorphicIdManager {
|
|
4
|
+
private readonly STORAGE_KEY = '__isomorphic_id_manager';
|
|
5
|
+
private readonly idMap: Map<string, IsomorphicIdManager.IsomorphicId> =
|
|
6
|
+
new Map();
|
|
7
|
+
|
|
8
|
+
constructor(private readonly storage: Storage) {
|
|
9
|
+
const storedIdMap = this.storage.getItem<
|
|
10
|
+
Record<string, { offlineId: number; realId?: number }>
|
|
11
|
+
>(this.STORAGE_KEY);
|
|
12
|
+
if (!storedIdMap) return;
|
|
13
|
+
this.idMap = new Map<string, IsomorphicIdManager.IsomorphicId>(
|
|
14
|
+
Object.entries(storedIdMap).map(([key, value]) => [
|
|
15
|
+
key,
|
|
16
|
+
new IsomorphicIdManager.IsomorphicId(value.offlineId, value.realId),
|
|
17
|
+
])
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private _save() {
|
|
22
|
+
const currentIdMap = Object.fromEntries(this.idMap);
|
|
23
|
+
this.storage.setItem(this.STORAGE_KEY, currentIdMap);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public isOffline(id: number): boolean {
|
|
27
|
+
const saved = this.idMap.get(String(id));
|
|
28
|
+
if (!saved) return false;
|
|
29
|
+
return saved.isOffline();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public create(id: number): IsomorphicIdManager.IsomorphicId {
|
|
33
|
+
const current = this.idMap.get(String(id));
|
|
34
|
+
if (current) return current;
|
|
35
|
+
const isomorphicId = new IsomorphicIdManager.IsomorphicId(id);
|
|
36
|
+
this.set(id, isomorphicId);
|
|
37
|
+
return isomorphicId;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public get(id: number): IsomorphicIdManager.IsomorphicId {
|
|
41
|
+
const saved = this.idMap.get(String(id));
|
|
42
|
+
if (!saved) {
|
|
43
|
+
const isomorphicId = this.create(id);
|
|
44
|
+
this.update(id, id);
|
|
45
|
+
return isomorphicId;
|
|
46
|
+
}
|
|
47
|
+
return saved;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public set(id: number, isomorphicId: IsomorphicIdManager.IsomorphicId): void {
|
|
51
|
+
this.idMap.set(String(id), isomorphicId);
|
|
52
|
+
this._save();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public update(id: number, realId: number): void {
|
|
56
|
+
const current = this.idMap.get(String(id));
|
|
57
|
+
if (!current) return;
|
|
58
|
+
current.set(realId);
|
|
59
|
+
this.set(id, current);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public remove(id: number): void {
|
|
63
|
+
this.idMap.delete(String(id));
|
|
64
|
+
this._save();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public clear(): void {
|
|
68
|
+
this.idMap.clear();
|
|
69
|
+
this._save();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export namespace IsomorphicIdManager {
|
|
74
|
+
export class IsomorphicId {
|
|
75
|
+
private realId: number | undefined;
|
|
76
|
+
private offlineId: number;
|
|
77
|
+
|
|
78
|
+
constructor(id: number, realId?: number) {
|
|
79
|
+
this.offlineId = id;
|
|
80
|
+
this.realId = realId;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public isFromOffline() {
|
|
84
|
+
return this.realId !== this.offlineId;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public getOfflineId() {
|
|
88
|
+
return this.offlineId;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public getRealId() {
|
|
92
|
+
return this.realId;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public get() {
|
|
96
|
+
return this.realId ?? this.offlineId;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public set(id: number) {
|
|
100
|
+
this.realId = id;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public isOffline() {
|
|
104
|
+
return this.realId === undefined;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createMMKV } from 'react-native-mmkv';
|
|
2
|
+
|
|
3
|
+
import type { Storage } from '../data/protocols';
|
|
4
|
+
|
|
5
|
+
export class MMKVStorageAdapter implements Storage {
|
|
6
|
+
private readonly storage;
|
|
7
|
+
|
|
8
|
+
constructor({ id, encryptionKey }: MMKVStorageAdapter.Params) {
|
|
9
|
+
this.storage = createMMKV({
|
|
10
|
+
id,
|
|
11
|
+
encryptionKey,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public get(params?: Storage.GetParams) {
|
|
16
|
+
const { exclude = [] } = params ?? {};
|
|
17
|
+
const keys = this.storage.getAllKeys();
|
|
18
|
+
return keys.reduce(
|
|
19
|
+
(acc, key) => {
|
|
20
|
+
if (exclude.includes(key)) return acc;
|
|
21
|
+
return {
|
|
22
|
+
...acc,
|
|
23
|
+
[key]: this.getItem(key),
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
{} as Record<string, any>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public getItem<T = any>(key: string): T | null {
|
|
31
|
+
const value = this.storage.getString(key);
|
|
32
|
+
try {
|
|
33
|
+
return value ? (JSON.parse(value) as T) : null;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.info('[STORAGE]: error on JSON parse', e);
|
|
36
|
+
this.removeItem(key);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public removeItem(key: string): void {
|
|
42
|
+
this.storage.remove(key);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public setItem<T = any>(key: string, value: T): void {
|
|
46
|
+
if (value === undefined || value === null) {
|
|
47
|
+
console.info('[STORAGE]: setItem called with undefined/null');
|
|
48
|
+
this.removeItem(key);
|
|
49
|
+
} else {
|
|
50
|
+
this.storage.set(key, JSON.stringify(value));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public clear() {
|
|
55
|
+
this.storage.clearAll();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public reset(params?: Storage.ResetParams) {
|
|
59
|
+
const { exclude = [] } = params ?? {};
|
|
60
|
+
const keys = this.storage.getAllKeys();
|
|
61
|
+
for (const key of keys) {
|
|
62
|
+
if (exclude.includes(key)) return;
|
|
63
|
+
this.removeItem(key);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export namespace MMKVStorageAdapter {
|
|
69
|
+
export type Params = {
|
|
70
|
+
id: string;
|
|
71
|
+
encryptionKey?: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { NotificationManager } from '../data/protocols';
|
|
2
|
+
import notifee, { AndroidImportance, TriggerType } from '@notifee/react-native';
|
|
3
|
+
import { theme } from '../theme';
|
|
4
|
+
import { Platform } from 'react-native';
|
|
5
|
+
|
|
6
|
+
export namespace NotifeeNotificationManagerAdapter {
|
|
7
|
+
export type Options = {
|
|
8
|
+
channelId: string;
|
|
9
|
+
channelName: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class NotifeeNotificationManagerAdapter implements NotificationManager {
|
|
15
|
+
public notifications: NotificationManager.Message[] = [];
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
private readonly options: NotifeeNotificationManagerAdapter.Options
|
|
19
|
+
) {}
|
|
20
|
+
|
|
21
|
+
async display(message: NotificationManager.Message) {
|
|
22
|
+
const channelId = await notifee.createChannel({
|
|
23
|
+
id: this.options.channelId,
|
|
24
|
+
name: this.options.channelName,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
await notifee.displayNotification({
|
|
28
|
+
title: message.title,
|
|
29
|
+
body: message.body,
|
|
30
|
+
android: {
|
|
31
|
+
smallIcon: this.options.icon ?? 'ic_small_icon',
|
|
32
|
+
channelId,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
this.notifications = [...this.notifications, message];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async trigger(message: NotificationManager.Message) {
|
|
40
|
+
const channelId = await notifee.createChannel({
|
|
41
|
+
id: this.options.channelId,
|
|
42
|
+
name: this.options.channelName,
|
|
43
|
+
});
|
|
44
|
+
await notifee.createTriggerNotification(
|
|
45
|
+
{
|
|
46
|
+
title: message.title,
|
|
47
|
+
body: message.body,
|
|
48
|
+
android: {
|
|
49
|
+
channelId,
|
|
50
|
+
smallIcon: this.options.icon ?? 'ic_small_icon',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: TriggerType.TIMESTAMP,
|
|
55
|
+
timestamp: message.date,
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async foreground(options: NotificationManager.ForegroundOptions) {
|
|
61
|
+
if (Platform.OS !== 'android') return;
|
|
62
|
+
|
|
63
|
+
const channelId = await notifee.createChannel({
|
|
64
|
+
id: `${this.options.channelId}-foreground`,
|
|
65
|
+
name: `${this.options.channelName}-foreground`,
|
|
66
|
+
importance: AndroidImportance.MIN,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
notifee.displayNotification({
|
|
70
|
+
title: options.title,
|
|
71
|
+
body: options.body,
|
|
72
|
+
android: {
|
|
73
|
+
smallIcon: this.options.icon ?? 'ic_small_icon',
|
|
74
|
+
channelId,
|
|
75
|
+
asForegroundService: true,
|
|
76
|
+
color: theme.color.brand.violet['500'],
|
|
77
|
+
colorized: true,
|
|
78
|
+
ongoing: true,
|
|
79
|
+
importance: AndroidImportance.MIN,
|
|
80
|
+
pressAction: {
|
|
81
|
+
id: 'foreground',
|
|
82
|
+
launchActivity: 'default',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|