@sudoplatform/sudo-privacy-interaction 1.0.0 → 2.0.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 (91) hide show
  1. package/cjs/gen/graphqlTypes.js +44 -4
  2. package/cjs/private/data/analysis-result/transformer/analysisResultDataTransformer.js +2 -0
  3. package/cjs/private/data/analysis-result/transformer/capabilitySignalsTransformer.js +2 -0
  4. package/cjs/private/data/analysis-result/transformer/categorySignalsTransformer.js +2 -2
  5. package/cjs/private/data/common/apiClient.js +8 -0
  6. package/cjs/private/data/provider-configuration/defaultProviderConfigurationService.js +23 -0
  7. package/cjs/private/data/provider-configuration/transformer/providerConfigurationTransformer.js +52 -0
  8. package/cjs/private/data/virtual-presence/defaultVirtualPresenceService.js +11 -1
  9. package/cjs/private/data/virtual-presence/transformer/relationshipProviderTransformer.js +29 -0
  10. package/cjs/private/domain/entities/configuration/providerConfigurationEntity.js +7 -0
  11. package/cjs/private/domain/entities/configuration/providerConfigurationService.js +7 -0
  12. package/cjs/private/domain/entities/inputs/relationshipProviderEntity.js +21 -0
  13. package/cjs/private/domain/use-cases/configuration/getProviderConfigurationUseCase.js +25 -0
  14. package/cjs/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.js +6 -2
  15. package/cjs/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithRefreshTokenUseCase.js +7 -1
  16. package/cjs/public/defaultSudoPrivacyInteractionClient.js +34 -3
  17. package/cjs/public/inputs/virtualPresence.js +14 -0
  18. package/cjs/public/typings/index.js +1 -0
  19. package/cjs/public/typings/providerConfiguration.js +7 -0
  20. package/docs/assets/hierarchy.js +1 -1
  21. package/docs/assets/navigation.js +1 -1
  22. package/docs/assets/search.js +1 -1
  23. package/docs/classes/DefaultSudoPrivacyInteractionClient.html +36 -21
  24. package/docs/enums/DataCategory.html +18 -18
  25. package/docs/enums/OrganizationCategory.html +30 -30
  26. package/docs/enums/RelationshipProvider.html +63 -0
  27. package/docs/enums/RetentionStyle.html +5 -5
  28. package/docs/enums/ShareStyle.html +6 -6
  29. package/docs/enums/SignalValue.html +4 -4
  30. package/docs/hierarchy.html +5 -5
  31. package/docs/interfaces/AnalysisResultData.html +18 -10
  32. package/docs/interfaces/CapabilitySignals.html +18 -10
  33. package/docs/interfaces/CategorySignals.html +20 -20
  34. package/docs/interfaces/ConnectVirtualPresenceWithAuthCodeInput.html +79 -0
  35. package/docs/interfaces/ConnectVirtualPresenceWithRefreshTokenInput.html +16 -7
  36. package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
  37. package/docs/interfaces/ListDataHoldersInput.html +1 -1
  38. package/docs/interfaces/ListVirtualPresencesInput.html +2 -2
  39. package/docs/interfaces/OrganizationIdentity.html +5 -5
  40. package/docs/interfaces/Pagination.html +1 -1
  41. package/docs/interfaces/PrivacyScore.html +3 -3
  42. package/docs/interfaces/PrivacySummary.html +4 -4
  43. package/docs/interfaces/ProviderConfiguration.html +80 -0
  44. package/docs/interfaces/RescanVirtualPresenceInput.html +3 -3
  45. package/docs/interfaces/RetentionInfo.html +4 -4
  46. package/docs/interfaces/RiskIndicators.html +8 -8
  47. package/docs/interfaces/ScanOptions.html +6 -6
  48. package/docs/interfaces/ScoreContribution.html +3 -3
  49. package/docs/interfaces/SudoPrivacyInteractionClient.html +35 -21
  50. package/docs/modules.html +4 -4
  51. package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
  52. package/lib/gen/graphqlTypes.js +43 -3
  53. package/lib/private/data/analysis-result/transformer/analysisResultDataTransformer.js +2 -0
  54. package/lib/private/data/analysis-result/transformer/capabilitySignalsTransformer.js +2 -0
  55. package/lib/private/data/analysis-result/transformer/categorySignalsTransformer.js +2 -2
  56. package/lib/private/data/common/apiClient.js +9 -1
  57. package/lib/private/data/provider-configuration/defaultProviderConfigurationService.js +19 -0
  58. package/lib/private/data/provider-configuration/transformer/providerConfigurationTransformer.js +48 -0
  59. package/lib/private/data/virtual-presence/defaultVirtualPresenceService.js +11 -1
  60. package/lib/private/data/virtual-presence/transformer/relationshipProviderTransformer.js +25 -0
  61. package/lib/private/domain/entities/configuration/providerConfigurationEntity.js +6 -0
  62. package/lib/private/domain/entities/configuration/providerConfigurationService.js +6 -0
  63. package/lib/private/domain/entities/inputs/relationshipProviderEntity.js +18 -0
  64. package/lib/private/domain/use-cases/configuration/getProviderConfigurationUseCase.js +21 -0
  65. package/lib/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.js +6 -2
  66. package/lib/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithRefreshTokenUseCase.js +7 -1
  67. package/lib/public/defaultSudoPrivacyInteractionClient.js +34 -3
  68. package/lib/public/inputs/virtualPresence.js +13 -1
  69. package/lib/public/typings/index.js +1 -0
  70. package/lib/public/typings/providerConfiguration.js +6 -0
  71. package/package.json +6 -4
  72. package/types/gen/graphqlTypes.d.ts +37 -5
  73. package/types/private/data/common/apiClient.d.ts +2 -1
  74. package/types/private/data/provider-configuration/defaultProviderConfigurationService.d.ts +14 -0
  75. package/types/private/data/provider-configuration/transformer/providerConfigurationTransformer.d.ts +19 -0
  76. package/types/private/data/virtual-presence/defaultVirtualPresenceService.d.ts +1 -0
  77. package/types/private/data/virtual-presence/transformer/relationshipProviderTransformer.d.ts +12 -0
  78. package/types/private/domain/entities/analysis-result/analysisResultEntity.d.ts +6 -2
  79. package/types/private/domain/entities/configuration/providerConfigurationEntity.d.ts +23 -0
  80. package/types/private/domain/entities/configuration/providerConfigurationService.d.ts +21 -0
  81. package/types/private/domain/entities/inputs/relationshipProviderEntity.d.ts +17 -0
  82. package/types/private/domain/entities/virtual-presence/virtualPresenceService.d.ts +17 -2
  83. package/types/private/domain/use-cases/configuration/getProviderConfigurationUseCase.d.ts +16 -0
  84. package/types/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.d.ts +13 -1
  85. package/types/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithRefreshTokenUseCase.d.ts +2 -0
  86. package/types/public/defaultSudoPrivacyInteractionClient.d.ts +7 -3
  87. package/types/public/inputs/virtualPresence.d.ts +30 -0
  88. package/types/public/sudoPrivacyInteractionClient.d.ts +11 -4
  89. package/types/public/typings/analysisResult.d.ts +6 -2
  90. package/types/public/typings/index.d.ts +1 -0
  91. package/types/public/typings/providerConfiguration.d.ts +23 -0
