@procivis/one-react-native-components 0.3.121 → 0.3.132

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 (246) hide show
  1. package/lib/commonjs/components/credential/credential.js +2 -1
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/history/history-list-item-icon.js +3 -3
  4. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  5. package/lib/commonjs/components/history/history-list-item.js +5 -12
  6. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  7. package/lib/commonjs/components/history/history-list-screen.js +1 -1
  8. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  9. package/lib/commonjs/components/index.js +0 -11
  10. package/lib/commonjs/components/index.js.map +1 -1
  11. package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -1
  12. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  13. package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -1
  14. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  15. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -1
  16. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  17. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +3 -1
  18. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  19. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +7 -3
  20. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  21. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
  22. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  23. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  24. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  25. package/lib/commonjs/ui-components/history/history-details.js +2 -2
  26. package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
  27. package/lib/commonjs/ui-components/history/history-section-list-item.js +2 -2
  28. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  29. package/lib/commonjs/ui-components/history/index.js +0 -8
  30. package/lib/commonjs/ui-components/history/index.js.map +1 -1
  31. package/lib/commonjs/ui-components/icons/contact.js.map +1 -1
  32. package/lib/commonjs/ui-components/icons/credential.js +3 -3
  33. package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
  34. package/lib/commonjs/ui-components/icons/icons.js +20 -1
  35. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  36. package/lib/commonjs/ui-components/list/index.js +8 -0
  37. package/lib/commonjs/ui-components/list/index.js.map +1 -1
  38. package/lib/commonjs/ui-components/{history/history-item.js → list/list-item.js} +32 -22
  39. package/lib/commonjs/ui-components/list/list-item.js.map +1 -0
  40. package/lib/commonjs/ui-components/loader/loading-result.js +2 -0
  41. package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
  42. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +7 -33
  43. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  44. package/lib/commonjs/utils/date.js +4 -5
  45. package/lib/commonjs/utils/date.js.map +1 -1
  46. package/lib/commonjs/utils/hooks/core/cache.js +7 -4
  47. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  48. package/lib/commonjs/utils/hooks/core/core-config.js +1 -6
  49. package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
  50. package/lib/commonjs/utils/hooks/core/core-context.js +0 -15
  51. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  52. package/lib/commonjs/utils/hooks/core/credentials.js +15 -1
  53. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  54. package/lib/commonjs/utils/hooks/core/index.js +0 -11
  55. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  56. package/lib/commonjs/utils/hooks/core/trust-list.js +19 -3
  57. package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
  58. package/lib/commonjs/utils/hooks/core/verifier-instance.js +22 -3
  59. package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -1
  60. package/lib/commonjs/utils/hooks/core/wallet-unit.js +2 -2
  61. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  62. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +23 -18
  63. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  64. package/lib/commonjs/utils/parsers/credential-sharing.js +20 -18
  65. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  66. package/lib/commonjs/utils/parsers/credential.js +36 -22
  67. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  68. package/lib/commonjs/utils/parsers/query.js +2 -2
  69. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  70. package/lib/commonjs/utils/translations.js +15 -0
  71. package/lib/commonjs/utils/translations.js.map +1 -0
  72. package/lib/module/components/credential/credential.js +2 -1
  73. package/lib/module/components/credential/credential.js.map +1 -1
  74. package/lib/module/components/history/history-list-item-icon.js +3 -3
  75. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  76. package/lib/module/components/history/history-list-item.js +7 -14
  77. package/lib/module/components/history/history-list-item.js.map +1 -1
  78. package/lib/module/components/history/history-list-screen.js +1 -1
  79. package/lib/module/components/history/history-list-screen.js.map +1 -1
  80. package/lib/module/components/index.js +0 -1
  81. package/lib/module/components/index.js.map +1 -1
  82. package/lib/module/components/proof-request/v1/select-credential.js +2 -1
  83. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  84. package/lib/module/components/proof-request/v1/share-credential.js +2 -1
  85. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  86. package/lib/module/components/proof-request/v2/select-credential-v2.js +2 -1
  87. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  88. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +3 -1
  89. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  90. package/lib/module/components/proof-request/v2/share-credential-v2.js +7 -3
  91. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  92. package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
  93. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  94. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  95. package/lib/module/ui-components/header/header.js.map +1 -1
  96. package/lib/module/ui-components/history/history-details.js +3 -3
  97. package/lib/module/ui-components/history/history-details.js.map +1 -1
  98. package/lib/module/ui-components/history/history-section-list-item.js +2 -2
  99. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  100. package/lib/module/ui-components/history/index.js +0 -2
  101. package/lib/module/ui-components/history/index.js.map +1 -1
  102. package/lib/module/ui-components/icons/contact.js.map +1 -1
  103. package/lib/module/ui-components/icons/credential.js +1 -1
  104. package/lib/module/ui-components/icons/credential.js.map +1 -1
  105. package/lib/module/ui-components/icons/icons.js +18 -0
  106. package/lib/module/ui-components/icons/icons.js.map +1 -1
  107. package/lib/module/ui-components/list/index.js +2 -0
  108. package/lib/module/ui-components/list/index.js.map +1 -1
  109. package/lib/module/ui-components/{history/history-item.js → list/list-item.js} +32 -22
  110. package/lib/module/ui-components/list/list-item.js.map +1 -0
  111. package/lib/module/ui-components/loader/loading-result.js +2 -0
  112. package/lib/module/ui-components/loader/loading-result.js.map +1 -1
  113. package/lib/module/ui-components/screens/nerd-mode-screen.js +7 -33
  114. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  115. package/lib/module/utils/date.js +4 -5
  116. package/lib/module/utils/date.js.map +1 -1
  117. package/lib/module/utils/hooks/core/cache.js +7 -4
  118. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  119. package/lib/module/utils/hooks/core/core-config.js +0 -4
  120. package/lib/module/utils/hooks/core/core-config.js.map +1 -1
  121. package/lib/module/utils/hooks/core/core-context.js +0 -15
  122. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  123. package/lib/module/utils/hooks/core/credentials.js +13 -0
  124. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  125. package/lib/module/utils/hooks/core/index.js +0 -1
  126. package/lib/module/utils/hooks/core/index.js.map +1 -1
  127. package/lib/module/utils/hooks/core/trust-list.js +20 -4
  128. package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
  129. package/lib/module/utils/hooks/core/verifier-instance.js +20 -2
  130. package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -1
  131. package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
  132. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  133. package/lib/module/utils/parsers/credential-sharing-v2.js +24 -19
  134. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  135. package/lib/module/utils/parsers/credential-sharing.js +20 -18
  136. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  137. package/lib/module/utils/parsers/credential.js +37 -23
  138. package/lib/module/utils/parsers/credential.js.map +1 -1
  139. package/lib/module/utils/parsers/query.js +2 -2
  140. package/lib/module/utils/parsers/query.js.map +1 -1
  141. package/lib/module/utils/translations.js +8 -0
  142. package/lib/module/utils/translations.js.map +1 -0
  143. package/lib/typescript/components/credential/credential.d.ts +1 -0
  144. package/lib/typescript/components/history/history-list-item.d.ts +1 -1
  145. package/lib/typescript/components/index.d.ts +0 -1
  146. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +1 -0
  147. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +1 -0
  148. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +1 -0
  149. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +1 -0
  150. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +1 -0
  151. package/lib/typescript/ui-components/history/history-details.d.ts +2 -2
  152. package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
  153. package/lib/typescript/ui-components/history/index.d.ts +0 -3
  154. package/lib/typescript/ui-components/icons/credential.d.ts +1 -1
  155. package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
  156. package/lib/typescript/ui-components/list/index.d.ts +3 -0
  157. package/lib/typescript/ui-components/{history/history-item.d.ts → list/list-item.d.ts} +4 -4
  158. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +0 -12
  159. package/lib/typescript/utils/hooks/core/core-config.d.ts +0 -1
  160. package/lib/typescript/utils/hooks/core/core-context.d.ts +0 -1
  161. package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -0
  162. package/lib/typescript/utils/hooks/core/index.d.ts +0 -1
  163. package/lib/typescript/utils/hooks/core/trust-list.d.ts +1 -4
  164. package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +2 -0
  165. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +2 -2
  166. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +3 -3
  167. package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
  168. package/lib/typescript/utils/parsers/credential.d.ts +5 -5
  169. package/lib/typescript/utils/parsers/query.d.ts +2 -2
  170. package/lib/typescript/utils/translations.d.ts +1 -0
  171. package/package.json +3 -3
  172. package/src/components/credential/credential.tsx +3 -0
  173. package/src/components/history/history-list-item-icon.tsx +2 -2
  174. package/src/components/history/history-list-item.tsx +7 -12
  175. package/src/components/history/history-list-screen.tsx +1 -1
  176. package/src/components/index.ts +0 -1
  177. package/src/components/proof-request/v1/select-credential.tsx +3 -1
  178. package/src/components/proof-request/v1/share-credential.tsx +3 -0
  179. package/src/components/proof-request/v2/select-credential-v2.tsx +3 -1
  180. package/src/components/proof-request/v2/share-credential-v2-group.tsx +4 -0
  181. package/src/components/proof-request/v2/share-credential-v2.tsx +7 -0
  182. package/src/ui-components/credential/card/credential-details-card.tsx +3 -2
  183. package/src/ui-components/header/foldable-header.tsx +10 -9
  184. package/src/ui-components/header/header.tsx +10 -1
  185. package/src/ui-components/history/history-details.tsx +4 -4
  186. package/src/ui-components/history/history-section-list-item.tsx +3 -3
  187. package/src/ui-components/history/index.ts +0 -3
  188. package/src/ui-components/icons/contact.tsx +1 -1
  189. package/src/ui-components/icons/credential.tsx +1 -1
  190. package/src/ui-components/icons/icons.tsx +18 -0
  191. package/src/ui-components/list/index.ts +3 -0
  192. package/src/ui-components/{history/history-item.tsx → list/list-item.tsx} +36 -33
  193. package/src/ui-components/loader/loading-result.tsx +7 -1
  194. package/src/ui-components/screens/nerd-mode-screen.tsx +2 -52
  195. package/src/utils/date.ts +7 -14
  196. package/src/utils/hooks/core/cache.ts +10 -3
  197. package/src/utils/hooks/core/core-config.ts +1 -6
  198. package/src/utils/hooks/core/core-context.tsx +0 -24
  199. package/src/utils/hooks/core/credentials.ts +13 -0
  200. package/src/utils/hooks/core/index.ts +0 -1
  201. package/src/utils/hooks/core/trust-list.ts +22 -11
  202. package/src/utils/hooks/core/verifier-instance.ts +23 -2
  203. package/src/utils/hooks/core/wallet-unit.ts +3 -3
  204. package/src/utils/parsers/credential-sharing-v2.tsx +34 -14
  205. package/src/utils/parsers/credential-sharing.tsx +33 -16
  206. package/src/utils/parsers/credential.ts +45 -14
  207. package/src/utils/parsers/query.ts +5 -0
  208. package/src/utils/translations.ts +10 -0
  209. package/lib/commonjs/components/entity/EntityButtons.js +0 -64
  210. package/lib/commonjs/components/entity/EntityButtons.js.map +0 -1
  211. package/lib/commonjs/components/entity/entity-attributes.js +0 -65
  212. package/lib/commonjs/components/entity/entity-attributes.js.map +0 -1
  213. package/lib/commonjs/components/entity/entity-details-with-buttons.js +0 -67
  214. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +0 -1
  215. package/lib/commonjs/components/entity/entity-details.js +0 -101
  216. package/lib/commonjs/components/entity/entity-details.js.map +0 -1
  217. package/lib/commonjs/components/entity/index.js +0 -14
  218. package/lib/commonjs/components/entity/index.js.map +0 -1
  219. package/lib/commonjs/ui-components/history/history-item.js.map +0 -1
  220. package/lib/commonjs/utils/hooks/core/trust-entity.js +0 -147
  221. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +0 -1
  222. package/lib/module/components/entity/EntityButtons.js +0 -56
  223. package/lib/module/components/entity/EntityButtons.js.map +0 -1
  224. package/lib/module/components/entity/entity-attributes.js +0 -57
  225. package/lib/module/components/entity/entity-attributes.js.map +0 -1
  226. package/lib/module/components/entity/entity-details-with-buttons.js +0 -58
  227. package/lib/module/components/entity/entity-details-with-buttons.js.map +0 -1
  228. package/lib/module/components/entity/entity-details.js +0 -92
  229. package/lib/module/components/entity/entity-details.js.map +0 -1
  230. package/lib/module/components/entity/index.js +0 -3
  231. package/lib/module/components/entity/index.js.map +0 -1
  232. package/lib/module/ui-components/history/history-item.js.map +0 -1
  233. package/lib/module/utils/hooks/core/trust-entity.js +0 -136
  234. package/lib/module/utils/hooks/core/trust-entity.js.map +0 -1
  235. package/lib/typescript/components/entity/EntityButtons.d.ts +0 -14
  236. package/lib/typescript/components/entity/entity-attributes.d.ts +0 -15
  237. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +0 -18
  238. package/lib/typescript/components/entity/entity-details.d.ts +0 -21
  239. package/lib/typescript/components/entity/index.d.ts +0 -3
  240. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +0 -17
  241. package/src/components/entity/EntityButtons.tsx +0 -79
  242. package/src/components/entity/entity-attributes.tsx +0 -80
  243. package/src/components/entity/entity-details-with-buttons.tsx +0 -75
  244. package/src/components/entity/entity-details.tsx +0 -145
  245. package/src/components/entity/index.ts +0 -4
  246. package/src/utils/hooks/core/trust-entity.ts +0 -172
