@sudoplatform/sudo-privacy-interaction 1.1.0 → 2.1.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 +1750 -770
- package/cjs/private/data/analysis-result/transformer/privacyScoreTransformer.js +8 -0
- package/cjs/private/data/common/apiClient.js +31 -0
- package/cjs/private/data/data-holder/defaultDataHolderService.js +12 -0
- package/cjs/private/data/data-holder/transformer/dataHolderScanSummaryTransformer.js +56 -0
- package/cjs/private/data/organization-analysis/defaultOrganizationAnalysisService.js +31 -0
- package/cjs/private/data/organization-analysis/transformer/organizationAnalysisModeTransformer.js +29 -0
- package/cjs/private/data/organization-analysis/transformer/organizationAnalysisTransformer.js +45 -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/data/virtual-presence/transformer/virtualPresenceTransformer.js +2 -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/entities/organization-analysis/organizationAnalysisEntity.js +24 -0
- package/cjs/private/domain/entities/organization-analysis/organizationAnalysisService.js +7 -0
- package/cjs/private/domain/use-cases/configuration/getProviderConfigurationUseCase.js +25 -0
- package/cjs/private/domain/use-cases/data-holder/listDataHolderScanSummariesUseCase.js +29 -0
- package/cjs/private/domain/use-cases/organization-analysis/getOrganizationAnalysisUseCase.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 +109 -9
- package/cjs/public/inputs/index.js +1 -0
- package/cjs/public/inputs/organizationAnalysis.js +7 -0
- package/cjs/public/inputs/virtualPresence.js +14 -0
- package/cjs/public/typings/index.js +2 -0
- package/cjs/public/typings/organizationAnalysis.js +24 -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 +86 -22
- package/docs/enums/DataCategory.html +18 -18
- package/docs/enums/DataHolderProtectionState.html +5 -5
- package/docs/enums/OrganizationAnalysisMode.html +70 -0
- package/docs/enums/OrganizationCategory.html +30 -30
- package/docs/enums/ProviderType.html +3 -3
- package/docs/enums/RelationshipProvider.html +63 -0
- package/docs/enums/RetentionStyle.html +5 -5
- package/docs/enums/ShareStyle.html +6 -6
- package/docs/enums/SignalValue.html +4 -4
- package/docs/enums/VirtualPresenceState.html +7 -7
- package/docs/hierarchy.html +6 -5
- package/docs/interfaces/CapabilitySignals.html +9 -9
- package/docs/interfaces/CategorySignals.html +11 -11
- package/docs/interfaces/ConnectVirtualPresenceWithAuthCodeInput.html +79 -0
- package/docs/interfaces/ConnectVirtualPresenceWithRefreshTokenInput.html +16 -7
- package/docs/interfaces/DataHolder.html +24 -14
- package/docs/interfaces/DataHolderScanSummary.html +158 -0
- package/docs/interfaces/GetDataHolderOptions.html +63 -0
- package/docs/interfaces/GetOrganizationAnalysisInput.html +70 -0
- package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
- package/docs/interfaces/ListDataHolderScanSummariesInput.html +85 -0
- package/docs/interfaces/ListDataHoldersInput.html +1 -1
- package/docs/interfaces/ListVirtualPresencesInput.html +2 -2
- package/docs/interfaces/OrganizationAnalysis.html +131 -0
- package/docs/interfaces/OrganizationIdentity.html +5 -5
- package/docs/interfaces/Pagination.html +2 -1
- package/docs/interfaces/PrivacyScore.html +13 -5
- package/docs/interfaces/PrivacySummary.html +4 -4
- package/docs/interfaces/ProviderConfiguration.html +80 -0
- package/docs/interfaces/RescanVirtualPresenceInput.html +3 -3
- package/docs/interfaces/RetentionInfo.html +4 -4
- package/docs/interfaces/RiskIndicators.html +8 -8
- package/docs/interfaces/ScanOptions.html +6 -6
- package/docs/interfaces/ScoreContribution.html +3 -3
- package/docs/interfaces/ScoreCoverage.html +70 -0
- package/docs/interfaces/SudoPrivacyInteractionClient.html +83 -22
- package/docs/interfaces/VirtualPresence.html +21 -12
- package/docs/modules.html +4 -4
- package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
- package/lib/gen/graphqlTypes.js +1749 -769
- package/lib/private/data/analysis-result/transformer/privacyScoreTransformer.js +8 -0
- package/lib/private/data/common/apiClient.js +32 -1
- package/lib/private/data/data-holder/defaultDataHolderService.js +12 -0
- package/lib/private/data/data-holder/transformer/dataHolderScanSummaryTransformer.js +52 -0
- package/lib/private/data/organization-analysis/defaultOrganizationAnalysisService.js +27 -0
- package/lib/private/data/organization-analysis/transformer/organizationAnalysisModeTransformer.js +25 -0
- package/lib/private/data/organization-analysis/transformer/organizationAnalysisTransformer.js +41 -0
- 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/data/virtual-presence/transformer/virtualPresenceTransformer.js +2 -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/entities/organization-analysis/organizationAnalysisEntity.js +21 -0
- package/lib/private/domain/entities/organization-analysis/organizationAnalysisService.js +6 -0
- package/lib/private/domain/use-cases/configuration/getProviderConfigurationUseCase.js +21 -0
- package/lib/private/domain/use-cases/data-holder/listDataHolderScanSummariesUseCase.js +25 -0
- package/lib/private/domain/use-cases/organization-analysis/getOrganizationAnalysisUseCase.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 +109 -9
- package/lib/public/inputs/index.js +1 -0
- package/lib/public/inputs/organizationAnalysis.js +6 -0
- package/lib/public/inputs/virtualPresence.js +13 -1
- package/lib/public/typings/index.js +2 -0
- package/lib/public/typings/organizationAnalysis.js +21 -0
- package/lib/public/typings/providerConfiguration.js +6 -0
- package/package.json +9 -5
- package/types/gen/graphqlTypes.d.ts +349 -1
- package/types/private/data/common/apiClient.d.ts +11 -1
- package/types/private/data/common/baseSubscriptionManager.d.ts +5 -0
- package/types/private/data/data-holder/defaultDataHolderService.d.ts +3 -1
- package/types/private/data/data-holder/transformer/dataHolderScanSummaryTransformer.d.ts +18 -0
- package/types/private/data/organization-analysis/defaultOrganizationAnalysisService.d.ts +15 -0
- package/types/private/data/organization-analysis/transformer/organizationAnalysisModeTransformer.d.ts +12 -0
- package/types/private/data/organization-analysis/transformer/organizationAnalysisTransformer.d.ts +14 -0
- 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/analysis-result/analysisResultEntity.d.ts +14 -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/data-holder/dataHolderEntity.d.ts +34 -0
- package/types/private/domain/entities/data-holder/dataHolderService.d.ts +35 -1
- package/types/private/domain/entities/inputs/relationshipProviderEntity.d.ts +17 -0
- package/types/private/domain/entities/organization-analysis/organizationAnalysisEntity.d.ts +53 -0
- package/types/private/domain/entities/organization-analysis/organizationAnalysisService.d.ts +35 -0
- package/types/private/domain/entities/virtual-presence/virtualPresenceEntity.d.ts +3 -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/data-holder/listDataHolderScanSummariesUseCase.d.ts +36 -0
- package/types/private/domain/use-cases/organization-analysis/getOrganizationAnalysisUseCase.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 +14 -4
- package/types/public/inputs/dataHolder.d.ts +22 -0
- package/types/public/inputs/index.d.ts +1 -0
- package/types/public/inputs/organizationAnalysis.d.ts +18 -0
- package/types/public/inputs/virtualPresence.d.ts +30 -0
- package/types/public/sudoPrivacyInteractionClient.d.ts +34 -5
- package/types/public/typings/analysisResult.d.ts +14 -0
- package/types/public/typings/dataHolder.d.ts +38 -0
- package/types/public/typings/index.d.ts +2 -0
- package/types/public/typings/organizationAnalysis.d.ts +53 -0
- package/types/public/typings/providerConfiguration.d.ts +23 -0
- package/types/public/typings/virtualPresence.d.ts +3 -0
|
@@ -14,6 +14,10 @@ class PrivacyScoreTransformer {
|
|
|
14
14
|
aspect: b.aspect,
|
|
15
15
|
contribution: b.contribution,
|
|
16
16
|
})),
|
|
17
|
+
coverage: {
|
|
18
|
+
evaluated: data.coverage.evaluated,
|
|
19
|
+
total: data.coverage.total,
|
|
20
|
+
},
|
|
17
21
|
};
|
|
18
22
|
}
|
|
19
23
|
fromEntityToAPI(entity) {
|
|
@@ -23,6 +27,10 @@ class PrivacyScoreTransformer {
|
|
|
23
27
|
aspect: b.aspect,
|
|
24
28
|
contribution: b.contribution,
|
|
25
29
|
})),
|
|
30
|
+
coverage: {
|
|
31
|
+
evaluated: entity.coverage.evaluated,
|
|
32
|
+
total: entity.coverage.total,
|
|
33
|
+
},
|
|
26
34
|
};
|
|
27
35
|
}
|
|
28
36
|
}
|
|
@@ -54,6 +54,14 @@ class ApiClient {
|
|
|
54
54
|
});
|
|
55
55
|
return data.listVirtualPresences;
|
|
56
56
|
}
|
|
57
|
+
async getProviderConfiguration() {
|
|
58
|
+
const data = await this.performQuery({
|
|
59
|
+
query: graphqlTypes_1.GetProviderConfigurationDocument,
|
|
60
|
+
variables: {},
|
|
61
|
+
calleeName: this.getProviderConfiguration.name,
|
|
62
|
+
});
|
|
63
|
+
return data.getProviderConfiguration;
|
|
64
|
+
}
|
|
57
65
|
async getDataHolder(id) {
|
|
58
66
|
const data = await this.performQuery({
|
|
59
67
|
query: graphqlTypes_1.GetDataHolderDocument,
|
|
@@ -74,6 +82,18 @@ class ApiClient {
|
|
|
74
82
|
});
|
|
75
83
|
return data.listDataHolders;
|
|
76
84
|
}
|
|
85
|
+
async listDataHolderScanSummaries(input) {
|
|
86
|
+
const data = await this.performQuery({
|
|
87
|
+
query: graphqlTypes_1.ListDataHolderScanSummariesDocument,
|
|
88
|
+
variables: {
|
|
89
|
+
dataHolderId: input.dataHolderId,
|
|
90
|
+
limit: input.limit,
|
|
91
|
+
nextToken: input.nextToken,
|
|
92
|
+
},
|
|
93
|
+
calleeName: this.listDataHolderScanSummaries.name,
|
|
94
|
+
});
|
|
95
|
+
return data.listDataHolderScanSummaries;
|
|
96
|
+
}
|
|
77
97
|
async getAnalysisResult(id) {
|
|
78
98
|
const data = await this.performQuery({
|
|
79
99
|
query: graphqlTypes_1.GetAnalysisResultDocument,
|
|
@@ -82,6 +102,17 @@ class ApiClient {
|
|
|
82
102
|
});
|
|
83
103
|
return data.getAnalysisResult ?? undefined;
|
|
84
104
|
}
|
|
105
|
+
async getOrganizationAnalysis(input) {
|
|
106
|
+
const data = await this.performQuery({
|
|
107
|
+
query: graphqlTypes_1.GetOrganizationAnalysisDocument,
|
|
108
|
+
variables: {
|
|
109
|
+
domain: input.domain,
|
|
110
|
+
mode: input.mode,
|
|
111
|
+
},
|
|
112
|
+
calleeName: this.getOrganizationAnalysis.name,
|
|
113
|
+
});
|
|
114
|
+
return data.getOrganizationAnalysis ?? undefined;
|
|
115
|
+
}
|
|
85
116
|
async listAnalysisResults(input) {
|
|
86
117
|
const data = await this.performQuery({
|
|
87
118
|
query: graphqlTypes_1.ListAnalysisResultsDocument,
|
|
@@ -8,14 +8,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.DefaultDataHolderService = void 0;
|
|
9
9
|
const subscription_1 = require("../../../public/typings/subscription");
|
|
10
10
|
const dataHolderSubscriptionManager_1 = require("./dataHolderSubscriptionManager");
|
|
11
|
+
const dataHolderScanSummaryTransformer_1 = require("./transformer/dataHolderScanSummaryTransformer");
|
|
11
12
|
const dataHolderTransformer_1 = require("./transformer/dataHolderTransformer");
|
|
12
13
|
class DefaultDataHolderService {
|
|
13
14
|
appSync;
|
|
14
15
|
dataHolderTransformer;
|
|
16
|
+
dataHolderScanSummaryTransformer;
|
|
15
17
|
subscriptionManager;
|
|
16
18
|
constructor(appSync) {
|
|
17
19
|
this.appSync = appSync;
|
|
18
20
|
this.dataHolderTransformer = new dataHolderTransformer_1.DataHolderTransformer();
|
|
21
|
+
this.dataHolderScanSummaryTransformer =
|
|
22
|
+
new dataHolderScanSummaryTransformer_1.DataHolderScanSummaryTransformer();
|
|
19
23
|
this.subscriptionManager = new dataHolderSubscriptionManager_1.DataHolderSubscriptionManager();
|
|
20
24
|
}
|
|
21
25
|
async get(id) {
|
|
@@ -36,6 +40,14 @@ class DefaultDataHolderService {
|
|
|
36
40
|
nextToken: result.nextToken ?? undefined,
|
|
37
41
|
};
|
|
38
42
|
}
|
|
43
|
+
async listScanSummaries(input) {
|
|
44
|
+
const result = await this.appSync.listDataHolderScanSummaries(input);
|
|
45
|
+
const scanSummaries = (result.items ?? []).map((item) => this.dataHolderScanSummaryTransformer.fromGraphQLToEntity(item));
|
|
46
|
+
return {
|
|
47
|
+
scanSummaries,
|
|
48
|
+
nextToken: result.nextToken ?? undefined,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
39
51
|
async subscribe(input) {
|
|
40
52
|
this.subscriptionManager.subscribe(input.subscriptionId, input.subscriber);
|
|
41
53
|
if (!this.subscriptionManager.getWatcher()) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.DataHolderScanSummaryTransformer = void 0;
|
|
9
|
+
class DataHolderScanSummaryTransformer {
|
|
10
|
+
fromGraphQLToEntity(data) {
|
|
11
|
+
return {
|
|
12
|
+
dataHolderId: data.dataHolderId,
|
|
13
|
+
owner: data.owner,
|
|
14
|
+
scannedAt: new Date(data.scannedAtEpochMs),
|
|
15
|
+
scanRangeFrom: new Date(data.scanRangeFromEpochMs),
|
|
16
|
+
scanRangeTo: new Date(data.scanRangeToEpochMs),
|
|
17
|
+
emailCount: data.emailCount,
|
|
18
|
+
readCount: data.readCount,
|
|
19
|
+
readRate: data.readRate,
|
|
20
|
+
marketingEmailCount: data.marketingEmailCount,
|
|
21
|
+
marketingEmailOpened: data.marketingEmailOpened,
|
|
22
|
+
marketingOpenRate: data.marketingOpenRate,
|
|
23
|
+
categoryBreakdown: this.parseCategoryBreakdown(data.categoryBreakdown),
|
|
24
|
+
uncategorizedCount: data.uncategorizedCount,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
fromEntityToAPI(entity) {
|
|
28
|
+
return {
|
|
29
|
+
dataHolderId: entity.dataHolderId,
|
|
30
|
+
owner: entity.owner,
|
|
31
|
+
scannedAt: entity.scannedAt,
|
|
32
|
+
scanRangeFrom: entity.scanRangeFrom,
|
|
33
|
+
scanRangeTo: entity.scanRangeTo,
|
|
34
|
+
emailCount: entity.emailCount,
|
|
35
|
+
readCount: entity.readCount,
|
|
36
|
+
readRate: entity.readRate,
|
|
37
|
+
marketingEmailCount: entity.marketingEmailCount,
|
|
38
|
+
marketingEmailOpened: entity.marketingEmailOpened,
|
|
39
|
+
marketingOpenRate: entity.marketingOpenRate,
|
|
40
|
+
categoryBreakdown: { ...entity.categoryBreakdown },
|
|
41
|
+
uncategorizedCount: entity.uncategorizedCount,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The `categoryBreakdown` field is an AWSJSON scalar, which is delivered as a
|
|
46
|
+
* JSON-encoded string. Parse it into a category-to-count map. Accepts an
|
|
47
|
+
* already-parsed object for resilience.
|
|
48
|
+
*/
|
|
49
|
+
parseCategoryBreakdown(value) {
|
|
50
|
+
if (typeof value === 'string') {
|
|
51
|
+
return JSON.parse(value);
|
|
52
|
+
}
|
|
53
|
+
return value ?? {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.DataHolderScanSummaryTransformer = DataHolderScanSummaryTransformer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.DefaultOrganizationAnalysisService = void 0;
|
|
9
|
+
const organizationAnalysisModeTransformer_1 = require("./transformer/organizationAnalysisModeTransformer");
|
|
10
|
+
const organizationAnalysisTransformer_1 = require("./transformer/organizationAnalysisTransformer");
|
|
11
|
+
class DefaultOrganizationAnalysisService {
|
|
12
|
+
appSync;
|
|
13
|
+
organizationAnalysisTransformer = new organizationAnalysisTransformer_1.OrganizationAnalysisTransformer();
|
|
14
|
+
modeTransformer = new organizationAnalysisModeTransformer_1.OrganizationAnalysisModeTransformer();
|
|
15
|
+
constructor(appSync) {
|
|
16
|
+
this.appSync = appSync;
|
|
17
|
+
}
|
|
18
|
+
async getOrganizationAnalysis(input) {
|
|
19
|
+
const result = await this.appSync.getOrganizationAnalysis({
|
|
20
|
+
domain: input.domain,
|
|
21
|
+
mode: input.mode
|
|
22
|
+
? this.modeTransformer.fromEntityToGraphQL(input.mode)
|
|
23
|
+
: undefined,
|
|
24
|
+
});
|
|
25
|
+
if (!result) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return this.organizationAnalysisTransformer.fromGraphQLToEntity(result);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.DefaultOrganizationAnalysisService = DefaultOrganizationAnalysisService;
|
package/cjs/private/data/organization-analysis/transformer/organizationAnalysisModeTransformer.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.OrganizationAnalysisModeTransformer = void 0;
|
|
9
|
+
const organizationAnalysis_1 = require("../../../../public/typings/organizationAnalysis");
|
|
10
|
+
const organizationAnalysisEntity_1 = require("../../../domain/entities/organization-analysis/organizationAnalysisEntity");
|
|
11
|
+
class OrganizationAnalysisModeTransformer {
|
|
12
|
+
fromAPIToEntity(mode) {
|
|
13
|
+
switch (mode) {
|
|
14
|
+
case organizationAnalysis_1.OrganizationAnalysisMode.Analyze:
|
|
15
|
+
return organizationAnalysisEntity_1.OrganizationAnalysisModeEntity.Analyze;
|
|
16
|
+
case organizationAnalysis_1.OrganizationAnalysisMode.Fetch:
|
|
17
|
+
return organizationAnalysisEntity_1.OrganizationAnalysisModeEntity.Fetch;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
fromEntityToGraphQL(mode) {
|
|
21
|
+
switch (mode) {
|
|
22
|
+
case organizationAnalysisEntity_1.OrganizationAnalysisModeEntity.Analyze:
|
|
23
|
+
return 'ANALYZE';
|
|
24
|
+
case organizationAnalysisEntity_1.OrganizationAnalysisModeEntity.Fetch:
|
|
25
|
+
return 'FETCH';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.OrganizationAnalysisModeTransformer = OrganizationAnalysisModeTransformer;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.OrganizationAnalysisTransformer = void 0;
|
|
9
|
+
const analysisResultDataTransformer_1 = require("../../analysis-result/transformer/analysisResultDataTransformer");
|
|
10
|
+
const analysisResultStatusTransformer_1 = require("../../analysis-result/transformer/analysisResultStatusTransformer");
|
|
11
|
+
class OrganizationAnalysisTransformer {
|
|
12
|
+
statusTransformer = new analysisResultStatusTransformer_1.AnalysisResultStatusTransformer();
|
|
13
|
+
dataTransformer = new analysisResultDataTransformer_1.AnalysisResultDataTransformer();
|
|
14
|
+
fromGraphQLToEntity(data) {
|
|
15
|
+
return {
|
|
16
|
+
id: data.id,
|
|
17
|
+
domain: data.domain,
|
|
18
|
+
status: this.statusTransformer.fromGraphQLToEntity(data.status),
|
|
19
|
+
lastAnalyzedAt: new Date(data.lastAnalyzedAtEpochMs),
|
|
20
|
+
data: data.data
|
|
21
|
+
? this.dataTransformer.fromGraphQLToEntity(data.data)
|
|
22
|
+
: undefined,
|
|
23
|
+
owner: data.owner,
|
|
24
|
+
version: data.version,
|
|
25
|
+
createdAt: new Date(data.createdAtEpochMs),
|
|
26
|
+
updatedAt: new Date(data.updatedAtEpochMs),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
fromEntityToAPI(entity) {
|
|
30
|
+
return {
|
|
31
|
+
id: entity.id,
|
|
32
|
+
domain: entity.domain,
|
|
33
|
+
status: this.statusTransformer.fromEntityToAPI(entity.status),
|
|
34
|
+
lastAnalyzedAt: entity.lastAnalyzedAt,
|
|
35
|
+
data: entity.data
|
|
36
|
+
? this.dataTransformer.fromEntityToAPI(entity.data)
|
|
37
|
+
: undefined,
|
|
38
|
+
owner: entity.owner,
|
|
39
|
+
version: entity.version,
|
|
40
|
+
createdAt: entity.createdAt,
|
|
41
|
+
updatedAt: entity.updatedAt,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.OrganizationAnalysisTransformer = OrganizationAnalysisTransformer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.DefaultProviderConfigurationService = void 0;
|
|
9
|
+
const providerConfigurationTransformer_1 = require("./transformer/providerConfigurationTransformer");
|
|
10
|
+
class DefaultProviderConfigurationService {
|
|
11
|
+
appSync;
|
|
12
|
+
providerConfigurationTransformer;
|
|
13
|
+
constructor(appSync) {
|
|
14
|
+
this.appSync = appSync;
|
|
15
|
+
this.providerConfigurationTransformer =
|
|
16
|
+
new providerConfigurationTransformer_1.ProviderConfigurationTransformer();
|
|
17
|
+
}
|
|
18
|
+
async get() {
|
|
19
|
+
const result = await this.appSync.getProviderConfiguration();
|
|
20
|
+
return this.providerConfigurationTransformer.fromGraphQLToEntity(result.data);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.DefaultProviderConfigurationService = DefaultProviderConfigurationService;
|
package/cjs/private/data/provider-configuration/transformer/providerConfigurationTransformer.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ProviderConfigurationTransformer = void 0;
|
|
9
|
+
const sudo_common_1 = require("@sudoplatform/sudo-common");
|
|
10
|
+
const providerTypeTransformer_1 = require("../../virtual-presence/transformer/providerTypeTransformer");
|
|
11
|
+
class ProviderConfigurationTransformer {
|
|
12
|
+
providerTypeTransformer = new providerTypeTransformer_1.ProviderTypeTransformer();
|
|
13
|
+
/**
|
|
14
|
+
* Decodes the opaque, base-64 encoded provider configuration data into a
|
|
15
|
+
* list of domain entities.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} data The base-64 encoded provider configuration data.
|
|
18
|
+
* @returns {ProviderConfigurationEntity[]} The decoded provider configurations.
|
|
19
|
+
*/
|
|
20
|
+
fromGraphQLToEntity(data) {
|
|
21
|
+
const msg = 'provider configuration cannot be decoded';
|
|
22
|
+
let decodedString;
|
|
23
|
+
try {
|
|
24
|
+
decodedString = sudo_common_1.Base64.decodeString(data);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
const error = err;
|
|
28
|
+
throw new sudo_common_1.FatalError(`${msg}: Base64 decoding failed: ${error.message}`);
|
|
29
|
+
}
|
|
30
|
+
let decodedObject;
|
|
31
|
+
try {
|
|
32
|
+
decodedObject = JSON.parse(decodedString);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
const error = err;
|
|
36
|
+
throw new sudo_common_1.FatalError(`${msg}: JSON parsing failed: ${error.message}`);
|
|
37
|
+
}
|
|
38
|
+
return decodedObject.providers.map((provider) => ({
|
|
39
|
+
name: provider.name,
|
|
40
|
+
providerType: this.providerTypeTransformer.fromGraphQLToEntity(provider.providerType),
|
|
41
|
+
clientId: provider.clientId,
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
fromEntityToAPI(entity) {
|
|
45
|
+
return {
|
|
46
|
+
name: entity.name,
|
|
47
|
+
providerType: this.providerTypeTransformer.fromEntityToAPI(entity.providerType),
|
|
48
|
+
clientId: entity.clientId,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.ProviderConfigurationTransformer = ProviderConfigurationTransformer;
|
|
@@ -7,19 +7,29 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.DefaultVirtualPresenceService = void 0;
|
|
9
9
|
const subscription_1 = require("../../../public/typings/subscription");
|
|
10
|
+
const relationshipProviderTransformer_1 = require("./transformer/relationshipProviderTransformer");
|
|
10
11
|
const virtualPresenceTransformer_1 = require("./transformer/virtualPresenceTransformer");
|
|
11
12
|
const virtualPresenceSubscriptionManager_1 = require("./virtualPresenceSubscriptionManager");
|
|
12
13
|
class DefaultVirtualPresenceService {
|
|
13
14
|
appSync;
|
|
14
15
|
virtualPresenceTransformer;
|
|
16
|
+
relationshipProviderTransformer;
|
|
15
17
|
subscriptionManager;
|
|
16
18
|
constructor(appSync) {
|
|
17
19
|
this.appSync = appSync;
|
|
18
20
|
this.virtualPresenceTransformer = new virtualPresenceTransformer_1.VirtualPresenceTransformer();
|
|
21
|
+
this.relationshipProviderTransformer = new relationshipProviderTransformer_1.RelationshipProviderTransformer();
|
|
19
22
|
this.subscriptionManager = new virtualPresenceSubscriptionManager_1.VirtualPresenceSubscriptionManager();
|
|
20
23
|
}
|
|
21
24
|
async connect(input) {
|
|
22
|
-
const
|
|
25
|
+
const graphQLInput = {
|
|
26
|
+
authCode: input.authCode,
|
|
27
|
+
refreshToken: input.refreshToken,
|
|
28
|
+
relationshipProvider: input.relationshipProvider
|
|
29
|
+
? this.relationshipProviderTransformer.fromEntityToGraphQL(input.relationshipProvider)
|
|
30
|
+
: undefined,
|
|
31
|
+
};
|
|
32
|
+
const result = await this.appSync.connectVirtualPresence(graphQLInput);
|
|
23
33
|
return this.virtualPresenceTransformer.fromGraphQLToEntity(result);
|
|
24
34
|
}
|
|
25
35
|
async list(input) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.RelationshipProviderTransformer = void 0;
|
|
9
|
+
const virtualPresence_1 = require("../../../../public/inputs/virtualPresence");
|
|
10
|
+
const relationshipProviderEntity_1 = require("../../../domain/entities/inputs/relationshipProviderEntity");
|
|
11
|
+
class RelationshipProviderTransformer {
|
|
12
|
+
fromEntityToGraphQL(entity) {
|
|
13
|
+
switch (entity) {
|
|
14
|
+
case relationshipProviderEntity_1.RelationshipProviderEntity.GmailProvider:
|
|
15
|
+
return 'GMAIL_PROVIDER';
|
|
16
|
+
case relationshipProviderEntity_1.RelationshipProviderEntity.TestProvider:
|
|
17
|
+
return 'TEST_PROVIDER';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
fromAPIToEntity(data) {
|
|
21
|
+
switch (data) {
|
|
22
|
+
case virtualPresence_1.RelationshipProvider.GmailProvider:
|
|
23
|
+
return relationshipProviderEntity_1.RelationshipProviderEntity.GmailProvider;
|
|
24
|
+
case virtualPresence_1.RelationshipProvider.TestProvider:
|
|
25
|
+
return relationshipProviderEntity_1.RelationshipProviderEntity.TestProvider;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.RelationshipProviderTransformer = RelationshipProviderTransformer;
|
|
@@ -20,6 +20,7 @@ class VirtualPresenceTransformer {
|
|
|
20
20
|
identifier: entity.identifier,
|
|
21
21
|
state: virtualPresenceStateTransformer.fromEntityToAPI(entity.state),
|
|
22
22
|
lastScannedAt: entity.lastScannedAt,
|
|
23
|
+
lastScanFailureReason: entity.lastScanFailureReason,
|
|
23
24
|
createdAt: entity.createdAt,
|
|
24
25
|
updatedAt: entity.updatedAt,
|
|
25
26
|
};
|
|
@@ -35,6 +36,7 @@ class VirtualPresenceTransformer {
|
|
|
35
36
|
identifier: data.identifier,
|
|
36
37
|
state: virtualPresenceStateTransformer.fromGraphQLToEntity(data.state),
|
|
37
38
|
lastScannedAt: new Date(data.lastScannedAtEpochMs),
|
|
39
|
+
lastScanFailureReason: data.lastScanFailureReason ?? undefined,
|
|
38
40
|
createdAt: new Date(data.createdAtEpochMs),
|
|
39
41
|
updatedAt: new Date(data.updatedAtEpochMs),
|
|
40
42
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.RelationshipProviderEntity = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Enumeration of the relationship providers that back a virtual presence connection.
|
|
11
|
+
*
|
|
12
|
+
* @property GMAIL_PROVIDER The Gmail relationship provider.
|
|
13
|
+
* @property TEST_PROVIDER The test relationship provider.
|
|
14
|
+
*
|
|
15
|
+
* @enum
|
|
16
|
+
*/
|
|
17
|
+
var RelationshipProviderEntity;
|
|
18
|
+
(function (RelationshipProviderEntity) {
|
|
19
|
+
RelationshipProviderEntity["GmailProvider"] = "GMAIL_PROVIDER";
|
|
20
|
+
RelationshipProviderEntity["TestProvider"] = "TEST_PROVIDER";
|
|
21
|
+
})(RelationshipProviderEntity || (exports.RelationshipProviderEntity = RelationshipProviderEntity = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.OrganizationAnalysisModeEntity = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Controls how `getOrganizationAnalysis` obtains source results when the stored
|
|
11
|
+
* analysis is stale or absent.
|
|
12
|
+
*
|
|
13
|
+
* @property ANALYZE Read-through: request analysis from the sources, which may compute and
|
|
14
|
+
* leave the result PENDING until asynchronous work completes.
|
|
15
|
+
* @property FETCH Pull only the sources' existing values; never request new work. A stale
|
|
16
|
+
* domain with no existing source value is not moved to PENDING.
|
|
17
|
+
*
|
|
18
|
+
* @enum
|
|
19
|
+
*/
|
|
20
|
+
var OrganizationAnalysisModeEntity;
|
|
21
|
+
(function (OrganizationAnalysisModeEntity) {
|
|
22
|
+
OrganizationAnalysisModeEntity["Analyze"] = "ANALYZE";
|
|
23
|
+
OrganizationAnalysisModeEntity["Fetch"] = "FETCH";
|
|
24
|
+
})(OrganizationAnalysisModeEntity || (exports.OrganizationAnalysisModeEntity = OrganizationAnalysisModeEntity = {}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GetProviderConfigurationUseCase = void 0;
|
|
9
|
+
const sudo_common_1 = require("@sudoplatform/sudo-common");
|
|
10
|
+
/**
|
|
11
|
+
* Application business logic for retrieving the provider configuration.
|
|
12
|
+
*/
|
|
13
|
+
class GetProviderConfigurationUseCase {
|
|
14
|
+
providerConfigurationService;
|
|
15
|
+
log;
|
|
16
|
+
constructor(providerConfigurationService) {
|
|
17
|
+
this.providerConfigurationService = providerConfigurationService;
|
|
18
|
+
this.log = new sudo_common_1.DefaultLogger(this.constructor.name);
|
|
19
|
+
}
|
|
20
|
+
async execute() {
|
|
21
|
+
this.log.debug(this.constructor.name);
|
|
22
|
+
return await this.providerConfigurationService.get();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.GetProviderConfigurationUseCase = GetProviderConfigurationUseCase;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ListDataHolderScanSummariesUseCase = void 0;
|
|
9
|
+
const sudo_common_1 = require("@sudoplatform/sudo-common");
|
|
10
|
+
/**
|
|
11
|
+
* Application business logic for listing scan summaries for a data holder.
|
|
12
|
+
*/
|
|
13
|
+
class ListDataHolderScanSummariesUseCase {
|
|
14
|
+
dataHolderService;
|
|
15
|
+
log;
|
|
16
|
+
constructor(dataHolderService) {
|
|
17
|
+
this.dataHolderService = dataHolderService;
|
|
18
|
+
this.log = new sudo_common_1.DefaultLogger(this.constructor.name);
|
|
19
|
+
}
|
|
20
|
+
async execute(input) {
|
|
21
|
+
this.log.debug(this.constructor.name, { input });
|
|
22
|
+
return await this.dataHolderService.listScanSummaries({
|
|
23
|
+
dataHolderId: input.dataHolderId,
|
|
24
|
+
limit: input.limit,
|
|
25
|
+
nextToken: input.nextToken,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ListDataHolderScanSummariesUseCase = ListDataHolderScanSummariesUseCase;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GetOrganizationAnalysisUseCase = void 0;
|
|
9
|
+
const sudo_common_1 = require("@sudoplatform/sudo-common");
|
|
10
|
+
/**
|
|
11
|
+
* Application business logic for obtaining an organization analysis.
|
|
12
|
+
*/
|
|
13
|
+
class GetOrganizationAnalysisUseCase {
|
|
14
|
+
organizationAnalysisService;
|
|
15
|
+
log;
|
|
16
|
+
constructor(organizationAnalysisService) {
|
|
17
|
+
this.organizationAnalysisService = organizationAnalysisService;
|
|
18
|
+
this.log = new sudo_common_1.DefaultLogger(this.constructor.name);
|
|
19
|
+
}
|
|
20
|
+
async execute(input) {
|
|
21
|
+
this.log.debug(this.constructor.name, { input });
|
|
22
|
+
return await this.organizationAnalysisService.getOrganizationAnalysis(input);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.GetOrganizationAnalysisUseCase = GetOrganizationAnalysisUseCase;
|
package/cjs/private/domain/use-cases/virtual-presence/connectVirtualPresenceWithAuthCodeUseCase.js
CHANGED
|
@@ -17,10 +17,14 @@ class ConnectVirtualPresenceWithAuthCodeUseCase {
|
|
|
17
17
|
this.virtualPresenceService = virtualPresenceService;
|
|
18
18
|
this.log = new sudo_common_1.DefaultLogger(this.constructor.name);
|
|
19
19
|
}
|
|
20
|
-
async execute(
|
|
20
|
+
async execute(input) {
|
|
21
21
|
this.log.debug(this.constructor.name);
|
|
22
22
|
return await this.virtualPresenceService.connect({
|
|
23
|
-
authCode
|
|
23
|
+
authCode: {
|
|
24
|
+
authCode: input.authCode,
|
|
25
|
+
redirectUri: input.redirectUri,
|
|
26
|
+
},
|
|
27
|
+
relationshipProvider: input.relationshipProvider,
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -20,7 +20,13 @@ class ConnectVirtualPresenceWithRefreshTokenUseCase {
|
|
|
20
20
|
async execute(input) {
|
|
21
21
|
this.log.debug(this.constructor.name);
|
|
22
22
|
return await this.virtualPresenceService.connect({
|
|
23
|
-
refreshToken:
|
|
23
|
+
refreshToken: {
|
|
24
|
+
refreshToken: input.refreshToken,
|
|
25
|
+
providerIdentity: input.providerIdentity,
|
|
26
|
+
scopes: input.scopes,
|
|
27
|
+
expiresInEpochMs: input.expiresInEpochMs,
|
|
28
|
+
},
|
|
29
|
+
relationshipProvider: input.relationshipProvider,
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
32
|
}
|