@@ -3,8 +3,19 @@
3
3
  *
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { RelationshipProviderEntity } from '../../entities/inputs/relationshipProviderEntity';
6
7
  import { VirtualPresenceEntity } from '../../entities/virtual-presence/virtualPresenceEntity';
7
8
  import { VirtualPresenceService } from '../../entities/virtual-presence/virtualPresenceService';
9
+ /**
10
+ * Input for `ConnectVirtualPresenceWithAuthCodeUseCase`.
11
+ *
12
+ * @interface ConnectVirtualPresenceWithAuthCodeUseCaseInput
13
+ */
14
+ interface ConnectVirtualPresenceWithAuthCodeUseCaseInput {
15
+ authCode: string;
16
+ redirectUri?: string;
17
+ relationshipProvider?: RelationshipProviderEntity;
18
+ }
8
19
  /**
9
20
  * Application business logic for connecting a virtual presence using an authorization code.
10
21
  */
@@ -12,5 +23,6 @@ export declare class ConnectVirtualPresenceWithAuthCodeUseCase {
12
23
  private readonly virtualPresenceService;
13
24
  private readonly log;
14
25
  constructor(virtualPresenceService: VirtualPresenceService);
15
- execute(authCode: string): Promise<VirtualPresenceEntity>;
26
+ execute(input: ConnectVirtualPresenceWithAuthCodeUseCaseInput): Promise<VirtualPresenceEntity>;
16
27
  }
