@procivis/one-react-native-components 0.3.112 → 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/history/history-list-item-icon.js +5 -2
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/ui-components/control/checkbox.js +1 -0
- package/lib/commonjs/ui-components/control/checkbox.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/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +11 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
- 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 +9 -2
- package/lib/commonjs/utils/hooks/core/wallet-unit.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/history/history-list-item-icon.js +5 -2
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/ui-components/control/checkbox.js +1 -0
- package/lib/module/ui-components/control/checkbox.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/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +1 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
- 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 +9 -2
- package/lib/module/utils/hooks/core/wallet-unit.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/utils/hooks/core/core-init.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +2 -9
- package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +8 -0
- package/lib/typescript/utils/parsers/query.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/history/history-list-item-icon.tsx +3 -0
- package/src/ui-components/control/checkbox.tsx +1 -1
- package/src/utils/hooks/core/core-init.ts +3 -4
- package/src/utils/hooks/core/credentials.ts +2 -10
- package/src/utils/hooks/core/index.ts +1 -0
- package/src/utils/hooks/core/trust-list.ts +1 -1
- package/src/utils/hooks/core/verifier-instance.ts +54 -0
- package/src/utils/hooks/core/wallet-unit.ts +9 -2
- package/src/utils/parsers/query.ts +8 -0
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
CredentialState,
|
|
4
4
|
HandleInvitationRequest,
|
|
5
5
|
HandleInvitationResponse,
|
|
6
|
+
HolderAcceptCredentialRequest,
|
|
6
7
|
InitiateIssuanceRequest,
|
|
7
8
|
OneError,
|
|
8
9
|
} from '@procivis/react-native-one-core';
|
|
@@ -105,17 +106,8 @@ export const useCredentialAccept = () => {
|
|
|
105
106
|
const queryClient = useQueryClient();
|
|
106
107
|
const { core } = useONECore();
|
|
107
108
|
|
|
108
|
-
type CredentialAcceptHookParams = {
|
|
109
|
-
didId?: string;
|
|
110
|
-
identifierId?: string;
|
|
111
|
-
interactionId: string;
|
|
112
|
-
keyId?: string;
|
|
113
|
-
txCode?: string;
|
|
114
|
-
holderWalletUnitId?: string;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
109
|
return useMutation(
|
|
118
|
-
async (credentialAcceptHookParams:
|
|
110
|
+
async (credentialAcceptHookParams: HolderAcceptCredentialRequest) =>
|
|
119
111
|
core.holderAcceptCredential(credentialAcceptHookParams),
|
|
120
112
|
{
|
|
121
113
|
onSuccess: async () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { HolderWalletUnit } from '@procivis/react-native-one-core';
|
|
1
2
|
import { useMutation } from 'react-query';
|
|
2
3
|
|
|
3
4
|
import { reportException } from '../../reporting';
|
|
4
5
|
import { useONECore } from './core-context';
|
|
5
|
-
import { HolderWalletUnit } from '@procivis/react-native-one-core';
|
|
6
6
|
|
|
7
7
|
export const useTrustCollectionSync = () => {
|
|
8
8
|
const { core } = useONECore();
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { RegisterVerifierInstanceRequest, UpdateVerifierInstanceRequest } from '@procivis/react-native-one-core';
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
3
|
+
|
|
4
|
+
import { reportException } from '../../reporting';
|
|
5
|
+
import { useONECore } from './core-context';
|
|
6
|
+
|
|
7
|
+
export const VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY = 'verifier-instance-trust-collections';
|
|
8
|
+
|
|
9
|
+
export const useVerifierInstanceTrustCollections = (verifierInstanceId: string | undefined, active = true) => {
|
|
10
|
+
const { core } = useONECore();
|
|
11
|
+
|
|
12
|
+
return useQuery(
|
|
13
|
+
[VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY, verifierInstanceId],
|
|
14
|
+
() => (verifierInstanceId ? core.getVerifierInstanceTrustCollections(verifierInstanceId) : undefined),
|
|
15
|
+
{
|
|
16
|
+
enabled: active && Boolean(verifierInstanceId),
|
|
17
|
+
keepPreviousData: true,
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const useRegisterVerifierInstance = () => {
|
|
23
|
+
const queryClient = useQueryClient();
|
|
24
|
+
const { core, organisationId } = useONECore();
|
|
25
|
+
|
|
26
|
+
return useMutation(
|
|
27
|
+
async (request: Omit<RegisterVerifierInstanceRequest, 'organisationId'>) =>
|
|
28
|
+
core.registerVerifierInstance({
|
|
29
|
+
organisationId,
|
|
30
|
+
...request,
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
{
|
|
34
|
+
onSuccess: () => queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY),
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const useVerifierInstanceUpdate = () => {
|
|
40
|
+
const queryClient = useQueryClient();
|
|
41
|
+
const { core } = useONECore();
|
|
42
|
+
|
|
43
|
+
return useMutation(
|
|
44
|
+
async ({ verifierInstanceId, update }: { verifierInstanceId: string; update: UpdateVerifierInstanceRequest }) =>
|
|
45
|
+
core.updateVerifierInstance(verifierInstanceId, update),
|
|
46
|
+
{
|
|
47
|
+
onError: async (err) => {
|
|
48
|
+
reportException(err, 'Update verifier instance failure');
|
|
49
|
+
await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
|
|
50
|
+
},
|
|
51
|
+
onSuccess: () => queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY),
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -52,7 +52,10 @@ export const useRegisterWalletUnit = () => {
|
|
|
52
52
|
}),
|
|
53
53
|
|
|
54
54
|
{
|
|
55
|
-
onSuccess: () =>
|
|
55
|
+
onSuccess: async () => {
|
|
56
|
+
await queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY);
|
|
57
|
+
await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
|
|
58
|
+
},
|
|
56
59
|
},
|
|
57
60
|
);
|
|
58
61
|
};
|
|
@@ -81,8 +84,12 @@ export const useWalletUnitUpdate = () => {
|
|
|
81
84
|
onError: async (err) => {
|
|
82
85
|
reportException(err, 'Update wallet unit failure');
|
|
83
86
|
await queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY);
|
|
87
|
+
await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
|
|
88
|
+
},
|
|
89
|
+
onSuccess: async () => {
|
|
90
|
+
await queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY);
|
|
91
|
+
await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
|
|
84
92
|
},
|
|
85
|
-
onSuccess: () => queryClient.invalidateQueries(WALLET_UNIT_QUERY_KEY),
|
|
86
93
|
},
|
|
87
94
|
);
|
|
88
95
|
};
|
|
@@ -54,6 +54,8 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
|
|
|
54
54
|
return getQueryKey(queryParams, [
|
|
55
55
|
'page',
|
|
56
56
|
'pageSize',
|
|
57
|
+
'sort',
|
|
58
|
+
'sortDirection',
|
|
57
59
|
'organisationId',
|
|
58
60
|
'entityIds',
|
|
59
61
|
'actions',
|
|
@@ -63,6 +65,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
|
|
|
63
65
|
'identifierId',
|
|
64
66
|
'credentialId',
|
|
65
67
|
'credentialSchemaId',
|
|
68
|
+
'proofId',
|
|
66
69
|
'proofSchemaId',
|
|
67
70
|
'search',
|
|
68
71
|
'users',
|
|
@@ -159,6 +162,7 @@ export const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<Id
|
|
|
159
162
|
'page',
|
|
160
163
|
'pageSize',
|
|
161
164
|
'organisationId',
|
|
165
|
+
'ids',
|
|
162
166
|
'sort',
|
|
163
167
|
'sortDirection',
|
|
164
168
|
'name',
|
|
@@ -170,6 +174,10 @@ export const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<Id
|
|
|
170
174
|
'keyAlgorithms',
|
|
171
175
|
'keyRoles',
|
|
172
176
|
'keyStorages',
|
|
177
|
+
'certificateRoles',
|
|
178
|
+
'certificateRolesMatchMode',
|
|
179
|
+
'trustIssuanceSchemaId',
|
|
180
|
+
'trustVerificationSchemaId',
|
|
173
181
|
'createdDateAfter',
|
|
174
182
|
'createdDateBefore',
|
|
175
183
|
'lastModifiedAfter',
|