@ampsec/platform-client 69.7.0 → 70.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/dto/findings.dto.js +9 -0
- package/build/src/dto/findings.dto.js.map +1 -1
- package/build/src/services/AmpSdk.d.ts +3 -2
- package/build/src/services/AmpSdk.js +2 -1
- package/build/src/services/AmpSdk.js.map +1 -1
- package/build/src/services/findings.service.d.ts +4 -4
- package/build/src/services/findings.service.js +5 -4
- package/build/src/services/findings.service.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/findings.dto.ts +10 -0
- package/src/services/AmpSdk.ts +3 -4
- package/src/services/findings.service.ts +6 -5
|
@@ -20,6 +20,15 @@ exports._FindingBucketSummaryDto = zod_1.z.object({
|
|
|
20
20
|
flowStateId: zod_1.z.string().nullable(),
|
|
21
21
|
flowStateCreatedAt: zod_1.z.string().nullable(),
|
|
22
22
|
});
|
|
23
|
+
// export const _PendingFindingFilter = z.object({
|
|
24
|
+
// tid: z.string().optional(),
|
|
25
|
+
// flowSpecIds: z.array(z.string()),
|
|
26
|
+
// eventTypes: z.array(z.string()).optional(),
|
|
27
|
+
// severities: z.array(z.nativeEnum(FindingSeverity)).optional(),
|
|
28
|
+
// limit: z.number().optional(),
|
|
29
|
+
// offset: z.number().optional(),
|
|
30
|
+
// });
|
|
31
|
+
// export type PendingFindingFilter = z.infer<typeof _PendingFindingFilter>;
|
|
23
32
|
const _FindingSpecDescription = zod_1.z.unknown();
|
|
24
33
|
const _FindingSpecInsights = zod_1.z.object({
|
|
25
34
|
meta: zod_1.z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings.dto.js","sourceRoot":"","sources":["../../../src/dto/findings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,yCAA6E;AAC7E,mCAAkF;AAClF,mCAAuE;AAY1D,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,iBAAiB;IAC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AAC,UAAU,CAAC,sBAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,oEAAoE;IACtH,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAe,CAAC;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAKU,QAAA,qBAAqB,GAAG,uBAAe,CAAC,OAAO,CAAC,0BAAe,CAAC,CAAC;AAGjE,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlatformActionExecutionDto, PlatformActionExecutionUpsertDto, PlatformCustomActionDto, PlatformCustomActionUpsertDto, PlatformCustomScoreCohortDto, PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreValueDto, PlatformCustomScoreValueUpsertDto,
|
|
1
|
+
import { PlatformActionExecutionDto, PlatformActionExecutionUpsertDto, PlatformCustomActionDto, PlatformCustomActionUpsertDto, PlatformCustomScoreCohortDto, PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreValueDto, PlatformCustomScoreValueUpsertDto, PlatformFindingSpecDto, PlatformFindingSpecUpsertDto, PlatformFlowSpecDto, PlatformFlowSpecUpsertDto, PlatformFlowStateDto, PlatformFlowStateUpsertDto, PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto, PlatformJobSpecDto, PlatformJobSpecUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformStagedSaasAssetDto, PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasUserDto, PlatformStagedSaasUserUpsertDto, PlatformTokenDto, PlatformTokenUpsertDto, ProviderDto, TenantDto, TenantUpsertDto } from '../dto';
|
|
2
2
|
import { AmpEntityService, AmpSdkAssetService, AmpSdkTenantService, AmpSdkUserService, TruncatableAmpEntityService } from './entity.service';
|
|
3
3
|
import { AmpRestClientOptions, RestClient } from './rest';
|
|
4
4
|
import { EnumService } from './rest/EnumService';
|
|
@@ -8,6 +8,7 @@ import { ContentfulService } from './contentful.service';
|
|
|
8
8
|
import { FindingsInsightsService } from './findingsInsights.service';
|
|
9
9
|
import { PlatformConnectorService } from './connector.platform.service';
|
|
10
10
|
import { PlatformAgentService } from './AgentsService';
|
|
11
|
+
import { FindingsService } from './findings.service';
|
|
11
12
|
export type AmpSdkOptions = AmpRestClientOptions;
|
|
12
13
|
/**
|
|
13
14
|
* AMP API
|
|
@@ -28,7 +29,7 @@ export declare class AmpSdkServices {
|
|
|
28
29
|
readonly customScoreCohorts: AmpEntityService<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>;
|
|
29
30
|
readonly customScoreValues: AmpEntityService<PlatformCustomScoreValueUpsertDto, PlatformCustomScoreValueDto>;
|
|
30
31
|
readonly enums: EnumService;
|
|
31
|
-
readonly findings:
|
|
32
|
+
readonly findings: FindingsService;
|
|
32
33
|
readonly findingSpecs: AmpSaaSEntityService<PlatformFindingSpecUpsertDto, PlatformFindingSpecDto>;
|
|
33
34
|
readonly findingsInsights: FindingsInsightsService;
|
|
34
35
|
readonly flowSpecs: AmpSaaSEntityService<PlatformFlowSpecUpsertDto, PlatformFlowSpecDto>;
|
|
@@ -11,6 +11,7 @@ const contentful_service_1 = require("./contentful.service");
|
|
|
11
11
|
const findingsInsights_service_1 = require("./findingsInsights.service");
|
|
12
12
|
const connector_platform_service_1 = require("./connector.platform.service");
|
|
13
13
|
const AgentsService_1 = require("./AgentsService");
|
|
14
|
+
const findings_service_1 = require("./findings.service");
|
|
14
15
|
/**
|
|
15
16
|
* AMP API
|
|
16
17
|
* This client is a wrapper around the AMP REST API meant to be used by
|
|
@@ -31,7 +32,7 @@ class AmpSdkServices {
|
|
|
31
32
|
this.customScoreCohorts = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.CUSTOM_SCORE_COHORTS, constants_1.TARGET_API_PLATFORM);
|
|
32
33
|
this.customScoreValues = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.CUSTOM_SCORE_VALUES, constants_1.TARGET_API_PLATFORM);
|
|
33
34
|
this.enums = new EnumService_1.DefaultEnumService(rest, constants_1.TARGET_API_PLATFORM);
|
|
34
|
-
this.findings = new
|
|
35
|
+
this.findings = new findings_service_1.FindingsService(rest, constants_1.TARGET_API_PLATFORM);
|
|
35
36
|
this.findingSpecs = new saasEntity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.FINDING_SPECS, constants_1.TARGET_API_PLATFORM);
|
|
36
37
|
this.findingsInsights = new findingsInsights_service_1.FindingsInsightsService(rest, constants_1.KIND.FINDINGS_INSIGHTS, constants_1.TARGET_API_PLATFORM);
|
|
37
38
|
this.flowSpecs = new saasEntity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.FLOW_SPECS, constants_1.TARGET_API_PLATFORM);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AAwCA,qDAQ0B;AAC1B,iCAA0E;AAC1E,2CAAsD;AACtD,oDAAmE;AACnE,yDAAyD;AACzD,6DAA+J;AAC/J,6DAAuD;AACvD,yEAAmE;AACnE,6EAAsE;AACtE,mDAAqD;AACrD,yDAAmD;AAInD;;;;;;;;GAQG;AACH,MAAa,cAAc;IAgCzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,qCAAoB,CAA+D,IAAI,EAAE,gBAAI,CAAC,gBAAgB,EAAE,+BAAmB,CAAC,CAAC;QACjK,IAAI,CAAC,MAAM,GAAG,IAAI,oCAAoB,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,mCAAkB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,IAAI,qDAAwB,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,IAAI,sCAAiB,EAAE,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,qCAAoB,CAAyD,IAAI,EAAE,gBAAI,CAAC,cAAc,EAAE,+BAAmB,CAAC,CAAC;QACtJ,IAAI,CAAC,kBAAkB,GAAG,IAAI,qCAAoB,CAAmE,IAAI,EAAE,gBAAI,CAAC,oBAAoB,EAAE,+BAAmB,CAAC,CAAC;QAC3K,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAAoB,CAAiE,IAAI,EAAE,gBAAI,CAAC,mBAAmB,EAAE,+BAAmB,CAAC,CAAC;QACvK,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAkB,CAAC,IAAI,EAAE,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
|
2
|
-
import { AmpDataServiceImpl } from './data.service';
|
|
1
|
+
import { FindingBucketSummaryDto, FindingDto, FindingStatus, Page, PlatformFindingDto, PlatformFindingUpsertDto } from '../dto';
|
|
3
2
|
import { RestClient, RestResponse } from './rest';
|
|
4
3
|
import { TargetApi } from './constants';
|
|
4
|
+
import { AmpEntityServiceImpl } from './entity.service';
|
|
5
5
|
export interface FindingPatchDto {
|
|
6
6
|
id?: string;
|
|
7
7
|
status: FindingStatus;
|
|
8
8
|
}
|
|
9
|
-
export declare class FindingsService extends
|
|
9
|
+
export declare class FindingsService extends AmpEntityServiceImpl<PlatformFindingUpsertDto, PlatformFindingDto> {
|
|
10
10
|
constructor(rest: RestClient, targetApi?: TargetApi);
|
|
11
11
|
patch(id: string, values: FindingPatchDto | FindingPatchDto[]): Promise<Page<FindingDto>>;
|
|
12
12
|
patchAll(values: FindingPatchDto[]): Promise<Page<FindingDto>>;
|
|
@@ -21,5 +21,5 @@ export declare class FindingsService extends AmpDataServiceImpl<FindingDto> {
|
|
|
21
21
|
* @param limit Optional limit for pagination. Default 50
|
|
22
22
|
* @returns Page of FindingBucketSummaryDto scoped to a tenant.
|
|
23
23
|
*/
|
|
24
|
-
getFindingBuckets(tid: string, offset
|
|
24
|
+
getFindingBuckets(tid: string, offset: number | undefined, limit: number | undefined, keepOpenThresholdMs: number): Promise<Page<FindingBucketSummaryDto>>;
|
|
25
25
|
}
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.FindingsService = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const dto_1 = require("../dto");
|
|
9
|
-
const data_service_1 = require("./data.service");
|
|
10
9
|
const constants_1 = require("./constants");
|
|
11
|
-
|
|
10
|
+
const entity_service_1 = require("./entity.service");
|
|
11
|
+
class FindingsService extends entity_service_1.AmpEntityServiceImpl {
|
|
12
12
|
constructor(rest, targetApi = 'api') {
|
|
13
13
|
super(rest, constants_1.KIND.FINDINGS, targetApi);
|
|
14
14
|
}
|
|
@@ -46,8 +46,8 @@ class FindingsService extends data_service_1.AmpDataServiceImpl {
|
|
|
46
46
|
* @param limit Optional limit for pagination. Default 50
|
|
47
47
|
* @returns Page of FindingBucketSummaryDto scoped to a tenant.
|
|
48
48
|
*/
|
|
49
|
-
async getFindingBuckets(tid, offset = 0, limit = 50) {
|
|
50
|
-
const url = `/${
|
|
49
|
+
async getFindingBuckets(tid, offset = 0, limit = 50, keepOpenThresholdMs) {
|
|
50
|
+
const url = `/${this.targetApi}/v1/${this.kind}/_byUserBuckets`;
|
|
51
51
|
const res = await this.rest.call({
|
|
52
52
|
url,
|
|
53
53
|
method: 'GET',
|
|
@@ -55,6 +55,7 @@ class FindingsService extends data_service_1.AmpDataServiceImpl {
|
|
|
55
55
|
tid,
|
|
56
56
|
limit,
|
|
57
57
|
offset,
|
|
58
|
+
keepOpenThresholdMs,
|
|
58
59
|
},
|
|
59
60
|
});
|
|
60
61
|
return (0, dto_1.toTypedPage)(dto_1._FindingBucketSummaryDto, res.data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings.service.js","sourceRoot":"","sources":["../../../src/services/findings.service.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"findings.service.js","sourceRoot":"","sources":["../../../src/services/findings.service.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,gCAAqK;AAErK,2CAA+D;AAC/D,qDAAsD;AAOtD,MAAa,eAAgB,SAAQ,qCAAkE;IACrG,YAAY,IAAgB,EAAE,YAAuB,KAAK;QACxD,KAAK,CAAC,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,EAAU,EAAE,MAA2C;QAC3D,MAAM,GAAG,GAAG,gBAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,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.json
CHANGED
package/src/dto/findings.dto.ts
CHANGED
|
@@ -83,6 +83,16 @@ export const _FindingBucketSummaryDto = z.object({
|
|
|
83
83
|
});
|
|
84
84
|
export type FindingBucketSummaryDto = z.infer<typeof _FindingBucketSummaryDto>;
|
|
85
85
|
|
|
86
|
+
// export const _PendingFindingFilter = z.object({
|
|
87
|
+
// tid: z.string().optional(),
|
|
88
|
+
// flowSpecIds: z.array(z.string()),
|
|
89
|
+
// eventTypes: z.array(z.string()).optional(),
|
|
90
|
+
// severities: z.array(z.nativeEnum(FindingSeverity)).optional(),
|
|
91
|
+
// limit: z.number().optional(),
|
|
92
|
+
// offset: z.number().optional(),
|
|
93
|
+
// });
|
|
94
|
+
// export type PendingFindingFilter = z.infer<typeof _PendingFindingFilter>;
|
|
95
|
+
|
|
86
96
|
const _FindingSpecDescription = z.unknown();
|
|
87
97
|
const _FindingSpecInsights = z.object({
|
|
88
98
|
meta: z
|
package/src/services/AmpSdk.ts
CHANGED
|
@@ -7,10 +7,8 @@ import {
|
|
|
7
7
|
PlatformCustomScoreCohortUpsertDto,
|
|
8
8
|
PlatformCustomScoreValueDto,
|
|
9
9
|
PlatformCustomScoreValueUpsertDto,
|
|
10
|
-
PlatformFindingDto,
|
|
11
10
|
PlatformFindingSpecDto,
|
|
12
11
|
PlatformFindingSpecUpsertDto,
|
|
13
|
-
PlatformFindingUpsertDto,
|
|
14
12
|
PlatformFlowSpecDto,
|
|
15
13
|
PlatformFlowSpecUpsertDto,
|
|
16
14
|
PlatformFlowStateDto,
|
|
@@ -58,6 +56,7 @@ import {ContentfulService} from './contentful.service';
|
|
|
58
56
|
import {FindingsInsightsService} from './findingsInsights.service';
|
|
59
57
|
import {PlatformConnectorService} from './connector.platform.service';
|
|
60
58
|
import {PlatformAgentService} from './AgentsService';
|
|
59
|
+
import {FindingsService} from './findings.service';
|
|
61
60
|
|
|
62
61
|
export type AmpSdkOptions = AmpRestClientOptions;
|
|
63
62
|
|
|
@@ -80,7 +79,7 @@ export class AmpSdkServices {
|
|
|
80
79
|
readonly customScoreCohorts: AmpEntityService<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>;
|
|
81
80
|
readonly customScoreValues: AmpEntityService<PlatformCustomScoreValueUpsertDto, PlatformCustomScoreValueDto>;
|
|
82
81
|
readonly enums: EnumService;
|
|
83
|
-
readonly findings:
|
|
82
|
+
readonly findings: FindingsService;
|
|
84
83
|
readonly findingSpecs: AmpSaaSEntityService<PlatformFindingSpecUpsertDto, PlatformFindingSpecDto>;
|
|
85
84
|
readonly findingsInsights: FindingsInsightsService;
|
|
86
85
|
readonly flowSpecs: AmpSaaSEntityService<PlatformFlowSpecUpsertDto, PlatformFlowSpecDto>;
|
|
@@ -112,7 +111,7 @@ export class AmpSdkServices {
|
|
|
112
111
|
this.customScoreCohorts = new AmpEntityServiceImpl<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>(rest, KIND.CUSTOM_SCORE_COHORTS, TARGET_API_PLATFORM);
|
|
113
112
|
this.customScoreValues = new AmpEntityServiceImpl<PlatformCustomScoreValueUpsertDto, PlatformCustomScoreValueDto>(rest, KIND.CUSTOM_SCORE_VALUES, TARGET_API_PLATFORM);
|
|
114
113
|
this.enums = new DefaultEnumService(rest, TARGET_API_PLATFORM);
|
|
115
|
-
this.findings = new
|
|
114
|
+
this.findings = new FindingsService(rest, TARGET_API_PLATFORM);
|
|
116
115
|
this.findingSpecs = new AmpSaaSEntityServiceImpl<PlatformFindingSpecUpsertDto, PlatformFindingSpecDto>(rest, KIND.FINDING_SPECS, TARGET_API_PLATFORM);
|
|
117
116
|
this.findingsInsights = new FindingsInsightsService(rest, KIND.FINDINGS_INSIGHTS, TARGET_API_PLATFORM);
|
|
118
117
|
this.flowSpecs = new AmpSaaSEntityServiceImpl<PlatformFlowSpecUpsertDto, PlatformFlowSpecDto>(rest, KIND.FLOW_SPECS, TARGET_API_PLATFORM);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import {FindingBucketSummaryDto, FindingDto, FindingStatus, Page, _FindingBucketSummaryDto, toTypedPage} from '../dto';
|
|
3
|
-
import {AmpDataServiceImpl} from './data.service';
|
|
2
|
+
import {FindingBucketSummaryDto, FindingDto, FindingStatus, Page, PlatformFindingDto, PlatformFindingUpsertDto, _FindingBucketSummaryDto, toTypedPage} from '../dto';
|
|
4
3
|
import {RestClient, RestResponse} from './rest';
|
|
5
4
|
import {KIND, TARGET_API_ENGAGE, TargetApi} from './constants';
|
|
5
|
+
import {AmpEntityServiceImpl} from './entity.service';
|
|
6
6
|
|
|
7
7
|
export interface FindingPatchDto {
|
|
8
8
|
id?: string;
|
|
9
9
|
status: FindingStatus;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export class FindingsService extends
|
|
12
|
+
export class FindingsService extends AmpEntityServiceImpl<PlatformFindingUpsertDto, PlatformFindingDto> {
|
|
13
13
|
constructor(rest: RestClient, targetApi: TargetApi = 'api') {
|
|
14
14
|
super(rest, KIND.FINDINGS, targetApi);
|
|
15
15
|
}
|
|
@@ -51,8 +51,8 @@ export class FindingsService extends AmpDataServiceImpl<FindingDto> {
|
|
|
51
51
|
* @param limit Optional limit for pagination. Default 50
|
|
52
52
|
* @returns Page of FindingBucketSummaryDto scoped to a tenant.
|
|
53
53
|
*/
|
|
54
|
-
async getFindingBuckets(tid: string, offset = 0, limit = 50): Promise<Page<FindingBucketSummaryDto>> {
|
|
55
|
-
const url = `/${
|
|
54
|
+
async getFindingBuckets(tid: string, offset = 0, limit = 50, keepOpenThresholdMs: number): Promise<Page<FindingBucketSummaryDto>> {
|
|
55
|
+
const url = `/${this.targetApi}/v1/${this.kind}/_byUserBuckets`;
|
|
56
56
|
const res = await this.rest.call({
|
|
57
57
|
url,
|
|
58
58
|
method: 'GET',
|
|
@@ -60,6 +60,7 @@ export class FindingsService extends AmpDataServiceImpl<FindingDto> {
|
|
|
60
60
|
tid,
|
|
61
61
|
limit,
|
|
62
62
|
offset,
|
|
63
|
+
keepOpenThresholdMs,
|
|
63
64
|
},
|
|
64
65
|
});
|
|
65
66
|
return toTypedPage(_FindingBucketSummaryDto, res.data);
|