@sudoplatform/sudo-privacy-interaction 2.4.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.
Files changed (63) hide show
  1. package/cjs/gen/graphqlTypes.js +299 -1
  2. package/cjs/private/data/action/defaultActionService.js +8 -0
  3. package/cjs/private/data/action/transformer/actionIntentTransformer.js +32 -0
  4. package/cjs/private/data/action/transformer/availableActionTransformer.js +8 -0
  5. package/cjs/private/data/common/apiClient.js +21 -0
  6. package/cjs/private/data/virtual-presence/defaultVirtualPresenceService.js +4 -0
  7. package/cjs/private/domain/entities/action/actionEntity.js +14 -0
  8. package/cjs/private/domain/use-cases/action/listActionsForDataHolderUseCase.js +26 -0
  9. package/cjs/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.js +25 -0
  10. package/cjs/public/defaultSudoPrivacyInteractionClient.js +23 -1
  11. package/cjs/public/typings/action.js +14 -0
  12. package/docs/assets/hierarchy.js +1 -1
  13. package/docs/assets/navigation.js +1 -1
  14. package/docs/assets/search.js +1 -1
  15. package/docs/classes/DefaultSudoPrivacyInteractionClient.html +77 -29
  16. package/docs/enums/ActionFulfilmentMethod.html +3 -3
  17. package/docs/enums/ActionIntent.html +31 -7
  18. package/docs/enums/ActionOrigin.html +5 -5
  19. package/docs/enums/ActionStatus.html +9 -9
  20. package/docs/hierarchy.html +7 -6
  21. package/docs/interfaces/Action.html +15 -15
  22. package/docs/interfaces/ActionContact.html +4 -4
  23. package/docs/interfaces/AssistedEmailTemplate.html +3 -3
  24. package/docs/interfaces/AssistedPayload.html +8 -8
  25. package/docs/interfaces/AvailableAction.html +20 -9
  26. package/docs/interfaces/InitiateActionInput.html +4 -4
  27. package/docs/interfaces/ListActionsForDataHolderInput.html +85 -0
  28. package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
  29. package/docs/interfaces/ListAvailableActionsInput.html +14 -4
  30. package/docs/interfaces/ListDataHolderScanSummariesInput.html +1 -1
  31. package/docs/interfaces/ListDataHoldersInput.html +1 -1
  32. package/docs/interfaces/ListVirtualPresencesInput.html +1 -1
  33. package/docs/interfaces/Pagination.html +2 -1
  34. package/docs/interfaces/SudoPrivacyInteractionClient.html +75 -29
  35. package/docs/modules.html +2 -2
  36. package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
  37. package/lib/gen/graphqlTypes.js +298 -0
  38. package/lib/private/data/action/defaultActionService.js +8 -0
  39. package/lib/private/data/action/transformer/actionIntentTransformer.js +32 -0
  40. package/lib/private/data/action/transformer/availableActionTransformer.js +8 -0
  41. package/lib/private/data/common/apiClient.js +22 -1
  42. package/lib/private/data/virtual-presence/defaultVirtualPresenceService.js +4 -0
  43. package/lib/private/domain/entities/action/actionEntity.js +14 -0
  44. package/lib/private/domain/use-cases/action/listActionsForDataHolderUseCase.js +22 -0
  45. package/lib/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.js +21 -0
  46. package/lib/public/defaultSudoPrivacyInteractionClient.js +23 -1
  47. package/lib/public/typings/action.js +14 -0
  48. package/package.json +6 -1
  49. package/types/gen/graphqlTypes.d.ts +71 -1
  50. package/types/gen/schema-types.d.ts +35 -2
  51. package/types/private/data/action/defaultActionService.d.ts +2 -1
  52. package/types/private/data/action/transformer/availableActionTransformer.d.ts +1 -0
  53. package/types/private/data/common/apiClient.d.ts +8 -1
  54. package/types/private/data/virtual-presence/defaultVirtualPresenceService.d.ts +1 -0
  55. package/types/private/domain/entities/action/actionEntity.d.ts +18 -0
  56. package/types/private/domain/entities/action/actionService.d.ts +36 -0
  57. package/types/private/domain/entities/virtual-presence/virtualPresenceService.d.ts +11 -1
  58. package/types/private/domain/use-cases/action/listActionsForDataHolderUseCase.d.ts +16 -0
  59. package/types/private/domain/use-cases/virtual-presence/refreshVirtualPresenceStateUseCase.d.ts +16 -0
  60. package/types/public/defaultSudoPrivacyInteractionClient.d.ts +3 -1
  61. package/types/public/inputs/action.d.ts +16 -0
  62. package/types/public/sudoPrivacyInteractionClient.d.ts +23 -1
  63. package/types/public/typings/action.d.ts +19 -0
@@ -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
  *
@@ -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 {SubscribeToVirtualPresenceUpdatesInput} input Parameters used to subscribe to virtual
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
+ }
@@ -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
  }