@sudoplatform/sudo-privacy-interaction 2.1.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 +1111 -132
- package/cjs/gen/schema-types.js +2 -0
- package/cjs/private/data/action/actionSubscriptionManager.js +25 -0
- package/cjs/private/data/action/defaultActionService.js +87 -0
- package/cjs/private/data/action/transformer/actionFulfilmentMethodTransformer.js +47 -0
- package/cjs/private/data/action/transformer/actionIntentTransformer.js +69 -0
- package/cjs/private/data/action/transformer/actionOriginTransformer.js +37 -0
- package/cjs/private/data/action/transformer/actionStatusTransformer.js +53 -0
- package/cjs/private/data/action/transformer/actionTransformer.js +85 -0
- package/cjs/private/data/action/transformer/availableActionTransformer.js +37 -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 +64 -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/action/actionEntity.js +86 -0
- package/cjs/private/domain/entities/action/actionService.js +7 -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/confirmActionOutcomeUseCase.js +25 -0
- package/cjs/private/domain/use-cases/action/getActionUseCase.js +25 -0
- package/cjs/private/domain/use-cases/action/initiateActionUseCase.js +26 -0
- package/cjs/private/domain/use-cases/action/listAvailableActionsUseCase.js +26 -0
- package/cjs/private/domain/use-cases/action/subscribeToActionUseCase.js +37 -0
- package/cjs/private/domain/use-cases/action/unsubscribeFromActionUseCase.js +27 -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 +89 -0
- package/cjs/public/inputs/action.js +7 -0
- package/cjs/public/inputs/index.js +1 -0
- package/cjs/public/typings/action.js +85 -0
- package/cjs/public/typings/analysisResult.js +1 -0
- package/cjs/public/typings/dataHolder.js +2 -0
- package/cjs/public/typings/index.js +1 -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 +194 -22
- package/docs/enums/ActionFulfilmentMethod.html +63 -0
- package/docs/enums/ActionIntent.html +84 -0
- package/docs/enums/ActionOrigin.html +75 -0
- package/docs/enums/ActionStatus.html +99 -0
- package/docs/enums/ConnectionState.html +3 -3
- 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/Action.html +167 -0
- package/docs/interfaces/ActionContact.html +77 -0
- package/docs/interfaces/ActionSubscriber.html +92 -0
- package/docs/interfaces/AnalysisResultSubscriber.html +3 -3
- package/docs/interfaces/AssistedEmailTemplate.html +70 -0
- package/docs/interfaces/AssistedPayload.html +113 -0
- package/docs/interfaces/AvailableAction.html +102 -0
- package/docs/interfaces/CapabilitySignals.html +41 -29
- package/docs/interfaces/DataHolderCount.html +98 -0
- package/docs/interfaces/DataHolderScanSummary.html +14 -14
- package/docs/interfaces/DataHolderSubscriber.html +3 -3
- package/docs/interfaces/GetOrganizationAnalysisInput.html +24 -5
- package/docs/interfaces/InitiateActionInput.html +79 -0
- package/docs/interfaces/ListAnalysisResultsInput.html +1 -1
- package/docs/interfaces/ListAvailableActionsInput.html +61 -0
- 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 +186 -22
- package/docs/interfaces/VirtualPresence.html +22 -13
- package/docs/interfaces/VirtualPresenceSubscriber.html +3 -3
- package/docs/modules.html +4 -4
- package/docs/types/SudoPrivacyInteractionClientOptions.html +2 -2
- package/lib/gen/graphqlTypes.js +1109 -131
- package/lib/gen/schema-types.js +1 -0
- package/lib/private/data/action/actionSubscriptionManager.js +21 -0
- package/lib/private/data/action/defaultActionService.js +83 -0
- package/lib/private/data/action/transformer/actionFulfilmentMethodTransformer.js +43 -0
- package/lib/private/data/action/transformer/actionIntentTransformer.js +65 -0
- package/lib/private/data/action/transformer/actionOriginTransformer.js +33 -0
- package/lib/private/data/action/transformer/actionStatusTransformer.js +49 -0
- package/lib/private/data/action/transformer/actionTransformer.js +81 -0
- package/lib/private/data/action/transformer/availableActionTransformer.js +33 -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 +65 -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/action/actionEntity.js +83 -0
- package/lib/private/domain/entities/action/actionService.js +6 -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/confirmActionOutcomeUseCase.js +21 -0
- package/lib/private/domain/use-cases/action/getActionUseCase.js +21 -0
- package/lib/private/domain/use-cases/action/initiateActionUseCase.js +22 -0
- package/lib/private/domain/use-cases/action/listAvailableActionsUseCase.js +22 -0
- package/lib/private/domain/use-cases/action/subscribeToActionUseCase.js +33 -0
- package/lib/private/domain/use-cases/action/unsubscribeFromActionUseCase.js +23 -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 +89 -0
- package/lib/public/inputs/action.js +6 -0
- package/lib/public/inputs/index.js +1 -0
- package/lib/public/typings/action.js +82 -0
- package/lib/public/typings/analysisResult.js +1 -0
- package/lib/public/typings/dataHolder.js +2 -0
- package/lib/public/typings/index.js +1 -0
- package/lib/public/typings/organizationAnalysis.js +16 -0
- package/package.json +20 -24
- package/types/gen/graphqlTypes.d.ts +427 -497
- package/types/gen/schema-types.d.ts +521 -0
- package/types/private/data/action/actionSubscriptionManager.d.ts +19 -0
- package/types/private/data/action/defaultActionService.d.ts +24 -0
- package/types/private/data/action/transformer/actionFulfilmentMethodTransformer.d.ts +14 -0
- package/types/private/data/action/transformer/actionIntentTransformer.d.ts +14 -0
- package/types/private/data/action/transformer/actionOriginTransformer.d.ts +12 -0
- package/types/private/data/action/transformer/actionStatusTransformer.d.ts +12 -0
- package/types/private/data/action/transformer/actionTransformer.d.ts +39 -0
- package/types/private/data/action/transformer/availableActionTransformer.d.ts +15 -0
- package/types/private/data/common/apiClient.d.ts +12 -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/actionEntity.d.ts +187 -0
- package/types/private/domain/entities/action/actionService.d.ts +110 -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/confirmActionOutcomeUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/action/getActionUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/action/initiateActionUseCase.d.ts +17 -0
- package/types/private/domain/use-cases/action/listAvailableActionsUseCase.d.ts +16 -0
- package/types/private/domain/use-cases/action/subscribeToActionUseCase.d.ts +27 -0
- package/types/private/domain/use-cases/action/unsubscribeFromActionUseCase.d.ts +15 -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 +16 -2
- package/types/public/inputs/action.d.ts +30 -0
- package/types/public/inputs/index.d.ts +1 -0
- package/types/public/inputs/organizationAnalysis.d.ts +8 -1
- package/types/public/sudoPrivacyInteractionClient.d.ts +68 -2
- package/types/public/typings/action.d.ts +185 -0
- package/types/public/typings/analysisResult.d.ts +8 -0
- package/types/public/typings/dataHolder.d.ts +2 -0
- package/types/public/typings/index.d.ts +1 -0
- package/types/public/typings/organizationAnalysis.d.ts +15 -0
- package/types/public/typings/subscription.d.ts +23 -0
- package/types/public/typings/virtualPresence.d.ts +25 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 { BaseSubscriptionManager } from '../common/baseSubscriptionManager';
|
|
7
|
+
export class ActionSubscriptionManager extends BaseSubscriptionManager {
|
|
8
|
+
/**
|
|
9
|
+
* Notifies subscribers of an action status update.
|
|
10
|
+
*
|
|
11
|
+
* @param action The updated action.
|
|
12
|
+
*/
|
|
13
|
+
actionUpdated(action) {
|
|
14
|
+
for (const subscriber of this.getSubscribers()) {
|
|
15
|
+
subscriber.actionUpdated(action);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
connectionStatusChanged(state) {
|
|
19
|
+
super.connectionStatusChanged(state);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ConnectionState, } from '../../../public/typings/subscription';
|
|
7
|
+
import { ActionSubscriptionManager } from './actionSubscriptionManager';
|
|
8
|
+
import { ActionFulfilmentMethodTransformer } from './transformer/actionFulfilmentMethodTransformer';
|
|
9
|
+
import { ActionIntentTransformer } from './transformer/actionIntentTransformer';
|
|
10
|
+
import { ActionTransformer } from './transformer/actionTransformer';
|
|
11
|
+
import { AvailableActionTransformer } from './transformer/availableActionTransformer';
|
|
12
|
+
export class DefaultActionService {
|
|
13
|
+
appSync;
|
|
14
|
+
actionTransformer;
|
|
15
|
+
availableActionTransformer;
|
|
16
|
+
intentTransformer;
|
|
17
|
+
fulfilmentMethodTransformer;
|
|
18
|
+
subscriptionManager;
|
|
19
|
+
constructor(appSync) {
|
|
20
|
+
this.appSync = appSync;
|
|
21
|
+
this.actionTransformer = new ActionTransformer();
|
|
22
|
+
this.availableActionTransformer = new AvailableActionTransformer();
|
|
23
|
+
this.intentTransformer = new ActionIntentTransformer();
|
|
24
|
+
this.fulfilmentMethodTransformer = new ActionFulfilmentMethodTransformer();
|
|
25
|
+
this.subscriptionManager = new ActionSubscriptionManager();
|
|
26
|
+
}
|
|
27
|
+
async initiate(input) {
|
|
28
|
+
const result = await this.appSync.initiateAction({
|
|
29
|
+
dataHolderId: input.dataHolderId,
|
|
30
|
+
intent: this.intentTransformer.fromEntityToGraphQL(input.intent),
|
|
31
|
+
fulfilmentMethod: this.fulfilmentMethodTransformer.fromEntityToGraphQL(input.fulfilmentMethod),
|
|
32
|
+
});
|
|
33
|
+
return this.actionTransformer.fromGraphQLToEntity(result);
|
|
34
|
+
}
|
|
35
|
+
async get(id) {
|
|
36
|
+
const result = await this.appSync.getAction(id);
|
|
37
|
+
if (!result) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return this.actionTransformer.fromGraphQLToEntity(result);
|
|
41
|
+
}
|
|
42
|
+
async confirmOutcome(id) {
|
|
43
|
+
const result = await this.appSync.confirmActionOutcome(id);
|
|
44
|
+
return this.actionTransformer.fromGraphQLToEntity(result);
|
|
45
|
+
}
|
|
46
|
+
async listAvailable(input) {
|
|
47
|
+
const result = await this.appSync.listAvailableActions(input);
|
|
48
|
+
const availableActions = (result.items ?? []).map((item) => this.availableActionTransformer.fromGraphQLToEntity(item));
|
|
49
|
+
return {
|
|
50
|
+
availableActions,
|
|
51
|
+
nextToken: result.nextToken ?? undefined,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
async subscribe(input) {
|
|
55
|
+
this.subscriptionManager.subscribe(input.subscriptionId, input.subscriber);
|
|
56
|
+
if (!this.subscriptionManager.getWatcher()) {
|
|
57
|
+
this.subscriptionManager.setWatcher(await this.appSync.onActionStatusUpdated(input.owner));
|
|
58
|
+
this.subscriptionManager.setSubscription(this.setupUpdateSubscription());
|
|
59
|
+
this.subscriptionManager.connectionStatusChanged(ConnectionState.Connected);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
unsubscribe(subscriptionId) {
|
|
63
|
+
this.subscriptionManager.unsubscribe(subscriptionId);
|
|
64
|
+
}
|
|
65
|
+
setupUpdateSubscription() {
|
|
66
|
+
const subscription = this.subscriptionManager.getWatcher()?.subscribe({
|
|
67
|
+
complete: () => {
|
|
68
|
+
this.subscriptionManager.connectionStatusChanged(ConnectionState.Disconnected);
|
|
69
|
+
},
|
|
70
|
+
error: () => {
|
|
71
|
+
this.subscriptionManager.connectionStatusChanged(ConnectionState.Disconnected);
|
|
72
|
+
},
|
|
73
|
+
next: (result) => {
|
|
74
|
+
const action = result.data?.onActionStatusUpdate;
|
|
75
|
+
if (action) {
|
|
76
|
+
const entity = this.actionTransformer.fromGraphQLToEntity(action);
|
|
77
|
+
this.subscriptionManager.actionUpdated(this.actionTransformer.fromEntityToAPI(entity));
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
return subscription;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionFulfilmentMethod } from '../../../../public';
|
|
7
|
+
import { ActionFulfilmentMethodEntity } from '../../../domain/entities/action/actionEntity';
|
|
8
|
+
export class ActionFulfilmentMethodTransformer {
|
|
9
|
+
fromEntityToAPI(entity) {
|
|
10
|
+
switch (entity) {
|
|
11
|
+
case ActionFulfilmentMethodEntity.Assisted:
|
|
12
|
+
return ActionFulfilmentMethod.Assisted;
|
|
13
|
+
case ActionFulfilmentMethodEntity.Delegated:
|
|
14
|
+
return ActionFulfilmentMethod.Delegated;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
fromAPIToEntity(data) {
|
|
18
|
+
switch (data) {
|
|
19
|
+
case ActionFulfilmentMethod.Assisted:
|
|
20
|
+
return ActionFulfilmentMethodEntity.Assisted;
|
|
21
|
+
case ActionFulfilmentMethod.Delegated:
|
|
22
|
+
return ActionFulfilmentMethodEntity.Delegated;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
fromGraphQLToEntity(data) {
|
|
26
|
+
switch (data) {
|
|
27
|
+
case 'ASSISTED':
|
|
28
|
+
return ActionFulfilmentMethodEntity.Assisted;
|
|
29
|
+
case 'DELEGATED':
|
|
30
|
+
return ActionFulfilmentMethodEntity.Delegated;
|
|
31
|
+
default:
|
|
32
|
+
return ActionFulfilmentMethodEntity.Assisted;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
fromEntityToGraphQL(entity) {
|
|
36
|
+
switch (entity) {
|
|
37
|
+
case ActionFulfilmentMethodEntity.Assisted:
|
|
38
|
+
return 'ASSISTED';
|
|
39
|
+
case ActionFulfilmentMethodEntity.Delegated:
|
|
40
|
+
return 'DELEGATED';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionIntent } from '../../../../public';
|
|
7
|
+
import { ActionIntentEntity } from '../../../domain/entities/action/actionEntity';
|
|
8
|
+
export class ActionIntentTransformer {
|
|
9
|
+
fromEntityToAPI(entity) {
|
|
10
|
+
switch (entity) {
|
|
11
|
+
case ActionIntentEntity.StopContact:
|
|
12
|
+
return ActionIntent.StopContact;
|
|
13
|
+
case ActionIntentEntity.AccessMyData:
|
|
14
|
+
return ActionIntent.AccessMyData;
|
|
15
|
+
case ActionIntentEntity.DeleteMyData:
|
|
16
|
+
return ActionIntent.DeleteMyData;
|
|
17
|
+
case ActionIntentEntity.LimitDataUse:
|
|
18
|
+
return ActionIntent.LimitDataUse;
|
|
19
|
+
case ActionIntentEntity.Other:
|
|
20
|
+
return ActionIntent.Other;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
fromAPIToEntity(data) {
|
|
24
|
+
switch (data) {
|
|
25
|
+
case ActionIntent.StopContact:
|
|
26
|
+
return ActionIntentEntity.StopContact;
|
|
27
|
+
case ActionIntent.AccessMyData:
|
|
28
|
+
return ActionIntentEntity.AccessMyData;
|
|
29
|
+
case ActionIntent.DeleteMyData:
|
|
30
|
+
return ActionIntentEntity.DeleteMyData;
|
|
31
|
+
case ActionIntent.LimitDataUse:
|
|
32
|
+
return ActionIntentEntity.LimitDataUse;
|
|
33
|
+
case ActionIntent.Other:
|
|
34
|
+
return ActionIntentEntity.Other;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
fromGraphQLToEntity(data) {
|
|
38
|
+
switch (data) {
|
|
39
|
+
case 'STOP_CONTACT':
|
|
40
|
+
return ActionIntentEntity.StopContact;
|
|
41
|
+
case 'ACCESS_MY_DATA':
|
|
42
|
+
return ActionIntentEntity.AccessMyData;
|
|
43
|
+
case 'DELETE_MY_DATA':
|
|
44
|
+
return ActionIntentEntity.DeleteMyData;
|
|
45
|
+
case 'LIMIT_DATA_USE':
|
|
46
|
+
return ActionIntentEntity.LimitDataUse;
|
|
47
|
+
default:
|
|
48
|
+
return ActionIntentEntity.Other;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
fromEntityToGraphQL(entity) {
|
|
52
|
+
switch (entity) {
|
|
53
|
+
case ActionIntentEntity.StopContact:
|
|
54
|
+
return 'STOP_CONTACT';
|
|
55
|
+
case ActionIntentEntity.AccessMyData:
|
|
56
|
+
return 'ACCESS_MY_DATA';
|
|
57
|
+
case ActionIntentEntity.DeleteMyData:
|
|
58
|
+
return 'DELETE_MY_DATA';
|
|
59
|
+
case ActionIntentEntity.LimitDataUse:
|
|
60
|
+
return 'LIMIT_DATA_USE';
|
|
61
|
+
case ActionIntentEntity.Other:
|
|
62
|
+
return 'OTHER';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionOrigin } from '../../../../public';
|
|
7
|
+
import { ActionOriginEntity } from '../../../domain/entities/action/actionEntity';
|
|
8
|
+
export class ActionOriginTransformer {
|
|
9
|
+
fromEntityToAPI(entity) {
|
|
10
|
+
switch (entity) {
|
|
11
|
+
case ActionOriginEntity.Static:
|
|
12
|
+
return ActionOrigin.Static;
|
|
13
|
+
case ActionOriginEntity.Analysis:
|
|
14
|
+
return ActionOrigin.Analysis;
|
|
15
|
+
case ActionOriginEntity.Discovery:
|
|
16
|
+
return ActionOrigin.Discovery;
|
|
17
|
+
case ActionOriginEntity.Unknown:
|
|
18
|
+
return ActionOrigin.Unknown;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
fromGraphQLToEntity(data) {
|
|
22
|
+
switch (data) {
|
|
23
|
+
case 'STATIC':
|
|
24
|
+
return ActionOriginEntity.Static;
|
|
25
|
+
case 'ANALYSIS':
|
|
26
|
+
return ActionOriginEntity.Analysis;
|
|
27
|
+
case 'DISCOVERY':
|
|
28
|
+
return ActionOriginEntity.Discovery;
|
|
29
|
+
default:
|
|
30
|
+
return ActionOriginEntity.Unknown;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionStatus } from '../../../../public';
|
|
7
|
+
import { ActionStatusEntity } from '../../../domain/entities/action/actionEntity';
|
|
8
|
+
export class ActionStatusTransformer {
|
|
9
|
+
fromEntityToAPI(entity) {
|
|
10
|
+
switch (entity) {
|
|
11
|
+
case ActionStatusEntity.Pending:
|
|
12
|
+
return ActionStatus.Pending;
|
|
13
|
+
case ActionStatusEntity.InProgress:
|
|
14
|
+
return ActionStatus.InProgress;
|
|
15
|
+
case ActionStatusEntity.CompletedUnverified:
|
|
16
|
+
return ActionStatus.CompletedUnverified;
|
|
17
|
+
case ActionStatusEntity.CompletedVerified:
|
|
18
|
+
return ActionStatus.CompletedVerified;
|
|
19
|
+
case ActionStatusEntity.Failed:
|
|
20
|
+
return ActionStatus.Failed;
|
|
21
|
+
case ActionStatusEntity.RequiresUserInput:
|
|
22
|
+
return ActionStatus.RequiresUserInput;
|
|
23
|
+
case ActionStatusEntity.Contradicted:
|
|
24
|
+
return ActionStatus.Contradicted;
|
|
25
|
+
case ActionStatusEntity.Unknown:
|
|
26
|
+
return ActionStatus.Unknown;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
fromGraphQLToEntity(data) {
|
|
30
|
+
switch (data) {
|
|
31
|
+
case 'PENDING':
|
|
32
|
+
return ActionStatusEntity.Pending;
|
|
33
|
+
case 'IN_PROGRESS':
|
|
34
|
+
return ActionStatusEntity.InProgress;
|
|
35
|
+
case 'COMPLETED_UNVERIFIED':
|
|
36
|
+
return ActionStatusEntity.CompletedUnverified;
|
|
37
|
+
case 'COMPLETED_VERIFIED':
|
|
38
|
+
return ActionStatusEntity.CompletedVerified;
|
|
39
|
+
case 'FAILED':
|
|
40
|
+
return ActionStatusEntity.Failed;
|
|
41
|
+
case 'REQUIRES_USER_INPUT':
|
|
42
|
+
return ActionStatusEntity.RequiresUserInput;
|
|
43
|
+
case 'CONTRADICTED':
|
|
44
|
+
return ActionStatusEntity.Contradicted;
|
|
45
|
+
default:
|
|
46
|
+
return ActionStatusEntity.Unknown;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionFulfilmentMethodTransformer } from './actionFulfilmentMethodTransformer';
|
|
7
|
+
import { ActionIntentTransformer } from './actionIntentTransformer';
|
|
8
|
+
import { ActionStatusTransformer } from './actionStatusTransformer';
|
|
9
|
+
export class ActionTransformer {
|
|
10
|
+
intentTransformer = new ActionIntentTransformer();
|
|
11
|
+
fulfilmentMethodTransformer = new ActionFulfilmentMethodTransformer();
|
|
12
|
+
statusTransformer = new ActionStatusTransformer();
|
|
13
|
+
fromGraphQLToEntity(data) {
|
|
14
|
+
return {
|
|
15
|
+
id: data.id,
|
|
16
|
+
virtualPresenceId: data.virtualPresenceId,
|
|
17
|
+
dataHolderId: data.dataHolderId ?? undefined,
|
|
18
|
+
intent: this.intentTransformer.fromGraphQLToEntity(data.intent),
|
|
19
|
+
additionalInfo: data.additionalInfo ?? undefined,
|
|
20
|
+
fulfilmentMethod: this.fulfilmentMethodTransformer.fromGraphQLToEntity(data.fulfilmentMethod),
|
|
21
|
+
status: this.statusTransformer.fromGraphQLToEntity(data.status),
|
|
22
|
+
assistedPayload: data.assistedPayload
|
|
23
|
+
? this.assistedPayloadFromGraphQL(data.assistedPayload)
|
|
24
|
+
: undefined,
|
|
25
|
+
initiatedAt: data.initiatedAtEpochMs != null
|
|
26
|
+
? new Date(data.initiatedAtEpochMs)
|
|
27
|
+
: undefined,
|
|
28
|
+
completedAt: data.completedAtEpochMs != null
|
|
29
|
+
? new Date(data.completedAtEpochMs)
|
|
30
|
+
: undefined,
|
|
31
|
+
owner: data.owner,
|
|
32
|
+
version: data.version,
|
|
33
|
+
createdAt: new Date(data.createdAtEpochMs),
|
|
34
|
+
updatedAt: new Date(data.updatedAtEpochMs),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
fromEntityToAPI(entity) {
|
|
38
|
+
return {
|
|
39
|
+
id: entity.id,
|
|
40
|
+
virtualPresenceId: entity.virtualPresenceId,
|
|
41
|
+
dataHolderId: entity.dataHolderId,
|
|
42
|
+
intent: this.intentTransformer.fromEntityToAPI(entity.intent),
|
|
43
|
+
additionalInfo: entity.additionalInfo,
|
|
44
|
+
fulfilmentMethod: this.fulfilmentMethodTransformer.fromEntityToAPI(entity.fulfilmentMethod),
|
|
45
|
+
status: this.statusTransformer.fromEntityToAPI(entity.status),
|
|
46
|
+
assistedPayload: entity.assistedPayload,
|
|
47
|
+
initiatedAt: entity.initiatedAt,
|
|
48
|
+
completedAt: entity.completedAt,
|
|
49
|
+
owner: entity.owner,
|
|
50
|
+
version: entity.version,
|
|
51
|
+
createdAt: entity.createdAt,
|
|
52
|
+
updatedAt: entity.updatedAt,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
assistedPayloadFromGraphQL(data) {
|
|
56
|
+
return {
|
|
57
|
+
toAddress: data.toAddress ?? undefined,
|
|
58
|
+
unsubscribeUrl: data.unsubscribeUrl ?? undefined,
|
|
59
|
+
unsubscribeMailto: data.unsubscribeMailto ?? undefined,
|
|
60
|
+
contact: data.contact ? this.contactFromGraphQL(data.contact) : undefined,
|
|
61
|
+
jurisdiction: data.jurisdiction ?? undefined,
|
|
62
|
+
instructions: data.instructions ?? undefined,
|
|
63
|
+
emailTemplate: data.emailTemplate
|
|
64
|
+
? this.emailTemplateFromGraphQL(data.emailTemplate)
|
|
65
|
+
: undefined,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
contactFromGraphQL(data) {
|
|
69
|
+
return {
|
|
70
|
+
email: data.email ?? undefined,
|
|
71
|
+
phone: data.phone ?? undefined,
|
|
72
|
+
address: data.address ?? undefined,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
emailTemplateFromGraphQL(data) {
|
|
76
|
+
return {
|
|
77
|
+
subject: data.subject ?? undefined,
|
|
78
|
+
body: data.body,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2026 Anonyome Labs, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ActionFulfilmentMethodTransformer } from './actionFulfilmentMethodTransformer';
|
|
7
|
+
import { ActionIntentTransformer } from './actionIntentTransformer';
|
|
8
|
+
import { ActionOriginTransformer } from './actionOriginTransformer';
|
|
9
|
+
export class AvailableActionTransformer {
|
|
10
|
+
intentTransformer = new ActionIntentTransformer();
|
|
11
|
+
fulfilmentMethodTransformer = new ActionFulfilmentMethodTransformer();
|
|
12
|
+
originTransformer = new ActionOriginTransformer();
|
|
13
|
+
fromGraphQLToEntity(data) {
|
|
14
|
+
return {
|
|
15
|
+
intent: this.intentTransformer.fromGraphQLToEntity(data.intent),
|
|
16
|
+
additionalInfo: data.additionalInfo ?? undefined,
|
|
17
|
+
fulfilmentMethod: this.fulfilmentMethodTransformer.fromGraphQLToEntity(data.fulfilmentMethod),
|
|
18
|
+
origin: this.originTransformer.fromGraphQLToEntity(data.origin),
|
|
19
|
+
title: data.title ?? undefined,
|
|
20
|
+
description: data.description ?? undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
fromEntityToAPI(entity) {
|
|
24
|
+
return {
|
|
25
|
+
intent: this.intentTransformer.fromEntityToAPI(entity.intent),
|
|
26
|
+
additionalInfo: entity.additionalInfo,
|
|
27
|
+
fulfilmentMethod: this.fulfilmentMethodTransformer.fromEntityToAPI(entity.fulfilmentMethod),
|
|
28
|
+
origin: this.originTransformer.fromEntityToAPI(entity.origin),
|
|
29
|
+
title: entity.title,
|
|
30
|
+
description: entity.description,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -13,7 +13,7 @@ export class CapabilitySignalsTransformer {
|
|
|
13
13
|
supportsDataDeletionRequests: this.signalValueTransformer.fromGraphQLToEntity(data.supportsDataDeletionRequests),
|
|
14
14
|
supportsDataExport: this.signalValueTransformer.fromGraphQLToEntity(data.supportsDataExport),
|
|
15
15
|
supportsSubscriptions: this.signalValueTransformer.fromGraphQLToEntity(data.supportsSubscriptions),
|
|
16
|
-
|
|
16
|
+
supportsOptOutOfSale: this.signalValueTransformer.fromGraphQLToEntity(data.supportsOptOutOfSale),
|
|
17
17
|
usesCookiesOrTracking: this.signalValueTransformer.fromGraphQLToEntity(data.usesCookiesOrTracking),
|
|
18
18
|
supportsTwoFactorAuth: this.signalValueTransformer.fromGraphQLToEntity(data.supportsTwoFactorAuth),
|
|
19
19
|
};
|
|
@@ -25,7 +25,10 @@ export class CapabilitySignalsTransformer {
|
|
|
25
25
|
supportsDataDeletionRequests: this.signalValueTransformer.fromEntityToAPI(entity.supportsDataDeletionRequests),
|
|
26
26
|
supportsDataExport: this.signalValueTransformer.fromEntityToAPI(entity.supportsDataExport),
|
|
27
27
|
supportsSubscriptions: this.signalValueTransformer.fromEntityToAPI(entity.supportsSubscriptions),
|
|
28
|
-
|
|
28
|
+
supportsOptOutOfSale: this.signalValueTransformer.fromEntityToAPI(entity.supportsOptOutOfSale),
|
|
29
|
+
// Deprecated: surfaced for backward compatibility, populated from
|
|
30
|
+
// `supportsOptOutOfSale`.
|
|
31
|
+
sellsPersonalInformation: this.signalValueTransformer.fromEntityToAPI(entity.supportsOptOutOfSale),
|
|
29
32
|
usesCookiesOrTracking: this.signalValueTransformer.fromEntityToAPI(entity.usesCookiesOrTracking),
|
|
30
33
|
supportsTwoFactorAuth: this.signalValueTransformer.fromEntityToAPI(entity.supportsTwoFactorAuth),
|
|
31
34
|
};
|
|
@@ -8,6 +8,8 @@ import { OrganizationCategoryEntity } from '../../../domain/entities/analysis-re
|
|
|
8
8
|
export class OrganizationCategoryTransformer {
|
|
9
9
|
fromGraphQLToEntity(data) {
|
|
10
10
|
switch (data) {
|
|
11
|
+
case 'AdultEntertainment':
|
|
12
|
+
return OrganizationCategoryEntity.AdultEntertainment;
|
|
11
13
|
case 'Automotive':
|
|
12
14
|
return OrganizationCategoryEntity.Automotive;
|
|
13
15
|
case 'Communications':
|
|
@@ -72,6 +74,8 @@ export class OrganizationCategoryTransformer {
|
|
|
72
74
|
}
|
|
73
75
|
fromEntityToAPI(entity) {
|
|
74
76
|
switch (entity) {
|
|
77
|
+
case OrganizationCategoryEntity.AdultEntertainment:
|
|
78
|
+
return OrganizationCategory.AdultEntertainment;
|
|
75
79
|
case OrganizationCategoryEntity.Automotive:
|
|
76
80
|
return OrganizationCategory.Automotive;
|
|
77
81
|
case OrganizationCategoryEntity.Communications:
|
|
@@ -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 { ConnectVirtualPresenceDocument, DisconnectVirtualPresenceDocument, GetAnalysisResultDocument, GetDataHolderDocument, GetProviderConfigurationDocument, GetOrganizationAnalysisDocument, ListAnalysisResultsDocument, ListDataHolderScanSummariesDocument, ListDataHoldersDocument, ListVirtualPresencesDocument, 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
|
});
|
|
@@ -122,6 +142,40 @@ export class ApiClient {
|
|
|
122
142
|
});
|
|
123
143
|
return data.listAnalysisResults;
|
|
124
144
|
}
|
|
145
|
+
async initiateAction(input) {
|
|
146
|
+
const data = await this.performMutation({
|
|
147
|
+
mutation: InitiateActionDocument,
|
|
148
|
+
variables: { input },
|
|
149
|
+
calleeName: this.initiateAction.name,
|
|
150
|
+
});
|
|
151
|
+
return data.initiateAction;
|
|
152
|
+
}
|
|
153
|
+
async confirmActionOutcome(id) {
|
|
154
|
+
const data = await this.performMutation({
|
|
155
|
+
mutation: ConfirmActionOutcomeDocument,
|
|
156
|
+
variables: { id },
|
|
157
|
+
calleeName: this.confirmActionOutcome.name,
|
|
158
|
+
});
|
|
159
|
+
return data.confirmActionOutcome;
|
|
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
|
+
}
|
|
169
|
+
async listAvailableActions(input) {
|
|
170
|
+
const data = await this.performQuery({
|
|
171
|
+
query: ListAvailableActionsDocument,
|
|
172
|
+
variables: {
|
|
173
|
+
dataHolderId: input.dataHolderId,
|
|
174
|
+
},
|
|
175
|
+
calleeName: this.listAvailableActions.name,
|
|
176
|
+
});
|
|
177
|
+
return data.listAvailableActions;
|
|
178
|
+
}
|
|
125
179
|
onVirtualPresenceUpdated(owner) {
|
|
126
180
|
return this.performSubscription({
|
|
127
181
|
subscription: OnVirtualPresenceUpdateDocument,
|
|
@@ -149,6 +203,15 @@ export class ApiClient {
|
|
|
149
203
|
calleeName: this.onAnalysisResultUpdated.name,
|
|
150
204
|
});
|
|
151
205
|
}
|
|
206
|
+
onActionStatusUpdated(owner) {
|
|
207
|
+
return this.performSubscription({
|
|
208
|
+
subscription: OnActionStatusUpdateDocument,
|
|
209
|
+
variables: {
|
|
210
|
+
owner,
|
|
211
|
+
},
|
|
212
|
+
calleeName: this.onActionStatusUpdated.name,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
152
215
|
async performQuery({ variables, query, calleeName, }) {
|
|
153
216
|
let result;
|
|
154
217
|
try {
|
|
@@ -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
|
+
}
|