@procivis/one-react-native-components 0.3.86 → 0.3.94

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 (110) hide show
  1. package/lib/commonjs/components/credential/credential.js +2 -8
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/entity/entity-attributes.js +3 -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 -1
  6. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  7. package/lib/commonjs/components/history/history-list-item-icon.js +10 -2
  8. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  9. package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -8
  10. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  11. package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -8
  12. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  13. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -6
  14. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  15. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +2 -6
  16. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  17. package/lib/commonjs/ui-components/accessibility/locale/fi.json +21 -0
  18. package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -0
  19. package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
  20. package/lib/commonjs/utils/hooks/core/cache.js +4 -1
  21. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  22. package/lib/commonjs/utils/hooks/core/credentials.js +1 -7
  23. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  24. package/lib/commonjs/utils/hooks/core/proofs.js +3 -6
  25. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  26. package/lib/commonjs/utils/hooks/core/wallet-unit.js +28 -37
  27. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  28. package/lib/commonjs/utils/index.js +0 -12
  29. package/lib/commonjs/utils/index.js.map +1 -1
  30. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +4 -4
  31. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  32. package/lib/commonjs/utils/parsers/credential-sharing.js +6 -6
  33. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  34. package/lib/commonjs/utils/parsers/credential.js +9 -25
  35. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  36. package/lib/commonjs/utils/parsers/query.js +1 -1
  37. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  38. package/lib/module/components/credential/credential.js +2 -8
  39. package/lib/module/components/credential/credential.js.map +1 -1
  40. package/lib/module/components/entity/entity-attributes.js +3 -1
  41. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  42. package/lib/module/components/entity/entity-details-with-buttons.js +2 -1
  43. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  44. package/lib/module/components/history/history-list-item-icon.js +10 -2
  45. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  46. package/lib/module/components/proof-request/v1/select-credential.js +2 -8
  47. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  48. package/lib/module/components/proof-request/v1/share-credential.js +2 -8
  49. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  50. package/lib/module/components/proof-request/v2/select-credential-v2.js +3 -7
  51. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  52. package/lib/module/components/proof-request/v2/share-credential-v2.js +3 -7
  53. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  54. package/lib/module/ui-components/accessibility/locale/fi.json +21 -0
  55. package/lib/module/ui-components/accessibility/locale/index.js +2 -0
  56. package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
  57. package/lib/module/utils/hooks/core/cache.js +4 -1
  58. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  59. package/lib/module/utils/hooks/core/credentials.js +1 -7
  60. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  61. package/lib/module/utils/hooks/core/proofs.js +3 -6
  62. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  63. package/lib/module/utils/hooks/core/wallet-unit.js +26 -35
  64. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  65. package/lib/module/utils/index.js +0 -1
  66. package/lib/module/utils/index.js.map +1 -1
  67. package/lib/module/utils/parsers/credential-sharing-v2.js +4 -4
  68. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  69. package/lib/module/utils/parsers/credential-sharing.js +6 -6
  70. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  71. package/lib/module/utils/parsers/credential.js +10 -26
  72. package/lib/module/utils/parsers/credential.js.map +1 -1
  73. package/lib/module/utils/parsers/query.js +1 -1
  74. package/lib/module/utils/parsers/query.js.map +1 -1
  75. package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
  76. package/lib/typescript/ui-components/accessibility/locale/index.d.ts +21 -0
  77. package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -0
  78. package/lib/typescript/utils/hooks/core/proofs.d.ts +0 -3
  79. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +7 -7
  80. package/lib/typescript/utils/index.d.ts +0 -1
  81. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +2 -3
  82. package/lib/typescript/utils/parsers/credential-sharing.d.ts +3 -4
  83. package/lib/typescript/utils/parsers/credential.d.ts +6 -10
  84. package/lib/typescript/utils/parsers/query.d.ts +1 -1
  85. package/package.json +4 -4
  86. package/src/components/credential/credential.tsx +1 -5
  87. package/src/components/entity/entity-attributes.tsx +3 -0
  88. package/src/components/entity/entity-details-with-buttons.tsx +1 -0
  89. package/src/components/history/history-list-item-icon.tsx +9 -1
  90. package/src/components/proof-request/v1/select-credential.tsx +1 -5
  91. package/src/components/proof-request/v1/share-credential.tsx +1 -5
  92. package/src/components/proof-request/v2/select-credential-v2.tsx +2 -9
  93. package/src/components/proof-request/v2/share-credential-v2.tsx +2 -11
  94. package/src/ui-components/accessibility/locale/fi.json +21 -0
  95. package/src/ui-components/accessibility/locale/index.ts +2 -1
  96. package/src/utils/hooks/core/cache.ts +3 -0
  97. package/src/utils/hooks/core/credentials.ts +3 -2
  98. package/src/utils/hooks/core/proofs.ts +2 -8
  99. package/src/utils/hooks/core/wallet-unit.ts +31 -37
  100. package/src/utils/index.ts +0 -1
  101. package/src/utils/parsers/credential-sharing-v2.tsx +0 -5
  102. package/src/utils/parsers/credential-sharing.tsx +34 -35
  103. package/src/utils/parsers/credential.ts +3 -30
  104. package/src/utils/parsers/query.ts +2 -2
  105. package/lib/commonjs/utils/wallet-unit.js +0 -30
  106. package/lib/commonjs/utils/wallet-unit.js.map +0 -1
  107. package/lib/module/utils/wallet-unit.js +0 -22
  108. package/lib/module/utils/wallet-unit.js.map +0 -1
  109. package/lib/typescript/utils/wallet-unit.d.ts +0 -8
  110. package/src/utils/wallet-unit.ts +0 -30
