@ampsec/platform-client 63.1.1 → 63.2.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/build/src/services/AmpApi.d.ts +3 -3
- package/build/src/services/AmpApi.js +1 -1
- package/build/src/services/AmpApi.js.map +1 -1
- package/build/src/services/customActionsService.d.ts +8 -0
- package/build/src/services/customActionsService.js +20 -0
- package/build/src/services/customActionsService.js.map +1 -0
- package/build/src/services/index.d.ts +1 -0
- package/build/src/services/index.js +1 -0
- package/build/src/services/index.js.map +1 -1
- package/package.json +1 -1
- package/src/services/AmpApi.ts +3 -4
- package/src/services/customActionsService.ts +19 -0
- package/src/services/index.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionExecutionDto, AgentDto, AgentUpsertDto, AssetDto,
|
|
2
|
-
import { AmpEntityService, AmpDataService, AmpReportService, AmpSettingsService, ConnectorsService, FindingsInsightsService, FindingsService, NotificationService, PredictionService } from '.';
|
|
1
|
+
import { ActionExecutionDto, AgentDto, AgentUpsertDto, AssetDto, CustomScoreCohortDto, CustomScoreCohortUpsertDto, CustomScoreValueDto, CustomScoreValueUpsertDto, FindingSpecDto, FindingSpecUpsertDto, ProviderDto, ReportResultDto, SaasAssetDto, SaasComponentDto, SaasUserDto, TenantDto, TenantUpsertDto, TokenDto, UserDto } from '../dto';
|
|
2
|
+
import { AmpEntityService, AmpDataService, AmpReportService, AmpSettingsService, ConnectorsService, FindingsInsightsService, FindingsService, NotificationService, PredictionService, CustomActionsService } from '.';
|
|
3
3
|
import { AmpRestClientOptions, AgentIdentityService, ConnectorInstallService, EnumService, RestClient } from './rest';
|
|
4
4
|
import { UsersInsightsService } from './usersInsights.service';
|
|
5
5
|
import { FlowSpecsService } from './flowSpecs.service';
|
|
@@ -23,7 +23,7 @@ export declare class AmpApi {
|
|
|
23
23
|
readonly asset: AmpDataService<AssetDto>;
|
|
24
24
|
readonly cohorts: CohortService;
|
|
25
25
|
readonly connectors: ConnectorsService;
|
|
26
|
-
readonly customActions:
|
|
26
|
+
readonly customActions: CustomActionsService;
|
|
27
27
|
readonly customScoreValues: AmpEntityService<CustomScoreValueUpsertDto, CustomScoreValueDto>;
|
|
28
28
|
readonly customScoreCohorts: AmpEntityService<CustomScoreCohortUpsertDto, CustomScoreCohortDto>;
|
|
29
29
|
readonly enums: EnumService;
|
|
@@ -26,7 +26,7 @@ class AmpApi {
|
|
|
26
26
|
this.asset = new _1.AmpDataServiceImpl(rest, constants_1.KIND.ASSETS);
|
|
27
27
|
this.cohorts = new CohortService_1.CohortService(rest);
|
|
28
28
|
this.connectors = new _1.ConnectorsService(rest);
|
|
29
|
-
this.customActions = new _1.
|
|
29
|
+
this.customActions = new _1.CustomActionsService(rest);
|
|
30
30
|
this.customScoreCohorts = new _1.AmpEntityServiceImpl(rest, constants_1.KIND.CUSTOM_SCORE_COHORTS);
|
|
31
31
|
this.customScoreValues = new _1.AmpEntityServiceImpl(rest, constants_1.KIND.CUSTOM_SCORE_VALUES);
|
|
32
32
|
this.enums = new rest_1.DefaultEnumService(rest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmpApi.js","sourceRoot":"","sources":["../../../src/services/AmpApi.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AmpApi.js","sourceRoot":"","sources":["../../../src/services/AmpApi.ts"],"names":[],"mappings":";;;AAqBA,wBAcW;AACX,2CAAmD;AACnD,iCAA0J;AAC1J,mEAA6D;AAC7D,2DAAqD;AACrD,wDAAmD;AAInD;;;;;;;;;;;GAWG;AACH,MAAa,MAAM;IA8BjB,YAAY,IAAgB;QAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,qBAAkB,CAAqB,IAAI,EAAE,gBAAI,CAAC,gBAAgB,CAAC,CAAC;QAChG,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAoB,CAA2B,IAAI,EAAE,gBAAI,CAAC,MAAM,CAAC,CAAC;QACpF,IAAI,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CustomActionUpsertDto, CustomerActionSummaryDto, Page } from '../dto';
|
|
3
|
+
import { AmpEntityServiceImpl } from './entity.service';
|
|
4
|
+
import { RestClient } from './rest';
|
|
5
|
+
export declare class CustomActionsService extends AmpEntityServiceImpl<CustomActionUpsertDto, CustomActionDto> {
|
|
6
|
+
constructor(rest: RestClient);
|
|
7
|
+
summary: (filter?: FilterCriteria) => Promise<Page<CustomerActionSummaryDto>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomActionsService = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
const entity_service_1 = require("./entity.service");
|
|
6
|
+
class CustomActionsService extends entity_service_1.AmpEntityServiceImpl {
|
|
7
|
+
constructor(rest) {
|
|
8
|
+
super(rest, constants_1.KIND.CUSTOM_ACTIONS);
|
|
9
|
+
this.summary = async (filter) => {
|
|
10
|
+
const res = await this.rest.call({
|
|
11
|
+
url: `/${this.targetApi}/v1/${this.kind}/_summary`,
|
|
12
|
+
method: 'GET',
|
|
13
|
+
params: filter,
|
|
14
|
+
});
|
|
15
|
+
return res.data;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.CustomActionsService = CustomActionsService;
|
|
20
|
+
//# sourceMappingURL=customActionsService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customActionsService.js","sourceRoot":"","sources":["../../../src/services/customActionsService.ts"],"names":[],"mappings":";;;AAEA,2CAAiC;AACjC,qDAAsD;AAGtD,MAAa,oBAAqB,SAAQ,qCAA4D;IACpG,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,EAAE,gBAAI,CAAC,cAAc,CAAC,CAAC;QAEnC,YAAO,GAAG,KAAK,EAAE,MAAuB,EAA2C,EAAE;YACnF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/B,GAAG,EAAE,IAAI,IAAI,CAAC,SAAS,OAAO,IAAI,CAAC,IAAI,WAAW;gBAClD,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,IAAsC,CAAC;QACpD,CAAC,CAAC;IARF,CAAC;CASF;AAZD,oDAYC"}
|
|
@@ -33,4 +33,5 @@ __exportStar(require("./notification.service"), exports);
|
|
|
33
33
|
__exportStar(require("./reports.service"), exports);
|
|
34
34
|
__exportStar(require("./contentful.service"), exports);
|
|
35
35
|
__exportStar(require("./prediction.service"), exports);
|
|
36
|
+
__exportStar(require("./customActionsService"), exports);
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2DAAyC;AACzC,iDAA+B;AAC/B,mDAAiC;AACjC,6DAA2C;AAC3C,qDAAmC;AACnC,mDAAiC;AACjC,yCAAuB;AACvB,uDAAqC;AACrC,qDAAmC;AACnC,0CAAwB;AACxB,uDAAqC;AACrC,yDAAuC;AACvC,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2DAAyC;AACzC,iDAA+B;AAC/B,mDAAiC;AACjC,6DAA2C;AAC3C,qDAAmC;AACnC,mDAAiC;AACjC,yCAAuB;AACvB,uDAAqC;AACrC,qDAAmC;AACnC,0CAAwB;AACxB,uDAAqC;AACrC,yDAAuC;AACvC,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,yDAAuC"}
|
package/package.json
CHANGED
package/src/services/AmpApi.ts
CHANGED
|
@@ -3,8 +3,6 @@ import {
|
|
|
3
3
|
AgentDto,
|
|
4
4
|
AgentUpsertDto,
|
|
5
5
|
AssetDto,
|
|
6
|
-
CustomActionDto,
|
|
7
|
-
CustomActionUpsertDto,
|
|
8
6
|
CustomScoreCohortDto,
|
|
9
7
|
CustomScoreCohortUpsertDto,
|
|
10
8
|
CustomScoreValueDto,
|
|
@@ -34,6 +32,7 @@ import {
|
|
|
34
32
|
FindingsService,
|
|
35
33
|
NotificationService,
|
|
36
34
|
PredictionService,
|
|
35
|
+
CustomActionsService,
|
|
37
36
|
} from '.';
|
|
38
37
|
import {KIND, TARGET_API_AGENT} from './constants';
|
|
39
38
|
import {getAmpRestClient, AmpRestClientOptions, AgentIdentityService, ConnectorInstallService, DefaultEnumService, EnumService, RestClient} from './rest';
|
|
@@ -61,7 +60,7 @@ export class AmpApi {
|
|
|
61
60
|
readonly asset: AmpDataService<AssetDto>;
|
|
62
61
|
readonly cohorts: CohortService;
|
|
63
62
|
readonly connectors: ConnectorsService;
|
|
64
|
-
readonly customActions:
|
|
63
|
+
readonly customActions: CustomActionsService;
|
|
65
64
|
readonly customScoreValues: AmpEntityService<CustomScoreValueUpsertDto, CustomScoreValueDto>;
|
|
66
65
|
readonly customScoreCohorts: AmpEntityService<CustomScoreCohortUpsertDto, CustomScoreCohortDto>;
|
|
67
66
|
readonly enums: EnumService;
|
|
@@ -91,7 +90,7 @@ export class AmpApi {
|
|
|
91
90
|
this.asset = new AmpDataServiceImpl<AssetDto>(rest, KIND.ASSETS);
|
|
92
91
|
this.cohorts = new CohortService(rest);
|
|
93
92
|
this.connectors = new ConnectorsService(rest);
|
|
94
|
-
this.customActions = new
|
|
93
|
+
this.customActions = new CustomActionsService(rest);
|
|
95
94
|
this.customScoreCohorts = new AmpEntityServiceImpl<CustomScoreCohortUpsertDto, CustomScoreCohortDto>(rest, KIND.CUSTOM_SCORE_COHORTS);
|
|
96
95
|
this.customScoreValues = new AmpEntityServiceImpl<CustomScoreValueUpsertDto, CustomScoreValueDto>(rest, KIND.CUSTOM_SCORE_VALUES);
|
|
97
96
|
this.enums = new DefaultEnumService(rest);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {FilterCriteria} from '../FilterCriteria';
|
|
2
|
+
import {CustomActionDto, CustomActionUpsertDto, CustomerActionSummaryDto, Page} from '../dto';
|
|
3
|
+
import {KIND} from './constants';
|
|
4
|
+
import {AmpEntityServiceImpl} from './entity.service';
|
|
5
|
+
import {RestClient} from './rest';
|
|
6
|
+
|
|
7
|
+
export class CustomActionsService extends AmpEntityServiceImpl<CustomActionUpsertDto, CustomActionDto> {
|
|
8
|
+
constructor(rest: RestClient) {
|
|
9
|
+
super(rest, KIND.CUSTOM_ACTIONS);
|
|
10
|
+
}
|
|
11
|
+
summary = async (filter?: FilterCriteria): Promise<Page<CustomerActionSummaryDto>> => {
|
|
12
|
+
const res = await this.rest.call({
|
|
13
|
+
url: `/${this.targetApi}/v1/${this.kind}/_summary`,
|
|
14
|
+
method: 'GET',
|
|
15
|
+
params: filter,
|
|
16
|
+
});
|
|
17
|
+
return res.data as Page<CustomerActionSummaryDto>;
|
|
18
|
+
};
|
|
19
|
+
}
|
package/src/services/index.ts
CHANGED