28
+ export {};
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { RelationshipProviderEntity } from '../../entities/inputs/relationshipProviderEntity';
6
7
  import { VirtualPresenceEntity } from '../../entities/virtual-presence/virtualPresenceEntity';
7
8
  import { VirtualPresenceService } from '../../entities/virtual-presence/virtualPresenceService';
8
9
  /**
@@ -15,6 +16,7 @@ interface ConnectVirtualPresenceWithRefreshTokenUseCaseInput {
15
16
  providerIdentity: string;
16
17
  scopes?: string[];
17
18
  expiresInEpochMs?: number;
19
+ relationshipProvider?: RelationshipProviderEntity;
18
20
  }
19
21
  /**
20
22
  * Application business logic for connecting a virtual presence with a pre-obtained refresh token.
@@ -4,21 +4,25 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { ListOutput } from '@sudoplatform/sudo-common';
7
- import { ConnectVirtualPresenceWithRefreshTokenInput, ListAnalysisResultsInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
7
+ import { ConnectVirtualPresenceWithAuthCodeInput, ConnectVirtualPresenceWithRefreshTokenInput, ListAnalysisResultsInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
8
8
  import { SudoPrivacyInteractionClient, SudoPrivacyInteractionClientOptions } from './sudoPrivacyInteractionClient';
9
- import { AnalysisResult, AnalysisResultSubscriber, DataHolder, DataHolderSubscriber, VirtualPresence, VirtualPresenceSubscriber } from './typings';
9
+ import { AnalysisResult, AnalysisResultSubscriber, DataHolder, DataHolderSubscriber, ProviderConfiguration, VirtualPresence, VirtualPresenceSubscriber } from './typings';
10
10
  export declare class DefaultSudoPrivacyInteractionClient implements SudoPrivacyInteractionClient {
11
11
  private readonly apiClient;
12
12
  private readonly userClient;
13
+ private readonly providerConfigurationService;
13
14
  private readonly virtualPresenceService;
14
15
  private readonly dataHolderService;
15
16
  private readonly analysisResultService;
17
+ private readonly providerConfigurationTransformer;
16
18
  private readonly virtualPresenceTransformer;
19
+ private readonly relationshipProviderTransformer;
17
20
  private readonly dataHolderTransformer;
18
21
  private readonly analysisResultTransformer;
19
22
  private readonly log;
20
23
  constructor(opts: SudoPrivacyInteractionClientOptions);
21
- connectVirtualPresenceWithAuthCode(authCode: string): Promise<VirtualPresence>;
24
+ getProviderConfiguration(): Promise<ProviderConfiguration[]>;
25
+ connectVirtualPresenceWithAuthCode(input: ConnectVirtualPresenceWithAuthCodeInput): Promise<VirtualPresence>;
22
26
  connectVirtualPresenceWithRefreshToken(input: ConnectVirtualPresenceWithRefreshTokenInput): Promise<VirtualPresence>;
23
27
  disconnectVirtualPresence(id: string): Promise<VirtualPresence>;
24
28
  rescanVirtualPresence(input: RescanVirtualPresenceInput): Promise<VirtualPresence>;
@@ -4,6 +4,21 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { Pagination } from './common';
7
+ /**
8
+ * Properties required to connect a virtual presence with an auth code.
9
+ *
10
+ * @interface ConnectVirtualPresenceWithAuthCodeInput
11
+ * @property {string} authCode An authorization code obtained from the OAuth flow.
12
+ * @property {string} redirectUri The redirect URI that was used to obtain the
13
+ * authorization code.
14
+ * @property {RelationshipProvider} relationshipProvider The relationship provider
15
+ * to associate with the connection.
16
+ */
17
+ export interface ConnectVirtualPresenceWithAuthCodeInput {
18
+ authCode: string;
19
+ redirectUri?: string;
20
+ relationshipProvider?: RelationshipProvider;
21
+ }
7
22
  /**
8
23
  * Properties required to connect a virtual presence with a refresh token.
9
24
  *
@@ -12,12 +27,27 @@ import { Pagination } from './common';
12
27
  * @property {string} providerIdentity The identity associated with the provider.
13
28
  * @property {string[]} scopes Optional OAuth scopes associated with the token.
14
29
  * @property {number} expiresInEpochMs Optional expiration time in milliseconds since epoch.
30
+ * @property {RelationshipProvider} relationshipProvider The relationship provider
31
+ * to associate with the connection.
15
32
  */