@@ -17,7 +17,6 @@ import {
17
17
  import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
18
18
  import { CredentialNoticeWarningIcon, CredentialWarningIcon, RequiredAttributeIcon } from '../../ui-components/icons';
19
19
  import { concatTestID } from '../testID';
20
- import { WUAState } from '../wallet-unit';
21
20
  import {
22
21
  CardLabels,
23
22
  CredentialDetailsCardPropsWithoutWidth,
@@ -35,20 +34,19 @@ export const validityCheckedCardFromCredential = (
35
34
  expanded: boolean,
36
35
  multipleCredentialsAvailable: boolean,
37
36
  config: Config,
38
- wuaState: WUAState | undefined,
39
37
  notice: CredentialCardNotice | undefined,
40
38
  testID: string,
41
39
  labels: ShareCredentialCardLabels,
42
40
  ): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID' | 'width'> => {
43
41
  let credentialHeaderDetail:
44
42
  | Pick<
45
- CredentialHeaderProps,
46
- | 'credentialDetailPrimary'
47
- | 'credentialDetailSecondary'
48
- | 'credentialDetailErrorColor'
49
- | 'credentialDetailTestID'
50
- | 'statusIcon'
51
- >
43
+ CredentialHeaderProps,
44
+ | 'credentialDetailPrimary'
45
+ | 'credentialDetailSecondary'
46
+ | 'credentialDetailErrorColor'
47
+ | 'credentialDetailTestID'
48
+ | 'statusIcon'
49
+ >
52
50
  | undefined;
53
51
  if (invalidLVVC) {
54
52
  credentialHeaderDetail = {
@@ -64,7 +62,7 @@ export const validityCheckedCardFromCredential = (
64
62
  };
65
63
  }
66
64
 
67
- const card = getCredentialCardPropsFromCredential(credential, credential.claims, config, wuaState, notice, testID, labels);
65
+ const card = getCredentialCardPropsFromCredential(credential, credential.claims, config, notice, testID, labels);
68
66
  return {
69
67
  ...card,
70
68
  header: {
@@ -167,7 +165,9 @@ const getDisplayedAttributes = (
167
165
 
168
166
  let fields = request.fields;
169
167
  if (credential) {
170
- const fieldsWithNoKeyMapping = request.fields.filter((field) => !(credential.id in field.keyMap)).filter((field) => !isApplicable || !field.required);
168
+ const fieldsWithNoKeyMapping = request.fields
169
+ .filter((field) => !(credential.id in field.keyMap))
170
+ .filter((field) => !isApplicable || !field.required);
171
171
  const fullyNestedFields = getFullyNestedFields(request.fields, credential.id);
172
172
 
173
173
  fields = [...fieldsWithNoKeyMapping, ...fullyNestedFields];
@@ -177,7 +177,7 @@ const getDisplayedAttributes = (
177
177
  const selected = !field.required && selectedFields?.includes(field.id);
178
178
  const claim = credential
179
179
  ? claims?.find(({ path }) => {
180
- return path === field.keyMap[credential.id];
180
+ return path === field.keyMap[credential.id];
181
181
  })
182
182
  : undefined;
183
183
  const status =
@@ -209,7 +209,12 @@ export const shareCredentialCardAttributeFromClaim = (
209
209
  field?: PresentationDefinitionField,
210
210
  ): CredentialAttribute => {
211
211
  if (claim) {
212
- return { ...detailsCardAttributeFromClaim(claim, config, testID), id, path: claim.path, listValue: claim.isArrayElement };
212
+ return {
213
+ ...detailsCardAttributeFromClaim(claim, config, testID),
214
+ id,
215
+ path: claim.path,
216
+ listValue: claim.isArrayElement,
217
+ };
213
218
  }
214
219
  return {
215
220
  id,
@@ -269,7 +274,6 @@ export const shareCredentialCardFromCredential = (
269
274
  request: PresentationDefinitionRequestedCredential,
270
275
  selectedFields: string[] | undefined,
271
276
  config: Config,
272
- wuaState: WUAState | undefined,
273
277
  testID: string,
274
278
  labels: ShareCredentialCardLabels,
275
279
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -280,27 +284,24 @@ export const shareCredentialCardFromCredential = (
280
284
  const notice: CredentialCardNotice | undefined =
281
285
  selectiveDisclosureSupported === false
282
286
  ? {
283
- text: labels.selectiveDisclosureNotice,
284
- noticeIcon: CredentialNoticeWarningIcon,
285
- }
287
+ text: labels.selectiveDisclosureNotice,
288
+ noticeIcon: CredentialNoticeWarningIcon,
289
+ }
286
290
  : undefined;
287
291
  const cardTestId = concatTestID(testID, 'card');
288
292
  const card = credential
289
293
  ? validityCheckedCardFromCredential(
290
- credential,
291
- invalidLVVC,
292
- expanded,
293
- multipleCredentialsAvailable,
294
- config,
295
- wuaState,
296
- notice,
297
- cardTestId,
298
- labels,
299
- )
294
+ credential,
295
+ invalidLVVC,
296
+ expanded,
297
+ multipleCredentialsAvailable,
298
+ config,
299
+ notice,
300
+ cardTestId,
301
+ labels,
302
+ )
300
303
  : missingCredentialCardFromRequest(request, notice, cardTestId, labels);
301
- const validityState = getValidityState(
302
- credential ? { ...credential, issuer: credential.issuer?.id } : undefined,
303
- );
304
+ const validityState = getValidityState(credential ? { ...credential, issuer: credential.issuer?.id } : undefined);
304
305
  const displayedAttributes = getDisplayedAttributes(
305
306
  request,
306
307
  validityState,
@@ -355,7 +356,6 @@ export const selectCredentialCardFromCredential = (
355
356
  selected: boolean,
356
357
  request: PresentationDefinitionRequestedCredential,
357
358
  config: Config,
358
- wuaState: WUAState | undefined,
359
359
  testID: string,
360
360
  labels: ShareCredentialCardLabels,
361
361
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -367,15 +367,14 @@ export const selectCredentialCardFromCredential = (
367
367
  const notice: CredentialCardNotice | undefined =
368
368
  selectiveDisclosureSupported === false
369
369
  ? {
370
- text: labels.selectiveDisclosureNotice,
371
- noticeIcon: CredentialNoticeWarningIcon,
372
- }
370
+ text: labels.selectiveDisclosureNotice,
371
+ noticeIcon: CredentialNoticeWarningIcon,
372
+ }
373
373
  : undefined;
374
374
  const { header, ...cardProps } = getCredentialCardPropsFromCredential(
375
375
  credential,
376
376
  credential.claims,
377
377
  config,
378
- wuaState,
379
378
  notice,
380
379
  testID,
381
380
  labels,
@@ -7,7 +7,6 @@ import {
7
7
  CredentialStateEnum,
8
8
  DataTypeEnum,
9
9
  FormatFeatureEnum,
10
- WalletStorageType,
11
10
  } from '@procivis/react-native-one-core';
12
11
  import { FC } from 'react';
13
12
  import { SvgProps } from 'react-native-svg';
@@ -23,7 +22,6 @@ import { CredentialCardNotice } from '../../ui-components/credential/card/creden
23
22
  import { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';
24
23
  import { formatDateLocalized, formatDateTimeLocalized } from '../date';
25
24
  import { concatTestID } from '../testID';
26
- import { WUAState } from '../wallet-unit';
27
25
  import { getCarouselImagesFromClaims } from './credential-images';
28
26
 
29
27
  export enum ValidityState {
@@ -86,15 +84,12 @@ export type CardHeaderLabels = {
86
84
  revoked: string;
87
85
  suspended: string;
88
86
  suspendedUntil: (date: string) => string;
89
- wuaExpired: string;
90
- wuaRevoked: string;
91
87
  };
92
88
 
93
89
  const credentialDetailFromCredential = (
94
90
  credential: CredentialDetail,
95
91
  claims: Claim[] = [],
96
92
  config: Config,
97
- wuaState: WUAState | undefined,
98
93
  testID: string,
99
94
  labels: CardHeaderLabels,
100
95
  ): {
@@ -106,15 +101,6 @@ const credentialDetailFromCredential = (
106
101
  } => {
107
102
  const { layoutProperties } = credential.schema;
108
103
 
109
- if (credential.schema.walletStorageType === WalletStorageType.EUDI_COMPLIANT && wuaState === WUAState.Revoked) {
110
- return {
111
- credentialDetailPrimary: labels.wuaRevoked,
112
- credentialDetailErrorColor: true,
113
- credentialDetailTestID: concatTestID(testID, 'wua', 'revoked'),
114
- statusIcon: CredentialErrorIcon,
115
- };
116
- }
117
-
118
104
  switch (credential.state) {
119
105
  case CredentialStateEnum.SUSPENDED:
120
106
  return {
@@ -133,14 +119,6 @@ const credentialDetailFromCredential = (
133
119
  };
134
120
  }
135
121
 
136
- if (credential.schema.walletStorageType === WalletStorageType.EUDI_COMPLIANT && wuaState === WUAState.Expired) {
137
- return {
138
- credentialDetailPrimary: labels.wuaExpired,
139
- credentialDetailTestID: concatTestID(testID, 'wua', 'suspended'),
140
- statusIcon: CredentialWarningIcon,
141
- };
142
- }
143
-
144
122
  if (hasMsoValidityIssues(credential)) {
145
123
  return {
146
124
  credentialDetailPrimary: labels.validityIssues,
@@ -176,7 +154,6 @@ export const cardHeaderFromCredential = (
176
154
  credential: CredentialDetail,
177
155
  claims: Claim[] = [],
178
156
  config: Config,
179
- wuaState: WUAState | undefined,
180
157
  testID: string,
181
158
  labels: CardHeaderLabels,
182
159
  ): Omit<CredentialHeaderProps, 'style'> => {
@@ -186,7 +163,7 @@ export const cardHeaderFromCredential = (
186
163
  credentialDetailErrorColor,
187
164
  credentialDetailTestID,
188
165
  statusIcon,
189
- } = credentialDetailFromCredential(credential, claims, config, wuaState, testID, labels);
166
+ } = credentialDetailFromCredential(credential, claims, config, testID, labels);
190
167
  const { layoutProperties } = credential.schema;
191
168
 
192
169
  return {
@@ -217,7 +194,6 @@ export const getCredentialCardPropsFromCredential = (
217
194
  credential: CredentialDetail,
218
195
  claims: Claim[] = [],
219
196
  config: Config,
220
- wuaState: WUAState | undefined,
221
197
  notice: CredentialCardNotice | undefined,
222
198
  testID: string,
223
199
  labels: CardLabels,
@@ -237,7 +213,7 @@ export const getCredentialCardPropsFromCredential = (
237
213
  ? { imageSource: { uri: layoutProperties.background.image } }
238
214
  : undefined,
239
215
  color: layoutProperties?.background?.color,
240
- header: cardHeaderFromCredential(credential, claims, config, wuaState, concatTestID(testID, 'header'), labels),
216
+ header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),
241
217
  testID,
242
218
  notice,
243
219
  };
@@ -315,18 +291,16 @@ export type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardP
315
291
  export const detailsCardFromCredential = (
316
292
  credential: CredentialDetail,
317
293
  config: Config,
318
- wuaState: WUAState | undefined,
319
294
  testID: string,
320
295
  labels: CardLabels,
321
296
  ): CredentialDetailsCardPropsWithoutWidth => {
322
- return detailsCardFromCredentialWithClaims(credential, credential.claims, config, wuaState, testID, labels);
297
+ return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);
323
298
  };
324
299
 
325
300
  export const detailsCardFromCredentialWithClaims = (
326
301
  credential: CredentialDetail,
327
302
  claims: Claim[],
328
303
  config: Config,
329
- wuaState: WUAState | undefined,
330
304
  testID: string,
331
305
  labels: CardLabels,
332
306
  ): CredentialDetailsCardPropsWithoutWidth => {
@@ -338,7 +312,6 @@ export const detailsCardFromCredentialWithClaims = (
338
312
  credential,
339
313
  claims,
340
314
  config,
341
- wuaState,
342
315
  undefined,
343
316
  concatTestID(testID, 'card'),
344
317
  labels,
@@ -55,7 +55,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
55
55
  'page',
56
56
  'pageSize',
57
57
  'organisationId',
58
- 'entityId',
58
+ 'entityIds',
59
59
  'actions',
60
60
  'entityTypes',
61
61
  'createdDateAfter',
@@ -65,7 +65,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
65
65
  'credentialSchemaId',
66
66
  'proofSchemaId',
67
67
  'search',
68
- 'user',
68
+ 'users',
69
69
  ]);
70
70
  };
71
71
 
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.walletUnitAttestationState = exports.isWalletAttestationExpired = exports.WUAState = void 0;
7
- var _reactNativeOneCore = require("@procivis/react-native-one-core");
8
- const isWalletAttestationExpired = walletUnitAttestation => {
9
- return (walletUnitAttestation === null || walletUnitAttestation === void 0 ? void 0 : walletUnitAttestation.expirationDate) && Date.parse(walletUnitAttestation.expirationDate) < Date.now();
10
- };
11
- exports.isWalletAttestationExpired = isWalletAttestationExpired;
12
- let WUAState = exports.WUAState = /*#__PURE__*/function (WUAState) {
13
- WUAState["Revoked"] = "revoked";
14
- WUAState["Expired"] = "expired";
15
- WUAState["Valid"] = "valid";
16
- return WUAState;
17
- }({});
18
- const walletUnitAttestationState = walletUnitAttestation => {
19
- if (!walletUnitAttestation) {
20
- return undefined;
21
- }
22
- if (walletUnitAttestation.status === _reactNativeOneCore.WalletUnitStatusEnum.REVOKED) {
23
- return WUAState.Revoked;
24
- } else if (isWalletAttestationExpired(walletUnitAttestation)) {
25
- return WUAState.Expired;
26
- }
27
- return WUAState.Valid;
28
- };
29
- exports.walletUnitAttestationState = walletUnitAttestationState;
30
- //# sourceMappingURL=wallet-unit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","isWalletAttestationExpired","walletUnitAttestation","expirationDate","Date","parse","now","exports","WUAState","walletUnitAttestationState","undefined","status","WalletUnitStatusEnum","REVOKED","Revoked","Expired","Valid"],"sources":["wallet-unit.ts"],"sourcesContent":["import { HolderAttestationWalletUnitResponse, WalletUnitStatusEnum } from '@procivis/react-native-one-core';\n\nexport const isWalletAttestationExpired = (\n walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined,\n) => {\n return (\n walletUnitAttestation?.expirationDate &&\n Date.parse(walletUnitAttestation.expirationDate) < Date.now()\n );\n};\n\nexport enum WUAState {\n Revoked = \"revoked\",\n Expired = \"expired\",\n Valid = \"valid\"\n}\n\nexport const walletUnitAttestationState = (\n walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined,\n): WUAState | undefined => {\n if (!walletUnitAttestation) {\n return undefined;\n }\n if (walletUnitAttestation.status === WalletUnitStatusEnum.REVOKED) {\n return WUAState.Revoked;\n } else if (isWalletAttestationExpired(walletUnitAttestation)) {\n return WUAState.Expired;\n }\n return WUAState.Valid;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAEO,MAAMC,0BAA0B,GACrCC,qBAAsE,IACnE;EACH,OACE,CAAAA,qBAAqB,aAArBA,qBAAqB,uBAArBA,qBAAqB,CAAEC,cAAc,KACrCC,IAAI,CAACC,KAAK,CAACH,qBAAqB,CAACC,cAAc,CAAC,GAAGC,IAAI,CAACE,GAAG,CAAC,CAAC;AAEjE,CAAC;AAACC,OAAA,CAAAN,0BAAA,GAAAA,0BAAA;AAAA,IAEUO,QAAQ,GAAAD,OAAA,CAAAC,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAMb,MAAMC,0BAA0B,GACrCP,qBAAsE,IAC7C;EACzB,IAAI,CAACA,qBAAqB,EAAE;IAC1B,OAAOQ,SAAS;EAClB;EACA,IAAIR,qBAAqB,CAACS,MAAM,KAAKC,wCAAoB,CAACC,OAAO,EAAE;IACjE,OAAOL,QAAQ,CAACM,OAAO;EACzB,CAAC,MAAM,IAAIb,0BAA0B,CAACC,qBAAqB,CAAC,EAAE;IAC5D,OAAOM,QAAQ,CAACO,OAAO;EACzB;EACA,OAAOP,QAAQ,CAACQ,KAAK;AACvB,CAAC;AAACT,OAAA,CAAAE,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- import { WalletUnitStatusEnum } from '@procivis/react-native-one-core';
2
- export const isWalletAttestationExpired = walletUnitAttestation => {
3
- return (walletUnitAttestation === null || walletUnitAttestation === void 0 ? void 0 : walletUnitAttestation.expirationDate) && Date.parse(walletUnitAttestation.expirationDate) < Date.now();
4
- };
5
- export let WUAState = /*#__PURE__*/function (WUAState) {
6
- WUAState["Revoked"] = "revoked";
7
- WUAState["Expired"] = "expired";
8
- WUAState["Valid"] = "valid";
9
- return WUAState;
10
- }({});
11
- export const walletUnitAttestationState = walletUnitAttestation => {
12
- if (!walletUnitAttestation) {
13
- return undefined;
14
- }
15
- if (walletUnitAttestation.status === WalletUnitStatusEnum.REVOKED) {
16
- return WUAState.Revoked;
17
- } else if (isWalletAttestationExpired(walletUnitAttestation)) {
18
- return WUAState.Expired;
19
- }
20
- return WUAState.Valid;
21
- };
22
- //# sourceMappingURL=wallet-unit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WalletUnitStatusEnum","isWalletAttestationExpired","walletUnitAttestation","expirationDate","Date","parse","now","WUAState","walletUnitAttestationState","undefined","status","REVOKED","Revoked","Expired","Valid"],"sources":["wallet-unit.ts"],"sourcesContent":["import { HolderAttestationWalletUnitResponse, WalletUnitStatusEnum } from '@procivis/react-native-one-core';\n\nexport const isWalletAttestationExpired = (\n walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined,\n) => {\n return (\n walletUnitAttestation?.expirationDate &&\n Date.parse(walletUnitAttestation.expirationDate) < Date.now()\n );\n};\n\nexport enum WUAState {\n Revoked = \"revoked\",\n Expired = \"expired\",\n Valid = \"valid\"\n}\n\nexport const walletUnitAttestationState = (\n walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined,\n): WUAState | undefined => {\n if (!walletUnitAttestation) {\n return undefined;\n }\n if (walletUnitAttestation.status === WalletUnitStatusEnum.REVOKED) {\n return WUAState.Revoked;\n } else if (isWalletAttestationExpired(walletUnitAttestation)) {\n return WUAState.Expired;\n }\n return WUAState.Valid;\n};\n"],"mappings":"AAAA,SAA8CA,oBAAoB,QAAQ,iCAAiC;AAE3G,OAAO,MAAMC,0BAA0B,GACrCC,qBAAsE,IACnE;EACH,OACE,CAAAA,qBAAqB,aAArBA,qBAAqB,uBAArBA,qBAAqB,CAAEC,cAAc,KACrCC,IAAI,CAACC,KAAK,CAACH,qBAAqB,CAACC,cAAc,CAAC,GAAGC,IAAI,CAACE,GAAG,CAAC,CAAC;AAEjE,CAAC;AAED,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAMpB,OAAO,MAAMC,0BAA0B,GACrCN,qBAAsE,IAC7C;EACzB,IAAI,CAACA,qBAAqB,EAAE;IAC1B,OAAOO,SAAS;EAClB;EACA,IAAIP,qBAAqB,CAACQ,MAAM,KAAKV,oBAAoB,CAACW,OAAO,EAAE;IACjE,OAAOJ,QAAQ,CAACK,OAAO;EACzB,CAAC,MAAM,IAAIX,0BAA0B,CAACC,qBAAqB,CAAC,EAAE;IAC5D,OAAOK,QAAQ,CAACM,OAAO;EACzB;EACA,OAAON,QAAQ,CAACO,KAAK;AACvB,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import { HolderAttestationWalletUnitResponse } from '@procivis/react-native-one-core';
2
- export declare const isWalletAttestationExpired: (walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined) => boolean | "" | undefined;
3
- export declare enum WUAState {
4
- Revoked = "revoked",
5
- Expired = "expired",
6
- Valid = "valid"
7
- }
8
- export declare const walletUnitAttestationState: (walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined) => WUAState | undefined;
@@ -1,30 +0,0 @@
1
- import { HolderAttestationWalletUnitResponse, WalletUnitStatusEnum } from '@procivis/react-native-one-core';
2
-
3
- export const isWalletAttestationExpired = (
4
- walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined,
5
- ) => {
6
- return (
7
- walletUnitAttestation?.expirationDate &&
8
- Date.parse(walletUnitAttestation.expirationDate) < Date.now()
9
- );
10
- };
11
-
12
- export enum WUAState {
13
- Revoked = "revoked",
14
- Expired = "expired",
15
- Valid = "valid"
16
- }
17
-
18
- export const walletUnitAttestationState = (
19
- walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined,
20
- ): WUAState | undefined => {
21
- if (!walletUnitAttestation) {
22
- return undefined;
23
- }
24
- if (walletUnitAttestation.status === WalletUnitStatusEnum.REVOKED) {
25
- return WUAState.Revoked;
26
- } else if (isWalletAttestationExpired(walletUnitAttestation)) {
27
- return WUAState.Expired;
28
- }
29
- return WUAState.Valid;
30
- };