@@ -1,58 +0,0 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import { TrustEntityRole, TrustEntityState } from '@procivis/react-native-one-core';
3
- import React, { memo } from 'react';
4
- import { View } from 'react-native';
5
- import { useAppColorScheme } from '../../ui-components/theme/color-scheme-context';
6
- import { concatTestID, useIdentifierDetails } from '../../utils';
7
- import { useTrustEntity } from '../../utils/hooks/core/trust-entity';
8
- import EntityAttributes from './entity-attributes';
9
- import EntityDetails from './entity-details';
10
- import EntityButtons from './EntityButtons';
11
- const EntityDetailsWithButtons = ({
12
- identifier,
13
- entityLabels,
14
- attributesLabels,
15
- onCopyToClipboard,
16
- role,
17
- entityType,
18
- testID,
19
- ...props
20
- }) => {
21
- var _identifierDetail$cer, _identifierDetail$did;
22
- let {
23
- data
24
- } = useTrustEntity(identifier === null || identifier === void 0 ? void 0 : identifier.id);
25
- let {
26
- data: identifierDetail
27
- } = useIdentifierDetails(identifier === null || identifier === void 0 ? void 0 : identifier.id);
28
- const trustEntity = data !== null && data !== void 0 ? data : undefined;
29
- const colorScheme = useAppColorScheme();
30
- const trusted = Boolean(trustEntity && trustEntity.state === TrustEntityState.ACTIVE && (trustEntity.role === TrustEntityRole.BOTH || trustEntity.role === role));
31
- return /*#__PURE__*/React.createElement(View, {
32
- style: {
33
- backgroundColor: colorScheme.nerdView.background
34
- }
35
- }, /*#__PURE__*/React.createElement(EntityDetails, _extends({
36
- identifier: identifier,
37
- labels: {
38
- unknown: role === TrustEntityRole.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier
39
- },
40
- role: role,
41
- testID: testID
42
- }, props)), trusted && /*#__PURE__*/React.createElement(EntityButtons, {
43
- entity: trustEntity,
44
- labels: entityLabels,
45
- testID: concatTestID(testID, 'links')
46
- }), /*#__PURE__*/React.createElement(EntityAttributes, {
47
- certificate: identifierDetail === null || identifierDetail === void 0 || (_identifierDetail$cer = identifierDetail.certificates) === null || _identifierDetail$cer === void 0 || (_identifierDetail$cer = _identifierDetail$cer[0]) === null || _identifierDetail$cer === void 0 ? void 0 : _identifierDetail$cer.chain,
48
- did: identifierDetail === null || identifierDetail === void 0 || (_identifierDetail$did = identifierDetail.did) === null || _identifierDetail$did === void 0 ? void 0 : _identifierDetail$did.did,
49
- trustEntity: trustEntity,
50
- trusted: trusted,
51
- labels: attributesLabels,
52
- onCopyToClipboard: onCopyToClipboard,
53
- entityType: entityType,
54
- testID: testID
55
- }));
56
- };
57
- export default /*#__PURE__*/memo(EntityDetailsWithButtons);
58
- //# sourceMappingURL=entity-details-with-buttons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TrustEntityRole","TrustEntityState","React","memo","View","useAppColorScheme","concatTestID","useIdentifierDetails","useTrustEntity","EntityAttributes","EntityDetails","EntityButtons","EntityDetailsWithButtons","identifier","entityLabels","attributesLabels","onCopyToClipboard","role","entityType","testID","props","_identifierDetail$cer","_identifierDetail$did","data","id","identifierDetail","trustEntity","undefined","colorScheme","trusted","Boolean","state","ACTIVE","BOTH","createElement","style","backgroundColor","nerdView","background","_extends","labels","unknown","ISSUER","unknownIssuer","unknownVerifier","entity","certificate","certificates","chain","did"],"sources":["entity-details-with-buttons.tsx"],"sourcesContent":["import { IdentifierListItem, TrustEntityRole, TrustEntityState } from '@procivis/react-native-one-core';\nimport React, { FC, memo } from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\n\nimport { AttributesLabels, EntityLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';\nimport { useAppColorScheme } from '../../ui-components/theme/color-scheme-context';\nimport { concatTestID, useIdentifierDetails } from '../../utils';\nimport { useTrustEntity } from '../../utils/hooks/core/trust-entity';\nimport EntityAttributes from './entity-attributes';\nimport EntityDetails from './entity-details';\nimport EntityButtons from './EntityButtons';\n\nexport type ContextRole = Exclude<TrustEntityRole, TrustEntityRole.BOTH>;\n\ninterface EntityDetailsWithButtonsProps {\n identifier?: IdentifierListItem;\n entityLabels: EntityLabels;\n attributesLabels: AttributesLabels;\n style?: StyleProp<ViewStyle>;\n textColor?: string;\n testID?: string;\n role: ContextRole;\n onCopyToClipboard: (value: string) => void;\n entityType: EntityType;\n}\n\nconst EntityDetailsWithButtons: FC<EntityDetailsWithButtonsProps> = ({\n identifier,\n entityLabels,\n attributesLabels,\n onCopyToClipboard,\n role,\n entityType,\n testID,\n ...props\n}) => {\n let { data } = useTrustEntity(identifier?.id);\n let { data: identifierDetail } = useIdentifierDetails(identifier?.id);\n const trustEntity = data ?? undefined;\n\n const colorScheme = useAppColorScheme();\n\n const trusted = Boolean(\n trustEntity &&\n trustEntity.state === TrustEntityState.ACTIVE &&\n (trustEntity.role === TrustEntityRole.BOTH || trustEntity.role === role),\n );\n\n return (\n <View style={{ backgroundColor: colorScheme.nerdView.background }}>\n <EntityDetails\n identifier={identifier}\n labels={{\n unknown: role === TrustEntityRole.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier,\n }}\n role={role}\n testID={testID}\n {...props}\n />\n {trusted && <EntityButtons entity={trustEntity} labels={entityLabels} testID={concatTestID(testID, 'links')} />}\n <EntityAttributes\n certificate={identifierDetail?.certificates?.[0]?.chain}\n did={identifierDetail?.did?.did}\n trustEntity={trustEntity}\n trusted={trusted}\n labels={attributesLabels}\n onCopyToClipboard={onCopyToClipboard}\n entityType={entityType}\n testID={testID}\n />\n </View>\n );\n};\n\nexport default memo(EntityDetailsWithButtons);\n"],"mappings":";AAAA,SAA6BA,eAAe,EAAEC,gBAAgB,QAAQ,iCAAiC;AACvG,OAAOC,KAAK,IAAQC,IAAI,QAAQ,OAAO;AACvC,SAAoBC,IAAI,QAAmB,cAAc;AAGzD,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,SAASC,YAAY,EAAEC,oBAAoB,QAAQ,aAAa;AAChE,SAASC,cAAc,QAAQ,qCAAqC;AACpE,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,aAAa,MAAM,iBAAiB;AAgB3C,MAAMC,wBAA2D,GAAGA,CAAC;EACnEC,UAAU;EACVC,YAAY;EACZC,gBAAgB;EAChBC,iBAAiB;EACjBC,IAAI;EACJC,UAAU;EACVC,MAAM;EACN,GAAGC;AACL,CAAC,KAAK;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACJ,IAAI;IAAEC;EAAK,CAAC,GAAGf,cAAc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B,CAAEsB,YAAY,cAAA1B,qBAAA,gBAAAA,qBAAA,GAA9BA,qBAAA,CAAiC,CAAC,CAAC,cAAAA,qBAAA,uBAAnCA,qBAAA,CAAqC2B,KAAM;IACxDC,GAAG,EAAExB,gBAAgB,aAAhBA,gBAAgB,gBAAAH,qBAAA,GAAhBG,gBAAgB,CAAEwB,GAAG,cAAA3B,qBAAA,uBAArBA,qBAAA,CAAuB2B,GAAI;IAChCvB,WAAW,EAAEA,WAAY;IACzBG,OAAO,EAAEA,OAAQ;IACjBW,MAAM,EAAEzB,gBAAiB;IACzBC,iBAAiB,EAAEA,iBAAkB;IACrCE,UAAU,EAAEA,UAAW;IACvBC,MAAM,EAAEA;EAAO,CAChB,CACG,CAAC;AAEX,CAAC;AAED,4BAAehB,IAAI,CAACS,wBAAwB,CAAC","ignoreList":[]}
@@ -1,92 +0,0 @@
1
- import { IdentifierType, TrustEntityRole, TrustEntityState } from '@procivis/react-native-one-core';
2
- import React, { useMemo } from 'react';
3
- import EntityCluster from '../../ui-components/entity/entity-cluster';
4
- import { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';
5
- import { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';
6
- import { useTrustEntity } from '../../utils/hooks/core/trust-entity';
7
- const getCertificateCommonName = certificate => {
8
- var _certificate$x509Attr;
9
- return (_certificate$x509Attr = certificate.x509Attributes.subject.split(', ').find(s => s.startsWith('CN'))) === null || _certificate$x509Attr === void 0 || (_certificate$x509Attr = _certificate$x509Attr.split('=')) === null || _certificate$x509Attr === void 0 ? void 0 : _certificate$x509Attr.pop();
10
- };
11
- const EntityDetails = ({
12
- labels,
13
- renderMore,
14
- role,
15
- style,
16
- testID,
17
- sublineColor,
18
- textColor,
19
- ...props
20
- }) => {
21
- var _props$identifier, _props$identifier2;
22
- const {
23
- data,
24
- isLoading: isLoadingTrustEntity
25
- } = useTrustEntity('identifier' in props ? (_props$identifier = props.identifier) === null || _props$identifier === void 0 ? void 0 : _props$identifier.id : undefined);
26
- const trustEntity = 'entity' in props ? props.entity : data !== null && data !== void 0 ? data : undefined;
27
- const {
28
- data: identifierDetail,
29
- isLoading: isLoadingIdentifier
30
- } = useIdentifierDetails('identifier' in props ? (_props$identifier2 = props.identifier) === null || _props$identifier2 === void 0 ? void 0 : _props$identifier2.id : undefined);
31
- const trusted = trustEntity && trustEntity.state === TrustEntityState.ACTIVE && (trustEntity.role === TrustEntityRole.BOTH || trustEntity.role === role);
32
- const isLoading = isLoadingIdentifier || isLoadingTrustEntity;
33
- const avatarProps = useMemo(() => {
34
- var _identifierDetail$cer, _getCertificateCommon;
35
- if (isLoading) {
36
- return undefined;
37
- }
38
- const avatar = trusted && (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === 'DID' && trustEntity.logo ? {
39
- imageSource: {
40
- uri: trustEntity.logo
41
- }
42
- } : undefined;
43
- const placeholderText = (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierType.CERTIFICATE && (_identifierDetail$cer = identifierDetail.certificates) !== null && _identifierDetail$cer !== void 0 && _identifierDetail$cer[0] ? (_getCertificateCommon = getCertificateCommonName(identifierDetail.certificates[0])) === null || _getCertificateCommon === void 0 ? void 0 : _getCertificateCommon.substring(0, 1) : 'D';
44
- const statusIcon = trusted ? /*#__PURE__*/React.createElement(EntityTrustedIcon, {
45
- testID: concatTestID(testID, 'statusIcon', 'trusted')
46
- }) : /*#__PURE__*/React.createElement(EntityNotTrustedIcon, {
47
- testID: concatTestID(testID, 'statusIcon', 'notTrusted')
48
- });
49
- if (trustEntity) {
50
- return {
51
- avatar,
52
- placeholderText: trusted && (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === 'DID' ? trustEntity.name.substring(0, 1) : placeholderText,
53
- statusIcon,
54
- testID: concatTestID(testID, 'avatar')
55
- };
56
- }
57
- return {
58
- placeholderText,
59
- statusIcon
60
- };
61
- }, [trustEntity, trusted, identifierDetail, isLoading, testID]);
62
- const trustEntityName = useMemo(() => {
63
- var _identifierDetail$cer2, _identifierDetail$did;
64
- if (isLoading) {
65
- return '';
66
- }
67
- if ((identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierType.CERTIFICATE && (_identifierDetail$cer2 = identifierDetail.certificates) !== null && _identifierDetail$cer2 !== void 0 && _identifierDetail$cer2[0]) {
68
- const commonName = getCertificateCommonName(identifierDetail.certificates[0]);
69
- if (commonName) {
70
- return commonName;
71
- }
72
- }
73
- if (trustEntity) {
74
- return trustEntity.name;
75
- }
76
- if (identifierDetail !== null && identifierDetail !== void 0 && (_identifierDetail$did = identifierDetail.did) !== null && _identifierDetail$did !== void 0 && _identifierDetail$did.did) {
77
- return replaceBreakingHyphens(identifierDetail.did.did);
78
- }
79
- return labels.unknown;
80
- }, [labels.unknown, trustEntity, identifierDetail, isLoading]);
81
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EntityCluster, {
82
- avatar: avatarProps,
83
- entityName: trustEntityName,
84
- style: style,
85
- testID: testID,
86
- textColor: textColor,
87
- sublineColor: sublineColor,
88
- isLoading: isLoading
89
- }), trustEntity && renderMore && renderMore(trustEntity));
90
- };
91
- export default EntityDetails;
92
- //# sourceMappingURL=entity-details.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["IdentifierType","TrustEntityRole","TrustEntityState","React","useMemo","EntityCluster","EntityNotTrustedIcon","EntityTrustedIcon","concatTestID","replaceBreakingHyphens","useIdentifierDetails","useTrustEntity","getCertificateCommonName","certificate","_certificate$x509Attr","x509Attributes","subject","split","find","s","startsWith","pop","EntityDetails","labels","renderMore","role","style","testID","sublineColor","textColor","props","_props$identifier","_props$identifier2","data","isLoading","isLoadingTrustEntity","identifier","id","undefined","trustEntity","entity","identifierDetail","isLoadingIdentifier","trusted","state","ACTIVE","BOTH","avatarProps","_identifierDetail$cer","_getCertificateCommon","avatar","type","logo","imageSource","uri","placeholderText","CERTIFICATE","certificates","substring","statusIcon","createElement","name","trustEntityName","_identifierDetail$cer2","_identifierDetail$did","commonName","did","unknown","Fragment","entityName"],"sources":["entity-details.tsx"],"sourcesContent":["import {\n CertificateDetail,\n IdentifierListItem,\n IdentifierType,\n TrustEntityDetail,\n TrustEntityRole,\n TrustEntityState,\n} from '@procivis/react-native-one-core';\nimport React, { FC, ReactNode, useMemo } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\n\nimport { AvatarProps } from '../../ui-components';\nimport EntityCluster from '../../ui-components/entity/entity-cluster';\nimport { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';\nimport { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';\nimport { useTrustEntity } from '../../utils/hooks/core/trust-entity';\n\nexport type EntityDetailsLabels = {\n unknown: string;\n};\n\nexport type EntityDetailsProps = {\n labels: EntityDetailsLabels;\n renderMore?: (trustEntity: TrustEntityDetail) => ReactNode;\n role: Exclude<TrustEntityRole, TrustEntityRole.BOTH>;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n textColor?: string;\n testID?: string;\n} & (\n | {\n identifier?: IdentifierListItem;\n }\n | {\n entity: TrustEntityDetail;\n }\n);\n\nconst getCertificateCommonName = (certificate: CertificateDetail): string | undefined => {\n return certificate.x509Attributes.subject\n .split(', ')\n .find((s) => s.startsWith('CN'))\n ?.split('=')\n ?.pop();\n};\n\nconst EntityDetails: FC<EntityDetailsProps> = ({\n labels,\n renderMore,\n role,\n style,\n testID,\n sublineColor,\n textColor,\n ...props\n}) => {\n const { data, isLoading: isLoadingTrustEntity } = useTrustEntity(\n 'identifier' in props ? props.identifier?.id : undefined,\n );\n const trustEntity = 'entity' in props ? props.entity : data ?? undefined;\n const { data: identifierDetail, isLoading: isLoadingIdentifier } = useIdentifierDetails(\n 'identifier' in props ? props.identifier?.id : undefined,\n );\n\n const trusted =\n trustEntity &&\n trustEntity.state === TrustEntityState.ACTIVE &&\n (trustEntity.role === TrustEntityRole.BOTH || trustEntity.role === role);\n\n const isLoading = isLoadingIdentifier || isLoadingTrustEntity;\n\n const avatarProps: AvatarProps | undefined = useMemo(() => {\n if (isLoading) {\n return undefined;\n }\n\n const avatar =\n trusted && identifierDetail?.type === 'DID' && trustEntity.logo\n ? { imageSource: { uri: trustEntity.logo } }\n : undefined;\n\n const placeholderText =\n identifierDetail?.type === IdentifierType.CERTIFICATE && identifierDetail.certificates?.[0]\n ? getCertificateCommonName(identifierDetail.certificates[0])?.substring(0, 1)\n : 'D';\n\n const statusIcon = trusted ? (\n <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />\n ) : (\n <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />\n );\n\n if (trustEntity) {\n return {\n avatar,\n placeholderText:\n trusted && identifierDetail?.type === 'DID' ? trustEntity.name.substring(0, 1) : placeholderText,\n statusIcon,\n testID: concatTestID(testID, 'avatar'),\n };\n }\n\n return {\n placeholderText,\n statusIcon,\n };\n }, [trustEntity, trusted, identifierDetail, isLoading, testID]);\n\n const trustEntityName = useMemo(() => {\n if (isLoading) {\n return '';\n }\n if (identifierDetail?.type === IdentifierType.CERTIFICATE && identifierDetail.certificates?.[0]) {\n const commonName = getCertificateCommonName(identifierDetail.certificates[0]);\n if (commonName) {\n return commonName;\n }\n }\n if (trustEntity) {\n return trustEntity.name;\n }\n if (identifierDetail?.did?.did) {\n return replaceBreakingHyphens(identifierDetail.did.did);\n }\n\n return labels.unknown;\n }, [labels.unknown, trustEntity, identifierDetail, isLoading]);\n\n return (\n <>\n <EntityCluster\n avatar={avatarProps}\n entityName={trustEntityName}\n style={style}\n testID={testID}\n textColor={textColor}\n sublineColor={sublineColor}\n isLoading={isLoading}\n />\n {trustEntity && renderMore && renderMore(trustEntity)}\n </>\n );\n};\n\nexport default EntityDetails;\n"],"mappings":"AAAA,SAGEA,cAAc,EAEdC,eAAe,EACfC,gBAAgB,QACX,iCAAiC;AACxC,OAAOC,KAAK,IAAmBC,OAA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AArBA,qBAAA,CAAuBE,GAAG,EAAE;MAC9B,OAAOzD,sBAAsB,CAACgC,gBAAgB,CAACyB,GAAG,CAACA,GAAG,CAAC;IACzD;IAEA,OAAO3C,MAAM,CAAC4C,OAAO;EACvB,CAAC,EAAE,CAAC5C,MAAM,CAAC4C,OAAO,EAAE5B,WAAW,EAAEE,gBAAgB,EAAEP,SAAS,CAAC,CAAC;EAE9D,oBACE/B,KAAA,CAAAyD,aAAA,CAAAzD,KAAA,CAAAiE,QAAA,qBACEjE,KAAA,CAAAyD,aAAA,CAACvD,aAAa;IACZ6C,MAAM,EAAEH,WAAY;IACpBsB,UAAU,EAAEP,eAAgB;IAC5BpC,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfE,SAAS,EAAEA,SAAU;IACrBD,YAAY,EAAEA,YAAa;IAC3BM,SAAS,EAAEA;EAAU,CACtB,CAAC,EACDK,WAAW,IAAIf,UAAU,IAAIA,UAAU,CAACe,WAAW,CACpD,CAAC;AAEP,CAAC;AAED,eAAejB,aAAa","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import EntityDetails from './entity-details';
2
- export { EntityDetails };
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["EntityDetails"],"sources":["index.ts"],"sourcesContent":["import type { EntityDetailsLabels, EntityDetailsProps } from './entity-details';\nimport EntityDetails from './entity-details';\n\nexport { EntityDetails, EntityDetailsLabels, EntityDetailsProps };\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,kBAAkB;AAE5C,SAASA,aAAa","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","TouchableOpacity","Typography","useAppColorScheme","HistoryItemView","first","icon","label","info","last","style","time","onPress","testID","colorScheme","iconView","isValidElement","IconComponent","createElement","disabled","styles","historyItemContainer","backgroundColor","white","containerFirst","containerLast","historyItemWrapper","borderColor","background","wrapperLast","labelAndInfo","color","text","numberOfLines","preset","Boolean","shaded","create","borderTopLeftRadius","borderTopRightRadius","marginTop","paddingTop","borderBottomLeftRadius","borderBottomRightRadius","marginBottom","paddingBottom","paddingHorizontal","alignItems","borderBottomWidth","flexDirection","paddingVertical","flex","marginHorizontal","opacity","marginRight"],"sources":["history-item.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type HistoryItemViewProps = {\n first?: boolean;\n icon: ComponentType<any> | ReactElement;\n info?: string;\n label: string;\n last?: boolean;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n time: string;\n};\n\nconst HistoryItemView: FC<HistoryItemViewProps> = ({\n first,\n icon,\n label,\n info,\n last,\n style,\n time,\n onPress,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const iconView: ReactElement | undefined = useMemo(() => {\n if (React.isValidElement(icon)) {\n return icon;\n } else if (icon) {\n const IconComponent = icon as ComponentType<any>;\n return <IconComponent />;\n }\n }, [icon]);\n\n return (\n <TouchableOpacity\n disabled={!onPress}\n onPress={() => onPress?.()}\n style={[\n styles.historyItemContainer,\n {\n backgroundColor: colorScheme.white,\n },\n first && styles.containerFirst,\n last && styles.containerLast,\n style,\n ]}\n testID={testID}>\n <View\n style={[\n styles.historyItemWrapper,\n {\n backgroundColor: colorScheme.white,\n borderColor: colorScheme.background,\n },\n last && styles.wrapperLast,\n ]}>\n {iconView}\n <View style={styles.labelAndInfo}>\n <Typography\n color={colorScheme.text}\n numberOfLines={1}\n preset=\"s\"\n style={styles.label}\n testID={concatTestID(testID, 'label')}>\n {label}\n </Typography>\n {Boolean(info) && (\n <Typography\n color={colorScheme.text}\n numberOfLines={1}\n preset=\"s/line-height-small\"\n style={styles.shaded}\n testID={concatTestID(testID, 'info')}>\n {info}\n </Typography>\n )}\n </View>\n <Typography\n color={colorScheme.text}\n numberOfLines={1}\n preset=\"xs/line-height-small\"\n style={styles.time}\n testID={concatTestID(testID, 'timeLabel')}>\n {time}\n </Typography>\n </View>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n containerFirst: {\n borderTopLeftRadius: 20,\n borderTopRightRadius: 20,\n marginTop: 8,\n paddingTop: 12,\n },\n containerLast: {\n borderBottomLeftRadius: 20,\n borderBottomRightRadius: 20,\n marginBottom: 12,\n paddingBottom: 12,\n },\n historyItemContainer: {\n paddingHorizontal: 12,\n },\n historyItemWrapper: {\n alignItems: 'center',\n borderBottomWidth: 1,\n flexDirection: 'row',\n paddingVertical: 12,\n },\n label: {\n marginBottom: 2,\n },\n labelAndInfo: {\n flex: 1,\n marginHorizontal: 12,\n },\n shaded: {\n opacity: 0.7,\n },\n time: {\n marginRight: 8,\n opacity: 0.7,\n },\n wrapperLast: {\n borderBottomWidth: 0,\n },\n});\n\nexport default HistoryItemView;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAqCC,OAAO,QAAQ,OAAO;AACvE,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAcjE,MAAMC,eAAyC,GAAGA,CAAC;EACjDC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,IAAI;EACJC,IAAI;EACJC,KAAK;EACLC,IAAI;EACJC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGX,iBAAiB,CAAC,CAAC;EAEvC,MAAMY,QAAkC,GAAGlB,OAAO,CAAC,MAAM;IACvD,iBAAID,KAAK,CAACoB,cAAc,CAACV,IAAI,CAAC,EAAE;MAC9B,OAAOA,IAAI;IACb,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B,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAe5C,eAAe","ignoreList":[]}
@@ -1,136 +0,0 @@
1
- import { IdentifierType, OneError } from '@procivis/react-native-one-core';
2
- import { useCallback } from 'react';
3
- import { useMutation, useQuery, useQueryClient } from 'react-query';
4
- import { reportException } from '../../reporting';
5
- import { useHTTPClient } from '../http/client';
6
- import { useONECore } from './core-context';
7
- import { OneErrorCode } from './error-code';
8
- import { HISTORY_LIST_QUERY_KEY } from './history';
9
- import { useIdentifierDetails } from './identifiers';
10
- export const TRUST_ENTITY_DETAIL_QUERY_KEY = 'trust-entity-detail';
11
- export const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = 'remote-trust-entity-detail';
12
- export const useCreateTrustAnchor = () => {
13
- const httpClient = useHTTPClient();
14
- return useCallback(async (core, publisherReference) => {
15
- const trustAnchors = await core.listTrustAnchors({
16
- page: 0,
17
- pageSize: 1
18
- });
19
- if (trustAnchors.values.length > 0) {
20
- return;
21
- }
22
- const response = await httpClient.get(publisherReference);
23
- if (!response.ok || !response.data) {
24
- return;
25
- }
26
- const trustAnchor = response.data;
27
- await core.createTrustAnchor({
28
- isPublisher: false,
29
- name: trustAnchor.name,
30
- publisherReference,
31
- type: TrustManagementEnum.SimpleTrustList
32
- }).catch(err => {
33
- reportException(err, 'Failed to create trust anchor');
34
- throw err;
35
- });
36
- }, [httpClient]);
37
- };
38
- export const useTrustEntity = identifierId => {
39
- const {
40
- core
41
- } = useONECore();
42
- const {
43
- data: identifierDetail
44
- } = useIdentifierDetails(identifierId);
45
- return useQuery([TRUST_ENTITY_DETAIL_QUERY_KEY, identifierId], () => {
46
- var _identifierDetail$cer;
47
- return identifierId && identifierDetail ? core.resolveTrustEntityByIdentifier({
48
- identifiers: [{
49
- certificateId: (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierType.CERTIFICATE ? (_identifierDetail$cer = identifierDetail.certificates) === null || _identifierDetail$cer === void 0 || (_identifierDetail$cer = _identifierDetail$cer[0]) === null || _identifierDetail$cer === void 0 ? void 0 : _identifierDetail$cer.id : undefined,
50
- id: identifierId
51
- }]
52
- }).then(result => {
53
- var _result$identifierId$, _result$identifierId;
54
- return (_result$identifierId$ = (_result$identifierId = result[identifierId]) === null || _result$identifierId === void 0 || (_result$identifierId = _result$identifierId[0]) === null || _result$identifierId === void 0 ? void 0 : _result$identifierId.trustEntity) !== null && _result$identifierId$ !== void 0 ? _result$identifierId$ : null;
55
- }).catch(e => {
56
- if (e instanceof OneError && e.code === OneErrorCode.NoTrustEntityFound) {
57
- return null;
58
- }
59
- throw e;
60
- }) : undefined;
61
- }, {
62
- enabled: Boolean(identifierDetail),
63
- keepPreviousData: true
64
- });
65
- };
66
- export const useRemoteTrustEntity = identifierId => {
67
- const {
68
- core
69
- } = useONECore();
70
- const {
71
- data: identifierDetail
72
- } = useIdentifierDetails(identifierId);
73
- return useQuery([REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, identifierId], () => identifierDetail !== null && identifierDetail !== void 0 && identifierDetail.did ? core.getRemoteTrustEntity(identifierDetail.did.id) : undefined, {
74
- enabled: Boolean(identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.did),
75
- keepPreviousData: true
76
- });
77
- };
78
- export const useCreateRemoteTrustEntity = () => {
79
- const queryClient = useQueryClient();
80
- const {
81
- core
82
- } = useONECore();
83
- return useMutation(async request => {
84
- const {
85
- identifierId,
86
- didId
87
- } = request;
88
- let entityDidId = didId;
89
- if (identifierId) {
90
- var _identifierDetail$did;
91
- const identifierDetail = await core.getIdentifier(identifierId);
92
- entityDidId = identifierDetail === null || identifierDetail === void 0 || (_identifierDetail$did = identifierDetail.did) === null || _identifierDetail$did === void 0 ? void 0 : _identifierDetail$did.id;
93
- }
94
- return core.createRemoteTrustEntity({
95
- ...request,
96
- didId: entityDidId
97
- });
98
- }, {
99
- onSuccess: async () => {
100
- await queryClient.invalidateQueries(REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY);
101
- await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
102
- }
103
- });
104
- };
105
- export const useUpdateRemoteTrustEntity = () => {
106
- const queryClient = useQueryClient();
107
- const {
108
- core
109
- } = useONECore();
110
- return useMutation(async request => {
111
- const {
112
- identifierId,
113
- didId
114
- } = request;
115
- let entityDidId = didId;
116
- if (identifierId) {
117
- var _identifierDetail$did2;
118
- const identifierDetail = await core.getIdentifier(identifierId);
119
- entityDidId = identifierDetail === null || identifierDetail === void 0 || (_identifierDetail$did2 = identifierDetail.did) === null || _identifierDetail$did2 === void 0 ? void 0 : _identifierDetail$did2.id;
120
- }
121
- return core.updateRemoteTrustEntity({
122
- ...request,
123
- didId: entityDidId
124
- });
125
- }, {
126
- onSuccess: async () => {
127
- await queryClient.invalidateQueries(REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY);
128
- await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
129
- }
130
- });
131
- };
132
- export let TrustManagementEnum = /*#__PURE__*/function (TrustManagementEnum) {
133
- TrustManagementEnum["SimpleTrustList"] = "SIMPLE_TRUST_LIST";
134
- return TrustManagementEnum;
135
- }({});
136
- //# sourceMappingURL=trust-entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["IdentifierType","OneError","useCallback","useMutation","useQuery","useQueryClient","reportException","useHTTPClient","useONECore","OneErrorCode","HISTORY_LIST_QUERY_KEY","useIdentifierDetails","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","useCreateTrustAnchor","httpClient","core","publisherReference","trustAnchors","listTrustAnchors","page","pageSize","values","length","response","get","ok","data","trustAnchor","createTrustAnchor","isPublisher","name","type","TrustManagementEnum","SimpleTrustList","catch","err","useTrustEntity","identifierId","identifierDetail","_identifierDetail$cer","resolveTrustEntityByIdentifier","identifiers","certificateId","CERTIFICATE","certificates","id","undefined","then","result","_result$identifierId$","_result$identifierId","trustEntity","e","code","NoTrustEntityFound","enabled","Boolean","keepPreviousData","useRemoteTrustEntity","did","getRemoteTrustEntity","useCreateRemoteTrustEntity","queryClient","request","didId","entityDidId","_identifierDetail$did","getIdentifier","createRemoteTrustEntity","onSuccess","invalidateQueries","useUpdateRemoteTrustEntity","_identifierDetail$did2","updateRemoteTrustEntity"],"sources":["trust-entity.ts"],"sourcesContent":["import {\n CreateRemoteTrustEntityRequest,\n IdentifierType,\n ONECore,\n OneError,\n TrustAnchorDetail,\n UpdateRemoteTrustEntityRequest,\n} from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useHTTPClient } from '../http/client';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\nimport { useIdentifierDetails } from './identifiers';\n\nexport const TRUST_ENTITY_DETAIL_QUERY_KEY = 'trust-entity-detail';\nexport const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = 'remote-trust-entity-detail';\n\nexport const useCreateTrustAnchor = () => {\n const httpClient = useHTTPClient();\n\n return useCallback(\n async (core: ONECore, publisherReference: string) => {\n const trustAnchors = await core.listTrustAnchors({\n page: 0,\n pageSize: 1,\n });\n if (trustAnchors.values.length > 0) {\n return;\n }\n const response = await httpClient.get<TrustAnchorDetail>(publisherReference);\n if (!response.ok || !response.data) {\n return;\n }\n const trustAnchor = response.data;\n await core\n .createTrustAnchor({\n isPublisher: false,\n name: trustAnchor.name,\n publisherReference,\n type: TrustManagementEnum.SimpleTrustList,\n })\n .catch((err) => {\n reportException(err, 'Failed to create trust anchor');\n throw err;\n });\n },\n [httpClient],\n );\n};\n\nexport const useTrustEntity = (identifierId: string | undefined) => {\n const { core } = useONECore();\n\n const { data: identifierDetail } = useIdentifierDetails(identifierId);\n\n return useQuery(\n [TRUST_ENTITY_DETAIL_QUERY_KEY, identifierId],\n () =>\n identifierId && identifierDetail\n ? core\n .resolveTrustEntityByIdentifier({\n identifiers: [\n {\n certificateId:\n identifierDetail?.type === IdentifierType.CERTIFICATE\n ? identifierDetail.certificates?.[0]?.id\n : undefined,\n id: identifierId,\n },\n ],\n })\n .then((result) => {\n return result[identifierId]?.[0]?.trustEntity ?? null;\n })\n .catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.NoTrustEntityFound) {\n return null;\n }\n throw e;\n })\n : undefined,\n {\n enabled: Boolean(identifierDetail),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useRemoteTrustEntity = (identifierId: string | undefined) => {\n const { core } = useONECore();\n\n const { data: identifierDetail } = useIdentifierDetails(identifierId);\n\n return useQuery(\n [REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, identifierId],\n () => (identifierDetail?.did ? core.getRemoteTrustEntity(identifierDetail.did.id) : undefined),\n {\n enabled: Boolean(identifierDetail?.did),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useCreateRemoteTrustEntity = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (request: Omit<CreateRemoteTrustEntityRequest, 'didId'> & { identifierId?: string; didId?: string }) => {\n const { identifierId, didId } = request;\n\n let entityDidId = didId;\n\n if (identifierId) {\n const identifierDetail = await core.getIdentifier(identifierId);\n entityDidId = identifierDetail?.did?.id;\n }\n\n return core.createRemoteTrustEntity({\n ...request,\n didId: entityDidId!,\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useUpdateRemoteTrustEntity = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (\n request: Omit<UpdateRemoteTrustEntityRequest, 'didId'> & {\n identifierId?: string;\n didId?: string;\n },\n ) => {\n const { identifierId, didId } = request;\n\n let entityDidId = didId;\n if (identifierId) {\n const identifierDetail = await core.getIdentifier(identifierId);\n entityDidId = identifierDetail?.did?.id;\n }\n\n return core.updateRemoteTrustEntity({\n ...request,\n didId: entityDidId!,\n });\n },\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport enum TrustManagementEnum {\n SimpleTrustList = 'SIMPLE_TRUST_LIST',\n}\n"],"mappings":"AAAA,SAEEA,cAAc,EAEdC,QAAQ,QAGH,iCAAiC;AACxC,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,YAAY,QAAQ,cAAc;AAC3C,SAASC,sBAAsB,QAAQ,WAAW;AAClD,SAASC,oBAAoB,QAAQ,eAAe;AAEpD,OAAO,MAAMC,6BAA6B,GAAG,qBAAqB;AAClE,OAAO,MAAMC,oCAAoC,GAAG,4BAA4B;AAEhF,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,UAAU,GAAGR,aAAa,CAAC,CAAC;EAElC,OAAOL,WAAW,CAChB,OAAOc,IAAa,EAAEC,kBAA0B,KAAK;IACnD,MAAMC,YAAY,GAAG,MAAMF,IAAI,CAACG,gBAAgB,CAAC;MAC/CC,IAAI,EAAE,CAAC;MACPC,QAAQ,EAAE;IACZ,CAAC,CAAC;IACF,IAAIH,YAAY,CAACI,MAAM,CAACC,MAAM,GAAG,CAAC,EAAE;MAClC;IACF;IACA,MAAMC,QAAQ,GAAG,MAAMT,UAAU,CAACU,GAAG,CAAoBR,kBAAkB,CAAC;IAC5E,IAAI,CAACO,QAAQ,CAACE,EAAE,IAAI,CAACF,QAAQ,CAACG,IAAI,EAAE;MAClC;IACF;IACA,M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AO9B,IAAI,CAAC0D,uBAAuB,CAAC;MAClC,GAAGV,OAAO;MACVC,KAAK,EAAEC;IACT,CAAC,CAAC;EACJ,CAAC,EACD;IACEI,SAAS,EAAE,MAAAA,CAAA,KAAY;MACrB,MAAMP,WAAW,CAACQ,iBAAiB,CAAC1D,oCAAoC,CAAC;MACzE,MAAMkD,WAAW,CAACQ,iBAAiB,CAAC7D,sBAAsB,CAAC;IAC7D;EACF,CACF,CAAC;AACH,CAAC;AAED,WAAYuB,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- import { TrustEntityDetail } from '@procivis/react-native-one-core';
2
- import React from 'react';
3
- import { EntityLabels } from '../../ui-components/screens/nerd-mode-screen';
4
- export interface EntityButton {
5
- url: string;
6
- label: string;
7
- }
8
- interface EntityButtonsProps {
9
- entity?: TrustEntityDetail;
10
- labels: EntityLabels;
11
- testID?: string;
12
- }
13
- declare const _default: React.NamedExoticComponent<EntityButtonsProps>;
14
- export default _default;
@@ -1,15 +0,0 @@
1
- import { TrustEntityDetail, TrustEntityListItem } from '@procivis/react-native-one-core';
2
- import React from 'react';
3
- import { AttributesLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
4
- interface EntityAttributesProps {
5
- certificate?: string;
6
- did?: string;
7
- trustEntity?: TrustEntityDetail | TrustEntityListItem;
8
- trusted: boolean;
9
- labels: AttributesLabels;
10
- onCopyToClipboard: (value: string) => void;
11
- entityType: EntityType;
12
- testID?: string;
13
- }
14
- declare const _default: React.NamedExoticComponent<EntityAttributesProps>;
15
- export default _default;
@@ -1,18 +0,0 @@
1
- import { IdentifierListItem, TrustEntityRole } from '@procivis/react-native-one-core';
2
- import React from 'react';
3
- import { StyleProp, ViewStyle } from 'react-native';
4
- import { AttributesLabels, EntityLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
5
- export type ContextRole = Exclude<TrustEntityRole, TrustEntityRole.BOTH>;
6
- interface EntityDetailsWithButtonsProps {
7
- identifier?: IdentifierListItem;
8
- entityLabels: EntityLabels;
9
- attributesLabels: AttributesLabels;
10
- style?: StyleProp<ViewStyle>;
11
- textColor?: string;
12
- testID?: string;
13
- role: ContextRole;
14
- onCopyToClipboard: (value: string) => void;
15
- entityType: EntityType;
16
- }
17
- declare const _default: React.NamedExoticComponent<EntityDetailsWithButtonsProps>;
18
- export default _default;
@@ -1,21 +0,0 @@
1
- import { IdentifierListItem, TrustEntityDetail, TrustEntityRole } from '@procivis/react-native-one-core';
2
- import { FC, ReactNode } from 'react';
3
- import { StyleProp, ViewStyle } from 'react-native';
4
- export type EntityDetailsLabels = {
5
- unknown: string;
6
- };
7
- export type EntityDetailsProps = {
8
- labels: EntityDetailsLabels;
9
- renderMore?: (trustEntity: TrustEntityDetail) => ReactNode;
10
- role: Exclude<TrustEntityRole, TrustEntityRole.BOTH>;
11
- style?: StyleProp<ViewStyle>;
12
- sublineColor?: string;
13
- textColor?: string;
14
- testID?: string;
15
- } & ({
16
- identifier?: IdentifierListItem;
17
- } | {
18
- entity: TrustEntityDetail;
19
- });
20
- declare const EntityDetails: FC<EntityDetailsProps>;
21
- export default EntityDetails;
@@ -1,3 +0,0 @@
1
- import type { EntityDetailsLabels, EntityDetailsProps } from './entity-details';
2
- import EntityDetails from './entity-details';
3
- export { EntityDetails, EntityDetailsLabels, EntityDetailsProps };
@@ -1,17 +0,0 @@
1
- import { CreateRemoteTrustEntityRequest, ONECore, UpdateRemoteTrustEntityRequest } from '@procivis/react-native-one-core';
2
- export declare const TRUST_ENTITY_DETAIL_QUERY_KEY = "trust-entity-detail";
3
- export declare const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = "remote-trust-entity-detail";
4
- export declare const useCreateTrustAnchor: () => (core: ONECore, publisherReference: string) => Promise<void>;
5
- export declare const useTrustEntity: (identifierId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").TrustEntityDetail | null | undefined, unknown>;
6
- export declare const useRemoteTrustEntity: (identifierId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").RemoteTrustEntityDetail | undefined, unknown>;
7
- export declare const useCreateRemoteTrustEntity: () => import("react-query").UseMutationResult<string, unknown, Omit<CreateRemoteTrustEntityRequest, "didId"> & {
8
- identifierId?: string | undefined;
9
- didId?: string | undefined;
10
- }, unknown>;
11
- export declare const useUpdateRemoteTrustEntity: () => import("react-query").UseMutationResult<void, unknown, Omit<UpdateRemoteTrustEntityRequest, "didId"> & {
12
- identifierId?: string | undefined;
13
- didId?: string | undefined;
14
- }, unknown>;
15
- export declare enum TrustManagementEnum {
16
- SimpleTrustList = "SIMPLE_TRUST_LIST"
17
- }
@@ -1,79 +0,0 @@
1
- import { TrustEntityDetail } from '@procivis/react-native-one-core';
2
- import React, { FC, memo, useCallback, useMemo } from 'react';
3
- import { Linking, StyleSheet, View } from 'react-native';
4
-
5
- import { Button, ButtonType } from '../../ui-components/buttons';
6
- import { EntityLabels } from '../../ui-components/screens/nerd-mode-screen';
7
- import { concatTestID, reportException } from '../../utils';
8
-
9
- export interface EntityButton {
10
- url: string;
11
- label: string;
12
- }
13
-
14
- interface EntityButtonsProps {
15
- entity?: TrustEntityDetail;
16
- labels: EntityLabels;
17
- testID?: string;
18
- }
19
-
20
- const EntityButtons: FC<EntityButtonsProps> = ({ entity, labels, testID }) => {
21
- const buttons = useMemo(
22
- () =>
23
- [
24
- {
25
- label: labels.visitWebsite,
26
- url: entity?.website || '',
27
- testID: 'website',
28
- },
29
- {
30
- label: labels.termsAndServices,
31
- url: entity?.termsUrl || '',
32
- testID: 'termsOfService',
33
- },
34
- {
35
- label: labels.privacyPolicy,
36
- url: entity?.privacyUrl || '',
37
- testID: 'privacyPolicy',
38
- },
39
- ].filter((btn) => Boolean(btn.url)),
40
- [entity, labels],
41
- );
42
-
43
- const openURL = useCallback(
44
- (url: string) => () => {
45
- Linking.openURL(url).catch((e) => {
46
- reportException(e, 'Error opening entity link');
47
- });
48
- },
49
- [],
50
- );
51
- return (
52
- <View style={[styles.buttons]} testID={testID}>
53
- {buttons.map(({ label, url, testID: testIdSuffix }) => (
54
- <Button
55
- key={label}
56
- title={label}
57
- onPress={openURL(url)}
58
- style={styles.urlButton}
59
- testID={concatTestID(testID, testIdSuffix)}
60
- type={ButtonType.SmallTech}
61
- />
62
- ))}
63
- </View>
64
- );
65
- };
66
-
67
- const styles = StyleSheet.create({
68
- buttons: {
69
- paddingBottom: 10,
70
- paddingHorizontal: 12,
71
- },
72
- urlButton: {
73
- borderRadius: 4,
74
- borderWidth: 0,
75
- marginTop: 4,
76
- },
77
- });
78
-
79
- export default memo(EntityButtons);
@@ -1,80 +0,0 @@
1
- import { TrustEntityDetail, TrustEntityListItem } from '@procivis/react-native-one-core';
2
- import React, { FC, memo } from 'react';
3
- import { StyleSheet, View } from 'react-native';
4
-
5
- import { NerdModeItem } from '../../ui-components/nerd-view';
6
- import { AttributesLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
7
- import { addElementIf } from '../../utils/array';
8
-
9
- interface EntityAttributesProps {
10
- certificate?: string;
11
- did?: string;
12
- trustEntity?: TrustEntityDetail | TrustEntityListItem;
13
- trusted: boolean;
14
- labels: AttributesLabels;
15
- onCopyToClipboard: (value: string) => void;
16
- entityType: EntityType;
17
- testID?: string;
18
- }
19
-
20
- const EntityAttributes: FC<EntityAttributesProps> = ({
21
- certificate,
22
- did,
23
- trustEntity,
24
- trusted,
25
- labels,
26
- entityType,
27
- testID,
28
- onCopyToClipboard,
29
- }) => {
30
- const didSections = did?.split(':') ?? [];
31
- const identifier = didSections.pop();
32
- const didMethod = didSections.length ? didSections.join(':') + ':' : '';
33
-
34
- const attributes = [
35
- ...addElementIf(trusted, {
36
- attributeKey: labels.trustRegistry,
37
- highlightedText: trustEntity?.trustAnchor.name,
38
- testID: 'trustRegistry',
39
- }),
40
- ...addElementIf(Boolean(did), {
41
- attributeKey: entityType === EntityType.CredentialEntity ? labels.issuerIdentifier : labels.entityIdentifier,
42
- attributeText: identifier,
43
- canBeCopied: true,
44
- highlightedText: didMethod,
45
- testID: 'issuerDID',
46
- }),
47
- ...addElementIf(Boolean(certificate), {
48
- attributeKey: entityType === EntityType.CredentialEntity ? labels.issuerIdentifier : labels.entityIdentifier,
49
- attributeText: certificate,
50
- canBeCopied: true,
51
- testID: 'issuerCertificate',
52
- }),
53
- ...addElementIf(trusted && Boolean(trustEntity?.role), {
54
- attributeKey: labels.role,
55
- highlightedText: trustEntity?.role,
56
- testID: 'role',
57
- }),
58
- ];
59
- return (
60
- <View style={styles.wrapper}>
61
- {attributes.map((attribute) => (
62
- <NerdModeItem
63
- key={attribute.attributeKey}
64
- {...attribute}
65
- labels={labels}
66
- onCopyToClipboard={onCopyToClipboard}
67
- testID={testID}
68
- />
69
- ))}
70
- </View>
71
- );
72
- };
73
-
74
- const styles = StyleSheet.create({
75
- wrapper: {
76
- marginBottom: 20,
77
- },
78
- });
79
-
80
- export default memo(EntityAttributes);