@sudoplatform/sudo-privacy-interaction 2.3.0 → 2.5.0
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/cjs/gen/graphqlTypes.js +308 -1
- package/cjs/private/data/action/defaultActionService.js +8 -0
- package/cjs/private/data/action/transformer/actionIntentTransformer.js +32 -0
- package/cjs/private/data/action/transformer/availableActionTransformer.js +8 -0
- package/cjs/private/data/analysis-result/defaultAnalysisResultService.js +6 -0
- package/cjs/private/data/analysis-result/transformer/analysisResultStatusReasonTransformer.js +45 -0
- package/cjs/private/data/analysis-result/transformer/analysisResultTransformer.js +6 -0
- package/cjs/private/data/common/apiClient.js +21 -0
- package/cjs/private/data/organization-analysis/transformer/organizationAnalysisTransformer.js +6 -0
- package/cjs/private/data/virtual-presence/defaultVirtualPresenceService.js +4 -0
- package/cjs/private/domain/entities/action/actionEntity.js +14 -0
- package/cjs/private/domain/entities/analysis-result/analysisResultEntity.js +20 -1
- package/cjs/private/domain/use-cases/action/listActionsForDataHolderUseCase.js +26 -0
- package/cjs/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.js +25 -0
- package/cjs/public/defaultSudoPrivacyInteractionClient.js +23 -1
- package/cjs/public/typings/action.js +14 -0
- package/cjs/public/typings/analysisResult.js +20 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/DefaultSudoPrivacyInteractionClient.html +77 -29
- package/docs/enums/ActionFulfilmentMethod.html +3 -3
- package/docs/enums/ActionIntent.html +31 -7
- package/docs/enums/ActionOrigin.html +5 -5
- package/docs/enums/ActionStatus.html +9 -9
- package/docs/enums/AnalysisResultStatus.html +6 -6
- package/docs/enums/AnalysisResultStatusReason.html +81 -0
- package/docs/enums/DataCategory.html +18 -18
- package/docs/enums/OrganizationAnalysisDomainResolution.html +3 -3
- package/docs/enums/OrganizationAnalysisMode.html +3 -3
- package/docs/enums/OrganizationCategory.html +31 -31
- package/docs/enums/RetentionStyle.html +5 -5
- package/docs/enums/ShareStyle.html +6 -6
- package/docs/enums/SignalValue.html +4 -4
- package/docs/hierarchy.html +7 -6
- package/docs/interfaces/Action.html +15 -15
- package/docs/interfaces/ActionContact.html +4 -4
- package/docs/interfaces/AnalysisResult.html +21 -13
- package/docs/interfaces/AnalysisResultData.html +8 -8
- package/docs/interfaces/AnalysisResultUpdate.html +20 -12
- package/docs/interfaces/AssistedEmailTemplate.html +3 -3
- package/docs/interfaces/AssistedPayload.html +8 -8
- package/docs/interfaces/AvailableAction.html +20 -9
- package/docs/interfaces/CapabilitySignals.html +10 -10
- package/docs/interfaces/CategorySignals.html +11 -11
- package/docs/interfaces/InitiateActionInput.html +4 -4
- package/docs/interfaces/ListActionsForDataHolderInput.html +85 -0
- package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
- package/docs/interfaces/ListAvailableActionsInput.html +14 -4
- package/docs/interfaces/ListDataHolderScanSummariesInput.html +1 -1
- package/docs/interfaces/ListDataHoldersInput.html +1 -1
- package/docs/interfaces/ListVirtualPresencesInput.html +1 -1
- package/docs/interfaces/OrganizationAnalysis.html +20 -12
- package/docs/interfaces/OrganizationIdentity.html +5 -5
- package/docs/interfaces/Pagination.html +2 -1
- package/docs/interfaces/PrivacyScore.html +4 -4
- package/docs/interfaces/PrivacySummary.html +4 -4
- package/docs/interfaces/RetentionInfo.html +4 -4
- package/docs/interfaces/RiskIndicators.html +8 -8
- package/docs/interfaces/ScoreContribution.html +3 -3
- package/docs/interfaces/ScoreCoverage.html +3 -3
- package/docs/interfaces/SudoPrivacyInteractionClient.html +75 -29
- package/docs/modules.html +4 -4
- package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
- package/lib/gen/graphqlTypes.js +307 -0
- package/lib/private/data/action/defaultActionService.js +8 -0
- package/lib/private/data/action/transformer/actionIntentTransformer.js +32 -0
- package/lib/private/data/action/transformer/availableActionTransformer.js +8 -0
- package/lib/private/data/analysis-result/defaultAnalysisResultService.js +6 -0
- package/lib/private/data/analysis-result/transformer/analysisResultStatusReasonTransformer.js +41 -0
- package/lib/private/data/analysis-result/transformer/analysisResultTransformer.js +6 -0
- package/lib/private/data/common/apiClient.js +22 -1
- package/lib/private/data/organization-analysis/transformer/organizationAnalysisTransformer.js +6 -0
- package/lib/private/data/virtual-presence/defaultVirtualPresenceService.js +4 -0
- package/lib/private/domain/entities/action/actionEntity.js +14 -0
- package/lib/private/domain/entities/analysis-result/analysisResultEntity.js +19 -0
- package/lib/private/domain/use-cases/action/listActionsForDataHolderUseCase.js +22 -0
- package/lib/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.js +21 -0
- package/lib/public/defaultSudoPrivacyInteractionClient.js +23 -1
- package/lib/public/typings/action.js +14 -0
- package/lib/public/typings/analysisResult.js +19 -0
- package/package.json +6 -1
- package/types/gen/graphqlTypes.d.ts +78 -1
- package/types/gen/schema-types.d.ts +39 -2
- package/types/private/data/action/defaultActionService.d.ts +2 -1
- package/types/private/data/action/transformer/availableActionTransformer.d.ts +1 -0
- package/types/private/data/analysis-result/defaultAnalysisResultService.d.ts +1 -0
- package/types/private/data/analysis-result/transformer/analysisResultStatusReasonTransformer.d.ts +12 -0
- package/types/private/data/analysis-result/transformer/analysisResultTransformer.d.ts +1 -0
- package/types/private/data/common/apiClient.d.ts +8 -1
- package/types/private/data/organization-analysis/transformer/organizationAnalysisTransformer.d.ts +1 -0
- package/types/private/data/virtual-presence/defaultVirtualPresenceService.d.ts +1 -0
- package/types/private/domain/entities/action/actionEntity.d.ts +18 -0
- package/types/private/domain/entities/action/actionService.d.ts +36 -0
- package/types/private/domain/entities/analysis-result/analysisResultEntity.d.ts +20 -0
- package/types/private/domain/entities/organization-analysis/organizationAnalysisEntity.d.ts +3 -1
- package/types/private/domain/entities/virtual-presence/virtualPresenceService.d.ts +11 -1
- package/types/private/domain/use-cases/action/listActionsForDataHolderUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.d.ts +16 -0
- package/types/public/defaultSudoPrivacyInteractionClient.d.ts +3 -1
- package/types/public/inputs/action.d.ts +16 -0
- package/types/public/sudoPrivacyInteractionClient.d.ts +23 -1
- package/types/public/typings/action.d.ts +19 -0
- package/types/public/typings/analysisResult.d.ts +22 -0
- package/types/public/typings/organizationAnalysis.d.ts +3 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ApiClientManager } from '@sudoplatform/sudo-api-client';
|
|
7
7
|
import Observable from 'zen-observable';
|
|
8
|
-
import { AnalysisResult, AnalysisResultConnection, Action, AvailableActionConnection, ConnectVirtualPresenceInput, DataHolder, DataHolderConnection, DataHolderScanSummaryConnection, InitiateActionInput, OrganizationAnalysis, OrganizationAnalysisDomainResolution, OrganizationAnalysisMode, ProviderConfiguration, ListVirtualPresencesInput, OnActionStatusUpdateSubscription, OnAnalysisResultUpdateSubscription, OnDataHoldersUpdateSubscription, OnVirtualPresenceUpdateSubscription, ScanOptionsInput, VirtualPresence, VirtualPresenceConnection } from '../../../gen/graphqlTypes';
|
|
8
|
+
import { AnalysisResult, AnalysisResultConnection, Action, ActionConnection, AvailableActionConnection, ConnectVirtualPresenceInput, DataHolder, DataHolderConnection, DataHolderScanSummaryConnection, InitiateActionInput, OrganizationAnalysis, OrganizationAnalysisDomainResolution, OrganizationAnalysisMode, ProviderConfiguration, ListVirtualPresencesInput, OnActionStatusUpdateSubscription, OnAnalysisResultUpdateSubscription, OnDataHoldersUpdateSubscription, OnVirtualPresenceUpdateSubscription, ScanOptionsInput, VirtualPresence, VirtualPresenceConnection } from '../../../gen/graphqlTypes';
|
|
9
9
|
import { SubscriptionResult } from './baseSubscriptionManager';
|
|
10
10
|
export declare class ApiClient {
|
|
11
11
|
private readonly log;
|
|
@@ -15,6 +15,7 @@ export declare class ApiClient {
|
|
|
15
15
|
connectVirtualPresence(input: ConnectVirtualPresenceInput): Promise<VirtualPresence>;
|
|
16
16
|
disconnectVirtualPresence(id: string): Promise<VirtualPresence>;
|
|
17
17
|
rescanVirtualPresence(id: string, options?: ScanOptionsInput): Promise<VirtualPresence>;
|
|
18
|
+
refreshVirtualPresenceState(id: string): Promise<VirtualPresence>;
|
|
18
19
|
listVirtualPresences(input: ListVirtualPresencesInput): Promise<VirtualPresenceConnection>;
|
|
19
20
|
getProviderConfiguration(): Promise<ProviderConfiguration>;
|
|
20
21
|
getDataHolder(id: string): Promise<DataHolder | undefined>;
|
|
@@ -47,7 +48,13 @@ export declare class ApiClient {
|
|
|
47
48
|
getAction(id: string): Promise<Action | undefined>;
|
|
48
49
|
listAvailableActions(input: {
|
|
49
50
|
dataHolderId: string;
|
|
51
|
+
includeCompleted?: boolean;
|
|
50
52
|
}): Promise<AvailableActionConnection>;
|
|
53
|
+
listActionsForDataHolder(input: {
|
|
54
|
+
dataHolderId: string;
|
|
55
|
+
limit?: number;
|
|
56
|
+
nextToken?: string;
|
|
57
|
+
}): Promise<ActionConnection>;
|
|
51
58
|
onVirtualPresenceUpdated(owner: string): Promise<Observable<SubscriptionResult<OnVirtualPresenceUpdateSubscription>>>;
|
|
52
59
|
onDataHoldersUpdated(owner: string): Promise<Observable<SubscriptionResult<OnDataHoldersUpdateSubscription>>>;
|
|
53
60
|
onAnalysisResultUpdated(owner: string): Promise<Observable<SubscriptionResult<OnAnalysisResultUpdateSubscription>>>;
|
package/types/private/data/organization-analysis/transformer/organizationAnalysisTransformer.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { OrganizationAnalysis } from '../../../../public/typings/organizationAna
|
|
|
8
8
|
import { OrganizationAnalysisEntity } from '../../../domain/entities/organization-analysis/organizationAnalysisEntity';
|
|
9
9
|
export declare class OrganizationAnalysisTransformer {
|
|
10
10
|
private readonly statusTransformer;
|
|
11
|
+
private readonly statusReasonTransformer;
|
|
11
12
|
private readonly dataTransformer;
|
|
12
13
|
fromGraphQLToEntity(data: OrganizationAnalysisGraphQL): OrganizationAnalysisEntity;
|
|
13
14
|
fromEntityToAPI(entity: OrganizationAnalysisEntity): OrganizationAnalysis;
|
|
@@ -16,6 +16,7 @@ export declare class DefaultVirtualPresenceService implements VirtualPresenceSer
|
|
|
16
16
|
list(input: ListVirtualPresencesInput): Promise<ListVirtualPresencesOutput>;
|
|
17
17
|
rescan(input: RescanVirtualPresenceInput): Promise<VirtualPresenceEntity>;
|
|
18
18
|
disconnect(id: string): Promise<VirtualPresenceEntity>;
|
|
19
|
+
refreshState(id: string): Promise<VirtualPresenceEntity>;
|
|
19
20
|
subscribe(input: SubscribeToVirtualPresenceInput): Promise<void>;
|
|
20
21
|
unsubscribe(subscriptionId: string): void;
|
|
21
22
|
private setupUpdateSubscription;
|
|
@@ -15,6 +15,16 @@
|
|
|
15
15
|
* @property AccessMyData Data subject access / portability request.
|
|
16
16
|
* @property DeleteMyData Account deletion / data erasure.
|
|
17
17
|
* @property LimitDataUse Opt out of sale / tracking, manage consent.
|
|
18
|
+
* @property SwapEmail The user has replaced the account's email with a private
|
|
19
|
+
* email. Always available for an email presence; self-reported.
|
|
20
|
+
* @property SwapPhone The user has replaced the account's phone number with a
|
|
21
|
+
* private number. Offered only when a signal indicates the data holder holds
|
|
22
|
+
* the user's phone number.
|
|
23
|
+
* @property SwapVirtualCard The user has replaced the account's payment card
|
|
24
|
+
* with a virtual card. Offered only when the data holder is identified as
|
|
25
|
+
* collecting credit card data.
|
|
26
|
+
* @property SaveInPassword The user has saved this account in a password
|
|
27
|
+
* manager. Offered only when the data holder supports account creation.
|
|
18
28
|
* @property Other Anything unmapped; carries additionalInfo.
|
|
19
29
|
*
|
|
20
30
|
* @enum
|
|
@@ -24,6 +34,10 @@ export declare enum ActionIntentEntity {
|
|
|
24
34
|
AccessMyData = "ACCESS_MY_DATA",
|
|
25
35
|
DeleteMyData = "DELETE_MY_DATA",
|
|
26
36
|
LimitDataUse = "LIMIT_DATA_USE",
|
|
37
|
+
SwapEmail = "SWAP_EMAIL",
|
|
38
|
+
SwapPhone = "SWAP_PHONE",
|
|
39
|
+
SwapVirtualCard = "SWAP_VIRTUAL_CARD",
|
|
40
|
+
SaveInPassword = "SAVE_IN_PASSWORD",
|
|
27
41
|
Other = "OTHER"
|
|
28
42
|
}
|
|
29
43
|
/**
|
|
@@ -176,6 +190,9 @@ export interface ActionEntity {
|
|
|
176
190
|
* @property {ActionOriginEntity} origin Which source contributed this action.
|
|
177
191
|
* @property {string} title Short presentation hint for the action's title.
|
|
178
192
|
* @property {string} description Short presentation hint describing the action.
|
|
193
|
+
* @property {ActionStatusEntity} status Lifecycle status of the most recent,
|
|
194
|
+
* non-superseded persisted action for this intent on the data holder.
|
|
195
|
+
* Undefined when the user has never initiated this action.
|
|
179
196
|
*/
|
|
180
197
|
export interface AvailableActionEntity {
|
|
181
198
|
intent: ActionIntentEntity;
|
|
@@ -184,4 +201,5 @@ export interface AvailableActionEntity {
|
|
|
184
201
|
origin: ActionOriginEntity;
|
|
185
202
|
title?: string;
|
|
186
203
|
description?: string;
|
|
204
|
+
status?: ActionStatusEntity;
|
|
187
205
|
}
|
|
@@ -24,9 +24,12 @@ export interface InitiateActionInput {
|
|
|
24
24
|
*
|
|
25
25
|
* @interface ListAvailableActionsInput
|
|
26
26
|
* @property {string} dataHolderId The data holder relationship to list available actions for.
|
|
27
|
+
* @property {boolean} includeCompleted When true, actions the user has already
|
|
28
|
+
* completed are included. Defaults to false (completed actions omitted).
|
|
27
29
|
*/
|
|
28
30
|
export interface ListAvailableActionsInput {
|
|
29
31
|
dataHolderId: string;
|
|
32
|
+
includeCompleted?: boolean;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
35
|
* Output for `ActionService.listAvailable` method.
|
|
@@ -40,6 +43,31 @@ export interface ListAvailableActionsOutput {
|
|
|
40
43
|
availableActions: AvailableActionEntity[];
|
|
41
44
|
nextToken?: string;
|
|
42
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Input for `ActionService.listForDataHolder` method.
|
|
48
|
+
*
|
|
49
|
+
* @interface ListActionsForDataHolderInput
|
|
50
|
+
* @property {string} dataHolderId The data holder to list the action history for.
|
|
51
|
+
* @property {number} limit Number of records to return.
|
|
52
|
+
* @property {string} nextToken A token generated by a previous call to
|
|
53
|
+
* `ActionService.listForDataHolder`. This allows for pagination.
|
|
54
|
+
*/
|
|
55
|
+
export interface ListActionsForDataHolderInput {
|
|
56
|
+
dataHolderId: string;
|
|
57
|
+
limit?: number;
|
|
58
|
+
nextToken?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Output for `ActionService.listForDataHolder` method.
|
|
62
|
+
*
|
|
63
|
+
* @interface ListActionsForDataHolderOutput
|
|
64
|
+
* @property {ActionEntity[]} actions The list of actions retrieved in this query.
|
|
65
|
+
* @property {string} nextToken A token generated by a previous call. This allows for pagination.
|
|
66
|
+
*/
|
|
67
|
+
export interface ListActionsForDataHolderOutput {
|
|
68
|
+
actions: ActionEntity[];
|
|
69
|
+
nextToken?: string;
|
|
70
|
+
}
|
|
43
71
|
/**
|
|
44
72
|
* Input for `ActionService.subscribe` method.
|
|
45
73
|
*
|
|
@@ -94,6 +122,14 @@ export interface ActionService {
|
|
|
94
122
|
* no actions are available.
|
|
95
123
|
*/
|
|
96
124
|
listAvailable(input: ListAvailableActionsInput): Promise<ListAvailableActionsOutput>;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve the persisted action history for a data holder, ordered newest-first.
|
|
127
|
+
*
|
|
128
|
+
* @param {ListActionsForDataHolderInput} input Parameters used to list the action history.
|
|
129
|
+
* @returns {ListActionsForDataHolderOutput} A list of actions. Can be empty if the
|
|
130
|
+
* data holder has no action history.
|
|
131
|
+
*/
|
|
132
|
+
listForDataHolder(input: ListActionsForDataHolderInput): Promise<ListActionsForDataHolderOutput>;
|
|
97
133
|
/**
|
|
98
134
|
* Subscribe to action status events.
|
|
99
135
|
*
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @property {string} virtualPresenceId The virtual presence this analysis is associated with.
|
|
13
13
|
* @property {string} dataHolderIdentifier The data holder domain that this analysis is about.
|
|
14
14
|
* @property {AnalysisResultStatusEntity} status Current status of the analysis.
|
|
15
|
+
* @property {AnalysisResultStatusReasonEntity} statusReason Reason explaining the current status, when one applies.
|
|
15
16
|
* @property {Date} lastAnalyzedAt Date for when the analysis was last performed.
|
|
16
17
|
* @property {AnalysisResultDataEntity} data Structured analysis data. Populated when status is COMPLETE or PARTIAL.
|
|
17
18
|
* @property {number} version Version of this entity. Increments on update.
|
|
@@ -23,6 +24,7 @@ export interface AnalysisResultEntity {
|
|
|
23
24
|
virtualPresenceId: string;
|
|
24
25
|
dataHolderIdentifier: string;
|
|
25
26
|
status: AnalysisResultStatusEntity;
|
|
27
|
+
statusReason?: AnalysisResultStatusReasonEntity;
|
|
26
28
|
lastAnalyzedAt: Date;
|
|
27
29
|
data?: AnalysisResultDataEntity;
|
|
28
30
|
owner: string;
|
|
@@ -48,6 +50,24 @@ export declare enum AnalysisResultStatusEntity {
|
|
|
48
50
|
Failed = "FAILED",
|
|
49
51
|
Unavailable = "UNAVAILABLE"
|
|
50
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The reason explaining an analysis result's status.
|
|
55
|
+
*
|
|
56
|
+
* @property INVALID_DOMAIN The requested domain was not a valid analyzable domain.
|
|
57
|
+
* @property POLICY_UNAVAILABLE No privacy policy could be located for the organization.
|
|
58
|
+
* @property MALICIOUS The domain was identified as malicious.
|
|
59
|
+
* @property NOT_ATTEMPTED Analysis was not attempted for the domain.
|
|
60
|
+
* @property OTHER A reason that does not fit the other categories.
|
|
61
|
+
*
|
|
62
|
+
* @enum
|
|
63
|
+
*/
|
|
64
|
+
export declare enum AnalysisResultStatusReasonEntity {
|
|
65
|
+
InvalidDomain = "INVALID_DOMAIN",
|
|
66
|
+
PolicyUnavailable = "POLICY_UNAVAILABLE",
|
|
67
|
+
Malicious = "MALICIOUS",
|
|
68
|
+
NotAttempted = "NOT_ATTEMPTED",
|
|
69
|
+
Other = "OTHER"
|
|
70
|
+
}
|
|
51
71
|
/**
|
|
52
72
|
* The structured data payload for an analysis result.
|
|
53
73
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AnalysisResultDataEntity, AnalysisResultStatusEntity } from '../analysis-result/analysisResultEntity';
|
|
6
|
+
import { AnalysisResultDataEntity, AnalysisResultStatusEntity, AnalysisResultStatusReasonEntity } from '../analysis-result/analysisResultEntity';
|
|
7
7
|
/**
|
|
8
8
|
* Core entity representation of a shared, domain-keyed privacy analysis of an
|
|
9
9
|
* organization.
|
|
@@ -17,6 +17,7 @@ import { AnalysisResultDataEntity, AnalysisResultStatusEntity } from '../analysi
|
|
|
17
17
|
* @property {string} domain The analyzed domain (equal to id).
|
|
18
18
|
* @property {AnalysisResultStatusEntity} status Aggregate status. PENDING while an asynchronous
|
|
19
19
|
* source is still resolving; re-query for the terminal result.
|
|
20
|
+
* @property {AnalysisResultStatusReasonEntity} statusReason Reason explaining the aggregate status, when one applies.
|
|
20
21
|
* @property {Date} lastAnalyzedAt When the aggregate was last derived.
|
|
21
22
|
* @property {AnalysisResultDataEntity} data Structured analysis payload. Populated when status
|
|
22
23
|
* is COMPLETE or PARTIAL.
|
|
@@ -29,6 +30,7 @@ export interface OrganizationAnalysisEntity {
|
|
|
29
30
|
id: string;
|
|
30
31
|
domain: string;
|
|
31
32
|
status: AnalysisResultStatusEntity;
|
|
33
|
+
statusReason?: AnalysisResultStatusReasonEntity;
|
|
32
34
|
lastAnalyzedAt: Date;
|
|
33
35
|
data?: AnalysisResultDataEntity;
|
|
34
36
|
owner: string;
|
|
@@ -130,10 +130,20 @@ export interface VirtualPresenceService {
|
|
|
130
130
|
* @returns {VirtualPresenceEntity} The rescanned virtual presence.
|
|
131
131
|
*/
|
|
132
132
|
rescan(input: RescanVirtualPresenceInput): Promise<VirtualPresenceEntity>;
|
|
133
|
+
/**
|
|
134
|
+
* Validate a virtual presence's provider grant on demand and return its
|
|
135
|
+
* reconciled state. If the provider confirms the grant has been revoked, the
|
|
136
|
+
* presence transitions to `NeedsReauth`; otherwise its state is returned
|
|
137
|
+
* unchanged.
|
|
138
|
+
*
|
|
139
|
+
* @param {string} id The unique identifier of the virtual presence to refresh.
|
|
140
|
+
* @returns {VirtualPresenceEntity} The virtual presence with its reconciled state.
|
|
141
|
+
*/
|
|
142
|
+
refreshState(id: string): Promise<VirtualPresenceEntity>;
|
|
133
143
|
/**
|
|
134
144
|
* Subscribe to virtual presence state events.
|
|
135
145
|
*
|
|
136
|
-
* @param {
|
|
146
|
+
* @param {SubscribeToVirtualPresenceInput} input Parameters used to subscribe to virtual
|
|
137
147
|
* presence state events.
|
|
138
148
|
*/
|
|
139
149
|
subscribe(input: SubscribeToVirtualPresenceInput): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionService, ListActionsForDataHolderInput, ListActionsForDataHolderOutput } from '../../entities/action/actionService';
|
|
7
|
+
/**
|
|
8
|
+
* Application business logic for listing the persisted action history for a data
|
|
9
|
+
* holder.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ListActionsForDataHolderUseCase {
|
|
12
|
+
private readonly actionService;
|
|
13
|
+
private readonly log;
|
|
14
|
+
constructor(actionService: ActionService);
|
|
15
|
+
execute(input: ListActionsForDataHolderInput): Promise<ListActionsForDataHolderOutput>;
|
|
16
|
+
}
|
package/types/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { VirtualPresenceEntity } from '../../entities/virtual-presence/virtualPresenceEntity';
|
|
7
|
+
import { VirtualPresenceService } from '../../entities/virtual-presence/virtualPresenceService';
|
|
8
|
+
/**
|
|
9
|
+
* Application business logic for refreshing a virtual presence's state.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RefreshVirtualPresenceStateUseCase {
|
|
12
|
+
private readonly virtualPresenceService;
|
|
13
|
+
private readonly log;
|
|
14
|
+
constructor(virtualPresenceService: VirtualPresenceService);
|
|
15
|
+
execute(id: string): Promise<VirtualPresenceEntity>;
|
|
16
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { ListOutput } from '@sudoplatform/sudo-common';
|
|
7
|
-
import { ConnectVirtualPresenceWithAuthCodeInput, ConnectVirtualPresenceWithRefreshTokenInput, GetDataHolderOptions, GetOrganizationAnalysisInput, InitiateActionInput, ListAnalysisResultsInput, ListAvailableActionsInput, ListDataHolderScanSummariesInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
|
|
7
|
+
import { ConnectVirtualPresenceWithAuthCodeInput, ConnectVirtualPresenceWithRefreshTokenInput, GetDataHolderOptions, GetOrganizationAnalysisInput, InitiateActionInput, ListAnalysisResultsInput, ListActionsForDataHolderInput, ListAvailableActionsInput, ListDataHolderScanSummariesInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
|
|
8
8
|
import { SudoPrivacyInteractionClient, SudoPrivacyInteractionClientOptions } from './sudoPrivacyInteractionClient';
|
|
9
9
|
import { Action, AnalysisResult, AnalysisResultSubscriber, ActionSubscriber, AvailableAction, DataHolder, DataHolderScanSummary, DataHolderSubscriber, OrganizationAnalysis, ProviderConfiguration, VirtualPresence, VirtualPresenceSubscriber } from './typings';
|
|
10
10
|
export declare class DefaultSudoPrivacyInteractionClient implements SudoPrivacyInteractionClient {
|
|
@@ -36,6 +36,7 @@ export declare class DefaultSudoPrivacyInteractionClient implements SudoPrivacyI
|
|
|
36
36
|
connectVirtualPresenceWithRefreshToken(input: ConnectVirtualPresenceWithRefreshTokenInput): Promise<VirtualPresence>;
|
|
37
37
|
disconnectVirtualPresence(id: string): Promise<VirtualPresence>;
|
|
38
38
|
rescanVirtualPresence(input: RescanVirtualPresenceInput): Promise<VirtualPresence>;
|
|
39
|
+
refreshVirtualPresenceState(id: string): Promise<VirtualPresence>;
|
|
39
40
|
listVirtualPresences(input: ListVirtualPresencesInput): Promise<ListOutput<VirtualPresence>>;
|
|
40
41
|
subscribeToVirtualPresence(subscriptionId: string, subscriber: VirtualPresenceSubscriber): Promise<void>;
|
|
41
42
|
unsubscribeFromVirtualPresence(subscriptionId: string): void;
|
|
@@ -55,6 +56,7 @@ export declare class DefaultSudoPrivacyInteractionClient implements SudoPrivacyI
|
|
|
55
56
|
getAction(id: string): Promise<Action | undefined>;
|
|
56
57
|
confirmActionOutcome(id: string): Promise<Action>;
|
|
57
58
|
listAvailableActions(input: ListAvailableActionsInput): Promise<ListOutput<AvailableAction>>;
|
|
59
|
+
listActionsForDataHolder(input: ListActionsForDataHolderInput): Promise<ListOutput<Action>>;
|
|
58
60
|
subscribeToActions(subscriptionId: string, subscriber: ActionSubscriber): Promise<void>;
|
|
59
61
|
unsubscribeFromActions(subscriptionId: string): void;
|
|
60
62
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { ActionFulfilmentMethod, ActionIntent } from '../typings/action';
|
|
7
|
+
import { Pagination } from './common';
|
|
7
8
|
/**
|
|
8
9
|
* Properties required to initiate an action against a data holder relationship.
|
|
9
10
|
*
|
|
@@ -24,7 +25,22 @@ export interface InitiateActionInput {
|
|
|
24
25
|
*
|
|
25
26
|
* @interface ListAvailableActionsInput
|
|
26
27
|
* @property {string} dataHolderId The data holder relationship to list available actions for.
|
|
28
|
+
* @property {boolean} includeCompleted When true, actions the user has already
|
|
29
|
+
* completed are included in the results. Defaults to false, omitting completed
|
|
30
|
+
* actions.
|
|
27
31
|
*/
|
|
28
32
|
export interface ListAvailableActionsInput {
|
|
29
33
|
dataHolderId: string;
|
|
34
|
+
includeCompleted?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Properties required to list the persisted action history for a data holder.
|
|
38
|
+
*
|
|
39
|
+
* @interface ListActionsForDataHolderInput
|
|
40
|
+
* @property {string} dataHolderId The data holder relationship to list the action history for.
|
|
41
|
+
* @property {number} limit Number of items to return.
|
|
42
|
+
* @property {string} nextToken A token generated by a previous call.
|
|
43
|
+
*/
|
|
44
|
+
export interface ListActionsForDataHolderInput extends Pagination {
|
|
45
|
+
dataHolderId: string;
|
|
30
46
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ListOutput } from '@sudoplatform/sudo-common';
|
|
7
7
|
import { SudoUserClient } from '@sudoplatform/sudo-user';
|
|
8
|
-
import { ConnectVirtualPresenceWithAuthCodeInput, ConnectVirtualPresenceWithRefreshTokenInput, GetDataHolderOptions, GetOrganizationAnalysisInput, InitiateActionInput, ListAnalysisResultsInput, ListAvailableActionsInput, ListDataHolderScanSummariesInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
|
|
8
|
+
import { ConnectVirtualPresenceWithAuthCodeInput, ConnectVirtualPresenceWithRefreshTokenInput, GetDataHolderOptions, GetOrganizationAnalysisInput, InitiateActionInput, ListAnalysisResultsInput, ListActionsForDataHolderInput, ListAvailableActionsInput, ListDataHolderScanSummariesInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
|
|
9
9
|
import { Action, AnalysisResult, AnalysisResultSubscriber, ActionSubscriber, AvailableAction, DataHolder, DataHolderScanSummary, DataHolderSubscriber, OrganizationAnalysis, ProviderConfiguration, VirtualPresence, VirtualPresenceSubscriber } from './typings';
|
|
10
10
|
export interface SudoPrivacyInteractionClient {
|
|
11
11
|
/**
|
|
@@ -43,6 +43,17 @@ export interface SudoPrivacyInteractionClient {
|
|
|
43
43
|
* @returns {VirtualPresence} The rescanned virtual presence.
|
|
44
44
|
*/
|
|
45
45
|
rescanVirtualPresence(input: RescanVirtualPresenceInput): Promise<VirtualPresence>;
|
|
46
|
+
/**
|
|
47
|
+
* Validate a virtual presence's provider grant on demand and return its
|
|
48
|
+
* reconciled state. If the provider confirms the grant has been revoked (e.g.
|
|
49
|
+
* the user removed access in their provider account), the presence transitions
|
|
50
|
+
* to `NeedsReauth`; otherwise its state is returned unchanged. Use before
|
|
51
|
+
* gating access on a current `Connected` state.
|
|
52
|
+
*
|
|
53
|
+
* @param {string} id The unique identifier of the virtual presence to refresh.
|
|
54
|
+
* @returns {VirtualPresence} The virtual presence with its reconciled state.
|
|
55
|
+
*/
|
|
56
|
+
refreshVirtualPresenceState(id: string): Promise<VirtualPresence>;
|
|
46
57
|
/**
|
|
47
58
|
* List all virtual presences for the signed in user.
|
|
48
59
|
*
|
|
@@ -197,6 +208,17 @@ export interface SudoPrivacyInteractionClient {
|
|
|
197
208
|
* search criteria.
|
|
198
209
|
*/
|
|
199
210
|
listAvailableActions(input: ListAvailableActionsInput): Promise<ListOutput<AvailableAction>>;
|
|
211
|
+
/**
|
|
212
|
+
* List the persisted action history for a data holder. Returns every action
|
|
213
|
+
* that has been initiated against the data holder (all intents, all statuses,
|
|
214
|
+
* every attempt), ordered newest-first. This is the executed-action history,
|
|
215
|
+
* distinct from `listAvailableActions`, which returns the derived set of
|
|
216
|
+
* actions a user could take.
|
|
217
|
+
*
|
|
218
|
+
* @param {ListActionsForDataHolderInput} input Parameters used to list the action history.
|
|
219
|
+
* @returns {ListOutput<Action>} A list of actions matching the search criteria.
|
|
220
|
+
*/
|
|
221
|
+
listActionsForDataHolder(input: ListActionsForDataHolderInput): Promise<ListOutput<Action>>;
|
|
200
222
|
/**
|
|
201
223
|
* Subscribe to action status events. Emitted each time an action's status changes.
|
|
202
224
|
*
|
|
@@ -14,6 +14,16 @@
|
|
|
14
14
|
* @property ACCESS_MY_DATA Data subject access / portability request.
|
|
15
15
|
* @property DELETE_MY_DATA Account deletion / data erasure.
|
|
16
16
|
* @property LIMIT_DATA_USE Opt out of sale / tracking, manage consent.
|
|
17
|
+
* @property SWAP_EMAIL The user has replaced the account's email with a private
|
|
18
|
+
* email. Always available for an email presence; self-reported.
|
|
19
|
+
* @property SWAP_PHONE The user has replaced the account's phone number with a
|
|
20
|
+
* private number. Offered only when a signal indicates the data holder holds
|
|
21
|
+
* the user's phone number.
|
|
22
|
+
* @property SWAP_VIRTUAL_CARD The user has replaced the account's payment card
|
|
23
|
+
* with a virtual card. Offered only when the data holder is identified as
|
|
24
|
+
* collecting credit card data.
|
|
25
|
+
* @property SAVE_IN_PASSWORD The user has saved this account in a password
|
|
26
|
+
* manager. Offered only when the data holder supports account creation.
|
|
17
27
|
* @property OTHER Anything unmapped; carries additionalInfo.
|
|
18
28
|
*
|
|
19
29
|
* @enum
|
|
@@ -23,6 +33,10 @@ export declare enum ActionIntent {
|
|
|
23
33
|
AccessMyData = "ACCESS_MY_DATA",
|
|
24
34
|
DeleteMyData = "DELETE_MY_DATA",
|
|
25
35
|
LimitDataUse = "LIMIT_DATA_USE",
|
|
36
|
+
SwapEmail = "SWAP_EMAIL",
|
|
37
|
+
SwapPhone = "SWAP_PHONE",
|
|
38
|
+
SwapVirtualCard = "SWAP_VIRTUAL_CARD",
|
|
39
|
+
SaveInPassword = "SAVE_IN_PASSWORD",
|
|
26
40
|
Other = "OTHER"
|
|
27
41
|
}
|
|
28
42
|
/**
|
|
@@ -174,6 +188,10 @@ export interface Action {
|
|
|
174
188
|
* @property {ActionOrigin} origin Which source contributed this action.
|
|
175
189
|
* @property {string} title Short presentation hint for the action's title.
|
|
176
190
|
* @property {string} description Short presentation hint describing the action.
|
|
191
|
+
* @property {ActionStatus} status Lifecycle status of the most recent,
|
|
192
|
+
* non-superseded persisted action for this intent on the data holder.
|
|
193
|
+
* Undefined when the user has never initiated this action, distinguishing
|
|
194
|
+
* "not yet started" from "in progress" or "completed".
|
|
177
195
|
*/
|
|
178
196
|
export interface AvailableAction {
|
|
179
197
|
intent: ActionIntent;
|
|
@@ -182,4 +200,5 @@ export interface AvailableAction {
|
|
|
182
200
|
origin: ActionOrigin;
|
|
183
201
|
title?: string;
|
|
184
202
|
description?: string;
|
|
203
|
+
status?: ActionStatus;
|
|
185
204
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @property {string} virtualPresenceId The virtual presence this analysis is associated with.
|
|
13
13
|
* @property {string} dataHolderIdentifier The data holder domain that this analysis is about.
|
|
14
14
|
* @property {AnalysisResultStatus} status Current status of the analysis.
|
|
15
|
+
* @property {AnalysisResultStatusReason} statusReason Reason explaining the current status, when one applies.
|
|
15
16
|
* @property {Date} lastAnalyzedAt Date for when the analysis was last performed.
|
|
16
17
|
* @property {AnalysisResultData} data Structured analysis data. Populated when status is COMPLETE or PARTIAL.
|
|
17
18
|
* @property {number} version Version of this entity. Increments on update.
|
|
@@ -23,6 +24,7 @@ export interface AnalysisResult {
|
|
|
23
24
|
virtualPresenceId: string;
|
|
24
25
|
dataHolderIdentifier: string;
|
|
25
26
|
status: AnalysisResultStatus;
|
|
27
|
+
statusReason?: AnalysisResultStatusReason;
|
|
26
28
|
lastAnalyzedAt: Date;
|
|
27
29
|
data?: AnalysisResultData;
|
|
28
30
|
owner: string;
|
|
@@ -39,6 +41,7 @@ export interface AnalysisResult {
|
|
|
39
41
|
* @property {string} virtualPresenceId The virtual presence this analysis is associated with.
|
|
40
42
|
* @property {string} dataHolderIdentifier The data holder domain that this analysis is about.
|
|
41
43
|
* @property {AnalysisResultStatus} status Current status of the analysis.
|
|
44
|
+
* @property {AnalysisResultStatusReason} statusReason Reason explaining the current status, when one applies.
|
|
42
45
|
* @property {Date} lastAnalyzedAt Date for when the analysis was last performed.
|
|
43
46
|
* @property {number} version Version of this entity. Increments on update.
|
|
44
47
|
* @property {Date} createdAt Date for when the analysis result was created.
|
|
@@ -49,6 +52,7 @@ export interface AnalysisResultUpdate {
|
|
|
49
52
|
virtualPresenceId: string;
|
|
50
53
|
dataHolderIdentifier: string;
|
|
51
54
|
status: AnalysisResultStatus;
|
|
55
|
+
statusReason?: AnalysisResultStatusReason;
|
|
52
56
|
lastAnalyzedAt: Date;
|
|
53
57
|
owner: string;
|
|
54
58
|
version: number;
|
|
@@ -73,6 +77,24 @@ export declare enum AnalysisResultStatus {
|
|
|
73
77
|
Failed = "FAILED",
|
|
74
78
|
Unavailable = "UNAVAILABLE"
|
|
75
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The reason explaining an analysis result's status.
|
|
82
|
+
*
|
|
83
|
+
* @property INVALID_DOMAIN The requested domain was not a valid analyzable domain.
|
|
84
|
+
* @property POLICY_UNAVAILABLE No privacy policy could be located for the organization.
|
|
85
|
+
* @property MALICIOUS The domain was identified as malicious.
|
|
86
|
+
* @property NOT_ATTEMPTED Analysis was not attempted for the domain.
|
|
87
|
+
* @property OTHER A reason that does not fit the other categories.
|
|
88
|
+
*
|
|
89
|
+
* @enum
|
|
90
|
+
*/
|
|
91
|
+
export declare enum AnalysisResultStatusReason {
|
|
92
|
+
InvalidDomain = "INVALID_DOMAIN",
|
|
93
|
+
PolicyUnavailable = "POLICY_UNAVAILABLE",
|
|
94
|
+
Malicious = "MALICIOUS",
|
|
95
|
+
NotAttempted = "NOT_ATTEMPTED",
|
|
96
|
+
Other = "OTHER"
|
|
97
|
+
}
|
|
76
98
|
/**
|
|
77
99
|
* The structured data payload for an analysis result.
|
|
78
100
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AnalysisResultData, AnalysisResultStatus } from './analysisResult';
|
|
6
|
+
import { AnalysisResultData, AnalysisResultStatus, AnalysisResultStatusReason } from './analysisResult';
|
|
7
7
|
/**
|
|
8
8
|
* The Sudo Platform SDK representation of a shared, domain-keyed privacy analysis
|
|
9
9
|
* of an organization.
|
|
@@ -17,6 +17,7 @@ import { AnalysisResultData, AnalysisResultStatus } from './analysisResult';
|
|
|
17
17
|
* @property {string} domain The analyzed domain (equal to id).
|
|
18
18
|
* @property {AnalysisResultStatus} status Aggregate status. Pending while an asynchronous
|
|
19
19
|
* source is still resolving; re-query for the terminal result.
|
|
20
|
+
* @property {AnalysisResultStatusReason} statusReason Reason explaining the aggregate status, when one applies.
|
|
20
21
|
* @property {Date} lastAnalyzedAt When the aggregate was last derived.
|
|
21
22
|
* @property {AnalysisResultData} data Structured analysis payload. Populated when status is
|
|
22
23
|
* Complete or Partial.
|
|
@@ -29,6 +30,7 @@ export interface OrganizationAnalysis {
|
|
|
29
30
|
id: string;
|
|
30
31
|
domain: string;
|
|
31
32
|
status: AnalysisResultStatus;
|
|
33
|
+
statusReason?: AnalysisResultStatusReason;
|
|
32
34
|
lastAnalyzedAt: Date;
|
|
33
35
|
data?: AnalysisResultData;
|
|
34
36
|
owner: string;
|