@procivis/one-react-native-components 0.2.54 → 0.3.27

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.
Files changed (889) hide show
  1. package/README.md +3 -8
  2. package/lib/commonjs/components/backup/index.js.map +1 -1
  3. package/lib/commonjs/components/backup/preview-credentials.js +18 -22
  4. package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
  5. package/lib/commonjs/components/credential/credential.js +11 -12
  6. package/lib/commonjs/components/credential/credential.js.map +1 -1
  7. package/lib/commonjs/components/credential/index.js.map +1 -1
  8. package/lib/commonjs/components/entity/EntityButtons.js +20 -25
  9. package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
  10. package/lib/commonjs/components/entity/entity-attributes.js +16 -18
  11. package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
  12. package/lib/commonjs/components/entity/entity-details-with-buttons.js +31 -23
  13. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  14. package/lib/commonjs/components/entity/entity-details.js +30 -31
  15. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  16. package/lib/commonjs/components/entity/index.js +2 -2
  17. package/lib/commonjs/components/entity/index.js.map +1 -1
  18. package/lib/commonjs/components/history/history-details-screen.js +67 -0
  19. package/lib/commonjs/components/history/history-details-screen.js.map +1 -0
  20. package/lib/commonjs/components/history/history-list-item-icon.js +97 -0
  21. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -0
  22. package/lib/commonjs/components/history/history-list-item.js +55 -0
  23. package/lib/commonjs/components/history/history-list-item.js.map +1 -0
  24. package/lib/commonjs/components/history/history-list-screen.js +123 -0
  25. package/lib/commonjs/components/history/history-list-screen.js.map +1 -0
  26. package/lib/commonjs/components/history/history-list-section-header.js +39 -0
  27. package/lib/commonjs/components/history/history-list-section-header.js.map +1 -0
  28. package/lib/commonjs/components/history/history-list.js +100 -0
  29. package/lib/commonjs/components/history/history-list.js.map +1 -0
  30. package/lib/commonjs/components/history/index.js +72 -0
  31. package/lib/commonjs/components/history/index.js.map +1 -0
  32. package/lib/commonjs/components/index.js +11 -0
  33. package/lib/commonjs/components/index.js.map +1 -1
  34. package/lib/commonjs/components/navigation/header-buttons.js +21 -25
  35. package/lib/commonjs/components/navigation/header-buttons.js.map +1 -1
  36. package/lib/commonjs/components/navigation/index.js.map +1 -1
  37. package/lib/commonjs/components/proof-request/group.js +4 -5
  38. package/lib/commonjs/components/proof-request/group.js.map +1 -1
  39. package/lib/commonjs/components/proof-request/index.js.map +1 -1
  40. package/lib/commonjs/components/proof-request/select-credential.js +11 -12
  41. package/lib/commonjs/components/proof-request/select-credential.js.map +1 -1
  42. package/lib/commonjs/components/proof-request/share-credential.js +25 -28
  43. package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/normalize-color.d.js.map +1 -1
  46. package/lib/commonjs/ui-components/accessibility/accessibility.js +11 -7
  47. package/lib/commonjs/ui-components/accessibility/accessibility.js.map +1 -1
  48. package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js +8 -12
  49. package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js.map +1 -1
  50. package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js +15 -17
  51. package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  52. package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js +8 -10
  53. package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
  54. package/lib/commonjs/ui-components/accessibility/index.js +1 -30
  55. package/lib/commonjs/ui-components/accessibility/index.js.map +1 -1
  56. package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -3
  57. package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
  58. package/lib/commonjs/ui-components/accessibility/locale.test.js.map +1 -1
  59. package/lib/commonjs/ui-components/action-modal/ActionModal.js +9 -11
  60. package/lib/commonjs/ui-components/action-modal/ActionModal.js.map +1 -1
  61. package/lib/commonjs/ui-components/action-modal/index.js +1 -1
  62. package/lib/commonjs/ui-components/action-modal/index.js.map +1 -1
  63. package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js +10 -12
  64. package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js.map +1 -1
  65. package/lib/commonjs/ui-components/activity-indicator/index.js +1 -1
  66. package/lib/commonjs/ui-components/activity-indicator/index.js.map +1 -1
  67. package/lib/commonjs/ui-components/blur/blur-view.js +13 -15
  68. package/lib/commonjs/ui-components/blur/blur-view.js.map +1 -1
  69. package/lib/commonjs/ui-components/blur/index.js +2 -2
  70. package/lib/commonjs/ui-components/blur/index.js.map +1 -1
  71. package/lib/commonjs/ui-components/buttons/back-button.js +12 -15
  72. package/lib/commonjs/ui-components/buttons/back-button.js.map +1 -1
  73. package/lib/commonjs/ui-components/buttons/button.js +19 -22
  74. package/lib/commonjs/ui-components/buttons/button.js.map +1 -1
  75. package/lib/commonjs/ui-components/buttons/connectivity-button.js +16 -18
  76. package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -1
  77. package/lib/commonjs/ui-components/buttons/filter-button.js +8 -10
  78. package/lib/commonjs/ui-components/buttons/filter-button.js.map +1 -1
  79. package/lib/commonjs/ui-components/buttons/ghost-button.js +12 -14
  80. package/lib/commonjs/ui-components/buttons/ghost-button.js.map +1 -1
  81. package/lib/commonjs/ui-components/buttons/hold-button.js +244 -0
  82. package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -0
  83. package/lib/commonjs/ui-components/buttons/index.js +9 -37
  84. package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
  85. package/lib/commonjs/ui-components/buttons/scan-button.js +7 -9
  86. package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
  87. package/lib/commonjs/ui-components/camera/camera-overlay.js +11 -14
  88. package/lib/commonjs/ui-components/camera/camera-overlay.js.map +1 -1
  89. package/lib/commonjs/ui-components/camera/index.js +2 -2
  90. package/lib/commonjs/ui-components/camera/index.js.map +1 -1
  91. package/lib/commonjs/ui-components/camera/qr-code-scanner.js +12 -14
  92. package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
  93. package/lib/commonjs/ui-components/control/checkbox.js +11 -12
  94. package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
  95. package/lib/commonjs/ui-components/control/index.js.map +1 -1
  96. package/lib/commonjs/ui-components/control/switch.js +10 -12
  97. package/lib/commonjs/ui-components/control/switch.js.map +1 -1
  98. package/lib/commonjs/ui-components/credential/card/credential-card.js +22 -26
  99. package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
  100. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +30 -35
  101. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  102. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +27 -20
  103. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  104. package/lib/commonjs/ui-components/credential/card/credential-header.js +25 -24
  105. package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
  106. package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +27 -29
  107. package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -1
  108. package/lib/commonjs/ui-components/credential/card/index.js +6 -41
  109. package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
  110. package/lib/commonjs/ui-components/credential/credential-attribute-item.js +51 -60
  111. package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
  112. package/lib/commonjs/ui-components/credential/credential-carousel-images.js +18 -21
  113. package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
  114. package/lib/commonjs/ui-components/credential/index.js +2 -25
  115. package/lib/commonjs/ui-components/credential/index.js.map +1 -1
  116. package/lib/commonjs/ui-components/credential/selector-status.js +3 -4
  117. package/lib/commonjs/ui-components/credential/selector-status.js.map +1 -1
  118. package/lib/commonjs/ui-components/credential/selector.js +8 -10
  119. package/lib/commonjs/ui-components/credential/selector.js.map +1 -1
  120. package/lib/commonjs/ui-components/detail/detail.js +12 -14
  121. package/lib/commonjs/ui-components/detail/detail.js.map +1 -1
  122. package/lib/commonjs/ui-components/detail/index.js +1 -1
  123. package/lib/commonjs/ui-components/detail/index.js.map +1 -1
  124. package/lib/commonjs/ui-components/entity/avatar.js +14 -16
  125. package/lib/commonjs/ui-components/entity/avatar.js.map +1 -1
  126. package/lib/commonjs/ui-components/entity/entity-cluster.js +16 -19
  127. package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
  128. package/lib/commonjs/ui-components/entity/index.js +2 -2
  129. package/lib/commonjs/ui-components/entity/index.js.map +1 -1
  130. package/lib/commonjs/ui-components/header/focus-aware-status-bar.js +3 -4
  131. package/lib/commonjs/ui-components/header/focus-aware-status-bar.js.map +1 -1
  132. package/lib/commonjs/ui-components/header/foldable-header.js +14 -17
  133. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  134. package/lib/commonjs/ui-components/header/header.js +12 -14
  135. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  136. package/lib/commonjs/ui-components/header/index.js +4 -24
  137. package/lib/commonjs/ui-components/header/index.js.map +1 -1
  138. package/lib/commonjs/ui-components/header/navigation-header.js +27 -33
  139. package/lib/commonjs/ui-components/header/navigation-header.js.map +1 -1
  140. package/lib/commonjs/ui-components/history/data-item.js +30 -23
  141. package/lib/commonjs/ui-components/history/data-item.js.map +1 -1
  142. package/lib/commonjs/ui-components/history/history-details.js +181 -0
  143. package/lib/commonjs/ui-components/history/history-details.js.map +1 -0
  144. package/lib/commonjs/ui-components/history/{history-list-item.js → history-item.js} +47 -26
  145. package/lib/commonjs/ui-components/history/history-item.js.map +1 -0
  146. package/lib/commonjs/ui-components/history/history-section-header.js +7 -9
  147. package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
  148. package/lib/commonjs/ui-components/history/history-section-list-item.js +13 -12
  149. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  150. package/lib/commonjs/ui-components/history/index.js +30 -9
  151. package/lib/commonjs/ui-components/history/index.js.map +1 -1
  152. package/lib/commonjs/ui-components/icons/connectivity.js +19 -24
  153. package/lib/commonjs/ui-components/icons/connectivity.js.map +1 -1
  154. package/lib/commonjs/ui-components/icons/credential.js +60 -71
  155. package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
  156. package/lib/commonjs/ui-components/icons/entity.js +36 -9
  157. package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
  158. package/lib/commonjs/ui-components/icons/history.js +115 -133
  159. package/lib/commonjs/ui-components/icons/history.js.map +1 -1
  160. package/lib/commonjs/ui-components/icons/icons.js +73 -90
  161. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  162. package/lib/commonjs/ui-components/icons/index.js.map +1 -1
  163. package/lib/commonjs/ui-components/icons/input.js +3 -3
  164. package/lib/commonjs/ui-components/icons/input.js.map +1 -1
  165. package/lib/commonjs/ui-components/icons/keypad.js +69 -81
  166. package/lib/commonjs/ui-components/icons/keypad.js.map +1 -1
  167. package/lib/commonjs/ui-components/icons/loader.js +4 -4
  168. package/lib/commonjs/ui-components/icons/loader.js.map +1 -1
  169. package/lib/commonjs/ui-components/icons/nerd-view.js +6 -9
  170. package/lib/commonjs/ui-components/icons/nerd-view.js.map +1 -1
  171. package/lib/commonjs/ui-components/icons/selector.js +8 -9
  172. package/lib/commonjs/ui-components/icons/selector.js.map +1 -1
  173. package/lib/commonjs/ui-components/icons/wallet.js +16 -19
  174. package/lib/commonjs/ui-components/icons/wallet.js.map +1 -1
  175. package/lib/commonjs/ui-components/image/image-or-component.js +15 -18
  176. package/lib/commonjs/ui-components/image/image-or-component.js.map +1 -1
  177. package/lib/commonjs/ui-components/image/index.js +2 -9
  178. package/lib/commonjs/ui-components/image/index.js.map +1 -1
  179. package/lib/commonjs/ui-components/index.js.map +1 -1
  180. package/lib/commonjs/ui-components/input/index.js +2 -2
  181. package/lib/commonjs/ui-components/input/index.js.map +1 -1
  182. package/lib/commonjs/ui-components/input/radio-group.js +28 -25
  183. package/lib/commonjs/ui-components/input/radio-group.js.map +1 -1
  184. package/lib/commonjs/ui-components/input/selection-input.js +27 -38
  185. package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
  186. package/lib/commonjs/ui-components/input/text-input.js +25 -28
  187. package/lib/commonjs/ui-components/input/text-input.js.map +1 -1
  188. package/lib/commonjs/ui-components/list/index.js +20 -2
  189. package/lib/commonjs/ui-components/list/index.js.map +1 -1
  190. package/lib/commonjs/ui-components/list/list-page-loading-indicator.js +14 -0
  191. package/lib/commonjs/ui-components/list/list-page-loading-indicator.js.map +1 -0
  192. package/lib/commonjs/ui-components/list/list-section-header.js +10 -12
  193. package/lib/commonjs/ui-components/list/list-section-header.js.map +1 -1
  194. package/lib/commonjs/ui-components/list/list-title-header.js +6 -8
  195. package/lib/commonjs/ui-components/list/list-title-header.js.map +1 -1
  196. package/lib/commonjs/ui-components/list/wallet/empty-list.js +73 -0
  197. package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -0
  198. package/lib/commonjs/ui-components/list/wallet/empty-search-result.js +41 -0
  199. package/lib/commonjs/ui-components/list/wallet/empty-search-result.js.map +1 -0
  200. package/lib/commonjs/ui-components/list/wallet/index.js +21 -0
  201. package/lib/commonjs/ui-components/list/wallet/index.js.map +1 -0
  202. package/lib/commonjs/ui-components/loader/index.js +2 -2
  203. package/lib/commonjs/ui-components/loader/index.js.map +1 -1
  204. package/lib/commonjs/ui-components/loader/loader.js +17 -17
  205. package/lib/commonjs/ui-components/loader/loader.js.map +1 -1
  206. package/lib/commonjs/ui-components/loader/loading-result.js +22 -21
  207. package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
  208. package/lib/commonjs/ui-components/nerd-view/index.js +2 -8
  209. package/lib/commonjs/ui-components/nerd-view/index.js.map +1 -1
  210. package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js +37 -41
  211. package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
  212. package/lib/commonjs/ui-components/pin/index.js +2 -2
  213. package/lib/commonjs/ui-components/pin/index.js.map +1 -1
  214. package/lib/commonjs/ui-components/pin/keypad.js +19 -23
  215. package/lib/commonjs/ui-components/pin/keypad.js.map +1 -1
  216. package/lib/commonjs/ui-components/pin/pin-code-screen.js +19 -21
  217. package/lib/commonjs/ui-components/pin/pin-code-screen.js.map +1 -1
  218. package/lib/commonjs/ui-components/pin/pin-lock-animation.js +1 -2
  219. package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
  220. package/lib/commonjs/ui-components/pin/pin-lock.js +10 -12
  221. package/lib/commonjs/ui-components/pin/pin-lock.js.map +1 -1
  222. package/lib/commonjs/ui-components/pin/pins.js +8 -9
  223. package/lib/commonjs/ui-components/pin/pins.js.map +1 -1
  224. package/lib/commonjs/ui-components/screens/backup-screen.js +15 -18
  225. package/lib/commonjs/ui-components/screens/backup-screen.js.map +1 -1
  226. package/lib/commonjs/ui-components/screens/image-preview-screen.js +12 -14
  227. package/lib/commonjs/ui-components/screens/image-preview-screen.js.map +1 -1
  228. package/lib/commonjs/ui-components/screens/index.js +8 -49
  229. package/lib/commonjs/ui-components/screens/index.js.map +1 -1
  230. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +35 -42
  231. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  232. package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js +14 -16
  233. package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
  234. package/lib/commonjs/ui-components/screens/scroll-view-screen.js +12 -14
  235. package/lib/commonjs/ui-components/screens/scroll-view-screen.js.map +1 -1
  236. package/lib/commonjs/ui-components/screens/section-list-screen.js +13 -15
  237. package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
  238. package/lib/commonjs/ui-components/searchbar/animated-search-bar.js +10 -12
  239. package/lib/commonjs/ui-components/searchbar/animated-search-bar.js.map +1 -1
  240. package/lib/commonjs/ui-components/searchbar/index.js +2 -2
  241. package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
  242. package/lib/commonjs/ui-components/searchbar/search-bar.js +15 -17
  243. package/lib/commonjs/ui-components/searchbar/search-bar.js.map +1 -1
  244. package/lib/commonjs/ui-components/settings/button-setting.js +14 -16
  245. package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
  246. package/lib/commonjs/ui-components/settings/index.js +2 -2
  247. package/lib/commonjs/ui-components/settings/index.js.map +1 -1
  248. package/lib/commonjs/ui-components/settings/setting-item-separator.js +6 -8
  249. package/lib/commonjs/ui-components/settings/setting-item-separator.js.map +1 -1
  250. package/lib/commonjs/ui-components/settings/setting-item.js +11 -13
  251. package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
  252. package/lib/commonjs/ui-components/settings/settings-button.js +7 -9
  253. package/lib/commonjs/ui-components/settings/settings-button.js.map +1 -1
  254. package/lib/commonjs/ui-components/settings/switch-setting.js +11 -13
  255. package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
  256. package/lib/commonjs/ui-components/state/error-screen.js +10 -12
  257. package/lib/commonjs/ui-components/state/error-screen.js.map +1 -1
  258. package/lib/commonjs/ui-components/state/index.js +2 -2
  259. package/lib/commonjs/ui-components/state/index.js.map +1 -1
  260. package/lib/commonjs/ui-components/text/base.js +14 -16
  261. package/lib/commonjs/ui-components/text/base.js.map +1 -1
  262. package/lib/commonjs/ui-components/text/font.js +11 -13
  263. package/lib/commonjs/ui-components/text/font.js.map +1 -1
  264. package/lib/commonjs/ui-components/text/index.js +2 -9
  265. package/lib/commonjs/ui-components/text/index.js.map +1 -1
  266. package/lib/commonjs/ui-components/text/typography.js +10 -13
  267. package/lib/commonjs/ui-components/text/typography.js.map +1 -1
  268. package/lib/commonjs/ui-components/theme/color-scheme-context.js +2 -1
  269. package/lib/commonjs/ui-components/theme/color-scheme-context.js.map +1 -1
  270. package/lib/commonjs/ui-components/theme/color-scheme.js.map +1 -1
  271. package/lib/commonjs/ui-components/theme/index.js.map +1 -1
  272. package/lib/commonjs/utils/array.js.map +1 -1
  273. package/lib/commonjs/utils/backup.js.map +1 -1
  274. package/lib/commonjs/utils/color.js +1 -1
  275. package/lib/commonjs/utils/color.js.map +1 -1
  276. package/lib/commonjs/utils/contrasting-status-bar.js +8 -10
  277. package/lib/commonjs/utils/contrasting-status-bar.js.map +1 -1
  278. package/lib/commonjs/utils/date.js +3 -3
  279. package/lib/commonjs/utils/date.js.map +1 -1
  280. package/lib/commonjs/utils/filtering.js +11 -0
  281. package/lib/commonjs/utils/filtering.js.map +1 -0
  282. package/lib/commonjs/utils/history.js +76 -0
  283. package/lib/commonjs/utils/history.js.map +1 -0
  284. package/lib/commonjs/utils/hooks/connectivity/connectivity.js +37 -23
  285. package/lib/commonjs/utils/hooks/connectivity/connectivity.js.map +1 -1
  286. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +6 -0
  287. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  288. package/lib/commonjs/utils/hooks/core/backup.js +31 -31
  289. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  290. package/lib/commonjs/utils/hooks/core/cache.js +44 -0
  291. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -0
  292. package/lib/commonjs/utils/hooks/core/core-config.js +15 -1
  293. package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
  294. package/lib/commonjs/utils/hooks/core/core-context.js +15 -10
  295. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  296. package/lib/commonjs/utils/hooks/core/core-init.js +44 -34
  297. package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
  298. package/lib/commonjs/utils/hooks/core/credential-schemas.js +16 -27
  299. package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
  300. package/lib/commonjs/utils/hooks/core/credentials.js +28 -37
  301. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  302. package/lib/commonjs/utils/hooks/core/dids.js +4 -6
  303. package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
  304. package/lib/commonjs/utils/hooks/core/error-code.js +3 -4
  305. package/lib/commonjs/utils/hooks/core/error-code.js.map +1 -1
  306. package/lib/commonjs/utils/hooks/core/history.js +5 -37
  307. package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
  308. package/lib/commonjs/utils/hooks/core/identifiers.js +20 -0
  309. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -0
  310. package/lib/commonjs/utils/hooks/core/index.js +22 -0
  311. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  312. package/lib/commonjs/utils/hooks/core/proof-schemas.js +23 -38
  313. package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
  314. package/lib/commonjs/utils/hooks/core/proofs.js +108 -76
  315. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  316. package/lib/commonjs/utils/hooks/core/query.js +1 -2
  317. package/lib/commonjs/utils/hooks/core/query.js.map +1 -1
  318. package/lib/commonjs/utils/hooks/core/trust-entity.js +17 -7
  319. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  320. package/lib/commonjs/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
  321. package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js +1 -2
  322. package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js.map +1 -1
  323. package/lib/commonjs/utils/hooks/http/client.js.map +1 -1
  324. package/lib/commonjs/utils/hooks/index.js.map +1 -1
  325. package/lib/commonjs/utils/hooks/list/list-content-inset.js +9 -10
  326. package/lib/commonjs/utils/hooks/list/list-content-inset.js.map +1 -1
  327. package/lib/commonjs/utils/hooks/navigation/before-remove.js.map +1 -1
  328. package/lib/commonjs/utils/hooks/navigation/close-button-timeout.js.map +1 -1
  329. package/lib/commonjs/utils/hooks/navigation/deep-link.js +3 -4
  330. package/lib/commonjs/utils/hooks/navigation/deep-link.js.map +1 -1
  331. package/lib/commonjs/utils/hooks/navigation/index.js.map +1 -1
  332. package/lib/commonjs/utils/hooks/navigation/open-settings.js +1 -2
  333. package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
  334. package/lib/commonjs/utils/hooks/pin-security/pin-security.js +1 -2
  335. package/lib/commonjs/utils/hooks/pin-security/pin-security.js.map +1 -1
  336. package/lib/commonjs/utils/hooks/revocation/credential-status.js +17 -26
  337. package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
  338. package/lib/commonjs/utils/index.js +37 -1
  339. package/lib/commonjs/utils/index.js.map +1 -1
  340. package/lib/commonjs/utils/navigation.js +5 -5
  341. package/lib/commonjs/utils/navigation.js.map +1 -1
  342. package/lib/commonjs/utils/parsers/credential-images.js +1 -1
  343. package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
  344. package/lib/commonjs/utils/parsers/credential-sharing.js +24 -25
  345. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  346. package/lib/commonjs/utils/parsers/credential.js +23 -26
  347. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  348. package/lib/commonjs/utils/parsers/index.js +11 -0
  349. package/lib/commonjs/utils/parsers/index.js.map +1 -1
  350. package/lib/commonjs/utils/parsers/query.js +4 -3
  351. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  352. package/lib/commonjs/utils/parsers/universal-links.js +33 -0
  353. package/lib/commonjs/utils/parsers/universal-links.js.map +1 -0
  354. package/lib/commonjs/utils/parsers/universal-links.test.js +40 -0
  355. package/lib/commonjs/utils/parsers/universal-links.test.js.map +1 -0
  356. package/lib/commonjs/utils/ref.js.map +1 -1
  357. package/lib/commonjs/utils/reporting.js +4 -2
  358. package/lib/commonjs/utils/reporting.js.map +1 -1
  359. package/lib/commonjs/utils/string.js.map +1 -1
  360. package/lib/commonjs/utils/testID.js +1 -4
  361. package/lib/commonjs/utils/testID.js.map +1 -1
  362. package/lib/commonjs/utils/testID.test.js.map +1 -1
  363. package/lib/commonjs/utils/useMemoAsync.js +9 -0
  364. package/lib/commonjs/utils/useMemoAsync.js.map +1 -1
  365. package/lib/commonjs/utils/uuid.js +1 -1
  366. package/lib/commonjs/utils/uuid.js.map +1 -1
  367. package/lib/module/components/backup/index.js.map +1 -1
  368. package/lib/module/components/backup/preview-credentials.js +17 -21
  369. package/lib/module/components/backup/preview-credentials.js.map +1 -1
  370. package/lib/module/components/credential/credential.js +10 -11
  371. package/lib/module/components/credential/credential.js.map +1 -1
  372. package/lib/module/components/credential/index.js.map +1 -1
  373. package/lib/module/components/entity/EntityButtons.js +17 -21
  374. package/lib/module/components/entity/EntityButtons.js.map +1 -1
  375. package/lib/module/components/entity/entity-attributes.js +13 -14
  376. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  377. package/lib/module/components/entity/entity-details-with-buttons.js +29 -20
  378. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  379. package/lib/module/components/entity/entity-details.js +28 -28
  380. package/lib/module/components/entity/entity-details.js.map +1 -1
  381. package/lib/module/components/entity/index.js.map +1 -1
  382. package/lib/module/components/history/history-details-screen.js +59 -0
  383. package/lib/module/components/history/history-details-screen.js.map +1 -0
  384. package/lib/module/components/history/history-list-item-icon.js +87 -0
  385. package/lib/module/components/history/history-list-item-icon.js.map +1 -0
  386. package/lib/module/components/history/history-list-item.js +46 -0
  387. package/lib/module/components/history/history-list-item.js.map +1 -0
  388. package/lib/module/components/history/history-list-screen.js +114 -0
  389. package/lib/module/components/history/history-list-screen.js.map +1 -0
  390. package/lib/module/components/history/history-list-section-header.js +29 -0
  391. package/lib/module/components/history/history-list-section-header.js.map +1 -0
  392. package/lib/module/components/history/history-list.js +90 -0
  393. package/lib/module/components/history/history-list.js.map +1 -0
  394. package/lib/module/components/history/index.js +7 -0
  395. package/lib/module/components/history/index.js.map +1 -0
  396. package/lib/module/components/index.js +1 -0
  397. package/lib/module/components/index.js.map +1 -1
  398. package/lib/module/components/navigation/header-buttons.js +19 -23
  399. package/lib/module/components/navigation/header-buttons.js.map +1 -1
  400. package/lib/module/components/navigation/index.js.map +1 -1
  401. package/lib/module/components/proof-request/group.js +3 -4
  402. package/lib/module/components/proof-request/group.js.map +1 -1
  403. package/lib/module/components/proof-request/index.js.map +1 -1
  404. package/lib/module/components/proof-request/select-credential.js +10 -11
  405. package/lib/module/components/proof-request/select-credential.js.map +1 -1
  406. package/lib/module/components/proof-request/share-credential.js +23 -26
  407. package/lib/module/components/proof-request/share-credential.js.map +1 -1
  408. package/lib/module/index.js.map +1 -1
  409. package/lib/module/normalize-color.d.js.map +1 -1
  410. package/lib/module/ui-components/accessibility/accessibility.js +5 -7
  411. package/lib/module/ui-components/accessibility/accessibility.js.map +1 -1
  412. package/lib/module/ui-components/accessibility/accessibilityHistory.js +4 -8
  413. package/lib/module/ui-components/accessibility/accessibilityHistory.js.map +1 -1
  414. package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js +10 -8
  415. package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  416. package/lib/module/ui-components/accessibility/accessibilityLanguage.js +6 -8
  417. package/lib/module/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
  418. package/lib/module/ui-components/accessibility/index.js +4 -4
  419. package/lib/module/ui-components/accessibility/index.js.map +1 -1
  420. package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
  421. package/lib/module/ui-components/accessibility/locale.test.js.map +1 -1
  422. package/lib/module/ui-components/action-modal/ActionModal.js +7 -8
  423. package/lib/module/ui-components/action-modal/ActionModal.js.map +1 -1
  424. package/lib/module/ui-components/action-modal/index.js.map +1 -1
  425. package/lib/module/ui-components/activity-indicator/activity-indicator.js +6 -7
  426. package/lib/module/ui-components/activity-indicator/activity-indicator.js.map +1 -1
  427. package/lib/module/ui-components/activity-indicator/index.js.map +1 -1
  428. package/lib/module/ui-components/blur/blur-view.js +10 -11
  429. package/lib/module/ui-components/blur/blur-view.js.map +1 -1
  430. package/lib/module/ui-components/blur/index.js.map +1 -1
  431. package/lib/module/ui-components/buttons/back-button.js +10 -11
  432. package/lib/module/ui-components/buttons/back-button.js.map +1 -1
  433. package/lib/module/ui-components/buttons/button.js +17 -18
  434. package/lib/module/ui-components/buttons/button.js.map +1 -1
  435. package/lib/module/ui-components/buttons/connectivity-button.js +14 -14
  436. package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -1
  437. package/lib/module/ui-components/buttons/filter-button.js +6 -7
  438. package/lib/module/ui-components/buttons/filter-button.js.map +1 -1
  439. package/lib/module/ui-components/buttons/ghost-button.js +9 -10
  440. package/lib/module/ui-components/buttons/ghost-button.js.map +1 -1
  441. package/lib/module/ui-components/buttons/hold-button.js +236 -0
  442. package/lib/module/ui-components/buttons/hold-button.js.map +1 -0
  443. package/lib/module/ui-components/buttons/index.js +8 -7
  444. package/lib/module/ui-components/buttons/index.js.map +1 -1
  445. package/lib/module/ui-components/buttons/scan-button.js +5 -6
  446. package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
  447. package/lib/module/ui-components/camera/camera-overlay.js +7 -9
  448. package/lib/module/ui-components/camera/camera-overlay.js.map +1 -1
  449. package/lib/module/ui-components/camera/index.js.map +1 -1
  450. package/lib/module/ui-components/camera/qr-code-scanner.js +8 -9
  451. package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
  452. package/lib/module/ui-components/control/checkbox.js +9 -10
  453. package/lib/module/ui-components/control/checkbox.js.map +1 -1
  454. package/lib/module/ui-components/control/index.js.map +1 -1
  455. package/lib/module/ui-components/control/switch.js +8 -9
  456. package/lib/module/ui-components/control/switch.js.map +1 -1
  457. package/lib/module/ui-components/credential/card/credential-card.js +16 -17
  458. package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
  459. package/lib/module/ui-components/credential/card/credential-details-card.js +26 -30
  460. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  461. package/lib/module/ui-components/credential/card/credential-details-list-item.js +23 -15
  462. package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  463. package/lib/module/ui-components/credential/card/credential-header.js +21 -19
  464. package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
  465. package/lib/module/ui-components/credential/card/credential-image-carousel.js +23 -23
  466. package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -1
  467. package/lib/module/ui-components/credential/card/index.js +10 -10
  468. package/lib/module/ui-components/credential/card/index.js.map +1 -1
  469. package/lib/module/ui-components/credential/credential-attribute-item.js +47 -55
  470. package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
  471. package/lib/module/ui-components/credential/credential-carousel-images.js +15 -18
  472. package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
  473. package/lib/module/ui-components/credential/index.js +2 -2
  474. package/lib/module/ui-components/credential/index.js.map +1 -1
  475. package/lib/module/ui-components/credential/selector-status.js +3 -3
  476. package/lib/module/ui-components/credential/selector-status.js.map +1 -1
  477. package/lib/module/ui-components/credential/selector.js +5 -6
  478. package/lib/module/ui-components/credential/selector.js.map +1 -1
  479. package/lib/module/ui-components/detail/detail.js +9 -10
  480. package/lib/module/ui-components/detail/detail.js.map +1 -1
  481. package/lib/module/ui-components/detail/index.js.map +1 -1
  482. package/lib/module/ui-components/entity/avatar.js +10 -11
  483. package/lib/module/ui-components/entity/avatar.js.map +1 -1
  484. package/lib/module/ui-components/entity/entity-cluster.js +12 -14
  485. package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
  486. package/lib/module/ui-components/entity/index.js.map +1 -1
  487. package/lib/module/ui-components/header/focus-aware-status-bar.js +1 -1
  488. package/lib/module/ui-components/header/focus-aware-status-bar.js.map +1 -1
  489. package/lib/module/ui-components/header/foldable-header.js +10 -12
  490. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  491. package/lib/module/ui-components/header/header.js +10 -11
  492. package/lib/module/ui-components/header/header.js.map +1 -1
  493. package/lib/module/ui-components/header/index.js +6 -6
  494. package/lib/module/ui-components/header/index.js.map +1 -1
  495. package/lib/module/ui-components/header/navigation-header.js +23 -28
  496. package/lib/module/ui-components/header/navigation-header.js.map +1 -1
  497. package/lib/module/ui-components/history/data-item.js +23 -15
  498. package/lib/module/ui-components/history/data-item.js.map +1 -1
  499. package/lib/module/ui-components/history/history-details.js +171 -0
  500. package/lib/module/ui-components/history/history-details.js.map +1 -0
  501. package/lib/module/ui-components/history/{history-list-item.js → history-item.js} +44 -22
  502. package/lib/module/ui-components/history/history-item.js.map +1 -0
  503. package/lib/module/ui-components/history/history-section-header.js +6 -7
  504. package/lib/module/ui-components/history/history-section-header.js.map +1 -1
  505. package/lib/module/ui-components/history/history-section-list-item.js +8 -9
  506. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  507. package/lib/module/ui-components/history/index.js +5 -4
  508. package/lib/module/ui-components/history/index.js.map +1 -1
  509. package/lib/module/ui-components/icons/connectivity.js +16 -21
  510. package/lib/module/ui-components/icons/connectivity.js.map +1 -1
  511. package/lib/module/ui-components/icons/credential.js +57 -68
  512. package/lib/module/ui-components/icons/credential.js.map +1 -1
  513. package/lib/module/ui-components/icons/entity.js +31 -5
  514. package/lib/module/ui-components/icons/entity.js.map +1 -1
  515. package/lib/module/ui-components/icons/history.js +103 -128
  516. package/lib/module/ui-components/icons/history.js.map +1 -1
  517. package/lib/module/ui-components/icons/icons.js +70 -87
  518. package/lib/module/ui-components/icons/icons.js.map +1 -1
  519. package/lib/module/ui-components/icons/index.js.map +1 -1
  520. package/lib/module/ui-components/icons/input.js.map +1 -1
  521. package/lib/module/ui-components/icons/keypad.js +66 -78
  522. package/lib/module/ui-components/icons/keypad.js.map +1 -1
  523. package/lib/module/ui-components/icons/loader.js +1 -1
  524. package/lib/module/ui-components/icons/loader.js.map +1 -1
  525. package/lib/module/ui-components/icons/nerd-view.js.map +1 -1
  526. package/lib/module/ui-components/icons/selector.js +5 -6
  527. package/lib/module/ui-components/icons/selector.js.map +1 -1
  528. package/lib/module/ui-components/icons/wallet.js +13 -16
  529. package/lib/module/ui-components/icons/wallet.js.map +1 -1
  530. package/lib/module/ui-components/image/image-or-component.js +12 -14
  531. package/lib/module/ui-components/image/image-or-component.js.map +1 -1
  532. package/lib/module/ui-components/image/index.js +2 -2
  533. package/lib/module/ui-components/image/index.js.map +1 -1
  534. package/lib/module/ui-components/index.js.map +1 -1
  535. package/lib/module/ui-components/input/index.js.map +1 -1
  536. package/lib/module/ui-components/input/radio-group.js +26 -22
  537. package/lib/module/ui-components/input/radio-group.js.map +1 -1
  538. package/lib/module/ui-components/input/selection-input.js +21 -31
  539. package/lib/module/ui-components/input/selection-input.js.map +1 -1
  540. package/lib/module/ui-components/input/text-input.js +21 -22
  541. package/lib/module/ui-components/input/text-input.js.map +1 -1
  542. package/lib/module/ui-components/list/index.js +1 -0
  543. package/lib/module/ui-components/list/index.js.map +1 -1
  544. package/lib/module/ui-components/list/list-page-loading-indicator.js +7 -0
  545. package/lib/module/ui-components/list/list-page-loading-indicator.js.map +1 -0
  546. package/lib/module/ui-components/list/list-section-header.js +8 -9
  547. package/lib/module/ui-components/list/list-section-header.js.map +1 -1
  548. package/lib/module/ui-components/list/list-title-header.js +4 -5
  549. package/lib/module/ui-components/list/list-title-header.js.map +1 -1
  550. package/lib/module/ui-components/list/wallet/empty-list.js +66 -0
  551. package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -0
  552. package/lib/module/ui-components/list/wallet/empty-search-result.js +34 -0
  553. package/lib/module/ui-components/list/wallet/empty-search-result.js.map +1 -0
  554. package/lib/module/ui-components/list/wallet/index.js +4 -0
  555. package/lib/module/ui-components/list/wallet/index.js.map +1 -0
  556. package/lib/module/ui-components/loader/index.js.map +1 -1
  557. package/lib/module/ui-components/loader/loader.js +14 -12
  558. package/lib/module/ui-components/loader/loader.js.map +1 -1
  559. package/lib/module/ui-components/loader/loading-result.js +21 -19
  560. package/lib/module/ui-components/loader/loading-result.js.map +1 -1
  561. package/lib/module/ui-components/nerd-view/index.js +2 -2
  562. package/lib/module/ui-components/nerd-view/index.js.map +1 -1
  563. package/lib/module/ui-components/nerd-view/nerd-mode-item.js +31 -34
  564. package/lib/module/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
  565. package/lib/module/ui-components/pin/index.js.map +1 -1
  566. package/lib/module/ui-components/pin/keypad.js +17 -19
  567. package/lib/module/ui-components/pin/keypad.js.map +1 -1
  568. package/lib/module/ui-components/pin/pin-code-screen.js +16 -17
  569. package/lib/module/ui-components/pin/pin-code-screen.js.map +1 -1
  570. package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
  571. package/lib/module/ui-components/pin/pin-lock.js +6 -7
  572. package/lib/module/ui-components/pin/pin-lock.js.map +1 -1
  573. package/lib/module/ui-components/pin/pins.js +7 -8
  574. package/lib/module/ui-components/pin/pins.js.map +1 -1
  575. package/lib/module/ui-components/screens/backup-screen.js +13 -14
  576. package/lib/module/ui-components/screens/backup-screen.js.map +1 -1
  577. package/lib/module/ui-components/screens/image-preview-screen.js +9 -10
  578. package/lib/module/ui-components/screens/image-preview-screen.js.map +1 -1
  579. package/lib/module/ui-components/screens/index.js +12 -12
  580. package/lib/module/ui-components/screens/index.js.map +1 -1
  581. package/lib/module/ui-components/screens/nerd-mode-screen.js +30 -35
  582. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  583. package/lib/module/ui-components/screens/qr-code-scanner-screen.js +10 -11
  584. package/lib/module/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
  585. package/lib/module/ui-components/screens/scroll-view-screen.js +10 -11
  586. package/lib/module/ui-components/screens/scroll-view-screen.js.map +1 -1
  587. package/lib/module/ui-components/screens/section-list-screen.js +11 -12
  588. package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
  589. package/lib/module/ui-components/searchbar/animated-search-bar.js +6 -7
  590. package/lib/module/ui-components/searchbar/animated-search-bar.js.map +1 -1
  591. package/lib/module/ui-components/searchbar/index.js.map +1 -1
  592. package/lib/module/ui-components/searchbar/search-bar.js +11 -12
  593. package/lib/module/ui-components/searchbar/search-bar.js.map +1 -1
  594. package/lib/module/ui-components/settings/button-setting.js +10 -11
  595. package/lib/module/ui-components/settings/button-setting.js.map +1 -1
  596. package/lib/module/ui-components/settings/index.js.map +1 -1
  597. package/lib/module/ui-components/settings/setting-item-separator.js +4 -5
  598. package/lib/module/ui-components/settings/setting-item-separator.js.map +1 -1
  599. package/lib/module/ui-components/settings/setting-item.js +7 -8
  600. package/lib/module/ui-components/settings/setting-item.js.map +1 -1
  601. package/lib/module/ui-components/settings/settings-button.js +5 -6
  602. package/lib/module/ui-components/settings/settings-button.js.map +1 -1
  603. package/lib/module/ui-components/settings/switch-setting.js +9 -10
  604. package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
  605. package/lib/module/ui-components/state/error-screen.js +7 -8
  606. package/lib/module/ui-components/state/error-screen.js.map +1 -1
  607. package/lib/module/ui-components/state/index.js.map +1 -1
  608. package/lib/module/ui-components/text/base.js +12 -13
  609. package/lib/module/ui-components/text/base.js.map +1 -1
  610. package/lib/module/ui-components/text/font.js +10 -11
  611. package/lib/module/ui-components/text/font.js.map +1 -1
  612. package/lib/module/ui-components/text/index.js +2 -2
  613. package/lib/module/ui-components/text/index.js.map +1 -1
  614. package/lib/module/ui-components/text/typography.js +8 -10
  615. package/lib/module/ui-components/text/typography.js.map +1 -1
  616. package/lib/module/ui-components/theme/color-scheme-context.js +1 -0
  617. package/lib/module/ui-components/theme/color-scheme-context.js.map +1 -1
  618. package/lib/module/ui-components/theme/color-scheme.js.map +1 -1
  619. package/lib/module/ui-components/theme/index.js.map +1 -1
  620. package/lib/module/utils/array.js.map +1 -1
  621. package/lib/module/utils/backup.js.map +1 -1
  622. package/lib/module/utils/color.js.map +1 -1
  623. package/lib/module/utils/contrasting-status-bar.js +5 -6
  624. package/lib/module/utils/contrasting-status-bar.js.map +1 -1
  625. package/lib/module/utils/date.js +4 -4
  626. package/lib/module/utils/date.js.map +1 -1
  627. package/lib/module/utils/filtering.js +4 -0
  628. package/lib/module/utils/filtering.js.map +1 -0
  629. package/lib/module/utils/history.js +66 -0
  630. package/lib/module/utils/history.js.map +1 -0
  631. package/lib/module/utils/hooks/connectivity/connectivity.js +36 -19
  632. package/lib/module/utils/hooks/connectivity/connectivity.js.map +1 -1
  633. package/lib/module/utils/hooks/connectivity/connectivity.test.js +6 -0
  634. package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  635. package/lib/module/utils/hooks/core/backup.js +31 -31
  636. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  637. package/lib/module/utils/hooks/core/cache.js +37 -0
  638. package/lib/module/utils/hooks/core/cache.js.map +1 -0
  639. package/lib/module/utils/hooks/core/core-config.js +11 -0
  640. package/lib/module/utils/hooks/core/core-config.js.map +1 -1
  641. package/lib/module/utils/hooks/core/core-context.js +14 -9
  642. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  643. package/lib/module/utils/hooks/core/core-init.js +42 -30
  644. package/lib/module/utils/hooks/core/core-init.js.map +1 -1
  645. package/lib/module/utils/hooks/core/credential-schemas.js +12 -19
  646. package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
  647. package/lib/module/utils/hooks/core/credentials.js +27 -36
  648. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  649. package/lib/module/utils/hooks/core/dids.js +3 -4
  650. package/lib/module/utils/hooks/core/dids.js.map +1 -1
  651. package/lib/module/utils/hooks/core/error-code.js +3 -3
  652. package/lib/module/utils/hooks/core/error-code.js.map +1 -1
  653. package/lib/module/utils/hooks/core/history.js +4 -35
  654. package/lib/module/utils/hooks/core/history.js.map +1 -1
  655. package/lib/module/utils/hooks/core/identifiers.js +13 -0
  656. package/lib/module/utils/hooks/core/identifiers.js.map +1 -0
  657. package/lib/module/utils/hooks/core/index.js +2 -0
  658. package/lib/module/utils/hooks/core/index.js.map +1 -1
  659. package/lib/module/utils/hooks/core/proof-schemas.js +19 -30
  660. package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
  661. package/lib/module/utils/hooks/core/proofs.js +102 -67
  662. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  663. package/lib/module/utils/hooks/core/query.js.map +1 -1
  664. package/lib/module/utils/hooks/core/trust-entity.js +16 -6
  665. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  666. package/lib/module/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
  667. package/lib/module/utils/hooks/header/on-scroll-header-state.js +1 -2
  668. package/lib/module/utils/hooks/header/on-scroll-header-state.js.map +1 -1
  669. package/lib/module/utils/hooks/http/client.js.map +1 -1
  670. package/lib/module/utils/hooks/index.js.map +1 -1
  671. package/lib/module/utils/hooks/list/list-content-inset.js +9 -10
  672. package/lib/module/utils/hooks/list/list-content-inset.js.map +1 -1
  673. package/lib/module/utils/hooks/navigation/before-remove.js.map +1 -1
  674. package/lib/module/utils/hooks/navigation/close-button-timeout.js.map +1 -1
  675. package/lib/module/utils/hooks/navigation/deep-link.js +3 -4
  676. package/lib/module/utils/hooks/navigation/deep-link.js.map +1 -1
  677. package/lib/module/utils/hooks/navigation/index.js.map +1 -1
  678. package/lib/module/utils/hooks/navigation/open-settings.js +1 -2
  679. package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
  680. package/lib/module/utils/hooks/pin-security/pin-security.js +1 -2
  681. package/lib/module/utils/hooks/pin-security/pin-security.js.map +1 -1
  682. package/lib/module/utils/hooks/revocation/credential-status.js +17 -26
  683. package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
  684. package/lib/module/utils/index.js +3 -0
  685. package/lib/module/utils/index.js.map +1 -1
  686. package/lib/module/utils/navigation.js +5 -5
  687. package/lib/module/utils/navigation.js.map +1 -1
  688. package/lib/module/utils/parsers/credential-images.js.map +1 -1
  689. package/lib/module/utils/parsers/credential-sharing.js +23 -24
  690. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  691. package/lib/module/utils/parsers/credential.js +23 -25
  692. package/lib/module/utils/parsers/credential.js.map +1 -1
  693. package/lib/module/utils/parsers/index.js +1 -0
  694. package/lib/module/utils/parsers/index.js.map +1 -1
  695. package/lib/module/utils/parsers/query.js +4 -3
  696. package/lib/module/utils/parsers/query.js.map +1 -1
  697. package/lib/module/utils/parsers/universal-links.js +25 -0
  698. package/lib/module/utils/parsers/universal-links.js.map +1 -0
  699. package/lib/module/utils/parsers/universal-links.test.js +38 -0
  700. package/lib/module/utils/parsers/universal-links.test.js.map +1 -0
  701. package/lib/module/utils/ref.js.map +1 -1
  702. package/lib/module/utils/reporting.js +1 -0
  703. package/lib/module/utils/reporting.js.map +1 -1
  704. package/lib/module/utils/string.js.map +1 -1
  705. package/lib/module/utils/testID.js +1 -4
  706. package/lib/module/utils/testID.js.map +1 -1
  707. package/lib/module/utils/testID.test.js.map +1 -1
  708. package/lib/module/utils/useMemoAsync.js +10 -0
  709. package/lib/module/utils/useMemoAsync.js.map +1 -1
  710. package/lib/module/utils/uuid.js.map +1 -1
  711. package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
  712. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -2
  713. package/lib/typescript/components/entity/entity-details.d.ts +3 -2
  714. package/lib/typescript/components/history/history-details-screen.d.ts +20 -0
  715. package/lib/typescript/components/history/history-list-item-icon.d.ts +8 -0
  716. package/lib/typescript/components/history/history-list-item.d.ts +21 -0
  717. package/lib/typescript/components/history/history-list-screen.d.ts +24 -0
  718. package/lib/typescript/components/history/history-list-section-header.d.ts +13 -0
  719. package/lib/typescript/components/history/history-list.d.ts +19 -0
  720. package/lib/typescript/components/history/index.d.ts +6 -0
  721. package/lib/typescript/components/index.d.ts +1 -0
  722. package/lib/typescript/ui-components/accessibility/accessibility.d.ts +2 -2
  723. package/lib/typescript/ui-components/accessibility/accessibilityHistory.d.ts +1 -1
  724. package/lib/typescript/ui-components/accessibility/accessibilityHistoryWrappers.d.ts +3 -3
  725. package/lib/typescript/ui-components/accessibility/index.d.ts +5 -3
  726. package/lib/typescript/ui-components/buttons/button.d.ts +2 -2
  727. package/lib/typescript/ui-components/buttons/hold-button.d.ts +16 -0
  728. package/lib/typescript/ui-components/buttons/index.d.ts +15 -7
  729. package/lib/typescript/ui-components/buttons/scan-button.d.ts +2 -2
  730. package/lib/typescript/ui-components/credential/card/credential-header.d.ts +1 -1
  731. package/lib/typescript/ui-components/credential/card/index.d.ts +10 -5
  732. package/lib/typescript/ui-components/credential/index.d.ts +2 -1
  733. package/lib/typescript/ui-components/header/index.d.ts +6 -3
  734. package/lib/typescript/ui-components/history/data-item.d.ts +2 -2
  735. package/lib/typescript/ui-components/history/history-details.d.ts +51 -0
  736. package/lib/typescript/ui-components/history/{history-list-item.d.ts → history-item.d.ts} +4 -3
  737. package/lib/typescript/ui-components/history/history-section-header.d.ts +2 -2
  738. package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
  739. package/lib/typescript/ui-components/history/index.d.ts +5 -4
  740. package/lib/typescript/ui-components/icons/entity.d.ts +1 -0
  741. package/lib/typescript/ui-components/icons/history.d.ts +22 -35
  742. package/lib/typescript/ui-components/image/index.d.ts +2 -1
  743. package/lib/typescript/ui-components/input/selection-input.d.ts +1 -1
  744. package/lib/typescript/ui-components/list/index.d.ts +1 -0
  745. package/lib/typescript/ui-components/list/list-page-loading-indicator.d.ts +4 -0
  746. package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +10 -0
  747. package/lib/typescript/ui-components/list/wallet/empty-search-result.d.ts +7 -0
  748. package/lib/typescript/ui-components/list/wallet/index.d.ts +3 -0
  749. package/lib/typescript/ui-components/nerd-view/index.d.ts +2 -1
  750. package/lib/typescript/ui-components/pin/keypad.d.ts +2 -2
  751. package/lib/typescript/ui-components/screens/index.d.ts +12 -6
  752. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +4 -4
  753. package/lib/typescript/ui-components/text/index.d.ts +2 -1
  754. package/lib/typescript/ui-components/text/typography.d.ts +14 -14
  755. package/lib/typescript/ui-components/theme/color-scheme.d.ts +1 -0
  756. package/lib/typescript/utils/filtering.d.ts +1 -0
  757. package/lib/typescript/utils/history.d.ts +10 -0
  758. package/lib/typescript/utils/hooks/connectivity/connectivity.d.ts +1 -1
  759. package/lib/typescript/utils/hooks/core/backup.d.ts +2 -1
  760. package/lib/typescript/utils/hooks/core/cache.d.ts +2 -0
  761. package/lib/typescript/utils/hooks/core/core-config.d.ts +5 -1
  762. package/lib/typescript/utils/hooks/core/core-init.d.ts +10 -1
  763. package/lib/typescript/utils/hooks/core/credentials.d.ts +9 -4
  764. package/lib/typescript/utils/hooks/core/history.d.ts +2 -5
  765. package/lib/typescript/utils/hooks/core/identifiers.d.ts +2 -0
  766. package/lib/typescript/utils/hooks/core/index.d.ts +2 -0
  767. package/lib/typescript/utils/hooks/core/proofs.d.ts +16 -9
  768. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -1
  769. package/lib/typescript/utils/hooks/revocation/credential-status.d.ts +2 -1
  770. package/lib/typescript/utils/index.d.ts +3 -0
  771. package/lib/typescript/utils/parsers/index.d.ts +1 -0
  772. package/lib/typescript/utils/parsers/universal-links.d.ts +1 -0
  773. package/lib/typescript/utils/parsers/universal-links.test.d.ts +1 -0
  774. package/lib/typescript/utils/ref.d.ts +1 -1
  775. package/package.json +61 -47
  776. package/src/components/entity/entity-attributes.tsx +5 -4
  777. package/src/components/entity/entity-details-with-buttons.tsx +20 -13
  778. package/src/components/entity/entity-details.tsx +24 -27
  779. package/src/components/history/history-details-screen.tsx +89 -0
  780. package/src/components/history/history-list-item-icon.tsx +113 -0
  781. package/src/components/history/history-list-item.tsx +64 -0
  782. package/src/components/history/history-list-screen.tsx +157 -0
  783. package/src/components/history/history-list-section-header.tsx +42 -0
  784. package/src/components/history/history-list.tsx +116 -0
  785. package/src/components/history/index.tsx +6 -0
  786. package/src/components/index.ts +1 -0
  787. package/src/components/proof-request/share-credential.tsx +2 -1
  788. package/src/ui-components/accessibility/accessibility.ts +2 -2
  789. package/src/ui-components/accessibility/accessibilityHistory.tsx +2 -2
  790. package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +3 -5
  791. package/src/ui-components/accessibility/index.ts +4 -3
  792. package/src/ui-components/action-modal/ActionModal.stories.tsx +7 -3
  793. package/src/ui-components/activity-indicator/activity-indicator.stories.tsx +3 -6
  794. package/src/ui-components/buttons/back-button.stories.tsx +7 -8
  795. package/src/ui-components/buttons/button.stories.tsx +9 -10
  796. package/src/ui-components/buttons/connectivity-button.stories.tsx +10 -11
  797. package/src/ui-components/buttons/connectivity-button.tsx +1 -1
  798. package/src/ui-components/buttons/ghost-button.stories.tsx +8 -8
  799. package/src/ui-components/buttons/hold-button.stories.tsx +29 -0
  800. package/src/ui-components/buttons/hold-button.tsx +276 -0
  801. package/src/ui-components/buttons/index.ts +16 -6
  802. package/src/ui-components/buttons/scan-button.stories.tsx +8 -4
  803. package/src/ui-components/control/checkbox.stories.tsx +8 -8
  804. package/src/ui-components/control/switch.stories.tsx +11 -8
  805. package/src/ui-components/credential/card/credential-card.stories.tsx +22 -25
  806. package/src/ui-components/credential/card/credential-details-card.stories.tsx +249 -245
  807. package/src/ui-components/credential/card/credential-details-card.tsx +2 -2
  808. package/src/ui-components/credential/card/credential-details-list-item.tsx +16 -6
  809. package/src/ui-components/credential/card/credential-header.stories.tsx +15 -17
  810. package/src/ui-components/credential/card/credential-header.tsx +4 -1
  811. package/src/ui-components/credential/card/credential-image-carousel.tsx +4 -0
  812. package/src/ui-components/credential/card/index.ts +11 -5
  813. package/src/ui-components/credential/index.ts +2 -1
  814. package/src/ui-components/credential/selector.stories.tsx +7 -7
  815. package/src/ui-components/detail/detail.stories.tsx +11 -8
  816. package/src/ui-components/entity/avatar.stories.tsx +10 -7
  817. package/src/ui-components/entity/entity-cluster.stories.tsx +11 -8
  818. package/src/ui-components/entity/entity-cluster.tsx +1 -1
  819. package/src/ui-components/header/header.stories.tsx +10 -7
  820. package/src/ui-components/header/index.ts +6 -3
  821. package/src/ui-components/header/navigation-header.stories.tsx +11 -8
  822. package/src/ui-components/history/data-item.tsx +13 -4
  823. package/src/ui-components/history/history-details.tsx +247 -0
  824. package/src/ui-components/history/{history-list-item.tsx → history-item.tsx} +72 -33
  825. package/src/ui-components/history/history-section-header.tsx +2 -2
  826. package/src/ui-components/history/history-section-list-item.tsx +3 -3
  827. package/src/ui-components/history/index.ts +5 -4
  828. package/src/ui-components/icons/entity.tsx +27 -0
  829. package/src/ui-components/icons/history.tsx +84 -131
  830. package/src/ui-components/image/index.tsx +2 -1
  831. package/src/ui-components/input/radio-group.stories.tsx +34 -0
  832. package/src/ui-components/input/radio-group.tsx +8 -2
  833. package/src/ui-components/input/selection-input.stories.tsx +20 -17
  834. package/src/ui-components/list/index.ts +1 -0
  835. package/src/ui-components/list/list-page-loading-indicator.tsx +8 -0
  836. package/src/ui-components/list/wallet/empty-list.tsx +75 -0
  837. package/src/ui-components/list/wallet/empty-search-result.tsx +39 -0
  838. package/src/ui-components/list/wallet/index.tsx +4 -0
  839. package/src/ui-components/loader/loader.stories.tsx +6 -9
  840. package/src/ui-components/loader/loader.tsx +6 -3
  841. package/src/ui-components/loader/loading-result.stories.tsx +13 -10
  842. package/src/ui-components/loader/loading-result.tsx +8 -4
  843. package/src/ui-components/nerd-view/index.ts +2 -1
  844. package/src/ui-components/nerd-view/nerd-mode-item.tsx +2 -2
  845. package/src/ui-components/pin/pin-code-screen.stories.tsx +20 -13
  846. package/src/ui-components/screens/image-preview-screen.stories.tsx +9 -6
  847. package/src/ui-components/screens/index.ts +12 -6
  848. package/src/ui-components/screens/nerd-mode-screen.tsx +6 -6
  849. package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +10 -7
  850. package/src/ui-components/searchbar/search-bar.stories.tsx +15 -8
  851. package/src/ui-components/searchbar/search-bar.tsx +2 -2
  852. package/src/ui-components/state/error-screen.stories.tsx +8 -9
  853. package/src/ui-components/state/error-screen.tsx +1 -1
  854. package/src/ui-components/text/index.ts +2 -1
  855. package/src/ui-components/text/typography.stories.tsx +19 -12
  856. package/src/ui-components/theme/color-scheme-context.tsx +1 -0
  857. package/src/ui-components/theme/color-scheme.ts +1 -0
  858. package/src/utils/date.ts +5 -5
  859. package/src/utils/filtering.ts +5 -0
  860. package/src/utils/history.ts +71 -0
  861. package/src/utils/hooks/connectivity/connectivity.test.ts +8 -0
  862. package/src/utils/hooks/connectivity/connectivity.ts +28 -4
  863. package/src/utils/hooks/core/backup.ts +25 -21
  864. package/src/utils/hooks/core/cache.ts +43 -0
  865. package/src/utils/hooks/core/core-config.ts +19 -0
  866. package/src/utils/hooks/core/core-context.tsx +15 -2
  867. package/src/utils/hooks/core/core-init.ts +45 -27
  868. package/src/utils/hooks/core/credential-schemas.ts +1 -1
  869. package/src/utils/hooks/core/credentials.ts +18 -17
  870. package/src/utils/hooks/core/history.ts +2 -57
  871. package/src/utils/hooks/core/identifiers.ts +18 -0
  872. package/src/utils/hooks/core/index.ts +3 -1
  873. package/src/utils/hooks/core/proof-schemas.ts +1 -1
  874. package/src/utils/hooks/core/proofs.ts +111 -51
  875. package/src/utils/hooks/core/trust-entity.ts +21 -13
  876. package/src/utils/hooks/navigation/open-settings.ts +2 -3
  877. package/src/utils/hooks/revocation/credential-status.ts +3 -2
  878. package/src/utils/index.ts +3 -0
  879. package/src/utils/navigation.ts +4 -2
  880. package/src/utils/parsers/credential-sharing.tsx +25 -25
  881. package/src/utils/parsers/credential.ts +5 -1
  882. package/src/utils/parsers/index.ts +1 -0
  883. package/src/utils/parsers/query.tsx +4 -2
  884. package/src/utils/parsers/universal-links.test.ts +57 -0
  885. package/src/utils/parsers/universal-links.ts +26 -0
  886. package/src/utils/ref.ts +1 -1
  887. package/src/utils/reporting.ts +1 -0
  888. package/lib/commonjs/ui-components/history/history-list-item.js.map +0 -1
  889. package/lib/module/ui-components/history/history-list-item.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_connectivity","require","jest","mock","addEventListener","onStateChange","describe","test","transports","getInvitationUrlTransports","expect","toStrictEqual","Transport","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getInvitationUrlTransports('invalid');\n expect(transports).toStrictEqual([]);\n });\n});\n"],"mappings":";;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEAC,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDC,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHF,IAAI,CAACC,IAAI,CAAC,sCAAsC,EAAE,OAAO;EACvDE,aAAa,EAAEA,CAAA,KAAM,CAAC;AACxB,CAAC,CAAC,CAAC;AAEHC,QAAQ,CAA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CAAC,CAAC"}
