@procivis/one-react-native-components 0.3.106 → 0.3.115
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 +14 -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/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.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/control/checkbox.js +2 -1
- package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
- package/lib/commonjs/ui-components/control/switch.js +2 -2
- package/lib/commonjs/ui-components/control/switch.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/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/utils/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +2 -2
- 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-config.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +4 -2
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +4 -4
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +2 -2
- 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 +2 -2
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +22 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +11 -11
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-list.js +32 -0
- package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/verifier-instance.js +52 -0
- package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +38 -3
- package/lib/commonjs/utils/hooks/core/wallet-unit.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 +3 -3
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +9 -9
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +2 -2
- package/lib/commonjs/utils/parsers/query.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 +15 -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/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.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/control/checkbox.js +2 -1
- package/lib/module/ui-components/control/checkbox.js.map +1 -1
- package/lib/module/ui-components/control/switch.js +3 -3
- package/lib/module/ui-components/control/switch.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/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/utils/history.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +3 -3
- 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-config.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +4 -2
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +5 -5
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +3 -3
- 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 +3 -3
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +2 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +12 -12
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +2 -2
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-list.js +24 -0
- package/lib/module/utils/hooks/core/trust-list.js.map +1 -0
- package/lib/module/utils/hooks/core/verifier-instance.js +43 -0
- package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -0
- package/lib/module/utils/hooks/core/wallet-unit.js +36 -3
- package/lib/module/utils/hooks/core/wallet-unit.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 +4 -4
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +10 -10
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +2 -2
- package/lib/module/utils/parsers/query.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/control/checkbox.d.ts +1 -1
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
- 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-config.d.ts +4 -4
- package/lib/typescript/utils/hooks/core/core-init.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 +9 -16
- 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/index.d.ts +2 -0
- 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 +5 -5
- package/lib/typescript/utils/hooks/core/trust-list.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +8 -0
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +11 -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 +11 -11
- package/lib/typescript/utils/parsers/query.d.ts +8 -8
- package/package.json +3 -3
- 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 +2 -2
- package/src/components/entity/entity-details-with-buttons.tsx +6 -11
- package/src/components/entity/entity-details.tsx +16 -17
- package/src/components/history/history-details-screen.tsx +13 -13
- package/src/components/history/history-list-item-icon.tsx +17 -15
- package/src/components/history/history-list-item.tsx +5 -9
- 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/v1/select-credential.tsx +2 -2
- package/src/components/proof-request/v1/share-credential.tsx +11 -13
- package/src/components/proof-request/v2/select-credential-v2.tsx +3 -6
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +10 -10
- package/src/components/proof-request/v2/share-credential-v2.tsx +9 -9
- package/src/ui-components/control/checkbox.tsx +13 -11
- package/src/ui-components/control/switch.tsx +23 -21
- package/src/ui-components/detail/detail.stories.tsx +1 -1
- 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/screens/nerd-mode-screen.tsx +2 -2
- package/src/utils/history.ts +4 -4
- package/src/utils/hooks/core/backup.ts +3 -3
- package/src/utils/hooks/core/cache.ts +13 -13
- package/src/utils/hooks/core/core-config.ts +3 -3
- package/src/utils/hooks/core/core-init.ts +3 -4
- package/src/utils/hooks/core/credential-schemas.ts +5 -8
- package/src/utils/hooks/core/credentials.ts +16 -32
- package/src/utils/hooks/core/dids.ts +4 -4
- package/src/utils/hooks/core/history.ts +3 -3
- package/src/utils/hooks/core/identifiers.ts +4 -8
- package/src/utils/hooks/core/index.ts +2 -0
- package/src/utils/hooks/core/proof-schemas.ts +16 -22
- package/src/utils/hooks/core/proofs.ts +33 -34
- package/src/utils/hooks/core/trust-entity.ts +8 -10
- package/src/utils/hooks/core/trust-list.ts +29 -0
- package/src/utils/hooks/core/verifier-instance.ts +54 -0
- package/src/utils/hooks/core/wallet-unit.ts +47 -14
- package/src/utils/hooks/revocation/credential-status.ts +2 -2
- package/src/utils/parsers/credential-images.tsx +6 -10
- package/src/utils/parsers/credential-sharing-v2.tsx +20 -22
- package/src/utils/parsers/credential-sharing.tsx +28 -28
- package/src/utils/parsers/credential.ts +43 -43
- package/src/utils/parsers/query.ts +22 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
CredentialListItem,
|
|
3
|
+
PresentationDefinitionV2,
|
|
4
|
+
PresentationDefinitionV2Claim,
|
|
5
|
+
PresentationSubmitV2CredentialRequest,
|
|
6
6
|
} from '@procivis/react-native-one-core';
|
|
7
7
|
import React, { FC, useCallback, useMemo } from 'react';
|
|
8
8
|
import { ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
@@ -24,7 +24,7 @@ import { GroupedShareCredentialV2Padding, ShareCredentialV2 } from './share-cred
|
|
|
24
24
|
|
|
25
25
|
export type CredentialQuerySelection = Record<
|
|
26
26
|
string,
|
|
27
|
-
|
|
27
|
+
PresentationSubmitV2CredentialRequest | PresentationSubmitV2CredentialRequest[]
|
|
28
28
|
>;
|
|
29
29
|
|
|
30
30
|
export type ShareCredentialGroupLabels = ShareCredentialLabels & {
|
|
@@ -40,11 +40,11 @@ export type ShareCredentialV2GroupProps = {
|
|
|
40
40
|
onSelectField: (
|
|
41
41
|
requestCredentialId: string,
|
|
42
42
|
) => (
|
|
43
|
-
credentialId:
|
|
44
|
-
fieldPath:
|
|
43
|
+
credentialId: CredentialListItem['id'],
|
|
44
|
+
fieldPath: PresentationDefinitionV2Claim['path'],
|
|
45
45
|
selected: boolean,
|
|
46
46
|
) => void;
|
|
47
|
-
presentationDefinition:
|
|
47
|
+
presentationDefinition: PresentationDefinitionV2;
|
|
48
48
|
requestGroup: string[];
|
|
49
49
|
selected?: boolean;
|
|
50
50
|
selectedCredentials?: CredentialQuerySelection;
|
|
@@ -61,7 +61,7 @@ const multipleCredentialsSelected = (
|
|
|
61
61
|
selectedCredentials &&
|
|
62
62
|
selectedCredentials[credentialRequestId] &&
|
|
63
63
|
Array.isArray(selectedCredentials[credentialRequestId]) &&
|
|
64
|
-
(selectedCredentials[credentialRequestId] as
|
|
64
|
+
(selectedCredentials[credentialRequestId] as PresentationSubmitV2CredentialRequest[]).length > 1
|
|
65
65
|
);
|
|
66
66
|
};
|
|
67
67
|
|
|
@@ -123,7 +123,7 @@ export const ShareCredentialV2Group: FC<ShareCredentialV2GroupProps> = ({
|
|
|
123
123
|
const lastQuery = credentialRequestIndex === credentialRequestsLength - 1;
|
|
124
124
|
|
|
125
125
|
const credentialQuery = presentationDefinition.credentialQueries[credentialRequestId].credentialOrFailureHint;
|
|
126
|
-
let defaultSelection:
|
|
126
|
+
let defaultSelection: PresentationSubmitV2CredentialRequest;
|
|
127
127
|
if (credentialQuery.type_ === 'APPLICABLE_CREDENTIALS') {
|
|
128
128
|
defaultSelection = credentialQuery.applicableCredentials?.[0]
|
|
129
129
|
? {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
ApplicableCredentialOrFailureHint,
|
|
3
|
+
CredentialListItem,
|
|
4
|
+
PresentationDefinitionV2Claim,
|
|
5
5
|
} from '@procivis/react-native-one-core';
|
|
6
6
|
import React, { FunctionComponent, useCallback, useMemo } from 'react';
|
|
7
7
|
import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
@@ -14,7 +14,7 @@ import { ShareCredentialCardNotice } from '../share-credential-card-notice';
|
|
|
14
14
|
import { ShareCredentialLabels } from '../v1';
|
|
15
15
|
|
|
16
16
|
export type ShareCredentialV2Props = {
|
|
17
|
-
credentialQuery:
|
|
17
|
+
credentialQuery: ApplicableCredentialOrFailureHint;
|
|
18
18
|
credentialRequestId: string;
|
|
19
19
|
expanded?: boolean;
|
|
20
20
|
grouped?: boolean;
|
|
@@ -25,12 +25,12 @@ export type ShareCredentialV2Props = {
|
|
|
25
25
|
onImagePreview: (title: string, image: ImageSourcePropType) => void;
|
|
26
26
|
onSelectCredential?: () => void;
|
|
27
27
|
onSelectField: (
|
|
28
|
-
credentialId:
|
|
29
|
-
fieldPath:
|
|
28
|
+
credentialId: CredentialListItem['id'],
|
|
29
|
+
fieldPath: PresentationDefinitionV2Claim['path'],
|
|
30
30
|
selected: boolean,
|
|
31
31
|
) => void;
|
|
32
|
-
selectedCredentialId?:
|
|
33
|
-
selectedFields?: Array<
|
|
32
|
+
selectedCredentialId?: CredentialListItem['id'];
|
|
33
|
+
selectedFields?: Array<PresentationDefinitionV2Claim['path']>;
|
|
34
34
|
style?: StyleProp<ViewStyle>;
|
|
35
35
|
testID: string;
|
|
36
36
|
};
|
|
@@ -131,7 +131,7 @@ export const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({
|
|
|
131
131
|
]);
|
|
132
132
|
|
|
133
133
|
const onAttributeSelected = useCallback(
|
|
134
|
-
(fieldPath:
|
|
134
|
+
(fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {
|
|
135
135
|
if (!selectedCredentialId) {
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
@@ -9,7 +9,7 @@ import { useAppColorScheme } from '../theme';
|
|
|
9
9
|
|
|
10
10
|
export interface CheckboxProps extends TouchableOpacityProps {
|
|
11
11
|
value: boolean;
|
|
12
|
-
text
|
|
12
|
+
text?: ReactNode;
|
|
13
13
|
onValueChanged: (value: boolean) => void;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
}
|
|
@@ -24,7 +24,7 @@ export const Checkbox: FC<CheckboxProps> = ({ style, text, value, disabled, onVa
|
|
|
24
24
|
<TouchableOpacity
|
|
25
25
|
activeOpacity={0.8}
|
|
26
26
|
accessibilityRole="checkbox"
|
|
27
|
-
accessibilityState={{ disabled }}
|
|
27
|
+
accessibilityState={{ checked: value, disabled }}
|
|
28
28
|
accessibilityValue={
|
|
29
29
|
disabled ? undefined : { text: t(value ? 'accessibility.control.checked' : 'accessibility.control.unchecked') }
|
|
30
30
|
}
|
|
@@ -45,15 +45,17 @@ export const Checkbox: FC<CheckboxProps> = ({ style, text, value, disabled, onVa
|
|
|
45
45
|
]}
|
|
46
46
|
/>
|
|
47
47
|
)}
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
{text}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
{text && (
|
|
49
|
+
<View style={[styles.text, disabled && styles.disabled]}>
|
|
50
|
+
{typeof text === 'string' ? (
|
|
51
|
+
<Typography preset="xs/line-height-small" color={colorScheme.text}>
|
|
52
|
+
{text}
|
|
53
|
+
</Typography>
|
|
54
|
+
) : (
|
|
55
|
+
text
|
|
56
|
+
)}
|
|
57
|
+
</View>
|
|
58
|
+
)}
|
|
57
59
|
</TouchableOpacity>
|
|
58
60
|
);
|
|
59
61
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { Insets, Platform, StyleSheet, Switch as RNSwitch, SwitchProps as RNSwitchProps } from 'react-native';
|
|
2
|
+
import { Insets, Platform, StyleSheet, Switch as RNSwitch, SwitchProps as RNSwitchProps, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useAppColorScheme } from '../theme';
|
|
5
5
|
|
|
@@ -15,26 +15,28 @@ const hitSlop: Insets = { top: 10, bottom: 10, left: 10, right: 10 };
|
|
|
15
15
|
export const Switch = forwardRef<RNSwitch, SwitchProps>(({ value, disabled, style, onChange, ...props }, ref) => {
|
|
16
16
|
const colorScheme = useAppColorScheme();
|
|
17
17
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
<View>
|
|
19
|
+
<RNSwitch
|
|
20
|
+
ref={ref}
|
|
21
|
+
value={value}
|
|
22
|
+
disabled={disabled}
|
|
23
|
+
hitSlop={hitSlop}
|
|
24
|
+
style={[disabled && styles.disabled, style]}
|
|
25
|
+
onValueChange={onChange}
|
|
26
|
+
trackColor={Platform.select({
|
|
27
|
+
default: { true: colorScheme.grayDark, false: colorScheme.grayDark },
|
|
28
|
+
ios: { true: colorScheme.accent, false: colorScheme.grayDark },
|
|
29
|
+
})}
|
|
30
|
+
thumbColor={Platform.select({
|
|
31
|
+
default: value ? colorScheme.accent : disabled ? colorScheme.background : colorScheme.white,
|
|
32
|
+
ios: colorScheme.white,
|
|
33
|
+
})}
|
|
34
|
+
ios_backgroundColor={colorScheme.grayDark}
|
|
35
|
+
// @ts-ignore: web only prop
|
|
36
|
+
activeThumbColor={colorScheme.accent}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
38
40
|
);
|
|
39
41
|
});
|
|
40
42
|
|
|
@@ -19,7 +19,7 @@ const Render = ({ onRightAction, contentHeight, headerProps }: Args) => {
|
|
|
19
19
|
headerProps={{
|
|
20
20
|
...headerProps,
|
|
21
21
|
rightButtons: [
|
|
22
|
-
<TouchableOpacity onPress={onRightAction} hitSlop={hitSlop}>
|
|
22
|
+
<TouchableOpacity key="R" onPress={onRightAction} hitSlop={hitSlop}>
|
|
23
23
|
<Placeholder id="R" style={styles.rightButton} />
|
|
24
24
|
</TouchableOpacity>,
|
|
25
25
|
],
|
|
@@ -5,7 +5,7 @@ import { concatTestID } from '../../utils/testID';
|
|
|
5
5
|
import Typography from '../text/typography';
|
|
6
6
|
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
7
7
|
|
|
8
|
-
// component used on the history section lists (Settings->History,
|
|
8
|
+
// component used on the history section lists (Settings->History, CredentialDetail->History)
|
|
9
9
|
// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev
|
|
10
10
|
|
|
11
11
|
const HistorySectionHeaderView: FC<{
|
|
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native';
|
|
|
4
4
|
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
5
5
|
import HistoryItemView, { HistoryItemViewProps } from './history-item';
|
|
6
6
|
|
|
7
|
-
// component used on the history section lists (Settings->History,
|
|
7
|
+
// component used on the history section lists (Settings->History, CredentialDetail->History)
|
|
8
8
|
// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev
|
|
9
9
|
|
|
10
10
|
export interface HistorySectionListItemProps extends HistoryItemViewProps {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentifierListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FunctionComponent, useState } from 'react';
|
|
3
3
|
import { SectionList, StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';
|
|
@@ -34,7 +34,7 @@ export interface AttributesLabels {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface SectionEntityCluster {
|
|
37
|
-
identifier?:
|
|
37
|
+
identifier?: IdentifierListItem;
|
|
38
38
|
subline?: string;
|
|
39
39
|
entityLabels: EntityLabels;
|
|
40
40
|
role: ContextRole;
|
package/src/utils/history.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import moment, { Moment } from 'moment';
|
|
3
3
|
|
|
4
4
|
export interface HistoryGroupByDaySection {
|
|
5
|
-
data:
|
|
5
|
+
data: HistoryListItem[];
|
|
6
6
|
date: Moment;
|
|
7
7
|
firstYearEntry: boolean;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const groupEntriesByDay = (entries:
|
|
11
|
-
const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry:
|
|
10
|
+
export const groupEntriesByDay = (entries: HistoryListItem[]) => {
|
|
11
|
+
const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry: HistoryListItem) => {
|
|
12
12
|
const entryDate = moment(entry.createdDate);
|
|
13
13
|
|
|
14
14
|
const matchingEntry = result.find(({ date }) => date.isSame(entryDate, 'day'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentifierState, IdentifierType } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
4
4
|
|
|
@@ -81,11 +81,11 @@ export const useBackupFinalizeImportProcedure = ({ generateHwKey, generateSwKey
|
|
|
81
81
|
let swIdentifierId: string | undefined;
|
|
82
82
|
if (generateSwKey) {
|
|
83
83
|
const identifiers = await core.listIdentifiers({
|
|
84
|
-
states: [
|
|
84
|
+
states: [IdentifierState.ACTIVE],
|
|
85
85
|
organisationId,
|
|
86
86
|
page: 0,
|
|
87
87
|
pageSize: 1,
|
|
88
|
-
types: [
|
|
88
|
+
types: [IdentifierType.DID],
|
|
89
89
|
isRemote: false,
|
|
90
90
|
});
|
|
91
91
|
swIdentifierId = identifiers.values.find((identifier) => identifier.name.startsWith(SW_DID_NAME_PREFIX))?.id;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CacheType } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useMutation, useQueryClient } from 'react-query';
|
|
3
3
|
|
|
4
4
|
import { useONECore } from './core-context';
|
|
@@ -8,17 +8,17 @@ import { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } f
|
|
|
8
8
|
const CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];
|
|
9
9
|
const TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
|
|
10
10
|
|
|
11
|
-
// Map each
|
|
12
|
-
const cacheTypeToQueryKeys: Record<
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
11
|
+
// Map each CacheType to the query keys that should be invalidated when that cache is cleared.
|
|
12
|
+
const cacheTypeToQueryKeys: Record<CacheType, string[]> = {
|
|
13
|
+
[CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,
|
|
14
|
+
[CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,
|
|
15
|
+
[CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
|
|
16
|
+
[CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
17
|
+
[CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
|
|
18
|
+
[CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
|
|
19
|
+
[CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
20
|
+
[CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
21
|
+
[CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const useCacheClear = () => {
|
|
@@ -26,7 +26,7 @@ export const useCacheClear = () => {
|
|
|
26
26
|
const { core } = useONECore();
|
|
27
27
|
|
|
28
28
|
return useMutation(
|
|
29
|
-
async (cacheTypes:
|
|
29
|
+
async (cacheTypes: CacheType[]) => {
|
|
30
30
|
await core.deleteCache(cacheTypes);
|
|
31
31
|
return cacheTypes;
|
|
32
32
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigEntities,CoreConfig } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useQuery } from 'react-query';
|
|
3
3
|
|
|
4
4
|
import { useONECore } from './core-context';
|
|
@@ -13,7 +13,7 @@ export const useCoreConfig = () => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export const getEnabledTransports = (config:
|
|
16
|
+
export const getEnabledTransports = (config: CoreConfig): string[] => {
|
|
17
17
|
return Object.values(config?.transport ?? {})
|
|
18
18
|
.filter((t) => t.enabled !== false)
|
|
19
19
|
.map((transport) => transport.type);
|
|
@@ -25,7 +25,7 @@ export const getEnabledExchangeProtocols = (exchangeProtocol: ConfigEntities<any
|
|
|
25
25
|
.map((exchange) => exchange.type);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
export const getEnabledTrustManagement = (config:
|
|
28
|
+
export const getEnabledTrustManagement = (config: CoreConfig): string[] => {
|
|
29
29
|
return Object.values(config?.trustManagement ?? {})
|
|
30
30
|
.filter((t) => t.enabled !== false)
|
|
31
31
|
.map((trustManagement) => trustManagement.type);
|
|
@@ -43,6 +43,7 @@ export const generateHwIdentifier = async (core: ONECore, organisationId: string
|
|
|
43
43
|
},
|
|
44
44
|
name: HW_DID_NAME_PREFIX,
|
|
45
45
|
organisationId,
|
|
46
|
+
trustInformation: [],
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -74,6 +75,7 @@ export const generateSwIdentifier = async (core: ONECore, organisationId: string
|
|
|
74
75
|
},
|
|
75
76
|
name: SW_DID_NAME_PREFIX,
|
|
76
77
|
organisationId,
|
|
78
|
+
trustInformation: [],
|
|
77
79
|
});
|
|
78
80
|
};
|
|
79
81
|
|
|
@@ -87,10 +89,7 @@ export interface IdentifiersInitializationConfig {
|
|
|
87
89
|
* @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created
|
|
88
90
|
* @returns [hwIdentifierId, swIdentifierId]
|
|
89
91
|
*/
|
|
90
|
-
export const useInitializeONECoreIdentifiers = ({
|
|
91
|
-
generateHwKey,
|
|
92
|
-
generateSwKey,
|
|
93
|
-
}: IdentifiersInitializationConfig) => {
|
|
92
|
+
export const useInitializeONECoreIdentifiers = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {
|
|
94
93
|
const { core, organisationId } = useONECore();
|
|
95
94
|
|
|
96
95
|
return useCallback(async () => {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CredentialSchemaListQueryBindingDto,
|
|
3
|
-
ImportCredentialSchemaRequestSchemaBindingDto,
|
|
4
|
-
} from '@procivis/react-native-one-core';
|
|
1
|
+
import { CredentialSchemaListQuery, ImportCredentialSchemaRequestSchema } from '@procivis/react-native-one-core';
|
|
5
2
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';
|
|
6
3
|
|
|
7
4
|
import { getQueryKeyFromCredentialSchemaListQueryParams } from '../../parsers/query';
|
|
@@ -15,14 +12,14 @@ export const CREDENTIAL_SCHEMA_DETAIL_QUERY_KEY = 'credential-schema-detail';
|
|
|
15
12
|
export const CREDENTIAL_SCHEMA_PREVIEW_QUERY_KEY = 'credential-schema-preview';
|
|
16
13
|
export const CREDENTIAL_SCHEMA_SHARE_QUERY_KEY = 'credential-schema-share';
|
|
17
14
|
|
|
18
|
-
export const useCredentialSchemas = (queryParams?: Partial<
|
|
15
|
+
export const useCredentialSchemas = (queryParams?: Partial<CredentialSchemaListQuery>) => {
|
|
19
16
|
const { core, organisationId } = useONECore();
|
|
20
17
|
|
|
21
18
|
return useInfiniteQuery(
|
|
22
19
|
[CREDENTIAL_SCHEMA_LIST_QUERY_KEY, ...getQueryKeyFromCredentialSchemaListQueryParams(queryParams)],
|
|
23
20
|
({ pageParam = 0 }) =>
|
|
24
21
|
core
|
|
25
|
-
.
|
|
22
|
+
.listCredentialSchemas({
|
|
26
23
|
organisationId,
|
|
27
24
|
page: pageParam,
|
|
28
25
|
pageSize: PAGE_SIZE,
|
|
@@ -46,7 +43,7 @@ export const useCredentialSchemaPreview = (url: string) => {
|
|
|
46
43
|
if (!response.ok) {
|
|
47
44
|
throw response.originalError;
|
|
48
45
|
}
|
|
49
|
-
return response.data as
|
|
46
|
+
return response.data as ImportCredentialSchemaRequestSchema;
|
|
50
47
|
}),
|
|
51
48
|
{
|
|
52
49
|
keepPreviousData: true,
|
|
@@ -59,7 +56,7 @@ export const useCredentialSchemaAccept = () => {
|
|
|
59
56
|
const { core, organisationId } = useONECore();
|
|
60
57
|
|
|
61
58
|
return useMutation(
|
|
62
|
-
async (schema:
|
|
59
|
+
async (schema: ImportCredentialSchemaRequestSchema) =>
|
|
63
60
|
core.importCredentialSchema({
|
|
64
61
|
organisationId,
|
|
65
62
|
schema,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
CredentialListQuery,
|
|
3
|
+
CredentialState,
|
|
4
|
+
HandleInvitationRequest,
|
|
5
|
+
HandleInvitationResponse,
|
|
6
|
+
HolderAcceptCredentialRequest,
|
|
7
|
+
InitiateIssuanceRequest,
|
|
7
8
|
OneError,
|
|
8
9
|
} from '@procivis/react-native-one-core';
|
|
9
10
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';
|
|
@@ -20,22 +21,18 @@ export const CREDENTIAL_LIST_QUERY_KEY = 'credential-list';
|
|
|
20
21
|
export const CREDENTIAL_LIST_PAGED_QUERY_KEY = 'credential-list-paged';
|
|
21
22
|
export const CREDENTIAL_DETAIL_QUERY_KEY = 'credential-detail';
|
|
22
23
|
|
|
23
|
-
export const useCredentials = (queryParams?: Partial<
|
|
24
|
+
export const useCredentials = (queryParams?: Partial<CredentialListQuery>) => {
|
|
24
25
|
const { core, organisationId } = useONECore();
|
|
25
26
|
|
|
26
27
|
return useQuery(
|
|
27
28
|
[CREDENTIAL_LIST_QUERY_KEY, ...getQueryKeyFromCredentialListQueryParams(queryParams)],
|
|
28
29
|
async () => {
|
|
29
|
-
const { values } = await core.
|
|
30
|
+
const { values } = await core.listCredentials({
|
|
30
31
|
organisationId,
|
|
31
32
|
page: 0,
|
|
32
33
|
// TODO: workaround pagination for now, until it's supported by UI
|
|
33
34
|
pageSize: 10000,
|
|
34
|
-
states: [
|
|
35
|
-
CredentialStateBindingEnum.ACCEPTED,
|
|
36
|
-
CredentialStateBindingEnum.SUSPENDED,
|
|
37
|
-
CredentialStateBindingEnum.REVOKED,
|
|
38
|
-
],
|
|
35
|
+
states: [CredentialState.ACCEPTED, CredentialState.SUSPENDED, CredentialState.REVOKED],
|
|
39
36
|
...queryParams,
|
|
40
37
|
});
|
|
41
38
|
return values;
|
|
@@ -46,7 +43,7 @@ export const useCredentials = (queryParams?: Partial<CredentialListQueryBindingD
|
|
|
46
43
|
);
|
|
47
44
|
};
|
|
48
45
|
|
|
49
|
-
export const usePagedCredentials = (queryParams?: Partial<
|
|
46
|
+
export const usePagedCredentials = (queryParams?: Partial<CredentialListQuery>) => {
|
|
50
47
|
const { core, organisationId } = useONECore();
|
|
51
48
|
|
|
52
49
|
return useInfiniteQuery(
|
|
@@ -56,15 +53,11 @@ export const usePagedCredentials = (queryParams?: Partial<CredentialListQueryBin
|
|
|
56
53
|
...getQueryKeyFromCredentialListQueryParams(queryParams),
|
|
57
54
|
],
|
|
58
55
|
({ pageParam = 0 }) =>
|
|
59
|
-
core.
|
|
56
|
+
core.listCredentials({
|
|
60
57
|
organisationId,
|
|
61
58
|
page: pageParam,
|
|
62
59
|
pageSize: PAGE_SIZE,
|
|
63
|
-
states: [
|
|
64
|
-
CredentialStateBindingEnum.ACCEPTED,
|
|
65
|
-
CredentialStateBindingEnum.SUSPENDED,
|
|
66
|
-
CredentialStateBindingEnum.REVOKED,
|
|
67
|
-
],
|
|
60
|
+
states: [CredentialState.ACCEPTED, CredentialState.SUSPENDED, CredentialState.REVOKED],
|
|
68
61
|
...queryParams,
|
|
69
62
|
}),
|
|
70
63
|
{
|
|
@@ -92,10 +85,10 @@ export const useInvitationHandler = () => {
|
|
|
92
85
|
const { core, organisationId } = useONECore();
|
|
93
86
|
|
|
94
87
|
return useMutation(
|
|
95
|
-
async (request: Omit<
|
|
88
|
+
async (request: Omit<HandleInvitationRequest, 'organisationId'>) =>
|
|
96
89
|
core.handleInvitation({ organisationId, ...request }),
|
|
97
90
|
{
|
|
98
|
-
onSuccess: async (result:
|
|
91
|
+
onSuccess: async (result: HandleInvitationResponse) => {
|
|
99
92
|
if (result.type_ === 'PROOF_REQUEST') {
|
|
100
93
|
await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);
|
|
101
94
|
} else {
|
|
@@ -113,17 +106,8 @@ export const useCredentialAccept = () => {
|
|
|
113
106
|
const queryClient = useQueryClient();
|
|
114
107
|
const { core } = useONECore();
|
|
115
108
|
|
|
116
|
-
type CredentialAcceptHookParams = {
|
|
117
|
-
didId?: string;
|
|
118
|
-
identifierId?: string;
|
|
119
|
-
interactionId: string;
|
|
120
|
-
keyId?: string;
|
|
121
|
-
txCode?: string;
|
|
122
|
-
holderWalletUnitId?: string;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
109
|
return useMutation(
|
|
126
|
-
async (credentialAcceptHookParams:
|
|
110
|
+
async (credentialAcceptHookParams: HolderAcceptCredentialRequest) =>
|
|
127
111
|
core.holderAcceptCredential(credentialAcceptHookParams),
|
|
128
112
|
{
|
|
129
113
|
onSuccess: async () => {
|
|
@@ -197,7 +181,7 @@ export const useInitiateIssuance = () => {
|
|
|
197
181
|
const { core, organisationId } = useONECore();
|
|
198
182
|
|
|
199
183
|
return useMutation(
|
|
200
|
-
async (request: Omit<
|
|
184
|
+
async (request: Omit<InitiateIssuanceRequest, 'organisationId'>) =>
|
|
201
185
|
core.initiateIssuance({ organisationId, ...request }),
|
|
202
186
|
{
|
|
203
187
|
onSuccess: async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DidListQuery, DidType } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useQuery } from 'react-query';
|
|
3
3
|
|
|
4
4
|
import { getQueryKeyFromDidListQueryParams } from '../../parsers/query';
|
|
@@ -7,18 +7,18 @@ import { useONECore } from './core-context';
|
|
|
7
7
|
const PAGE_SIZE = 20;
|
|
8
8
|
export const DID_LIST_QUERY_KEY = 'did-list';
|
|
9
9
|
|
|
10
|
-
export const useDids = (queryParams?: Partial<
|
|
10
|
+
export const useDids = (queryParams?: Partial<DidListQuery>) => {
|
|
11
11
|
const { core, organisationId } = useONECore();
|
|
12
12
|
|
|
13
13
|
return useQuery(
|
|
14
14
|
[DID_LIST_QUERY_KEY, ...getQueryKeyFromDidListQueryParams(queryParams)],
|
|
15
15
|
async ({ pageParam = 0 }) => {
|
|
16
|
-
const dids = await core.
|
|
16
|
+
const dids = await core.listDids({
|
|
17
17
|
deactivated: false,
|
|
18
18
|
organisationId,
|
|
19
19
|
page: pageParam,
|
|
20
20
|
pageSize: PAGE_SIZE,
|
|
21
|
-
type:
|
|
21
|
+
type: DidType.LOCAL,
|
|
22
22
|
...queryParams,
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useInfiniteQuery } from 'react-query';
|
|
3
3
|
|
|
4
4
|
import { getQueryKeyFromHistoryListQueryParams } from '../../parsers/query';
|
|
@@ -7,13 +7,13 @@ import { useONECore } from './core-context';
|
|
|
7
7
|
const PAGE_SIZE = 20;
|
|
8
8
|
export const HISTORY_LIST_QUERY_KEY = 'history-list';
|
|
9
9
|
|
|
10
|
-
export const useHistory = (queryParams?: Partial<
|
|
10
|
+
export const useHistory = (queryParams?: Partial<HistoryListQuery>) => {
|
|
11
11
|
const { core, organisationId } = useONECore();
|
|
12
12
|
|
|
13
13
|
return useInfiniteQuery(
|
|
14
14
|
[HISTORY_LIST_QUERY_KEY, ...getQueryKeyFromHistoryListQueryParams(queryParams)],
|
|
15
15
|
async ({ pageParam = 0 }) => {
|
|
16
|
-
const historyPage = await core.
|
|
16
|
+
const historyPage = await core.listHistory({
|
|
17
17
|
organisationId,
|
|
18
18
|
page: pageParam,
|
|
19
19
|
pageSize: PAGE_SIZE,
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IdentifierListQueryBindingDto,
|
|
3
|
-
IdentifierStateBindingEnum,
|
|
4
|
-
IdentifierTypeBindingEnum,
|
|
5
|
-
} from '@procivis/react-native-one-core';
|
|
1
|
+
import { IdentifierListQuery, IdentifierState, IdentifierType } from '@procivis/react-native-one-core';
|
|
6
2
|
import { useQuery } from 'react-query';
|
|
7
3
|
|
|
8
4
|
import { getQueryKeyFromIdentifierListQueryParams } from '../../parsers';
|
|
@@ -25,17 +21,17 @@ export const useIdentifierDetails = (identifierId: string | undefined) => {
|
|
|
25
21
|
);
|
|
26
22
|
};
|
|
27
23
|
|
|
28
|
-
export const useIdentifiers = (identifierFilter?: Partial<
|
|
24
|
+
export const useIdentifiers = (identifierFilter?: Partial<IdentifierListQuery>) => {
|
|
29
25
|
const { core, organisationId } = useONECore();
|
|
30
26
|
|
|
31
27
|
return useQuery(
|
|
32
28
|
[IDENTIFIER_LIST_QUERY_KEY, ...getQueryKeyFromIdentifierListQueryParams(identifierFilter)],
|
|
33
29
|
({ pageParam = 0 }) =>
|
|
34
30
|
core.listIdentifiers({
|
|
35
|
-
types: [
|
|
31
|
+
types: [IdentifierType.DID],
|
|
36
32
|
isRemote: false,
|
|
37
33
|
page: pageParam,
|
|
38
|
-
states: [
|
|
34
|
+
states: [IdentifierState.ACTIVE],
|
|
39
35
|
organisationId: organisationId,
|
|
40
36
|
pageSize: PAGE_SIZE,
|
|
41
37
|
...identifierFilter,
|