16
33
  export interface ConnectVirtualPresenceWithRefreshTokenInput {
17
34
  refreshToken: string;
18
35
  providerIdentity: string;
19
36
  scopes?: string[];
20
37
  expiresInEpochMs?: number;
38
+ relationshipProvider?: RelationshipProvider;
39
+ }
40
+ /**
41
+ * Enumeration of the relationship providers that back a virtual presence connection.
42
+ *
43
+ * @property GMAIL_PROVIDER The Gmail relationship provider.
44
+ * @property TEST_PROVIDER The test relationship provider.
45
+ *
46
+ * @enum
47
+ */
48
+ export declare enum RelationshipProvider {
49
+ GmailProvider = "GMAIL_PROVIDER",
50
+ TestProvider = "TEST_PROVIDER"
21
51
  }
22
52
  /**
23
53
  * Properties required to list virtual presences for this client.
@@ -5,16 +5,23 @@
5
5
  */
6
6
  import { ListOutput } from '@sudoplatform/sudo-common';
7
7
  import { SudoUserClient } from '@sudoplatform/sudo-user';
8
- import { ConnectVirtualPresenceWithRefreshTokenInput, ListAnalysisResultsInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
9
- import { AnalysisResult, AnalysisResultSubscriber, DataHolder, DataHolderSubscriber, VirtualPresence, VirtualPresenceSubscriber } from './typings';
8
+ import { ConnectVirtualPresenceWithAuthCodeInput, ConnectVirtualPresenceWithRefreshTokenInput, ListAnalysisResultsInput, ListDataHoldersInput, ListVirtualPresencesInput, RescanVirtualPresenceInput } from './inputs';
9
+ import { AnalysisResult, AnalysisResultSubscriber, DataHolder, DataHolderSubscriber, ProviderConfiguration, VirtualPresence, VirtualPresenceSubscriber } from './typings';
10
10
  export interface SudoPrivacyInteractionClient {
11
+ /**
12
+ * Retrieve the provider configurations required by consumers to support
13
+ * the provider OAuth flow.
14
+ *
15
+ * @returns {ProviderConfiguration[]} The provider configurations.
16
+ */
17
+ getProviderConfiguration(): Promise<ProviderConfiguration[]>;
11
18
  /**
12
19
  * Connect a virtual presence using an authorization code obtained from an OAuth flow.
13
20
  *
14
- * @param {string} authCode An authorization code obtained from the OAuth flow.
21
+ * @param {ConnectVirtualPresenceWithAuthCodeInput} input The authorization code input.
15
22
  * @returns {VirtualPresence} The connected virtual presence.
16
23
  */
17
- connectVirtualPresenceWithAuthCode(authCode: string): Promise<VirtualPresence>;
24
+ connectVirtualPresenceWithAuthCode(input: ConnectVirtualPresenceWithAuthCodeInput): Promise<VirtualPresence>;
18
25
  /**
19
26
  * Connect a virtual presence using a pre-obtained refresh token credential.
20
27
  *
@@ -84,6 +84,7 @@ export declare enum AnalysisResultStatus {
84
84
  * @property {CapabilitySignals} capabilities Action-derived capability signals.
85
85
  * @property {RiskIndicators} riskIndicators Aggregated risk indicators.
86
86
  * @property {OrganizationIdentity} organizationIdentity Organization identity (brand, company, business categories).
87
+ * @property {string[]} attribution Information describing where the analysis result is derived from.
87
88
  */
88
89
  export interface AnalysisResultData {
89
90
  privacyScore?: PrivacyScore;
@@ -92,6 +93,7 @@ export interface AnalysisResultData {
92
93
  capabilities: CapabilitySignals;
93
94
  riskIndicators: RiskIndicators;
94
95
  organizationIdentity?: OrganizationIdentity;
96
+ attribution: string[];
95
97
  }
96
98
  /**
97
99
  * Overall privacy score for an organization.
@@ -216,7 +218,7 @@ export interface RetentionInfo {
216
218
  * @property {SignalValue} collected Whether this category of data is collected.
217
219
  * @property {string[]} dataLabels Descriptive labels for the collected data within this category.
218
220
  * @property {ShareStyle} sharedWithThirdParties How this category is shared with third parties.
219
- * @property {SignalValue} usedForAdvertising Whether this category is used for advertising or monetization.
221
+ * @property {SignalValue} monetized Whether this category is used for monetization.
220
222
  * @property {SignalValue} retained Whether this category is retained.
221
223
  * @property {RetentionInfo} retention Retention details when data is retained.
222
224
  * @property {SignalValue} userCanOptOut Whether the user can opt out of this category's collection.
@@ -228,7 +230,7 @@ export interface CategorySignals {
228
230
  collected: SignalValue;
229
231
  dataLabels: string[];
230
232
  sharedWithThirdParties: ShareStyle;
231
- usedForAdvertising: SignalValue;
233
+ monetized: SignalValue;
232
234
  retained: SignalValue;
233
235
  retention?: RetentionInfo;
234
236
  userCanOptOut: SignalValue;
@@ -246,6 +248,7 @@ export interface CategorySignals {
246
248
  * @property {SignalValue} supportsSubscriptions Whether the organization supports subscription management.
247
249
  * @property {SignalValue} sellsPersonalInformation Whether the organization sells personal information.
248
250
  * @property {SignalValue} usesCookiesOrTracking Whether the organization uses cookies or tracking.
251
+ * @property {SignalValue} supportsTwoFactorAuth Whether the organization supports two-factor auth for logins.
249
252
  */
250
253
  export interface CapabilitySignals {
251
254
  supportsAccountCreation: SignalValue;
@@ -255,6 +258,7 @@ export interface CapabilitySignals {
255
258
  supportsSubscriptions: SignalValue;
256
259
  sellsPersonalInformation: SignalValue;
257
260
  usesCookiesOrTracking: SignalValue;
261
+ supportsTwoFactorAuth: SignalValue;
258
262
  }
259
263
  /**
260
264
  * Aggregated risk indicators derived from categories and capabilities.
@@ -5,5 +5,6 @@
5
5
  */
6
6
  export * from './analysisResult';
7
7
  export * from './dataHolder';
8
+ export * from './providerConfiguration';
8
9
  export * from './subscription';
9
10
  export * from './virtualPresence';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { ProviderType } from './virtualPresence';
7
+ /**
8
+ * The Sudo Platform SDK representation of a provider client configuration.
9
+ *
10
+ * Contains the configuration required by consumers to support the provider
11
+ * OAuth flow. This is the decoded form of the opaque configuration data
12
+ * returned by the service.
13
+ *
14
+ * @interface ProviderConfiguration
15
+ * @property {string} name Human-readable provider name (e.g. 'google').
16
+ * @property {ProviderType} providerType The kind of virtual presence this provider backs (e.g. EMAIL).
17
+ * @property {string} clientId OAuth client id.
18
+ */
19
+ export interface ProviderConfiguration {
20
+ name: string;
21
+ providerType: ProviderType;
22
+ clientId: string;
23
+ }