@procivis/one-react-native-components 0.3.102 → 0.3.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +15 -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 +3 -15
- 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 +1 -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/header/foldable-header.js +26 -16
- 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/index.js +11 -0
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/notice/index.js +14 -0
- package/lib/commonjs/ui-components/notice/index.js.map +1 -0
- package/lib/commonjs/ui-components/notice/wallet-notice.js +80 -0
- package/lib/commonjs/ui-components/notice/wallet-notice.js.map +1 -0
- 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/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 +11 -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 +23 -13
- 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/wallet-unit.js +30 -2
- 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 +4 -4
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +4 -10
- 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.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 +16 -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 +4 -16
- 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 +1 -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/header/foldable-header.js +26 -16
- 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/index.js +1 -0
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/notice/index.js +3 -0
- package/lib/module/ui-components/notice/index.js.map +1 -0
- package/lib/module/ui-components/notice/wallet-notice.js +72 -0
- package/lib/module/ui-components/notice/wallet-notice.js.map +1 -0
- 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/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 +1 -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 +24 -14
- 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/wallet-unit.js +28 -2
- 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 +5 -5
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +4 -10
- 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.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/index.d.ts +1 -0
- package/lib/typescript/ui-components/notice/index.d.ts +2 -0
- package/lib/typescript/ui-components/notice/wallet-notice.d.ts +11 -0
- 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/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/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
- package/lib/typescript/utils/hooks/core/proofs.d.ts +14 -12
- 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/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 +18 -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 +12 -31
- 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 +12 -10
- package/src/ui-components/control/switch.tsx +23 -21
- package/src/ui-components/detail/detail.stories.tsx +1 -1
- package/src/ui-components/header/foldable-header.tsx +27 -20
- 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/index.ts +1 -0
- package/src/ui-components/notice/index.ts +3 -0
- package/src/ui-components/notice/wallet-notice.tsx +82 -0
- 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/credential-schemas.ts +5 -8
- package/src/utils/hooks/core/credentials.ts +14 -22
- 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 +1 -0
- package/src/utils/hooks/core/proof-schemas.ts +16 -22
- package/src/utils/hooks/core/proofs.ts +43 -36
- 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/wallet-unit.ts +38 -12
- package/src/utils/hooks/revocation/credential-status.ts +2 -2
- package/src/utils/parsers/credential-images.tsx +7 -11
- package/src/utils/parsers/credential-sharing-v2.tsx +20 -23
- package/src/utils/parsers/credential-sharing.tsx +29 -38
- package/src/utils/parsers/credential.ts +43 -43
- package/src/utils/parsers/query.ts +14 -16
|
@@ -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,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
CredentialListQuery,
|
|
3
|
+
CredentialState,
|
|
4
|
+
HandleInvitationRequest,
|
|
5
|
+
HandleInvitationResponse,
|
|
6
|
+
InitiateIssuanceRequest,
|
|
7
7
|
OneError,
|
|
8
8
|
} from '@procivis/react-native-one-core';
|
|
9
9
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';
|
|
@@ -20,22 +20,18 @@ export const CREDENTIAL_LIST_QUERY_KEY = 'credential-list';
|
|
|
20
20
|
export const CREDENTIAL_LIST_PAGED_QUERY_KEY = 'credential-list-paged';
|
|
21
21
|
export const CREDENTIAL_DETAIL_QUERY_KEY = 'credential-detail';
|
|
22
22
|
|
|
23
|
-
export const useCredentials = (queryParams?: Partial<
|
|
23
|
+
export const useCredentials = (queryParams?: Partial<CredentialListQuery>) => {
|
|
24
24
|
const { core, organisationId } = useONECore();
|
|
25
25
|
|
|
26
26
|
return useQuery(
|
|
27
27
|
[CREDENTIAL_LIST_QUERY_KEY, ...getQueryKeyFromCredentialListQueryParams(queryParams)],
|
|
28
28
|
async () => {
|
|
29
|
-
const { values } = await core.
|
|
29
|
+
const { values } = await core.listCredentials({
|
|
30
30
|
organisationId,
|
|
31
31
|
page: 0,
|
|
32
32
|
// TODO: workaround pagination for now, until it's supported by UI
|
|
33
33
|
pageSize: 10000,
|
|
34
|
-
states: [
|
|
35
|
-
CredentialStateBindingEnum.ACCEPTED,
|
|
36
|
-
CredentialStateBindingEnum.SUSPENDED,
|
|
37
|
-
CredentialStateBindingEnum.REVOKED,
|
|
38
|
-
],
|
|
34
|
+
states: [CredentialState.ACCEPTED, CredentialState.SUSPENDED, CredentialState.REVOKED],
|
|
39
35
|
...queryParams,
|
|
40
36
|
});
|
|
41
37
|
return values;
|
|
@@ -46,7 +42,7 @@ export const useCredentials = (queryParams?: Partial<CredentialListQueryBindingD
|
|
|
46
42
|
);
|
|
47
43
|
};
|
|
48
44
|
|
|
49
|
-
export const usePagedCredentials = (queryParams?: Partial<
|
|
45
|
+
export const usePagedCredentials = (queryParams?: Partial<CredentialListQuery>) => {
|
|
50
46
|
const { core, organisationId } = useONECore();
|
|
51
47
|
|
|
52
48
|
return useInfiniteQuery(
|
|
@@ -56,15 +52,11 @@ export const usePagedCredentials = (queryParams?: Partial<CredentialListQueryBin
|
|
|
56
52
|
...getQueryKeyFromCredentialListQueryParams(queryParams),
|
|
57
53
|
],
|
|
58
54
|
({ pageParam = 0 }) =>
|
|
59
|
-
core.
|
|
55
|
+
core.listCredentials({
|
|
60
56
|
organisationId,
|
|
61
57
|
page: pageParam,
|
|
62
58
|
pageSize: PAGE_SIZE,
|
|
63
|
-
states: [
|
|
64
|
-
CredentialStateBindingEnum.ACCEPTED,
|
|
65
|
-
CredentialStateBindingEnum.SUSPENDED,
|
|
66
|
-
CredentialStateBindingEnum.REVOKED,
|
|
67
|
-
],
|
|
59
|
+
states: [CredentialState.ACCEPTED, CredentialState.SUSPENDED, CredentialState.REVOKED],
|
|
68
60
|
...queryParams,
|
|
69
61
|
}),
|
|
70
62
|
{
|
|
@@ -92,10 +84,10 @@ export const useInvitationHandler = () => {
|
|
|
92
84
|
const { core, organisationId } = useONECore();
|
|
93
85
|
|
|
94
86
|
return useMutation(
|
|
95
|
-
async (request: Omit<
|
|
87
|
+
async (request: Omit<HandleInvitationRequest, 'organisationId'>) =>
|
|
96
88
|
core.handleInvitation({ organisationId, ...request }),
|
|
97
89
|
{
|
|
98
|
-
onSuccess: async (result:
|
|
90
|
+
onSuccess: async (result: HandleInvitationResponse) => {
|
|
99
91
|
if (result.type_ === 'PROOF_REQUEST') {
|
|
100
92
|
await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);
|
|
101
93
|
} else {
|
|
@@ -197,7 +189,7 @@ export const useInitiateIssuance = () => {
|
|
|
197
189
|
const { core, organisationId } = useONECore();
|
|
198
190
|
|
|
199
191
|
return useMutation(
|
|
200
|
-
async (request: Omit<
|
|
192
|
+
async (request: Omit<InitiateIssuanceRequest, 'organisationId'>) =>
|
|
201
193
|
core.initiateIssuance({ organisationId, ...request }),
|
|
202
194
|
{
|
|
203
195
|
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,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
CreateProofSchemaRequest,
|
|
3
|
+
ImportProofSchema,
|
|
4
|
+
ProofSchemaListItem,
|
|
5
|
+
ProofSchemaListQuery,
|
|
6
6
|
} from '@procivis/react-native-one-core';
|
|
7
7
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';
|
|
8
8
|
|
|
@@ -18,14 +18,14 @@ export const PROOF_SCHEMA_IMPORT_DETAIL_QUERY_KEY = 'proof-schema-import';
|
|
|
18
18
|
export const PROOF_SCHEMA_DETAIL_QUERY_KEY = 'proof-schema-detail';
|
|
19
19
|
export const PROOF_SCHEMA_SHARE_QUERY_KEY = 'proof-schema-share';
|
|
20
20
|
|
|
21
|
-
export const useProofSchemas = (queryParams?: Partial<
|
|
21
|
+
export const useProofSchemas = (queryParams?: Partial<ProofSchemaListQuery>, keepPreviousData = true) => {
|
|
22
22
|
const { core, organisationId } = useONECore();
|
|
23
23
|
|
|
24
24
|
return useInfiniteQuery(
|
|
25
25
|
[PROOF_SCHEMA_LIST_QUERY_KEY, ...getQueryKeyFromProofSchemaListQueryParams(queryParams)],
|
|
26
26
|
({ pageParam = 0 }) =>
|
|
27
27
|
core
|
|
28
|
-
.
|
|
28
|
+
.listProofSchemas({
|
|
29
29
|
organisationId,
|
|
30
30
|
page: pageParam,
|
|
31
31
|
pageSize: PAGE_SIZE,
|
|
@@ -39,10 +39,7 @@ export const useProofSchemas = (queryParams?: Partial<ListProofSchemasFiltersBin
|
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const useProofSchemaDetail = (
|
|
43
|
-
proofSchemaId: GetProofSchemaListItemBindingDto['id'] | undefined,
|
|
44
|
-
active = true,
|
|
45
|
-
) => {
|
|
42
|
+
export const useProofSchemaDetail = (proofSchemaId: ProofSchemaListItem['id'] | undefined, active = true) => {
|
|
46
43
|
const { core } = useONECore();
|
|
47
44
|
|
|
48
45
|
return useQuery(
|
|
@@ -65,7 +62,7 @@ export const useProofSchemaImportDetail = (url: string) => {
|
|
|
65
62
|
if (!response.ok) {
|
|
66
63
|
throw response.originalError;
|
|
67
64
|
}
|
|
68
|
-
return response.data as
|
|
65
|
+
return response.data as ImportProofSchema;
|
|
69
66
|
}),
|
|
70
67
|
{
|
|
71
68
|
keepPreviousData: true,
|
|
@@ -78,7 +75,7 @@ export const useProofSchemaAccept = () => {
|
|
|
78
75
|
const { core, organisationId } = useONECore();
|
|
79
76
|
|
|
80
77
|
return useMutation(
|
|
81
|
-
async ({ schema }: { schema:
|
|
78
|
+
async ({ schema }: { schema: ImportProofSchema }) =>
|
|
82
79
|
core.importProofSchema({
|
|
83
80
|
organisationId,
|
|
84
81
|
schema,
|
|
@@ -97,7 +94,7 @@ export const useProofSchemaCreate = () => {
|
|
|
97
94
|
const queryClient = useQueryClient();
|
|
98
95
|
const { core } = useONECore();
|
|
99
96
|
|
|
100
|
-
return useMutation(async (proofSchema:
|
|
97
|
+
return useMutation(async (proofSchema: CreateProofSchemaRequest) => core.createProofSchema(proofSchema), {
|
|
101
98
|
onSuccess: async () => {
|
|
102
99
|
await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);
|
|
103
100
|
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
@@ -109,16 +106,13 @@ export const useProofSchemaDelete = () => {
|
|
|
109
106
|
const queryClient = useQueryClient();
|
|
110
107
|
const { core } = useONECore();
|
|
111
108
|
|
|
112
|
-
return useMutation(
|
|
113
|
-
async (proofSchemaId
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
118
|
-
await queryClient.removeQueries([PROOF_SCHEMA_DETAIL_QUERY_KEY, proofSchemaId]);
|
|
119
|
-
},
|
|
109
|
+
return useMutation(async (proofSchemaId: ProofSchemaListItem['id']) => core.deleteProofSchema(proofSchemaId), {
|
|
110
|
+
onSuccess: async (_, proofSchemaId) => {
|
|
111
|
+
await queryClient.invalidateQueries(PROOF_SCHEMA_LIST_QUERY_KEY);
|
|
112
|
+
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
113
|
+
await queryClient.removeQueries([PROOF_SCHEMA_DETAIL_QUERY_KEY, proofSchemaId]);
|
|
120
114
|
},
|
|
121
|
-
);
|
|
115
|
+
});
|
|
122
116
|
};
|
|
123
117
|
|
|
124
118
|
export const useShareProofSchema = (schemaId?: string) => {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
IdentifierListQueryBindingDto,
|
|
2
|
+
CoreConfig,
|
|
3
|
+
CreateProofRequest,
|
|
4
|
+
HistoryAction,
|
|
5
|
+
HistoryEntityType,
|
|
6
|
+
HistoryErrorMetadata,
|
|
7
|
+
IdentifierListQuery,
|
|
9
8
|
OneError,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
PresentationSubmitCredentialRequest,
|
|
10
|
+
ProofListQuery,
|
|
11
|
+
ProofSchemaDetail,
|
|
12
|
+
ProofState,
|
|
13
|
+
ProposeProofRequest,
|
|
14
|
+
ShareProofRequest,
|
|
15
15
|
} from '@procivis/react-native-one-core';
|
|
16
16
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17
17
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
@@ -51,18 +51,18 @@ export const useProofState = (proofId: string | undefined, isPolling: boolean) =
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const state = await core.getProof(proofId).then((proof) => proof.state);
|
|
54
|
-
let metadata:
|
|
55
|
-
if (state ===
|
|
54
|
+
let metadata: HistoryErrorMetadata | undefined;
|
|
55
|
+
if (state === ProofState.ERROR) {
|
|
56
56
|
metadata = await core
|
|
57
|
-
.
|
|
57
|
+
.listHistory({
|
|
58
58
|
organisationId,
|
|
59
59
|
page: 0,
|
|
60
60
|
pageSize: 1,
|
|
61
61
|
entityIds: [proofId],
|
|
62
|
-
entityTypes: [
|
|
63
|
-
actions: [
|
|
62
|
+
entityTypes: [HistoryEntityType.PROOF],
|
|
63
|
+
actions: [HistoryAction.ERRORED],
|
|
64
64
|
})
|
|
65
|
-
.then((result) => result.values[0]?.metadata?.value as
|
|
65
|
+
.then((result) => result.values[0]?.metadata?.value as HistoryErrorMetadata);
|
|
66
66
|
}
|
|
67
67
|
return { state, metadata };
|
|
68
68
|
},
|
|
@@ -73,7 +73,7 @@ export const useProofState = (proofId: string | undefined, isPolling: boolean) =
|
|
|
73
73
|
);
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
type ProofUrlHookParams = { proofId: string; request?:
|
|
76
|
+
type ProofUrlHookParams = { proofId: string; request?: ShareProofRequest };
|
|
77
77
|
|
|
78
78
|
export const useProofUrl = () => {
|
|
79
79
|
const queryClient = useQueryClient();
|
|
@@ -101,7 +101,7 @@ export const useProofAccept = () => {
|
|
|
101
101
|
interactionId,
|
|
102
102
|
credentials,
|
|
103
103
|
}: {
|
|
104
|
-
credentials: Record<string,
|
|
104
|
+
credentials: Record<string, PresentationSubmitCredentialRequest[]>;
|
|
105
105
|
interactionId: string;
|
|
106
106
|
}) => core.holderSubmitProof(interactionId, credentials),
|
|
107
107
|
{
|
|
@@ -151,7 +151,6 @@ export enum VerificationProtocol {
|
|
|
151
151
|
OPENID4VP_DRAFT20 = 'OPENID4VP_DRAFT20',
|
|
152
152
|
OPENID4VP_DRAFT25 = 'OPENID4VP_DRAFT25',
|
|
153
153
|
OPENID4VP_PROXIMITY_DRAFT00 = 'OPENID4VP_PROXIMITY_DRAFT00',
|
|
154
|
-
SCAN_TO_VERIFY = 'SCAN_TO_VERIFY',
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
export enum VerificationEngagement {
|
|
@@ -164,8 +163,7 @@ export const useProposeProof = () => {
|
|
|
164
163
|
const { core, organisationId } = useONECore();
|
|
165
164
|
|
|
166
165
|
return useMutation(
|
|
167
|
-
async (request: Omit<
|
|
168
|
-
core.proposeProof({ organisationId, ...request }),
|
|
166
|
+
async (request: Omit<ProposeProofRequest, 'organisationId'>) => core.proposeProof({ organisationId, ...request }),
|
|
169
167
|
{
|
|
170
168
|
onSuccess: async () => {
|
|
171
169
|
await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);
|
|
@@ -199,7 +197,7 @@ export const useProofDelete = () => {
|
|
|
199
197
|
);
|
|
200
198
|
};
|
|
201
199
|
|
|
202
|
-
export const useProofs = (queryParams?: Partial<
|
|
200
|
+
export const useProofs = (queryParams?: Partial<ProofListQuery>) => {
|
|
203
201
|
const { core, organisationId } = useONECore();
|
|
204
202
|
|
|
205
203
|
const queryKey = [PROOF_LIST_QUERY_KEY, ...getQueryKeyFromProofListQueryParams(queryParams)];
|
|
@@ -207,7 +205,7 @@ export const useProofs = (queryParams?: Partial<ProofListQueryBindingDto>) => {
|
|
|
207
205
|
return useQuery(
|
|
208
206
|
queryKey,
|
|
209
207
|
({ pageParam = 0 }) =>
|
|
210
|
-
core.
|
|
208
|
+
core.listProofs({
|
|
211
209
|
organisationId,
|
|
212
210
|
page: pageParam,
|
|
213
211
|
pageSize: PAGE_SIZE,
|
|
@@ -224,7 +222,7 @@ export const useProofCreate = () => {
|
|
|
224
222
|
|
|
225
223
|
const { core } = useONECore();
|
|
226
224
|
|
|
227
|
-
return useMutation(async (data:
|
|
225
|
+
return useMutation(async (data: CreateProofRequest) => core.createProof(data), {
|
|
228
226
|
onSuccess: async () => {
|
|
229
227
|
await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);
|
|
230
228
|
await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
|
|
@@ -233,9 +231,9 @@ export const useProofCreate = () => {
|
|
|
233
231
|
};
|
|
234
232
|
|
|
235
233
|
const getIdentifierFilterForProofSchema = (
|
|
236
|
-
proofSchema:
|
|
237
|
-
config:
|
|
238
|
-
): Partial<
|
|
234
|
+
proofSchema: ProofSchemaDetail,
|
|
235
|
+
config: CoreConfig,
|
|
236
|
+
): Partial<IdentifierListQuery> => {
|
|
239
237
|
const requestedFormats = proofSchema.proofInputSchemas.map((schema) => schema.credentialSchema.format);
|
|
240
238
|
const requestedFormatsCapabilities = requestedFormats
|
|
241
239
|
.map((format) => config.format[format]?.capabilities)
|
|
@@ -284,6 +282,15 @@ export const useProofForSchemaIdWithTransport = (
|
|
|
284
282
|
setProofIdState(id);
|
|
285
283
|
}, []);
|
|
286
284
|
|
|
285
|
+
const retract = useCallback(async () => {
|
|
286
|
+
const id = proofIdRef.current;
|
|
287
|
+
if (!id) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
setProofId(undefined);
|
|
291
|
+
await deleteProof(id).catch(() => {});
|
|
292
|
+
}, [deleteProof, setProofId]);
|
|
293
|
+
|
|
287
294
|
useEffect(() => {
|
|
288
295
|
if (!proofIdRef.current) {
|
|
289
296
|
return;
|
|
@@ -302,7 +309,7 @@ export const useProofForSchemaIdWithTransport = (
|
|
|
302
309
|
return;
|
|
303
310
|
}
|
|
304
311
|
|
|
305
|
-
if (proofState?.state !==
|
|
312
|
+
if (proofState?.state !== ProofState.CREATED && proofState?.state !== ProofState.PENDING) {
|
|
306
313
|
setProofId(undefined);
|
|
307
314
|
} else {
|
|
308
315
|
setDeleting(true);
|
|
@@ -341,7 +348,7 @@ export const useProofForSchemaIdWithTransport = (
|
|
|
341
348
|
.catch(() => {});
|
|
342
349
|
}, [proofSchemaId, identifiers, identifierFilter, createProof, enabled, transport, proofId, setProofId, deleting]);
|
|
343
350
|
|
|
344
|
-
return deleting ? undefined : proofId;
|
|
351
|
+
return { proofId: deleting ? undefined : proofId, retract };
|
|
345
352
|
};
|
|
346
353
|
|
|
347
354
|
export const useCleanupUnusedProofs = () => {
|
|
@@ -349,7 +356,7 @@ export const useCleanupUnusedProofs = () => {
|
|
|
349
356
|
const { data: proofs } = useProofs({
|
|
350
357
|
page: 0,
|
|
351
358
|
pageSize: 100,
|
|
352
|
-
proofStates: [
|
|
359
|
+
proofStates: [ProofState.CREATED, ProofState.PENDING],
|
|
353
360
|
});
|
|
354
361
|
const [cleaned, setCleaned] = useState(false);
|
|
355
362
|
|
|
@@ -374,7 +381,7 @@ export const useShareProof = (proofUrlProps: ProofUrlHookParams | undefined, ena
|
|
|
374
381
|
|
|
375
382
|
// reset when proofId changes or the proof was retracted
|
|
376
383
|
useEffect(() => {
|
|
377
|
-
if (!proofUrlProps?.proofId || proofState?.state ===
|
|
384
|
+
if (!proofUrlProps?.proofId || proofState?.state === ProofState.CREATED) {
|
|
378
385
|
setSharedProof(undefined);
|
|
379
386
|
}
|
|
380
387
|
}, [proofUrlProps?.proofId, proofState]);
|
|
@@ -410,7 +417,7 @@ export const useRetainProofCheck = (proofId?: string) => {
|
|
|
410
417
|
|
|
411
418
|
const { core } = useONECore();
|
|
412
419
|
|
|
413
|
-
return useMutation(async () => core.runTask('RETAIN_PROOF_CHECK'), {
|
|
420
|
+
return useMutation(async () => core.runTask('RETAIN_PROOF_CHECK', undefined), {
|
|
414
421
|
onSuccess: async () => {
|
|
415
422
|
if (proofId) {
|
|
416
423
|
await queryClient.removeQueries([PROOF_DETAIL_QUERY_KEY, proofId]);
|
|
@@ -441,12 +448,12 @@ export const useDeleteAllProofsData = (schemaId: string) => {
|
|
|
441
448
|
return useMutation(
|
|
442
449
|
async () =>
|
|
443
450
|
core
|
|
444
|
-
.
|
|
451
|
+
.listProofs({
|
|
445
452
|
organisationId,
|
|
446
453
|
page: 0,
|
|
447
454
|
pageSize: 1000,
|
|
448
455
|
proofSchemaIds: [schemaId],
|
|
449
|
-
proofStates: [
|
|
456
|
+
proofStates: [ProofState.ACCEPTED],
|
|
450
457
|
})
|
|
451
458
|
.then((result) => Promise.all(result.values.reverse().map((proof) => core.deleteProofClaims(proof.id)))),
|
|
452
459
|
{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
IdentifierTypeBindingEnum,
|
|
2
|
+
CreateRemoteTrustEntityRequest,
|
|
3
|
+
IdentifierType,
|
|
5
4
|
ONECore,
|
|
6
5
|
OneError,
|
|
7
|
-
|
|
6
|
+
TrustAnchorDetail,
|
|
7
|
+
UpdateRemoteTrustEntityRequest,
|
|
8
8
|
} from '@procivis/react-native-one-core';
|
|
9
9
|
import { useCallback } from 'react';
|
|
10
10
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
@@ -31,7 +31,7 @@ export const useCreateTrustAnchor = () => {
|
|
|
31
31
|
if (trustAnchors.values.length > 0) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
const response = await httpClient.get<
|
|
34
|
+
const response = await httpClient.get<TrustAnchorDetail>(publisherReference);
|
|
35
35
|
if (!response.ok || !response.data) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -66,7 +66,7 @@ export const useTrustEntity = (identifierId: string | undefined) => {
|
|
|
66
66
|
identifiers: [
|
|
67
67
|
{
|
|
68
68
|
certificateId:
|
|
69
|
-
identifierDetail?.type ===
|
|
69
|
+
identifierDetail?.type === IdentifierType.CERTIFICATE
|
|
70
70
|
? identifierDetail.certificates?.[0]?.id
|
|
71
71
|
: undefined,
|
|
72
72
|
id: identifierId,
|
|
@@ -110,9 +110,7 @@ export const useCreateRemoteTrustEntity = () => {
|
|
|
110
110
|
const { core } = useONECore();
|
|
111
111
|
|
|
112
112
|
return useMutation(
|
|
113
|
-
async (
|
|
114
|
-
request: Omit<CreateRemoteTrustEntityRequestBindingDto, 'didId'> & { identifierId?: string; didId?: string },
|
|
115
|
-
) => {
|
|
113
|
+
async (request: Omit<CreateRemoteTrustEntityRequest, 'didId'> & { identifierId?: string; didId?: string }) => {
|
|
116
114
|
const { identifierId, didId } = request;
|
|
117
115
|
|
|
118
116
|
let entityDidId = didId;
|
|
@@ -142,7 +140,7 @@ export const useUpdateRemoteTrustEntity = () => {
|
|
|
142
140
|
|
|
143
141
|
return useMutation(
|
|
144
142
|
async (
|
|
145
|
-
request: Omit<
|
|
143
|
+
request: Omit<UpdateRemoteTrustEntityRequest, 'didId'> & {
|
|
146
144
|
identifierId?: string;
|
|
147
145
|
didId?: string;
|
|
148
146
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMutation } from 'react-query';
|
|
2
|
+
|
|
3
|
+
import { reportException } from '../../reporting';
|
|
4
|
+
import { useONECore } from './core-context';
|
|
5
|
+
import { HolderWalletUnit } from '@procivis/react-native-one-core';
|
|
6
|
+
|
|
7
|
+
export const useTrustCollectionSync = () => {
|
|
8
|
+
const { core } = useONECore();
|
|
9
|
+
|
|
10
|
+
return useMutation(
|
|
11
|
+
async (params: { holderWalletUnitId?: HolderWalletUnit['id']; verifierInstanceId?: string }) =>
|
|
12
|
+
core.runTask('TRUST_COLLECTION_SYNC', JSON.stringify(params)),
|
|
13
|
+
{
|
|
14
|
+
onError: (err) => {
|
|
15
|
+
reportException(err, 'TRUST_COLLECTION_SYNC error');
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const useTrustListSubscriptionUpdate = () => {
|
|
22
|
+
const { core } = useONECore();
|
|
23
|
+
|
|
24
|
+
return useMutation(async () => core.runTask('TRUST_LIST_SUBSCRIPTION_UPDATE', undefined), {
|
|
25
|
+
onError: (err) => {
|
|
26
|
+
reportException(err, 'TRUST_LIST_SUBSCRIPTION_UPDATE error');
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
};
|