@sudoplatform/sudo-privacy-interaction 2.2.0 → 2.3.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 +434 -11
- package/cjs/gen/schema-types.js +2 -0
- package/cjs/private/data/action/defaultActionService.js +7 -0
- package/cjs/private/data/analysis-result/transformer/capabilitySignalsTransformer.js +5 -2
- package/cjs/private/data/analysis-result/transformer/organizationCategoryTransformer.js +4 -0
- package/cjs/private/data/common/apiClient.js +29 -1
- package/cjs/private/data/data-holder/defaultDataHolderService.js +8 -0
- package/cjs/private/data/data-holder/transformer/dataHolderProtectionStateTransformer.js +4 -0
- package/cjs/private/data/organization-analysis/defaultOrganizationAnalysisService.js +6 -0
- package/cjs/private/data/organization-analysis/transformer/organizationAnalysisDomainResolutionTransformer.js +29 -0
- package/cjs/private/data/virtual-presence/transformer/virtualPresenceTransformer.js +8 -0
- package/cjs/private/domain/entities/analysis-result/analysisResultEntity.js +1 -0
- package/cjs/private/domain/entities/data-holder/dataHolderEntity.js +2 -0
- package/cjs/private/domain/entities/organization-analysis/organizationAnalysisEntity.js +17 -1
- package/cjs/private/domain/use-cases/action/getActionUseCase.js +25 -0
- package/cjs/private/domain/use-cases/data-holder/archiveDataHolderUseCase.js +25 -0
- package/cjs/private/domain/use-cases/data-holder/unarchiveDataHolderUseCase.js +25 -0
- package/cjs/public/defaultSudoPrivacyInteractionClient.js +31 -0
- package/cjs/public/typings/analysisResult.js +1 -0
- package/cjs/public/typings/dataHolder.js +2 -0
- package/cjs/public/typings/organizationAnalysis.js +17 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/DefaultSudoPrivacyInteractionClient.html +93 -27
- package/docs/enums/DataHolderProtectionState.html +12 -6
- package/docs/enums/OrganizationAnalysisDomainResolution.html +70 -0
- package/docs/enums/OrganizationCategory.html +38 -32
- package/docs/enums/ProviderType.html +3 -3
- package/docs/enums/VirtualPresenceState.html +7 -7
- package/docs/hierarchy.html +6 -6
- package/docs/interfaces/CapabilitySignals.html +41 -29
- package/docs/interfaces/DataHolderCount.html +98 -0
- package/docs/interfaces/DataHolderScanSummary.html +14 -14
- package/docs/interfaces/GetOrganizationAnalysisInput.html +24 -5
- package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
- package/docs/interfaces/ListDataHolderScanSummariesInput.html +1 -1
- package/docs/interfaces/ListDataHoldersInput.html +1 -1
- package/docs/interfaces/ListVirtualPresencesInput.html +1 -1
- package/docs/interfaces/OrganizationIdentity.html +5 -5
- package/docs/interfaces/Pagination.html +1 -1
- package/docs/interfaces/RiskIndicators.html +8 -8
- package/docs/interfaces/SudoPrivacyInteractionClient.html +78 -15
- package/docs/interfaces/VirtualPresence.html +22 -13
- package/docs/modules.html +4 -4
- package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
- package/lib/gen/graphqlTypes.js +432 -10
- package/lib/gen/schema-types.js +1 -0
- package/lib/private/data/action/defaultActionService.js +7 -0
- package/lib/private/data/analysis-result/transformer/capabilitySignalsTransformer.js +5 -2
- package/lib/private/data/analysis-result/transformer/organizationCategoryTransformer.js +4 -0
- package/lib/private/data/common/apiClient.js +30 -2
- package/lib/private/data/data-holder/defaultDataHolderService.js +8 -0
- package/lib/private/data/data-holder/transformer/dataHolderProtectionStateTransformer.js +4 -0
- package/lib/private/data/organization-analysis/defaultOrganizationAnalysisService.js +6 -0
- package/lib/private/data/organization-analysis/transformer/organizationAnalysisDomainResolutionTransformer.js +25 -0
- package/lib/private/data/virtual-presence/transformer/virtualPresenceTransformer.js +8 -0
- package/lib/private/domain/entities/analysis-result/analysisResultEntity.js +1 -0
- package/lib/private/domain/entities/data-holder/dataHolderEntity.js +2 -0
- package/lib/private/domain/entities/organization-analysis/organizationAnalysisEntity.js +16 -0
- package/lib/private/domain/use-cases/action/getActionUseCase.js +21 -0
- package/lib/private/domain/use-cases/data-holder/archiveDataHolderUseCase.js +21 -0
- package/lib/private/domain/use-cases/data-holder/unarchiveDataHolderUseCase.js +21 -0
- package/lib/public/defaultSudoPrivacyInteractionClient.js +31 -0
- package/lib/public/typings/analysisResult.js +1 -0
- package/lib/public/typings/dataHolder.js +2 -0
- package/lib/public/typings/organizationAnalysis.js +16 -0
- package/package.json +19 -23
- package/types/gen/graphqlTypes.d.ts +331 -645
- package/types/gen/schema-types.d.ts +521 -0
- package/types/private/data/action/defaultActionService.d.ts +1 -0
- package/types/private/data/common/apiClient.d.ts +6 -1
- package/types/private/data/data-holder/defaultDataHolderService.d.ts +2 -0
- package/types/private/data/organization-analysis/defaultOrganizationAnalysisService.d.ts +1 -0
- package/types/private/data/organization-analysis/transformer/organizationAnalysisDomainResolutionTransformer.d.ts +12 -0
- package/types/private/domain/entities/action/actionService.d.ts +11 -0
- package/types/private/domain/entities/analysis-result/analysisResultEntity.d.ts +3 -2
- package/types/private/domain/entities/data-holder/dataHolderEntity.d.ts +2 -0
- package/types/private/domain/entities/data-holder/dataHolderService.d.ts +16 -0
- package/types/private/domain/entities/organization-analysis/organizationAnalysisEntity.d.ts +15 -0
- package/types/private/domain/entities/organization-analysis/organizationAnalysisService.d.ts +8 -1
- package/types/private/domain/entities/virtual-presence/virtualPresenceEntity.d.ts +24 -0
- package/types/private/domain/use-cases/action/getActionUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/data-holder/archiveDataHolderUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/data-holder/unarchiveDataHolderUseCase.d.ts +16 -0
- package/types/public/defaultSudoPrivacyInteractionClient.d.ts +4 -0
- package/types/public/inputs/organizationAnalysis.d.ts +8 -1
- package/types/public/sudoPrivacyInteractionClient.d.ts +27 -0
- package/types/public/typings/analysisResult.d.ts +8 -0
- package/types/public/typings/dataHolder.d.ts +2 -0
- package/types/public/typings/organizationAnalysis.d.ts +15 -0
- package/types/public/typings/virtualPresence.d.ts +25 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { DefaultApiClientManager, } from '@sudoplatform/sudo-api-client';
|
|
7
7
|
import { DefaultLogger, FatalError, UnknownGraphQLError, isGraphQLNetworkError, mapNetworkErrorToClientError, } from '@sudoplatform/sudo-common';
|
|
8
|
-
import { ConfirmActionOutcomeDocument, ConnectVirtualPresenceDocument, DisconnectVirtualPresenceDocument, GetAnalysisResultDocument, GetDataHolderDocument, GetProviderConfigurationDocument, GetOrganizationAnalysisDocument, InitiateActionDocument, ListAnalysisResultsDocument, ListAvailableActionsDocument, ListDataHolderScanSummariesDocument, ListDataHoldersDocument, ListVirtualPresencesDocument, OnActionStatusUpdateDocument, OnAnalysisResultUpdateDocument, OnDataHoldersUpdateDocument, OnVirtualPresenceUpdateDocument, RescanVirtualPresenceDocument, } from '../../../gen/graphqlTypes';
|
|
8
|
+
import { ArchiveDataHolderDocument, ConfirmActionOutcomeDocument, ConnectVirtualPresenceDocument, DisconnectVirtualPresenceDocument, GetActionDocument, GetAnalysisResultDocument, GetDataHolderDocument, GetProviderConfigurationDocument, GetOrganizationAnalysisDocument, InitiateActionDocument, ListAnalysisResultsDocument, ListAvailableActionsDocument, ListDataHolderScanSummariesDocument, ListDataHoldersDocument, ListVirtualPresencesDocument, OnActionStatusUpdateDocument, OnAnalysisResultUpdateDocument, OnDataHoldersUpdateDocument, OnVirtualPresenceUpdateDocument, RescanVirtualPresenceDocument, UnarchiveDataHolderDocument, } from '../../../gen/graphqlTypes';
|
|
9
9
|
import { ErrorTransformer } from './transformer/errorTransformer';
|
|
10
10
|
export class ApiClient {
|
|
11
11
|
log;
|
|
@@ -91,6 +91,22 @@ export class ApiClient {
|
|
|
91
91
|
});
|
|
92
92
|
return data.listDataHolderScanSummaries;
|
|
93
93
|
}
|
|
94
|
+
async archiveDataHolder(id) {
|
|
95
|
+
const data = await this.performMutation({
|
|
96
|
+
mutation: ArchiveDataHolderDocument,
|
|
97
|
+
variables: { id },
|
|
98
|
+
calleeName: this.archiveDataHolder.name,
|
|
99
|
+
});
|
|
100
|
+
return data.archiveDataHolder;
|
|
101
|
+
}
|
|
102
|
+
async unarchiveDataHolder(id) {
|
|
103
|
+
const data = await this.performMutation({
|
|
104
|
+
mutation: UnarchiveDataHolderDocument,
|
|
105
|
+
variables: { id },
|
|
106
|
+
calleeName: this.unarchiveDataHolder.name,
|
|
107
|
+
});
|
|
108
|
+
return data.unarchiveDataHolder;
|
|
109
|
+
}
|
|
94
110
|
async getAnalysisResult(id) {
|
|
95
111
|
const data = await this.performQuery({
|
|
96
112
|
query: GetAnalysisResultDocument,
|
|
@@ -100,11 +116,15 @@ export class ApiClient {
|
|
|
100
116
|
return data.getAnalysisResult ?? undefined;
|
|
101
117
|
}
|
|
102
118
|
async getOrganizationAnalysis(input) {
|
|
119
|
+
const options = input.mode || input.resolution
|
|
120
|
+
? { mode: input.mode, resolution: input.resolution }
|
|
121
|
+
: undefined;
|
|
103
122
|
const data = await this.performQuery({
|
|
104
123
|
query: GetOrganizationAnalysisDocument,
|
|
105
124
|
variables: {
|
|
106
125
|
domain: input.domain,
|
|
107
|
-
|
|
126
|
+
name: input.name,
|
|
127
|
+
options,
|
|
108
128
|
},
|
|
109
129
|
calleeName: this.getOrganizationAnalysis.name,
|
|
110
130
|
});
|
|
@@ -138,6 +158,14 @@ export class ApiClient {
|
|
|
138
158
|
});
|
|
139
159
|
return data.confirmActionOutcome;
|
|
140
160
|
}
|
|
161
|
+
async getAction(id) {
|
|
162
|
+
const data = await this.performQuery({
|
|
163
|
+
query: GetActionDocument,
|
|
164
|
+
variables: { id },
|
|
165
|
+
calleeName: this.getAction.name,
|
|
166
|
+
});
|
|
167
|
+
return data.getAction ?? undefined;
|
|
168
|
+
}
|
|
141
169
|
async listAvailableActions(input) {
|
|
142
170
|
const data = await this.performQuery({
|
|
143
171
|
query: ListAvailableActionsDocument,
|
|
@@ -45,6 +45,14 @@ export class DefaultDataHolderService {
|
|
|
45
45
|
nextToken: result.nextToken ?? undefined,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
+
async archive(id) {
|
|
49
|
+
const result = await this.appSync.archiveDataHolder(id);
|
|
50
|
+
return this.dataHolderTransformer.fromGraphQLToEntity(result);
|
|
51
|
+
}
|
|
52
|
+
async unarchive(id) {
|
|
53
|
+
const result = await this.appSync.unarchiveDataHolder(id);
|
|
54
|
+
return this.dataHolderTransformer.fromGraphQLToEntity(result);
|
|
55
|
+
}
|
|
48
56
|
async subscribe(input) {
|
|
49
57
|
this.subscriptionManager.subscribe(input.subscriptionId, input.subscriber);
|
|
50
58
|
if (!this.subscriptionManager.getWatcher()) {
|
|
@@ -14,6 +14,8 @@ export class DataHolderProtectionStateTransformer {
|
|
|
14
14
|
return DataHolderProtectionState.ActionRequested;
|
|
15
15
|
case DataHolderProtectionStateEntity.Resolved:
|
|
16
16
|
return DataHolderProtectionState.Resolved;
|
|
17
|
+
case DataHolderProtectionStateEntity.Archived:
|
|
18
|
+
return DataHolderProtectionState.Archived;
|
|
17
19
|
case DataHolderProtectionStateEntity.Unknown:
|
|
18
20
|
return DataHolderProtectionState.Unknown;
|
|
19
21
|
}
|
|
@@ -26,6 +28,8 @@ export class DataHolderProtectionStateTransformer {
|
|
|
26
28
|
return DataHolderProtectionStateEntity.ActionRequested;
|
|
27
29
|
case 'RESOLVED':
|
|
28
30
|
return DataHolderProtectionStateEntity.Resolved;
|
|
31
|
+
case 'ARCHIVED':
|
|
32
|
+
return DataHolderProtectionStateEntity.Archived;
|
|
29
33
|
default:
|
|
30
34
|
return DataHolderProtectionStateEntity.Unknown;
|
|
31
35
|
}
|
|
@@ -3,21 +3,27 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { OrganizationAnalysisDomainResolutionTransformer } from './transformer/organizationAnalysisDomainResolutionTransformer';
|
|
6
7
|
import { OrganizationAnalysisModeTransformer } from './transformer/organizationAnalysisModeTransformer';
|
|
7
8
|
import { OrganizationAnalysisTransformer } from './transformer/organizationAnalysisTransformer';
|
|
8
9
|
export class DefaultOrganizationAnalysisService {
|
|
9
10
|
appSync;
|
|
10
11
|
organizationAnalysisTransformer = new OrganizationAnalysisTransformer();
|
|
11
12
|
modeTransformer = new OrganizationAnalysisModeTransformer();
|
|
13
|
+
resolutionTransformer = new OrganizationAnalysisDomainResolutionTransformer();
|
|
12
14
|
constructor(appSync) {
|
|
13
15
|
this.appSync = appSync;
|
|
14
16
|
}
|
|
15
17
|
async getOrganizationAnalysis(input) {
|
|
16
18
|
const result = await this.appSync.getOrganizationAnalysis({
|
|
17
19
|
domain: input.domain,
|
|
20
|
+
name: input.name,
|
|
18
21
|
mode: input.mode
|
|
19
22
|
? this.modeTransformer.fromEntityToGraphQL(input.mode)
|
|
20
23
|
: undefined,
|
|
24
|
+
resolution: input.resolution
|
|
25
|
+
? this.resolutionTransformer.fromEntityToGraphQL(input.resolution)
|
|
26
|
+
: undefined,
|
|
21
27
|
});
|
|
22
28
|
if (!result) {
|
|
23
29
|
return undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { OrganizationAnalysisDomainResolution } from '../../../../public/typings/organizationAnalysis';
|
|
7
|
+
import { OrganizationAnalysisDomainResolutionEntity } from '../../../domain/entities/organization-analysis/organizationAnalysisEntity';
|
|
8
|
+
export class OrganizationAnalysisDomainResolutionTransformer {
|
|
9
|
+
fromAPIToEntity(resolution) {
|
|
10
|
+
switch (resolution) {
|
|
11
|
+
case OrganizationAnalysisDomainResolution.Registrable:
|
|
12
|
+
return OrganizationAnalysisDomainResolutionEntity.Registrable;
|
|
13
|
+
case OrganizationAnalysisDomainResolution.Exact:
|
|
14
|
+
return OrganizationAnalysisDomainResolutionEntity.Exact;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
fromEntityToGraphQL(resolution) {
|
|
18
|
+
switch (resolution) {
|
|
19
|
+
case OrganizationAnalysisDomainResolutionEntity.Registrable:
|
|
20
|
+
return 'REGISTRABLE';
|
|
21
|
+
case OrganizationAnalysisDomainResolutionEntity.Exact:
|
|
22
|
+
return 'EXACT';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -18,6 +18,7 @@ export class VirtualPresenceTransformer {
|
|
|
18
18
|
state: virtualPresenceStateTransformer.fromEntityToAPI(entity.state),
|
|
19
19
|
lastScannedAt: entity.lastScannedAt,
|
|
20
20
|
lastScanFailureReason: entity.lastScanFailureReason,
|
|
21
|
+
dataHolderCount: { ...entity.dataHolderCount },
|
|
21
22
|
createdAt: entity.createdAt,
|
|
22
23
|
updatedAt: entity.updatedAt,
|
|
23
24
|
};
|
|
@@ -34,6 +35,13 @@ export class VirtualPresenceTransformer {
|
|
|
34
35
|
state: virtualPresenceStateTransformer.fromGraphQLToEntity(data.state),
|
|
35
36
|
lastScannedAt: new Date(data.lastScannedAtEpochMs),
|
|
36
37
|
lastScanFailureReason: data.lastScanFailureReason ?? undefined,
|
|
38
|
+
dataHolderCount: {
|
|
39
|
+
count: data.dataHolderCount.count,
|
|
40
|
+
monitored: data.dataHolderCount.monitored,
|
|
41
|
+
initiatedActions: data.dataHolderCount.initiatedActions,
|
|
42
|
+
completedActions: data.dataHolderCount.completedActions,
|
|
43
|
+
archived: data.dataHolderCount.archived,
|
|
44
|
+
},
|
|
37
45
|
createdAt: new Date(data.createdAtEpochMs),
|
|
38
46
|
updatedAt: new Date(data.updatedAtEpochMs),
|
|
39
47
|
};
|
|
@@ -100,6 +100,7 @@ export var RetentionStyleEntity;
|
|
|
100
100
|
*/
|
|
101
101
|
export var OrganizationCategoryEntity;
|
|
102
102
|
(function (OrganizationCategoryEntity) {
|
|
103
|
+
OrganizationCategoryEntity["AdultEntertainment"] = "AdultEntertainment";
|
|
103
104
|
OrganizationCategoryEntity["Automotive"] = "Automotive";
|
|
104
105
|
OrganizationCategoryEntity["Communications"] = "Communications";
|
|
105
106
|
OrganizationCategoryEntity["CommunityAndCharity"] = "CommunityAndCharity";
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @property MONITORED The data holder is being monitored.
|
|
10
10
|
* @property ACTION_REQUESTED An action has been requested against this data holder.
|
|
11
11
|
* @property RESOLVED The data holder has been resolved.
|
|
12
|
+
* @property ARCHIVED The data holder has been archived by the user.
|
|
12
13
|
*
|
|
13
14
|
* @enum
|
|
14
15
|
*/
|
|
@@ -17,5 +18,6 @@ export var DataHolderProtectionStateEntity;
|
|
|
17
18
|
DataHolderProtectionStateEntity["Monitored"] = "MONITORED";
|
|
18
19
|
DataHolderProtectionStateEntity["ActionRequested"] = "ACTION_REQUESTED";
|
|
19
20
|
DataHolderProtectionStateEntity["Resolved"] = "RESOLVED";
|
|
21
|
+
DataHolderProtectionStateEntity["Archived"] = "ARCHIVED";
|
|
20
22
|
DataHolderProtectionStateEntity["Unknown"] = "UNKNOWN";
|
|
21
23
|
})(DataHolderProtectionStateEntity || (DataHolderProtectionStateEntity = {}));
|
|
@@ -19,3 +19,19 @@ export var OrganizationAnalysisModeEntity;
|
|
|
19
19
|
OrganizationAnalysisModeEntity["Analyze"] = "ANALYZE";
|
|
20
20
|
OrganizationAnalysisModeEntity["Fetch"] = "FETCH";
|
|
21
21
|
})(OrganizationAnalysisModeEntity || (OrganizationAnalysisModeEntity = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Controls how `getOrganizationAnalysis` treats the requested domain before
|
|
24
|
+
* sources query their backing services.
|
|
25
|
+
*
|
|
26
|
+
* @property REGISTRABLE Reduce the domain to its registrable (eTLD+1) form before analysis,
|
|
27
|
+
* e.g. `mail.sub.example.co.uk` becomes `example.co.uk`.
|
|
28
|
+
* @property EXACT Analyze the domain verbatim, without reducing it to a registrable domain.
|
|
29
|
+
* Used to analyze a specific host/subdomain rather than the organization.
|
|
30
|
+
*
|
|
31
|
+
* @enum
|
|
32
|
+
*/
|
|
33
|
+
export var OrganizationAnalysisDomainResolutionEntity;
|
|
34
|
+
(function (OrganizationAnalysisDomainResolutionEntity) {
|
|
35
|
+
OrganizationAnalysisDomainResolutionEntity["Registrable"] = "REGISTRABLE";
|
|
36
|
+
OrganizationAnalysisDomainResolutionEntity["Exact"] = "EXACT";
|
|
37
|
+
})(OrganizationAnalysisDomainResolutionEntity || (OrganizationAnalysisDomainResolutionEntity = {}));
|
|
@@ -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 { DefaultLogger } from '@sudoplatform/sudo-common';
|
|
7
|
+
/**
|
|
8
|
+
* Application business logic for retrieving a single action.
|
|
9
|
+
*/
|
|
10
|
+
export class GetActionUseCase {
|
|
11
|
+
actionService;
|
|
12
|
+
log;
|
|
13
|
+
constructor(actionService) {
|
|
14
|
+
this.actionService = actionService;
|
|
15
|
+
this.log = new DefaultLogger(this.constructor.name);
|
|
16
|
+
}
|
|
17
|
+
async execute(id) {
|
|
18
|
+
this.log.debug(this.constructor.name, { id });
|
|
19
|
+
return await this.actionService.get(id);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -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 { DefaultLogger } from '@sudoplatform/sudo-common';
|
|
7
|
+
/**
|
|
8
|
+
* Application business logic for archiving a data holder.
|
|
9
|
+
*/
|
|
10
|
+
export class ArchiveDataHolderUseCase {
|
|
11
|
+
dataHolderService;
|
|
12
|
+
log;
|
|
13
|
+
constructor(dataHolderService) {
|
|
14
|
+
this.dataHolderService = dataHolderService;
|
|
15
|
+
this.log = new DefaultLogger(this.constructor.name);
|
|
16
|
+
}
|
|
17
|
+
async execute(id) {
|
|
18
|
+
this.log.debug(this.constructor.name, { id });
|
|
19
|
+
return await this.dataHolderService.archive(id);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -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 { DefaultLogger } from '@sudoplatform/sudo-common';
|
|
7
|
+
/**
|
|
8
|
+
* Application business logic for unarchiving a data holder.
|
|
9
|
+
*/
|
|
10
|
+
export class UnarchiveDataHolderUseCase {
|
|
11
|
+
dataHolderService;
|
|
12
|
+
log;
|
|
13
|
+
constructor(dataHolderService) {
|
|
14
|
+
this.dataHolderService = dataHolderService;
|
|
15
|
+
this.log = new DefaultLogger(this.constructor.name);
|
|
16
|
+
}
|
|
17
|
+
async execute(id) {
|
|
18
|
+
this.log.debug(this.constructor.name, { id });
|
|
19
|
+
return await this.dataHolderService.unarchive(id);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -19,12 +19,14 @@ import { DefaultProviderConfigurationService } from '../private/data/provider-co
|
|
|
19
19
|
import { ProviderConfigurationTransformer } from '../private/data/provider-configuration/transformer/providerConfigurationTransformer';
|
|
20
20
|
import { DefaultOrganizationAnalysisService } from '../private/data/organization-analysis/defaultOrganizationAnalysisService';
|
|
21
21
|
import { OrganizationAnalysisModeTransformer } from '../private/data/organization-analysis/transformer/organizationAnalysisModeTransformer';
|
|
22
|
+
import { OrganizationAnalysisDomainResolutionTransformer } from '../private/data/organization-analysis/transformer/organizationAnalysisDomainResolutionTransformer';
|
|
22
23
|
import { OrganizationAnalysisTransformer } from '../private/data/organization-analysis/transformer/organizationAnalysisTransformer';
|
|
23
24
|
import { DefaultVirtualPresenceService } from '../private/data/virtual-presence/defaultVirtualPresenceService';
|
|
24
25
|
import { RelationshipProviderTransformer } from '../private/data/virtual-presence/transformer/relationshipProviderTransformer';
|
|
25
26
|
import { VirtualPresenceTransformer } from '../private/data/virtual-presence/transformer/virtualPresenceTransformer';
|
|
26
27
|
import { GetAnalysisResultUseCase } from '../private/domain/use-cases/analysis-result/getAnalysisResultUseCase';
|
|
27
28
|
import { ConfirmActionOutcomeUseCase } from '../private/domain/use-cases/action/confirmActionOutcomeUseCase';
|
|
29
|
+
import { GetActionUseCase } from '../private/domain/use-cases/action/getActionUseCase';
|
|
28
30
|
import { InitiateActionUseCase } from '../private/domain/use-cases/action/initiateActionUseCase';
|
|
29
31
|
import { ListAvailableActionsUseCase } from '../private/domain/use-cases/action/listAvailableActionsUseCase';
|
|
30
32
|
import { SubscribeToActionUseCase } from '../private/domain/use-cases/action/subscribeToActionUseCase';
|
|
@@ -35,6 +37,8 @@ import { UnsubscribeFromAnalysisResultUseCase } from '../private/domain/use-case
|
|
|
35
37
|
import { GetProviderConfigurationUseCase } from '../private/domain/use-cases/configuration/getProviderConfigurationUseCase';
|
|
36
38
|
import { GetOrganizationAnalysisUseCase } from '../private/domain/use-cases/organization-analysis/getOrganizationAnalysisUseCase';
|
|
37
39
|
import { GetDataHolderUseCase } from '../private/domain/use-cases/data-holder/getDataHolderUseCase';
|
|
40
|
+
import { ArchiveDataHolderUseCase } from '../private/domain/use-cases/data-holder/archiveDataHolderUseCase';
|
|
41
|
+
import { UnarchiveDataHolderUseCase } from '../private/domain/use-cases/data-holder/unarchiveDataHolderUseCase';
|
|
38
42
|
import { ListDataHolderScanSummariesUseCase } from '../private/domain/use-cases/data-holder/listDataHolderScanSummariesUseCase';
|
|
39
43
|
import { ListDataHoldersUseCase } from '../private/domain/use-cases/data-holder/listDataHoldersUseCase';
|
|
40
44
|
import { SubscribeToDataHoldersUseCase } from '../private/domain/use-cases/data-holder/subscribeToDataHoldersUseCase';
|
|
@@ -46,6 +50,7 @@ import { ListVirtualPresencesUseCase } from '../private/domain/use-cases/virtual
|
|
|
46
50
|
import { RescanVirtualPresenceUseCase } from '../private/domain/use-cases/virtual-presence/rescanVirtualPresenceUseCase';
|
|
47
51
|
import { SubscribeToVirtualPresenceUseCase } from '../private/domain/use-cases/virtual-presence/subscribeToVirtualPresenceUseCase';
|
|
48
52
|
import { UnsubscribeFromVirtualPresenceUseCase } from '../private/domain/use-cases/virtual-presence/unsubscribeFromVirtualPresenceUseCase';
|
|
53
|
+
import { OrganizationAnalysisDomainResolution, } from './typings';
|
|
49
54
|
export class DefaultSudoPrivacyInteractionClient {
|
|
50
55
|
apiClient;
|
|
51
56
|
userClient;
|
|
@@ -63,6 +68,7 @@ export class DefaultSudoPrivacyInteractionClient {
|
|
|
63
68
|
analysisResultTransformer;
|
|
64
69
|
organizationAnalysisTransformer;
|
|
65
70
|
organizationAnalysisModeTransformer;
|
|
71
|
+
organizationAnalysisDomainResolutionTransformer;
|
|
66
72
|
actionTransformer;
|
|
67
73
|
availableActionTransformer;
|
|
68
74
|
actionIntentTransformer;
|
|
@@ -90,6 +96,8 @@ export class DefaultSudoPrivacyInteractionClient {
|
|
|
90
96
|
this.organizationAnalysisTransformer = new OrganizationAnalysisTransformer();
|
|
91
97
|
this.organizationAnalysisModeTransformer =
|
|
92
98
|
new OrganizationAnalysisModeTransformer();
|
|
99
|
+
this.organizationAnalysisDomainResolutionTransformer =
|
|
100
|
+
new OrganizationAnalysisDomainResolutionTransformer();
|
|
93
101
|
this.actionTransformer = new ActionTransformer();
|
|
94
102
|
this.availableActionTransformer = new AvailableActionTransformer();
|
|
95
103
|
this.actionIntentTransformer = new ActionIntentTransformer();
|
|
@@ -225,6 +233,18 @@ export class DefaultSudoPrivacyInteractionClient {
|
|
|
225
233
|
const transformedScanSummaries = scanSummaries.map((scanSummary) => this.dataHolderScanSummaryTransformer.fromEntityToAPI(scanSummary));
|
|
226
234
|
return { items: transformedScanSummaries, nextToken: resultNextToken };
|
|
227
235
|
}
|
|
236
|
+
async archiveDataHolder(id) {
|
|
237
|
+
this.log.debug(this.archiveDataHolder.name, { id });
|
|
238
|
+
const useCase = new ArchiveDataHolderUseCase(this.dataHolderService);
|
|
239
|
+
const result = await useCase.execute(id);
|
|
240
|
+
return this.dataHolderTransformer.fromEntityToAPI(result);
|
|
241
|
+
}
|
|
242
|
+
async unarchiveDataHolder(id) {
|
|
243
|
+
this.log.debug(this.unarchiveDataHolder.name, { id });
|
|
244
|
+
const useCase = new UnarchiveDataHolderUseCase(this.dataHolderService);
|
|
245
|
+
const result = await useCase.execute(id);
|
|
246
|
+
return this.dataHolderTransformer.fromEntityToAPI(result);
|
|
247
|
+
}
|
|
228
248
|
async subscribeToDataHolders(subscriptionId, subscriber) {
|
|
229
249
|
this.log.debug(this.subscribeToDataHolders.name, {
|
|
230
250
|
subscriptionId,
|
|
@@ -278,9 +298,11 @@ export class DefaultSudoPrivacyInteractionClient {
|
|
|
278
298
|
const useCase = new GetOrganizationAnalysisUseCase(this.organizationAnalysisService);
|
|
279
299
|
const result = await useCase.execute({
|
|
280
300
|
domain: input.domain,
|
|
301
|
+
name: input.name,
|
|
281
302
|
mode: input.mode
|
|
282
303
|
? this.organizationAnalysisModeTransformer.fromAPIToEntity(input.mode)
|
|
283
304
|
: undefined,
|
|
305
|
+
resolution: this.organizationAnalysisDomainResolutionTransformer.fromAPIToEntity(input.resolution ?? OrganizationAnalysisDomainResolution.Exact),
|
|
284
306
|
});
|
|
285
307
|
if (!result) {
|
|
286
308
|
return undefined;
|
|
@@ -297,6 +319,15 @@ export class DefaultSudoPrivacyInteractionClient {
|
|
|
297
319
|
});
|
|
298
320
|
return this.actionTransformer.fromEntityToAPI(result);
|
|
299
321
|
}
|
|
322
|
+
async getAction(id) {
|
|
323
|
+
this.log.debug(this.getAction.name, { id });
|
|
324
|
+
const useCase = new GetActionUseCase(this.actionService);
|
|
325
|
+
const result = await useCase.execute(id);
|
|
326
|
+
if (!result) {
|
|
327
|
+
return undefined;
|
|
328
|
+
}
|
|
329
|
+
return this.actionTransformer.fromEntityToAPI(result);
|
|
330
|
+
}
|
|
300
331
|
async confirmActionOutcome(id) {
|
|
301
332
|
this.log.debug(this.confirmActionOutcome.name, { id });
|
|
302
333
|
const useCase = new ConfirmActionOutcomeUseCase(this.actionService);
|
|
@@ -100,6 +100,7 @@ export var RetentionStyle;
|
|
|
100
100
|
*/
|
|
101
101
|
export var OrganizationCategory;
|
|
102
102
|
(function (OrganizationCategory) {
|
|
103
|
+
OrganizationCategory["AdultEntertainment"] = "AdultEntertainment";
|
|
103
104
|
OrganizationCategory["Automotive"] = "Automotive";
|
|
104
105
|
OrganizationCategory["Communications"] = "Communications";
|
|
105
106
|
OrganizationCategory["CommunityAndCharity"] = "CommunityAndCharity";
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @property MONITORED The data holder is being monitored.
|
|
10
10
|
* @property ACTION_REQUESTED An action has been requested against this data holder.
|
|
11
11
|
* @property RESOLVED The data holder has been resolved.
|
|
12
|
+
* @property ARCHIVED The data holder has been archived by the user.
|
|
12
13
|
*
|
|
13
14
|
* @enum
|
|
14
15
|
*/
|
|
@@ -17,5 +18,6 @@ export var DataHolderProtectionState;
|
|
|
17
18
|
DataHolderProtectionState["Monitored"] = "MONITORED";
|
|
18
19
|
DataHolderProtectionState["ActionRequested"] = "ACTION_REQUESTED";
|
|
19
20
|
DataHolderProtectionState["Resolved"] = "RESOLVED";
|
|
21
|
+
DataHolderProtectionState["Archived"] = "ARCHIVED";
|
|
20
22
|
DataHolderProtectionState["Unknown"] = "UNKNOWN";
|
|
21
23
|
})(DataHolderProtectionState || (DataHolderProtectionState = {}));
|
|
@@ -19,3 +19,19 @@ export var OrganizationAnalysisMode;
|
|
|
19
19
|
OrganizationAnalysisMode["Analyze"] = "ANALYZE";
|
|
20
20
|
OrganizationAnalysisMode["Fetch"] = "FETCH";
|
|
21
21
|
})(OrganizationAnalysisMode || (OrganizationAnalysisMode = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Controls how `getOrganizationAnalysis` treats the requested domain before
|
|
24
|
+
* sources query their backing services.
|
|
25
|
+
*
|
|
26
|
+
* @property Registrable Reduce the domain to its registrable (eTLD+1) form before analysis,
|
|
27
|
+
* e.g. `mail.sub.example.co.uk` becomes `example.co.uk`.
|
|
28
|
+
* @property Exact Analyze the domain verbatim, without reducing it to a registrable domain.
|
|
29
|
+
* Used to analyze a specific host/subdomain rather than the organization.
|
|
30
|
+
*
|
|
31
|
+
* @enum
|
|
32
|
+
*/
|
|
33
|
+
export var OrganizationAnalysisDomainResolution;
|
|
34
|
+
(function (OrganizationAnalysisDomainResolution) {
|
|
35
|
+
OrganizationAnalysisDomainResolution["Registrable"] = "REGISTRABLE";
|
|
36
|
+
OrganizationAnalysisDomainResolution["Exact"] = "EXACT";
|
|
37
|
+
})(OrganizationAnalysisDomainResolution || (OrganizationAnalysisDomainResolution = {}));
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudoplatform/sudo-privacy-interaction",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"author": "Anonyome Labs, Inc.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/sudoplatform/sudo-privacy-interaction-js.git"
|
|
9
9
|
},
|
|
10
|
-
"engines": {
|
|
11
|
-
"node": ">=22"
|
|
12
|
-
},
|
|
13
10
|
"scripts": {
|
|
14
11
|
"prepare": "husky",
|
|
15
12
|
"lint": "npm-run-all --parallel lint:eslint lint:prettier",
|
|
@@ -51,33 +48,31 @@
|
|
|
51
48
|
"@sudoplatform/sudo-user": "^17.1.1"
|
|
52
49
|
},
|
|
53
50
|
"dependencies": {
|
|
54
|
-
"graphql": "^
|
|
51
|
+
"graphql": "^17.0.2",
|
|
55
52
|
"io-ts": "^2.2.22",
|
|
56
53
|
"tslib": "^2.8.1"
|
|
57
54
|
},
|
|
58
55
|
"resolutions": {
|
|
59
|
-
"graphql": "^
|
|
56
|
+
"graphql": "^17.0.0",
|
|
60
57
|
"cross-spawn": "^7.0.5",
|
|
61
58
|
"braces": "^3.0.3",
|
|
59
|
+
"@graphql-tools/utils": "^12.0.2",
|
|
62
60
|
"micromatch": "^4.0.8",
|
|
63
|
-
"fast-xml-parser": "5.7.0",
|
|
61
|
+
"fast-xml-parser": "^5.7.0",
|
|
64
62
|
"semver": "^7.5.2",
|
|
65
63
|
"@smithy/config-resolver": "^4.4.6",
|
|
66
64
|
"undici": "^8.9.0",
|
|
67
65
|
"tar": "^7.5.21",
|
|
68
66
|
"postcss": "^8.5.23",
|
|
69
67
|
"uuid": "^11.1.1",
|
|
70
|
-
"js-yaml": "^4.3.2"
|
|
71
|
-
"vitest": "^4.1.11",
|
|
72
|
-
"@vitest/mocker": "^4.1.11"
|
|
68
|
+
"js-yaml": "^4.3.2"
|
|
73
69
|
},
|
|
74
70
|
"devDependencies": {
|
|
75
|
-
"@graphql-codegen/add": "^
|
|
76
|
-
"@graphql-codegen/cli": "^
|
|
77
|
-
"@graphql-codegen/typed-document-node": "^
|
|
78
|
-
"@graphql-codegen/typescript": "^
|
|
79
|
-
"@graphql-codegen/typescript-operations": "^
|
|
80
|
-
"@graphql-typed-document-node/apollo-client-2": "^1.0.0",
|
|
71
|
+
"@graphql-codegen/add": "^7.1.1",
|
|
72
|
+
"@graphql-codegen/cli": "^7.4.4",
|
|
73
|
+
"@graphql-codegen/typed-document-node": "^7.1.1",
|
|
74
|
+
"@graphql-codegen/typescript": "^6.1.1",
|
|
75
|
+
"@graphql-codegen/typescript-operations": "^6.1.10",
|
|
81
76
|
"@sudoplatform/sudo-api-client": "^16.2.0",
|
|
82
77
|
"@sudoplatform/sudo-common": "^12.2.9",
|
|
83
78
|
"@sudoplatform/sudo-entitlements": "^18.0.3",
|
|
@@ -87,7 +82,7 @@
|
|
|
87
82
|
"@types/ws": "^8.18.1",
|
|
88
83
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
89
84
|
"@typescript-eslint/parser": "^8.26.1",
|
|
90
|
-
"@vitest/coverage-v8": "^
|
|
85
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
91
86
|
"concurrently": "^9.2.1",
|
|
92
87
|
"dotenv": "^17.4.2",
|
|
93
88
|
"eslint": "^8.57.1",
|
|
@@ -104,7 +99,8 @@
|
|
|
104
99
|
"typedoc": "^0.28.11",
|
|
105
100
|
"typescript": "^5.9.2",
|
|
106
101
|
"uuid": "^11.1.0",
|
|
107
|
-
"
|
|
102
|
+
"vite": "^8.3.4",
|
|
103
|
+
"vitest": "^5.0.0",
|
|
108
104
|
"wait-for-expect": "^4.0.0",
|
|
109
105
|
"ws": "^8.21.3"
|
|
110
106
|
},
|
|
@@ -112,13 +108,13 @@
|
|
|
112
108
|
"auditSuppressions": {
|
|
113
109
|
"1120607": {
|
|
114
110
|
"until": 1797004800,
|
|
115
|
-
"untilISO": "2026-
|
|
111
|
+
"untilISO": "2026-12-12T00:00:00Z",
|
|
116
112
|
"reason": "Transitive dep of amazon-cognito-auth-js (deprecated/unmaintained); no fix available without upstream SDK migration"
|
|
117
113
|
},
|
|
118
|
-
"
|
|
119
|
-
"until":
|
|
120
|
-
"untilISO": "2026-
|
|
121
|
-
"reason": "
|
|
114
|
+
"1242672": {
|
|
115
|
+
"until": 1795224255,
|
|
116
|
+
"untilISO": "2026-11-21T01:24:15Z",
|
|
117
|
+
"reason": "markdown-it fix too new"
|
|
122
118
|
}
|
|
123
119
|
}
|
|
124
120
|
}
|