@procivis/one-react-native-components 0.3.102 → 0.3.112

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 (248) hide show
  1. package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
  4. package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
  5. package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
  6. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  7. package/lib/commonjs/components/entity/entity-details.js +3 -3
  8. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  9. package/lib/commonjs/components/history/history-details-screen.js +10 -10
  10. package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
  11. package/lib/commonjs/components/history/history-list-item-icon.js +15 -8
  12. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  13. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  14. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  15. package/lib/commonjs/components/history/history-list-section-header.js +1 -1
  16. package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
  17. package/lib/commonjs/components/history/history-list.js.map +1 -1
  18. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  19. package/lib/commonjs/components/proof-request/v1/share-credential.js +3 -15
  20. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  21. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  22. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  23. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  24. package/lib/commonjs/ui-components/control/checkbox.js +1 -1
  25. package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
  26. package/lib/commonjs/ui-components/control/switch.js +2 -2
  27. package/lib/commonjs/ui-components/control/switch.js.map +1 -1
  28. package/lib/commonjs/ui-components/header/foldable-header.js +26 -16
  29. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  30. package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
  31. package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
  32. package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
  33. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  34. package/lib/commonjs/ui-components/index.js +11 -0
  35. package/lib/commonjs/ui-components/index.js.map +1 -1
  36. package/lib/commonjs/ui-components/notice/index.js +14 -0
  37. package/lib/commonjs/ui-components/notice/index.js.map +1 -0
  38. package/lib/commonjs/ui-components/notice/wallet-notice.js +80 -0
  39. package/lib/commonjs/ui-components/notice/wallet-notice.js.map +1 -0
  40. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  41. package/lib/commonjs/utils/history.js.map +1 -1
  42. package/lib/commonjs/utils/hooks/core/backup.js +2 -2
  43. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  44. package/lib/commonjs/utils/hooks/core/cache.js +10 -10
  45. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  46. package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
  47. package/lib/commonjs/utils/hooks/core/credential-schemas.js +1 -1
  48. package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
  49. package/lib/commonjs/utils/hooks/core/credentials.js +4 -4
  50. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  51. package/lib/commonjs/utils/hooks/core/dids.js +2 -2
  52. package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
  53. package/lib/commonjs/utils/hooks/core/history.js +1 -1
  54. package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
  55. package/lib/commonjs/utils/hooks/core/identifiers.js +2 -2
  56. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
  57. package/lib/commonjs/utils/hooks/core/index.js +11 -0
  58. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  59. package/lib/commonjs/utils/hooks/core/proof-schemas.js +1 -1
  60. package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
  61. package/lib/commonjs/utils/hooks/core/proofs.js +23 -13
  62. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  63. package/lib/commonjs/utils/hooks/core/trust-entity.js +1 -1
  64. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  65. package/lib/commonjs/utils/hooks/core/trust-list.js +32 -0
  66. package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -0
  67. package/lib/commonjs/utils/hooks/core/wallet-unit.js +30 -2
  68. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  69. package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
  70. package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
  71. package/lib/commonjs/utils/parsers/credential-images.js +4 -4
  72. package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
  73. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +1 -1
  74. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  75. package/lib/commonjs/utils/parsers/credential-sharing.js +4 -10
  76. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  77. package/lib/commonjs/utils/parsers/credential.js +9 -9
  78. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  79. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  80. package/lib/module/components/backup/preview-credentials.js.map +1 -1
  81. package/lib/module/components/credential/credential.js.map +1 -1
  82. package/lib/module/components/entity/EntityButtons.js.map +1 -1
  83. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  84. package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
  85. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  86. package/lib/module/components/entity/entity-details.js +4 -4
  87. package/lib/module/components/entity/entity-details.js.map +1 -1
  88. package/lib/module/components/history/history-details-screen.js +11 -11
  89. package/lib/module/components/history/history-details-screen.js.map +1 -1
  90. package/lib/module/components/history/history-list-item-icon.js +16 -9
  91. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  92. package/lib/module/components/history/history-list-item.js.map +1 -1
  93. package/lib/module/components/history/history-list-screen.js.map +1 -1
  94. package/lib/module/components/history/history-list-section-header.js +1 -1
  95. package/lib/module/components/history/history-list-section-header.js.map +1 -1
  96. package/lib/module/components/history/history-list.js.map +1 -1
  97. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  98. package/lib/module/components/proof-request/v1/share-credential.js +4 -16
  99. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  100. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  101. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  102. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  103. package/lib/module/ui-components/control/checkbox.js +1 -1
  104. package/lib/module/ui-components/control/checkbox.js.map +1 -1
  105. package/lib/module/ui-components/control/switch.js +3 -3
  106. package/lib/module/ui-components/control/switch.js.map +1 -1
  107. package/lib/module/ui-components/header/foldable-header.js +26 -16
  108. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  109. package/lib/module/ui-components/history/history-section-header.js +1 -1
  110. package/lib/module/ui-components/history/history-section-header.js.map +1 -1
  111. package/lib/module/ui-components/history/history-section-list-item.js +1 -1
  112. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  113. package/lib/module/ui-components/index.js +1 -0
  114. package/lib/module/ui-components/index.js.map +1 -1
  115. package/lib/module/ui-components/notice/index.js +3 -0
  116. package/lib/module/ui-components/notice/index.js.map +1 -0
  117. package/lib/module/ui-components/notice/wallet-notice.js +72 -0
  118. package/lib/module/ui-components/notice/wallet-notice.js.map +1 -0
  119. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  120. package/lib/module/utils/history.js.map +1 -1
  121. package/lib/module/utils/hooks/core/backup.js +3 -3
  122. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  123. package/lib/module/utils/hooks/core/cache.js +11 -11
  124. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  125. package/lib/module/utils/hooks/core/core-config.js.map +1 -1
  126. package/lib/module/utils/hooks/core/credential-schemas.js +1 -1
  127. package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
  128. package/lib/module/utils/hooks/core/credentials.js +5 -5
  129. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  130. package/lib/module/utils/hooks/core/dids.js +3 -3
  131. package/lib/module/utils/hooks/core/dids.js.map +1 -1
  132. package/lib/module/utils/hooks/core/history.js +1 -1
  133. package/lib/module/utils/hooks/core/history.js.map +1 -1
  134. package/lib/module/utils/hooks/core/identifiers.js +3 -3
  135. package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
  136. package/lib/module/utils/hooks/core/index.js +1 -0
  137. package/lib/module/utils/hooks/core/index.js.map +1 -1
  138. package/lib/module/utils/hooks/core/proof-schemas.js +1 -1
  139. package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
  140. package/lib/module/utils/hooks/core/proofs.js +24 -14
  141. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  142. package/lib/module/utils/hooks/core/trust-entity.js +2 -2
  143. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  144. package/lib/module/utils/hooks/core/trust-list.js +24 -0
  145. package/lib/module/utils/hooks/core/trust-list.js.map +1 -0
  146. package/lib/module/utils/hooks/core/wallet-unit.js +28 -2
  147. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  148. package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
  149. package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
  150. package/lib/module/utils/parsers/credential-images.js +5 -5
  151. package/lib/module/utils/parsers/credential-images.js.map +1 -1
  152. package/lib/module/utils/parsers/credential-sharing-v2.js +1 -1
  153. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  154. package/lib/module/utils/parsers/credential-sharing.js +4 -10
  155. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  156. package/lib/module/utils/parsers/credential.js +10 -10
  157. package/lib/module/utils/parsers/credential.js.map +1 -1
  158. package/lib/module/utils/parsers/query.js.map +1 -1
  159. package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
  160. package/lib/typescript/components/credential/credential.d.ts +2 -2
  161. package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
  162. package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
  163. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
  164. package/lib/typescript/components/entity/entity-details.d.ts +5 -5
  165. package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
  166. package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
  167. package/lib/typescript/components/history/history-list-item.d.ts +5 -5
  168. package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
  169. package/lib/typescript/components/history/history-list.d.ts +5 -5
  170. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
  171. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
  172. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
  173. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
  174. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
  175. package/lib/typescript/ui-components/control/checkbox.d.ts +1 -1
  176. package/lib/typescript/ui-components/index.d.ts +1 -0
  177. package/lib/typescript/ui-components/notice/index.d.ts +2 -0
  178. package/lib/typescript/ui-components/notice/wallet-notice.d.ts +11 -0
  179. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
  180. package/lib/typescript/utils/history.d.ts +3 -3
  181. package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
  182. package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
  183. package/lib/typescript/utils/hooks/core/core-config.d.ts +4 -4
  184. package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
  185. package/lib/typescript/utils/hooks/core/credentials.d.ts +8 -8
  186. package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
  187. package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
  188. package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
  189. package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
  190. package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
  191. package/lib/typescript/utils/hooks/core/proofs.d.ts +14 -12
  192. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +5 -5
  193. package/lib/typescript/utils/hooks/core/trust-list.d.ts +5 -0
  194. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +11 -5
  195. package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
  196. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
  197. package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -8
  198. package/lib/typescript/utils/parsers/credential.d.ts +11 -11
  199. package/lib/typescript/utils/parsers/query.d.ts +8 -8
  200. package/package.json +3 -3
  201. package/src/components/backup/preview-credentials.tsx +2 -2
  202. package/src/components/credential/credential.tsx +2 -2
  203. package/src/components/entity/EntityButtons.tsx +2 -2
  204. package/src/components/entity/entity-attributes.tsx +2 -2
  205. package/src/components/entity/entity-details-with-buttons.tsx +6 -11
  206. package/src/components/entity/entity-details.tsx +16 -17
  207. package/src/components/history/history-details-screen.tsx +13 -13
  208. package/src/components/history/history-list-item-icon.tsx +18 -15
  209. package/src/components/history/history-list-item.tsx +5 -9
  210. package/src/components/history/history-list-screen.tsx +4 -4
  211. package/src/components/history/history-list-section-header.tsx +1 -1
  212. package/src/components/history/history-list.tsx +6 -6
  213. package/src/components/proof-request/v1/select-credential.tsx +2 -2
  214. package/src/components/proof-request/v1/share-credential.tsx +12 -31
  215. package/src/components/proof-request/v2/select-credential-v2.tsx +3 -6
  216. package/src/components/proof-request/v2/share-credential-v2-group.tsx +10 -10
  217. package/src/components/proof-request/v2/share-credential-v2.tsx +9 -9
  218. package/src/ui-components/control/checkbox.tsx +12 -10
  219. package/src/ui-components/control/switch.tsx +23 -21
  220. package/src/ui-components/detail/detail.stories.tsx +1 -1
  221. package/src/ui-components/header/foldable-header.tsx +27 -20
  222. package/src/ui-components/history/history-section-header.tsx +1 -1
  223. package/src/ui-components/history/history-section-list-item.tsx +1 -1
  224. package/src/ui-components/index.ts +1 -0
  225. package/src/ui-components/notice/index.ts +3 -0
  226. package/src/ui-components/notice/wallet-notice.tsx +82 -0
  227. package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
  228. package/src/utils/history.ts +4 -4
  229. package/src/utils/hooks/core/backup.ts +3 -3
  230. package/src/utils/hooks/core/cache.ts +13 -13
  231. package/src/utils/hooks/core/core-config.ts +3 -3
  232. package/src/utils/hooks/core/credential-schemas.ts +5 -8
  233. package/src/utils/hooks/core/credentials.ts +14 -22
  234. package/src/utils/hooks/core/dids.ts +4 -4
  235. package/src/utils/hooks/core/history.ts +3 -3
  236. package/src/utils/hooks/core/identifiers.ts +4 -8
  237. package/src/utils/hooks/core/index.ts +1 -0
  238. package/src/utils/hooks/core/proof-schemas.ts +16 -22
  239. package/src/utils/hooks/core/proofs.ts +43 -36
  240. package/src/utils/hooks/core/trust-entity.ts +8 -10
  241. package/src/utils/hooks/core/trust-list.ts +29 -0
  242. package/src/utils/hooks/core/wallet-unit.ts +38 -12
  243. package/src/utils/hooks/revocation/credential-status.ts +2 -2
  244. package/src/utils/parsers/credential-images.tsx +7 -11
  245. package/src/utils/parsers/credential-sharing-v2.tsx +20 -23
  246. package/src/utils/parsers/credential-sharing.tsx +29 -38
  247. package/src/utils/parsers/credential.ts +43 -43
  248. package/src/utils/parsers/query.ts +14 -16
