@procivis/one-react-native-components 0.1.63 → 0.2.54
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/README.md +17 -6
- package/lib/commonjs/components/backup/index.js +17 -0
- package/lib/commonjs/components/backup/index.js.map +1 -0
- package/lib/commonjs/components/backup/preview-credentials.js +42 -0
- package/lib/commonjs/components/backup/preview-credentials.js.map +1 -0
- package/lib/commonjs/components/credential/credential.js +63 -0
- package/lib/commonjs/components/credential/credential.js.map +1 -0
- package/lib/commonjs/components/credential/index.js +17 -0
- package/lib/commonjs/components/credential/index.js.map +1 -0
- package/lib/commonjs/components/entity/EntityButtons.js +69 -0
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -0
- package/lib/commonjs/components/entity/entity-attributes.js +52 -0
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -0
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +91 -0
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -0
- package/lib/commonjs/components/entity/entity-details.js +74 -0
- package/lib/commonjs/components/entity/entity-details.js.map +1 -0
- package/lib/commonjs/components/entity/index.js +27 -0
- package/lib/commonjs/components/entity/index.js.map +1 -0
- package/lib/commonjs/components/index.js +61 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/components/navigation/header-buttons.js +82 -0
- package/lib/commonjs/components/navigation/header-buttons.js.map +1 -0
- package/lib/commonjs/components/navigation/index.js +17 -0
- package/lib/commonjs/components/navigation/index.js.map +1 -0
- package/lib/commonjs/components/proof-request/group.js +36 -0
- package/lib/commonjs/components/proof-request/group.js.map +1 -0
- package/lib/commonjs/components/proof-request/index.js +39 -0
- package/lib/commonjs/components/proof-request/index.js.map +1 -0
- package/lib/commonjs/components/proof-request/select-credential.js +49 -0
- package/lib/commonjs/components/proof-request/select-credential.js.map +1 -0
- package/lib/commonjs/components/proof-request/share-credential.js +163 -0
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -0
- package/lib/commonjs/index.js +8 -261
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js +81 -0
- package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js.map +1 -0
- package/lib/commonjs/ui-components/blur/blur-view.js +76 -0
- package/lib/commonjs/ui-components/blur/blur-view.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/back-button.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/button.js +153 -0
- package/lib/commonjs/ui-components/buttons/button.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/connectivity-button.js +82 -0
- package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-card.js +183 -0
- package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +199 -0
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-header.js +173 -0
- package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +124 -0
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/index.js +91 -0
- package/lib/commonjs/ui-components/credential/card/index.js.map +1 -0
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +289 -0
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -0
- package/lib/commonjs/ui-components/credential/selector.js +79 -0
- package/lib/commonjs/ui-components/credential/selector.js.map +1 -0
- package/lib/commonjs/ui-components/detail/detail.js +84 -0
- package/lib/commonjs/ui-components/detail/detail.js.map +1 -0
- package/lib/commonjs/ui-components/entity/avatar.js +106 -0
- package/lib/commonjs/ui-components/entity/avatar.js.map +1 -0
- package/lib/commonjs/ui-components/entity/entity-cluster.js +75 -0
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -0
- package/lib/commonjs/ui-components/header/header.js +105 -0
- package/lib/commonjs/ui-components/header/header.js.map +1 -0
- package/lib/commonjs/ui-components/header/navigation-header.js +148 -0
- package/lib/commonjs/ui-components/header/navigation-header.js.map +1 -0
- package/lib/commonjs/ui-components/history/data-item.js +70 -0
- package/lib/commonjs/ui-components/history/data-item.js.map +1 -0
- package/lib/commonjs/ui-components/history/history-list-item.js +90 -0
- package/lib/commonjs/ui-components/history/history-list-item.js.map +1 -0
- package/lib/commonjs/ui-components/history/history-section-header.js +49 -0
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -0
- package/lib/commonjs/ui-components/icons/entity.js +52 -0
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -0
- package/lib/commonjs/ui-components/index.js +281 -0
- package/lib/commonjs/ui-components/index.js.map +1 -0
- package/lib/commonjs/ui-components/input/selection-input.js +102 -0
- package/lib/commonjs/ui-components/input/selection-input.js.map +1 -0
- package/lib/commonjs/ui-components/input/text-input.js +195 -0
- package/lib/commonjs/ui-components/input/text-input.js.map +1 -0
- package/lib/commonjs/ui-components/loader/loader.js +140 -0
- package/lib/commonjs/ui-components/loader/loader.js.map +1 -0
- package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js +238 -0
- package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js.map +1 -0
- package/lib/commonjs/ui-components/pin/index.js +47 -0
- package/lib/commonjs/ui-components/pin/index.js.map +1 -0
- package/lib/commonjs/ui-components/pin/keypad.js +201 -0
- package/lib/commonjs/ui-components/pin/keypad.js.map +1 -0
- package/lib/commonjs/ui-components/pin/pin-code-screen.js +162 -0
- package/lib/commonjs/ui-components/pin/pin-code-screen.js.map +1 -0
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js +824 -0
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -0
- package/lib/commonjs/ui-components/pin/pin-lock.js +83 -0
- package/lib/commonjs/ui-components/pin/pin-lock.js.map +1 -0
- package/lib/commonjs/ui-components/screens/backup-screen.js +87 -0
- package/lib/commonjs/ui-components/screens/backup-screen.js.map +1 -0
- package/lib/commonjs/ui-components/screens/image-preview-screen.js +92 -0
- package/lib/commonjs/ui-components/screens/image-preview-screen.js.map +1 -0
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +172 -0
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -0
- package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js +120 -0
- package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js.map +1 -0
- package/lib/commonjs/ui-components/screens/scroll-view-screen.js +94 -0
- package/lib/commonjs/ui-components/screens/scroll-view-screen.js.map +1 -0
- package/lib/commonjs/ui-components/screens/section-list-screen.js +67 -0
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -0
- package/lib/commonjs/ui-components/searchbar/search-bar.js +99 -0
- package/lib/commonjs/ui-components/searchbar/search-bar.js.map +1 -0
- package/lib/commonjs/utils/array.js +10 -0
- package/lib/commonjs/utils/array.js.map +1 -0
- package/lib/commonjs/utils/backup.js +12 -0
- package/lib/commonjs/utils/backup.js.map +1 -0
- package/lib/commonjs/utils/date.js +98 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.js +148 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.js.map +1 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +56 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/backup.js +155 -0
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/core-config.js +19 -0
- package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/core-context.js +72 -0
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/core-init.js +91 -0
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +111 -0
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/credentials.js +170 -0
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/dids.js +35 -0
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/error-code.js +15 -0
- package/lib/commonjs/utils/hooks/core/error-code.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/history.js +65 -0
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/index.js +138 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/proof-schemas.js +132 -0
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/proofs.js +336 -0
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/query.js +25 -0
- package/lib/commonjs/utils/hooks/core/query.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/trust-entity.js +95 -0
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -0
- package/lib/commonjs/utils/hooks/credential-card/credential-card-expanding.js +51 -0
- package/lib/commonjs/utils/hooks/credential-card/credential-card-expanding.js.map +1 -0
- package/lib/commonjs/utils/hooks/http/client.js +20 -0
- package/lib/commonjs/utils/hooks/http/client.js.map +1 -0
- package/lib/commonjs/utils/hooks/index.js +85 -11
- package/lib/commonjs/utils/hooks/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/before-remove.js +28 -0
- package/lib/commonjs/utils/hooks/navigation/before-remove.js.map +1 -0
- package/lib/commonjs/utils/hooks/navigation/close-button-timeout.js +34 -0
- package/lib/commonjs/utils/hooks/navigation/close-button-timeout.js.map +1 -0
- package/lib/commonjs/utils/hooks/navigation/deep-link.js +46 -0
- package/lib/commonjs/utils/hooks/navigation/deep-link.js.map +1 -0
- package/lib/commonjs/utils/hooks/navigation/index.js +50 -0
- package/lib/commonjs/utils/hooks/navigation/index.js.map +1 -0
- package/lib/commonjs/utils/hooks/navigation/open-settings.js +43 -0
- package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -0
- package/lib/commonjs/utils/hooks/pin-security/pin-security.js +87 -0
- package/lib/commonjs/utils/hooks/pin-security/pin-security.js.map +1 -0
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +67 -0
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -0
- package/lib/commonjs/utils/index.js +119 -45
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +86 -0
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -0
- package/lib/commonjs/utils/parsers/credential-sharing.js +255 -0
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -0
- package/lib/commonjs/utils/parsers/credential.js +323 -0
- package/lib/commonjs/utils/parsers/credential.js.map +1 -0
- package/lib/commonjs/utils/parsers/index.js +50 -0
- package/lib/commonjs/utils/parsers/index.js.map +1 -0
- package/lib/commonjs/utils/parsers/query.js +103 -0
- package/lib/commonjs/utils/parsers/query.js.map +1 -0
- package/lib/commonjs/utils/reporting.js +86 -0
- package/lib/commonjs/utils/reporting.js.map +1 -0
- package/lib/commonjs/utils/string.js +20 -0
- package/lib/commonjs/utils/string.js.map +1 -0
- package/lib/commonjs/utils/useMemoAsync.js +1 -1
- package/lib/commonjs/utils/useMemoAsync.js.map +1 -1
- package/lib/commonjs/utils/uuid.js +16 -0
- package/lib/commonjs/utils/uuid.js.map +1 -0
- package/lib/module/components/backup/index.js +2 -0
- package/lib/module/components/backup/index.js.map +1 -0
- package/lib/module/components/backup/preview-credentials.js +34 -0
- package/lib/module/components/backup/preview-credentials.js.map +1 -0
- package/lib/module/components/credential/credential.js +55 -0
- package/lib/module/components/credential/credential.js.map +1 -0
- package/lib/module/components/credential/index.js +2 -0
- package/lib/module/components/credential/index.js.map +1 -0
- package/lib/module/components/entity/EntityButtons.js +60 -0
- package/lib/module/components/entity/EntityButtons.js.map +1 -0
- package/lib/module/components/entity/entity-attributes.js +43 -0
- package/lib/module/components/entity/entity-attributes.js.map +1 -0
- package/lib/module/components/entity/entity-details-with-buttons.js +81 -0
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -0
- package/lib/module/components/entity/entity-details.js +64 -0
- package/lib/module/components/entity/entity-details.js.map +1 -0
- package/lib/module/components/entity/index.js +3 -0
- package/lib/module/components/entity/index.js.map +1 -0
- package/lib/module/components/index.js +6 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/navigation/header-buttons.js +70 -0
- package/lib/module/components/navigation/header-buttons.js.map +1 -0
- package/lib/module/components/navigation/index.js +2 -0
- package/lib/module/components/navigation/index.js.map +1 -0
- package/lib/module/components/proof-request/group.js +28 -0
- package/lib/module/components/proof-request/group.js.map +1 -0
- package/lib/module/components/proof-request/index.js +4 -0
- package/lib/module/components/proof-request/index.js.map +1 -0
- package/lib/module/components/proof-request/select-credential.js +41 -0
- package/lib/module/components/proof-request/select-credential.js.map +1 -0
- package/lib/module/components/proof-request/share-credential.js +154 -0
- package/lib/module/components/proof-request/share-credential.js.map +1 -0
- package/lib/module/index.js +2 -25
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistory.js +71 -0
- package/lib/module/ui-components/accessibility/accessibilityHistory.js.map +1 -0
- package/lib/module/ui-components/blur/blur-view.js +67 -0
- package/lib/module/ui-components/blur/blur-view.js.map +1 -0
- package/lib/module/ui-components/buttons/back-button.js.map +1 -0
- package/lib/module/ui-components/buttons/button.js +143 -0
- package/lib/module/ui-components/buttons/button.js.map +1 -0
- package/lib/module/ui-components/buttons/connectivity-button.js +73 -0
- package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-card.js +171 -0
- package/lib/module/ui-components/credential/card/credential-card.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-details-card.js +189 -0
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-header.js +163 -0
- package/lib/module/ui-components/credential/card/credential-header.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-image-carousel.js +113 -0
- package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -0
- package/lib/module/ui-components/credential/card/index.js +11 -0
- package/lib/module/ui-components/credential/card/index.js.map +1 -0
- package/lib/module/ui-components/credential/credential-attribute-item.js +279 -0
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -0
- package/lib/module/ui-components/credential/selector.js +70 -0
- package/lib/module/ui-components/credential/selector.js.map +1 -0
- package/lib/module/ui-components/detail/detail.js +75 -0
- package/lib/module/ui-components/detail/detail.js.map +1 -0
- package/lib/module/ui-components/entity/avatar.js +96 -0
- package/lib/module/ui-components/entity/avatar.js.map +1 -0
- package/lib/module/ui-components/entity/entity-cluster.js +65 -0
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -0
- package/lib/module/ui-components/header/header.js +97 -0
- package/lib/module/ui-components/header/header.js.map +1 -0
- package/lib/module/ui-components/header/navigation-header.js +138 -0
- package/lib/module/ui-components/header/navigation-header.js.map +1 -0
- package/lib/module/ui-components/history/data-item.js +60 -0
- package/lib/module/ui-components/history/data-item.js.map +1 -0
- package/lib/module/ui-components/history/history-list-item.js +80 -0
- package/lib/module/ui-components/history/history-list-item.js.map +1 -0
- package/lib/module/ui-components/history/history-section-header.js +42 -0
- package/lib/module/ui-components/history/history-section-header.js.map +1 -0
- package/lib/module/ui-components/icons/entity.js +43 -0
- package/lib/module/ui-components/icons/entity.js.map +1 -0
- package/lib/module/ui-components/index.js +26 -0
- package/lib/module/ui-components/index.js.map +1 -0
- package/lib/module/ui-components/input/selection-input.js +92 -0
- package/lib/module/ui-components/input/selection-input.js.map +1 -0
- package/lib/module/ui-components/input/text-input.js +185 -0
- package/lib/module/ui-components/input/text-input.js.map +1 -0
- package/lib/module/ui-components/loader/loader.js +130 -0
- package/lib/module/ui-components/loader/loader.js.map +1 -0
- package/lib/module/ui-components/nerd-view/nerd-mode-item.js +227 -0
- package/lib/module/ui-components/nerd-view/nerd-mode-item.js.map +1 -0
- package/lib/module/ui-components/pin/index.js +5 -0
- package/lib/module/ui-components/pin/index.js.map +1 -0
- package/lib/module/ui-components/pin/keypad.js +191 -0
- package/lib/module/ui-components/pin/keypad.js.map +1 -0
- package/lib/module/ui-components/pin/pin-code-screen.js +152 -0
- package/lib/module/ui-components/pin/pin-code-screen.js.map +1 -0
- package/lib/module/ui-components/pin/pin-lock-animation.js +817 -0
- package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -0
- package/lib/module/ui-components/pin/pin-lock.js +73 -0
- package/lib/module/ui-components/pin/pin-lock.js.map +1 -0
- package/lib/module/ui-components/screens/backup-screen.js +78 -0
- package/lib/module/ui-components/screens/backup-screen.js.map +1 -0
- package/lib/module/ui-components/screens/image-preview-screen.js +83 -0
- package/lib/module/ui-components/screens/image-preview-screen.js.map +1 -0
- package/lib/module/ui-components/screens/nerd-mode-screen.js +161 -0
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -0
- package/lib/module/ui-components/screens/qr-code-scanner-screen.js +110 -0
- package/lib/module/ui-components/screens/qr-code-scanner-screen.js.map +1 -0
- package/lib/module/ui-components/screens/scroll-view-screen.js +86 -0
- package/lib/module/ui-components/screens/scroll-view-screen.js.map +1 -0
- package/lib/module/ui-components/screens/section-list-screen.js +59 -0
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -0
- package/lib/module/ui-components/searchbar/search-bar.js +89 -0
- package/lib/module/ui-components/searchbar/search-bar.js.map +1 -0
- package/lib/module/utils/array.js +4 -0
- package/lib/module/utils/array.js.map +1 -0
- package/lib/module/utils/backup.js +5 -0
- package/lib/module/utils/backup.js.map +1 -0
- package/lib/module/utils/date.js +89 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.js +136 -0
- package/lib/module/utils/hooks/connectivity/connectivity.js.map +1 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +54 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -0
- package/lib/module/utils/hooks/core/backup.js +143 -0
- package/lib/module/utils/hooks/core/backup.js.map +1 -0
- package/lib/module/utils/hooks/core/core-config.js +12 -0
- package/lib/module/utils/hooks/core/core-config.js.map +1 -0
- package/lib/module/utils/hooks/core/core-context.js +62 -0
- package/lib/module/utils/hooks/core/core-context.js.map +1 -0
- package/lib/module/utils/hooks/core/core-init.js +82 -0
- package/lib/module/utils/hooks/core/core-init.js.map +1 -0
- package/lib/module/utils/hooks/core/credential-schemas.js +95 -0
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -0
- package/lib/module/utils/hooks/core/credentials.js +155 -0
- package/lib/module/utils/hooks/core/credentials.js.map +1 -0
- package/lib/module/utils/hooks/core/dids.js +27 -0
- package/lib/module/utils/hooks/core/dids.js.map +1 -0
- package/lib/module/utils/hooks/core/error-code.js +8 -0
- package/lib/module/utils/hooks/core/error-code.js.map +1 -0
- package/lib/module/utils/hooks/core/history.js +57 -0
- package/lib/module/utils/hooks/core/history.js.map +1 -0
- package/lib/module/utils/hooks/core/index.js +13 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -0
- package/lib/module/utils/hooks/core/proof-schemas.js +115 -0
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -0
- package/lib/module/utils/hooks/core/proofs.js +312 -0
- package/lib/module/utils/hooks/core/proofs.js.map +1 -0
- package/lib/module/utils/hooks/core/query.js +18 -0
- package/lib/module/utils/hooks/core/query.js.map +1 -0
- package/lib/module/utils/hooks/core/trust-entity.js +84 -0
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -0
- package/lib/module/utils/hooks/credential-card/credential-card-expanding.js +43 -0
- package/lib/module/utils/hooks/credential-card/credential-card-expanding.js.map +1 -0
- package/lib/module/utils/hooks/http/client.js +13 -0
- package/lib/module/utils/hooks/http/client.js.map +1 -0
- package/lib/module/utils/hooks/index.js +8 -4
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/navigation/before-remove.js +21 -0
- package/lib/module/utils/hooks/navigation/before-remove.js.map +1 -0
- package/lib/module/utils/hooks/navigation/close-button-timeout.js +27 -0
- package/lib/module/utils/hooks/navigation/close-button-timeout.js.map +1 -0
- package/lib/module/utils/hooks/navigation/deep-link.js +38 -0
- package/lib/module/utils/hooks/navigation/deep-link.js.map +1 -0
- package/lib/module/utils/hooks/navigation/index.js +5 -0
- package/lib/module/utils/hooks/navigation/index.js.map +1 -0
- package/lib/module/utils/hooks/navigation/open-settings.js +36 -0
- package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -0
- package/lib/module/utils/hooks/pin-security/pin-security.js +80 -0
- package/lib/module/utils/hooks/pin-security/pin-security.js.map +1 -0
- package/lib/module/utils/hooks/revocation/credential-status.js +61 -0
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -0
- package/lib/module/utils/index.js +11 -5
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js +78 -0
- package/lib/module/utils/parsers/credential-images.js.map +1 -0
- package/lib/module/utils/parsers/credential-sharing.js +242 -0
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -0
- package/lib/module/utils/parsers/credential.js +304 -0
- package/lib/module/utils/parsers/credential.js.map +1 -0
- package/lib/module/utils/parsers/index.js +5 -0
- package/lib/module/utils/parsers/index.js.map +1 -0
- package/lib/module/utils/parsers/query.js +91 -0
- package/lib/module/utils/parsers/query.js.map +1 -0
- package/lib/module/utils/reporting.js +76 -0
- package/lib/module/utils/reporting.js.map +1 -0
- package/lib/module/utils/string.js +10 -0
- package/lib/module/utils/string.js.map +1 -0
- package/lib/module/utils/useMemoAsync.js +1 -1
- package/lib/module/utils/useMemoAsync.js.map +1 -1
- package/lib/module/utils/uuid.js +9 -0
- package/lib/module/utils/uuid.js.map +1 -0
- package/lib/typescript/components/backup/index.d.ts +1 -0
- package/lib/typescript/components/backup/preview-credentials.d.ts +11 -0
- package/lib/typescript/components/credential/credential.d.ts +16 -0
- package/lib/typescript/components/credential/index.d.ts +1 -0
- package/lib/typescript/components/entity/EntityButtons.d.ts +14 -0
- package/lib/typescript/components/entity/entity-attributes.d.ts +12 -0
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +18 -0
- package/lib/typescript/components/entity/entity-details.d.ts +19 -0
- package/lib/typescript/components/entity/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts +5 -0
- package/lib/typescript/components/navigation/header-buttons.d.ts +21 -0
- package/lib/typescript/components/navigation/index.d.ts +1 -0
- package/lib/typescript/components/proof-request/group.d.ts +2 -0
- package/lib/typescript/components/proof-request/index.d.ts +3 -0
- package/lib/typescript/components/proof-request/select-credential.d.ts +14 -0
- package/lib/typescript/components/proof-request/share-credential.d.ts +27 -0
- package/lib/typescript/index.d.ts +2 -25
- package/lib/typescript/ui-components/accessibility/accessibilityHistory.d.ts +13 -0
- package/lib/typescript/ui-components/buttons/back-button.d.ts +9 -0
- package/lib/typescript/ui-components/credential/card/credential-card.d.ts +25 -0
- package/lib/typescript/ui-components/credential/card/index.d.ts +10 -0
- package/lib/typescript/ui-components/credential/credential-attribute-item.d.ts +49 -0
- package/lib/typescript/ui-components/entity/avatar.d.ts +11 -0
- package/lib/typescript/ui-components/entity/entity-cluster.d.ts +13 -0
- package/lib/typescript/ui-components/index.d.ts +25 -0
- package/lib/typescript/ui-components/pin/index.d.ts +4 -0
- package/lib/typescript/ui-components/pin/pin-lock-animation.d.ts +731 -0
- package/lib/typescript/ui-components/pin/pin-lock.d.ts +13 -0
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +49 -0
- package/lib/typescript/ui-components/text/typography.d.ts +112 -0
- package/lib/typescript/utils/array.d.ts +1 -0
- package/lib/typescript/utils/backup.d.ts +1 -0
- package/lib/typescript/utils/date.d.ts +32 -0
- package/lib/typescript/utils/hooks/connectivity/connectivity.d.ts +27 -0
- package/lib/typescript/utils/hooks/connectivity/connectivity.test.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/backup.d.ts +12 -0
- package/lib/typescript/utils/hooks/core/core-config.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/core-context.d.ts +15 -0
- package/lib/typescript/utils/hooks/core/core-init.d.ts +3 -0
- package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +11 -0
- package/lib/typescript/utils/hooks/core/credentials.d.ts +18 -0
- package/lib/typescript/utils/hooks/core/dids.d.ts +3 -0
- package/lib/typescript/utils/hooks/core/error-code.d.ts +6 -0
- package/lib/typescript/utils/hooks/core/history.d.ts +6 -0
- package/lib/typescript/utils/hooks/core/index.d.ts +12 -0
- package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +14 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +37 -0
- package/lib/typescript/utils/hooks/core/query.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -0
- package/lib/typescript/utils/hooks/credential-card/credential-card-expanding.d.ts +10 -0
- package/lib/typescript/utils/hooks/http/client.d.ts +2 -0
- package/lib/typescript/utils/hooks/index.d.ts +8 -4
- package/lib/typescript/utils/hooks/navigation/before-remove.d.ts +1 -0
- package/lib/typescript/utils/hooks/navigation/close-button-timeout.d.ts +3 -0
- package/lib/typescript/utils/hooks/navigation/deep-link.d.ts +2 -0
- package/lib/typescript/utils/hooks/navigation/index.d.ts +4 -0
- package/lib/typescript/utils/hooks/navigation/open-settings.d.ts +6 -0
- package/lib/typescript/utils/hooks/pin-security/pin-security.d.ts +6 -0
- package/lib/typescript/utils/hooks/revocation/credential-status.d.ts +7 -0
- package/lib/typescript/utils/index.d.ts +11 -5
- package/lib/typescript/utils/parsers/credential-images.d.ts +3 -0
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +16 -0
- package/lib/typescript/utils/parsers/credential.d.ts +76 -0
- package/lib/typescript/utils/parsers/index.d.ts +4 -0
- package/lib/typescript/utils/parsers/query.d.ts +7 -0
- package/lib/typescript/utils/ref.d.ts +1 -1
- package/lib/typescript/utils/reporting.d.ts +4 -0
- package/lib/typescript/utils/string.d.ts +4 -0
- package/lib/typescript/utils/uuid.d.ts +6 -0
- package/package.json +29 -2
- package/src/components/backup/index.ts +1 -0
- package/src/components/backup/preview-credentials.tsx +38 -0
- package/src/components/credential/credential.tsx +72 -0
- package/src/components/credential/index.ts +1 -0
- package/src/components/entity/EntityButtons.tsx +79 -0
- package/src/components/entity/entity-attributes.tsx +62 -0
- package/src/components/entity/entity-details-with-buttons.tsx +98 -0
- package/src/components/entity/entity-details.tsx +85 -0
- package/src/components/entity/index.ts +3 -0
- package/src/components/index.ts +5 -0
- package/src/components/navigation/header-buttons.tsx +64 -0
- package/src/components/navigation/index.ts +1 -0
- package/src/components/proof-request/group.tsx +26 -0
- package/src/components/proof-request/index.ts +3 -0
- package/src/components/proof-request/select-credential.tsx +48 -0
- package/src/components/proof-request/share-credential.tsx +194 -0
- package/src/index.ts +2 -25
- package/src/ui-components/accessibility/accessibilityHistory.tsx +77 -0
- package/src/ui-components/blur/blur-view.tsx +82 -0
- package/src/ui-components/buttons/back-button.tsx +30 -0
- package/src/ui-components/buttons/button.tsx +169 -0
- package/src/ui-components/buttons/connectivity-button.tsx +95 -0
- package/src/ui-components/credential/card/credential-card.stories.tsx +54 -0
- package/src/ui-components/credential/card/credential-card.tsx +189 -0
- package/src/ui-components/credential/card/credential-details-card.stories.tsx +299 -0
- package/src/ui-components/credential/card/credential-details-card.tsx +242 -0
- package/src/ui-components/credential/card/credential-header.stories.tsx +50 -0
- package/src/ui-components/credential/card/credential-header.tsx +196 -0
- package/src/ui-components/credential/card/credential-image-carousel.tsx +113 -0
- package/src/ui-components/credential/card/index.ts +16 -0
- package/src/ui-components/credential/credential-attribute-item.tsx +373 -0
- package/src/ui-components/credential/selector.tsx +64 -0
- package/src/ui-components/detail/detail.stories.tsx +65 -0
- package/src/ui-components/detail/detail.tsx +98 -0
- package/src/ui-components/entity/avatar.tsx +100 -0
- package/src/ui-components/entity/entity-cluster.tsx +82 -0
- package/src/ui-components/header/header.stories.tsx +59 -0
- package/src/ui-components/header/header.tsx +105 -0
- package/src/ui-components/header/navigation-header.stories.tsx +56 -0
- package/src/ui-components/header/navigation-header.tsx +147 -0
- package/src/ui-components/history/data-item.tsx +79 -0
- package/src/ui-components/history/history-list-item.tsx +102 -0
- package/src/ui-components/history/history-section-header.tsx +44 -0
- package/src/ui-components/icons/entity.tsx +31 -0
- package/src/ui-components/index.ts +25 -0
- package/src/ui-components/input/selection-input.tsx +112 -0
- package/src/ui-components/input/text-input.tsx +253 -0
- package/src/ui-components/loader/loader.tsx +171 -0
- package/src/ui-components/nerd-view/nerd-mode-item.tsx +299 -0
- package/src/ui-components/pin/index.ts +5 -0
- package/src/ui-components/pin/keypad.tsx +166 -0
- package/src/ui-components/pin/pin-code-screen.tsx +195 -0
- package/src/ui-components/pin/pin-lock-animation.tsx +500 -0
- package/src/ui-components/pin/pin-lock.tsx +82 -0
- package/src/ui-components/screens/backup-screen.tsx +92 -0
- package/src/ui-components/screens/image-preview-screen.stories.tsx +28 -0
- package/src/ui-components/screens/image-preview-screen.tsx +82 -0
- package/src/ui-components/screens/nerd-mode-screen.tsx +214 -0
- package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +37 -0
- package/src/ui-components/screens/qr-code-scanner-screen.tsx +124 -0
- package/src/ui-components/screens/scroll-view-screen.tsx +91 -0
- package/src/ui-components/screens/section-list-screen.tsx +61 -0
- package/src/ui-components/searchbar/search-bar.tsx +94 -0
- package/src/ui-components/text/typography.stories.tsx +70 -0
- package/src/utils/array.ts +3 -0
- package/src/utils/backup.ts +5 -0
- package/src/utils/date.ts +105 -1
- package/src/utils/hooks/connectivity/connectivity.test.ts +87 -0
- package/src/utils/hooks/connectivity/connectivity.ts +162 -0
- package/src/utils/hooks/core/backup.ts +140 -0
- package/src/utils/hooks/core/core-config.ts +13 -0
- package/src/utils/hooks/core/core-context.tsx +101 -0
- package/src/utils/hooks/core/core-init.ts +92 -0
- package/src/utils/hooks/core/credential-schemas.ts +110 -0
- package/src/utils/hooks/core/credentials.ts +171 -0
- package/src/utils/hooks/core/dids.ts +28 -0
- package/src/utils/hooks/core/error-code.ts +6 -0
- package/src/utils/hooks/core/history.ts +85 -0
- package/src/utils/hooks/core/index.ts +12 -0
- package/src/utils/hooks/core/proof-schemas.ts +130 -0
- package/src/utils/hooks/core/proofs.ts +351 -0
- package/src/utils/hooks/core/query.ts +19 -0
- package/src/utils/hooks/core/trust-entity.ts +109 -0
- package/src/utils/hooks/credential-card/credential-card-expanding.tsx +45 -0
- package/src/utils/hooks/http/client.ts +13 -0
- package/src/utils/hooks/index.ts +8 -5
- package/src/utils/hooks/navigation/before-remove.tsx +22 -0
- package/src/utils/hooks/navigation/close-button-timeout.tsx +29 -0
- package/src/utils/hooks/navigation/deep-link.ts +40 -0
- package/src/utils/hooks/navigation/index.ts +4 -0
- package/src/utils/hooks/navigation/open-settings.ts +40 -0
- package/src/utils/hooks/pin-security/pin-security.ts +99 -0
- package/src/utils/hooks/revocation/credential-status.ts +44 -0
- package/src/utils/index.ts +11 -14
- package/src/utils/parsers/credential-images.tsx +78 -0
- package/src/utils/parsers/credential-sharing.tsx +366 -0
- package/src/utils/parsers/credential.ts +365 -0
- package/src/utils/parsers/index.ts +4 -0
- package/src/utils/parsers/query.tsx +80 -0
- package/src/utils/reporting.ts +84 -0
- package/src/utils/string.ts +17 -0
- package/src/utils/useMemoAsync.ts +1 -1
- package/src/utils/uuid.ts +8 -0
- package/lib/commonjs/accessibility/accessibilityHistory.js +0 -81
- package/lib/commonjs/accessibility/accessibilityHistory.js.map +0 -1
- package/lib/commonjs/blur/blur-view.js +0 -76
- package/lib/commonjs/blur/blur-view.js.map +0 -1
- package/lib/commonjs/buttons/back-button.js.map +0 -1
- package/lib/commonjs/buttons/button.js +0 -153
- package/lib/commonjs/buttons/button.js.map +0 -1
- package/lib/commonjs/buttons/connectivity-button.js +0 -82
- package/lib/commonjs/buttons/connectivity-button.js.map +0 -1
- package/lib/commonjs/credential/card/credential-card.js +0 -189
- package/lib/commonjs/credential/card/credential-card.js.map +0 -1
- package/lib/commonjs/credential/card/credential-details-card.js +0 -201
- package/lib/commonjs/credential/card/credential-details-card.js.map +0 -1
- package/lib/commonjs/credential/card/credential-header.js +0 -172
- package/lib/commonjs/credential/card/credential-header.js.map +0 -1
- package/lib/commonjs/credential/card/credential-image-carousel.js +0 -124
- package/lib/commonjs/credential/card/credential-image-carousel.js.map +0 -1
- package/lib/commonjs/credential/card/index.js +0 -85
- package/lib/commonjs/credential/card/index.js.map +0 -1
- package/lib/commonjs/credential/credential-attribute-item.js +0 -289
- package/lib/commonjs/credential/credential-attribute-item.js.map +0 -1
- package/lib/commonjs/credential/selector.js +0 -79
- package/lib/commonjs/credential/selector.js.map +0 -1
- package/lib/commonjs/detail/detail.js +0 -84
- package/lib/commonjs/detail/detail.js.map +0 -1
- package/lib/commonjs/entity/avatar.js +0 -96
- package/lib/commonjs/entity/avatar.js.map +0 -1
- package/lib/commonjs/entity/entity-cluster.js +0 -66
- package/lib/commonjs/entity/entity-cluster.js.map +0 -1
- package/lib/commonjs/header/header.js +0 -105
- package/lib/commonjs/header/header.js.map +0 -1
- package/lib/commonjs/header/navigation-header.js +0 -148
- package/lib/commonjs/header/navigation-header.js.map +0 -1
- package/lib/commonjs/history/data-item.js +0 -70
- package/lib/commonjs/history/data-item.js.map +0 -1
- package/lib/commonjs/history/history-list-item.js +0 -90
- package/lib/commonjs/history/history-list-item.js.map +0 -1
- package/lib/commonjs/history/history-section-header.js +0 -49
- package/lib/commonjs/history/history-section-header.js.map +0 -1
- package/lib/commonjs/icons/entity.js +0 -34
- package/lib/commonjs/icons/entity.js.map +0 -1
- package/lib/commonjs/input/selection-input.js +0 -102
- package/lib/commonjs/input/selection-input.js.map +0 -1
- package/lib/commonjs/input/text-input.js +0 -195
- package/lib/commonjs/input/text-input.js.map +0 -1
- package/lib/commonjs/loader/loader.js +0 -140
- package/lib/commonjs/loader/loader.js.map +0 -1
- package/lib/commonjs/nerd-view/nerd-mode-item.js +0 -235
- package/lib/commonjs/nerd-view/nerd-mode-item.js.map +0 -1
- package/lib/commonjs/pin/index.js +0 -32
- package/lib/commonjs/pin/index.js.map +0 -1
- package/lib/commonjs/pin/keypad.js +0 -201
- package/lib/commonjs/pin/keypad.js.map +0 -1
- package/lib/commonjs/pin/pin-code-screen.js +0 -162
- package/lib/commonjs/pin/pin-code-screen.js.map +0 -1
- package/lib/commonjs/screens/backup-screen.js +0 -87
- package/lib/commonjs/screens/backup-screen.js.map +0 -1
- package/lib/commonjs/screens/image-preview-screen.js +0 -92
- package/lib/commonjs/screens/image-preview-screen.js.map +0 -1
- package/lib/commonjs/screens/nerd-mode-screen.js +0 -142
- package/lib/commonjs/screens/nerd-mode-screen.js.map +0 -1
- package/lib/commonjs/screens/qr-code-scanner-screen.js +0 -120
- package/lib/commonjs/screens/qr-code-scanner-screen.js.map +0 -1
- package/lib/commonjs/screens/scroll-view-screen.js +0 -94
- package/lib/commonjs/screens/scroll-view-screen.js.map +0 -1
- package/lib/commonjs/screens/section-list-screen.js +0 -67
- package/lib/commonjs/screens/section-list-screen.js.map +0 -1
- package/lib/commonjs/searchbar/search-bar.js +0 -99
- package/lib/commonjs/searchbar/search-bar.js.map +0 -1
- package/lib/module/accessibility/accessibilityHistory.js +0 -71
- package/lib/module/accessibility/accessibilityHistory.js.map +0 -1
- package/lib/module/blur/blur-view.js +0 -67
- package/lib/module/blur/blur-view.js.map +0 -1
- package/lib/module/buttons/back-button.js.map +0 -1
- package/lib/module/buttons/button.js +0 -143
- package/lib/module/buttons/button.js.map +0 -1
- package/lib/module/buttons/connectivity-button.js +0 -73
- package/lib/module/buttons/connectivity-button.js.map +0 -1
- package/lib/module/credential/card/credential-card.js +0 -177
- package/lib/module/credential/card/credential-card.js.map +0 -1
- package/lib/module/credential/card/credential-details-card.js +0 -191
- package/lib/module/credential/card/credential-details-card.js.map +0 -1
- package/lib/module/credential/card/credential-header.js +0 -162
- package/lib/module/credential/card/credential-header.js.map +0 -1
- package/lib/module/credential/card/credential-image-carousel.js +0 -113
- package/lib/module/credential/card/credential-image-carousel.js.map +0 -1
- package/lib/module/credential/card/index.js +0 -11
- package/lib/module/credential/card/index.js.map +0 -1
- package/lib/module/credential/credential-attribute-item.js +0 -279
- package/lib/module/credential/credential-attribute-item.js.map +0 -1
- package/lib/module/credential/selector.js +0 -70
- package/lib/module/credential/selector.js.map +0 -1
- package/lib/module/detail/detail.js +0 -75
- package/lib/module/detail/detail.js.map +0 -1
- package/lib/module/entity/avatar.js +0 -86
- package/lib/module/entity/avatar.js.map +0 -1
- package/lib/module/entity/entity-cluster.js +0 -56
- package/lib/module/entity/entity-cluster.js.map +0 -1
- package/lib/module/header/header.js +0 -97
- package/lib/module/header/header.js.map +0 -1
- package/lib/module/header/navigation-header.js +0 -138
- package/lib/module/header/navigation-header.js.map +0 -1
- package/lib/module/history/data-item.js +0 -60
- package/lib/module/history/data-item.js.map +0 -1
- package/lib/module/history/history-list-item.js +0 -80
- package/lib/module/history/history-list-item.js.map +0 -1
- package/lib/module/history/history-section-header.js +0 -42
- package/lib/module/history/history-section-header.js.map +0 -1
- package/lib/module/icons/entity.js +0 -25
- package/lib/module/icons/entity.js.map +0 -1
- package/lib/module/input/selection-input.js +0 -92
- package/lib/module/input/selection-input.js.map +0 -1
- package/lib/module/input/text-input.js +0 -185
- package/lib/module/input/text-input.js.map +0 -1
- package/lib/module/loader/loader.js +0 -130
- package/lib/module/loader/loader.js.map +0 -1
- package/lib/module/nerd-view/nerd-mode-item.js +0 -224
- package/lib/module/nerd-view/nerd-mode-item.js.map +0 -1
- package/lib/module/pin/index.js +0 -4
- package/lib/module/pin/index.js.map +0 -1
- package/lib/module/pin/keypad.js +0 -191
- package/lib/module/pin/keypad.js.map +0 -1
- package/lib/module/pin/pin-code-screen.js +0 -152
- package/lib/module/pin/pin-code-screen.js.map +0 -1
- package/lib/module/screens/backup-screen.js +0 -78
- package/lib/module/screens/backup-screen.js.map +0 -1
- package/lib/module/screens/image-preview-screen.js +0 -83
- package/lib/module/screens/image-preview-screen.js.map +0 -1
- package/lib/module/screens/nerd-mode-screen.js +0 -132
- package/lib/module/screens/nerd-mode-screen.js.map +0 -1
- package/lib/module/screens/qr-code-scanner-screen.js +0 -110
- package/lib/module/screens/qr-code-scanner-screen.js.map +0 -1
- package/lib/module/screens/scroll-view-screen.js +0 -86
- package/lib/module/screens/scroll-view-screen.js.map +0 -1
- package/lib/module/screens/section-list-screen.js +0 -59
- package/lib/module/screens/section-list-screen.js.map +0 -1
- package/lib/module/searchbar/search-bar.js +0 -89
- package/lib/module/searchbar/search-bar.js.map +0 -1
- package/lib/typescript/accessibility/accessibilityHistory.d.ts +0 -13
- package/lib/typescript/buttons/back-button.d.ts +0 -9
- package/lib/typescript/credential/card/credential-card.d.ts +0 -22
- package/lib/typescript/credential/card/index.d.ts +0 -10
- package/lib/typescript/credential/credential-attribute-item.d.ts +0 -48
- package/lib/typescript/entity/avatar.d.ts +0 -10
- package/lib/typescript/entity/entity-cluster.d.ts +0 -12
- package/lib/typescript/pin/index.d.ts +0 -3
- package/lib/typescript/screens/nerd-mode-screen.d.ts +0 -22
- package/lib/typescript/text/typography.d.ts +0 -112
- package/src/accessibility/accessibilityHistory.tsx +0 -77
- package/src/blur/blur-view.tsx +0 -82
- package/src/buttons/back-button.tsx +0 -31
- package/src/buttons/button.tsx +0 -169
- package/src/buttons/connectivity-button.tsx +0 -95
- package/src/credential/card/credential-card.stories.tsx +0 -52
- package/src/credential/card/credential-card.tsx +0 -195
- package/src/credential/card/credential-details-card.stories.tsx +0 -268
- package/src/credential/card/credential-details-card.tsx +0 -242
- package/src/credential/card/credential-header.stories.tsx +0 -50
- package/src/credential/card/credential-header.tsx +0 -195
- package/src/credential/card/credential-image-carousel.tsx +0 -113
- package/src/credential/card/index.ts +0 -11
- package/src/credential/credential-attribute-item.tsx +0 -372
- package/src/credential/selector.tsx +0 -64
- package/src/detail/detail.stories.tsx +0 -65
- package/src/detail/detail.tsx +0 -98
- package/src/entity/avatar.tsx +0 -87
- package/src/entity/entity-cluster.tsx +0 -72
- package/src/header/header.stories.tsx +0 -59
- package/src/header/header.tsx +0 -105
- package/src/header/navigation-header.stories.tsx +0 -56
- package/src/header/navigation-header.tsx +0 -147
- package/src/history/data-item.tsx +0 -79
- package/src/history/history-list-item.tsx +0 -102
- package/src/history/history-section-header.tsx +0 -44
- package/src/icons/entity.tsx +0 -21
- package/src/input/selection-input.tsx +0 -112
- package/src/input/text-input.tsx +0 -253
- package/src/loader/loader.tsx +0 -169
- package/src/nerd-view/nerd-mode-item.tsx +0 -296
- package/src/pin/index.ts +0 -4
- package/src/pin/keypad.tsx +0 -166
- package/src/pin/pin-code-screen.tsx +0 -195
- package/src/screens/backup-screen.tsx +0 -92
- package/src/screens/image-preview-screen.stories.tsx +0 -28
- package/src/screens/image-preview-screen.tsx +0 -82
- package/src/screens/nerd-mode-screen.tsx +0 -150
- package/src/screens/qr-code-scanner-screen.stories.tsx +0 -37
- package/src/screens/qr-code-scanner-screen.tsx +0 -124
- package/src/screens/scroll-view-screen.tsx +0 -91
- package/src/screens/section-list-screen.tsx +0 -61
- package/src/searchbar/search-bar.tsx +0 -94
- package/src/text/typography.stories.tsx +0 -70
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/accessibility.js +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/accessibility.js.map +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/accessibilityHistoryWrappers.js +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/accessibilityHistoryWrappers.js.map +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/accessibilityLanguage.js +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/accessibilityLanguage.js.map +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/index.js +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/index.js.map +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale/de.json +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale/en.json +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale/fr.json +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale/index.js +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale/index.js.map +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale/it.json +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale.test.js +0 -0
- /package/lib/commonjs/{accessibility → ui-components/accessibility}/locale.test.js.map +0 -0
- /package/lib/commonjs/{action-modal → ui-components/action-modal}/ActionModal.js +0 -0
- /package/lib/commonjs/{action-modal → ui-components/action-modal}/ActionModal.js.map +0 -0
- /package/lib/commonjs/{action-modal → ui-components/action-modal}/index.js +0 -0
- /package/lib/commonjs/{action-modal → ui-components/action-modal}/index.js.map +0 -0
- /package/lib/commonjs/{activity-indicator → ui-components/activity-indicator}/activity-indicator.js +0 -0
- /package/lib/commonjs/{activity-indicator → ui-components/activity-indicator}/activity-indicator.js.map +0 -0
- /package/lib/commonjs/{activity-indicator → ui-components/activity-indicator}/index.js +0 -0
- /package/lib/commonjs/{activity-indicator → ui-components/activity-indicator}/index.js.map +0 -0
- /package/lib/commonjs/{blur → ui-components/blur}/index.js +0 -0
- /package/lib/commonjs/{blur → ui-components/blur}/index.js.map +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/back-button.js +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/filter-button.js +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/filter-button.js.map +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/ghost-button.js +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/ghost-button.js.map +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/index.js +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/index.js.map +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/scan-button.js +0 -0
- /package/lib/commonjs/{buttons → ui-components/buttons}/scan-button.js.map +0 -0
- /package/lib/commonjs/{camera → ui-components/camera}/camera-overlay.js +0 -0
- /package/lib/commonjs/{camera → ui-components/camera}/camera-overlay.js.map +0 -0
- /package/lib/commonjs/{camera → ui-components/camera}/index.js +0 -0
- /package/lib/commonjs/{camera → ui-components/camera}/index.js.map +0 -0
- /package/lib/commonjs/{camera → ui-components/camera}/qr-code-scanner.js +0 -0
- /package/lib/commonjs/{camera → ui-components/camera}/qr-code-scanner.js.map +0 -0
- /package/lib/commonjs/{control → ui-components/control}/checkbox.js +0 -0
- /package/lib/commonjs/{control → ui-components/control}/checkbox.js.map +0 -0
- /package/lib/commonjs/{control → ui-components/control}/index.js +0 -0
- /package/lib/commonjs/{control → ui-components/control}/index.js.map +0 -0
- /package/lib/commonjs/{control → ui-components/control}/switch.js +0 -0
- /package/lib/commonjs/{control → ui-components/control}/switch.js.map +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/card/credential-details-list-item.js +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/card/credential-details-list-item.js.map +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/credential-carousel-images.js +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/credential-carousel-images.js.map +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/index.js +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/index.js.map +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/selector-status.js +0 -0
- /package/lib/commonjs/{credential → ui-components/credential}/selector-status.js.map +0 -0
- /package/lib/commonjs/{detail → ui-components/detail}/index.js +0 -0
- /package/lib/commonjs/{detail → ui-components/detail}/index.js.map +0 -0
- /package/lib/commonjs/{entity → ui-components/entity}/index.js +0 -0
- /package/lib/commonjs/{entity → ui-components/entity}/index.js.map +0 -0
- /package/lib/commonjs/{header → ui-components/header}/focus-aware-status-bar.js +0 -0
- /package/lib/commonjs/{header → ui-components/header}/focus-aware-status-bar.js.map +0 -0
- /package/lib/commonjs/{header → ui-components/header}/foldable-header.js +0 -0
- /package/lib/commonjs/{header → ui-components/header}/foldable-header.js.map +0 -0
- /package/lib/commonjs/{header → ui-components/header}/index.js +0 -0
- /package/lib/commonjs/{header → ui-components/header}/index.js.map +0 -0
- /package/lib/commonjs/{history → ui-components/history}/history-section-list-item.js +0 -0
- /package/lib/commonjs/{history → ui-components/history}/history-section-list-item.js.map +0 -0
- /package/lib/commonjs/{history → ui-components/history}/index.js +0 -0
- /package/lib/commonjs/{history → ui-components/history}/index.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/connectivity.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/connectivity.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/credential.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/credential.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/history.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/history.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/icons.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/icons.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/index.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/index.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/input.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/input.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/keypad.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/keypad.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/loader.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/loader.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/nerd-view.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/nerd-view.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/selector.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/selector.js.map +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/wallet.js +0 -0
- /package/lib/commonjs/{icons → ui-components/icons}/wallet.js.map +0 -0
- /package/lib/commonjs/{image → ui-components/image}/image-or-component.js +0 -0
- /package/lib/commonjs/{image → ui-components/image}/image-or-component.js.map +0 -0
- /package/lib/commonjs/{image → ui-components/image}/index.js +0 -0
- /package/lib/commonjs/{image → ui-components/image}/index.js.map +0 -0
- /package/lib/commonjs/{input → ui-components/input}/index.js +0 -0
- /package/lib/commonjs/{input → ui-components/input}/index.js.map +0 -0
- /package/lib/commonjs/{input → ui-components/input}/radio-group.js +0 -0
- /package/lib/commonjs/{input → ui-components/input}/radio-group.js.map +0 -0
- /package/lib/commonjs/{list → ui-components/list}/index.js +0 -0
- /package/lib/commonjs/{list → ui-components/list}/index.js.map +0 -0
- /package/lib/commonjs/{list → ui-components/list}/list-section-header.js +0 -0
- /package/lib/commonjs/{list → ui-components/list}/list-section-header.js.map +0 -0
- /package/lib/commonjs/{list → ui-components/list}/list-title-header.js +0 -0
- /package/lib/commonjs/{list → ui-components/list}/list-title-header.js.map +0 -0
- /package/lib/commonjs/{loader → ui-components/loader}/index.js +0 -0
- /package/lib/commonjs/{loader → ui-components/loader}/index.js.map +0 -0
- /package/lib/commonjs/{loader → ui-components/loader}/loading-result.js +0 -0
- /package/lib/commonjs/{loader → ui-components/loader}/loading-result.js.map +0 -0
- /package/lib/commonjs/{nerd-view → ui-components/nerd-view}/index.js +0 -0
- /package/lib/commonjs/{nerd-view → ui-components/nerd-view}/index.js.map +0 -0
- /package/lib/commonjs/{pin → ui-components/pin}/pins.js +0 -0
- /package/lib/commonjs/{pin → ui-components/pin}/pins.js.map +0 -0
- /package/lib/commonjs/{screens → ui-components/screens}/index.js +0 -0
- /package/lib/commonjs/{screens → ui-components/screens}/index.js.map +0 -0
- /package/lib/commonjs/{searchbar → ui-components/searchbar}/animated-search-bar.js +0 -0
- /package/lib/commonjs/{searchbar → ui-components/searchbar}/animated-search-bar.js.map +0 -0
- /package/lib/commonjs/{searchbar → ui-components/searchbar}/index.js +0 -0
- /package/lib/commonjs/{searchbar → ui-components/searchbar}/index.js.map +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/button-setting.js +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/button-setting.js.map +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/index.js +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/index.js.map +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/setting-item-separator.js +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/setting-item-separator.js.map +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/setting-item.js +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/setting-item.js.map +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/settings-button.js +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/settings-button.js.map +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/switch-setting.js +0 -0
- /package/lib/commonjs/{settings → ui-components/settings}/switch-setting.js.map +0 -0
- /package/lib/commonjs/{state → ui-components/state}/error-screen.js +0 -0
- /package/lib/commonjs/{state → ui-components/state}/error-screen.js.map +0 -0
- /package/lib/commonjs/{state → ui-components/state}/index.js +0 -0
- /package/lib/commonjs/{state → ui-components/state}/index.js.map +0 -0
- /package/lib/commonjs/{text → ui-components/text}/base.js +0 -0
- /package/lib/commonjs/{text → ui-components/text}/base.js.map +0 -0
- /package/lib/commonjs/{text → ui-components/text}/font.js +0 -0
- /package/lib/commonjs/{text → ui-components/text}/font.js.map +0 -0
- /package/lib/commonjs/{text → ui-components/text}/index.js +0 -0
- /package/lib/commonjs/{text → ui-components/text}/index.js.map +0 -0
- /package/lib/commonjs/{text → ui-components/text}/typography.js +0 -0
- /package/lib/commonjs/{text → ui-components/text}/typography.js.map +0 -0
- /package/lib/commonjs/{theme → ui-components/theme}/color-scheme-context.js +0 -0
- /package/lib/commonjs/{theme → ui-components/theme}/color-scheme-context.js.map +0 -0
- /package/lib/commonjs/{theme → ui-components/theme}/color-scheme.js +0 -0
- /package/lib/commonjs/{theme → ui-components/theme}/color-scheme.js.map +0 -0
- /package/lib/commonjs/{theme → ui-components/theme}/index.js +0 -0
- /package/lib/commonjs/{theme → ui-components/theme}/index.js.map +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/accessibility.js +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/accessibility.js.map +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/accessibilityHistoryWrappers.js +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/accessibilityHistoryWrappers.js.map +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/accessibilityLanguage.js +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/accessibilityLanguage.js.map +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/index.js +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/index.js.map +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale/de.json +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale/en.json +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale/fr.json +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale/index.js +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale/index.js.map +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale/it.json +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale.test.js +0 -0
- /package/lib/module/{accessibility → ui-components/accessibility}/locale.test.js.map +0 -0
- /package/lib/module/{action-modal → ui-components/action-modal}/ActionModal.js +0 -0
- /package/lib/module/{action-modal → ui-components/action-modal}/ActionModal.js.map +0 -0
- /package/lib/module/{action-modal → ui-components/action-modal}/index.js +0 -0
- /package/lib/module/{action-modal → ui-components/action-modal}/index.js.map +0 -0
- /package/lib/module/{activity-indicator → ui-components/activity-indicator}/activity-indicator.js +0 -0
- /package/lib/module/{activity-indicator → ui-components/activity-indicator}/activity-indicator.js.map +0 -0
- /package/lib/module/{activity-indicator → ui-components/activity-indicator}/index.js +0 -0
- /package/lib/module/{activity-indicator → ui-components/activity-indicator}/index.js.map +0 -0
- /package/lib/module/{blur → ui-components/blur}/index.js +0 -0
- /package/lib/module/{blur → ui-components/blur}/index.js.map +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/back-button.js +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/filter-button.js +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/filter-button.js.map +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/ghost-button.js +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/ghost-button.js.map +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/index.js +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/index.js.map +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/scan-button.js +0 -0
- /package/lib/module/{buttons → ui-components/buttons}/scan-button.js.map +0 -0
- /package/lib/module/{camera → ui-components/camera}/camera-overlay.js +0 -0
- /package/lib/module/{camera → ui-components/camera}/camera-overlay.js.map +0 -0
- /package/lib/module/{camera → ui-components/camera}/index.js +0 -0
- /package/lib/module/{camera → ui-components/camera}/index.js.map +0 -0
- /package/lib/module/{camera → ui-components/camera}/qr-code-scanner.js +0 -0
- /package/lib/module/{camera → ui-components/camera}/qr-code-scanner.js.map +0 -0
- /package/lib/module/{control → ui-components/control}/checkbox.js +0 -0
- /package/lib/module/{control → ui-components/control}/checkbox.js.map +0 -0
- /package/lib/module/{control → ui-components/control}/index.js +0 -0
- /package/lib/module/{control → ui-components/control}/index.js.map +0 -0
- /package/lib/module/{control → ui-components/control}/switch.js +0 -0
- /package/lib/module/{control → ui-components/control}/switch.js.map +0 -0
- /package/lib/module/{credential → ui-components/credential}/card/credential-details-list-item.js +0 -0
- /package/lib/module/{credential → ui-components/credential}/card/credential-details-list-item.js.map +0 -0
- /package/lib/module/{credential → ui-components/credential}/credential-carousel-images.js +0 -0
- /package/lib/module/{credential → ui-components/credential}/credential-carousel-images.js.map +0 -0
- /package/lib/module/{credential → ui-components/credential}/index.js +0 -0
- /package/lib/module/{credential → ui-components/credential}/index.js.map +0 -0
- /package/lib/module/{credential → ui-components/credential}/selector-status.js +0 -0
- /package/lib/module/{credential → ui-components/credential}/selector-status.js.map +0 -0
- /package/lib/module/{detail → ui-components/detail}/index.js +0 -0
- /package/lib/module/{detail → ui-components/detail}/index.js.map +0 -0
- /package/lib/module/{entity → ui-components/entity}/index.js +0 -0
- /package/lib/module/{entity → ui-components/entity}/index.js.map +0 -0
- /package/lib/module/{header → ui-components/header}/focus-aware-status-bar.js +0 -0
- /package/lib/module/{header → ui-components/header}/focus-aware-status-bar.js.map +0 -0
- /package/lib/module/{header → ui-components/header}/foldable-header.js +0 -0
- /package/lib/module/{header → ui-components/header}/foldable-header.js.map +0 -0
- /package/lib/module/{header → ui-components/header}/index.js +0 -0
- /package/lib/module/{header → ui-components/header}/index.js.map +0 -0
- /package/lib/module/{history → ui-components/history}/history-section-list-item.js +0 -0
- /package/lib/module/{history → ui-components/history}/history-section-list-item.js.map +0 -0
- /package/lib/module/{history → ui-components/history}/index.js +0 -0
- /package/lib/module/{history → ui-components/history}/index.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/connectivity.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/connectivity.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/credential.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/credential.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/history.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/history.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/icons.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/icons.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/index.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/index.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/input.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/input.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/keypad.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/keypad.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/loader.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/loader.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/nerd-view.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/nerd-view.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/selector.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/selector.js.map +0 -0
- /package/lib/module/{icons → ui-components/icons}/wallet.js +0 -0
- /package/lib/module/{icons → ui-components/icons}/wallet.js.map +0 -0
- /package/lib/module/{image → ui-components/image}/image-or-component.js +0 -0
- /package/lib/module/{image → ui-components/image}/image-or-component.js.map +0 -0
- /package/lib/module/{image → ui-components/image}/index.js +0 -0
- /package/lib/module/{image → ui-components/image}/index.js.map +0 -0
- /package/lib/module/{input → ui-components/input}/index.js +0 -0
- /package/lib/module/{input → ui-components/input}/index.js.map +0 -0
- /package/lib/module/{input → ui-components/input}/radio-group.js +0 -0
- /package/lib/module/{input → ui-components/input}/radio-group.js.map +0 -0
- /package/lib/module/{list → ui-components/list}/index.js +0 -0
- /package/lib/module/{list → ui-components/list}/index.js.map +0 -0
- /package/lib/module/{list → ui-components/list}/list-section-header.js +0 -0
- /package/lib/module/{list → ui-components/list}/list-section-header.js.map +0 -0
- /package/lib/module/{list → ui-components/list}/list-title-header.js +0 -0
- /package/lib/module/{list → ui-components/list}/list-title-header.js.map +0 -0
- /package/lib/module/{loader → ui-components/loader}/index.js +0 -0
- /package/lib/module/{loader → ui-components/loader}/index.js.map +0 -0
- /package/lib/module/{loader → ui-components/loader}/loading-result.js +0 -0
- /package/lib/module/{loader → ui-components/loader}/loading-result.js.map +0 -0
- /package/lib/module/{nerd-view → ui-components/nerd-view}/index.js +0 -0
- /package/lib/module/{nerd-view → ui-components/nerd-view}/index.js.map +0 -0
- /package/lib/module/{pin → ui-components/pin}/pins.js +0 -0
- /package/lib/module/{pin → ui-components/pin}/pins.js.map +0 -0
- /package/lib/module/{screens → ui-components/screens}/index.js +0 -0
- /package/lib/module/{screens → ui-components/screens}/index.js.map +0 -0
- /package/lib/module/{searchbar → ui-components/searchbar}/animated-search-bar.js +0 -0
- /package/lib/module/{searchbar → ui-components/searchbar}/animated-search-bar.js.map +0 -0
- /package/lib/module/{searchbar → ui-components/searchbar}/index.js +0 -0
- /package/lib/module/{searchbar → ui-components/searchbar}/index.js.map +0 -0
- /package/lib/module/{settings → ui-components/settings}/button-setting.js +0 -0
- /package/lib/module/{settings → ui-components/settings}/button-setting.js.map +0 -0
- /package/lib/module/{settings → ui-components/settings}/index.js +0 -0
- /package/lib/module/{settings → ui-components/settings}/index.js.map +0 -0
- /package/lib/module/{settings → ui-components/settings}/setting-item-separator.js +0 -0
- /package/lib/module/{settings → ui-components/settings}/setting-item-separator.js.map +0 -0
- /package/lib/module/{settings → ui-components/settings}/setting-item.js +0 -0
- /package/lib/module/{settings → ui-components/settings}/setting-item.js.map +0 -0
- /package/lib/module/{settings → ui-components/settings}/settings-button.js +0 -0
- /package/lib/module/{settings → ui-components/settings}/settings-button.js.map +0 -0
- /package/lib/module/{settings → ui-components/settings}/switch-setting.js +0 -0
- /package/lib/module/{settings → ui-components/settings}/switch-setting.js.map +0 -0
- /package/lib/module/{state → ui-components/state}/error-screen.js +0 -0
- /package/lib/module/{state → ui-components/state}/error-screen.js.map +0 -0
- /package/lib/module/{state → ui-components/state}/index.js +0 -0
- /package/lib/module/{state → ui-components/state}/index.js.map +0 -0
- /package/lib/module/{text → ui-components/text}/base.js +0 -0
- /package/lib/module/{text → ui-components/text}/base.js.map +0 -0
- /package/lib/module/{text → ui-components/text}/font.js +0 -0
- /package/lib/module/{text → ui-components/text}/font.js.map +0 -0
- /package/lib/module/{text → ui-components/text}/index.js +0 -0
- /package/lib/module/{text → ui-components/text}/index.js.map +0 -0
- /package/lib/module/{text → ui-components/text}/typography.js +0 -0
- /package/lib/module/{text → ui-components/text}/typography.js.map +0 -0
- /package/lib/module/{theme → ui-components/theme}/color-scheme-context.js +0 -0
- /package/lib/module/{theme → ui-components/theme}/color-scheme-context.js.map +0 -0
- /package/lib/module/{theme → ui-components/theme}/color-scheme.js +0 -0
- /package/lib/module/{theme → ui-components/theme}/color-scheme.js.map +0 -0
- /package/lib/module/{theme → ui-components/theme}/index.js +0 -0
- /package/lib/module/{theme → ui-components/theme}/index.js.map +0 -0
- /package/lib/typescript/{accessibility → ui-components/accessibility}/accessibility.d.ts +0 -0
- /package/lib/typescript/{accessibility → ui-components/accessibility}/accessibilityHistoryWrappers.d.ts +0 -0
- /package/lib/typescript/{accessibility → ui-components/accessibility}/accessibilityLanguage.d.ts +0 -0
- /package/lib/typescript/{accessibility → ui-components/accessibility}/index.d.ts +0 -0
- /package/lib/typescript/{accessibility → ui-components/accessibility}/locale/index.d.ts +0 -0
- /package/lib/typescript/{accessibility → ui-components/accessibility}/locale.test.d.ts +0 -0
- /package/lib/typescript/{action-modal → ui-components/action-modal}/ActionModal.d.ts +0 -0
- /package/lib/typescript/{action-modal → ui-components/action-modal}/index.d.ts +0 -0
- /package/lib/typescript/{activity-indicator → ui-components/activity-indicator}/activity-indicator.d.ts +0 -0
- /package/lib/typescript/{activity-indicator → ui-components/activity-indicator}/index.d.ts +0 -0
- /package/lib/typescript/{blur → ui-components/blur}/blur-view.d.ts +0 -0
- /package/lib/typescript/{blur → ui-components/blur}/index.d.ts +0 -0
- /package/lib/typescript/{buttons → ui-components/buttons}/button.d.ts +0 -0
- /package/lib/typescript/{buttons → ui-components/buttons}/connectivity-button.d.ts +0 -0
- /package/lib/typescript/{buttons → ui-components/buttons}/filter-button.d.ts +0 -0
- /package/lib/typescript/{buttons → ui-components/buttons}/ghost-button.d.ts +0 -0
- /package/lib/typescript/{buttons → ui-components/buttons}/index.d.ts +0 -0
- /package/lib/typescript/{buttons → ui-components/buttons}/scan-button.d.ts +0 -0
- /package/lib/typescript/{camera → ui-components/camera}/camera-overlay.d.ts +0 -0
- /package/lib/typescript/{camera → ui-components/camera}/index.d.ts +0 -0
- /package/lib/typescript/{camera → ui-components/camera}/qr-code-scanner.d.ts +0 -0
- /package/lib/typescript/{control → ui-components/control}/checkbox.d.ts +0 -0
- /package/lib/typescript/{control → ui-components/control}/index.d.ts +0 -0
- /package/lib/typescript/{control → ui-components/control}/switch.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/card/credential-details-card.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/card/credential-details-list-item.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/card/credential-header.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/card/credential-image-carousel.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/credential-carousel-images.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/index.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/selector-status.d.ts +0 -0
- /package/lib/typescript/{credential → ui-components/credential}/selector.d.ts +0 -0
- /package/lib/typescript/{detail → ui-components/detail}/detail.d.ts +0 -0
- /package/lib/typescript/{detail → ui-components/detail}/index.d.ts +0 -0
- /package/lib/typescript/{entity → ui-components/entity}/index.d.ts +0 -0
- /package/lib/typescript/{header → ui-components/header}/focus-aware-status-bar.d.ts +0 -0
- /package/lib/typescript/{header → ui-components/header}/foldable-header.d.ts +0 -0
- /package/lib/typescript/{header → ui-components/header}/header.d.ts +0 -0
- /package/lib/typescript/{header → ui-components/header}/index.d.ts +0 -0
- /package/lib/typescript/{header → ui-components/header}/navigation-header.d.ts +0 -0
- /package/lib/typescript/{history → ui-components/history}/data-item.d.ts +0 -0
- /package/lib/typescript/{history → ui-components/history}/history-list-item.d.ts +0 -0
- /package/lib/typescript/{history → ui-components/history}/history-section-header.d.ts +0 -0
- /package/lib/typescript/{history → ui-components/history}/history-section-list-item.d.ts +0 -0
- /package/lib/typescript/{history → ui-components/history}/index.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/connectivity.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/credential.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/entity.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/history.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/icons.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/index.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/input.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/keypad.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/loader.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/nerd-view.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/selector.d.ts +0 -0
- /package/lib/typescript/{icons → ui-components/icons}/wallet.d.ts +0 -0
- /package/lib/typescript/{image → ui-components/image}/image-or-component.d.ts +0 -0
- /package/lib/typescript/{image → ui-components/image}/index.d.ts +0 -0
- /package/lib/typescript/{input → ui-components/input}/index.d.ts +0 -0
- /package/lib/typescript/{input → ui-components/input}/radio-group.d.ts +0 -0
- /package/lib/typescript/{input → ui-components/input}/selection-input.d.ts +0 -0
- /package/lib/typescript/{input → ui-components/input}/text-input.d.ts +0 -0
- /package/lib/typescript/{list → ui-components/list}/index.d.ts +0 -0
- /package/lib/typescript/{list → ui-components/list}/list-section-header.d.ts +0 -0
- /package/lib/typescript/{list → ui-components/list}/list-title-header.d.ts +0 -0
- /package/lib/typescript/{loader → ui-components/loader}/index.d.ts +0 -0
- /package/lib/typescript/{loader → ui-components/loader}/loader.d.ts +0 -0
- /package/lib/typescript/{loader → ui-components/loader}/loading-result.d.ts +0 -0
- /package/lib/typescript/{nerd-view → ui-components/nerd-view}/index.d.ts +0 -0
- /package/lib/typescript/{nerd-view → ui-components/nerd-view}/nerd-mode-item.d.ts +0 -0
- /package/lib/typescript/{pin → ui-components/pin}/keypad.d.ts +0 -0
- /package/lib/typescript/{pin → ui-components/pin}/pin-code-screen.d.ts +0 -0
- /package/lib/typescript/{pin → ui-components/pin}/pins.d.ts +0 -0
- /package/lib/typescript/{screens → ui-components/screens}/backup-screen.d.ts +0 -0
- /package/lib/typescript/{screens → ui-components/screens}/image-preview-screen.d.ts +0 -0
- /package/lib/typescript/{screens → ui-components/screens}/index.d.ts +0 -0
- /package/lib/typescript/{screens → ui-components/screens}/qr-code-scanner-screen.d.ts +0 -0
- /package/lib/typescript/{screens → ui-components/screens}/scroll-view-screen.d.ts +0 -0
- /package/lib/typescript/{screens → ui-components/screens}/section-list-screen.d.ts +0 -0
- /package/lib/typescript/{searchbar → ui-components/searchbar}/animated-search-bar.d.ts +0 -0
- /package/lib/typescript/{searchbar → ui-components/searchbar}/index.d.ts +0 -0
- /package/lib/typescript/{searchbar → ui-components/searchbar}/search-bar.d.ts +0 -0
- /package/lib/typescript/{settings → ui-components/settings}/button-setting.d.ts +0 -0
- /package/lib/typescript/{settings → ui-components/settings}/index.d.ts +0 -0
- /package/lib/typescript/{settings → ui-components/settings}/setting-item-separator.d.ts +0 -0
- /package/lib/typescript/{settings → ui-components/settings}/setting-item.d.ts +0 -0
- /package/lib/typescript/{settings → ui-components/settings}/settings-button.d.ts +0 -0
- /package/lib/typescript/{settings → ui-components/settings}/switch-setting.d.ts +0 -0
- /package/lib/typescript/{state → ui-components/state}/error-screen.d.ts +0 -0
- /package/lib/typescript/{state → ui-components/state}/index.d.ts +0 -0
- /package/lib/typescript/{text → ui-components/text}/base.d.ts +0 -0
- /package/lib/typescript/{text → ui-components/text}/font.d.ts +0 -0
- /package/lib/typescript/{text → ui-components/text}/index.d.ts +0 -0
- /package/lib/typescript/{theme → ui-components/theme}/color-scheme-context.d.ts +0 -0
- /package/lib/typescript/{theme → ui-components/theme}/color-scheme.d.ts +0 -0
- /package/lib/typescript/{theme → ui-components/theme}/index.d.ts +0 -0
- /package/src/{accessibility → ui-components/accessibility}/accessibility.ts +0 -0
- /package/src/{accessibility → ui-components/accessibility}/accessibilityHistoryWrappers.tsx +0 -0
- /package/src/{accessibility → ui-components/accessibility}/accessibilityLanguage.tsx +0 -0
- /package/src/{accessibility → ui-components/accessibility}/index.ts +0 -0
- /package/src/{accessibility → ui-components/accessibility}/locale/de.json +0 -0
- /package/src/{accessibility → ui-components/accessibility}/locale/en.json +0 -0
- /package/src/{accessibility → ui-components/accessibility}/locale/fr.json +0 -0
- /package/src/{accessibility → ui-components/accessibility}/locale/index.ts +0 -0
- /package/src/{accessibility → ui-components/accessibility}/locale/it.json +0 -0
- /package/src/{accessibility → ui-components/accessibility}/locale.test.ts +0 -0
- /package/src/{action-modal → ui-components/action-modal}/ActionModal.stories.tsx +0 -0
- /package/src/{action-modal → ui-components/action-modal}/ActionModal.tsx +0 -0
- /package/src/{action-modal → ui-components/action-modal}/index.ts +0 -0
- /package/src/{activity-indicator → ui-components/activity-indicator}/activity-indicator.stories.tsx +0 -0
- /package/src/{activity-indicator → ui-components/activity-indicator}/activity-indicator.tsx +0 -0
- /package/src/{activity-indicator → ui-components/activity-indicator}/index.ts +0 -0
- /package/src/{blur → ui-components/blur}/index.ts +0 -0
- /package/src/{buttons → ui-components/buttons}/back-button.stories.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/button.stories.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/connectivity-button.stories.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/filter-button.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/ghost-button.stories.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/ghost-button.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/index.ts +0 -0
- /package/src/{buttons → ui-components/buttons}/scan-button.stories.tsx +0 -0
- /package/src/{buttons → ui-components/buttons}/scan-button.tsx +0 -0
- /package/src/{camera → ui-components/camera}/camera-overlay.tsx +0 -0
- /package/src/{camera → ui-components/camera}/index.tsx +0 -0
- /package/src/{camera → ui-components/camera}/qr-code-scanner.tsx +0 -0
- /package/src/{control → ui-components/control}/checkbox.stories.tsx +0 -0
- /package/src/{control → ui-components/control}/checkbox.tsx +0 -0
- /package/src/{control → ui-components/control}/index.ts +0 -0
- /package/src/{control → ui-components/control}/switch.stories.tsx +0 -0
- /package/src/{control → ui-components/control}/switch.tsx +0 -0
- /package/src/{credential → ui-components/credential}/card/credential-details-list-item.tsx +0 -0
- /package/src/{credential → ui-components/credential}/credential-carousel-images.tsx +0 -0
- /package/src/{credential → ui-components/credential}/index.ts +0 -0
- /package/src/{credential → ui-components/credential}/selector-status.ts +0 -0
- /package/src/{credential → ui-components/credential}/selector.stories.tsx +0 -0
- /package/src/{detail → ui-components/detail}/index.tsx +0 -0
- /package/src/{entity → ui-components/entity}/avatar.stories.tsx +0 -0
- /package/src/{entity → ui-components/entity}/entity-cluster.stories.tsx +0 -0
- /package/src/{entity → ui-components/entity}/index.ts +0 -0
- /package/src/{header → ui-components/header}/focus-aware-status-bar.tsx +0 -0
- /package/src/{header → ui-components/header}/foldable-header.tsx +0 -0
- /package/src/{header → ui-components/header}/index.ts +0 -0
- /package/src/{history → ui-components/history}/history-section-list-item.tsx +0 -0
- /package/src/{history → ui-components/history}/index.ts +0 -0
- /package/src/{icons → ui-components/icons}/connectivity.tsx +0 -0
- /package/src/{icons → ui-components/icons}/credential.tsx +0 -0
- /package/src/{icons → ui-components/icons}/history.tsx +0 -0
- /package/src/{icons → ui-components/icons}/icons.tsx +0 -0
- /package/src/{icons → ui-components/icons}/index.ts +0 -0
- /package/src/{icons → ui-components/icons}/input.tsx +0 -0
- /package/src/{icons → ui-components/icons}/keypad.tsx +0 -0
- /package/src/{icons → ui-components/icons}/loader.tsx +0 -0
- /package/src/{icons → ui-components/icons}/nerd-view.tsx +0 -0
- /package/src/{icons → ui-components/icons}/selector.tsx +0 -0
- /package/src/{icons → ui-components/icons}/wallet.tsx +0 -0
- /package/src/{image → ui-components/image}/image-or-component.tsx +0 -0
- /package/src/{image → ui-components/image}/index.tsx +0 -0
- /package/src/{input → ui-components/input}/index.ts +0 -0
- /package/src/{input → ui-components/input}/radio-group.tsx +0 -0
- /package/src/{input → ui-components/input}/selection-input.stories.tsx +0 -0
- /package/src/{list → ui-components/list}/index.ts +0 -0
- /package/src/{list → ui-components/list}/list-section-header.tsx +0 -0
- /package/src/{list → ui-components/list}/list-title-header.tsx +0 -0
- /package/src/{loader → ui-components/loader}/index.ts +0 -0
- /package/src/{loader → ui-components/loader}/loader.stories.tsx +0 -0
- /package/src/{loader → ui-components/loader}/loading-result.stories.tsx +0 -0
- /package/src/{loader → ui-components/loader}/loading-result.tsx +0 -0
- /package/src/{nerd-view → ui-components/nerd-view}/index.ts +0 -0
- /package/src/{pin → ui-components/pin}/pin-code-screen.stories.tsx +0 -0
- /package/src/{pin → ui-components/pin}/pins.tsx +0 -0
- /package/src/{screens → ui-components/screens}/index.ts +0 -0
- /package/src/{searchbar → ui-components/searchbar}/animated-search-bar.tsx +0 -0
- /package/src/{searchbar → ui-components/searchbar}/index.ts +0 -0
- /package/src/{searchbar → ui-components/searchbar}/search-bar.stories.tsx +0 -0
- /package/src/{settings → ui-components/settings}/button-setting.tsx +0 -0
- /package/src/{settings → ui-components/settings}/index.ts +0 -0
- /package/src/{settings → ui-components/settings}/setting-item-separator.tsx +0 -0
- /package/src/{settings → ui-components/settings}/setting-item.tsx +0 -0
- /package/src/{settings → ui-components/settings}/settings-button.tsx +0 -0
- /package/src/{settings → ui-components/settings}/switch-setting.tsx +0 -0
- /package/src/{state → ui-components/state}/error-screen.stories.tsx +0 -0
- /package/src/{state → ui-components/state}/error-screen.tsx +0 -0
- /package/src/{state → ui-components/state}/index.ts +0 -0
- /package/src/{text → ui-components/text}/base.tsx +0 -0
- /package/src/{text → ui-components/text}/font.ts +0 -0
- /package/src/{text → ui-components/text}/index.ts +0 -0
- /package/src/{text → ui-components/text}/typography.tsx +0 -0
- /package/src/{theme → ui-components/theme}/color-scheme-context.tsx +0 -0
- /package/src/{theme → ui-components/theme}/color-scheme.ts +0 -0
- /package/src/{theme → ui-components/theme}/index.ts +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { addEventListener as onNetworkStateChange, NetInfoStateType } from '@react-native-community/netinfo';
|
|
2
|
+
import parseUrl from 'parse-url';
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import BTStateManager from 'react-native-bluetooth-state-manager';
|
|
5
|
+
export let InternetState;
|
|
6
|
+
(function (InternetState) {
|
|
7
|
+
InternetState[InternetState["Available"] = 0] = "Available";
|
|
8
|
+
InternetState[InternetState["Unreachable"] = 1] = "Unreachable";
|
|
9
|
+
InternetState[InternetState["Disabled"] = 2] = "Disabled";
|
|
10
|
+
})(InternetState || (InternetState = {}));
|
|
11
|
+
export let BluetoothState;
|
|
12
|
+
(function (BluetoothState) {
|
|
13
|
+
BluetoothState[BluetoothState["Available"] = 0] = "Available";
|
|
14
|
+
BluetoothState[BluetoothState["Unauthorized"] = 1] = "Unauthorized";
|
|
15
|
+
BluetoothState[BluetoothState["Disabled"] = 2] = "Disabled";
|
|
16
|
+
BluetoothState[BluetoothState["Unavailable"] = 3] = "Unavailable";
|
|
17
|
+
})(BluetoothState || (BluetoothState = {}));
|
|
18
|
+
export let Transport;
|
|
19
|
+
(function (Transport) {
|
|
20
|
+
Transport["Bluetooth"] = "BLE";
|
|
21
|
+
Transport["HTTP"] = "HTTP";
|
|
22
|
+
Transport["MQTT"] = "MQTT";
|
|
23
|
+
})(Transport || (Transport = {}));
|
|
24
|
+
export const useAvailableTransports = supportedTransports => {
|
|
25
|
+
const [internetState, setInternetState] = useState();
|
|
26
|
+
const [bluetoothState, setBluetoothState] = useState();
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
let btSubscription;
|
|
29
|
+
if (supportedTransports.includes(Transport.Bluetooth)) {
|
|
30
|
+
btSubscription = BTStateManager.onStateChange(state => {
|
|
31
|
+
switch (state) {
|
|
32
|
+
case 'PoweredOn':
|
|
33
|
+
setBluetoothState(BluetoothState.Available);
|
|
34
|
+
break;
|
|
35
|
+
case 'PoweredOff':
|
|
36
|
+
setBluetoothState(BluetoothState.Disabled);
|
|
37
|
+
break;
|
|
38
|
+
case 'Unauthorized':
|
|
39
|
+
setBluetoothState(BluetoothState.Unauthorized);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
setBluetoothState(BluetoothState.Unavailable);
|
|
43
|
+
}
|
|
44
|
+
}, true);
|
|
45
|
+
}
|
|
46
|
+
let netSubscription;
|
|
47
|
+
if (supportedTransports.includes(Transport.HTTP) || supportedTransports.includes(Transport.MQTT)) {
|
|
48
|
+
netSubscription = onNetworkStateChange(state => {
|
|
49
|
+
if (state.type === NetInfoStateType.none) {
|
|
50
|
+
setInternetState(InternetState.Disabled);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (state.isInternetReachable === null) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (state.isInternetReachable) {
|
|
57
|
+
setInternetState(InternetState.Available);
|
|
58
|
+
} else {
|
|
59
|
+
setInternetState(InternetState.Unreachable);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return () => {
|
|
64
|
+
var _btSubscription, _netSubscription;
|
|
65
|
+
(_btSubscription = btSubscription) === null || _btSubscription === void 0 ? void 0 : _btSubscription.remove();
|
|
66
|
+
(_netSubscription = netSubscription) === null || _netSubscription === void 0 ? void 0 : _netSubscription();
|
|
67
|
+
};
|
|
68
|
+
}, [supportedTransports]);
|
|
69
|
+
const transportStatus = useMemo(() => {
|
|
70
|
+
const waitingForInternetState = (supportedTransports.includes(Transport.HTTP) || supportedTransports.includes(Transport.MQTT)) && internetState === undefined;
|
|
71
|
+
const waitingForBluetoothState = supportedTransports.includes(Transport.Bluetooth) && bluetoothState === undefined;
|
|
72
|
+
if (waitingForInternetState || waitingForBluetoothState) {
|
|
73
|
+
return {
|
|
74
|
+
availableTransport: undefined,
|
|
75
|
+
transportError: {}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const availableTransport = [];
|
|
79
|
+
const transportError = {};
|
|
80
|
+
if (internetState === InternetState.Available) {
|
|
81
|
+
availableTransport.push(Transport.MQTT);
|
|
82
|
+
availableTransport.push(Transport.HTTP);
|
|
83
|
+
} else {
|
|
84
|
+
transportError.internet = internetState;
|
|
85
|
+
}
|
|
86
|
+
if (bluetoothState === BluetoothState.Available) {
|
|
87
|
+
availableTransport.push(Transport.Bluetooth);
|
|
88
|
+
} else {
|
|
89
|
+
transportError.ble = bluetoothState;
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
availableTransport,
|
|
93
|
+
transportError
|
|
94
|
+
};
|
|
95
|
+
}, [bluetoothState, internetState, supportedTransports]);
|
|
96
|
+
return transportStatus;
|
|
97
|
+
};
|
|
98
|
+
export const getInvitationUrlTransports = (url, customOpenIdUrlScheme) => {
|
|
99
|
+
let parsedUrl;
|
|
100
|
+
try {
|
|
101
|
+
parsedUrl = parseUrl(url);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
if (parsedUrl.parse_failed) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
const protocol = parsedUrl.protocol;
|
|
109
|
+
if (protocol !== 'openid4vp' && protocol !== (customOpenIdUrlScheme === null || customOpenIdUrlScheme === void 0 ? void 0 : customOpenIdUrlScheme.toLowerCase())) {
|
|
110
|
+
return [Transport.HTTP];
|
|
111
|
+
}
|
|
112
|
+
const query = parsedUrl.query;
|
|
113
|
+
const hasAllParameters = function () {
|
|
114
|
+
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
115
|
+
params[_key] = arguments[_key];
|
|
116
|
+
}
|
|
117
|
+
return params.every(param => param in query);
|
|
118
|
+
};
|
|
119
|
+
const transports = [];
|
|
120
|
+
// BLE/MQTT
|
|
121
|
+
if (parsedUrl.host === 'connect') {
|
|
122
|
+
if (hasAllParameters('name', 'key')) {
|
|
123
|
+
transports.push(Transport.Bluetooth);
|
|
124
|
+
}
|
|
125
|
+
if (hasAllParameters('key', 'brokerUrl', 'topicId')) {
|
|
126
|
+
transports.push(Transport.MQTT);
|
|
127
|
+
}
|
|
128
|
+
return transports;
|
|
129
|
+
}
|
|
130
|
+
// HTTP
|
|
131
|
+
if (hasAllParameters('response_type', 'state', 'nonce', 'presentation_definition_uri') || hasAllParameters('client_id', 'request_uri')) {
|
|
132
|
+
transports.push(Transport.HTTP);
|
|
133
|
+
}
|
|
134
|
+
return transports;
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=connectivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["addEventListener","onNetworkStateChange","NetInfoStateType","parseUrl","useEffect","useMemo","useState","BTStateManager","InternetState","BluetoothState","Transport","useAvailableTransports","supportedTransports","internetState","setInternetState","bluetoothState","setBluetoothState","btSubscription","includes","Bluetooth","onStateChange","state","Available","Disabled","Unauthorized","Unavailable","netSubscription","HTTP","MQTT","type","none","isInternetReachable","Unreachable","_btSubscription","_netSubscription","remove","transportStatus","waitingForInternetState","undefined","waitingForBluetoothState","availableTransport","transportError","push","internet","ble","getInvitationUrlTransports","url","customOpenIdUrlScheme","parsedUrl","e","parse_failed","protocol","toLowerCase","query","hasAllParameters","_len","arguments","length","params","Array","_key","every","param","transports","host"],"sources":["connectivity.ts"],"sourcesContent":["import {\n addEventListener as onNetworkStateChange,\n NetInfoStateType,\n NetInfoSubscription,\n} from '@react-native-community/netinfo';\nimport parseUrl from 'parse-url';\nimport { useEffect, useMemo, useState } from 'react';\nimport { EventSubscription } from 'react-native';\nimport BTStateManager from 'react-native-bluetooth-state-manager';\n\nexport enum InternetState {\n Available,\n Unreachable,\n Disabled,\n}\n\nexport type InternetError = Exclude<InternetState, InternetState.Available>;\n\nexport enum BluetoothState {\n Available,\n Unauthorized,\n Disabled,\n Unavailable,\n}\n\nexport type BluetoothError = Exclude<BluetoothState, BluetoothState.Available>;\n\nexport enum Transport {\n Bluetooth = 'BLE',\n HTTP = 'HTTP',\n MQTT = 'MQTT',\n}\n\nexport type TransportError = {\n ble?: BluetoothError;\n internet?: InternetError;\n};\n\nexport const useAvailableTransports = (\n supportedTransports: Transport[],\n): {\n availableTransport: Transport[] | undefined;\n transportError: TransportError;\n} => {\n const [internetState, setInternetState] = useState<InternetState>();\n const [bluetoothState, setBluetoothState] = useState<BluetoothState>();\n\n useEffect(() => {\n let btSubscription: EventSubscription | undefined;\n if (supportedTransports.includes(Transport.Bluetooth)) {\n btSubscription = BTStateManager.onStateChange((state) => {\n switch (state) {\n case 'PoweredOn':\n setBluetoothState(BluetoothState.Available);\n break;\n case 'PoweredOff':\n setBluetoothState(BluetoothState.Disabled);\n break;\n case 'Unauthorized':\n setBluetoothState(BluetoothState.Unauthorized);\n break;\n default:\n setBluetoothState(BluetoothState.Unavailable);\n }\n }, true);\n }\n let netSubscription: NetInfoSubscription | undefined;\n if (supportedTransports.includes(Transport.HTTP) || supportedTransports.includes(Transport.MQTT)) {\n netSubscription = onNetworkStateChange((state) => {\n if (state.type === NetInfoStateType.none) {\n setInternetState(InternetState.Disabled);\n return;\n }\n if (state.isInternetReachable === null) {\n return;\n }\n if (state.isInternetReachable) {\n setInternetState(InternetState.Available);\n } else {\n setInternetState(InternetState.Unreachable);\n }\n });\n }\n return () => {\n btSubscription?.remove();\n netSubscription?.();\n };\n }, [supportedTransports]);\n\n const transportStatus = useMemo(() => {\n const waitingForInternetState =\n (supportedTransports.includes(Transport.HTTP) || supportedTransports.includes(Transport.MQTT)) &&\n internetState === undefined;\n const waitingForBluetoothState = supportedTransports.includes(Transport.Bluetooth) && bluetoothState === undefined;\n if (waitingForInternetState || waitingForBluetoothState) {\n return {\n availableTransport: undefined,\n transportError: {},\n };\n }\n const availableTransport: Transport[] = [];\n const transportError: TransportError = {};\n if (internetState === InternetState.Available) {\n availableTransport.push(Transport.MQTT);\n availableTransport.push(Transport.HTTP);\n } else {\n transportError.internet = internetState;\n }\n if (bluetoothState === BluetoothState.Available) {\n availableTransport.push(Transport.Bluetooth);\n } else {\n transportError.ble = bluetoothState;\n }\n return { availableTransport, transportError };\n }, [bluetoothState, internetState, supportedTransports]);\n\n return transportStatus;\n};\n\nexport const getInvitationUrlTransports = (url: string, customOpenIdUrlScheme?: string): Transport[] => {\n let parsedUrl: parseUrl.ParsedUrl;\n try {\n parsedUrl = parseUrl(url);\n } catch (e) {\n return [];\n }\n\n if (parsedUrl.parse_failed) {\n return [];\n }\n const protocol = parsedUrl.protocol as string;\n if (protocol !== 'openid4vp' && protocol !== customOpenIdUrlScheme?.toLowerCase()) {\n return [Transport.HTTP];\n }\n\n const query = parsedUrl.query as Record<string, string>;\n const hasAllParameters = (...params: string[]): boolean => {\n return params.every((param) => param in query);\n };\n\n const transports: Transport[] = [];\n // BLE/MQTT\n if (parsedUrl.host === 'connect') {\n if (hasAllParameters('name', 'key')) {\n transports.push(Transport.Bluetooth);\n }\n if (hasAllParameters('key', 'brokerUrl', 'topicId')) {\n transports.push(Transport.MQTT);\n }\n\n return transports;\n }\n // HTTP\n if (\n hasAllParameters('response_type', 'state', 'nonce', 'presentation_definition_uri') ||\n hasAllParameters('client_id', 'request_uri')\n ) {\n transports.push(Transport.HTTP);\n }\n\n return transports;\n};\n"],"mappings":"AAAA,SACEA,gBAAgB,IAAIC,oBAAoB,EACxCC,gBAAgB,QAEX,iCAAiC;AACxC,OAAOC,QAAQ,MAAM,WAAW;AAChC,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEpD,OAAOC,cAAc,MAAM,sCAAsC;AAEjE,WAAYC,aAAa;AAIxB,WAJWA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,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,OAAOF,MAAM,CAACG,KAAK,CAAEC,KAAK,IAAKA,KAAK,IAAIT,KAAK,CAAC;EAChD,CAAC;EAED,MAAMU,UAAuB,GAAG,EAAE;EAClC;EACA,IAAIf,SAAS,CAACgB,IAAI,KAAK,SAAS,EAAE;IAChC,IAAIV,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;MACnCS,UAAU,CAACrB,IAAI,CAAChC,SAAS,CAACS,SAAS,CAAC;IACtC;IACA,IAAImC,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE;MACnDS,UAAU,CAACrB,IAAI,CAAChC,SAAS,CAACkB,IAAI,CAAC;IACjC;IAEA,OAAOmC,UAAU;EACnB;EACA;EACA,IACET,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,6BAA6B,CAAC,IAClFA,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,EAC5C;IACAS,UAAU,CAACrB,IAAI,CAAChC,SAAS,CAACiB,IAAI,CAAC;EACjC;EAEA,OAAOoC,UAAU;AACnB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getInvitationUrlTransports, Transport } from './connectivity';
|
|
2
|
+
jest.mock('@react-native-community/netinfo', () => ({
|
|
3
|
+
addEventListener: () => {}
|
|
4
|
+
}));
|
|
5
|
+
jest.mock('react-native-bluetooth-state-manager', () => ({
|
|
6
|
+
onStateChange: () => {}
|
|
7
|
+
}));
|
|
8
|
+
describe('getInvitationUrlTransports', () => {
|
|
9
|
+
test('BLE OpenID4VP url', () => {
|
|
10
|
+
const transports = getInvitationUrlTransports('OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b', 'mdoc-openid4vp');
|
|
11
|
+
expect(transports).toStrictEqual([Transport.Bluetooth]);
|
|
12
|
+
});
|
|
13
|
+
test('MQTT OpenID4VP url', () => {
|
|
14
|
+
const transports = getInvitationUrlTransports('OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35', 'mdoc-openid4vp');
|
|
15
|
+
expect(transports).toStrictEqual([Transport.MQTT]);
|
|
16
|
+
});
|
|
17
|
+
test('Mixed BLE/MQTT OpenID4VP url', () => {
|
|
18
|
+
const transports = getInvitationUrlTransports('OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35', 'mdoc-openid4vp');
|
|
19
|
+
expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);
|
|
20
|
+
});
|
|
21
|
+
test('BLE OpenID4VP url with custom scheme', () => {
|
|
22
|
+
const transports = getInvitationUrlTransports('MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b', 'mdoc-openid4vp');
|
|
23
|
+
expect(transports).toStrictEqual([Transport.Bluetooth]);
|
|
24
|
+
});
|
|
25
|
+
test('MQTT OpenID4VP url with custom scheme', () => {
|
|
26
|
+
const transports = getInvitationUrlTransports('MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35', 'mdoc-openid4vp');
|
|
27
|
+
expect(transports).toStrictEqual([Transport.MQTT]);
|
|
28
|
+
});
|
|
29
|
+
test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {
|
|
30
|
+
const transports = getInvitationUrlTransports('MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35', 'mdoc-openid4vp');
|
|
31
|
+
expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);
|
|
32
|
+
});
|
|
33
|
+
test('HTTP OpenID4VP url', () => {
|
|
34
|
+
const transports = getInvitationUrlTransports('openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition', 'mdoc-openid4vp');
|
|
35
|
+
expect(transports).toStrictEqual([Transport.HTTP]);
|
|
36
|
+
});
|
|
37
|
+
test('HTTP OpenID4VP url with custom scheme', () => {
|
|
38
|
+
const transports = getInvitationUrlTransports('mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition', 'mdoc-openid4vp');
|
|
39
|
+
expect(transports).toStrictEqual([Transport.HTTP]);
|
|
40
|
+
});
|
|
41
|
+
test('HTTP OpenID4VP url with requestUri', () => {
|
|
42
|
+
const transports = getInvitationUrlTransports('openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request', 'mdoc-openid4vp');
|
|
43
|
+
expect(transports).toStrictEqual([Transport.HTTP]);
|
|
44
|
+
});
|
|
45
|
+
test('HTTP OpenID credential offer url', () => {
|
|
46
|
+
const transports = getInvitationUrlTransports('openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176', 'mdoc-openid4vp');
|
|
47
|
+
expect(transports).toStrictEqual([Transport.HTTP]);
|
|
48
|
+
});
|
|
49
|
+
test('Invalid link', () => {
|
|
50
|
+
const transports = getInvitationUrlTransports('invalid');
|
|
51
|
+
expect(transports).toStrictEqual([]);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=connectivity.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getInvitationUrlTransports","Transport","jest","mock","addEventListener","onStateChange","describe","test","transports","expect","toStrictEqual","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getInvitationUrlTransports('invalid');\n expect(transports).toStrictEqual([]);\n });\n});\n"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,SAAS,QAAQ,gBAAgB;AAEtEC,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDC,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHF,IAAI,CAACC,IAAI,CAAC,sCAAsC,EAAE,OAAO;EACvDE,aAAa,EAAEA,CAAA,KAAM,CAAC;AACxB,CAAC,CAAC,CAAC;AAEHC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EA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
import { useCallback } from 'react';
|
|
3
|
+
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
4
|
+
import { generateUUID } from '../../uuid';
|
|
5
|
+
import { useONECore } from './core-context';
|
|
6
|
+
import { HW_DID_NAME_PREFIX, SW_DID_NAME_PREFIX } from './core-init';
|
|
7
|
+
import { OneErrorCode } from './error-code';
|
|
8
|
+
import { HISTORY_LIST_QUERY_KEY } from './history';
|
|
9
|
+
const BACKUP_INFO_QUERY_KEY = 'backup-info';
|
|
10
|
+
export const useBackupInfo = () => {
|
|
11
|
+
const {
|
|
12
|
+
core
|
|
13
|
+
} = useONECore();
|
|
14
|
+
return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {
|
|
15
|
+
keepPreviousData: true
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export const useCreateBackup = () => {
|
|
19
|
+
const queryClient = useQueryClient();
|
|
20
|
+
const {
|
|
21
|
+
core
|
|
22
|
+
} = useONECore();
|
|
23
|
+
return useMutation(async _ref => {
|
|
24
|
+
let {
|
|
25
|
+
password,
|
|
26
|
+
outputPath
|
|
27
|
+
} = _ref;
|
|
28
|
+
return core.createBackup(password, outputPath);
|
|
29
|
+
}, {
|
|
30
|
+
onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY)
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export const useUnpackBackup = () => {
|
|
34
|
+
const queryClient = useQueryClient();
|
|
35
|
+
const {
|
|
36
|
+
core
|
|
37
|
+
} = useONECore();
|
|
38
|
+
return useMutation(async _ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
password,
|
|
41
|
+
inputPath
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return core.unpackBackup(password, inputPath);
|
|
44
|
+
}, {
|
|
45
|
+
onSuccess: () => queryClient.resetQueries()
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
export const useFinalizeImport = () => {
|
|
49
|
+
const queryClient = useQueryClient();
|
|
50
|
+
const {
|
|
51
|
+
core
|
|
52
|
+
} = useONECore();
|
|
53
|
+
return useMutation(async () => core.finalizeImport(), {
|
|
54
|
+
onSuccess: () => queryClient.resetQueries()
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
export const useRollbackImport = () => {
|
|
58
|
+
const queryClient = useQueryClient();
|
|
59
|
+
const {
|
|
60
|
+
core
|
|
61
|
+
} = useONECore();
|
|
62
|
+
return useMutation(async () => core.rollbackImport(), {
|
|
63
|
+
onSuccess: () => queryClient.resetQueries()
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
export const useBackupFinalizeImportProcedure = () => {
|
|
67
|
+
const {
|
|
68
|
+
mutateAsync: finalizeImport
|
|
69
|
+
} = useFinalizeImport();
|
|
70
|
+
const {
|
|
71
|
+
core,
|
|
72
|
+
organisationId
|
|
73
|
+
} = useONECore();
|
|
74
|
+
return useCallback(async () => {
|
|
75
|
+
var _dids$values$find;
|
|
76
|
+
await finalizeImport();
|
|
77
|
+
|
|
78
|
+
// update wallet did references
|
|
79
|
+
const dids = await core.getDids({
|
|
80
|
+
deactivated: false,
|
|
81
|
+
organisationId,
|
|
82
|
+
page: 0,
|
|
83
|
+
pageSize: 1,
|
|
84
|
+
type: DidTypeEnum.LOCAL
|
|
85
|
+
});
|
|
86
|
+
let swDidId = (_dids$values$find = dids.values.find(did => did.name.startsWith(SW_DID_NAME_PREFIX))) === null || _dids$values$find === void 0 ? void 0 : _dids$values$find.id;
|
|
87
|
+
if (!swDidId) {
|
|
88
|
+
const swKeyId = await core.generateKey({
|
|
89
|
+
keyParams: {},
|
|
90
|
+
keyType: 'EDDSA',
|
|
91
|
+
name: `holder-key-sw-${generateUUID()}`,
|
|
92
|
+
organisationId,
|
|
93
|
+
storageParams: {},
|
|
94
|
+
storageType: 'INTERNAL'
|
|
95
|
+
});
|
|
96
|
+
swDidId = await core.createDid({
|
|
97
|
+
didMethod: 'KEY',
|
|
98
|
+
keys: {
|
|
99
|
+
assertionMethod: [swKeyId],
|
|
100
|
+
authentication: [swKeyId],
|
|
101
|
+
capabilityDelegation: [swKeyId],
|
|
102
|
+
capabilityInvocation: [swKeyId],
|
|
103
|
+
keyAgreement: [swKeyId]
|
|
104
|
+
},
|
|
105
|
+
name: `${SW_DID_NAME_PREFIX}-${generateUUID()}`,
|
|
106
|
+
organisationId,
|
|
107
|
+
params: {}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
let hwDidId = null;
|
|
111
|
+
const hwKeyId = await core.generateKey({
|
|
112
|
+
keyParams: {},
|
|
113
|
+
keyType: 'ES256',
|
|
114
|
+
name: `holder-key-hw-${generateUUID()}`,
|
|
115
|
+
organisationId,
|
|
116
|
+
storageParams: {},
|
|
117
|
+
storageType: 'SECURE_ELEMENT'
|
|
118
|
+
}).catch(e => {
|
|
119
|
+
// ignore if HW keys not supported by device
|
|
120
|
+
if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
throw e;
|
|
124
|
+
});
|
|
125
|
+
if (hwKeyId) {
|
|
126
|
+
hwDidId = await core.createDid({
|
|
127
|
+
didMethod: 'KEY',
|
|
128
|
+
keys: {
|
|
129
|
+
assertionMethod: [hwKeyId],
|
|
130
|
+
authentication: [hwKeyId],
|
|
131
|
+
capabilityDelegation: [hwKeyId],
|
|
132
|
+
capabilityInvocation: [hwKeyId],
|
|
133
|
+
keyAgreement: [hwKeyId]
|
|
134
|
+
},
|
|
135
|
+
name: `${HW_DID_NAME_PREFIX}-${generateUUID()}`,
|
|
136
|
+
organisationId,
|
|
137
|
+
params: {}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return [hwDidId, swDidId];
|
|
141
|
+
}, [core, organisationId, finalizeImport]);
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=backup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DidTypeEnum","OneError","useCallback","useMutation","useQuery","useQueryClient","generateUUID","useONECore","HW_DID_NAME_PREFIX","SW_DID_NAME_PREFIX","OneErrorCode","HISTORY_LIST_QUERY_KEY","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","backupInfo","keepPreviousData","useCreateBackup","queryClient","_ref","password","outputPath","createBackup","onSuccess","invalidateQueries","useUnpackBackup","_ref2","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","mutateAsync","organisationId","_dids$values$find","dids","getDids","deactivated","page","pageSize","type","LOCAL","swDidId","values","find","did","name","startsWith","id","swKeyId","generateKey","keyParams","keyType","storageParams","storageType","createDid","didMethod","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","hwDidId","hwKeyId","catch","e","code","KeyStorageNotSupported"],"sources":["backup.ts"],"sourcesContent":["import { DidTypeEnum, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { generateUUID } from '../../uuid';\nimport { useONECore } from './core-context';\nimport { HW_DID_NAME_PREFIX, SW_DID_NAME_PREFIX } from './core-init';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useBackupFinalizeImportProcedure = () => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet did references\n const dids = await core.getDids({\n deactivated: false,\n organisationId,\n page: 0,\n pageSize: 1,\n type: DidTypeEnum.LOCAL,\n });\n let swDidId = dids.values.find((did) => did.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n\n if (!swDidId) {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'EDDSA',\n name: `holder-key-sw-${generateUUID()}`,\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n swDidId = await core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n name: `${SW_DID_NAME_PREFIX}-${generateUUID()}`,\n organisationId,\n params: {},\n });\n }\n\n let hwDidId: string | null = null;\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ES256',\n name: `holder-key-hw-${generateUUID()}`,\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n if (hwKeyId) {\n hwDidId = await core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n name: `${HW_DID_NAME_PREFIX}-${generateUUID()}`,\n organisationId,\n params: {},\n });\n }\n\n return [hwDidId, swDidId] as [string | null, string];\n }, [core, organisationId, finalizeImport]);\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,iCAAiC;AACvE,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,YAAY,QAAQ,YAAY;AACzC,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,kBAAkB,EAAEC,kBAAkB,QAAQ,aAAa;AACpE,SAASC,YAAY,QAAQ,cAAc;AAC3C,SAASC,sBAAsB,QAAQ,WAAW;AAElD,MAAMC,qBAAqB,GAAG,aAAa;AAE3C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAGP,UAAU,EAAE;EAE7B,OAAOH,QAAQ,CAAC,CAACQ,qBAAqB,CAAC,EAAE,MAAME,IAAI,CAACC,UAAU,EAAE,EAAE;IAChEC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACnC,MAAMC,WAAW,GAAGb,cAAc,EAAE;EACpC,MAAM;IAAES;EAAK,CAAC,GAAGP,UAAU,EAAE;EAE7B,OAAOJ,WAAW,CAChB,MAAAgB,IAAA;IAAA,IAAO;MAAEC,QAAQ;MAAEC;IAAqD,CAAC,GAAAF,IAAA;IAAA,OACvEL,IAAI,CAACQ,YAAY,CAACF,QAAQ,EAAEC,UAAU,CAAC;EAAA,GACzC;IACEE,SAAS,EAAEA,CAAA,KAAML,WAAW,CAACM,iBAAiB,CAACb,sBAAsB;EACvE,CAAC,CACF;AACH,CAAC;AAED,OAAO,MAAMc,eAAe,GAAGA,CAAA,KAAM;EACnC,MA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;MACvC8B,cAAc;MACdoB,aAAa,EAAE,CAAC,CAAC;MACjBC,WAAW,EAAE;IACf,CAAC,CAAC,CACDY,KAAK,CAAEC,CAAC,IAAK;MACZ;MACA,IAAIA,CAAC,YAAYrE,QAAQ,IAAIqE,CAAC,CAACC,IAAI,KAAK7D,YAAY,CAAC8D,sBAAsB,EAAE;QAC3E,OAAO,IAAI;MACb;MACA,MAAMF,CAAC;IACT,CAAC,CAAC;IACJ,IAAIF,OAAO,EAAE;MACXD,OAAO,GAAG,MAAMrD,IAAI,CAAC4C,SAAS,CAAC;QAC7BC,SAAS,EAAE,KAAK;QAChBC,IAAI,EAAE;UACJC,eAAe,EAAE,CAACO,OAAO,CAAC;UAC1BN,cAAc,EAAE,CAACM,OAAO,CAAC;UACzBL,oBAAoB,EAAE,CAACK,OAAO,CAAC;UAC/BJ,oBAAoB,EAAE,CAACI,OAAO,CAAC;UAC/BH,YAAY,EAAE,CAACG,OAAO;QACxB,CAAC;QACDnB,IAAI,EAAG,GAAEzC,kBAAmB,IAAGF,YAAY,EAAG,EAAC;QAC/C8B,cAAc;QACd8B,MAAM,EAAE,CAAC;MACX,CAAC,CAAC;IACJ;IAEA,OAAO,CAACC,OAAO,EAAEtB,OAAO,CAAC;EAC3B,CAAC,EAAE,CAAC/B,IAAI,EAAEsB,cAAc,EAAEL,cAAc,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from 'react-query';
|
|
2
|
+
import { useONECore } from './core-context';
|
|
3
|
+
const CONFIG_QUERY_KEY = 'config';
|
|
4
|
+
export const useCoreConfig = () => {
|
|
5
|
+
const {
|
|
6
|
+
core
|
|
7
|
+
} = useONECore();
|
|
8
|
+
return useQuery([CONFIG_QUERY_KEY], () => core === null || core === void 0 ? void 0 : core.getConfig(), {
|
|
9
|
+
keepPreviousData: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=core-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useQuery","useONECore","CONFIG_QUERY_KEY","useCoreConfig","core","getConfig","keepPreviousData"],"sources":["core-config.ts"],"sourcesContent":["import { useQuery } from 'react-query';\n\nimport { useONECore } from './core-context';\n\nconst CONFIG_QUERY_KEY = 'config';\n\nexport const useCoreConfig = () => {\n const { core } = useONECore();\n\n return useQuery([CONFIG_QUERY_KEY], () => core?.getConfig(), {\n keepPreviousData: true,\n });\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,aAAa;AAEtC,SAASC,UAAU,QAAQ,gBAAgB;AAE3C,MAAMC,gBAAgB,GAAG,QAAQ;AAEjC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAGH,UAAU,EAAE;EAE7B,OAAOD,QAAQ,CAAC,CAACE,gBAAgB,CAAC,EAAE,MAAME,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEC,SAAS,EAAE,EAAE;IAC3DC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { initializeCore } from '@procivis/react-native-one-core';
|
|
2
|
+
import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { reportException } from '../../reporting';
|
|
4
|
+
import { useCreateTrustAnchor } from './trust-entity';
|
|
5
|
+
const defaultContextValue = {
|
|
6
|
+
core: {},
|
|
7
|
+
organisationId: '11111111-2222-3333-a444-ffffffffffff',
|
|
8
|
+
initialize: () => Promise.reject()
|
|
9
|
+
};
|
|
10
|
+
const ONECoreContext = /*#__PURE__*/createContext(defaultContextValue);
|
|
11
|
+
export const ONECoreContextProvider = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
children,
|
|
14
|
+
organisationId = '11111111-2222-3333-a444-ffffffffffff',
|
|
15
|
+
publisherReference,
|
|
16
|
+
config
|
|
17
|
+
} = _ref;
|
|
18
|
+
const [core, setCore] = useState();
|
|
19
|
+
const createTrustAnchor = useCreateTrustAnchor(publisherReference);
|
|
20
|
+
const initialize = useCallback(async force => {
|
|
21
|
+
if (core && !force) {
|
|
22
|
+
return core;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const coreInstance = await initializeCore(config);
|
|
26
|
+
setCore(coreInstance);
|
|
27
|
+
return coreInstance;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
reportException(e, 'Failed to initialize core');
|
|
30
|
+
throw e;
|
|
31
|
+
}
|
|
32
|
+
}, [core, config]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const corePromise = initialize();
|
|
35
|
+
return () => {
|
|
36
|
+
corePromise.then(c => c === null || c === void 0 ? void 0 : c.uninitialize(false)).catch(e => {
|
|
37
|
+
reportException(e, 'Core uninitialization error');
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
[]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!core) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
createTrustAnchor(core).catch(() => {});
|
|
48
|
+
}, [core, createTrustAnchor]);
|
|
49
|
+
const contextValue = useMemo(() => ({
|
|
50
|
+
core: core !== null && core !== void 0 ? core : defaultContextValue.core,
|
|
51
|
+
organisationId,
|
|
52
|
+
initialize
|
|
53
|
+
}), [core, initialize, organisationId]);
|
|
54
|
+
if (!core) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return /*#__PURE__*/React.createElement(ONECoreContext.Provider, {
|
|
58
|
+
value: contextValue
|
|
59
|
+
}, children);
|
|
60
|
+
};
|
|
61
|
+
export const useONECore = () => useContext(ONECoreContext);
|
|
62
|
+
//# sourceMappingURL=core-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["initializeCore","React","createContext","useCallback","useContext","useEffect","useMemo","useState","reportException","useCreateTrustAnchor","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","ONECoreContextProvider","_ref","children","publisherReference","config","setCore","createTrustAnchor","force","coreInstance","e","corePromise","then","c","uninitialize","catch","contextValue","createElement","Provider","value","useONECore"],"sources":["core-context.tsx"],"sourcesContent":["import { initializeCore, ONECore } from '@procivis/react-native-one-core';\nimport React, {\n createContext,\n FC,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useCreateTrustAnchor } from './trust-entity';\n\ninterface ContextValue {\n core: ONECore;\n organisationId: string;\n initialize: (force?: boolean) => Promise<ONECore>;\n}\n\nconst defaultContextValue: ContextValue = {\n core: {} as ONECore,\n organisationId: '11111111-2222-3333-a444-ffffffffffff',\n initialize: () => Promise.reject(),\n};\n\nexport type ONECoreContextProviderProps = {\n config?: Record<string, unknown>;\n organisationId?: string;\n publisherReference: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = '11111111-2222-3333-a444-ffffffffffff',\n publisherReference,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n const createTrustAnchor = useCreateTrustAnchor(publisherReference);\n\n const initialize = useCallback(\n async (force?: boolean) => {\n if (core && !force) {\n return core;\n }\n\n try {\n const coreInstance = await initializeCore(config);\n setCore(coreInstance);\n return coreInstance;\n } catch (e) {\n reportException(e, 'Failed to initialize core');\n throw e;\n }\n },\n [core, config],\n );\n\n useEffect(\n () => {\n const corePromise = initialize();\n return () => {\n corePromise\n .then((c) => c?.uninitialize(false))\n .catch((e) => {\n reportException(e, 'Core uninitialization error');\n });\n };\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n useEffect(() => {\n if (!core) {\n return;\n }\n createTrustAnchor(core).catch(() => {});\n }, [core, createTrustAnchor]);\n\n const contextValue = useMemo(\n () => ({\n core: core ?? defaultContextValue.core,\n organisationId,\n initialize,\n }),\n [core, initialize, organisationId],\n );\n\n if (!core) {\n return null;\n }\n\n return <ONECoreContext.Provider value={contextValue}>{children}</ONECoreContext.Provider>;\n};\n\nexport const useONECore = () => useContext(ONECoreContext);\n"],"mappings":"AAAA,SAASA,cAAc,QAAiB,iCAAiC;AACzE,OAAOC,KAAK,IACVC,aAAa,EAGbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AAEd,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,oBAAoB,QAAQ,gBAAgB;AAQrD,MAAMC,mBAAiC,GAAG;EACxCC,IAAI,EAAE,CAAC,CAAY;EACnBC,cAAc,EAAE,sCAAsC;EACtDC,UAAU,EAAEA,CAAA,KAAMC,OAAO,CAACC,MAAM;AAClC,CAAC;AAQD,MAAMC,cAAc,gBAAGd,aAAa,CAAeQ,mBAAmB,CAAC;AAEvE,OAAO,MAAMO,sBAA0E,GAAGC,IAAA,IAKpF;EAAA,IALqF;IACzFC,QAAQ;IACRP,cAAc,GAAG,sCAAsC;IACvDQ,kBAAkB;IAClBC;EACF,CAAC,GAAAH,IAAA;EACC,MAAM,CAACP,IAAI,EAAEW,OAAO,CAAC,GAAGf,QAAQ,EAAW;EAC3C,MAAMgB,iBAAiB,GAAGd,oBAAoB,CAACW,kBAAkB,CAAC;EAElE,MAAMP,UAAU,GAAGV,WAAW,CAC5B,MAAOqB,KAAe,IAAK;IACzB,IAAIb,IAAI,IAAI,CAACa,KAAK,EAAE;MAClB,OAAOb,IAAI;IACb;IAEA,IAAI;MACF,MAAMc,YAAY,GAAG,MAAMzB,cAAc,CAACqB,MAAM,CAAC;MACjDC,OAAO,CAACG,YAAY,CAAC;MACrB,OAAOA,YAAY;IACrB,CAAC,CAAC,OAAOC,CAAC,EAAE;MACVlB,eAAe,CAACkB,CAAC,EAAE,2BAA2B,CAAC;MAC/C,MAAMA,CAAC;IACT;EACF,CAAC,EACD,CAACf,IAAI,EAAEU,MAAM,CAAC,CACf;EAEDhB,SAAS,CACP,MAAM;IACJ,MAAMsB,WAAW,GAAGd,UAAU,EAAE;IAChC,OAAO,MAAM;MACXc,WAAW,CACRC,IAAI,CAAEC,CAAC,IAAKA,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,YAAY,CAAC,KAAK,CAAC,CAAC,CACnCC,KAAK,CAAEL,CAAC,IAAK;QACZlB,eAAe,CAACkB,CAAC,EAAE,6BAA6B,CAAC;MACnD,CAAC,CAAC;IACN,CAAC;EACH,CAAC;EACD;EACA,EAAE,CACH;EAEDrB,SAAS,CAAC,MAAM;IACd,IAAI,CAACM,IAAI,EAAE;MACT;IACF;IACAY,iBAAiB,CAACZ,IAAI,CAAC,CAACoB,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EACzC,CAAC,EAAE,CAACpB,IAAI,EAAEY,iBAAiB,CAAC,CAAC;EAE7B,MAAMS,YAAY,GAAG1B,OAAO,CAC1B,OAAO;IACLK,IAAI,EAAEA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAID,mBAAmB,CAACC,IAAI;IACtCC,cAAc;IACdC;EACF,CAAC,CAAC,EACF,CAACF,IAAI,EAAEE,UAAU,EAAED,cAAc,CAAC,CACnC;EAED,IAAI,CAACD,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBAAOV,KAAA,CAAAgC,aAAA,CAACjB,cAAc,CAACkB,QAAQ;IAACC,KAAK,EAAEH;EAAa,GAAEb,QAAQ,CAA2B;AAC3F,CAAC;AAED,OAAO,MAAMiB,UAAU,GAAGA,CAAA,KAAMhC,UAAU,CAACY,cAAc,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { OneError } from '@procivis/react-native-one-core';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { reportException } from '../../reporting';
|
|
4
|
+
import { useONECore } from './core-context';
|
|
5
|
+
import { OneErrorCode } from './error-code';
|
|
6
|
+
export const SW_DID_NAME_PREFIX = 'holder-did-sw-key';
|
|
7
|
+
export const HW_DID_NAME_PREFIX = 'holder-did-hw-key';
|
|
8
|
+
const generateHwDid = async (core, organisationId) => {
|
|
9
|
+
const hwKeyId = await core.generateKey({
|
|
10
|
+
keyParams: {},
|
|
11
|
+
keyType: 'ES256',
|
|
12
|
+
name: 'holder-key-hw',
|
|
13
|
+
organisationId,
|
|
14
|
+
storageParams: {},
|
|
15
|
+
storageType: 'SECURE_ELEMENT'
|
|
16
|
+
}).catch(e => {
|
|
17
|
+
// ignore if HW keys not supported by device
|
|
18
|
+
if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
throw e;
|
|
22
|
+
});
|
|
23
|
+
if (hwKeyId) {
|
|
24
|
+
return core.createDid({
|
|
25
|
+
didMethod: 'KEY',
|
|
26
|
+
keys: {
|
|
27
|
+
assertionMethod: [hwKeyId],
|
|
28
|
+
authentication: [hwKeyId],
|
|
29
|
+
capabilityDelegation: [hwKeyId],
|
|
30
|
+
capabilityInvocation: [hwKeyId],
|
|
31
|
+
keyAgreement: [hwKeyId]
|
|
32
|
+
},
|
|
33
|
+
name: HW_DID_NAME_PREFIX,
|
|
34
|
+
organisationId,
|
|
35
|
+
params: {}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
};
|
|
40
|
+
const generateSwDid = async (core, organisationId) => {
|
|
41
|
+
const swKeyId = await core.generateKey({
|
|
42
|
+
keyParams: {},
|
|
43
|
+
keyType: 'EDDSA',
|
|
44
|
+
name: 'holder-key-sw',
|
|
45
|
+
organisationId,
|
|
46
|
+
storageParams: {},
|
|
47
|
+
storageType: 'INTERNAL'
|
|
48
|
+
});
|
|
49
|
+
return core.createDid({
|
|
50
|
+
didMethod: 'KEY',
|
|
51
|
+
keys: {
|
|
52
|
+
assertionMethod: [swKeyId],
|
|
53
|
+
authentication: [swKeyId],
|
|
54
|
+
capabilityDelegation: [swKeyId],
|
|
55
|
+
capabilityInvocation: [swKeyId],
|
|
56
|
+
keyAgreement: [swKeyId]
|
|
57
|
+
},
|
|
58
|
+
name: SW_DID_NAME_PREFIX,
|
|
59
|
+
organisationId,
|
|
60
|
+
params: {}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// create base local identifiers in the wallet
|
|
65
|
+
export const useInitializeONECoreIdentifiers = () => {
|
|
66
|
+
const {
|
|
67
|
+
core,
|
|
68
|
+
organisationId
|
|
69
|
+
} = useONECore();
|
|
70
|
+
return useCallback(async () => {
|
|
71
|
+
return await core.createOrganisation(organisationId).catch(e => {
|
|
72
|
+
if (e instanceof OneError && e.code === OneErrorCode.OrganisationAlreadyExists) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
throw e;
|
|
76
|
+
}).then(() => Promise.all([generateHwDid(core, organisationId), generateSwDid(core, organisationId)])).catch(err => {
|
|
77
|
+
reportException(err, 'Failed to create base identifiers');
|
|
78
|
+
throw err;
|
|
79
|
+
});
|
|
80
|
+
}, [core, organisationId]);
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=core-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OneError","useCallback","reportException","useONECore","OneErrorCode","SW_DID_NAME_PREFIX","HW_DID_NAME_PREFIX","generateHwDid","core","organisationId","hwKeyId","generateKey","keyParams","keyType","name","storageParams","storageType","catch","e","code","KeyStorageNotSupported","createDid","didMethod","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","generateSwDid","swKeyId","useInitializeONECoreIdentifiers","createOrganisation","OrganisationAlreadyExists","then","Promise","all","err"],"sources":["core-init.ts"],"sourcesContent":["import { ONECore, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\n\nexport const SW_DID_NAME_PREFIX = 'holder-did-sw-key';\nexport const HW_DID_NAME_PREFIX = 'holder-did-hw-key';\n\nconst generateHwDid = async (core: ONECore, organisationId: string) => {\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ES256',\n name: 'holder-key-hw',\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n\n if (hwKeyId) {\n return core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n name: HW_DID_NAME_PREFIX,\n organisationId,\n params: {},\n });\n }\n\n return null;\n};\n\nconst generateSwDid = async (core: ONECore, organisationId: string) => {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'EDDSA',\n name: 'holder-key-sw',\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n\n return core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n name: SW_DID_NAME_PREFIX,\n organisationId,\n params: {},\n });\n};\n\n// create base local identifiers in the wallet\nexport const useInitializeONECoreIdentifiers = () => {\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n return await core\n .createOrganisation(organisationId)\n .catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OrganisationAlreadyExists) {\n return;\n }\n throw e;\n })\n .then(() => Promise.all([generateHwDid(core, organisationId), generateSwDid(core, organisationId)]))\n .catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [core, organisationId]);\n};\n"],"mappings":"AAAA,SAAkBA,QAAQ,QAAQ,iCAAiC;AAC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