@procivis/one-react-native-components 0.2.54 → 0.3.22
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 +3 -8
- package/lib/commonjs/components/backup/index.js.map +1 -1
- package/lib/commonjs/components/backup/preview-credentials.js +18 -22
- package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
- package/lib/commonjs/components/credential/credential.js +11 -12
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/credential/index.js.map +1 -1
- package/lib/commonjs/components/entity/EntityButtons.js +20 -25
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js +15 -17
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +18 -19
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +12 -14
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/entity/index.js +2 -2
- package/lib/commonjs/components/entity/index.js.map +1 -1
- package/lib/commonjs/components/history/history-details-screen.js +67 -0
- package/lib/commonjs/components/history/history-details-screen.js.map +1 -0
- package/lib/commonjs/components/history/history-list-item-icon.js +94 -0
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -0
- package/lib/commonjs/components/history/history-list-item.js +45 -0
- package/lib/commonjs/components/history/history-list-item.js.map +1 -0
- package/lib/commonjs/components/history/history-list-screen.js +121 -0
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -0
- package/lib/commonjs/components/history/history-list-section-header.js +39 -0
- package/lib/commonjs/components/history/history-list-section-header.js.map +1 -0
- package/lib/commonjs/components/history/history-list.js +100 -0
- package/lib/commonjs/components/history/history-list.js.map +1 -0
- package/lib/commonjs/components/history/index.js +72 -0
- package/lib/commonjs/components/history/index.js.map +1 -0
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/navigation/header-buttons.js +21 -25
- package/lib/commonjs/components/navigation/header-buttons.js.map +1 -1
- package/lib/commonjs/components/navigation/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/group.js +4 -5
- package/lib/commonjs/components/proof-request/group.js.map +1 -1
- package/lib/commonjs/components/proof-request/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/select-credential.js +11 -12
- package/lib/commonjs/components/proof-request/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +23 -27
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/normalize-color.d.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibility.js +11 -7
- package/lib/commonjs/ui-components/accessibility/accessibility.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js +8 -12
- package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js +15 -17
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js +8 -10
- package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/index.js +1 -30
- package/lib/commonjs/ui-components/accessibility/index.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -3
- package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale.test.js.map +1 -1
- package/lib/commonjs/ui-components/action-modal/ActionModal.js +9 -11
- package/lib/commonjs/ui-components/action-modal/ActionModal.js.map +1 -1
- package/lib/commonjs/ui-components/action-modal/index.js +1 -1
- package/lib/commonjs/ui-components/action-modal/index.js.map +1 -1
- package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js +10 -12
- package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js.map +1 -1
- package/lib/commonjs/ui-components/activity-indicator/index.js +1 -1
- package/lib/commonjs/ui-components/activity-indicator/index.js.map +1 -1
- package/lib/commonjs/ui-components/blur/blur-view.js +13 -15
- package/lib/commonjs/ui-components/blur/blur-view.js.map +1 -1
- package/lib/commonjs/ui-components/blur/index.js +2 -2
- package/lib/commonjs/ui-components/blur/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/back-button.js +12 -15
- package/lib/commonjs/ui-components/buttons/back-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/button.js +19 -22
- package/lib/commonjs/ui-components/buttons/button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/connectivity-button.js +16 -18
- package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/filter-button.js +8 -10
- package/lib/commonjs/ui-components/buttons/filter-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/ghost-button.js +12 -14
- package/lib/commonjs/ui-components/buttons/ghost-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +244 -0
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/index.js +9 -37
- package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/scan-button.js +7 -9
- package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/camera-overlay.js +11 -14
- package/lib/commonjs/ui-components/camera/camera-overlay.js.map +1 -1
- package/lib/commonjs/ui-components/camera/index.js +2 -2
- package/lib/commonjs/ui-components/camera/index.js.map +1 -1
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js +12 -14
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/commonjs/ui-components/control/checkbox.js +11 -12
- package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
- package/lib/commonjs/ui-components/control/index.js.map +1 -1
- package/lib/commonjs/ui-components/control/switch.js +10 -12
- package/lib/commonjs/ui-components/control/switch.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-card.js +22 -26
- package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +30 -35
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +27 -20
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-header.js +25 -24
- package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +27 -29
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/index.js +6 -41
- package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +51 -60
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +18 -21
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/credential/index.js +2 -25
- package/lib/commonjs/ui-components/credential/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/selector-status.js +3 -4
- package/lib/commonjs/ui-components/credential/selector-status.js.map +1 -1
- package/lib/commonjs/ui-components/credential/selector.js +8 -10
- package/lib/commonjs/ui-components/credential/selector.js.map +1 -1
- package/lib/commonjs/ui-components/detail/detail.js +12 -14
- package/lib/commonjs/ui-components/detail/detail.js.map +1 -1
- package/lib/commonjs/ui-components/detail/index.js +1 -1
- package/lib/commonjs/ui-components/detail/index.js.map +1 -1
- package/lib/commonjs/ui-components/entity/avatar.js +14 -16
- package/lib/commonjs/ui-components/entity/avatar.js.map +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js +15 -18
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/entity/index.js +2 -2
- package/lib/commonjs/ui-components/entity/index.js.map +1 -1
- package/lib/commonjs/ui-components/header/focus-aware-status-bar.js +3 -4
- package/lib/commonjs/ui-components/header/focus-aware-status-bar.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js +14 -17
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/header/header.js +12 -14
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/header/index.js +4 -24
- package/lib/commonjs/ui-components/header/index.js.map +1 -1
- package/lib/commonjs/ui-components/header/navigation-header.js +27 -33
- package/lib/commonjs/ui-components/header/navigation-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/data-item.js +30 -23
- package/lib/commonjs/ui-components/history/data-item.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +181 -0
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -0
- package/lib/commonjs/ui-components/history/{history-list-item.js → history-item.js} +47 -26
- package/lib/commonjs/ui-components/history/history-item.js.map +1 -0
- package/lib/commonjs/ui-components/history/history-section-header.js +7 -9
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js +13 -12
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +30 -9
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/connectivity.js +19 -24
- package/lib/commonjs/ui-components/icons/connectivity.js.map +1 -1
- package/lib/commonjs/ui-components/icons/credential.js +60 -71
- package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js +7 -8
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/icons/history.js +113 -133
- package/lib/commonjs/ui-components/icons/history.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +73 -90
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/icons/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/input.js +3 -3
- package/lib/commonjs/ui-components/icons/input.js.map +1 -1
- package/lib/commonjs/ui-components/icons/keypad.js +69 -81
- package/lib/commonjs/ui-components/icons/keypad.js.map +1 -1
- package/lib/commonjs/ui-components/icons/loader.js +4 -4
- package/lib/commonjs/ui-components/icons/loader.js.map +1 -1
- package/lib/commonjs/ui-components/icons/nerd-view.js +6 -9
- package/lib/commonjs/ui-components/icons/nerd-view.js.map +1 -1
- package/lib/commonjs/ui-components/icons/selector.js +8 -9
- package/lib/commonjs/ui-components/icons/selector.js.map +1 -1
- package/lib/commonjs/ui-components/icons/wallet.js +16 -19
- package/lib/commonjs/ui-components/icons/wallet.js.map +1 -1
- package/lib/commonjs/ui-components/image/image-or-component.js +15 -18
- package/lib/commonjs/ui-components/image/image-or-component.js.map +1 -1
- package/lib/commonjs/ui-components/image/index.js +2 -9
- package/lib/commonjs/ui-components/image/index.js.map +1 -1
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/input/index.js +2 -2
- package/lib/commonjs/ui-components/input/index.js.map +1 -1
- package/lib/commonjs/ui-components/input/radio-group.js +28 -25
- package/lib/commonjs/ui-components/input/radio-group.js.map +1 -1
- package/lib/commonjs/ui-components/input/selection-input.js +27 -38
- package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
- package/lib/commonjs/ui-components/input/text-input.js +25 -28
- package/lib/commonjs/ui-components/input/text-input.js.map +1 -1
- package/lib/commonjs/ui-components/list/index.js +20 -2
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/list/list-page-loading-indicator.js +14 -0
- package/lib/commonjs/ui-components/list/list-page-loading-indicator.js.map +1 -0
- package/lib/commonjs/ui-components/list/list-section-header.js +10 -12
- package/lib/commonjs/ui-components/list/list-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/list/list-title-header.js +6 -8
- package/lib/commonjs/ui-components/list/list-title-header.js.map +1 -1
- package/lib/commonjs/ui-components/list/wallet/empty-list.js +73 -0
- package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -0
- package/lib/commonjs/ui-components/list/wallet/empty-search-result.js +41 -0
- package/lib/commonjs/ui-components/list/wallet/empty-search-result.js.map +1 -0
- package/lib/commonjs/ui-components/list/wallet/index.js +21 -0
- package/lib/commonjs/ui-components/list/wallet/index.js.map +1 -0
- package/lib/commonjs/ui-components/loader/index.js +2 -2
- package/lib/commonjs/ui-components/loader/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loader.js +17 -17
- package/lib/commonjs/ui-components/loader/loader.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +22 -21
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/nerd-view/index.js +2 -8
- package/lib/commonjs/ui-components/nerd-view/index.js.map +1 -1
- package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js +37 -41
- package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
- package/lib/commonjs/ui-components/pin/index.js +2 -2
- package/lib/commonjs/ui-components/pin/index.js.map +1 -1
- package/lib/commonjs/ui-components/pin/keypad.js +19 -23
- package/lib/commonjs/ui-components/pin/keypad.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-code-screen.js +19 -21
- package/lib/commonjs/ui-components/pin/pin-code-screen.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js +1 -2
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-lock.js +10 -12
- package/lib/commonjs/ui-components/pin/pin-lock.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pins.js +8 -9
- package/lib/commonjs/ui-components/pin/pins.js.map +1 -1
- package/lib/commonjs/ui-components/screens/backup-screen.js +15 -18
- package/lib/commonjs/ui-components/screens/backup-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/image-preview-screen.js +12 -14
- package/lib/commonjs/ui-components/screens/image-preview-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/index.js +8 -49
- package/lib/commonjs/ui-components/screens/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +34 -41
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js +14 -16
- package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/scroll-view-screen.js +12 -14
- package/lib/commonjs/ui-components/screens/scroll-view-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/section-list-screen.js +13 -15
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js +10 -12
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/index.js +2 -2
- package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/search-bar.js +15 -17
- package/lib/commonjs/ui-components/searchbar/search-bar.js.map +1 -1
- package/lib/commonjs/ui-components/settings/button-setting.js +14 -16
- package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
- package/lib/commonjs/ui-components/settings/index.js +2 -2
- package/lib/commonjs/ui-components/settings/index.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item-separator.js +6 -8
- package/lib/commonjs/ui-components/settings/setting-item-separator.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item.js +11 -13
- package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
- package/lib/commonjs/ui-components/settings/settings-button.js +7 -9
- package/lib/commonjs/ui-components/settings/settings-button.js.map +1 -1
- package/lib/commonjs/ui-components/settings/switch-setting.js +11 -13
- package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/commonjs/ui-components/state/error-screen.js +10 -12
- package/lib/commonjs/ui-components/state/error-screen.js.map +1 -1
- package/lib/commonjs/ui-components/state/index.js +2 -2
- package/lib/commonjs/ui-components/state/index.js.map +1 -1
- package/lib/commonjs/ui-components/text/base.js +14 -16
- package/lib/commonjs/ui-components/text/base.js.map +1 -1
- package/lib/commonjs/ui-components/text/font.js +11 -13
- package/lib/commonjs/ui-components/text/font.js.map +1 -1
- package/lib/commonjs/ui-components/text/index.js +2 -9
- package/lib/commonjs/ui-components/text/index.js.map +1 -1
- package/lib/commonjs/ui-components/text/typography.js +10 -13
- package/lib/commonjs/ui-components/text/typography.js.map +1 -1
- package/lib/commonjs/ui-components/theme/color-scheme-context.js +2 -1
- package/lib/commonjs/ui-components/theme/color-scheme-context.js.map +1 -1
- package/lib/commonjs/ui-components/theme/color-scheme.js.map +1 -1
- package/lib/commonjs/ui-components/theme/index.js.map +1 -1
- package/lib/commonjs/utils/array.js.map +1 -1
- package/lib/commonjs/utils/backup.js.map +1 -1
- package/lib/commonjs/utils/color.js +1 -1
- package/lib/commonjs/utils/color.js.map +1 -1
- package/lib/commonjs/utils/contrasting-status-bar.js +8 -10
- package/lib/commonjs/utils/contrasting-status-bar.js.map +1 -1
- package/lib/commonjs/utils/date.js +3 -3
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/filtering.js +11 -0
- package/lib/commonjs/utils/filtering.js.map +1 -0
- package/lib/commonjs/utils/history.js +76 -0
- package/lib/commonjs/utils/history.js.map +1 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.js +37 -23
- package/lib/commonjs/utils/hooks/connectivity/connectivity.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +6 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +31 -31
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +44 -0
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/core-config.js +15 -1
- package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +15 -10
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +18 -12
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +16 -27
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +27 -37
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +4 -6
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/error-code.js +3 -4
- package/lib/commonjs/utils/hooks/core/error-code.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/history.js +5 -37
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +11 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js +23 -38
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +107 -76
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/query.js +1 -2
- package/lib/commonjs/utils/hooks/core/query.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +8 -4
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
- package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js +1 -2
- package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js.map +1 -1
- package/lib/commonjs/utils/hooks/http/client.js.map +1 -1
- package/lib/commonjs/utils/hooks/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/list/list-content-inset.js +9 -10
- package/lib/commonjs/utils/hooks/list/list-content-inset.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/before-remove.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/close-button-timeout.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/deep-link.js +3 -4
- package/lib/commonjs/utils/hooks/navigation/deep-link.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/open-settings.js +1 -2
- package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/commonjs/utils/hooks/pin-security/pin-security.js +1 -2
- package/lib/commonjs/utils/hooks/pin-security/pin-security.js.map +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +17 -26
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/index.js +37 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/navigation.js +5 -5
- package/lib/commonjs/utils/navigation.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +16 -20
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +16 -26
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/index.js +11 -0
- package/lib/commonjs/utils/parsers/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +3 -2
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/parsers/universal-links.js +33 -0
- package/lib/commonjs/utils/parsers/universal-links.js.map +1 -0
- package/lib/commonjs/utils/parsers/universal-links.test.js +40 -0
- package/lib/commonjs/utils/parsers/universal-links.test.js.map +1 -0
- package/lib/commonjs/utils/ref.js.map +1 -1
- package/lib/commonjs/utils/reporting.js +4 -2
- package/lib/commonjs/utils/reporting.js.map +1 -1
- package/lib/commonjs/utils/string.js.map +1 -1
- package/lib/commonjs/utils/testID.js +1 -4
- package/lib/commonjs/utils/testID.js.map +1 -1
- package/lib/commonjs/utils/testID.test.js.map +1 -1
- package/lib/commonjs/utils/useMemoAsync.js +9 -0
- package/lib/commonjs/utils/useMemoAsync.js.map +1 -1
- package/lib/commonjs/utils/uuid.js +1 -1
- package/lib/commonjs/utils/uuid.js.map +1 -1
- package/lib/module/components/backup/index.js.map +1 -1
- package/lib/module/components/backup/preview-credentials.js +17 -21
- package/lib/module/components/backup/preview-credentials.js.map +1 -1
- package/lib/module/components/credential/credential.js +10 -11
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/credential/index.js.map +1 -1
- package/lib/module/components/entity/EntityButtons.js +17 -21
- package/lib/module/components/entity/EntityButtons.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +12 -13
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +15 -15
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +8 -9
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/entity/index.js.map +1 -1
- package/lib/module/components/history/history-details-screen.js +59 -0
- package/lib/module/components/history/history-details-screen.js.map +1 -0
- package/lib/module/components/history/history-list-item-icon.js +84 -0
- package/lib/module/components/history/history-list-item-icon.js.map +1 -0
- package/lib/module/components/history/history-list-item.js +36 -0
- package/lib/module/components/history/history-list-item.js.map +1 -0
- package/lib/module/components/history/history-list-screen.js +112 -0
- package/lib/module/components/history/history-list-screen.js.map +1 -0
- package/lib/module/components/history/history-list-section-header.js +29 -0
- package/lib/module/components/history/history-list-section-header.js.map +1 -0
- package/lib/module/components/history/history-list.js +90 -0
- package/lib/module/components/history/history-list.js.map +1 -0
- package/lib/module/components/history/index.js +7 -0
- package/lib/module/components/history/index.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/navigation/header-buttons.js +19 -23
- package/lib/module/components/navigation/header-buttons.js.map +1 -1
- package/lib/module/components/navigation/index.js.map +1 -1
- package/lib/module/components/proof-request/group.js +3 -4
- package/lib/module/components/proof-request/group.js.map +1 -1
- package/lib/module/components/proof-request/index.js.map +1 -1
- package/lib/module/components/proof-request/select-credential.js +10 -11
- package/lib/module/components/proof-request/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +21 -25
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/normalize-color.d.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibility.js +5 -7
- package/lib/module/ui-components/accessibility/accessibility.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistory.js +4 -8
- package/lib/module/ui-components/accessibility/accessibilityHistory.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js +10 -8
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityLanguage.js +6 -8
- package/lib/module/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
- package/lib/module/ui-components/accessibility/index.js +4 -4
- package/lib/module/ui-components/accessibility/index.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale.test.js.map +1 -1
- package/lib/module/ui-components/action-modal/ActionModal.js +7 -8
- package/lib/module/ui-components/action-modal/ActionModal.js.map +1 -1
- package/lib/module/ui-components/action-modal/index.js.map +1 -1
- package/lib/module/ui-components/activity-indicator/activity-indicator.js +6 -7
- package/lib/module/ui-components/activity-indicator/activity-indicator.js.map +1 -1
- package/lib/module/ui-components/activity-indicator/index.js.map +1 -1
- package/lib/module/ui-components/blur/blur-view.js +10 -11
- package/lib/module/ui-components/blur/blur-view.js.map +1 -1
- package/lib/module/ui-components/blur/index.js.map +1 -1
- package/lib/module/ui-components/buttons/back-button.js +10 -11
- package/lib/module/ui-components/buttons/back-button.js.map +1 -1
- package/lib/module/ui-components/buttons/button.js +17 -18
- package/lib/module/ui-components/buttons/button.js.map +1 -1
- package/lib/module/ui-components/buttons/connectivity-button.js +14 -14
- package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -1
- package/lib/module/ui-components/buttons/filter-button.js +6 -7
- package/lib/module/ui-components/buttons/filter-button.js.map +1 -1
- package/lib/module/ui-components/buttons/ghost-button.js +9 -10
- package/lib/module/ui-components/buttons/ghost-button.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +236 -0
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -0
- package/lib/module/ui-components/buttons/index.js +8 -7
- package/lib/module/ui-components/buttons/index.js.map +1 -1
- package/lib/module/ui-components/buttons/scan-button.js +5 -6
- package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/module/ui-components/camera/camera-overlay.js +7 -9
- package/lib/module/ui-components/camera/camera-overlay.js.map +1 -1
- package/lib/module/ui-components/camera/index.js.map +1 -1
- package/lib/module/ui-components/camera/qr-code-scanner.js +8 -9
- package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/module/ui-components/control/checkbox.js +9 -10
- package/lib/module/ui-components/control/checkbox.js.map +1 -1
- package/lib/module/ui-components/control/index.js.map +1 -1
- package/lib/module/ui-components/control/switch.js +8 -9
- package/lib/module/ui-components/control/switch.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-card.js +16 -17
- package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +26 -30
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +23 -15
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-header.js +21 -19
- package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-image-carousel.js +23 -23
- package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -1
- package/lib/module/ui-components/credential/card/index.js +10 -10
- package/lib/module/ui-components/credential/card/index.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +47 -55
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +15 -18
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/credential/index.js +2 -2
- package/lib/module/ui-components/credential/index.js.map +1 -1
- package/lib/module/ui-components/credential/selector-status.js +3 -3
- package/lib/module/ui-components/credential/selector-status.js.map +1 -1
- package/lib/module/ui-components/credential/selector.js +5 -6
- package/lib/module/ui-components/credential/selector.js.map +1 -1
- package/lib/module/ui-components/detail/detail.js +9 -10
- package/lib/module/ui-components/detail/detail.js.map +1 -1
- package/lib/module/ui-components/detail/index.js.map +1 -1
- package/lib/module/ui-components/entity/avatar.js +10 -11
- package/lib/module/ui-components/entity/avatar.js.map +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js +11 -13
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/entity/index.js.map +1 -1
- package/lib/module/ui-components/header/focus-aware-status-bar.js +1 -1
- package/lib/module/ui-components/header/focus-aware-status-bar.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js +10 -12
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/header/header.js +10 -11
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/header/index.js +6 -6
- package/lib/module/ui-components/header/index.js.map +1 -1
- package/lib/module/ui-components/header/navigation-header.js +23 -28
- package/lib/module/ui-components/header/navigation-header.js.map +1 -1
- package/lib/module/ui-components/history/data-item.js +23 -15
- package/lib/module/ui-components/history/data-item.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +171 -0
- package/lib/module/ui-components/history/history-details.js.map +1 -0
- package/lib/module/ui-components/history/{history-list-item.js → history-item.js} +44 -22
- package/lib/module/ui-components/history/history-item.js.map +1 -0
- package/lib/module/ui-components/history/history-section-header.js +6 -7
- package/lib/module/ui-components/history/history-section-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js +8 -9
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/history/index.js +5 -4
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/connectivity.js +16 -21
- package/lib/module/ui-components/icons/connectivity.js.map +1 -1
- package/lib/module/ui-components/icons/credential.js +57 -68
- package/lib/module/ui-components/icons/credential.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js +4 -5
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/icons/history.js +101 -128
- package/lib/module/ui-components/icons/history.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +70 -87
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/icons/index.js.map +1 -1
- package/lib/module/ui-components/icons/input.js.map +1 -1
- package/lib/module/ui-components/icons/keypad.js +66 -78
- package/lib/module/ui-components/icons/keypad.js.map +1 -1
- package/lib/module/ui-components/icons/loader.js +1 -1
- package/lib/module/ui-components/icons/loader.js.map +1 -1
- package/lib/module/ui-components/icons/nerd-view.js.map +1 -1
- package/lib/module/ui-components/icons/selector.js +5 -6
- package/lib/module/ui-components/icons/selector.js.map +1 -1
- package/lib/module/ui-components/icons/wallet.js +13 -16
- package/lib/module/ui-components/icons/wallet.js.map +1 -1
- package/lib/module/ui-components/image/image-or-component.js +12 -14
- package/lib/module/ui-components/image/image-or-component.js.map +1 -1
- package/lib/module/ui-components/image/index.js +2 -2
- package/lib/module/ui-components/image/index.js.map +1 -1
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/input/index.js.map +1 -1
- package/lib/module/ui-components/input/radio-group.js +26 -22
- package/lib/module/ui-components/input/radio-group.js.map +1 -1
- package/lib/module/ui-components/input/selection-input.js +21 -31
- package/lib/module/ui-components/input/selection-input.js.map +1 -1
- package/lib/module/ui-components/input/text-input.js +21 -22
- package/lib/module/ui-components/input/text-input.js.map +1 -1
- package/lib/module/ui-components/list/index.js +1 -0
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/list/list-page-loading-indicator.js +7 -0
- package/lib/module/ui-components/list/list-page-loading-indicator.js.map +1 -0
- package/lib/module/ui-components/list/list-section-header.js +8 -9
- package/lib/module/ui-components/list/list-section-header.js.map +1 -1
- package/lib/module/ui-components/list/list-title-header.js +4 -5
- package/lib/module/ui-components/list/list-title-header.js.map +1 -1
- package/lib/module/ui-components/list/wallet/empty-list.js +66 -0
- package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -0
- package/lib/module/ui-components/list/wallet/empty-search-result.js +34 -0
- package/lib/module/ui-components/list/wallet/empty-search-result.js.map +1 -0
- package/lib/module/ui-components/list/wallet/index.js +4 -0
- package/lib/module/ui-components/list/wallet/index.js.map +1 -0
- package/lib/module/ui-components/loader/index.js.map +1 -1
- package/lib/module/ui-components/loader/loader.js +14 -12
- package/lib/module/ui-components/loader/loader.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +21 -19
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/nerd-view/index.js +2 -2
- package/lib/module/ui-components/nerd-view/index.js.map +1 -1
- package/lib/module/ui-components/nerd-view/nerd-mode-item.js +31 -34
- package/lib/module/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
- package/lib/module/ui-components/pin/index.js.map +1 -1
- package/lib/module/ui-components/pin/keypad.js +17 -19
- package/lib/module/ui-components/pin/keypad.js.map +1 -1
- package/lib/module/ui-components/pin/pin-code-screen.js +16 -17
- package/lib/module/ui-components/pin/pin-code-screen.js.map +1 -1
- package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/module/ui-components/pin/pin-lock.js +6 -7
- package/lib/module/ui-components/pin/pin-lock.js.map +1 -1
- package/lib/module/ui-components/pin/pins.js +7 -8
- package/lib/module/ui-components/pin/pins.js.map +1 -1
- package/lib/module/ui-components/screens/backup-screen.js +13 -14
- package/lib/module/ui-components/screens/backup-screen.js.map +1 -1
- package/lib/module/ui-components/screens/image-preview-screen.js +9 -10
- package/lib/module/ui-components/screens/image-preview-screen.js.map +1 -1
- package/lib/module/ui-components/screens/index.js +12 -12
- package/lib/module/ui-components/screens/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js +29 -34
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/qr-code-scanner-screen.js +10 -11
- package/lib/module/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
- package/lib/module/ui-components/screens/scroll-view-screen.js +10 -11
- package/lib/module/ui-components/screens/scroll-view-screen.js.map +1 -1
- package/lib/module/ui-components/screens/section-list-screen.js +11 -12
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/animated-search-bar.js +6 -7
- package/lib/module/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/module/ui-components/searchbar/index.js.map +1 -1
- package/lib/module/ui-components/searchbar/search-bar.js +11 -12
- package/lib/module/ui-components/searchbar/search-bar.js.map +1 -1
- package/lib/module/ui-components/settings/button-setting.js +10 -11
- package/lib/module/ui-components/settings/button-setting.js.map +1 -1
- package/lib/module/ui-components/settings/index.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item-separator.js +4 -5
- package/lib/module/ui-components/settings/setting-item-separator.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item.js +7 -8
- package/lib/module/ui-components/settings/setting-item.js.map +1 -1
- package/lib/module/ui-components/settings/settings-button.js +5 -6
- package/lib/module/ui-components/settings/settings-button.js.map +1 -1
- package/lib/module/ui-components/settings/switch-setting.js +9 -10
- package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/module/ui-components/state/error-screen.js +7 -8
- package/lib/module/ui-components/state/error-screen.js.map +1 -1
- package/lib/module/ui-components/state/index.js.map +1 -1
- package/lib/module/ui-components/text/base.js +12 -13
- package/lib/module/ui-components/text/base.js.map +1 -1
- package/lib/module/ui-components/text/font.js +10 -11
- package/lib/module/ui-components/text/font.js.map +1 -1
- package/lib/module/ui-components/text/index.js +2 -2
- package/lib/module/ui-components/text/index.js.map +1 -1
- package/lib/module/ui-components/text/typography.js +8 -10
- package/lib/module/ui-components/text/typography.js.map +1 -1
- package/lib/module/ui-components/theme/color-scheme-context.js +1 -0
- package/lib/module/ui-components/theme/color-scheme-context.js.map +1 -1
- package/lib/module/ui-components/theme/color-scheme.js.map +1 -1
- package/lib/module/ui-components/theme/index.js.map +1 -1
- package/lib/module/utils/array.js.map +1 -1
- package/lib/module/utils/backup.js.map +1 -1
- package/lib/module/utils/color.js.map +1 -1
- package/lib/module/utils/contrasting-status-bar.js +5 -6
- package/lib/module/utils/contrasting-status-bar.js.map +1 -1
- package/lib/module/utils/date.js +4 -4
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/filtering.js +4 -0
- package/lib/module/utils/filtering.js.map +1 -0
- package/lib/module/utils/history.js +66 -0
- package/lib/module/utils/history.js.map +1 -0
- package/lib/module/utils/hooks/connectivity/connectivity.js +36 -19
- package/lib/module/utils/hooks/connectivity/connectivity.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +6 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +31 -31
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +37 -0
- package/lib/module/utils/hooks/core/cache.js.map +1 -0
- package/lib/module/utils/hooks/core/core-config.js +11 -0
- package/lib/module/utils/hooks/core/core-config.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +14 -9
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +16 -8
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js +12 -19
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +26 -36
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +3 -4
- package/lib/module/utils/hooks/core/dids.js.map +1 -1
- package/lib/module/utils/hooks/core/error-code.js +3 -3
- package/lib/module/utils/hooks/core/error-code.js.map +1 -1
- package/lib/module/utils/hooks/core/history.js +4 -35
- package/lib/module/utils/hooks/core/history.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +1 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js +19 -30
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +101 -67
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/query.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +7 -3
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
- package/lib/module/utils/hooks/header/on-scroll-header-state.js +1 -2
- package/lib/module/utils/hooks/header/on-scroll-header-state.js.map +1 -1
- package/lib/module/utils/hooks/http/client.js.map +1 -1
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/list/list-content-inset.js +9 -10
- package/lib/module/utils/hooks/list/list-content-inset.js.map +1 -1
- package/lib/module/utils/hooks/navigation/before-remove.js.map +1 -1
- package/lib/module/utils/hooks/navigation/close-button-timeout.js.map +1 -1
- package/lib/module/utils/hooks/navigation/deep-link.js +3 -4
- package/lib/module/utils/hooks/navigation/deep-link.js.map +1 -1
- package/lib/module/utils/hooks/navigation/index.js.map +1 -1
- package/lib/module/utils/hooks/navigation/open-settings.js +1 -2
- package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/module/utils/hooks/pin-security/pin-security.js +1 -2
- package/lib/module/utils/hooks/pin-security/pin-security.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +17 -26
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/index.js +3 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/navigation.js +5 -5
- package/lib/module/utils/navigation.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +15 -19
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +16 -25
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/index.js +1 -0
- package/lib/module/utils/parsers/index.js.map +1 -1
- package/lib/module/utils/parsers/query.js +3 -2
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/parsers/universal-links.js +25 -0
- package/lib/module/utils/parsers/universal-links.js.map +1 -0
- package/lib/module/utils/parsers/universal-links.test.js +38 -0
- package/lib/module/utils/parsers/universal-links.test.js.map +1 -0
- package/lib/module/utils/ref.js.map +1 -1
- package/lib/module/utils/reporting.js +1 -0
- package/lib/module/utils/reporting.js.map +1 -1
- package/lib/module/utils/string.js.map +1 -1
- package/lib/module/utils/testID.js +1 -4
- package/lib/module/utils/testID.js.map +1 -1
- package/lib/module/utils/testID.test.js.map +1 -1
- package/lib/module/utils/useMemoAsync.js +10 -0
- package/lib/module/utils/useMemoAsync.js.map +1 -1
- package/lib/module/utils/uuid.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/components/history/history-details-screen.d.ts +20 -0
- package/lib/typescript/components/history/history-list-item-icon.d.ts +8 -0
- package/lib/typescript/components/history/history-list-item.d.ts +20 -0
- package/lib/typescript/components/history/history-list-screen.d.ts +22 -0
- package/lib/typescript/components/history/history-list-section-header.d.ts +13 -0
- package/lib/typescript/components/history/history-list.d.ts +19 -0
- package/lib/typescript/components/history/index.d.ts +6 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/ui-components/accessibility/accessibility.d.ts +2 -2
- package/lib/typescript/ui-components/accessibility/accessibilityHistory.d.ts +1 -1
- package/lib/typescript/ui-components/accessibility/accessibilityHistoryWrappers.d.ts +3 -3
- package/lib/typescript/ui-components/accessibility/index.d.ts +5 -3
- package/lib/typescript/ui-components/buttons/button.d.ts +2 -2
- package/lib/typescript/ui-components/buttons/hold-button.d.ts +16 -0
- package/lib/typescript/ui-components/buttons/index.d.ts +15 -7
- package/lib/typescript/ui-components/buttons/scan-button.d.ts +2 -2
- package/lib/typescript/ui-components/credential/card/credential-header.d.ts +1 -1
- package/lib/typescript/ui-components/credential/card/index.d.ts +10 -5
- package/lib/typescript/ui-components/credential/index.d.ts +2 -1
- package/lib/typescript/ui-components/header/index.d.ts +6 -3
- package/lib/typescript/ui-components/history/data-item.d.ts +2 -2
- package/lib/typescript/ui-components/history/history-details.d.ts +51 -0
- package/lib/typescript/ui-components/history/{history-list-item.d.ts → history-item.d.ts} +4 -3
- package/lib/typescript/ui-components/history/history-section-header.d.ts +2 -2
- package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
- package/lib/typescript/ui-components/history/index.d.ts +5 -4
- package/lib/typescript/ui-components/icons/history.d.ts +20 -35
- package/lib/typescript/ui-components/image/index.d.ts +2 -1
- package/lib/typescript/ui-components/input/selection-input.d.ts +1 -1
- package/lib/typescript/ui-components/list/index.d.ts +1 -0
- package/lib/typescript/ui-components/list/list-page-loading-indicator.d.ts +4 -0
- package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +10 -0
- package/lib/typescript/ui-components/list/wallet/empty-search-result.d.ts +7 -0
- package/lib/typescript/ui-components/list/wallet/index.d.ts +3 -0
- package/lib/typescript/ui-components/nerd-view/index.d.ts +2 -1
- package/lib/typescript/ui-components/pin/keypad.d.ts +2 -2
- package/lib/typescript/ui-components/screens/index.d.ts +12 -6
- package/lib/typescript/ui-components/text/index.d.ts +2 -1
- package/lib/typescript/ui-components/text/typography.d.ts +14 -14
- package/lib/typescript/ui-components/theme/color-scheme.d.ts +1 -0
- package/lib/typescript/utils/filtering.d.ts +1 -0
- package/lib/typescript/utils/history.d.ts +10 -0
- package/lib/typescript/utils/hooks/connectivity/connectivity.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/backup.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/cache.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/core-config.d.ts +5 -1
- package/lib/typescript/utils/hooks/core/core-init.d.ts +10 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +7 -3
- package/lib/typescript/utils/hooks/core/history.d.ts +2 -5
- package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +14 -8
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +5 -0
- package/lib/typescript/utils/hooks/revocation/credential-status.d.ts +2 -1
- package/lib/typescript/utils/index.d.ts +3 -0
- package/lib/typescript/utils/parsers/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/universal-links.d.ts +1 -0
- package/lib/typescript/utils/parsers/universal-links.test.d.ts +1 -0
- package/lib/typescript/utils/ref.d.ts +1 -1
- package/package.json +60 -46
- package/src/components/entity/entity-attributes.tsx +4 -3
- package/src/components/entity/entity-details-with-buttons.tsx +4 -3
- package/src/components/history/history-details-screen.tsx +89 -0
- package/src/components/history/history-list-item-icon.tsx +108 -0
- package/src/components/history/history-list-item.tsx +53 -0
- package/src/components/history/history-list-screen.tsx +154 -0
- package/src/components/history/history-list-section-header.tsx +42 -0
- package/src/components/history/history-list.tsx +116 -0
- package/src/components/history/index.tsx +6 -0
- package/src/components/index.ts +1 -0
- package/src/ui-components/accessibility/accessibility.ts +2 -2
- package/src/ui-components/accessibility/accessibilityHistory.tsx +2 -2
- package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +3 -5
- package/src/ui-components/accessibility/index.ts +4 -3
- package/src/ui-components/action-modal/ActionModal.stories.tsx +7 -3
- package/src/ui-components/activity-indicator/activity-indicator.stories.tsx +3 -6
- package/src/ui-components/buttons/back-button.stories.tsx +7 -8
- package/src/ui-components/buttons/button.stories.tsx +9 -10
- package/src/ui-components/buttons/connectivity-button.stories.tsx +10 -11
- package/src/ui-components/buttons/connectivity-button.tsx +1 -1
- package/src/ui-components/buttons/ghost-button.stories.tsx +8 -8
- package/src/ui-components/buttons/hold-button.stories.tsx +29 -0
- package/src/ui-components/buttons/hold-button.tsx +276 -0
- package/src/ui-components/buttons/index.ts +16 -6
- package/src/ui-components/buttons/scan-button.stories.tsx +8 -4
- package/src/ui-components/control/checkbox.stories.tsx +8 -8
- package/src/ui-components/control/switch.stories.tsx +11 -8
- package/src/ui-components/credential/card/credential-card.stories.tsx +22 -25
- package/src/ui-components/credential/card/credential-details-card.stories.tsx +249 -245
- package/src/ui-components/credential/card/credential-details-card.tsx +2 -2
- package/src/ui-components/credential/card/credential-details-list-item.tsx +16 -6
- package/src/ui-components/credential/card/credential-header.stories.tsx +15 -17
- package/src/ui-components/credential/card/credential-header.tsx +4 -1
- package/src/ui-components/credential/card/credential-image-carousel.tsx +4 -0
- package/src/ui-components/credential/card/index.ts +11 -5
- package/src/ui-components/credential/index.ts +2 -1
- package/src/ui-components/credential/selector.stories.tsx +7 -7
- package/src/ui-components/detail/detail.stories.tsx +11 -8
- package/src/ui-components/entity/avatar.stories.tsx +10 -7
- package/src/ui-components/entity/entity-cluster.stories.tsx +11 -8
- package/src/ui-components/header/header.stories.tsx +10 -7
- package/src/ui-components/header/index.ts +6 -3
- package/src/ui-components/header/navigation-header.stories.tsx +11 -8
- package/src/ui-components/history/data-item.tsx +13 -4
- package/src/ui-components/history/history-details.tsx +247 -0
- package/src/ui-components/history/{history-list-item.tsx → history-item.tsx} +72 -33
- package/src/ui-components/history/history-section-header.tsx +2 -2
- package/src/ui-components/history/history-section-list-item.tsx +3 -3
- package/src/ui-components/history/index.ts +5 -4
- package/src/ui-components/icons/history.tsx +82 -131
- package/src/ui-components/image/index.tsx +2 -1
- package/src/ui-components/input/radio-group.stories.tsx +34 -0
- package/src/ui-components/input/radio-group.tsx +8 -2
- package/src/ui-components/input/selection-input.stories.tsx +20 -17
- package/src/ui-components/list/index.ts +1 -0
- package/src/ui-components/list/list-page-loading-indicator.tsx +8 -0
- package/src/ui-components/list/wallet/empty-list.tsx +75 -0
- package/src/ui-components/list/wallet/empty-search-result.tsx +39 -0
- package/src/ui-components/list/wallet/index.tsx +4 -0
- package/src/ui-components/loader/loader.stories.tsx +6 -9
- package/src/ui-components/loader/loader.tsx +6 -3
- package/src/ui-components/loader/loading-result.stories.tsx +13 -10
- package/src/ui-components/loader/loading-result.tsx +8 -4
- package/src/ui-components/nerd-view/index.ts +2 -1
- package/src/ui-components/nerd-view/nerd-mode-item.tsx +2 -2
- package/src/ui-components/pin/pin-code-screen.stories.tsx +20 -13
- package/src/ui-components/screens/image-preview-screen.stories.tsx +9 -6
- package/src/ui-components/screens/index.ts +12 -6
- package/src/ui-components/screens/nerd-mode-screen.tsx +1 -1
- package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +10 -7
- package/src/ui-components/searchbar/search-bar.stories.tsx +15 -8
- package/src/ui-components/searchbar/search-bar.tsx +2 -2
- package/src/ui-components/state/error-screen.stories.tsx +8 -9
- package/src/ui-components/state/error-screen.tsx +1 -1
- package/src/ui-components/text/index.ts +2 -1
- package/src/ui-components/text/typography.stories.tsx +19 -12
- package/src/ui-components/theme/color-scheme-context.tsx +1 -0
- package/src/ui-components/theme/color-scheme.ts +1 -0
- package/src/utils/date.ts +5 -5
- package/src/utils/filtering.ts +5 -0
- package/src/utils/history.ts +71 -0
- package/src/utils/hooks/connectivity/connectivity.test.ts +8 -0
- package/src/utils/hooks/connectivity/connectivity.ts +28 -4
- package/src/utils/hooks/core/backup.ts +25 -21
- package/src/utils/hooks/core/cache.ts +43 -0
- package/src/utils/hooks/core/core-config.ts +19 -0
- package/src/utils/hooks/core/core-context.tsx +15 -2
- package/src/utils/hooks/core/core-init.ts +21 -7
- package/src/utils/hooks/core/credential-schemas.ts +1 -1
- package/src/utils/hooks/core/credentials.ts +9 -14
- package/src/utils/hooks/core/history.ts +2 -57
- package/src/utils/hooks/core/index.ts +1 -0
- package/src/utils/hooks/core/proof-schemas.ts +1 -1
- package/src/utils/hooks/core/proofs.ts +107 -49
- package/src/utils/hooks/core/trust-entity.ts +7 -3
- package/src/utils/hooks/navigation/open-settings.ts +2 -3
- package/src/utils/hooks/revocation/credential-status.ts +3 -2
- package/src/utils/index.ts +3 -0
- package/src/utils/navigation.ts +4 -2
- package/src/utils/parsers/credential.ts +1 -1
- package/src/utils/parsers/index.ts +1 -0
- package/src/utils/parsers/query.tsx +2 -0
- package/src/utils/parsers/universal-links.test.ts +57 -0
- package/src/utils/parsers/universal-links.ts +26 -0
- package/src/utils/ref.ts +1 -1
- package/src/utils/reporting.ts +1 -0
- package/lib/commonjs/ui-components/history/history-list-item.js.map +0 -1
- package/lib/module/ui-components/history/history-list-item.js.map +0 -1
|
@@ -9,34 +9,26 @@ export const PROOF_SCHEMA_LIST_QUERY_KEY = 'proof-schema-list';
|
|
|
9
9
|
export const PROOF_SCHEMA_IMPORT_DETAIL_QUERY_KEY = 'proof-schema-import';
|
|
10
10
|
export const PROOF_SCHEMA_DETAIL_QUERY_KEY = 'proof-schema-detail';
|
|
11
11
|
export const PROOF_SCHEMA_SHARE_QUERY_KEY = 'proof-schema-share';
|
|
12
|
-
export const useProofSchemas =
|
|
13
|
-
let keepPreviousData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
12
|
+
export const useProofSchemas = (queryParams, keepPreviousData = true) => {
|
|
14
13
|
const {
|
|
15
14
|
core,
|
|
16
15
|
organisationId
|
|
17
16
|
} = useONECore();
|
|
18
|
-
return useInfiniteQuery([PROOF_SCHEMA_LIST_QUERY_KEY, ...getQueryKeyFromProofSchemaListQueryParams(queryParams)],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let {
|
|
29
|
-
values
|
|
30
|
-
} = _ref2;
|
|
31
|
-
return values;
|
|
32
|
-
});
|
|
33
|
-
}, {
|
|
17
|
+
return useInfiniteQuery([PROOF_SCHEMA_LIST_QUERY_KEY, ...getQueryKeyFromProofSchemaListQueryParams(queryParams)], ({
|
|
18
|
+
pageParam = 0
|
|
19
|
+
}) => core.getProofSchemas({
|
|
20
|
+
organisationId,
|
|
21
|
+
page: pageParam,
|
|
22
|
+
pageSize: PAGE_SIZE,
|
|
23
|
+
...queryParams
|
|
24
|
+
}).then(({
|
|
25
|
+
values
|
|
26
|
+
}) => values), {
|
|
34
27
|
getNextPageParam: (lastPage, allPages) => lastPage.length === PAGE_SIZE ? allPages.length : undefined,
|
|
35
28
|
keepPreviousData
|
|
36
29
|
});
|
|
37
30
|
};
|
|
38
|
-
export const useProofSchemaDetail =
|
|
39
|
-
let active = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
31
|
+
export const useProofSchemaDetail = (proofSchemaId, active = true) => {
|
|
40
32
|
const {
|
|
41
33
|
core
|
|
42
34
|
} = useONECore();
|
|
@@ -62,15 +54,12 @@ export const useProofSchemaAccept = () => {
|
|
|
62
54
|
core,
|
|
63
55
|
organisationId
|
|
64
56
|
} = useONECore();
|
|
65
|
-
return useMutation(async
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
schema
|
|
72
|
-
});
|
|
73
|
-
}, {
|
|
57
|
+
return useMutation(async ({
|
|
58
|
+
schema
|
|
59
|
+
}) => core.importProofSchema({
|
|
60
|
+
organisationId,
|
|
61
|
+
schema
|
|
62
|
+
}), {
|
|
74
63
|
onSuccess: async () => {
|
|
75
64
|
await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);
|
|
76
65
|
await queryClient.invalidateQueries(CREDENTIAL_SCHEMA_LIST_QUERY_KEY);
|
|
@@ -99,7 +88,7 @@ export const useProofSchemaDelete = () => {
|
|
|
99
88
|
onSuccess: async (_, proofSchemaId) => {
|
|
100
89
|
await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);
|
|
101
90
|
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
102
|
-
await queryClient.
|
|
91
|
+
await queryClient.removeQueries([PROOF_SCHEMA_DETAIL_QUERY_KEY, proofSchemaId]);
|
|
103
92
|
}
|
|
104
93
|
});
|
|
105
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useInfiniteQuery","useMutation","useQuery","useQueryClient","getQueryKeyFromProofSchemaListQueryParams","useHTTPClient","useONECore","CREDENTIAL_SCHEMA_LIST_QUERY_KEY","HISTORY_LIST_QUERY_KEY","PAGE_SIZE","PROOF_SCHEMA_LIST_QUERY_KEY","PROOF_SCHEMA_IMPORT_DETAIL_QUERY_KEY","PROOF_SCHEMA_DETAIL_QUERY_KEY","PROOF_SCHEMA_SHARE_QUERY_KEY","useProofSchemas","queryParams","keepPreviousData","
|
|
1
|
+
{"version":3,"names":["useInfiniteQuery","useMutation","useQuery","useQueryClient","getQueryKeyFromProofSchemaListQueryParams","useHTTPClient","useONECore","CREDENTIAL_SCHEMA_LIST_QUERY_KEY","HISTORY_LIST_QUERY_KEY","PAGE_SIZE","PROOF_SCHEMA_LIST_QUERY_KEY","PROOF_SCHEMA_IMPORT_DETAIL_QUERY_KEY","PROOF_SCHEMA_DETAIL_QUERY_KEY","PROOF_SCHEMA_SHARE_QUERY_KEY","useProofSchemas","queryParams","keepPreviousData","core","organisationId","pageParam","getProofSchemas","page","pageSize","then","values","getNextPageParam","lastPage","allPages","length","undefined","useProofSchemaDetail","proofSchemaId","active","getProofSchema","enabled","Boolean","useProofSchemaImportDetail","url","httpClient","get","response","ok","originalError","data","useProofSchemaAccept","queryClient","schema","importProofSchema","onSuccess","invalidateQueries","useProofSchemaCreate","proofSchema","createProofSchema","useProofSchemaDelete","deleteProofSchema","_","removeQueries","useShareProofSchema","schemaId","shareProofSchema","Promise","reject"],"sources":["proof-schemas.ts"],"sourcesContent":["import {\n CreateProofSchemaRequest,\n ImportProofSchema,\n ProofSchema,\n ProofSchemaListItem,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\nimport { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { getQueryKeyFromProofSchemaListQueryParams } from '../../parsers/query';\nimport { useHTTPClient } from '../http/client';\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_SCHEMA_LIST_QUERY_KEY } from './credential-schemas';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst PAGE_SIZE = 10;\nexport const PROOF_SCHEMA_LIST_QUERY_KEY = 'proof-schema-list';\nexport const PROOF_SCHEMA_IMPORT_DETAIL_QUERY_KEY = 'proof-schema-import';\nexport const PROOF_SCHEMA_DETAIL_QUERY_KEY = 'proof-schema-detail';\nexport const PROOF_SCHEMA_SHARE_QUERY_KEY = 'proof-schema-share';\n\nexport const useProofSchemas = (queryParams?: Partial<ProofSchemaListQuery>, keepPreviousData = true) => {\n const { core, organisationId } = useONECore();\n\n return useInfiniteQuery(\n [PROOF_SCHEMA_LIST_QUERY_KEY, ...getQueryKeyFromProofSchemaListQueryParams(queryParams)],\n ({ pageParam = 0 }) =>\n core\n .getProofSchemas({\n organisationId,\n page: pageParam,\n pageSize: PAGE_SIZE,\n ...queryParams,\n })\n .then(({ values }) => values),\n {\n getNextPageParam: (lastPage, allPages) => (lastPage.length === PAGE_SIZE ? allPages.length : undefined),\n keepPreviousData,\n },\n );\n};\n\nexport const useProofSchemaDetail = (proofSchemaId: ProofSchemaListItem['id'] | undefined, active = true) => {\n const { core } = useONECore();\n\n return useQuery(\n [PROOF_SCHEMA_DETAIL_QUERY_KEY, proofSchemaId],\n () => (proofSchemaId ? core.getProofSchema(proofSchemaId) : undefined),\n {\n enabled: active && Boolean(proofSchemaId),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useProofSchemaImportDetail = (url: string) => {\n const httpClient = useHTTPClient();\n\n return useQuery(\n [PROOF_SCHEMA_IMPORT_DETAIL_QUERY_KEY, url],\n () =>\n httpClient.get(url).then((response) => {\n if (!response.ok) {\n throw response.originalError;\n }\n return response.data as ImportProofSchema;\n }),\n {\n keepPreviousData: true,\n },\n );\n};\n\nexport const useProofSchemaAccept = () => {\n const queryClient = useQueryClient();\n const { core, organisationId } = useONECore();\n\n return useMutation(\n async ({ schema }: { schema: ImportProofSchema }) =>\n core.importProofSchema({\n organisationId,\n schema,\n }),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(CREDENTIAL_SCHEMA_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofSchemaCreate = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async (proofSchema: CreateProofSchemaRequest) => core.createProofSchema(proofSchema), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useProofSchemaDelete = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async (proofSchemaId: ProofSchema['id']) => core.deleteProofSchema(proofSchemaId), {\n onSuccess: async (_, proofSchemaId) => {\n await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n await queryClient.removeQueries([PROOF_SCHEMA_DETAIL_QUERY_KEY, proofSchemaId]);\n },\n });\n};\n\nexport const useShareProofSchema = (schemaId?: string) => {\n const { core } = useONECore();\n\n return useQuery(\n [PROOF_SCHEMA_SHARE_QUERY_KEY, schemaId],\n () => (schemaId ? core.shareProofSchema(schemaId) : Promise.reject()),\n {\n enabled: Boolean(schemaId),\n keepPreviousData: true,\n },\n );\n};\n"],"mappings":"AAOA,SAASA,gBAAgB,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAErF,SAASC,yCAAyC,QAAQ,qBAAqB;AAC/E,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,gCAAgC,QAAQ,sBAAsB;AACvE,SAASC,sBAAsB,QAAQ,WAAW;AAElD,MAAMC,SAAS,GAAG,EAAE;AACpB,OAAO,MAAMC,2BAA2B,GAAG,mBAAmB;AAC9D,OAAO,MAAMC,oCAAoC,GAAG,qBAAqB;AACzE,OAAO,MAAMC,6BAA6B,GAAG,qBAAqB;AAClE,OAAO,MAAMC,4BAA4B,GAAG,oBAAoB;AAEhE,OAAO,MAAMC,eAAe,GAAGA,CAACC,WAA2C,EAAEC,gBAAgB,GAAG,IAAI,KAAK;EACvG,MAAM;IAAEC,IAAI;IAAEC;EAAe,CAAC,GAAGZ,UAAU,CAAC,CAAC;EAE7C,OAAON,gBAAgB,CACrB,CAACU,2BAA2B,EAAE,GAAGN,yCAAyC,CAACW,WAAW,CAAC,CAAC,EACxF,CAAC;IAAEI,SAAS,GAAG;EAAE,CAAC,KAChBF,IAAI,CACDG,eAAe,CAAC;IACfF,cAAc;IACdG,IAAI,EAAEF,SAAS;IACfG,QAAQ,EAAEb,SAAS;IACnB,GAAGM;EACL,CAAC,CAAC,CACDQ,IAAI,CAAC,CAAC;IAAEC;EAAO,CAAC,KAAKA,MAAM,CAAC,EACjC;IACEC,gBAAgB,EAAEA,CAACC,QAAQ,EAAEC,QAAQ,KAAMD,QA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AiB,IAAK;EACxD,MAAM;IAAEzC;EAAK,CAAC,GAAGX,UAAU,CAAC,CAAC;EAE7B,OAAOJ,QAAQ,CACb,CAACW,4BAA4B,EAAE6C,QAAQ,CAAC,EACxC,MAAOA,QAAQ,GAAGzC,IAAI,CAAC0C,gBAAgB,CAACD,QAAQ,CAAC,GAAGE,OAAO,CAACC,MAAM,CAAC,CAAE,EACrE;IACE3B,OAAO,EAAEC,OAAO,CAACuB,QAAQ,CAAC;IAC1B1C,gBAAgB,EAAE;EACpB,CACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OneError, ProofStateEnum } from '@procivis/react-native-one-core';
|
|
2
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
4
4
|
import { getQueryKeyFromProofListQueryParams } from '../../parsers/query';
|
|
5
5
|
import { useCoreConfig } from './core-config';
|
|
@@ -25,7 +25,7 @@ export const useProofState = (proofId, isPolling) => {
|
|
|
25
25
|
const {
|
|
26
26
|
core
|
|
27
27
|
} = useONECore();
|
|
28
|
-
return useQuery([PROOF_STATE_QUERY_KEY, proofId], () => core.getProof(proofId).then(proof => proof.state), {
|
|
28
|
+
return useQuery([PROOF_STATE_QUERY_KEY, proofId], () => proofId ? core.getProof(proofId).then(proof => proof.state) : undefined, {
|
|
29
29
|
enabled: Boolean(proofId),
|
|
30
30
|
refetchInterval: isPolling ? 1000 : false
|
|
31
31
|
});
|
|
@@ -35,13 +35,10 @@ export const useProofUrl = () => {
|
|
|
35
35
|
const {
|
|
36
36
|
core
|
|
37
37
|
} = useONECore();
|
|
38
|
-
return useMutation(async
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref;
|
|
43
|
-
return core.shareProof(proofId, request !== null && request !== void 0 ? request : {}).then(proof => proof.url);
|
|
44
|
-
}, {
|
|
38
|
+
return useMutation(async ({
|
|
39
|
+
proofId,
|
|
40
|
+
request
|
|
41
|
+
}) => core.shareProof(proofId, request !== null && request !== void 0 ? request : {}).then(proof => proof.url), {
|
|
45
42
|
onSuccess: async () => {
|
|
46
43
|
await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);
|
|
47
44
|
await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);
|
|
@@ -53,15 +50,12 @@ export const useProofAccept = () => {
|
|
|
53
50
|
const {
|
|
54
51
|
core
|
|
55
52
|
} = useONECore();
|
|
56
|
-
return useMutation(async
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref2;
|
|
63
|
-
return core.holderSubmitProof(interactionId, credentials, didId, keyId);
|
|
64
|
-
}, {
|
|
53
|
+
return useMutation(async ({
|
|
54
|
+
interactionId,
|
|
55
|
+
credentials,
|
|
56
|
+
didId,
|
|
57
|
+
keyId
|
|
58
|
+
}) => core.holderSubmitProof(interactionId, credentials, didId, keyId), {
|
|
65
59
|
onError: async () => {
|
|
66
60
|
await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);
|
|
67
61
|
},
|
|
@@ -88,12 +82,18 @@ export const useProofReject = () => {
|
|
|
88
82
|
}
|
|
89
83
|
});
|
|
90
84
|
};
|
|
91
|
-
export let
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
export let IssuanceProtocol = /*#__PURE__*/function (IssuanceProtocol) {
|
|
86
|
+
IssuanceProtocol["OPENID4VCI_DRAFT13"] = "OPENID4VCI_DRAFT13";
|
|
87
|
+
return IssuanceProtocol;
|
|
88
|
+
}({});
|
|
89
|
+
export let VerificationProtocol = /*#__PURE__*/function (VerificationProtocol) {
|
|
90
|
+
VerificationProtocol["ISO_MDL"] = "ISO_MDL";
|
|
91
|
+
VerificationProtocol["OPENID4VP_DRAFT20"] = "OPENID4VP_DRAFT20";
|
|
92
|
+
VerificationProtocol["OPENID4VP_DRAFT25"] = "OPENID4VP_DRAFT25";
|
|
93
|
+
VerificationProtocol["OPENID4VP_PROXIMITY_DRAFT00"] = "OPENID4VP_PROXIMITY_DRAFT00";
|
|
94
|
+
VerificationProtocol["SCAN_TO_VERIFY"] = "SCAN_TO_VERIFY";
|
|
95
|
+
return VerificationProtocol;
|
|
96
|
+
}({});
|
|
97
97
|
export const useProposeProof = () => {
|
|
98
98
|
const queryClient = useQueryClient();
|
|
99
99
|
const {
|
|
@@ -106,13 +106,13 @@ export const useProposeProof = () => {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
|
-
export const
|
|
109
|
+
export const useProofDelete = () => {
|
|
110
110
|
const queryClient = useQueryClient();
|
|
111
111
|
const {
|
|
112
112
|
core
|
|
113
113
|
} = useONECore();
|
|
114
114
|
return useMutation(async proofId => {
|
|
115
|
-
return core.
|
|
115
|
+
return core.deleteProof(proofId).catch(e => {
|
|
116
116
|
if (e instanceof OneError && e.code === OneErrorCode.OperationNotSupported) {
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
@@ -133,17 +133,14 @@ export const useProofs = queryParams => {
|
|
|
133
133
|
organisationId
|
|
134
134
|
} = useONECore();
|
|
135
135
|
const queryKey = [PROOF_LIST_QUERY_KEY, ...getQueryKeyFromProofListQueryParams(queryParams)];
|
|
136
|
-
return useQuery(queryKey,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
...queryParams
|
|
145
|
-
});
|
|
146
|
-
}, {
|
|
136
|
+
return useQuery(queryKey, ({
|
|
137
|
+
pageParam = 0
|
|
138
|
+
}) => core.getProofs({
|
|
139
|
+
organisationId,
|
|
140
|
+
page: pageParam,
|
|
141
|
+
pageSize: PAGE_SIZE,
|
|
142
|
+
...queryParams
|
|
143
|
+
}), {
|
|
147
144
|
keepPreviousData: false
|
|
148
145
|
});
|
|
149
146
|
};
|
|
@@ -185,7 +182,7 @@ const getDidFilterForProofSchema = (proofSchema, config) => {
|
|
|
185
182
|
keyStorages
|
|
186
183
|
};
|
|
187
184
|
};
|
|
188
|
-
export const
|
|
185
|
+
export const useProofForSchemaIdWithTransport = (proofSchemaId, transport, enabled) => {
|
|
189
186
|
const {
|
|
190
187
|
data: proofSchema
|
|
191
188
|
} = useProofSchemaDetail(proofSchemaId, enabled);
|
|
@@ -199,42 +196,71 @@ export const useProofCreateOrReuse = (proofSchemaId, transport, enabled) => {
|
|
|
199
196
|
const {
|
|
200
197
|
mutateAsync: createProof
|
|
201
198
|
} = useProofCreate();
|
|
199
|
+
const {
|
|
200
|
+
mutateAsync: deleteProof
|
|
201
|
+
} = useProofDelete();
|
|
202
|
+
const [deleting, setDeleting] = useState(false);
|
|
203
|
+
const [proofId, setProofIdState] = useState(undefined);
|
|
204
|
+
const proofIdRef = useRef();
|
|
205
|
+
const {
|
|
206
|
+
data: proofState
|
|
207
|
+
} = useProofState(deleting ? undefined : proofId, enabled);
|
|
208
|
+
const setProofId = useCallback(id => {
|
|
209
|
+
proofIdRef.current = id;
|
|
210
|
+
setProofIdState(id);
|
|
211
|
+
}, []);
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
if (!proofIdRef.current) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
setDeleting(true);
|
|
217
|
+
deleteProof(proofIdRef.current).then(() => {
|
|
218
|
+
setProofId(undefined);
|
|
219
|
+
setDeleting(false);
|
|
220
|
+
}).catch(() => {});
|
|
221
|
+
}, [proofIdRef, deleteProof, proofSchemaId, transport, setProofId]);
|
|
222
|
+
useEffect(() => {
|
|
223
|
+
if (enabled) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (proofState !== ProofStateEnum.CREATED && proofState !== ProofStateEnum.PENDING) {
|
|
227
|
+
setProofId(undefined);
|
|
228
|
+
}
|
|
229
|
+
}, [enabled, proofState, setProofId]);
|
|
230
|
+
useEffect(() => {
|
|
231
|
+
if (deleting || !enabled || proofId || !dids || !didFilter || !dids.values.length || !transport || transport.length === 0) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
createProof({
|
|
235
|
+
exchange: VerificationProtocol.OPENID4VP_PROXIMITY_DRAFT00,
|
|
236
|
+
proofSchemaId,
|
|
237
|
+
transport,
|
|
238
|
+
verifierDidId: dids.values[0].id
|
|
239
|
+
}).then(id => {
|
|
240
|
+
setProofId(id);
|
|
241
|
+
}).catch(() => {});
|
|
242
|
+
}, [proofSchemaId, dids, didFilter, createProof, enabled, transport, proofId, setProofId, deleting]);
|
|
243
|
+
return deleting ? undefined : proofId;
|
|
244
|
+
};
|
|
245
|
+
export const useCleanupUnusedProofs = () => {
|
|
246
|
+
const {
|
|
247
|
+
mutateAsync: deleteProof
|
|
248
|
+
} = useProofDelete();
|
|
202
249
|
const {
|
|
203
250
|
data: proofs
|
|
204
251
|
} = useProofs({
|
|
205
252
|
page: 0,
|
|
206
253
|
pageSize: 100,
|
|
207
|
-
proofSchemaIds: [proofSchemaId],
|
|
208
254
|
proofStates: [ProofStateEnum.CREATED, ProofStateEnum.PENDING]
|
|
209
255
|
});
|
|
210
|
-
const [
|
|
256
|
+
const [cleaned, setCleaned] = useState(false);
|
|
211
257
|
useEffect(() => {
|
|
212
|
-
|
|
213
|
-
if (!dids || !didFilter || !dids.values.length || !proofs || !transport || transport.length === 0) {
|
|
258
|
+
if (cleaned || !proofs) {
|
|
214
259
|
return;
|
|
215
260
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const reusableProof = proof === null || proof === void 0 ? void 0 : proof.id;
|
|
220
|
-
if (!enabled) {
|
|
221
|
-
if (!reusableProof) {
|
|
222
|
-
setProofId(undefined);
|
|
223
|
-
}
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (reusableProof) {
|
|
227
|
-
setProofId(reusableProof);
|
|
228
|
-
} else {
|
|
229
|
-
createProof({
|
|
230
|
-
exchange: ExchangeProtocol.OPENID4VC,
|
|
231
|
-
proofSchemaId,
|
|
232
|
-
transport,
|
|
233
|
-
verifierDidId: dids.values[0].id
|
|
234
|
-
}).catch(() => {});
|
|
235
|
-
}
|
|
236
|
-
}, [proofSchemaId, proofs, dids, didFilter, createProof, enabled, transport]);
|
|
237
|
-
return proofId;
|
|
261
|
+
setCleaned(true);
|
|
262
|
+
proofs.values.forEach(proof => deleteProof(proof.id));
|
|
263
|
+
}, [cleaned, deleteProof, proofs]);
|
|
238
264
|
};
|
|
239
265
|
export const useShareProof = (proofUrlProps, enabled) => {
|
|
240
266
|
const {
|
|
@@ -272,11 +298,19 @@ export const useShareProof = (proofUrlProps, enabled) => {
|
|
|
272
298
|
}, [enabled, proofUrlProps, shareProof, sharedProof]);
|
|
273
299
|
return sharedProof;
|
|
274
300
|
};
|
|
275
|
-
export const useRetainProofCheck =
|
|
301
|
+
export const useRetainProofCheck = proofId => {
|
|
302
|
+
const queryClient = useQueryClient();
|
|
276
303
|
const {
|
|
277
304
|
core
|
|
278
305
|
} = useONECore();
|
|
279
|
-
return useMutation(async () => core.runTask('RETAIN_PROOF_CHECK')
|
|
306
|
+
return useMutation(async () => core.runTask('RETAIN_PROOF_CHECK'), {
|
|
307
|
+
onSuccess: async () => {
|
|
308
|
+
if (proofId) {
|
|
309
|
+
await queryClient.removeQueries([PROOF_DETAIL_QUERY_KEY, proofId]);
|
|
310
|
+
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
});
|
|
280
314
|
};
|
|
281
315
|
export const useDeleteProofData = proofId => {
|
|
282
316
|
const queryClient = useQueryClient();
|
|
@@ -285,7 +319,7 @@ export const useDeleteProofData = proofId => {
|
|
|
285
319
|
} = useONECore();
|
|
286
320
|
return useMutation(async () => core.deleteProofClaims(proofId), {
|
|
287
321
|
onSuccess: async () => {
|
|
288
|
-
await queryClient.
|
|
322
|
+
await queryClient.removeQueries([PROOF_DETAIL_QUERY_KEY, proofId]);
|
|
289
323
|
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
290
324
|
}
|
|
291
325
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OneError","ProofStateEnum","useEffect","useMemo","useState","useMutation","useQuery","useQueryClient","getQueryKeyFromProofListQueryParams","useCoreConfig","useONECore","useDids","OneErrorCode","HISTORY_LIST_QUERY_KEY","useProofSchemaDetail","PAGE_SIZE","PROOF_DETAIL_QUERY_KEY","PROOF_STATE_QUERY_KEY","PROOF_LIST_QUERY_KEY","useProofDetail","proofId","core","getProof","undefined","enabled","Boolean","keepPreviousData","useProofState","isPolling","then","proof","state","refetchInterval","useProofUrl","queryClient","_ref","request","shareProof","url","onSuccess","invalidateQueries","useProofAccept","_ref2","interactionId","credentials","didId","keyId","holderSubmitProof","onError","useProofReject","holderRejectProof","catch","e","code","OperationNotSupported","ExchangeProtocol","useProposeProof","organisationId","exchange","proposeProof","useProofRetract","retractProof","useProofs","queryParams","queryKey","_ref3","pageParam","getProofs","page","pageSize","useProofCreate","data","createProof","getDidFilterForProofSchema","proofSchema","config","requestedFormats","proofInputSchemas","map","schema","credentialSchema","format","requestedFormatsCapabilities","_config$format$format","capabilities","filter","x","keyAlgorithms","reduce","others","_others$filter","current","verificationKeyAlgorithms","item","includes","keyStorages","_others$filter2","verificationKeyStorages","useProofCreateOrReuse","proofSchemaId","transport","didFilter","dids","mutateAsync","proofs","proofSchemaIds","proofStates","CREATED","PENDING","setProofId","_filteredProofs$find","values","length","transportFilter","filteredProofs","p","OPENID4VC","find","reusableProof","id","verifierDidId","useShareProof","proofUrlProps","proofState","sharedProof","setSharedProof","bleAdapterDisabled","err","_err$cause","cause","useRetainProofCheck","runTask","useDeleteProofData","deleteProofClaims","useDeleteAllProofsData","schemaId","ACCEPTED","result","Promise","all","reverse"],"sources":["proofs.ts"],"sourcesContent":["import {\n Config,\n CreateProofRequest,\n DidListQuery,\n OneError,\n PresentationSubmitCredentialRequest,\n ProofListQuery,\n ProofSchema,\n ProofStateEnum,\n ShareProofRequest,\n} from '@procivis/react-native-one-core';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { getQueryKeyFromProofListQueryParams } from '../../parsers/query';\nimport { Transport } from '../connectivity/connectivity';\nimport { useCoreConfig } from './core-config';\nimport { useONECore } from './core-context';\nimport { useDids } from './dids';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\nimport { useProofSchemaDetail } from './proof-schemas';\n\nconst PAGE_SIZE = 10;\nexport const PROOF_DETAIL_QUERY_KEY = 'proof-detail';\nexport const PROOF_STATE_QUERY_KEY = 'proof-state';\nexport const PROOF_LIST_QUERY_KEY = 'proof-list';\n\nexport const useProofDetail = (proofId: string | undefined) => {\n const { core } = useONECore();\n\n return useQuery([PROOF_DETAIL_QUERY_KEY, proofId], () => (proofId ? core.getProof(proofId) : undefined), {\n enabled: Boolean(proofId),\n keepPreviousData: true,\n });\n};\n\nexport const useProofState = (proofId: string | undefined, isPolling: boolean) => {\n const { core } = useONECore();\n\n return useQuery([PROOF_STATE_QUERY_KEY, proofId], () => core.getProof(proofId!).then((proof) => proof.state), {\n enabled: Boolean(proofId),\n refetchInterval: isPolling ? 1000 : false,\n });\n};\n\ntype ProofUrlHookParams = { proofId: string; request?: ShareProofRequest };\n\nexport const useProofUrl = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ proofId, request }: ProofUrlHookParams) =>\n core.shareProof(proofId, request ?? {}).then((proof) => proof.url),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofAccept = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({\n interactionId,\n credentials,\n didId,\n keyId,\n }: {\n credentials: Record<string, PresentationSubmitCredentialRequest>;\n didId: string;\n interactionId: string;\n keyId?: string;\n }) => core.holderSubmitProof(interactionId, credentials, didId, keyId),\n {\n onError: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofReject = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (interactionId: string) =>\n core.holderRejectProof(interactionId).catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OperationNotSupported) {\n return;\n }\n throw e;\n }),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport enum ExchangeProtocol {\n ISO_MDL = 'ISO_MDL',\n OPENID4VC = 'OPENID4VC',\n PROCIVIS = 'PROCIVIS_TEMPORARY',\n}\n\nexport const useProposeProof = () => {\n const queryClient = useQueryClient();\n const { core, organisationId } = useONECore();\n\n return useMutation(async (exchange: ExchangeProtocol) => core.proposeProof(exchange, organisationId), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useProofRetract = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (proofId: string) => {\n return core.retractProof(proofId).catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OperationNotSupported) {\n return;\n }\n throw e;\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofs = (queryParams?: Partial<ProofListQuery>) => {\n const { core, organisationId } = useONECore();\n\n const queryKey = [PROOF_LIST_QUERY_KEY, ...getQueryKeyFromProofListQueryParams(queryParams)];\n\n return useQuery(\n queryKey,\n ({ pageParam = 0 }) =>\n core.getProofs({\n organisationId,\n page: pageParam,\n pageSize: PAGE_SIZE,\n ...queryParams,\n }),\n {\n keepPreviousData: false,\n },\n );\n};\n\nexport const useProofCreate = () => {\n const queryClient = useQueryClient();\n\n const { core } = useONECore();\n\n return useMutation(async (data: CreateProofRequest) => core.createProof(data), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n },\n });\n};\n\nconst getDidFilterForProofSchema = (proofSchema: ProofSchema, config: Config): Partial<DidListQuery> => {\n const requestedFormats = proofSchema.proofInputSchemas.map((schema) => schema.credentialSchema.format);\n const requestedFormatsCapabilities = requestedFormats\n .map((format) => config.format[format]?.capabilities)\n .filter((x) => x);\n\n // key algorithms must be supported by all requested formats\n const keyAlgorithms = requestedFormatsCapabilities.reduce<string[] | undefined>((others, capabilities) => {\n const current = capabilities.verificationKeyAlgorithms;\n return others?.filter((item) => current.includes(item)) ?? current;\n }, undefined);\n\n // key storages must be supported by all requested formats\n const keyStorages = requestedFormatsCapabilities.reduce<string[] | undefined>((others, capabilities) => {\n const current = capabilities.verificationKeyStorages;\n return others?.filter((item) => current.includes(item)) ?? current;\n }, undefined);\n\n return { keyAlgorithms, keyStorages };\n};\n\nexport const useProofCreateOrReuse = (proofSchemaId: string, transport: Transport[] | undefined, enabled: boolean) => {\n const { data: proofSchema } = useProofSchemaDetail(proofSchemaId, enabled);\n const { data: config } = useCoreConfig();\n\n const didFilter = useMemo(\n () => (proofSchema && config ? getDidFilterForProofSchema(proofSchema, config) : undefined),\n [config, proofSchema],\n );\n\n const { data: dids } = useDids(didFilter);\n const { mutateAsync: createProof } = useProofCreate();\n const { data: proofs } = useProofs({\n page: 0,\n pageSize: 100,\n proofSchemaIds: [proofSchemaId],\n proofStates: [ProofStateEnum.CREATED, ProofStateEnum.PENDING],\n });\n\n const [proofId, setProofId] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n if (!dids || !didFilter || !dids.values.length || !proofs || !transport || transport.length === 0) {\n return;\n }\n\n const transportFilter = transport.length === 2 ? '' : transport[0];\n const filteredProofs = proofs.values.filter(\n (p) => p.exchange === ExchangeProtocol.OPENID4VC && p.transport === transportFilter,\n );\n const proof =\n filteredProofs.length > 0\n ? filteredProofs.find((p) => p.state === ProofStateEnum.PENDING) ?? filteredProofs[0]\n : undefined;\n\n const reusableProof = proof?.id;\n\n if (!enabled) {\n if (!reusableProof) {\n setProofId(undefined);\n }\n return;\n }\n\n if (reusableProof) {\n setProofId(reusableProof);\n } else {\n createProof({\n exchange: ExchangeProtocol.OPENID4VC,\n proofSchemaId,\n transport,\n verifierDidId: dids.values[0].id,\n }).catch(() => {});\n }\n }, [proofSchemaId, proofs, dids, didFilter, createProof, enabled, transport]);\n\n return proofId;\n};\n\nexport const useShareProof = (proofUrlProps: ProofUrlHookParams | undefined, enabled: boolean) => {\n const { mutateAsync: shareProof } = useProofUrl();\n const { data: proofState } = useProofState(proofUrlProps?.proofId, enabled);\n\n const [sharedProof, setSharedProof] = useState<{\n bleAdapterDisabled: boolean;\n url?: string;\n }>();\n\n // reset when proofId changes or the proof was retracted\n useEffect(() => {\n if (!proofUrlProps?.proofId || proofState === ProofStateEnum.CREATED) {\n setSharedProof(undefined);\n }\n }, [proofUrlProps?.proofId, proofState]);\n\n useEffect(() => {\n if (!proofUrlProps || !enabled || sharedProof) {\n return;\n }\n\n shareProof(proofUrlProps)\n .then((url) => {\n setSharedProof({\n bleAdapterDisabled: false,\n url,\n });\n })\n .catch((err: unknown) => {\n // TODO emit error with specific error code from core.\n if (err instanceof OneError && err.cause?.includes('BLE adapter not enabled')) {\n setSharedProof({\n bleAdapterDisabled: true,\n });\n }\n });\n }, [enabled, proofUrlProps, shareProof, sharedProof]);\n\n return sharedProof;\n};\n\nexport const useRetainProofCheck = () => {\n const { core } = useONECore();\n\n return useMutation(async () => core.runTask('RETAIN_PROOF_CHECK'));\n};\n\nexport const useDeleteProofData = (proofId: string) => {\n const queryClient = useQueryClient();\n\n const { core } = useONECore();\n\n return useMutation(async () => core.deleteProofClaims(proofId), {\n onSuccess: async () => {\n await queryClient.invalidateQueries([PROOF_DETAIL_QUERY_KEY, proofId]);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useDeleteAllProofsData = (schemaId: string) => {\n const queryClient = useQueryClient();\n\n const { core, organisationId } = useONECore();\n\n return useMutation(\n async () =>\n core\n .getProofs({\n organisationId,\n page: 0,\n pageSize: 1000,\n proofSchemaIds: [schemaId],\n proofStates: [ProofStateEnum.ACCEPTED],\n })\n .then((result) => Promise.all(result.values.reverse().map((proof) => core.deleteProofClaims(proof.id)))),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n"],"mappings":"AAAA,SAIEA,QAAQ,EAIRC,cAAc,QAET,iCAAiC;AACxC,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,mCAAmC,QAAQ,qBAAqB;AAEzE,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,YAAY,QAAQ,cAAc;AAC3C,SAASC,sBAAsB,QAAQ,WAAW;AAClD,SAASC,oBAAoB,QAAQ,iBAAiB;AAEtD,MAAMC,SAAS,GAA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AMkB,WAAW,CAACM,iBAAiB,CAAC3B,sBAAsB,CAAC;IAC7D;EACF,CAAC,CACF;AACH,CAAC"}
|
|
1
|
+
{"version":3,"names":["OneError","ProofStateEnum","useCallback","useEffect","useMemo","useRef","useState","useMutation","useQuery","useQueryClient","getQueryKeyFromProofListQueryParams","useCoreConfig","useONECore","useDids","OneErrorCode","HISTORY_LIST_QUERY_KEY","useProofSchemaDetail","PAGE_SIZE","PROOF_DETAIL_QUERY_KEY","PROOF_STATE_QUERY_KEY","PROOF_LIST_QUERY_KEY","useProofDetail","proofId","core","getProof","undefined","enabled","Boolean","keepPreviousData","useProofState","isPolling","then","proof","state","refetchInterval","useProofUrl","queryClient","request","shareProof","url","onSuccess","invalidateQueries","useProofAccept","interactionId","credentials","didId","keyId","holderSubmitProof","onError","useProofReject","holderRejectProof","catch","e","code","OperationNotSupported","IssuanceProtocol","VerificationProtocol","useProposeProof","organisationId","exchange","proposeProof","useProofDelete","deleteProof","useProofs","queryParams","queryKey","pageParam","getProofs","page","pageSize","useProofCreate","data","createProof","getDidFilterForProofSchema","proofSchema","config","requestedFormats","proofInputSchemas","map","schema","credentialSchema","format","requestedFormatsCapabilities","_config$format$format","capabilities","filter","x","keyAlgorithms","reduce","others","_others$filter","current","verificationKeyAlgorithms","item","includes","keyStorages","_others$filter2","verificationKeyStorages","useProofForSchemaIdWithTransport","proofSchemaId","transport","didFilter","dids","mutateAsync","deleting","setDeleting","setProofIdState","proofIdRef","proofState","setProofId","id","CREATED","PENDING","values","length","OPENID4VP_PROXIMITY_DRAFT00","verifierDidId","useCleanupUnusedProofs","proofs","proofStates","cleaned","setCleaned","forEach","useShareProof","proofUrlProps","sharedProof","setSharedProof","bleAdapterDisabled","err","_err$cause","cause","useRetainProofCheck","runTask","removeQueries","useDeleteProofData","deleteProofClaims","useDeleteAllProofsData","schemaId","proofSchemaIds","ACCEPTED","result","Promise","all","reverse"],"sources":["proofs.ts"],"sourcesContent":["import {\n Config,\n CreateProofRequest,\n DidListQuery,\n OneError,\n PresentationSubmitCredentialRequest,\n ProofListQuery,\n ProofSchema,\n ProofStateEnum,\n ShareProofRequest,\n} from '@procivis/react-native-one-core';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { getQueryKeyFromProofListQueryParams } from '../../parsers/query';\nimport { Transport } from '../connectivity/connectivity';\nimport { useCoreConfig } from './core-config';\nimport { useONECore } from './core-context';\nimport { useDids } from './dids';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\nimport { useProofSchemaDetail } from './proof-schemas';\n\nconst PAGE_SIZE = 10;\nexport const PROOF_DETAIL_QUERY_KEY = 'proof-detail';\nexport const PROOF_STATE_QUERY_KEY = 'proof-state';\nexport const PROOF_LIST_QUERY_KEY = 'proof-list';\n\nexport const useProofDetail = (proofId: string | undefined) => {\n const { core } = useONECore();\n\n return useQuery([PROOF_DETAIL_QUERY_KEY, proofId], () => (proofId ? core.getProof(proofId) : undefined), {\n enabled: Boolean(proofId),\n keepPreviousData: true,\n });\n};\n\nexport const useProofState = (proofId: string | undefined, isPolling: boolean) => {\n const { core } = useONECore();\n\n return useQuery(\n [PROOF_STATE_QUERY_KEY, proofId],\n () => (proofId ? core.getProof(proofId).then((proof) => proof.state) : undefined),\n {\n enabled: Boolean(proofId),\n refetchInterval: isPolling ? 1000 : false,\n },\n );\n};\n\ntype ProofUrlHookParams = { proofId: string; request?: ShareProofRequest };\n\nexport const useProofUrl = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ proofId, request }: ProofUrlHookParams) =>\n core.shareProof(proofId, request ?? {}).then((proof) => proof.url),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofAccept = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({\n interactionId,\n credentials,\n didId,\n keyId,\n }: {\n credentials: Record<string, PresentationSubmitCredentialRequest>;\n didId: string;\n interactionId: string;\n keyId?: string;\n }) => core.holderSubmitProof(interactionId, credentials, didId, keyId),\n {\n onError: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofReject = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (interactionId: string) =>\n core.holderRejectProof(interactionId).catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OperationNotSupported) {\n return;\n }\n throw e;\n }),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport enum IssuanceProtocol {\n OPENID4VCI_DRAFT13 = 'OPENID4VCI_DRAFT13',\n}\n\nexport enum VerificationProtocol {\n ISO_MDL = 'ISO_MDL',\n OPENID4VP_DRAFT20 = 'OPENID4VP_DRAFT20',\n OPENID4VP_DRAFT25 = 'OPENID4VP_DRAFT25',\n OPENID4VP_PROXIMITY_DRAFT00 = 'OPENID4VP_PROXIMITY_DRAFT00',\n SCAN_TO_VERIFY = 'SCAN_TO_VERIFY',\n}\n\nexport const useProposeProof = () => {\n const queryClient = useQueryClient();\n const { core, organisationId } = useONECore();\n\n return useMutation(async (exchange: VerificationProtocol) => core.proposeProof(exchange, organisationId), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useProofDelete = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (proofId: string) => {\n return core.deleteProof(proofId).catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OperationNotSupported) {\n return;\n }\n throw e;\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useProofs = (queryParams?: Partial<ProofListQuery>) => {\n const { core, organisationId } = useONECore();\n\n const queryKey = [PROOF_LIST_QUERY_KEY, ...getQueryKeyFromProofListQueryParams(queryParams)];\n\n return useQuery(\n queryKey,\n ({ pageParam = 0 }) =>\n core.getProofs({\n organisationId,\n page: pageParam,\n pageSize: PAGE_SIZE,\n ...queryParams,\n }),\n {\n keepPreviousData: false,\n },\n );\n};\n\nexport const useProofCreate = () => {\n const queryClient = useQueryClient();\n\n const { core } = useONECore();\n\n return useMutation(async (data: CreateProofRequest) => core.createProof(data), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_STATE_QUERY_KEY);\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n },\n });\n};\n\nconst getDidFilterForProofSchema = (proofSchema: ProofSchema, config: Config): Partial<DidListQuery> => {\n const requestedFormats = proofSchema.proofInputSchemas.map((schema) => schema.credentialSchema.format);\n const requestedFormatsCapabilities = requestedFormats\n .map((format) => config.format[format]?.capabilities)\n .filter((x) => x);\n\n // key algorithms must be supported by all requested formats\n const keyAlgorithms = requestedFormatsCapabilities.reduce<string[] | undefined>((others, capabilities) => {\n const current = capabilities.verificationKeyAlgorithms;\n return others?.filter((item) => current.includes(item)) ?? current;\n }, undefined);\n\n // key storages must be supported by all requested formats\n const keyStorages = requestedFormatsCapabilities.reduce<string[] | undefined>((others, capabilities) => {\n const current = capabilities.verificationKeyStorages;\n return others?.filter((item) => current.includes(item)) ?? current;\n }, undefined);\n\n return { keyAlgorithms, keyStorages };\n};\n\nexport const useProofForSchemaIdWithTransport = (\n proofSchemaId: string,\n transport: Transport[] | undefined,\n enabled: boolean,\n) => {\n const { data: proofSchema } = useProofSchemaDetail(proofSchemaId, enabled);\n const { data: config } = useCoreConfig();\n\n const didFilter = useMemo(\n () => (proofSchema && config ? getDidFilterForProofSchema(proofSchema, config) : undefined),\n [config, proofSchema],\n );\n\n const { data: dids } = useDids(didFilter);\n const { mutateAsync: createProof } = useProofCreate();\n const { mutateAsync: deleteProof } = useProofDelete();\n\n const [deleting, setDeleting] = useState(false);\n const [proofId, setProofIdState] = useState<string | undefined>(undefined);\n const proofIdRef = useRef<string>();\n\n const { data: proofState } = useProofState(deleting ? undefined : proofId, enabled);\n\n const setProofId = useCallback((id: string | undefined) => {\n proofIdRef.current = id;\n setProofIdState(id);\n }, []);\n\n useEffect(() => {\n if (!proofIdRef.current) {\n return;\n }\n setDeleting(true);\n deleteProof(proofIdRef.current)\n .then(() => {\n setProofId(undefined);\n setDeleting(false);\n })\n .catch(() => {});\n }, [proofIdRef, deleteProof, proofSchemaId, transport, setProofId]);\n\n useEffect(() => {\n if (enabled) {\n return;\n }\n if (proofState !== ProofStateEnum.CREATED && proofState !== ProofStateEnum.PENDING) {\n setProofId(undefined);\n }\n }, [enabled, proofState, setProofId]);\n\n useEffect(() => {\n if (\n deleting ||\n !enabled ||\n proofId ||\n !dids ||\n !didFilter ||\n !dids.values.length ||\n !transport ||\n transport.length === 0\n ) {\n return;\n }\n\n createProof({\n exchange: VerificationProtocol.OPENID4VP_PROXIMITY_DRAFT00,\n proofSchemaId,\n transport,\n verifierDidId: dids.values[0].id,\n })\n .then((id) => {\n setProofId(id);\n })\n .catch(() => {});\n }, [proofSchemaId, dids, didFilter, createProof, enabled, transport, proofId, setProofId, deleting]);\n\n return deleting ? undefined : proofId;\n};\n\nexport const useCleanupUnusedProofs = () => {\n const { mutateAsync: deleteProof } = useProofDelete();\n const { data: proofs } = useProofs({\n page: 0,\n pageSize: 100,\n proofStates: [ProofStateEnum.CREATED, ProofStateEnum.PENDING],\n });\n const [cleaned, setCleaned] = useState(false);\n\n useEffect(() => {\n if (cleaned || !proofs) {\n return;\n }\n setCleaned(true);\n proofs.values.forEach((proof) => deleteProof(proof.id));\n }, [cleaned, deleteProof, proofs]);\n};\n\nexport const useShareProof = (proofUrlProps: ProofUrlHookParams | undefined, enabled: boolean) => {\n const { mutateAsync: shareProof } = useProofUrl();\n const { data: proofState } = useProofState(proofUrlProps?.proofId, enabled);\n\n const [sharedProof, setSharedProof] = useState<{\n bleAdapterDisabled: boolean;\n url?: string;\n }>();\n\n // reset when proofId changes or the proof was retracted\n useEffect(() => {\n if (!proofUrlProps?.proofId || proofState === ProofStateEnum.CREATED) {\n setSharedProof(undefined);\n }\n }, [proofUrlProps?.proofId, proofState]);\n\n useEffect(() => {\n if (!proofUrlProps || !enabled || sharedProof) {\n return;\n }\n\n shareProof(proofUrlProps)\n .then((url) => {\n setSharedProof({\n bleAdapterDisabled: false,\n url,\n });\n })\n .catch((err: unknown) => {\n // TODO emit error with specific error code from core.\n if (err instanceof OneError && err.cause?.includes('BLE adapter not enabled')) {\n setSharedProof({\n bleAdapterDisabled: true,\n });\n }\n });\n }, [enabled, proofUrlProps, shareProof, sharedProof]);\n\n return sharedProof;\n};\n\nexport const useRetainProofCheck = (proofId?: string) => {\n const queryClient = useQueryClient();\n\n const { core } = useONECore();\n\n return useMutation(async () => core.runTask('RETAIN_PROOF_CHECK'), {\n onSuccess: async () => {\n if (proofId) {\n await queryClient.removeQueries([PROOF_DETAIL_QUERY_KEY, proofId]);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n }\n },\n });\n};\n\nexport const useDeleteProofData = (proofId: string) => {\n const queryClient = useQueryClient();\n\n const { core } = useONECore();\n\n return useMutation(async () => core.deleteProofClaims(proofId), {\n onSuccess: async () => {\n await queryClient.removeQueries([PROOF_DETAIL_QUERY_KEY, proofId]);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useDeleteAllProofsData = (schemaId: string) => {\n const queryClient = useQueryClient();\n\n const { core, organisationId } = useONECore();\n\n return useMutation(\n async () =>\n core\n .getProofs({\n organisationId,\n page: 0,\n pageSize: 1000,\n proofSchemaIds: [schemaId],\n proofStates: [ProofStateEnum.ACCEPTED],\n })\n .then((result) => Promise.all(result.values.reverse().map((proof) => core.deleteProofClaims(proof.id)))),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(PROOF_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n"],"mappings":"AAAA,SAIEA,QAAQ,EAIRC,cAAc,QAET,iCAAiC;AACxC,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACzE,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,mCAAmC,QAAQ,qBAAqB;AAEzE,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,YAAY,QAAQ,cAAc;AAC3C,SAASC,sBAAsB,QAAQ,WAAW;AAClD,SAASC,oBAAoB,QAAQ,iBAAiB;AAEtD,MAAMC,SAAS,GAAG,EAAE;AACpB,OAAO,MAAMC,sBAAsB,GAAG,cAAc;AACpD,OAAO,MAAMC,qBAAqB,GAAG,aAAa;AAClD,OAAO,MAAMC,oBAAoB,GAAG,YAAY;AAEhD,OAAO,MAAMC,cAAc,GAAIC,OAA2B,IAAK;EAC7D,MAAM;IAAEC;EAAK,CAAC,GAAGX,UAAU,CAAC,CAAC;EAE7B,OAAOJ,QAAQ,CAAC,CAACU,sBAAsB,EAAEI,OAAO,CAAC,EAAE,MAAOA,OAAO,GAAGC,IAAI,CAACC,QAAQ,CAACF,OAAO,CAAC,GAAGG,SAAU,EAAE;IACv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,CAAC;EAE7B,OAAOL,WAAW,CAAC,YAAYgB,IAAI,CAACgH,iBAAiB,CAACjH,OAAO,CAAC,EAAE;IAC9DkB,SAAS,EAAE,MAAAA,CAAA,KAAY;MACrB,MAAMJ,WAAW,CAACiG,aAAa,CAAC,CAACnH,sBAAsB,EAAEI,OAAO,CAAC,CAAC;MAClE,MAAMc,WAAW,CAACK,iBAAiB,CAAC1B,sBAAsB,CAAC;IAC7D;EACF,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMyH,sBAAsB,GAAIC,QAAgB,IAAK;EAC1D,MAAMrG,WAAW,GAAG3B,cAAc,CAAC,CAAC;EAEpC,MAAM;IAAEc,IAAI;IAAEmC;EAAe,CAAC,GAAG9C,UAAU,CAAC,CAAC;EAE7C,OAAOL,WAAW,CAChB,YACEgB,IAAI,CACD4C,SAAS,CAAC;IACTT,cAAc;IACdU,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,IAAI;IACdqE,cAAc,EAAE,CAACD,QAAQ,CAAC;IAC1BlB,WAAW,EAAE,CAACtH,cAAc,CAAC0I,QAAQ;EACvC,CAAC,CAAC,CACD5G,IAAI,CAAE6G,MAAM,IAAKC,OAAO,CAACC,GAAG,CAACF,MAAM,CAAC3B,MAAM,CAAC8B,OAAO,CAAC,CAAC,CAACjE,GAAG,CAAE9C,KAAK,IAAKT,IAAI,CAACgH,iBAAiB,CAACvG,KAAK,CAAC8E,EAAE,CAAC,CAAC,CAAC,CAAC,EAC5G;IACEtE,SAAS,EAAE,MAAAA,CAAA,KAAY;MACrB,MAAMJ,WAAW,CAACK,iBAAiB,CAACvB,sBAAsB,CAAC;MAC3D,MAAMkB,WAAW,CAACK,iBAAiB,CAAC1B,sBAAsB,CAAC;IAC7D;EACF,CACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["QueryClient","reportException","queryClient","defaultOptions","mutations","onError","err","queries","staleTime","Infinity"],"sources":["query.ts"],"sourcesContent":["import { QueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\n\nexport const queryClient = new QueryClient({\n defaultOptions: {\n mutations: {\n onError: (err) => {\n reportException(err, 'Mutation failure');\n },\n },\n queries: {\n onError: (err) => {\n reportException(err, 'Query failure');\n },\n staleTime: Infinity,\n },\n },\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,aAAa;AAEzC,SAASC,eAAe,QAAQ,iBAAiB;AAEjD,OAAO,MAAMC,WAAW,GAAG,IAAIF,WAAW,CAAC;EACzCG,cAAc,EAAE;IACdC,SAAS,EAAE;MACTC,OAAO,EAAGC,GAAG,IAAK;QAChBL,eAAe,CAACK,GAAG,EAAE,kBAAkB,CAAC;MAC1C;IACF,CAAC;IACDC,OAAO,EAAE;MACPF,OAAO,EAAGC,GAAG,IAAK;QAChBL,eAAe,CAACK,GAAG,EAAE,eAAe,CAAC;MACvC,CAAC;MACDE,SAAS,EAAEC;IACb;EACF;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["QueryClient","reportException","queryClient","defaultOptions","mutations","onError","err","queries","staleTime","Infinity"],"sources":["query.ts"],"sourcesContent":["import { QueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\n\nexport const queryClient = new QueryClient({\n defaultOptions: {\n mutations: {\n onError: (err) => {\n reportException(err, 'Mutation failure');\n },\n },\n queries: {\n onError: (err) => {\n reportException(err, 'Query failure');\n },\n staleTime: Infinity,\n },\n },\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,aAAa;AAEzC,SAASC,eAAe,QAAQ,iBAAiB;AAEjD,OAAO,MAAMC,WAAW,GAAG,IAAIF,WAAW,CAAC;EACzCG,cAAc,EAAE;IACdC,SAAS,EAAE;MACTC,OAAO,EAAGC,GAAG,IAAK;QAChBL,eAAe,CAACK,GAAG,EAAE,kBAAkB,CAAC;MAC1C;IACF,CAAC;IACDC,OAAO,EAAE;MACPF,OAAO,EAAGC,GAAG,IAAK;QAChBL,eAAe,CAACK,GAAG,EAAE,eAAe,CAAC;MACvC,CAAC;MACDE,SAAS,EAAEC;IACb;EACF;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,8 +6,8 @@ import { useHTTPClient } from '../http/client';
|
|
|
6
6
|
import { useONECore } from './core-context';
|
|
7
7
|
import { OneErrorCode } from './error-code';
|
|
8
8
|
import { HISTORY_LIST_QUERY_KEY } from './history';
|
|
9
|
-
const TRUST_ENTITY_DETAIL_QUERY_KEY = 'trust-entity-detail';
|
|
10
|
-
const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = 'remote-trust-entity-detail';
|
|
9
|
+
export const TRUST_ENTITY_DETAIL_QUERY_KEY = 'trust-entity-detail';
|
|
10
|
+
export const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = 'remote-trust-entity-detail';
|
|
11
11
|
export const useCreateTrustAnchor = publisherReference => {
|
|
12
12
|
const httpClient = useHTTPClient();
|
|
13
13
|
return useCallback(async core => {
|
|
@@ -27,7 +27,7 @@ export const useCreateTrustAnchor = publisherReference => {
|
|
|
27
27
|
isPublisher: false,
|
|
28
28
|
name: trustAnchor.name,
|
|
29
29
|
publisherReference,
|
|
30
|
-
type:
|
|
30
|
+
type: TrustManagementEnum.SimpleTrustList
|
|
31
31
|
}).catch(err => {
|
|
32
32
|
reportException(err, 'Failed to create trust anchor');
|
|
33
33
|
throw err;
|
|
@@ -81,4 +81,8 @@ export const useUpdateRemoteTrustEntity = () => {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
|
+
export let TrustManagementEnum = /*#__PURE__*/function (TrustManagementEnum) {
|
|
85
|
+
TrustManagementEnum["SimpleTrustList"] = "SIMPLE_TRUST_LIST";
|
|
86
|
+
return TrustManagementEnum;
|
|
87
|
+
}({});
|
|
84
88
|
//# sourceMappingURL=trust-entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OneError","useCallback","useMutation","useQuery","useQueryClient","reportException","useHTTPClient","useONECore","OneErrorCode","HISTORY_LIST_QUERY_KEY","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","useCreateTrustAnchor","publisherReference","httpClient","core","trustAnchors","getTrustAnchors","page","pageSize","values","length","response","get","ok","data","trustAnchor","createTrustAnchor","isPublisher","name","type","catch","err","useTrustEntity","didId","getTrustEntityByDid","e","code","NoTrustEntityFound","undefined","enabled","Boolean","keepPreviousData","useRemoteTrustEntity","did","getRemoteTrustEntity","useCreateRemoteTrustEntity","queryClient","request","createRemoteTrustEntity","onSuccess","invalidateQueries","useUpdateRemoteTrustEntity","updateRemoteTrustEntity"],"sources":["trust-entity.ts"],"sourcesContent":["import {\n CreateRemoteTrustEntityRequest,\n ONECore,\n OneError,\n TrustAnchor,\n UpdateRemoteTrustEntityRequest,\n} from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useHTTPClient } from '../http/client';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\
|
|
1
|
+
{"version":3,"names":["OneError","useCallback","useMutation","useQuery","useQueryClient","reportException","useHTTPClient","useONECore","OneErrorCode","HISTORY_LIST_QUERY_KEY","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","useCreateTrustAnchor","publisherReference","httpClient","core","trustAnchors","getTrustAnchors","page","pageSize","values","length","response","get","ok","data","trustAnchor","createTrustAnchor","isPublisher","name","type","TrustManagementEnum","SimpleTrustList","catch","err","useTrustEntity","didId","getTrustEntityByDid","e","code","NoTrustEntityFound","undefined","enabled","Boolean","keepPreviousData","useRemoteTrustEntity","did","getRemoteTrustEntity","useCreateRemoteTrustEntity","queryClient","request","createRemoteTrustEntity","onSuccess","invalidateQueries","useUpdateRemoteTrustEntity","updateRemoteTrustEntity"],"sources":["trust-entity.ts"],"sourcesContent":["import {\n CreateRemoteTrustEntityRequest,\n ONECore,\n OneError,\n TrustAnchor,\n UpdateRemoteTrustEntityRequest,\n} from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useHTTPClient } from '../http/client';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nexport const TRUST_ENTITY_DETAIL_QUERY_KEY = 'trust-entity-detail';\nexport const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = 'remote-trust-entity-detail';\n\nexport const useCreateTrustAnchor = (publisherReference: string) => {\n const httpClient = useHTTPClient();\n\n return useCallback(\n async (core: ONECore) => {\n const trustAnchors = await core.getTrustAnchors({\n page: 0,\n pageSize: 1,\n });\n if (trustAnchors.values.length > 0) {\n return;\n }\n const response = await httpClient.get<TrustAnchor>(publisherReference);\n if (!response.ok || !response.data) {\n return;\n }\n const trustAnchor = response.data;\n await core\n .createTrustAnchor({\n isPublisher: false,\n name: trustAnchor.name,\n publisherReference,\n type: TrustManagementEnum.SimpleTrustList,\n })\n .catch((err) => {\n reportException(err, 'Failed to create trust anchor');\n throw err;\n });\n },\n [publisherReference, httpClient],\n );\n};\n\nexport const useTrustEntity = (didId: string | undefined) => {\n const { core } = useONECore();\n\n return useQuery(\n [TRUST_ENTITY_DETAIL_QUERY_KEY, didId],\n () =>\n didId\n ? core.getTrustEntityByDid(didId).catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.NoTrustEntityFound) {\n return null;\n }\n throw e;\n })\n : undefined,\n {\n enabled: Boolean(didId),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useRemoteTrustEntity = (did: string | undefined) => {\n const { core } = useONECore();\n\n return useQuery(\n [REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, did],\n () => (did ? core.getRemoteTrustEntity(did) : undefined),\n {\n enabled: Boolean(did),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useCreateRemoteTrustEntity = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async (request: CreateRemoteTrustEntityRequest) => core.createRemoteTrustEntity(request), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useUpdateRemoteTrustEntity = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async (request: UpdateRemoteTrustEntityRequest) => core.updateRemoteTrustEntity(request), {\n onSuccess: async () => {\n await queryClient.invalidateQueries(REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport enum TrustManagementEnum {\n SimpleTrustList = 'SIMPLE_TRUST_LIST',\n}\n"],"mappings":"AAAA,SAGEA,QAAQ,QAGH,iCAAiC;AACxC,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,YAAY,QAAQ,cAAc;AAC3C,SAASC,sBAAsB,QAAQ,WAAW;AAElD,OAAO,MAAMC,6BAA6B,GAAG,qBAAqB;AAClE,OAAO,MAAMC,oCAAoC,GAAG,4BAA4B;AAEhF,OAAO,MAAMC,oBAAoB,GAAIC,kBAA0B,IAAK;EAClE,MAAMC,UAAU,GAAGR,aAAa,CAAC,CAAC;EAElC,OAAOL,WAAW,CAChB,MAAOc,IAAa,IAAK;IACvB,MAAMC,YAAY,GAAG,MAAMD,IAAI,CAACE,eAAe,CAAC;MAC9CC,IAAI,EAAE,CAAC;MACPC,QAAQ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;EAAA,OAAnBA,mBAAmB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useState","useCredentialCardExpanded","expanded","setExpanded","onHeaderPress","oldValue","useCredentialListExpandedCard","expandedCredential","setExpandedCredential","initialized","setInitialized","credentialId","undefined","setInitialCredential","foldCards"],"sources":["credential-card-expanding.tsx"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nexport const useCredentialCardExpanded = () => {\n const [expanded, setExpanded] = useState(true);\n\n const onHeaderPress = useCallback(() => {\n setExpanded((oldValue) => !oldValue);\n }, []);\n\n return { expanded, onHeaderPress };\n};\n\nexport const useCredentialListExpandedCard = () => {\n const [expandedCredential, setExpandedCredential] = useState<string>();\n const [initialized, setInitialized] = useState(false);\n\n const onHeaderPress = useCallback((credentialId?: string) => {\n if (!credentialId) {\n return;\n }\n setInitialized(true);\n setExpandedCredential((oldValue) => {\n if (credentialId === oldValue) {\n return undefined;\n }\n return credentialId;\n });\n }, []);\n\n const setInitialCredential = useCallback(\n (credentialId: string) => {\n if (!initialized) {\n setExpandedCredential(credentialId);\n }\n setInitialized(true);\n },\n [initialized],\n );\n\n const foldCards = useCallback(() => {\n setExpandedCredential(undefined);\n }, []);\n\n return { expandedCredential, foldCards, onHeaderPress, setInitialCredential };\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EAC7C,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGH,QAAQ,CAAC,IAAI,CAAC;EAE9C,MAAMI,aAAa,GAAGL,WAAW,CAAC,MAAM;IACtCI,WAAW,CAAEE,QAAQ,IAAK,CAACA,QAAQ,CAAC;EACtC,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEH,QAAQ;IAAEE;EAAc,CAAC;AACpC,CAAC;AAED,OAAO,MAAME,6BAA6B,GAAGA,CAAA,KAAM;EACjD,MAAM,CAACC,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGR,QAAQ,
|
|
1
|
+
{"version":3,"names":["useCallback","useState","useCredentialCardExpanded","expanded","setExpanded","onHeaderPress","oldValue","useCredentialListExpandedCard","expandedCredential","setExpandedCredential","initialized","setInitialized","credentialId","undefined","setInitialCredential","foldCards"],"sources":["credential-card-expanding.tsx"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nexport const useCredentialCardExpanded = () => {\n const [expanded, setExpanded] = useState(true);\n\n const onHeaderPress = useCallback(() => {\n setExpanded((oldValue) => !oldValue);\n }, []);\n\n return { expanded, onHeaderPress };\n};\n\nexport const useCredentialListExpandedCard = () => {\n const [expandedCredential, setExpandedCredential] = useState<string>();\n const [initialized, setInitialized] = useState(false);\n\n const onHeaderPress = useCallback((credentialId?: string) => {\n if (!credentialId) {\n return;\n }\n setInitialized(true);\n setExpandedCredential((oldValue) => {\n if (credentialId === oldValue) {\n return undefined;\n }\n return credentialId;\n });\n }, []);\n\n const setInitialCredential = useCallback(\n (credentialId: string) => {\n if (!initialized) {\n setExpandedCredential(credentialId);\n }\n setInitialized(true);\n },\n [initialized],\n );\n\n const foldCards = useCallback(() => {\n setExpandedCredential(undefined);\n }, []);\n\n return { expandedCredential, foldCards, onHeaderPress, setInitialCredential };\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EAC7C,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGH,QAAQ,CAAC,IAAI,CAAC;EAE9C,MAAMI,aAAa,GAAGL,WAAW,CAAC,MAAM;IACtCI,WAAW,CAAEE,QAAQ,IAAK,CAACA,QAAQ,CAAC;EACtC,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEH,QAAQ;IAAEE;EAAc,CAAC;AACpC,CAAC;AAED,OAAO,MAAME,6BAA6B,GAAGA,CAAA,KAAM;EACjD,MAAM,CAACC,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGR,QAAQ,CAAS,CAAC;EACtE,MAAM,CAACS,WAAW,EAAEC,cAAc,CAAC,GAAGV,QAAQ,CAAC,KAAK,CAAC;EAErD,MAAMI,aAAa,GAAGL,WAAW,CAAEY,YAAqB,IAAK;IAC3D,IAAI,CAACA,YAAY,EAAE;MACjB;IACF;IACAD,cAAc,CAAC,IAAI,CAAC;IACpBF,qBAAqB,CAAEH,QAAQ,IAAK;MAClC,IAAIM,YAAY,KAAKN,QAAQ,EAAE;QAC7B,OAAOO,SAAS;MAClB;MACA,OAAOD,YAAY;IACrB,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,oBAAoB,GAAGd,WAAW,CACrCY,YAAoB,IAAK;IACxB,IAAI,CAACF,WAAW,EAAE;MAChBD,qBAAqB,CAACG,YAAY,CAAC;IACrC;IACAD,cAAc,CAAC,IAAI,CAAC;EACtB,CAAC,EACD,CAACD,WAAW,CACd,CAAC;EAED,MAAMK,SAAS,GAAGf,WAAW,CAAC,MAAM;IAClCS,qBAAqB,CAACI,SAAS,CAAC;EAClC,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEL,kBAAkB;IAAEO,SAAS;IAAEV,aAAa;IAAES;EAAqB,CAAC;AAC/E,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useCallback, useState } from 'react';
|
|
2
|
-
export const useOnScrollHeaderState =
|
|
3
|
-
let offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 30;
|
|
2
|
+
export const useOnScrollHeaderState = (offset = 30) => {
|
|
4
3
|
const [titleVisible, setTitleVisible] = useState(false);
|
|
5
4
|
const onScroll = useCallback(event => {
|
|
6
5
|
const scrollOffset = event.nativeEvent.contentOffset.y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useState","useOnScrollHeaderState","offset","
|
|
1
|
+
{"version":3,"names":["useCallback","useState","useOnScrollHeaderState","offset","titleVisible","setTitleVisible","onScroll","event","scrollOffset","nativeEvent","contentOffset","y"],"sources":["on-scroll-header-state.tsx"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';\n\nexport const useOnScrollHeaderState = (offset = 30) => {\n const [titleVisible, setTitleVisible] = useState(false);\n\n const onScroll = useCallback(\n (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n const scrollOffset = event.nativeEvent.contentOffset.y;\n setTitleVisible(scrollOffset > offset);\n },\n [offset],\n );\n\n return { onScroll, titleVisible };\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAG7C,OAAO,MAAMC,sBAAsB,GAAGA,CAACC,MAAM,GAAG,EAAE,KAAK;EACrD,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGJ,QAAQ,CAAC,KAAK,CAAC;EAEvD,MAAMK,QAAQ,GAAGN,WAAW,CACzBO,KAA8C,IAAK;IAClD,MAAMC,YAAY,GAAGD,KAAK,CAACE,WAAW,CAACC,aAAa,CAACC,CAAC;IACtDN,eAAe,CAACG,YAAY,GAAGL,MAAM,CAAC;EACxC,CAAC,EACD,CAACA,MAAM,CACT,CAAC;EAED,OAAO;IAAEG,QAAQ;IAAEF;EAAa,CAAC;AACnC,CAAC","ignoreList":[]}
|