@sudoplatform/sudo-privacy-interaction 1.1.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.
- package/cjs/gen/graphqlTypes.js +26 -1
- package/cjs/private/data/common/apiClient.js +8 -0
- package/cjs/private/data/provider-configuration/defaultProviderConfigurationService.js +23 -0
- package/cjs/private/data/provider-configuration/transformer/providerConfigurationTransformer.js +52 -0
- package/cjs/private/data/virtual-presence/defaultVirtualPresenceService.js +11 -1
- package/cjs/private/data/virtual-presence/transformer/relationshipProviderTransformer.js +29 -0
- package/cjs/private/domain/entities/configuration/providerConfigurationEntity.js +7 -0
- package/cjs/private/domain/entities/configuration/providerConfigurationService.js +7 -0
- package/cjs/private/domain/entities/inputs/relationshipProviderEntity.js +21 -0
- package/cjs/private/domain/use-cases/configuration/getProviderConfigurationUseCase.js +25 -0
- package/cjs/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.js +6 -2
- package/cjs/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithRefreshTokenUseCase.js +7 -1
- package/cjs/public/defaultSudoPrivacyInteractionClient.js +34 -3
- package/cjs/public/inputs/virtualPresence.js +14 -0
- package/cjs/public/typings/index.js +1 -0
- package/cjs/public/typings/providerConfiguration.js +7 -0
- 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 +36 -21
- package/docs/enums/RelationshipProvider.html +63 -0
- package/docs/hierarchy.html +5 -5
- package/docs/interfaces/ConnectVirtualPresenceWithAuthCodeInput.html +79 -0
- package/docs/interfaces/ConnectVirtualPresenceWithRefreshTokenInput.html +16 -7
- package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
- package/docs/interfaces/ListDataHoldersInput.html +1 -1
- package/docs/interfaces/ListVirtualPresencesInput.html +2 -2
- package/docs/interfaces/Pagination.html +1 -1
- package/docs/interfaces/ProviderConfiguration.html +80 -0
- package/docs/interfaces/RescanVirtualPresenceInput.html +3 -3
- package/docs/interfaces/ScanOptions.html +6 -6
- package/docs/interfaces/SudoPrivacyInteractionClient.html +35 -21
- package/docs/modules.html +4 -4
- package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
- package/lib/gen/graphqlTypes.js +25 -0
- package/lib/private/data/common/apiClient.js +9 -1
- package/lib/private/data/provider-configuration/defaultProviderConfigurationService.js +19 -0
- package/lib/private/data/provider-configuration/transformer/providerConfigurationTransformer.js +48 -0
- package/lib/private/data/virtual-presence/defaultVirtualPresenceService.js +11 -1
- package/lib/private/data/virtual-presence/transformer/relationshipProviderTransformer.js +25 -0
- package/lib/private/domain/entities/configuration/providerConfigurationEntity.js +6 -0
- package/lib/private/domain/entities/configuration/providerConfigurationService.js +6 -0
- package/lib/private/domain/entities/inputs/relationshipProviderEntity.js +18 -0
- package/lib/private/domain/use-cases/configuration/getProviderConfigurationUseCase.js +21 -0
- package/lib/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.js +6 -2
- package/lib/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithRefreshTokenUseCase.js +7 -1
- package/lib/public/defaultSudoPrivacyInteractionClient.js +34 -3
- package/lib/public/inputs/virtualPresence.js +13 -1
- package/lib/public/typings/index.js +1 -0
- package/lib/public/typings/providerConfiguration.js +6 -0
- package/package.json +6 -4
- package/types/gen/graphqlTypes.d.ts +25 -1
- package/types/private/data/common/apiClient.d.ts +2 -1
- package/types/private/data/provider-configuration/defaultProviderConfigurationService.d.ts +14 -0
- package/types/private/data/provider-configuration/transformer/providerConfigurationTransformer.d.ts +19 -0
- package/types/private/data/virtual-presence/defaultVirtualPresenceService.d.ts +1 -0
- package/types/private/data/virtual-presence/transformer/relationshipProviderTransformer.d.ts +12 -0
- package/types/private/domain/entities/configuration/providerConfigurationEntity.d.ts +23 -0
- package/types/private/domain/entities/configuration/providerConfigurationService.d.ts +21 -0
- package/types/private/domain/entities/inputs/relationshipProviderEntity.d.ts +17 -0
- package/types/private/domain/entities/virtual-presence/virtualPresenceService.d.ts +17 -2
- package/types/private/domain/use-cases/configuration/getProviderConfigurationUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.d.ts +13 -1
- package/types/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithRefreshTokenUseCase.d.ts +2 -0
- package/types/public/defaultSudoPrivacyInteractionClient.d.ts +7 -3
- package/types/public/inputs/virtualPresence.d.ts +30 -0
- package/types/public/sudoPrivacyInteractionClient.d.ts +11 -4
- package/types/public/typings/index.d.ts +1 -0
- package/types/public/typings/providerConfiguration.d.ts +23 -0
|
@@ -3,4 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Enumeration of the relationship providers that back a virtual presence connection.
|
|
8
|
+
*
|
|
9
|
+
* @property GMAIL_PROVIDER The Gmail relationship provider.
|
|
10
|
+
* @property TEST_PROVIDER The test relationship provider.
|
|
11
|
+
*
|
|
12
|
+
* @enum
|
|
13
|
+
*/
|
|
14
|
+
export var RelationshipProvider;
|
|
15
|
+
(function (RelationshipProvider) {
|
|
16
|
+
RelationshipProvider["GmailProvider"] = "GMAIL_PROVIDER";
|
|
17
|
+
RelationshipProvider["TestProvider"] = "TEST_PROVIDER";
|
|
18
|
+
})(RelationshipProvider || (RelationshipProvider = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudoplatform/sudo-privacy-interaction",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"author": "Anonyome Labs, Inc.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
"tar": "^7.5.21",
|
|
68
68
|
"postcss": "^8.5.23",
|
|
69
69
|
"uuid": "^11.1.1",
|
|
70
|
-
"js-yaml": "^4.3.
|
|
70
|
+
"js-yaml": "^4.3.2",
|
|
71
|
+
"vitest": "^4.1.11",
|
|
72
|
+
"@vitest/mocker": "^4.1.11"
|
|
71
73
|
},
|
|
72
74
|
"devDependencies": {
|
|
73
75
|
"@graphql-codegen/add": "^6.0.0",
|
|
@@ -84,7 +86,7 @@
|
|
|
84
86
|
"@types/uuid": "^10.0.0",
|
|
85
87
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
86
88
|
"@typescript-eslint/parser": "^8.26.1",
|
|
87
|
-
"@vitest/coverage-v8": "^4.1.
|
|
89
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
88
90
|
"concurrently": "^9.2.1",
|
|
89
91
|
"dotenv": "^17.4.2",
|
|
90
92
|
"eslint": "^8.57.1",
|
|
@@ -101,7 +103,7 @@
|
|
|
101
103
|
"typedoc": "^0.28.11",
|
|
102
104
|
"typescript": "^5.9.2",
|
|
103
105
|
"uuid": "^11.1.0",
|
|
104
|
-
"vitest": "^4.1.
|
|
106
|
+
"vitest": "^4.1.11",
|
|
105
107
|
"wait-for-expect": "^4.0.0"
|
|
106
108
|
},
|
|
107
109
|
"packageManager": "yarn@4.9.2+sha256.ca4310f8ba997b4643a000ce512d9772e01c1485df35511114b325315960acb7",
|
|
@@ -116,6 +116,10 @@ export type AnalysisResultUpdate = {
|
|
|
116
116
|
version: Scalars['Int']['output'];
|
|
117
117
|
virtualPresenceId: Scalars['ID']['output'];
|
|
118
118
|
};
|
|
119
|
+
export type AuthCodeInput = {
|
|
120
|
+
authCode: Scalars['String']['input'];
|
|
121
|
+
redirectUri?: InputMaybe<Scalars['String']['input']>;
|
|
122
|
+
};
|
|
119
123
|
export type CapabilitySignals = {
|
|
120
124
|
sellsPersonalInformation: SignalValue;
|
|
121
125
|
supportsAccountCreation: SignalValue;
|
|
@@ -139,8 +143,9 @@ export type CategorySignals = {
|
|
|
139
143
|
userCanOptOut: SignalValue;
|
|
140
144
|
};
|
|
141
145
|
export type ConnectVirtualPresenceInput = {
|
|
142
|
-
authCode?: InputMaybe<
|
|
146
|
+
authCode?: InputMaybe<AuthCodeInput>;
|
|
143
147
|
refreshToken?: InputMaybe<RefreshTokenInput>;
|
|
148
|
+
relationshipProvider?: InputMaybe<RelationshipProvider>;
|
|
144
149
|
};
|
|
145
150
|
export type DataCategory = 'ACCOUNT_PROFILE' | 'AUTHENTICATION' | 'BACKGROUND' | 'BIOMETRIC' | 'COMMUNICATION' | 'CONTACTS' | 'DEMOGRAPHIC' | 'DEVICE_IDENTIFIER' | 'FINANCIAL' | 'GOVERNMENT_ISSUED' | 'HEALTH' | 'INFERENCES' | 'LOCATION' | 'OTHER' | 'PII' | 'THIRD_PARTY_DATA' | 'USAGE' | '%future added value';
|
|
146
151
|
export type DataHolder = {
|
|
@@ -223,12 +228,20 @@ export type PrivacySummary = {
|
|
|
223
228
|
sourceLastUpdated?: Maybe<Scalars['String']['output']>;
|
|
224
229
|
sourceUrl: Scalars['String']['output'];
|
|
225
230
|
};
|
|
231
|
+
export type ProviderConfiguration = {
|
|
232
|
+
data: Scalars['ID']['output'];
|
|
233
|
+
};
|
|
226
234
|
export type ProviderType = 'EMAIL' | '%future added value';
|
|
227
235
|
export type Query = {
|
|
228
236
|
/** Get a full analysis result by ID, including typed data. */
|
|
229
237
|
getAnalysisResult?: Maybe<AnalysisResult>;
|
|
230
238
|
/** Get a single data holder by ID */
|
|
231
239
|
getDataHolder?: Maybe<DataHolder>;
|
|
240
|
+
/**
|
|
241
|
+
* Get the opaque provider configuration required by consumers to support
|
|
242
|
+
* the provider OAuth flow.
|
|
243
|
+
*/
|
|
244
|
+
getProviderConfiguration: ProviderConfiguration;
|
|
232
245
|
/** List analysis results for a virtual presence. */
|
|
233
246
|
listAnalysisResults: AnalysisResultConnection;
|
|
234
247
|
/** List data holders by virtual presence */
|
|
@@ -261,6 +274,7 @@ export type RefreshTokenInput = {
|
|
|
261
274
|
refreshToken: Scalars['String']['input'];
|
|
262
275
|
scopes?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
263
276
|
};
|
|
277
|
+
export type RelationshipProvider = 'GMAIL_PROVIDER' | 'TEST_PROVIDER' | '%future added value';
|
|
264
278
|
export type RetentionInfo = {
|
|
265
279
|
additionalInfo?: Maybe<Scalars['String']['output']>;
|
|
266
280
|
style: RetentionStyle;
|
|
@@ -323,6 +337,7 @@ export type VirtualPresence = {
|
|
|
323
337
|
lastScannedAtEpochMs: Scalars['Float']['output'];
|
|
324
338
|
owner: Scalars['ID']['output'];
|
|
325
339
|
providerType: ProviderType;
|
|
340
|
+
relationshipProvider?: Maybe<RelationshipProvider>;
|
|
326
341
|
state: VirtualPresenceState;
|
|
327
342
|
updatedAtEpochMs: Scalars['Float']['output'];
|
|
328
343
|
version: Scalars['Int']['output'];
|
|
@@ -472,6 +487,14 @@ export type RescanVirtualPresenceMutation = {
|
|
|
472
487
|
updatedAtEpochMs: number;
|
|
473
488
|
};
|
|
474
489
|
};
|
|
490
|
+
export type GetProviderConfigurationQueryVariables = Exact<{
|
|
491
|
+
[key: string]: never;
|
|
492
|
+
}>;
|
|
493
|
+
export type GetProviderConfigurationQuery = {
|
|
494
|
+
getProviderConfiguration: {
|
|
495
|
+
data: string;
|
|
496
|
+
};
|
|
497
|
+
};
|
|
475
498
|
export type ListVirtualPresencesQueryVariables = Exact<{
|
|
476
499
|
input?: InputMaybe<ListVirtualPresencesInput>;
|
|
477
500
|
}>;
|
|
@@ -740,6 +763,7 @@ export declare const VirtualPresenceFieldsFragmentDoc: DocumentNode<VirtualPrese
|
|
|
740
763
|
export declare const ConnectVirtualPresenceDocument: DocumentNode<ConnectVirtualPresenceMutation, ConnectVirtualPresenceMutationVariables>;
|
|
741
764
|
export declare const DisconnectVirtualPresenceDocument: DocumentNode<DisconnectVirtualPresenceMutation, DisconnectVirtualPresenceMutationVariables>;
|
|
742
765
|
export declare const RescanVirtualPresenceDocument: DocumentNode<RescanVirtualPresenceMutation, RescanVirtualPresenceMutationVariables>;
|
|
766
|
+
export declare const GetProviderConfigurationDocument: DocumentNode<GetProviderConfigurationQuery, GetProviderConfigurationQueryVariables>;
|
|
743
767
|
export declare const ListVirtualPresencesDocument: DocumentNode<ListVirtualPresencesQuery, ListVirtualPresencesQueryVariables>;
|
|
744
768
|
export declare const GetDataHolderDocument: DocumentNode<GetDataHolderQuery, GetDataHolderQueryVariables>;
|
|
745
769
|
export declare const ListDataHoldersDocument: DocumentNode<ListDataHoldersQuery, ListDataHoldersQueryVariables>;
|
|
@@ -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, ConnectVirtualPresenceInput, DataHolder, DataHolderConnection, ListVirtualPresencesInput, OnAnalysisResultUpdateSubscription, OnDataHoldersUpdateSubscription, OnVirtualPresenceUpdateSubscription, ScanOptionsInput, VirtualPresence, VirtualPresenceConnection } from '../../../gen/graphqlTypes';
|
|
8
|
+
import { AnalysisResult, AnalysisResultConnection, ConnectVirtualPresenceInput, DataHolder, DataHolderConnection, ProviderConfiguration, ListVirtualPresencesInput, 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;
|
|
@@ -16,6 +16,7 @@ export declare class ApiClient {
|
|
|
16
16
|
disconnectVirtualPresence(id: string): Promise<VirtualPresence>;
|
|
17
17
|
rescanVirtualPresence(id: string, options?: ScanOptionsInput): Promise<VirtualPresence>;
|
|
18
18
|
listVirtualPresences(input: ListVirtualPresencesInput): Promise<VirtualPresenceConnection>;
|
|
19
|
+
getProviderConfiguration(): Promise<ProviderConfiguration>;
|
|
19
20
|
getDataHolder(id: string): Promise<DataHolder | undefined>;
|
|
20
21
|
listDataHolders(input: {
|
|
21
22
|
virtualPresenceId: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ProviderConfigurationEntity } from '../../domain/entities/configuration/providerConfigurationEntity';
|
|
7
|
+
import { ProviderConfigurationService } from '../../domain/entities/configuration/providerConfigurationService';
|
|
8
|
+
import { ApiClient } from '../common/apiClient';
|
|
9
|
+
export declare class DefaultProviderConfigurationService implements ProviderConfigurationService {
|
|
10
|
+
private readonly appSync;
|
|
11
|
+
private readonly providerConfigurationTransformer;
|
|
12
|
+
constructor(appSync: ApiClient);
|
|
13
|
+
get(): Promise<ProviderConfigurationEntity[]>;
|
|
14
|
+
}
|
package/types/private/data/provider-configuration/transformer/providerConfigurationTransformer.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ProviderConfiguration } from '../../../../public/typings/providerConfiguration';
|
|
7
|
+
import { ProviderConfigurationEntity } from '../../../domain/entities/configuration/providerConfigurationEntity';
|
|
8
|
+
export declare class ProviderConfigurationTransformer {
|
|
9
|
+
private readonly providerTypeTransformer;
|
|
10
|
+
/**
|
|
11
|
+
* Decodes the opaque, base-64 encoded provider configuration data into a
|
|
12
|
+
* list of domain entities.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} data The base-64 encoded provider configuration data.
|
|
15
|
+
* @returns {ProviderConfigurationEntity[]} The decoded provider configurations.
|
|
16
|
+
*/
|
|
17
|
+
fromGraphQLToEntity(data: string): ProviderConfigurationEntity[];
|
|
18
|
+
fromEntityToAPI(entity: ProviderConfigurationEntity): ProviderConfiguration;
|
|
19
|
+
}
|
|
@@ -9,6 +9,7 @@ import { ApiClient } from '../common/apiClient';
|
|
|
9
9
|
export declare class DefaultVirtualPresenceService implements VirtualPresenceService {
|
|
10
10
|
private readonly appSync;
|
|
11
11
|
private readonly virtualPresenceTransformer;
|
|
12
|
+
private readonly relationshipProviderTransformer;
|
|
12
13
|
private readonly subscriptionManager;
|
|
13
14
|
constructor(appSync: ApiClient);
|
|
14
15
|
connect(input: ConnectVirtualPresenceInput): Promise<VirtualPresenceEntity>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { RelationshipProvider as RelationshipProviderGraphQL } from '../../../../gen/graphqlTypes';
|
|
7
|
+
import { RelationshipProvider } from '../../../../public/inputs/virtualPresence';
|
|
8
|
+
import { RelationshipProviderEntity } from '../../../domain/entities/inputs/relationshipProviderEntity';
|
|
9
|
+
export declare class RelationshipProviderTransformer {
|
|
10
|
+
fromEntityToGraphQL(entity: RelationshipProviderEntity): RelationshipProviderGraphQL;
|
|
11
|
+
fromAPIToEntity(data: RelationshipProvider): RelationshipProviderEntity;
|
|
12
|
+
}
|
|
@@ -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 { ProviderTypeEntity } from '../virtual-presence/virtualPresenceEntity';
|
|
7
|
+
/**
|
|
8
|
+
* Core entity representation of a provider 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 ProviderConfigurationEntity
|
|
15
|
+
* @property {string} name Human-readable provider name (e.g. 'google').
|
|
16
|
+
* @property {ProviderTypeEntity} providerType The kind of virtual presence this provider backs (e.g. EMAIL).
|
|
17
|
+
* @property {string} clientId OAuth client id.
|
|
18
|
+
*/
|
|
19
|
+
export interface ProviderConfigurationEntity {
|
|
20
|
+
name: string;
|
|
21
|
+
providerType: ProviderTypeEntity;
|
|
22
|
+
clientId: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ProviderConfigurationEntity } from './providerConfigurationEntity';
|
|
7
|
+
/**
|
|
8
|
+
* Core entity representation of a configuration service used in business logic.
|
|
9
|
+
* Used to retrieve service configuration.
|
|
10
|
+
*
|
|
11
|
+
* @interface ProviderConfigurationService
|
|
12
|
+
*/
|
|
13
|
+
export interface ProviderConfigurationService {
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve the provider configurations required by consumers to support
|
|
16
|
+
* the provider OAuth flow.
|
|
17
|
+
*
|
|
18
|
+
* @returns {ProviderConfigurationEntity[]} The decoded provider configurations.
|
|
19
|
+
*/
|
|
20
|
+
get(): Promise<ProviderConfigurationEntity[]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Enumeration of the relationship providers that back a virtual presence connection.
|
|
8
|
+
*
|
|
9
|
+
* @property GMAIL_PROVIDER The Gmail relationship provider.
|
|
10
|
+
* @property TEST_PROVIDER The test relationship provider.
|
|
11
|
+
*
|
|
12
|
+
* @enum
|
|
13
|
+
*/
|
|
14
|
+
export declare enum RelationshipProviderEntity {
|
|
15
|
+
GmailProvider = "GMAIL_PROVIDER",
|
|
16
|
+
TestProvider = "TEST_PROVIDER"
|
|
17
|
+
}
|
|
@@ -4,8 +4,20 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { VirtualPresenceSubscriber } from '../../../../public/typings/subscription';
|
|
7
|
+
import { RelationshipProviderEntity } from '../inputs/relationshipProviderEntity';
|
|
7
8
|
import { ScanOptionsEntity } from '../inputs/scanOptionsEntity';
|
|
8
9
|
import { VirtualPresenceEntity } from './virtualPresenceEntity';
|
|
10
|
+
/**
|
|
11
|
+
* Auth code input for connecting a virtual presence.
|
|
12
|
+
*
|
|
13
|
+
* @interface AuthCodeInput
|
|
14
|
+
* @property {string} authCode The auth code value.
|
|
15
|
+
* @property {string} redirectUri The optional redirect URI value.
|
|
16
|
+
*/
|
|
17
|
+
export interface AuthCodeInput {
|
|
18
|
+
authCode: string;
|
|
19
|
+
redirectUri?: string;
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* Refresh token credential input for connecting a virtual presence.
|
|
11
23
|
*
|
|
@@ -25,12 +37,15 @@ export interface RefreshTokenInput {
|
|
|
25
37
|
* Input for `VirtualPresenceService.connect` method.
|
|
26
38
|
*
|
|
27
39
|
* @interface ConnectVirtualPresenceInput
|
|
28
|
-
* @property {
|
|
40
|
+
* @property {AuthCodeInput} authCode An authorization code obtained from the OAuth flow.
|
|
29
41
|
* @property {RefreshTokenInput} refreshToken A pre-obtained refresh token credential.
|
|
42
|
+
* @property {RelationshipProviderEntity} relationshipProvider The relationship provider
|
|
43
|
+
* to associate with the connection.
|
|
30
44
|
*/
|
|
31
45
|
export interface ConnectVirtualPresenceInput {
|
|
32
|
-
authCode?:
|
|
46
|
+
authCode?: AuthCodeInput;
|
|
33
47
|
refreshToken?: RefreshTokenInput;
|
|
48
|
+
relationshipProvider?: RelationshipProviderEntity;
|
|
34
49
|
}
|
|
35
50
|
/**
|
|
36
51
|
* Input for `VirtualPresenceService.list` method.
|
|
@@ -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 { ProviderConfigurationEntity } from '../../entities/configuration/providerConfigurationEntity';
|
|
7
|
+
import { ProviderConfigurationService } from '../../entities/configuration/providerConfigurationService';
|
|
8
|
+
/**
|
|
9
|
+
* Application business logic for retrieving the provider configuration.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GetProviderConfigurationUseCase {
|
|
12
|
+
private readonly providerConfigurationService;
|
|
13
|
+
private readonly log;
|
|
14
|
+
constructor(providerConfigurationService: ProviderConfigurationService);
|
|
15
|
+
execute(): Promise<ProviderConfigurationEntity[]>;
|
|
16
|
+
}
|
|
@@ -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(
|
|
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
|
-
|
|
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 {
|
|
21
|
+
* @param {ConnectVirtualPresenceWithAuthCodeInput} input The authorization code input.
|
|
15
22
|
* @returns {VirtualPresence} The connected virtual presence.
|
|
16
23
|
*/
|
|
17
|
-
connectVirtualPresenceWithAuthCode(
|
|
24
|
+
connectVirtualPresenceWithAuthCode(input: ConnectVirtualPresenceWithAuthCodeInput): Promise<VirtualPresence>;
|
|
18
25
|
/**
|
|
19
26
|
* Connect a virtual presence using a pre-obtained refresh token credential.
|
|
20
27
|
*
|
|
@@ -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
|
+
}
|