@@ -1,7 +1,8 @@
1
1
  import {
2
- HolderWalletUnitResponseBindingDto,
3
- WalletProviderBindingDto,
4
- WalletUnitStatusBindingEnum,
2
+ HolderWalletUnit,
3
+ HolderWalletUnitUpdateRequest,
4
+ WalletProvider,
5
+ WalletUnitStatus,
5
6
  } from '@procivis/react-native-one-core';
6
7
  import { useEffect } from 'react';
7
8
  import { useMutation, useQuery, useQueryClient } from 'react-query';
@@ -10,11 +11,9 @@ import { reportException } from '../../reporting';
10
11
  import { useONECore } from './core-context';
11
12
 
12
13
  export const WALLET_UNIT_QUERY_KEY = 'wallet-unit';
14
+ export const WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY = 'wallet-unit-trust-collections';
13
15
 
14
- export const useWalletUnitDetail = (
15
- walletUnitId: HolderWalletUnitResponseBindingDto['id'] | undefined,
16
- active = true,
17
- ) => {
16
+ export const useWalletUnitDetail = (walletUnitId: HolderWalletUnit['id'] | undefined, active = true) => {
18
17
  const { core } = useONECore();
19
18
 
20
19
  return useQuery(
@@ -27,12 +26,25 @@ export const useWalletUnitDetail = (
27
26
  );
28
27
  };
29
28
 
29
+ export const useWalletUnitTrustCollections = (walletUnitId: HolderWalletUnit['id'] | undefined, active = true) => {
30
+ const { core } = useONECore();
31
+
32
+ return useQuery(
33
+ [WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY, walletUnitId],
34
+ () => (walletUnitId ? core.holderGetWalletUnitTrustCollections(walletUnitId) : undefined),
35
+ {
36
+ enabled: active && Boolean(walletUnitId),
37
+ keepPreviousData: true,
38
+ },
39
+ );
40
+ };
41
+
30
42
  export const useRegisterWalletUnit = () => {
31
43
  const queryClient = useQueryClient();
32
44
  const { core, organisationId } = useONECore();
33
45
 
34
46
  return useMutation(
35
- async (walletProvider: WalletProviderBindingDto) =>
47
+ async (walletProvider: WalletProvider) =>
36
48
  core.holderRegisterWalletUnit({
37
49
  keyType: 'ECDSA',
38
50
  organisationId,
@@ -49,11 +61,25 @@ export const useWalletUnitStatus = () => {
49
61
  const queryClient = useQueryClient();
50
62
  const { core } = useONECore();
51
63
 
64
+ return useMutation(async (walletUnitId: HolderWalletUnit['id']) => core.holderWalletUnitStatus(walletUnitId), {
65
+ onError: async (err) => {
66
+ reportException(err, 'Refresh wallet unit failure');
67
+ await queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY);
68
+ },
69
+ onSuccess: () => queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY),
70
+ });
71
+ };
72
+
73
+ export const useWalletUnitUpdate = () => {
74
+ const queryClient = useQueryClient();
75
+ const { core } = useONECore();
76
+
52
77
  return useMutation(
53
- async (walletUnitId: HolderWalletUnitResponseBindingDto['id']) => core.holderWalletUnitStatus(walletUnitId),
78
+ async ({ walletUnitId, update }: { walletUnitId: HolderWalletUnit['id']; update: HolderWalletUnitUpdateRequest }) =>
79
+ core.holderWalletUnitUpdate(walletUnitId, update),
54
80
  {
55
81
  onError: async (err) => {
56
- reportException(err, 'Refresh wallet unit failure');
82
+ reportException(err, 'Update wallet unit failure');
57
83
  await queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY);
58
84
  },
59
85
  onSuccess: () => queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY),
@@ -61,7 +87,7 @@ export const useWalletUnitStatus = () => {
61
87
  );
62
88
  };
63
89
 
64
- export const useWalletUnitCheck = (walletUnitId: HolderWalletUnitResponseBindingDto['id'] | undefined) => {
90
+ export const useWalletUnitCheck = (walletUnitId: HolderWalletUnit['id'] | undefined) => {
65
91
  const { data: walletUnitDetail, isLoading } = useWalletUnitDetail(walletUnitId);
66
92
  const { mutateAsync: refreshWalletUnit, isLoading: isRefreshing, status: refreshStatus } = useWalletUnitStatus();
67
93
 
@@ -69,7 +95,7 @@ export const useWalletUnitCheck = (walletUnitId: HolderWalletUnitResponseBinding
69
95
  if (isLoading || refreshStatus !== 'idle') {
70
96
  return;
71
97
  }
72
- if (walletUnitId && walletUnitDetail?.status === WalletUnitStatusBindingEnum.ACTIVE) {
98
+ if (walletUnitId && walletUnitDetail?.status === WalletUnitStatus.ACTIVE) {
73
99
  void refreshWalletUnit(walletUnitId);
74
100
  }
75
101
  }, [isLoading, refreshStatus, walletUnitDetail, refreshWalletUnit, walletUnitId]);
@@ -1,4 +1,4 @@
1
- import { CredentialStateBindingEnum } from '@procivis/react-native-one-core';
1
+ import { CredentialState } from '@procivis/react-native-one-core';
2
2
  import { useIsFocused } from '@react-navigation/native';
3
3
  import { useCallback, useRef } from 'react';
4
4
 
@@ -18,7 +18,7 @@ export const useCredentialStatusCheck = (credentialIds?: string[], forceRefresh
18
18
  const { mutateAsync: check } = useCredentialRevocationCheck(forceRefresh);
19
19
  const { data: credentials } = useCredentials({
20
20
  ids: credentialIds,
21
- states: [CredentialStateBindingEnum.ACCEPTED, CredentialStateBindingEnum.SUSPENDED],
21
+ states: [CredentialState.ACCEPTED, CredentialState.SUSPENDED],
22
22
  });
23
23
 
24
24
  const checkCredentialsStatus = useCallback(async () => {
@@ -1,8 +1,4 @@
1
- import {
2
- ClaimBindingDto,
3
- CredentialSchemaCodeTypeBindingDto,
4
- CredentialSchemaLayoutPropertiesBindingDto,
5
- } from '@procivis/react-native-one-core';
1
+ import { Claim, CredentialSchemaCodeType, CredentialSchemaLayoutProperties } from '@procivis/react-native-one-core';
6
2
  import React from 'react';
7
3
  import { StyleSheet } from 'react-native';
8
4
 
@@ -21,8 +17,8 @@ const styles = StyleSheet.create({
21
17
  });
22
18
 
23
19
  export const getCarouselImagesFromClaims = (
24
- claims: ClaimBindingDto[],
25
- layoutProperties?: CredentialSchemaLayoutPropertiesBindingDto,
20
+ claims: Claim[],
21
+ layoutProperties?: CredentialSchemaLayoutProperties,
26
22
  testID?: string,
27
23
  ): CarouselImage[] => {
28
24
  const result: CarouselImage[] = [];
@@ -54,7 +50,7 @@ export const getCarouselImagesFromClaims = (
54
50
 
55
51
  let claimValue = '';
56
52
 
57
- if (claim && (claim.value.type_ === 'FLOAT' || claim.value.type_ === 'INTEGER')) {
53
+ if (claim && (claim.value.type_ === 'FLOAT' || claim.value.type_ === 'INTEGER' || claim.value.type_ === 'STRING')) {
58
54
  claimValue = String(claim.value.value);
59
55
  }
60
56
 
@@ -62,17 +58,17 @@ export const getCarouselImagesFromClaims = (
62
58
  return result;
63
59
  }
64
60
 
65
- if (code.type === CredentialSchemaCodeTypeBindingDto.QR_CODE) {
61
+ if (code.type === CredentialSchemaCodeType.QR_CODE) {
66
62
  result.push({
67
63
  element: <QrCode content={claimValue} testID={concatTestID(testID, CarouselImageType.QrCode)} />,
68
64
  type: CarouselImageType.QrCode,
69
65
  });
70
- } else if (code.type === CredentialSchemaCodeTypeBindingDto.BARCODE && isASCII(claimValue)) {
66
+ } else if (code.type === CredentialSchemaCodeType.BARCODE && isASCII(claimValue)) {
71
67
  result.push({
72
68
  element: <Barcode content={claimValue} testID={concatTestID(testID, CarouselImageType.Barcode)} />,
73
69
  type: CarouselImageType.Barcode,
74
70
  });
75
- } else if (code.type === CredentialSchemaCodeTypeBindingDto.MRZ) {
71
+ } else if (code.type === CredentialSchemaCodeType.MRZ) {
76
72
  result.push({
77
73
  element: <Mrz content={claimValue} testID={concatTestID(testID, CarouselImageType.MRZ)} />,
78
74
  type: CarouselImageType.MRZ,
@@ -1,11 +1,11 @@
1
1
  import {
2
- ClaimBindingDto,
3
- ClaimValueBindingDto,
4
- Config,
5
- CredentialQueryFailureHintResponseBindingDto,
6
- PresentationDefinitionV2ClaimBindingDto,
7
- PresentationDefinitionV2ClaimValueBindingDto,
8
- PresentationDefinitionV2CredentialDetailBindingDto,
2
+ Claim,
3
+ ClaimValue,
4
+ CoreConfig,
5
+ CredentialQueryFailureHint,
6
+ PresentationDefinitionV2Claim,
7
+ PresentationDefinitionV2ClaimValue,
8
+ PresentationDefinitionV2Credential,
9
9
  } from '@procivis/react-native-one-core';
10
10
  import React from 'react';
11
11
 
@@ -27,7 +27,7 @@ import {
27
27
  } from '.';
28
28
  import { ShareCredentialCardLabels, validityCheckedCardFromCredential } from './credential-sharing';
29
29
 
30
- const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValueBindingDto): ClaimValueBindingDto => {
30
+ const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValue): ClaimValue => {
31
31
  if (value.type_ !== 'NESTED') {
32
32
  return value;
33
33
  }
@@ -37,7 +37,7 @@ const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValueBindi
37
37
  };
38
38
  };
39
39
 
40
- const v2PresentationClaimToClaim = (claim: PresentationDefinitionV2ClaimBindingDto): ClaimBindingDto => {
40
+ const v2PresentationClaimToClaim = (claim: PresentationDefinitionV2Claim): Claim => {
41
41
  return {
42
42
  schema: claim.schema,
43
43
  path: claim.path,
@@ -46,7 +46,7 @@ const v2PresentationClaimToClaim = (claim: PresentationDefinitionV2ClaimBindingD
46
46
  };
47
47
 
48
48
  const getAttributeSelectorStatus = (
49
- claim: PresentationDefinitionV2ClaimBindingDto,
49
+ claim: PresentationDefinitionV2Claim,
50
50
  selected: boolean,
51
51
  force: boolean,
52
52
  ): SelectorStatus | undefined => {
@@ -66,11 +66,11 @@ const getAttributeSelectorStatus = (
66
66
  };
67
67
 
68
68
  export const shareCredentialCardAttributeFromV2Claim = (
69
- claim: PresentationDefinitionV2ClaimBindingDto,
69
+ claim: PresentationDefinitionV2Claim,
70
70
  selection: string[] | undefined,
71
71
  parentShared: boolean,
72
72
  parentUserSelected: boolean,
73
- config: Config,
73
+ config: CoreConfig,
74
74
  testID: string,
75
75
  nested?: boolean,
76
76
  listValue?: boolean,
@@ -133,7 +133,7 @@ export const shareCredentialCardAttributeFromV2Claim = (
133
133
  };
134
134
 
135
135
  export const missingCredentialCardFromFailureHint = (
136
- failureHint: CredentialQueryFailureHintResponseBindingDto | undefined,
136
+ failureHint: CredentialQueryFailureHint | undefined,
137
137
  notice: CredentialCardNotice | undefined,
138
138
  testID: string,
139
139
  labels: ShareCredentialCardLabels,
@@ -154,12 +154,12 @@ export const missingCredentialCardFromFailureHint = (
154
154
  };
155
155
 
156
156
  export const shareCredentialCardFromV2PresentationCredential = (
157
- credential: PresentationDefinitionV2CredentialDetailBindingDto | undefined,
158
- failureHint: CredentialQueryFailureHintResponseBindingDto | undefined,
157
+ credential: PresentationDefinitionV2Credential | undefined,
158
+ failureHint: CredentialQueryFailureHint | undefined,
159
159
  expanded: boolean,
160
160
  multipleCredentialsAvailable: boolean,
161
161
  selectedFields: string[] | undefined,
162
- config: Config,
162
+ config: CoreConfig,
163
163
  testID: string,
164
164
  labels: ShareCredentialCardLabels,
165
165
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -181,7 +181,6 @@ export const shareCredentialCardFromV2PresentationCredential = (
181
181
  ...credential,
182
182
  claims: [],
183
183
  },
184
- false,
185
184
  expanded,
186
185
  multipleCredentialsAvailable,
187
186
  config,
@@ -201,10 +200,10 @@ export const shareCredentialCardFromV2PresentationCredential = (
201
200
  };
202
201
 
203
202
  export const selectCredentialCardFromV2Credential = (
204
- credential: PresentationDefinitionV2CredentialDetailBindingDto,
203
+ credential: PresentationDefinitionV2Credential,
205
204
  selected: boolean,
206
205
  multiple: boolean,
207
- config: Config,
206
+ config: CoreConfig,
208
207
  testID: string,
209
208
  labels: ShareCredentialCardLabels,
210
209
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -248,15 +247,13 @@ export const selectCredentialCardFromV2Credential = (
248
247
  };
249
248
  };
250
249
 
251
- export const getV2CredentialClaimAllSubpaths = (claim: PresentationDefinitionV2ClaimBindingDto): string[] => {
250
+ export const getV2CredentialClaimAllSubpaths = (claim: PresentationDefinitionV2Claim): string[] => {
252
251
  if (claim.value.type_ !== 'NESTED') {
253
252
  return [claim.path];
254
253
  }
255
254
  return [claim.path, ...claim.value.value.flatMap(getV2CredentialClaimAllSubpaths)];
256
255
  };
257
256
 
258
- export const getV2CredentialAvailablePaths = (
259
- credential: PresentationDefinitionV2CredentialDetailBindingDto,
260
- ): string[] => {
257
+ export const getV2CredentialAvailablePaths = (credential: PresentationDefinitionV2Credential): string[] => {
261
258
  return credential.claims.flatMap(getV2CredentialClaimAllSubpaths);
262
259
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
- ClaimBindingDto,
3
- Config,
4
- CredentialDetailBindingDto,
5
- PresentationDefinitionFieldBindingDto,
6
- PresentationDefinitionRequestedCredentialBindingDto,
2
+ Claim,
3
+ CoreConfig,
4
+ CredentialDetail,
5
+ PresentationDefinitionField,
6
+ PresentationDefinitionRequestedCredential,
7
7
  } from '@procivis/react-native-one-core';
8
8
  import React from 'react';
9
9
 
@@ -29,11 +29,10 @@ import {
29
29
  } from './credential';
30
30
 
31
31
  export const validityCheckedCardFromCredential = (
32
- credential: CredentialDetailBindingDto,
33
- invalidLVVC: boolean,
32
+ credential: CredentialDetail,
34
33
  expanded: boolean,
35
34
  multipleCredentialsAvailable: boolean,
36
- config: Config,
35
+ config: CoreConfig,
37
36
  notice: CredentialCardNotice | undefined,
38
37
  testID: string,
39
38
  labels: ShareCredentialCardLabels,
@@ -48,13 +47,7 @@ export const validityCheckedCardFromCredential = (
48
47
  | 'statusIcon'
49
48
  >
50
49
  | undefined;
51
- if (invalidLVVC) {
52
- credentialHeaderDetail = {
53
- credentialDetailErrorColor: true,
54
- credentialDetailPrimary: labels.revoked,
55
- credentialDetailTestID: concatTestID(testID, 'header.invalid'),
56
- };
57
- } else if (!expanded && multipleCredentialsAvailable) {
50
+ if (!expanded && multipleCredentialsAvailable) {
58
51
  credentialHeaderDetail = {
59
52
  credentialDetailPrimary: labels.multipleCredentials,
60
53
  credentialDetailTestID: concatTestID(testID, 'header.multiple'),
@@ -73,7 +66,7 @@ export const validityCheckedCardFromCredential = (
73
66
  };
74
67
 
75
68
  export const missingCredentialCardFromRequest = (
76
- request: PresentationDefinitionRequestedCredentialBindingDto,
69
+ request: PresentationDefinitionRequestedCredential,
77
70
  notice: CredentialCardNotice | undefined,
78
71
  testID: string,
79
72
  labels: ShareCredentialCardLabels,
@@ -95,17 +88,17 @@ export const missingCredentialCardFromRequest = (
95
88
 
96
89
  interface DisplayedAttribute {
97
90
  claim?: FlatClaim;
98
- field?: PresentationDefinitionFieldBindingDto;
91
+ field?: PresentationDefinitionField;
99
92
  id: string;
100
93
  selected?: boolean;
101
94
  status: SelectorStatus;
102
95
  }
103
96
 
104
97
  const getAttributeSelectorStatus = (
105
- field: PresentationDefinitionFieldBindingDto,
98
+ field: PresentationDefinitionField,
106
99
  validityState: ValidityState,
107
- credential?: CredentialDetailBindingDto,
108
- claim?: ClaimBindingDto,
100
+ credential?: CredentialDetail,
101
+ claim?: Claim,
109
102
  selected?: boolean,
110
103
  ): SelectorStatus => {
111
104
  if (!credential || validityState !== ValidityState.Valid) {
@@ -124,12 +117,12 @@ const getAttributeSelectorStatus = (
124
117
  return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;
125
118
  };
126
119
 
127
- type FlatClaim = ClaimBindingDto & {
120
+ type FlatClaim = Claim & {
128
121
  isArrayElement?: boolean;
129
122
  };
130
123
 
131
124
  // Returns a spread list of all claims with their full JSON path as key, including all intermediate objects
132
- const spreadClaims = (claims: ClaimBindingDto[]): FlatClaim[] => {
125
+ const spreadClaims = (claims: Claim[]): FlatClaim[] => {
133
126
  return claims.reduce((acc, claim) => {
134
127
  const result = [claim];
135
128
  if (claim.value.type_ === 'NESTED') {
@@ -144,9 +137,9 @@ const spreadClaims = (claims: ClaimBindingDto[]): FlatClaim[] => {
144
137
  };
145
138
 
146
139
  const getDisplayedAttributes = (
147
- request: PresentationDefinitionRequestedCredentialBindingDto,
140
+ request: PresentationDefinitionRequestedCredential,
148
141
  validityState: ValidityState,
149
- credential?: CredentialDetailBindingDto,
142
+ credential?: CredentialDetail,
150
143
  selectiveDisclosureSupported?: boolean,
151
144
  selectedFields?: string[],
152
145
  ): DisplayedAttribute[] => {
@@ -179,8 +172,8 @@ const getDisplayedAttributes = (
179
172
  };
180
173
 
181
174
  const getFullyNestedFields = (
182
- fields: PresentationDefinitionRequestedCredentialBindingDto['fields'],
183
- credentialId: CredentialDetailBindingDto['id'],
175
+ fields: PresentationDefinitionRequestedCredential['fields'],
176
+ credentialId: CredentialDetail['id'],
184
177
  ) => {
185
178
  const allKeys = fields.filter((field) => credentialId in field.keyMap).map((field) => field.keyMap[credentialId]);
186
179
 
@@ -192,11 +185,11 @@ const getFullyNestedFields = (
192
185
 
193
186
  export const shareCredentialCardAttributeFromClaim = (
194
187
  id: string,
195
- config: Config,
188
+ config: CoreConfig,
196
189
  testID: string,
197
190
  labels: ShareCredentialCardLabels,
198
191
  claim?: FlatClaim,
199
- field?: PresentationDefinitionFieldBindingDto,
192
+ field?: PresentationDefinitionField,
200
193
  ): CredentialAttribute => {
201
194
  if (claim) {
202
195
  return {
@@ -257,13 +250,12 @@ export type ShareCredentialCardLabels = CardLabels & {
257
250
  };
258
251
 
259
252
  export const shareCredentialCardFromCredential = (
260
- credential: CredentialDetailBindingDto | undefined,
261
- invalidLVVC: boolean,
253
+ credential: CredentialDetail | undefined,
262
254
  expanded: boolean,
263
255
  multipleCredentialsAvailable: boolean,
264
- request: PresentationDefinitionRequestedCredentialBindingDto,
256
+ request: PresentationDefinitionRequestedCredential,
265
257
  selectedFields: string[] | undefined,
266
- config: Config,
258
+ config: CoreConfig,
267
259
  testID: string,
268
260
  labels: ShareCredentialCardLabels,
269
261
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -282,7 +274,6 @@ export const shareCredentialCardFromCredential = (
282
274
  const card = credential
283
275
  ? validityCheckedCardFromCredential(
284
276
  credential,
285
- invalidLVVC,
286
277
  expanded,
287
278
  multipleCredentialsAvailable,
288
279
  config,
@@ -325,11 +316,11 @@ export const shareCredentialCardFromCredential = (
325
316
 
326
317
  export const selectCredentialCardAttributeFromClaim = (
327
318
  id: string,
328
- config: Config,
319
+ config: CoreConfig,
329
320
  testID: string,
330
321
  labels: ShareCredentialCardLabels,
331
322
  claim?: FlatClaim,
332
- field?: PresentationDefinitionFieldBindingDto,
323
+ field?: PresentationDefinitionField,
333
324
  ): CredentialAttribute => {
334
325
  const attribute = shareCredentialCardAttributeFromClaim(id, config, testID, labels, claim, field);
335
326
  if (!claim) {
@@ -342,10 +333,10 @@ export const selectCredentialCardAttributeFromClaim = (
342
333
  };
343
334
 
344
335
  export const selectCredentialCardFromCredential = (
345
- credential: CredentialDetailBindingDto,
336
+ credential: CredentialDetail,
346
337
  selected: boolean,
347
- request: PresentationDefinitionRequestedCredentialBindingDto,
348
- config: Config,
338
+ request: PresentationDefinitionRequestedCredential,
339
+ config: CoreConfig,
349
340
  testID: string,
350
341
  labels: ShareCredentialCardLabels,
351
342
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -1,12 +1,12 @@
1
1
  import {
2
- ClaimBindingDto,
3
- Config,
4
- CredentialDetailBindingDto,
5
- CredentialListItemBindingDto,
6
- CredentialSchemaBindingDto,
7
- CredentialStateBindingEnum,
8
- DataTypeEnum,
9
- FormatFeatureEnum,
2
+ Claim,
3
+ CoreConfig,
4
+ CredentialDetail,
5
+ CredentialListItem,
6
+ CredentialSchemaListItem,
7
+ CredentialState,
8
+ DataType,
9
+ FormatFeature,
10
10
  } from '@procivis/react-native-one-core';
11
11
  import { FC } from 'react';
12
12
  import { SvgProps } from 'react-native-svg';
@@ -30,27 +30,27 @@ export enum ValidityState {
30
30
  Valid = 'valid',
31
31
  }
32
32
 
33
- export const getValidityState = (credential: CredentialListItemBindingDto | undefined) => {
34
- if (credential?.state === CredentialStateBindingEnum.REVOKED) {
33
+ export const getValidityState = (credential: CredentialListItem | undefined) => {
34
+ if (credential?.state === CredentialState.REVOKED) {
35
35
  return ValidityState.Revoked;
36
36
  }
37
- if (credential?.state === CredentialStateBindingEnum.SUSPENDED) {
37
+ if (credential?.state === CredentialState.SUSPENDED) {
38
38
  return ValidityState.Suspended;
39
39
  }
40
40
  return ValidityState.Valid;
41
41
  };
42
42
 
43
43
  export const supportsSelectiveDisclosure = (
44
- credential: CredentialListItemBindingDto | undefined,
45
- config: Config | undefined,
44
+ credential: CredentialListItem | undefined,
45
+ config: CoreConfig | undefined,
46
46
  ) => {
47
47
  const formatConfig = credential && config?.format[credential.schema.format];
48
48
  return formatConfig
49
- ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))
49
+ ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeature.SelectiveDisclosure))
50
50
  : undefined;
51
51
  };
52
52
 
53
- export const findClaimByPath = (path: string | undefined, claims: ClaimBindingDto[]): ClaimBindingDto | undefined => {
53
+ export const findClaimByPath = (path: string | undefined, claims: Claim[]): Claim | undefined => {
54
54
  if (!path) {
55
55
  return undefined;
56
56
  }
@@ -68,12 +68,12 @@ export const findClaimByPath = (path: string | undefined, claims: ClaimBindingDt
68
68
  return undefined;
69
69
  };
70
70
 
71
- const formatCredentialDetail = (claim: ClaimBindingDto, config: Config, testID: string): string => {
71
+ const formatCredentialDetail = (claim: Claim, config: CoreConfig, testID: string): string => {
72
72
  const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);
73
73
  return attributeValue.value ?? '';
74
74
  };
75
75
 
76
- export const hasMsoValidityIssues = (credential: CredentialDetailBindingDto): boolean => {
76
+ export const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {
77
77
  const mdocMsoValidityIssue = Boolean(
78
78
  credential.mdocMsoValidity?.nextUpdate && new Date(credential.mdocMsoValidity.nextUpdate) < new Date(),
79
79
  );
@@ -89,9 +89,9 @@ export type CardHeaderLabels = {
89
89
  };
90
90
 
91
91
  const credentialDetailFromCredential = (
92
- credential: CredentialDetailBindingDto,
93
- claims: ClaimBindingDto[] = [],
94
- config: Config,
92
+ credential: CredentialDetail,
93
+ claims: Claim[] = [],
94
+ config: CoreConfig,
95
95
  testID: string,
96
96
  labels: CardHeaderLabels,
97
97
  ): {
@@ -104,7 +104,7 @@ const credentialDetailFromCredential = (
104
104
  const { layoutProperties } = credential.schema;
105
105
 
106
106
  switch (credential.state) {
107
- case CredentialStateBindingEnum.SUSPENDED:
107
+ case CredentialState.SUSPENDED:
108
108
  return {
109
109
  credentialDetailPrimary: credential.suspendEndDate
110
110
  ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)
@@ -112,7 +112,7 @@ const credentialDetailFromCredential = (
112
112
  credentialDetailTestID: concatTestID(testID, 'suspended'),
113
113
  statusIcon: CredentialWarningIcon,
114
114
  };
115
- case CredentialStateBindingEnum.REVOKED:
115
+ case CredentialState.REVOKED:
116
116
  return {
117
117
  credentialDetailPrimary: labels.revoked,
118
118
  credentialDetailErrorColor: true,
@@ -153,9 +153,9 @@ const credentialDetailFromCredential = (
153
153
  };
154
154
 
155
155
  export const cardHeaderFromCredential = (
156
- credential: CredentialDetailBindingDto,
157
- claims: ClaimBindingDto[] = [],
158
- config: Config,
156
+ credential: CredentialDetail,
157
+ claims: Claim[] = [],
158
+ config: CoreConfig,
159
159
  testID: string,
160
160
  labels: CardHeaderLabels,
161
161
  ): Omit<CredentialHeaderProps, 'style'> => {
@@ -193,9 +193,9 @@ export type CardLabels = CardHeaderLabels & {
193
193
  };
194
194
 
195
195
  export const getCredentialCardPropsFromCredential = (
196
- credential: CredentialDetailBindingDto,
197
- claims: ClaimBindingDto[] = [],
198
- config: Config,
196
+ credential: CredentialDetail,
197
+ claims: Claim[] = [],
198
+ config: CoreConfig,
199
199
  notice: CredentialCardNotice | undefined,
200
200
  testID: string,
201
201
  labels: CardLabels,
@@ -224,8 +224,8 @@ export const getCredentialCardPropsFromCredential = (
224
224
  };
225
225
 
226
226
  export const detailsCardAttributeFromClaim = (
227
- claim: ClaimBindingDto,
228
- config: Config,
227
+ claim: Claim,
228
+ config: CoreConfig,
229
229
  testID: string,
230
230
  ): CredentialAttribute => {
231
231
  const value = detailsCardAttributeValueFromClaim(claim, config, testID);
@@ -238,21 +238,21 @@ export const detailsCardAttributeFromClaim = (
238
238
  };
239
239
 
240
240
  const detailsCardAttributeValueFromClaim = (
241
- claim: ClaimBindingDto,
242
- config: Config,
241
+ claim: Claim,
242
+ config: CoreConfig,
243
243
  testID: string,
244
244
  ): CredentialAttributeValue => {
245
245
  const typeConfig = config?.datatype[claim.schema.datatype];
246
246
 
247
247
  if (claim.schema.array) {
248
248
  return {
249
- values: ((claim.value.value as ClaimBindingDto[]) || []).map((arrayValue, index) => {
249
+ values: ((claim.value.value as Claim[]) || []).map((arrayValue, index) => {
250
250
  return detailsCardAttributeFromClaim(arrayValue, config, concatTestID(testID, index.toString()));
251
251
  }),
252
252
  };
253
253
  } else {
254
254
  switch (typeConfig?.type) {
255
- case DataTypeEnum.Object: {
255
+ case DataType.Object: {
256
256
  if (claim.value.type_ !== 'NESTED') {
257
257
  return { attributes: [] };
258
258
  }
@@ -262,7 +262,7 @@ const detailsCardAttributeValueFromClaim = (
262
262
  ),
263
263
  };
264
264
  }
265
- case DataTypeEnum.Date: {
265
+ case DataType.Date: {
266
266
  if (!claim.value.value) {
267
267
  // Don't try to parse empty values (which will return "Invalid Date")
268
268
  return { testID: testID, value: String(claim.value.value) };
@@ -273,8 +273,8 @@ const detailsCardAttributeValueFromClaim = (
273
273
  value: formatDateLocalized(new Date(date)) ?? date,
274
274
  };
275
275
  }
276
- case DataTypeEnum.Picture: // fallback
277
- case DataTypeEnum.SwiyuPicture: {
276
+ case DataType.Picture: // fallback
277
+ case DataType.SwiyuPicture: {
278
278
  if (typeConfig.params?.showAs === 'IMAGE') {
279
279
  return { image: { uri: claim.value.value as string }, testID: testID };
280
280
  } else {
@@ -292,8 +292,8 @@ export type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardP
292
292
  };
293
293
 
294
294
  export const detailsCardFromCredential = (
295
- credential: CredentialDetailBindingDto,
296
- config: Config,
295
+ credential: CredentialDetail,
296
+ config: CoreConfig,
297
297
  testID: string,
298
298
  labels: CardLabels,
299
299
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -301,9 +301,9 @@ export const detailsCardFromCredential = (
301
301
  };
302
302
 
303
303
  export const detailsCardFromCredentialWithClaims = (
304
- credential: CredentialDetailBindingDto,
305
- claims: ClaimBindingDto[],
306
- config: Config,
304
+ credential: CredentialDetail,
305
+ claims: Claim[],
306
+ config: CoreConfig,
307
307
  testID: string,
308
308
  labels: CardLabels,
309
309
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -402,7 +402,7 @@ function parseBase64Image(image: string | undefined) {
402
402
  return image ? '__BASE64IMAGE__' : '';
403
403
  }
404
404
 
405
- export function getCredentialSchemaWithoutImages<T extends CredentialSchemaBindingDto>(credentialSchema: T): T {
405
+ export function getCredentialSchemaWithoutImages<T extends CredentialSchemaListItem>(credentialSchema: T): T {
406
406
  return {
407
407
  ...credentialSchema,
408
408
  layoutProperties: {