1
+ {"version":3,"names":["_connectivity","require","jest","mock","initializeCore","Promise","resolve","captureException","addEventListener","onStateChange","describe","test","transports","getInvitationUrlTransports","expect","toStrictEqual","Transport","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getIn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AM;IAC/C,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAC3C,6OAA6O,EAC7O,gBACF,CAAC;IACDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,CAACC,uBAAS,CAACG,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFR,IAAI,CAAC,kCAAkC,EAAE,MAAM;IAC7C,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAC3C,wMAAwM,EACxM,gBACF,CAAC;IACDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,CAACC,uBAAS,CAACG,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EAEFR,IAAI,CAAC,cAAc,EAAE,MAAM;IACzB,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAAC,SAAS,CAAC;IACxDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,EAAE,CAAC;EACtC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -27,13 +27,10 @@ const useCreateBackup = () => {
27
27
  const {
28
28
  core
29
29
  } = (0, _coreContext.useONECore)();
30
- return (0, _reactQuery.useMutation)(async _ref => {
31
- let {
32
- password,
33
- outputPath
34
- } = _ref;
35
- return core.createBackup(password, outputPath);
36
- }, {
30
+ return (0, _reactQuery.useMutation)(async ({
31
+ password,
32
+ outputPath
33
+ }) => core.createBackup(password, outputPath), {
37
34
  onSuccess: () => queryClient.invalidateQueries(_history.HISTORY_LIST_QUERY_KEY)
38
35
  });
39
36
  };
@@ -43,13 +40,10 @@ const useUnpackBackup = () => {
43
40
  const {
44
41
  core
45
42
  } = (0, _coreContext.useONECore)();
46
- return (0, _reactQuery.useMutation)(async _ref2 => {
47
- let {
48
- password,
49
- inputPath
50
- } = _ref2;
51
- return core.unpackBackup(password, inputPath);
52
- }, {
43
+ return (0, _reactQuery.useMutation)(async ({
44
+ password,
45
+ inputPath
46
+ }) => core.unpackBackup(password, inputPath), {
53
47
  onSuccess: () => queryClient.resetQueries()
54
48
  });
55
49
  };
@@ -74,7 +68,10 @@ const useRollbackImport = () => {
74
68
  });
75
69
  };
76
70
  exports.useRollbackImport = useRollbackImport;
77
- const useBackupFinalizeImportProcedure = () => {
71
+ const useBackupFinalizeImportProcedure = ({
72
+ generateHwKey,
73
+ generateSwKey
74
+ }) => {
78
75
  const {
79
76
  mutateAsync: finalizeImport
80
77
  } = useFinalizeImport();
@@ -95,7 +92,7 @@ const useBackupFinalizeImportProcedure = () => {
95
92
  type: _reactNativeOneCore.DidTypeEnum.LOCAL
96
93
  });
97
94
  let swDidId = (_dids$values$find = dids.values.find(did => did.name.startsWith(_coreInit.SW_DID_NAME_PREFIX))) === null || _dids$values$find === void 0 ? void 0 : _dids$values$find.id;
98
- if (!swDidId) {
95
+ if (!swDidId && generateSwKey) {
99
96
  const swKeyId = await core.generateKey({
100
97
  keyParams: {},
101
98
  keyType: 'EDDSA',
@@ -118,21 +115,24 @@ const useBackupFinalizeImportProcedure = () => {
118
115
  params: {}
119
116
  });
120
117
  }
118
+ let hwKeyId = null;
119
+ if (generateHwKey) {
120
+ hwKeyId = await core.generateKey({
121
+ keyParams: {},
122
+ keyType: 'ECDSA',
123
+ name: `holder-key-hw-${(0, _uuid.generateUUID)()}`,
124
+ organisationId,
125
+ storageParams: {},
126
+ storageType: 'SECURE_ELEMENT'
127
+ }).catch(e => {
128
+ // ignore if HW keys not supported by device
129
+ if (e instanceof _reactNativeOneCore.OneError && e.code === _errorCode.OneErrorCode.KeyStorageNotSupported) {
130
+ return null;
131
+ }
132
+ throw e;
133
+ });
134
+ }
121
135
  let hwDidId = null;
122
- const hwKeyId = await core.generateKey({
123
- keyParams: {},
124
- keyType: 'ES256',
125
- name: `holder-key-hw-${(0, _uuid.generateUUID)()}`,
126
- organisationId,
127
- storageParams: {},
128
- storageType: 'SECURE_ELEMENT'
129
- }).catch(e => {
130
- // ignore if HW keys not supported by device
131
- if (e instanceof _reactNativeOneCore.OneError && e.code === _errorCode.OneErrorCode.KeyStorageNotSupported) {
132
- return null;
133
- }
134
- throw e;
135
- });
136
136
  if (hwKeyId) {
137
137
  hwDidId = await core.createDid({
138
138
  didMethod: 'KEY',
@@ -149,7 +149,7 @@ const useBackupFinalizeImportProcedure = () => {
149
149
  });
150
150
  }
151
151
  return [hwDidId, swDidId];
152
- }, [core, organisationId, finalizeImport]);
152
+ }, [core, organisationId, finalizeImport, generateHwKey, generateSwKey]);
153
153
  };
154
154
  exports.useBackupFinalizeImportProcedure = useBackupFinalizeImportProcedure;
155
155
  //# sourceMappingURL=backup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_react","_reactQuery","_uuid","_coreContext","_coreInit","_errorCode","_history","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","useONECore","useQuery","backupInfo","keepPreviousData","exports","useCreateBackup","queryClient","useQueryClient","useMutation","_ref","password","outputPath","createBackup","onSuccess","invalidateQueries","HISTORY_LIST_QUERY_KEY","useUnpackBackup","_ref2","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","mutateAsync","organisationId","useCallback","_dids$values$find","dids","getDids","deactivated","page","pageSize","type","DidTypeEnum","LOCAL","swDidId","values","find","did","name","startsWith","SW_DID_NAME_PREFIX","id","swKeyId","generateKey","keyParams","keyType","generateUUID","storageParams","storageType","createDid","didMethod","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","hwDidId","hwKeyId","catch","e","OneError","code","OneErrorCode","KeyStorageNotSupported","HW_DID_NAME_PREFIX"],"sources":["backup.ts"],"sourcesContent":["import { DidTypeEnum, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { generateUUID } from '../../uuid';\nimport { useONECore } from './core-context';\nimport { HW_DID_NAME_PREFIX, SW_DID_NAME_PREFIX } from './core-init';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useBackupFinalizeImportProcedure = () => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet did references\n const dids = await core.getDids({\n deactivated: false,\n organisationId,\n page: 0,\n pageSize: 1,\n type: DidTypeEnum.LOCAL,\n });\n let swDidId = dids.values.find((did) => did.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n\n if (!swDidId) {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'EDDSA',\n name: `holder-key-sw-${generateUUID()}`,\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n swDidId = await core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n name: `${SW_DID_NAME_PREFIX}-${generateUUID()}`,\n organisationId,\n params: {},\n });\n }\n\n let hwDidId: string | null = null;\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ES256',\n name: `holder-key-hw-${generateUUID()}`,\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n if (hwKeyId) {\n hwDidId = await core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n name: `${HW_DID_NAME_PREFIX}-${generateUUID()}`,\n organisationId,\n params: {},\n });\n }\n\n return [hwDidId, swDidId] as [string | null, string];\n }, [core, organisationId, finalizeImport]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAEA,MAAMQ,qBAAqB,GAAG,aAAa;AAEpC,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,GAAE;EAE7B,OAAO,IAAAC,oBAAQ,EAAC,CAACJ,qBAAqB,CAAC,EAAE,MAAME,IAAI,CAACG,UAAU,EAAE,EAAE;IAChEC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA;A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BJ,oBAAoB,EAAE,CAACI,OAAO,CAAC;UAC/BH,YAAY,EAAE,CAACG,OAAO;QACxB,CAAC;QACDrB,IAAI,EAAG,GAAE4B,4BAAmB,IAAG,IAAApB,kBAAY,GAAG,EAAC;QAC/CvB,cAAc;QACdkC,MAAM,EAAE,CAAC;MACX,CAAC,CAAC;IACJ;IAEA,OAAO,CAACC,OAAO,EAAExB,OAAO,CAAC;EAC3B,CAAC,EAAE,CAACvC,IAAI,EAAE4B,cAAc,EAAEL,cAAc,CAAC,CAAC;AAC5C,CAAC;AAAClB,OAAA,CAAAqB,gCAAA,GAAAA,gCAAA"}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_reactQuery","_uuid","_coreContext","_coreInit","_errorCode","_history","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","useONECore","useQuery","backupInfo","keepPreviousData","exports","useCreateBackup","queryClient","useQueryClient","useMutation","password","outputPath","createBackup","onSuccess","invalidateQueries","HISTORY_LIST_QUERY_KEY","useUnpackBackup","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","generateHwKey","generateSwKey","mutateAsync","organisationId","useCallback","_dids$values$find","dids","getDids","deactivated","page","pageSize","type","DidTypeEnum","LOCAL","swDidId","values","find","did","name","startsWith","SW_DID_NAME_PREFIX","id","swKeyId","generateKey","keyParams","keyType","generateUUID","storageParams","storageType","createDid","didMethod","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","hwKeyId","catch","e","OneError","code","OneErrorCode","KeyStorageNotSupported","hwDidId","HW_DID_NAME_PREFIX"],"sources":["backup.ts"],"sourcesContent":["import { DidTypeEnum, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { generateUUID } from '../../uuid';\nimport { useONECore } from './core-context';\nimport { HW_DID_NAME_PREFIX, IdentifiersInitializationConfig, SW_DID_NAME_PREFIX } from './core-init';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useBackupFinalizeImportProcedure = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet did references\n const dids = await core.getDids({\n deactivated: false,\n organisationId,\n page: 0,\n pageSize: 1,\n type: DidTypeEnum.LOCAL,\n });\n let swDidId = dids.values.find((did) => did.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n\n if (!swDidId && generateSwKey) {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'EDDSA',\n name: `holder-key-sw-${generateUUID()}`,\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n swDidId = await core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n name: `${SW_DID_NAME_PREFIX}-${generateUUID()}`,\n organisationId,\n params: {},\n });\n }\n\n let hwKeyId: string | null = null;\n if (generateHwKey) {\n hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: `holder-key-hw-${generateUUID()}`,\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n }\n\n let hwDidId: string | null = null;\n if (hwKeyId) {\n hwDidId = await core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n name: `${HW_DID_NAME_PREFIX}-${generateUUID()}`,\n organisationId,\n params: {},\n });\n }\n\n return [hwDidId, swDidId] as [string | null, string | undefined];\n }, [core, organisationId, finalizeImport, generateHwKey, generateSwKey]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAEA,MAAMQ,qBAAqB,GAAG,aAAa;AAEpC,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,oBAA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CAAC,CAAC;IACN;IAEA,IAAIK,OAAsB,GAAG,IAAI;IACjC,IAAIP,OAAO,EAAE;MACXO,OAAO,GAAG,MAAMtE,IAAI,CAACsD,SAAS,CAAC;QAC7BC,SAAS,EAAE,KAAK;QAChBC,IAAI,EAAE;UACJC,eAAe,EAAE,CAACM,OAAO,CAAC;UAC1BL,cAAc,EAAE,CAACK,OAAO,CAAC;UACzBJ,oBAAoB,EAAE,CAACI,OAAO,CAAC;UAC/BH,oBAAoB,EAAE,CAACG,OAAO,CAAC;UAC/BF,YAAY,EAAE,CAACE,OAAO;QACxB,CAAC;QACDpB,IAAI,EAAE,GAAG4B,4BAAkB,IAAI,IAAApB,kBAAY,EAAC,CAAC,EAAE;QAC/CvB,cAAc;QACdkC,MAAM,EAAE,CAAC;MACX,CAAC,CAAC;IACJ;IAEA,OAAO,CAACQ,OAAO,EAAE/B,OAAO,CAAC;EAC3B,CAAC,EAAE,CAACvC,IAAI,EAAE4B,cAAc,EAAEP,cAAc,EAAEI,aAAa,EAAEC,aAAa,CAAC,CAAC;AAC1E,CAAC;AAACrB,OAAA,CAAAmB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useCacheClear = void 0;
7
+ var _reactNativeOneCore = require("@procivis/react-native-one-core");
8
+ var _reactQuery = require("react-query");
9
+ var _coreContext = require("./core-context");
10
+ var _credentials = require("./credentials");
11
+ var _trustEntity = require("./trust-entity");
12
+ const CREDENTIAL_QUERY_KEYS = [_credentials.CREDENTIAL_LIST_QUERY_KEY, _credentials.CREDENTIAL_LIST_PAGED_QUERY_KEY, _credentials.CREDENTIAL_DETAIL_QUERY_KEY];
13
+ const TRUST_ENTITY_QUERY_KEYS = [_trustEntity.TRUST_ENTITY_DETAIL_QUERY_KEY, _trustEntity.REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
14
+
15
+ // Map each CacheType to the query keys that should be invalidated when that cache is cleared.
16
+ const cacheTypeToQueryKeys = {
17
+ [_reactNativeOneCore.CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,
18
+ [_reactNativeOneCore.CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,
19
+ [_reactNativeOneCore.CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
20
+ [_reactNativeOneCore.CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
21
+ [_reactNativeOneCore.CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
22
+ [_reactNativeOneCore.CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS]
23
+ };
24
+ const useCacheClear = () => {
25
+ const queryClient = (0, _reactQuery.useQueryClient)();
26
+ const {
27
+ core
28
+ } = (0, _coreContext.useONECore)();
29
+ return (0, _reactQuery.useMutation)(async cacheTypes => {
30
+ await core.deleteCache(cacheTypes);
31
+ return cacheTypes;
32
+ }, {
33
+ onSuccess: async (_, cacheTypes) => {
34
+ const queryKeysToInvalidate = new Set();
35
+ cacheTypes.forEach(cacheType => {
36
+ const keys = cacheTypeToQueryKeys[cacheType] || [];
37
+ keys.forEach(key => queryKeysToInvalidate.add(key));
38
+ });
39
+ await Promise.all([...queryKeysToInvalidate].map(queryKey => queryClient.invalidateQueries(queryKey)));
40
+ }
41
+ });
42
+ };
43
+ exports.useCacheClear = useCacheClear;
44
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","_trustEntity","CREDENTIAL_QUERY_KEYS","CREDENTIAL_LIST_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_DETAIL_QUERY_KEY","TRUST_ENTITY_QUERY_KEYS","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","cacheTypeToQueryKeys","CacheType","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","useCacheClear","queryClient","useQueryClient","core","useONECore","useMutation","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries","exports"],"sources":["cache.ts"],"sourcesContent":["import { CacheType } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];\n\n// Map each CacheType to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheType, string[]> = {\n [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheType[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,MAAMK,qBAAqB,GAAG,CAACC,sCAAyB,EAAEC,4CAA+B,EAAEC,wCAA2B,CAAC;AACvH,MAAMC,uBAAuB,GAAG,CAACC,0CAA6B,EAAEC,iDAAoC,CAAC;;AAErG;AACA,MAAMC,oBAAiD,GAAG;EACxD,CAACC,6BAAS,CAACC,YAAY,GAAGT,qBAAqB;EAC/C,CAACQ,6BAAS,CAACE,eAAe,GAAGV,qBAAqB;EAClD,CAACQ,6BAAS,CAACG,sBAAsB,GAAGX,qBAAqB;EACzD,CAACQ,6BAAS,CAACI,YAAY,GAAGZ,qBAAqB;EAC/C,CAACQ,6BAAS,CAACK,WAAW,GAAGb,qBAAqB;EAC9C,CAACQ,6BAAS,CAACM,UAAU,GAAG,CAAC,GAAGV,uBAAuB,EAAE,GAAGJ,qBAAqB;AAC/E,CAAC;AAEM,MAAMe,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,WAAW,GAAG,IAAAC,0BAAc,EAAC,CAAC;EACpC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,uBAAW,EAChB,MAAOC,UAAuB,IAAK;IACjC,MAAMH,IAAI,CAACI,WAAW,CAACD,UAAU,CAAC;IAClC,OAAOA,UAAU;EACnB,CAAC,EACD;IACEE,SAAS,EAAE,MAAAA,CAAOC,CAAC,EAAEH,UAAU,KAAK;MAClC,MAAMI,qBAAqB,GAAG,IAAIC,GAAG,CAAS,CAAC;MAE/CL,UAAU,CAACM,OAAO,CAAEC,SAAS,IAAK;QAChC,MAAMC,IAAI,GAAGtB,oBAAoB,CAACqB,SAAS,CAAC,IAAI,EAAE;QAClDC,IAAI,CAACF,OAAO,CAAEG,GAAG,IAAKL,qBAAqB,CAACM,GAAG,CAACD,GAAG,CAAC,CAAC;MACvD,CAAC,CAAC;MAEF,MAAME,OAAO,CAACC,GAAG,CAAC,CAAC,GAAGR,qBAAqB,CAAC,CAACS,GAAG,CAAEC,QAAQ,IAAKnB,WAAW,CAACoB,iBAAiB,CAACD,QAAQ,CAAC,CAAC,CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC;AAACE,OAAA,CAAAtB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCoreConfig = void 0;
6
+ exports.useCoreConfig = exports.getEnabledTrustManagement = exports.getEnabledTransports = exports.getEnabledExchangeProtocols = void 0;
7
7
  var _reactQuery = require("react-query");
8
8
  var _coreContext = require("./core-context");
9
9
  const CONFIG_QUERY_KEY = 'config';
@@ -16,4 +16,18 @@ const useCoreConfig = () => {
16
16
  });
17
17
  };
18
18
  exports.useCoreConfig = useCoreConfig;
19
+ const getEnabledTransports = config => {
20
+ var _config$transport;
21
+ return Object.values((_config$transport = config === null || config === void 0 ? void 0 : config.transport) !== null && _config$transport !== void 0 ? _config$transport : {}).filter(t => t.enabled !== false).map(transport => transport.type);
22
+ };
23
+ exports.getEnabledTransports = getEnabledTransports;
24
+ const getEnabledExchangeProtocols = exchangeProtocol => {
25
+ return Object.values(exchangeProtocol !== null && exchangeProtocol !== void 0 ? exchangeProtocol : {}).filter(t => t.enabled !== false).map(exchange => exchange.type);
26
+ };
27
+ exports.getEnabledExchangeProtocols = getEnabledExchangeProtocols;
28
+ const getEnabledTrustManagement = config => {
29
+ var _config$trustManageme;
30
+ return Object.values((_config$trustManageme = config === null || config === void 0 ? void 0 : config.trustManagement) !== null && _config$trustManageme !== void 0 ? _config$trustManageme : {}).filter(t => t.enabled !== false).map(trustManagement => trustManagement.type);
31
+ };
32
+ exports.getEnabledTrustManagement = getEnabledTrustManagement;
19
33
  //# sourceMappingURL=core-config.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactQuery","require","_coreContext","CONFIG_QUERY_KEY","useCoreConfig","core","useONECore","useQuery","getConfig","keepPreviousData","exports"],"sources":["core-config.ts"],"sourcesContent":["import { useQuery } from 'react-query';\n\nimport { useONECore } from './core-context';\n\nconst CONFIG_QUERY_KEY = 'config';\n\nexport const useCoreConfig = () => {\n const { core } = useONECore();\n\n return useQuery([CONFIG_QUERY_KEY], () => core?.getConfig(), {\n keepPreviousData: true,\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,MAAME,gBAAgB,GAAG,QAAQ;AAE1B,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,GAAE;EAE7B,OAAO,IAAAC,oBAAQ,EAAC,CAACJ,gBAAgB,CAAC,EAAE,MAAME,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,SAAS,EAAE,EAAE;IAC3DC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"names":["_reactQuery","require","_coreContext","CONFIG_QUERY_KEY","useCoreConfig","core","useONECore","useQuery","getConfig","keepPreviousData","exports","getEnabledTransports","config","_config$transport","Object","values","transport","filter","t","enabled","map","type","getEnabledExchangeProtocols","exchangeProtocol","exchange","getEnabledTrustManagement","_config$trustManageme","trustManagement"],"sources":["core-config.ts"],"sourcesContent":["import { Config, ConfigEntities } from '@procivis/react-native-one-core';\nimport { useQuery } from 'react-query';\n\nimport { useONECore } from './core-context';\n\nconst CONFIG_QUERY_KEY = 'config';\n\nexport const useCoreConfig = () => {\n const { core } = useONECore();\n\n return useQuery([CONFIG_QUERY_KEY], () => core?.getConfig(), {\n keepPreviousData: true,\n });\n};\n\nexport const getEnabledTransports = (config: Config): string[] => {\n return Object.values(config?.transport ?? {})\n .filter((t) => t.enabled !== false)\n .map((transport) => transport.type);\n};\n\nexport const getEnabledExchangeProtocols = (exchangeProtocol: ConfigEntities<any>): string[] => {\n return Object.values(exchangeProtocol ?? {})\n .filter((t) => t.enabled !== false)\n .map((exchange) => exchange.type);\n};\n\nexport const getEnabledTrustManagement = (config: Config): string[] => {\n return Object.values(config?.trustManagement ?? {})\n .filter((t) => t.enabled !== false)\n .map((trustManagement) => trustManagement.type);\n};\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,MAAME,gBAAgB,GAAG,QAAQ;AAE1B,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,oBAAQ,EAAC,CAACJ,gBAAgB,CAAC,EAAE,MAAME,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,SAAS,CAAC,CAAC,EAAE;IAC3DC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA;AAEK,MAAMO,oBAAoB,GAAIC,MAAc,IAAe;EAAA,IAAAC,iBAAA;EAChE,OAAOC,MAAM,CAACC,MAAM,EAAAF,iBAAA,GAACD,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEI,SAAS,cAAAH,iBAAA,cAAAA,iBAAA,GAAI,CAAC,CAAC,CAAC,CAC1CI,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEJ,SAAS,IAAKA,SAAS,CAACK,IAAI,CAAC;AACvC,CAAC;AAACX,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AAEK,MAAMW,2BAA2B,GAAIC,gBAAqC,IAAe;EAC9F,OAAOT,MAAM,CAACC,MAAM,CAACQ,gBAAgB,aAAhBA,gBAAgB,cAAhBA,gBAAgB,GAAI,CAAC,CAAC,CAAC,CACzCN,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEI,QAAQ,IAAKA,QAAQ,CAACH,IAAI,CAAC;AACrC,CAAC;AAACX,OAAA,CAAAY,2BAAA,GAAAA,2BAAA;AAEK,MAAMG,yBAAyB,GAAIb,MAAc,IAAe;EAAA,IAAAc,qBAAA;EACrE,OAAOZ,MAAM,CAACC,MAAM,EAAAW,qBAAA,GAACd,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEe,eAAe,cAAAD,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC,CAAC,CAChDT,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEO,eAAe,IAAKA,eAAe,CAACN,IAAI,CAAC;AACnD,CAAC;AAACX,OAAA,CAAAe,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -7,22 +7,22 @@ exports.useONECore = exports.ONECoreContextProvider = void 0;
7
7
  var _reactNativeOneCore = require("@procivis/react-native-one-core");
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _reporting = require("../../reporting");
10
+ var _coreConfig = require("./core-config");
10
11
  var _trustEntity = require("./trust-entity");
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
14
  const defaultContextValue = {
14
15
  core: {},
15
16
  organisationId: '11111111-2222-3333-a444-ffffffffffff',
16
17
  initialize: () => Promise.reject()
17
18
  };
18
19
  const ONECoreContext = /*#__PURE__*/(0, _react.createContext)(defaultContextValue);
19
- const ONECoreContextProvider = _ref => {
20
- let {
21
- children,
22
- organisationId = '11111111-2222-3333-a444-ffffffffffff',
23
- publisherReference,
24
- config
25
- } = _ref;
20
+ const ONECoreContextProvider = ({
21
+ children,
22
+ organisationId = '11111111-2222-3333-a444-ffffffffffff',
23
+ publisherReference,
24
+ config
25
+ }) => {
26
26
  const [core, setCore] = (0, _react.useState)();
27
27
  const createTrustAnchor = (0, _trustEntity.useCreateTrustAnchor)(publisherReference);
28
28
  const initialize = (0, _react.useCallback)(async force => {
@@ -52,7 +52,12 @@ const ONECoreContextProvider = _ref => {
52
52
  if (!core) {
53
53
  return;
54
54
  }
55
- createTrustAnchor(core).catch(() => {});
55
+ core.getConfig().then(coreConfig => {
56
+ const trustManagementEnabled = (0, _coreConfig.getEnabledTrustManagement)(coreConfig).includes(_trustEntity.TrustManagementEnum.SimpleTrustList);
57
+ if (trustManagementEnabled) {
58
+ createTrustAnchor(core).catch(() => {});
59
+ }
60
+ }).catch(() => {});
56
61
  }, [core, createTrustAnchor]);
57
62
  const contextValue = (0, _react.useMemo)(() => ({
58
63
  core: core !== null && core !== void 0 ? core : defaultContextValue.core,
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reporting","_trustEntity","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","createContext","ONECoreContextProvider","_ref","children","publisherReference","config","setCore","useState","createTrustAnchor","useCreateTrustAnchor","useCallback","force","coreInstance","initializeCore","e","reportException","useEffect","corePromise","then","c","uninitialize","catch","contextValue","useMemo","createElement","Provider","value","exports","useONECore","useContext"],"sources":["core-context.tsx"],"sourcesContent":["import { initializeCore, ONECore } from '@procivis/react-native-one-core';\nimport React, {\n createContext,\n FC,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useCreateTrustAnchor } from './trust-entity';\n\ninterface ContextValue {\n core: ONECore;\n organisationId: string;\n initialize: (force?: boolean) => Promise<ONECore>;\n}\n\nconst defaultContextValue: ContextValue = {\n core: {} as ONECore,\n organisationId: '11111111-2222-3333-a444-ffffffffffff',\n initialize: () => Promise.reject(),\n};\n\nexport type ONECoreContextProviderProps = {\n config?: Record<string, unknown>;\n organisationId?: string;\n publisherReference: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = '11111111-2222-3333-a444-ffffffffffff',\n publisherReference,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n const createTrustAnchor = useCreateTrustAnchor(publisherReference);\n\n const initialize = useCallback(\n async (force?: boolean) => {\n if (core && !force) {\n return core;\n }\n\n try {\n const coreInstance = await initializeCore(config);\n setCore(coreInstance);\n return coreInstance;\n } catch (e) {\n reportException(e, 'Failed to initialize core');\n throw e;\n }\n },\n [core, config],\n );\n\n useEffect(\n () => {\n const corePromise = initialize();\n return () => {\n corePromise\n .then((c) => c?.uninitialize(false))\n .catch((e) => {\n reportException(e, 'Core uninitialization error');\n });\n };\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n useEffect(() => {\n if (!core) {\n return;\n }\n createTrustAnchor(core).catch(() => {});\n }, [core, createTrustAnchor]);\n\n const contextValue = useMemo(\n () => ({\n core: core ?? defaultContextValue.core,\n organisationId,\n initialize,\n }),\n [core, initialize, organisationId],\n );\n\n if (!core) {\n return null;\n }\n\n return <ONECoreContext.Provider value={contextValue}>{children}</ONECoreContext.Provider>;\n};\n\nexport const useONECore = () => useContext(ONECoreContext);\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAWA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAAsD,SAAAK,yB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K,CAAC,MAAM,CAAC,CAAC,CAAC;EACzC,CAAC,EAAE,CAAC3B,IAAI,EAAEc,iBAAiB,CAAC,CAAC;EAE7B,MAAMc,YAAY,GAAG,IAAAC,cAAO,EAC1B,OAAO;IACL7B,IAAI,EAAEA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAID,mBAAmB,CAACC,IAAI;IACtCC,cAAc;IACdC;EACF,CAAC,CAAC,EACF,CAACF,IAAI,EAAEE,UAAU,EAAED,cAAc,CAAC,CACnC;EAED,IAAI,CAACD,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBAAO3B,MAAA,CAAAW,OAAA,CAAA8C,aAAA,CAACzB,cAAc,CAAC0B,QAAQ;IAACC,KAAK,EAAEJ;EAAa,GAAEnB,QAAQ,CAA2B;AAC3F,CAAC;AAACwB,OAAA,CAAA1B,sBAAA,GAAAA,sBAAA;AAEK,MAAM2B,UAAU,GAAGA,CAAA,KAAM,IAAAC,iBAAU,EAAC9B,cAAc,CAAC;AAAC4B,OAAA,CAAAC,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reporting","_coreConfig","_trustEntity","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","createContext","ONECoreContextProvider","children","publisherReference","config","setCore","useState","createTrustAnchor","useCreateTrustAnchor","useCallback","force","coreInstance","initializeCore","reportException","useEffect","corePromise","then","c","uninitialize","catch","getConfig","coreConfig","trustManagementEnabled","getEnabledTrustManagement","includes","TrustManagementEnum","SimpleTrustList","contextValue","useMemo","createElement","Provider","value","exports","useONECore","useContext"],"sources":["core-context.tsx"],"sourcesContent":["import { initializeCore, ONECore } from '@procivis/react-native-one-core';\nimport React, {\n createContext,\n FC,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { reportException } from '../../reporting';\nimport { getEnabledTrustManagement } from './core-config';\nimport { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';\n\ninterface ContextValue {\n core: ONECore;\n organisationId: string;\n initialize: (force?: boolean) => Promise<ONECore>;\n}\n\nconst defaultContextValue: ContextValue = {\n core: {} as ONECore,\n organisationId: '11111111-2222-3333-a444-ffffffffffff',\n initialize: () => Promise.reject(),\n};\n\nexport type ONECoreContextProviderProps = {\n config?: Record<string, unknown>;\n organisationId?: string;\n publisherReference: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = '11111111-2222-3333-a444-ffffffffffff',\n publisherReference,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n const createTrustAnchor = useCreateTrustAnchor(publisherReference);\n\n const initialize = useCallback(\n async (force?: boolean) => {\n if (core && !force) {\n return core;\n }\n\n try {\n const coreInstance = await initializeCore(config);\n setCore(coreInstance);\n return coreInstance;\n } catch (e) {\n reportException(e, 'Failed to initialize core');\n throw e;\n }\n },\n [core, config],\n );\n\n useEffect(\n () => {\n const corePromise = initialize();\n return () => {\n corePromise\n .then((c) => c?.uninitialize(false))\n .catch((e) => {\n reportException(e, 'Core uninitialization error');\n });\n };\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n useEffect(() => {\n if (!core) {\n return;\n }\n\n core\n .getConfig()\n .then((coreConfig) => {\n const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(\n TrustManagementEnum.SimpleTrustList,\n );\n\n if (trustManagementEnabled) {\n createTrustAnchor(core).catch(() => {});\n }\n })\n .catch(() => {});\n }, [core, createTrustAnchor]);\n\n const contextValue = useMemo(\n () => ({\n core: core ?? defaultContextValue.core,\n organisationId,\n initialize,\n }),\n [core, initialize, organisationId],\n );\n\n if (!core) {\n return null;\n }\n\n return <ONECo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,12 @@ var _react = require("react");
9
9
  var _reporting = require("../../reporting");
10
10
  var _coreContext = require("./core-context");
11
11
  var _errorCode = require("./error-code");
12
- const SW_DID_NAME_PREFIX = 'holder-did-sw-key';
13
- exports.SW_DID_NAME_PREFIX = SW_DID_NAME_PREFIX;
14
- const HW_DID_NAME_PREFIX = 'holder-did-hw-key';
15
- exports.HW_DID_NAME_PREFIX = HW_DID_NAME_PREFIX;
16
- const generateHwDid = async (core, organisationId) => {
12
+ const SW_DID_NAME_PREFIX = exports.SW_DID_NAME_PREFIX = 'holder-did-sw-key';
13
+ const HW_DID_NAME_PREFIX = exports.HW_DID_NAME_PREFIX = 'holder-did-hw-key';
14
+ const generateHwIdentifier = async (core, organisationId) => {
17
15
  const hwKeyId = await core.generateKey({
18
16
  keyParams: {},
19
- keyType: 'ES256',
17
+ keyType: 'ECDSA',
20
18
  name: 'holder-key-hw',
21
19
  organisationId,
22
20
  storageParams: {},
@@ -29,63 +27,75 @@ const generateHwDid = async (core, organisationId) => {
29
27
  throw e;
30
28
  });
31
29
  if (hwKeyId) {
32
- return core.createDid({
33
- didMethod: 'KEY',
34
- keys: {
35
- assertionMethod: [hwKeyId],
36
- authentication: [hwKeyId],
37
- capabilityDelegation: [hwKeyId],
38
- capabilityInvocation: [hwKeyId],
39
- keyAgreement: [hwKeyId]
30
+ return core.createIdentifier({
31
+ did: {
32
+ method: 'KEY',
33
+ keys: {
34
+ assertionMethod: [hwKeyId],
35
+ authentication: [hwKeyId],
36
+ capabilityDelegation: [hwKeyId],
37
+ capabilityInvocation: [hwKeyId],
38
+ keyAgreement: [hwKeyId]
39
+ },
40
+ params: {}
40
41
  },
41
42
  name: HW_DID_NAME_PREFIX,
42
- organisationId,
43
- params: {}
43
+ organisationId
44
44
  });
45
45
  }
46
46
  return null;
47
47
  };
48
- const generateSwDid = async (core, organisationId) => {
48
+ const generateSwIdentifier = async (core, organisationId) => {
49
49
  const swKeyId = await core.generateKey({
50
50
  keyParams: {},
51
- keyType: 'EDDSA',
51
+ keyType: 'ECDSA',
52
52
  name: 'holder-key-sw',
53
53
  organisationId,
54
54
  storageParams: {},
55
55
  storageType: 'INTERNAL'
56
56
  });
57
- return core.createDid({
58
- didMethod: 'KEY',
59
- keys: {
60
- assertionMethod: [swKeyId],
61
- authentication: [swKeyId],
62
- capabilityDelegation: [swKeyId],
63
- capabilityInvocation: [swKeyId],
64
- keyAgreement: [swKeyId]
57
+ return core.createIdentifier({
58
+ did: {
59
+ method: 'KEY',
60
+ keys: {
61
+ assertionMethod: [swKeyId],
62
+ authentication: [swKeyId],
63
+ capabilityDelegation: [swKeyId],
64
+ capabilityInvocation: [swKeyId],
65
+ keyAgreement: [swKeyId]
66
+ },
67
+ params: {}
65
68
  },
66
69
  name: SW_DID_NAME_PREFIX,
67
- organisationId,
68
- params: {}
70
+ organisationId
69
71
  });
70
72
  };
71
-
72
- // create base local identifiers in the wallet
73
- const useInitializeONECoreIdentifiers = () => {
73
+ /**
74
+ * Create base local identifiers
75
+ * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created
76
+ * @returns [hwDidId, swDidId]
77
+ */
78
+ const useInitializeONECoreIdentifiers = ({
79
+ generateHwKey,
80
+ generateSwKey
81
+ }) => {
74
82
  const {
75
83
  core,
76
84
  organisationId
77
85
  } = (0, _coreContext.useONECore)();
78
86
  return (0, _react.useCallback)(async () => {
79
- return await core.createOrganisation(organisationId).catch(e => {
87
+ return await core.createOrganisation({
88
+ id: organisationId
89
+ }).catch(e => {
80
90
  if (e instanceof _reactNativeOneCore.OneError && e.code === _errorCode.OneErrorCode.OrganisationAlreadyExists) {
81
91
  return;
82
92
  }
83
93
  throw e;
84
- }).then(() => Promise.all([generateHwDid(core, organisationId), generateSwDid(core, organisationId)])).catch(err => {
94
+ }).then(() => Promise.all([generateHwKey ? generateHwIdentifier(core, organisationId) : null, generateSwKey ? generateSwIdentifier(core, organisationId) : null])).catch(err => {
85
95
  (0, _reporting.reportException)(err, 'Failed to create base identifiers');
86
96
  throw err;
87
97
  });
88
- }, [core, organisationId]);
98
+ }, [core, organisationId, generateHwKey, generateSwKey]);
89
99
  };
90
100
  exports.useInitializeONECoreIdentifiers = useInitializeONECoreIdentifiers;
91
101
  //# sourceMappingURL=core-init.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_react","_reporting","_coreContext","_errorCode","SW_DID_NAME_PREFIX","exports","HW_DID_NAME_PREFIX","generateHwDid","core","organisationId","hwKeyId","generateKey","keyParams","keyType","name","storageParams","storageType","catch","e","OneError","code","OneErrorCode","KeyStorageNotSupported","createDid","didMethod","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","generateSwDid","swKeyId","useInitializeONECoreIdentifiers","useONECore","useCallback","createOrganisation","OrganisationAlreadyExists","then","Promise","all","err","reportException"],"sources":["core-init.ts"],"sourcesContent":["import { ONECore, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\n\nexport const SW_DID_NAME_PREFIX = 'holder-did-sw-key';\nexport const HW_DID_NAME_PREFIX = 'holder-did-hw-key';\n\nconst generateHwDid = async (core: ONECore, organisationId: string) => {\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ES256',\n name: 'holder-key-hw',\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n\n if (hwKeyId) {\n return core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n name: HW_DID_NAME_PREFIX,\n organisationId,\n params: {},\n });\n }\n\n return null;\n};\n\nconst generateSwDid = async (core: ONECore, organisationId: string) => {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'EDDSA',\n name: 'holder-key-sw',\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n\n return core.createDid({\n didMethod: 'KEY',\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n name: SW_DID_NAME_PREFIX,\n organisationId,\n params: {},\n });\n};\n\n// create base local identifiers in the wallet\nexport const useInitializeONECoreIdentifiers = () => {\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n return await core\n .createOrganisation(organisationId)\n .catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OrganisationAlreadyExists) {\n return;\n }\n throw e;\n })\n .then(() => Promise.all([generateHwDid(core, organisationId), generateSwDid(core, organisationId)]))\n .catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [core, organisationId]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEO,MAAMK,kBAAkB,GAAG,mBAAmB;AAACC,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAC/C,MAAME,kBAAkB,GAAG,mBAAmB;AAACD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEtD,MAAMC,aAAa,GAAG,MAAAA,CAAOC,IAAa,EAAEC,cAAsB,KAAK;EACrE,MAAMC,OAAO,GAAG,MAAMF,IAAI,CACvBG,WAAW,CAAC;IACXC,SAAS,EAAE,CAAC,CAAC;IACbC,OAAO,EAAE,OAAO;IAChBC,IAAI,EAAE,eAAe;IACrBL,cAAc;IACdM,aAAa,EAAE,CAAC,CAAC;IACjBC,WAAW,EAAE;EACf,CAAC,CAAC,CACDC,KAAK,CAAEC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AE,CAAC;EACX,CAAC,CAAC;AACJ,CAAC;;AAED;AACO,MAAMG,+BAA+B,GAAGA,CAAA,KAAM;EACnD,MAAM;IAAE1B,IAAI;IAAEC;EAAe,CAAC,GAAG,IAAA0B,uBAAU,GAAE;EAE7C,OAAO,IAAAC,kBAAW,EAAC,YAAY;IAC7B,OAAO,MAAM5B,IAAI,CACd6B,kBAAkB,CAAC5B,cAAc,CAAC,CAClCQ,KAAK,CAAEC,CAAC,IAAK;MACZ,IAAIA,CAAC,YAAYC,4BAAQ,IAAID,CAAC,CAACE,IAAI,KAAKC,uBAAY,CAACiB,yBAAyB,EAAE;QAC9E;MACF;MACA,MAAMpB,CAAC;IACT,CAAC,CAAC,CACDqB,IAAI,CAAC,MAAMC,OAAO,CAACC,GAAG,CAAC,CAAClC,aAAa,CAACC,IAAI,EAAEC,cAAc,CAAC,EAAEuB,aAAa,CAACxB,IAAI,EAAEC,cAAc,CAAC,CAAC,CAAC,CAAC,CACnGQ,KAAK,CAAEyB,GAAG,IAAK;MACd,IAAAC,0BAAe,EAACD,GAAG,EAAE,mCAAmC,CAAC;MACzD,MAAMA,GAAG;IACX,CAAC,CAAC;EACN,CAAC,EAAE,CAAClC,IAAI,EAAEC,cAAc,CAAC,CAAC;AAC5B,CAAC;AAACJ,OAAA,CAAA6B,+BAAA,GAAAA,+BAAA"}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_reporting","_coreContext","_errorCode","SW_DID_NAME_PREFIX","exports","HW_DID_NAME_PREFIX","generateHwIdentifier","core","organisationId","hwKeyId","generateKey","keyParams","keyType","name","storageParams","storageType","catch","e","OneError","code","OneErrorCode","KeyStorageNotSupported","createIdentifier","did","method","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","generateSwIdentifier","swKeyId","useInitializeONECoreIdentifiers","generateHwKey","generateSwKey","useONECore","useCallback","createOrganisation","id","OrganisationAlreadyExists","then","Promise","all","err","reportException"],"sources":["core-init.ts"],"sourcesContent":["import { ONECore, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\n\nexport const SW_DID_NAME_PREFIX = 'holder-did-sw-key';\nexport const HW_DID_NAME_PREFIX = 'holder-did-hw-key';\n\nconst generateHwIdentifier = async (core: ONECore, organisationId: string) => {\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: 'holder-key-hw',\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n\n if (hwKeyId) {\n return core.createIdentifier({\n did: {\n method: 'KEY',\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n params: {},\n },\n name: HW_DID_NAME_PREFIX,\n organisationId,\n });\n }\n\n return null;\n};\n\nconst generateSwIdentifier = async (core: ONECore, organisationId: string) => {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: 'holder-key-sw',\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n\n return core.createIdentifier({\n did: {\n method: 'KEY',\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n params: {},\n },\n name: SW_DID_NAME_PREFIX,\n organisationId,\n });\n};\n\nexport interface IdentifiersInitializationConfig {\n generateHwKey: boolean;\n generateSwKey: boolean;\n}\n\n/**\n * Create base local identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created\n * @returns [hwDidId, swDidId]\n */\nexport const useInitializeONECoreIdentifiers = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n return await core\n .createOrganisation({ id: organisationId })\n .catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OrganisationAlreadyExists) {\n return;\n }\n throw e;\n })\n .then(() =>\n Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n generateSwKey ? generateSwIdentifier(core, organisationId) : null,\n ]),\n )\n .catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [core, organisationId, generateHwKey, generateSwKey]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEO,MAAMK,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,mBAAmB;AAC9C,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,mBAAmB;AAErD,MAAMC,oBAAoB,GAAG,MAAAA,CAAOC,IAAa,EAAEC,cAAsB,KAAK;EAC5E,MAAMC,OAAO,GAAG,MAAMF,IAAI,CACvBG,WAAW,CAAC;IACXC,SAAS,EAAE,CAAC,CAAC;IACbC,OAAO,EAAE,OAAO;IAChBC,IAAI,EAAE,eAAe;IACrBL,cAAc;IACdM,aAAa,EAAE,CAAC,CAAC;IACjBC,WAAW,EAAE;EACf,CAAC,CAAC,CACDC,KAAK,CAAEC,CAAC,IAAK;IACZ;IACA,IAAIA,CAAC,YAAYC,4BAAQ,IAAID,CAAC,CAACE,IAAI,KAAKC,uBAAY,CAACC,sBAAsB,EAAE;MAC3E,OAAO,IAAI;IACb;IACA,MAAMJ,CAAC;EACT,CAAC,CAAC;EAEJ,IAAIR,OAAO,EAAE;IACX,OAAOF,IAAI,CAACe,gBAAgB,CAAC;MAC3BC,GAAG,EAAE;QACHC,MAAM,EAAE,KAAK;QACbC,IAAI,EA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