@procivis/one-react-native-components 0.3.95 → 0.3.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +3 -3
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/history/history-details-screen.js +10 -10
- package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +12 -8
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
- package/lib/commonjs/components/history/history-list.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +2 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +2 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/fi.json +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/settings/button-setting.js +3 -1
- package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item.js +4 -2
- package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
- package/lib/commonjs/ui-components/settings/switch-setting.js +4 -2
- package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +3 -3
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +10 -10
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +5 -5
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +3 -3
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/history.js +1 -1
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +3 -3
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +9 -9
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +5 -5
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +11 -10
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +11 -8
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +2 -2
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +29 -16
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/url.js.map +1 -1
- package/lib/module/components/backup/preview-credentials.js.map +1 -1
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/entity/EntityButtons.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +4 -4
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/history/history-details-screen.js +11 -11
- package/lib/module/components/history/history-details-screen.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +13 -9
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/history/history-list-section-header.js +1 -1
- package/lib/module/components/history/history-list-section-header.js.map +1 -1
- package/lib/module/components/history/history-list.js.map +1 -1
- package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -2
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +2 -2
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js +2 -2
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/fi.json +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-header.js +1 -1
- package/lib/module/ui-components/history/history-section-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/settings/button-setting.js +3 -1
- package/lib/module/ui-components/settings/button-setting.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item.js +4 -2
- package/lib/module/ui-components/settings/setting-item.js.map +1 -1
- package/lib/module/ui-components/settings/switch-setting.js +4 -2
- package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/history.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +4 -4
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +11 -11
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +5 -5
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +4 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +2 -2
- package/lib/module/utils/hooks/core/dids.js.map +1 -1
- package/lib/module/utils/hooks/core/history.js +1 -1
- package/lib/module/utils/hooks/core/history.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +4 -4
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +10 -10
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +6 -6
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js +12 -11
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +11 -8
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +2 -2
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +30 -17
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/url.js.map +1 -1
- package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
- package/lib/typescript/components/credential/credential.d.ts +2 -2
- package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
- package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
- package/lib/typescript/components/entity/entity-details.d.ts +5 -5
- package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
- package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
- package/lib/typescript/components/history/history-list-item.d.ts +5 -5
- package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
- package/lib/typescript/components/history/history-list.d.ts +5 -5
- package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
- package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
- package/lib/typescript/ui-components/settings/setting-item.d.ts +1 -0
- package/lib/typescript/utils/history.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/core-context.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/credentials.d.ts +8 -8
- package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
- package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -9
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -5
- package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -8
- package/lib/typescript/utils/parsers/credential.d.ts +15 -14
- package/lib/typescript/utils/parsers/query.d.ts +8 -8
- package/package.json +6 -4
- package/src/components/backup/preview-credentials.tsx +2 -2
- package/src/components/credential/credential.tsx +2 -2
- package/src/components/entity/EntityButtons.tsx +2 -2
- package/src/components/entity/entity-attributes.tsx +4 -4
- package/src/components/entity/entity-details-with-buttons.tsx +11 -6
- package/src/components/entity/entity-details.tsx +17 -16
- package/src/components/history/history-details-screen.tsx +13 -16
- package/src/components/history/history-list-item-icon.tsx +19 -11
- package/src/components/history/history-list-item.tsx +9 -5
- package/src/components/history/history-list-screen.tsx +4 -4
- package/src/components/history/history-list-section-header.tsx +1 -1
- package/src/components/history/history-list.tsx +6 -6
- package/src/components/proof-request/share-credential-card-notice.tsx +1 -1
- package/src/components/proof-request/v1/select-credential.tsx +2 -2
- package/src/components/proof-request/v1/share-credential.tsx +13 -11
- package/src/components/proof-request/v2/select-credential-v2.tsx +6 -3
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +12 -12
- package/src/components/proof-request/v2/share-credential-v2.tsx +11 -11
- package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +4 -1
- package/src/ui-components/accessibility/locale/fi.json +1 -1
- package/src/ui-components/buttons/ghost-button.stories.tsx +0 -1
- package/src/ui-components/control/checkbox.stories.tsx +1 -1
- package/src/ui-components/control/switch.stories.tsx +1 -1
- package/src/ui-components/credential/card/credential-header.stories.tsx +0 -1
- package/src/ui-components/entity/entity-cluster.tsx +7 -6
- package/src/ui-components/header/foldable-header.tsx +8 -11
- package/src/ui-components/history/history-section-header.tsx +1 -1
- package/src/ui-components/history/history-section-list-item.tsx +1 -1
- package/src/ui-components/icons/entity.tsx +2 -2
- package/src/ui-components/pin/pin-code-screen.stories.tsx +1 -1
- package/src/ui-components/screens/image-preview-screen.stories.tsx +1 -1
- package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
- package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +1 -1
- package/src/ui-components/screens/section-list-screen.tsx +10 -1
- package/src/ui-components/searchbar/search-bar.stories.tsx +0 -1
- package/src/ui-components/settings/button-setting.tsx +2 -1
- package/src/ui-components/settings/setting-item.tsx +9 -2
- package/src/ui-components/settings/switch-setting.tsx +9 -2
- package/src/ui-components/text/typography.stories.tsx +2 -2
- package/src/utils/date.ts +2 -2
- package/src/utils/history.ts +4 -4
- package/src/utils/hooks/connectivity/connectivity.test.ts +2 -2
- package/src/utils/hooks/core/backup.ts +4 -4
- package/src/utils/hooks/core/cache.ts +13 -13
- package/src/utils/hooks/core/core-context.tsx +6 -6
- package/src/utils/hooks/core/credential-schemas.ts +7 -4
- package/src/utils/hooks/core/credentials.ts +21 -13
- package/src/utils/hooks/core/dids.ts +3 -3
- package/src/utils/hooks/core/history.ts +3 -3
- package/src/utils/hooks/core/identifiers.ts +9 -5
- package/src/utils/hooks/core/proof-schemas.ts +21 -16
- package/src/utils/hooks/core/proofs.ts +31 -27
- package/src/utils/hooks/core/trust-entity.ts +19 -12
- package/src/utils/hooks/core/wallet-unit.ts +21 -11
- package/src/utils/hooks/navigation/open-settings.ts +1 -1
- package/src/utils/hooks/revocation/credential-status.ts +2 -2
- package/src/utils/parsers/credential-images.tsx +19 -13
- package/src/utils/parsers/credential-sharing-v2.tsx +29 -24
- package/src/utils/parsers/credential-sharing.tsx +24 -24
- package/src/utils/parsers/credential.ts +63 -40
- package/src/utils/parsers/query.ts +16 -14
- package/src/utils/url.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
ClaimBindingDto,
|
|
3
|
+
ClaimValueBindingDto,
|
|
4
4
|
Config,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
CredentialQueryFailureHintResponseBindingDto,
|
|
6
|
+
PresentationDefinitionV2ClaimBindingDto,
|
|
7
|
+
PresentationDefinitionV2ClaimValueBindingDto,
|
|
8
|
+
PresentationDefinitionV2CredentialDetailBindingDto,
|
|
9
9
|
} from '@procivis/react-native-one-core';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
|
|
@@ -27,14 +27,17 @@ import {
|
|
|
27
27
|
} from '.';
|
|
28
28
|
import { ShareCredentialCardLabels, validityCheckedCardFromCredential } from './credential-sharing';
|
|
29
29
|
|
|
30
|
-
const v2ClaimValueToClaimValue = (value:
|
|
31
|
-
if (
|
|
30
|
+
const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValueBindingDto): ClaimValueBindingDto => {
|
|
31
|
+
if (value.type_ !== 'NESTED') {
|
|
32
32
|
return value;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
type_: 'NESTED',
|
|
36
|
+
value: value.value.map((c) => v2PresentationClaimToClaim(c)),
|
|
37
|
+
};
|
|
35
38
|
};
|
|
36
39
|
|
|
37
|
-
const v2PresentationClaimToClaim = (claim:
|
|
40
|
+
const v2PresentationClaimToClaim = (claim: PresentationDefinitionV2ClaimBindingDto): ClaimBindingDto => {
|
|
38
41
|
return {
|
|
39
42
|
schema: claim.schema,
|
|
40
43
|
path: claim.path,
|
|
@@ -43,14 +46,14 @@ const v2PresentationClaimToClaim = (claim: PresentationDefinitionV2CredentialCla
|
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
const getAttributeSelectorStatus = (
|
|
46
|
-
claim:
|
|
49
|
+
claim: PresentationDefinitionV2ClaimBindingDto,
|
|
47
50
|
selected: boolean,
|
|
48
51
|
force: boolean,
|
|
49
52
|
): SelectorStatus | undefined => {
|
|
50
53
|
if (claim.required && selected) {
|
|
51
54
|
return SelectorStatus.Required;
|
|
52
55
|
}
|
|
53
|
-
if (force
|
|
56
|
+
if (force) {
|
|
54
57
|
return SelectorStatus.Required;
|
|
55
58
|
}
|
|
56
59
|
if (claim.userSelection) {
|
|
@@ -63,7 +66,7 @@ const getAttributeSelectorStatus = (
|
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
export const shareCredentialCardAttributeFromV2Claim = (
|
|
66
|
-
claim:
|
|
69
|
+
claim: PresentationDefinitionV2ClaimBindingDto,
|
|
67
70
|
selection: string[] | undefined,
|
|
68
71
|
parentShared: boolean,
|
|
69
72
|
parentUserSelected: boolean,
|
|
@@ -93,14 +96,14 @@ export const shareCredentialCardAttributeFromV2Claim = (
|
|
|
93
96
|
selected,
|
|
94
97
|
testID,
|
|
95
98
|
};
|
|
96
|
-
if (
|
|
99
|
+
if (claim.value.type_ === 'NESTED') {
|
|
97
100
|
if (claim.schema.array) {
|
|
98
101
|
return {
|
|
99
102
|
...credentialAttribute,
|
|
100
103
|
attributes: undefined,
|
|
101
104
|
image: undefined,
|
|
102
105
|
value: undefined,
|
|
103
|
-
values: claim.value.map((v) =>
|
|
106
|
+
values: claim.value.value.map((v) =>
|
|
104
107
|
shareCredentialCardAttributeFromV2Claim(
|
|
105
108
|
v,
|
|
106
109
|
selection,
|
|
@@ -116,7 +119,7 @@ export const shareCredentialCardAttributeFromV2Claim = (
|
|
|
116
119
|
} else if (claim.schema.datatype === 'OBJECT') {
|
|
117
120
|
return {
|
|
118
121
|
...credentialAttribute,
|
|
119
|
-
attributes: claim.value.map((v) =>
|
|
122
|
+
attributes: claim.value.value.map((v) =>
|
|
120
123
|
shareCredentialCardAttributeFromV2Claim(v, selection, attributeShared, userSelected, config, testID, true),
|
|
121
124
|
),
|
|
122
125
|
image: undefined,
|
|
@@ -130,7 +133,7 @@ export const shareCredentialCardAttributeFromV2Claim = (
|
|
|
130
133
|
};
|
|
131
134
|
|
|
132
135
|
export const missingCredentialCardFromFailureHint = (
|
|
133
|
-
failureHint:
|
|
136
|
+
failureHint: CredentialQueryFailureHintResponseBindingDto | undefined,
|
|
134
137
|
notice: CredentialCardNotice | undefined,
|
|
135
138
|
testID: string,
|
|
136
139
|
labels: ShareCredentialCardLabels,
|
|
@@ -151,8 +154,8 @@ export const missingCredentialCardFromFailureHint = (
|
|
|
151
154
|
};
|
|
152
155
|
|
|
153
156
|
export const shareCredentialCardFromV2PresentationCredential = (
|
|
154
|
-
credential:
|
|
155
|
-
failureHint:
|
|
157
|
+
credential: PresentationDefinitionV2CredentialDetailBindingDto | undefined,
|
|
158
|
+
failureHint: CredentialQueryFailureHintResponseBindingDto | undefined,
|
|
156
159
|
expanded: boolean,
|
|
157
160
|
multipleCredentialsAvailable: boolean,
|
|
158
161
|
selectedFields: string[] | undefined,
|
|
@@ -198,7 +201,7 @@ export const shareCredentialCardFromV2PresentationCredential = (
|
|
|
198
201
|
};
|
|
199
202
|
|
|
200
203
|
export const selectCredentialCardFromV2Credential = (
|
|
201
|
-
credential:
|
|
204
|
+
credential: PresentationDefinitionV2CredentialDetailBindingDto,
|
|
202
205
|
selected: boolean,
|
|
203
206
|
multiple: boolean,
|
|
204
207
|
config: Config,
|
|
@@ -245,13 +248,15 @@ export const selectCredentialCardFromV2Credential = (
|
|
|
245
248
|
};
|
|
246
249
|
};
|
|
247
250
|
|
|
248
|
-
export const getV2CredentialClaimAllSubpaths = (claim:
|
|
249
|
-
if (
|
|
251
|
+
export const getV2CredentialClaimAllSubpaths = (claim: PresentationDefinitionV2ClaimBindingDto): string[] => {
|
|
252
|
+
if (claim.value.type_ !== 'NESTED') {
|
|
250
253
|
return [claim.path];
|
|
251
254
|
}
|
|
252
|
-
return [claim.path, ...claim.value.flatMap(getV2CredentialClaimAllSubpaths)];
|
|
255
|
+
return [claim.path, ...claim.value.value.flatMap(getV2CredentialClaimAllSubpaths)];
|
|
253
256
|
};
|
|
254
257
|
|
|
255
|
-
export const getV2CredentialAvailablePaths = (
|
|
258
|
+
export const getV2CredentialAvailablePaths = (
|
|
259
|
+
credential: PresentationDefinitionV2CredentialDetailBindingDto,
|
|
260
|
+
): string[] => {
|
|
256
261
|
return credential.claims.flatMap(getV2CredentialClaimAllSubpaths);
|
|
257
262
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
ClaimBindingDto,
|
|
3
3
|
Config,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
CredentialDetailBindingDto,
|
|
5
|
+
PresentationDefinitionFieldBindingDto,
|
|
6
|
+
PresentationDefinitionRequestedCredentialBindingDto,
|
|
7
7
|
} from '@procivis/react-native-one-core';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from './credential';
|
|
30
30
|
|
|
31
31
|
export const validityCheckedCardFromCredential = (
|
|
32
|
-
credential:
|
|
32
|
+
credential: CredentialDetailBindingDto,
|
|
33
33
|
invalidLVVC: boolean,
|
|
34
34
|
expanded: boolean,
|
|
35
35
|
multipleCredentialsAvailable: boolean,
|
|
@@ -73,7 +73,7 @@ export const validityCheckedCardFromCredential = (
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export const missingCredentialCardFromRequest = (
|
|
76
|
-
request:
|
|
76
|
+
request: PresentationDefinitionRequestedCredentialBindingDto,
|
|
77
77
|
notice: CredentialCardNotice | undefined,
|
|
78
78
|
testID: string,
|
|
79
79
|
labels: ShareCredentialCardLabels,
|
|
@@ -95,17 +95,17 @@ export const missingCredentialCardFromRequest = (
|
|
|
95
95
|
|
|
96
96
|
interface DisplayedAttribute {
|
|
97
97
|
claim?: FlatClaim;
|
|
98
|
-
field?:
|
|
98
|
+
field?: PresentationDefinitionFieldBindingDto;
|
|
99
99
|
id: string;
|
|
100
100
|
selected?: boolean;
|
|
101
101
|
status: SelectorStatus;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
const getAttributeSelectorStatus = (
|
|
105
|
-
field:
|
|
105
|
+
field: PresentationDefinitionFieldBindingDto,
|
|
106
106
|
validityState: ValidityState,
|
|
107
|
-
credential?:
|
|
108
|
-
claim?:
|
|
107
|
+
credential?: CredentialDetailBindingDto,
|
|
108
|
+
claim?: ClaimBindingDto,
|
|
109
109
|
selected?: boolean,
|
|
110
110
|
): SelectorStatus => {
|
|
111
111
|
if (!credential || validityState !== ValidityState.Valid) {
|
|
@@ -124,16 +124,16 @@ const getAttributeSelectorStatus = (
|
|
|
124
124
|
return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
type FlatClaim =
|
|
127
|
+
type FlatClaim = ClaimBindingDto & {
|
|
128
128
|
isArrayElement?: boolean;
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
// Returns a spread list of all claims with their full JSON path as key, including all intermediate objects
|
|
132
|
-
const spreadClaims = (claims:
|
|
132
|
+
const spreadClaims = (claims: ClaimBindingDto[]): FlatClaim[] => {
|
|
133
133
|
return claims.reduce((acc, claim) => {
|
|
134
134
|
const result = [claim];
|
|
135
|
-
if (
|
|
136
|
-
const nestedClaimsWithPath: FlatClaim[] = claim.value.map((c) => ({
|
|
135
|
+
if (claim.value.type_ === 'NESTED') {
|
|
136
|
+
const nestedClaimsWithPath: FlatClaim[] = claim.value.value.map((c) => ({
|
|
137
137
|
...c,
|
|
138
138
|
isArrayElement: claim.schema.array && claim.path.split('/').pop() !== claim.schema.key,
|
|
139
139
|
}));
|
|
@@ -144,9 +144,9 @@ const spreadClaims = (claims: Claim[]): FlatClaim[] => {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
const getDisplayedAttributes = (
|
|
147
|
-
request:
|
|
147
|
+
request: PresentationDefinitionRequestedCredentialBindingDto,
|
|
148
148
|
validityState: ValidityState,
|
|
149
|
-
credential?:
|
|
149
|
+
credential?: CredentialDetailBindingDto,
|
|
150
150
|
selectiveDisclosureSupported?: boolean,
|
|
151
151
|
selectedFields?: string[],
|
|
152
152
|
): DisplayedAttribute[] => {
|
|
@@ -179,8 +179,8 @@ const getDisplayedAttributes = (
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
const getFullyNestedFields = (
|
|
182
|
-
fields:
|
|
183
|
-
credentialId:
|
|
182
|
+
fields: PresentationDefinitionRequestedCredentialBindingDto['fields'],
|
|
183
|
+
credentialId: CredentialDetailBindingDto['id'],
|
|
184
184
|
) => {
|
|
185
185
|
const allKeys = fields.filter((field) => credentialId in field.keyMap).map((field) => field.keyMap[credentialId]);
|
|
186
186
|
|
|
@@ -196,7 +196,7 @@ export const shareCredentialCardAttributeFromClaim = (
|
|
|
196
196
|
testID: string,
|
|
197
197
|
labels: ShareCredentialCardLabels,
|
|
198
198
|
claim?: FlatClaim,
|
|
199
|
-
field?:
|
|
199
|
+
field?: PresentationDefinitionFieldBindingDto,
|
|
200
200
|
): CredentialAttribute => {
|
|
201
201
|
if (claim) {
|
|
202
202
|
return {
|
|
@@ -257,11 +257,11 @@ export type ShareCredentialCardLabels = CardLabels & {
|
|
|
257
257
|
};
|
|
258
258
|
|
|
259
259
|
export const shareCredentialCardFromCredential = (
|
|
260
|
-
credential:
|
|
260
|
+
credential: CredentialDetailBindingDto | undefined,
|
|
261
261
|
invalidLVVC: boolean,
|
|
262
262
|
expanded: boolean,
|
|
263
263
|
multipleCredentialsAvailable: boolean,
|
|
264
|
-
request:
|
|
264
|
+
request: PresentationDefinitionRequestedCredentialBindingDto,
|
|
265
265
|
selectedFields: string[] | undefined,
|
|
266
266
|
config: Config,
|
|
267
267
|
testID: string,
|
|
@@ -329,7 +329,7 @@ export const selectCredentialCardAttributeFromClaim = (
|
|
|
329
329
|
testID: string,
|
|
330
330
|
labels: ShareCredentialCardLabels,
|
|
331
331
|
claim?: FlatClaim,
|
|
332
|
-
field?:
|
|
332
|
+
field?: PresentationDefinitionFieldBindingDto,
|
|
333
333
|
): CredentialAttribute => {
|
|
334
334
|
const attribute = shareCredentialCardAttributeFromClaim(id, config, testID, labels, claim, field);
|
|
335
335
|
if (!claim) {
|
|
@@ -342,9 +342,9 @@ export const selectCredentialCardAttributeFromClaim = (
|
|
|
342
342
|
};
|
|
343
343
|
|
|
344
344
|
export const selectCredentialCardFromCredential = (
|
|
345
|
-
credential:
|
|
345
|
+
credential: CredentialDetailBindingDto,
|
|
346
346
|
selected: boolean,
|
|
347
|
-
request:
|
|
347
|
+
request: PresentationDefinitionRequestedCredentialBindingDto,
|
|
348
348
|
config: Config,
|
|
349
349
|
testID: string,
|
|
350
350
|
labels: ShareCredentialCardLabels,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
ClaimBindingDto,
|
|
3
3
|
Config,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
CredentialDetailBindingDto,
|
|
5
|
+
CredentialListItemBindingDto,
|
|
6
|
+
CredentialSchemaDetailBindingDto,
|
|
7
|
+
CredentialStateBindingEnum,
|
|
8
8
|
DataTypeEnum,
|
|
9
9
|
FormatFeatureEnum,
|
|
10
10
|
} from '@procivis/react-native-one-core';
|
|
@@ -30,37 +30,52 @@ export enum ValidityState {
|
|
|
30
30
|
Valid = 'valid',
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export const getValidityState = (credential:
|
|
34
|
-
if (credential?.state ===
|
|
33
|
+
export const getValidityState = (credential: CredentialListItemBindingDto | undefined) => {
|
|
34
|
+
if (credential?.state === CredentialStateBindingEnum.REVOKED) {
|
|
35
35
|
return ValidityState.Revoked;
|
|
36
36
|
}
|
|
37
|
-
if (credential?.state ===
|
|
37
|
+
if (credential?.state === CredentialStateBindingEnum.SUSPENDED) {
|
|
38
38
|
return ValidityState.Suspended;
|
|
39
39
|
}
|
|
40
40
|
return ValidityState.Valid;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export const supportsSelectiveDisclosure = (
|
|
43
|
+
export const supportsSelectiveDisclosure = (
|
|
44
|
+
credential: CredentialListItemBindingDto | undefined,
|
|
45
|
+
config: Config | undefined,
|
|
46
|
+
) => {
|
|
44
47
|
const formatConfig = credential && config?.format[credential.schema.format];
|
|
45
48
|
return formatConfig
|
|
46
49
|
? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))
|
|
47
50
|
: undefined;
|
|
48
51
|
};
|
|
49
52
|
|
|
50
|
-
export const findClaimByPath = (path: string | undefined, claims:
|
|
51
|
-
|
|
53
|
+
export const findClaimByPath = (path: string | undefined, claims: ClaimBindingDto[]): ClaimBindingDto | undefined => {
|
|
54
|
+
if (!path) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const exactClaim = claims.find((claim) => claim.path === path);
|
|
59
|
+
if (exactClaim) {
|
|
60
|
+
return exactClaim;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const parentClaim = claims.find((claim) => path.startsWith(`${claim.path}/`));
|
|
64
|
+
if (parentClaim && parentClaim.value.type_ === 'NESTED') {
|
|
65
|
+
return findClaimByPath(path, parentClaim.value.value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return undefined;
|
|
69
|
+
};
|
|
52
70
|
|
|
53
|
-
const formatCredentialDetail = (claim:
|
|
71
|
+
const formatCredentialDetail = (claim: ClaimBindingDto, config: Config, testID: string): string => {
|
|
54
72
|
const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);
|
|
55
73
|
return attributeValue.value ?? '';
|
|
56
74
|
};
|
|
57
75
|
|
|
58
|
-
export const hasMsoValidityIssues = (credential:
|
|
59
|
-
const mdocMsoValidity: { nextUpdate: string } | undefined =
|
|
60
|
-
'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;
|
|
61
|
-
|
|
76
|
+
export const hasMsoValidityIssues = (credential: CredentialDetailBindingDto): boolean => {
|
|
62
77
|
const mdocMsoValidityIssue = Boolean(
|
|
63
|
-
mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),
|
|
78
|
+
credential.mdocMsoValidity?.nextUpdate && new Date(credential.mdocMsoValidity.nextUpdate) < new Date(),
|
|
64
79
|
);
|
|
65
80
|
|
|
66
81
|
return mdocMsoValidityIssue;
|
|
@@ -74,8 +89,8 @@ export type CardHeaderLabels = {
|
|
|
74
89
|
};
|
|
75
90
|
|
|
76
91
|
const credentialDetailFromCredential = (
|
|
77
|
-
credential:
|
|
78
|
-
claims:
|
|
92
|
+
credential: CredentialDetailBindingDto,
|
|
93
|
+
claims: ClaimBindingDto[] = [],
|
|
79
94
|
config: Config,
|
|
80
95
|
testID: string,
|
|
81
96
|
labels: CardHeaderLabels,
|
|
@@ -89,7 +104,7 @@ const credentialDetailFromCredential = (
|
|
|
89
104
|
const { layoutProperties } = credential.schema;
|
|
90
105
|
|
|
91
106
|
switch (credential.state) {
|
|
92
|
-
case
|
|
107
|
+
case CredentialStateBindingEnum.SUSPENDED:
|
|
93
108
|
return {
|
|
94
109
|
credentialDetailPrimary: credential.suspendEndDate
|
|
95
110
|
? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)
|
|
@@ -97,7 +112,7 @@ const credentialDetailFromCredential = (
|
|
|
97
112
|
credentialDetailTestID: concatTestID(testID, 'suspended'),
|
|
98
113
|
statusIcon: CredentialWarningIcon,
|
|
99
114
|
};
|
|
100
|
-
case
|
|
115
|
+
case CredentialStateBindingEnum.REVOKED:
|
|
101
116
|
return {
|
|
102
117
|
credentialDetailPrimary: labels.revoked,
|
|
103
118
|
credentialDetailErrorColor: true,
|
|
@@ -138,8 +153,8 @@ const credentialDetailFromCredential = (
|
|
|
138
153
|
};
|
|
139
154
|
|
|
140
155
|
export const cardHeaderFromCredential = (
|
|
141
|
-
credential:
|
|
142
|
-
claims:
|
|
156
|
+
credential: CredentialDetailBindingDto,
|
|
157
|
+
claims: ClaimBindingDto[] = [],
|
|
143
158
|
config: Config,
|
|
144
159
|
testID: string,
|
|
145
160
|
labels: CardHeaderLabels,
|
|
@@ -178,8 +193,8 @@ export type CardLabels = CardHeaderLabels & {
|
|
|
178
193
|
};
|
|
179
194
|
|
|
180
195
|
export const getCredentialCardPropsFromCredential = (
|
|
181
|
-
credential:
|
|
182
|
-
claims:
|
|
196
|
+
credential: CredentialDetailBindingDto,
|
|
197
|
+
claims: ClaimBindingDto[] = [],
|
|
183
198
|
config: Config,
|
|
184
199
|
notice: CredentialCardNotice | undefined,
|
|
185
200
|
testID: string,
|
|
@@ -208,7 +223,11 @@ export const getCredentialCardPropsFromCredential = (
|
|
|
208
223
|
return result;
|
|
209
224
|
};
|
|
210
225
|
|
|
211
|
-
export const detailsCardAttributeFromClaim = (
|
|
226
|
+
export const detailsCardAttributeFromClaim = (
|
|
227
|
+
claim: ClaimBindingDto,
|
|
228
|
+
config: Config,
|
|
229
|
+
testID: string,
|
|
230
|
+
): CredentialAttribute => {
|
|
212
231
|
const value = detailsCardAttributeValueFromClaim(claim, config, testID);
|
|
213
232
|
return {
|
|
214
233
|
id: claim.path,
|
|
@@ -218,33 +237,37 @@ export const detailsCardAttributeFromClaim = (claim: Claim, config: Config, test
|
|
|
218
237
|
};
|
|
219
238
|
};
|
|
220
239
|
|
|
221
|
-
const detailsCardAttributeValueFromClaim = (
|
|
240
|
+
const detailsCardAttributeValueFromClaim = (
|
|
241
|
+
claim: ClaimBindingDto,
|
|
242
|
+
config: Config,
|
|
243
|
+
testID: string,
|
|
244
|
+
): CredentialAttributeValue => {
|
|
222
245
|
const typeConfig = config?.datatype[claim.schema.datatype];
|
|
223
246
|
|
|
224
247
|
if (claim.schema.array) {
|
|
225
248
|
return {
|
|
226
|
-
values: ((claim.value as
|
|
249
|
+
values: ((claim.value.value as ClaimBindingDto[]) || []).map((arrayValue, index) => {
|
|
227
250
|
return detailsCardAttributeFromClaim(arrayValue, config, concatTestID(testID, index.toString()));
|
|
228
251
|
}),
|
|
229
252
|
};
|
|
230
253
|
} else {
|
|
231
254
|
switch (typeConfig?.type) {
|
|
232
255
|
case DataTypeEnum.Object: {
|
|
233
|
-
if (
|
|
256
|
+
if (claim.value.type_ !== 'NESTED') {
|
|
234
257
|
return { attributes: [] };
|
|
235
258
|
}
|
|
236
259
|
return {
|
|
237
|
-
attributes:
|
|
260
|
+
attributes: claim.value.value.map((nestedClaim, index) =>
|
|
238
261
|
detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),
|
|
239
262
|
),
|
|
240
263
|
};
|
|
241
264
|
}
|
|
242
265
|
case DataTypeEnum.Date: {
|
|
243
|
-
if (!claim.value) {
|
|
266
|
+
if (!claim.value.value) {
|
|
244
267
|
// Don't try to parse empty values (which will return "Invalid Date")
|
|
245
|
-
return { testID: testID, value: String(claim.value) };
|
|
268
|
+
return { testID: testID, value: String(claim.value.value) };
|
|
246
269
|
}
|
|
247
|
-
const date = claim.value as string;
|
|
270
|
+
const date = claim.value.value as string;
|
|
248
271
|
return {
|
|
249
272
|
testID: testID,
|
|
250
273
|
value: formatDateLocalized(new Date(date)) ?? date,
|
|
@@ -253,13 +276,13 @@ const detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID
|
|
|
253
276
|
case DataTypeEnum.Picture: // fallback
|
|
254
277
|
case DataTypeEnum.SwiyuPicture: {
|
|
255
278
|
if (typeConfig.params?.showAs === 'IMAGE') {
|
|
256
|
-
return { image: { uri: claim.value as string }, testID: testID };
|
|
279
|
+
return { image: { uri: claim.value.value as string }, testID: testID };
|
|
257
280
|
} else {
|
|
258
|
-
return { testID: testID, value: claim.value as string };
|
|
281
|
+
return { testID: testID, value: claim.value.value as string };
|
|
259
282
|
}
|
|
260
283
|
}
|
|
261
284
|
default:
|
|
262
|
-
return { testID: testID, value: String(claim.value) };
|
|
285
|
+
return { testID: testID, value: String(claim.value.value) };
|
|
263
286
|
}
|
|
264
287
|
}
|
|
265
288
|
};
|
|
@@ -269,7 +292,7 @@ export type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardP
|
|
|
269
292
|
};
|
|
270
293
|
|
|
271
294
|
export const detailsCardFromCredential = (
|
|
272
|
-
credential:
|
|
295
|
+
credential: CredentialDetailBindingDto,
|
|
273
296
|
config: Config,
|
|
274
297
|
testID: string,
|
|
275
298
|
labels: CardLabels,
|
|
@@ -278,8 +301,8 @@ export const detailsCardFromCredential = (
|
|
|
278
301
|
};
|
|
279
302
|
|
|
280
303
|
export const detailsCardFromCredentialWithClaims = (
|
|
281
|
-
credential:
|
|
282
|
-
claims:
|
|
304
|
+
credential: CredentialDetailBindingDto,
|
|
305
|
+
claims: ClaimBindingDto[],
|
|
283
306
|
config: Config,
|
|
284
307
|
testID: string,
|
|
285
308
|
labels: CardLabels,
|
|
@@ -379,7 +402,7 @@ function parseBase64Image(image: string | undefined) {
|
|
|
379
402
|
return image ? '__BASE64IMAGE__' : '';
|
|
380
403
|
}
|
|
381
404
|
|
|
382
|
-
export function getCredentialSchemaWithoutImages(credentialSchema:
|
|
405
|
+
export function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchemaDetailBindingDto) {
|
|
383
406
|
return {
|
|
384
407
|
...credentialSchema,
|
|
385
408
|
layoutProperties: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
CredentialListQueryBindingDto,
|
|
3
|
+
CredentialSchemaListQueryBindingDto,
|
|
4
|
+
DidListQueryBindingDto,
|
|
5
|
+
HistoryListQueryBindingDto,
|
|
6
|
+
IdentifierListQueryBindingDto,
|
|
7
|
+
ListProofSchemasFiltersBindingDto,
|
|
8
|
+
ProofListQueryBindingDto,
|
|
9
9
|
} from '@procivis/react-native-one-core';
|
|
10
10
|
|
|
11
11
|
type QueryKey<ListQuery, ParamList> = ParamList extends ReadonlyArray<keyof ListQuery> // all params are inside the ListQuery
|
|
@@ -22,7 +22,7 @@ function getQueryKey<ListQuery extends {}, ParamList extends ReadonlyArray<keyof
|
|
|
22
22
|
return params.map((param) => queryParams[param]) as QueryKey<ListQuery, ParamList>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<
|
|
25
|
+
export const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<CredentialListQueryBindingDto> = {}) => {
|
|
26
26
|
return getQueryKey(queryParams, [
|
|
27
27
|
'page',
|
|
28
28
|
'pageSize',
|
|
@@ -50,7 +50,7 @@ export const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<Cr
|
|
|
50
50
|
]);
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<
|
|
53
|
+
export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<HistoryListQueryBindingDto> = {}) => {
|
|
54
54
|
return getQueryKey(queryParams, [
|
|
55
55
|
'page',
|
|
56
56
|
'pageSize',
|
|
@@ -70,7 +70,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
export const getQueryKeyFromCredentialSchemaListQueryParams = (
|
|
73
|
-
queryParams: Partial<
|
|
73
|
+
queryParams: Partial<CredentialSchemaListQueryBindingDto> = {},
|
|
74
74
|
) => {
|
|
75
75
|
return getQueryKey(queryParams, [
|
|
76
76
|
'page',
|
|
@@ -91,7 +91,9 @@ export const getQueryKeyFromCredentialSchemaListQueryParams = (
|
|
|
91
91
|
]);
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
export const getQueryKeyFromProofSchemaListQueryParams = (
|
|
94
|
+
export const getQueryKeyFromProofSchemaListQueryParams = (
|
|
95
|
+
queryParams: Partial<ListProofSchemasFiltersBindingDto> = {},
|
|
96
|
+
) => {
|
|
95
97
|
return getQueryKey(queryParams, [
|
|
96
98
|
'page',
|
|
97
99
|
'pageSize',
|
|
@@ -109,7 +111,7 @@ export const getQueryKeyFromProofSchemaListQueryParams = (queryParams: Partial<P
|
|
|
109
111
|
]);
|
|
110
112
|
};
|
|
111
113
|
|
|
112
|
-
export const getQueryKeyFromProofListQueryParams = (queryParams: Partial<
|
|
114
|
+
export const getQueryKeyFromProofListQueryParams = (queryParams: Partial<ProofListQueryBindingDto> = {}) => {
|
|
113
115
|
return getQueryKey(queryParams, [
|
|
114
116
|
'page',
|
|
115
117
|
'pageSize',
|
|
@@ -134,7 +136,7 @@ export const getQueryKeyFromProofListQueryParams = (queryParams: Partial<ProofLi
|
|
|
134
136
|
]);
|
|
135
137
|
};
|
|
136
138
|
|
|
137
|
-
export const getQueryKeyFromDidListQueryParams = (queryParams: Partial<
|
|
139
|
+
export const getQueryKeyFromDidListQueryParams = (queryParams: Partial<DidListQueryBindingDto> = {}) => {
|
|
138
140
|
return getQueryKey(queryParams, [
|
|
139
141
|
'page',
|
|
140
142
|
'pageSize',
|
|
@@ -154,7 +156,7 @@ export const getQueryKeyFromDidListQueryParams = (queryParams: Partial<DidListQu
|
|
|
154
156
|
]);
|
|
155
157
|
};
|
|
156
158
|
|
|
157
|
-
export const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<
|
|
159
|
+
export const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<IdentifierListQueryBindingDto> = {}) => {
|
|
158
160
|
return getQueryKey(queryParams, [
|
|
159
161
|
'page',
|
|
160
162
|
'pageSize',
|
package/src/utils/url.ts
CHANGED