@ampsec/platform-client 84.40.0 → 84.42.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/browserCoachingSubject.dto.d.ts +2 -1
- package/build/src/dto/browserCoachingSubject.dto.js +1 -0
- package/build/src/dto/browserCoachingSubject.dto.js.map +1 -1
- package/build/src/dto/findings.dto.d.ts +97 -5
- package/build/src/dto/findings.dto.js +26 -1
- package/build/src/dto/findings.dto.js.map +1 -1
- package/build/src/dto/findingsInsights.dto.d.ts +2 -2
- package/build/src/dto/index.d.ts +1 -0
- package/build/src/dto/index.js +1 -0
- package/build/src/dto/index.js.map +1 -1
- package/build/src/dto/platform/platform.findings.dto.d.ts +5 -5
- package/build/src/dto/platform/platform.webhookProviders.dto.d.ts +5 -5
- package/build/src/dto/rules.dto.d.ts +69 -0
- package/build/src/dto/rules.dto.js +18 -0
- package/build/src/dto/rules.dto.js.map +1 -0
- package/build/src/dto/tagSpecs.dto.d.ts +5 -4
- package/build/src/dto/tagSpecs.dto.js +1 -1
- package/build/src/dto/tagSpecs.dto.js.map +1 -1
- package/build/src/dto/webhookProviders.dto.d.ts +5 -5
- package/build/src/services/AmpSdk.d.ts +2 -0
- package/build/src/services/AmpSdk.js +2 -0
- package/build/src/services/AmpSdk.js.map +1 -1
- package/build/src/services/ContentTemplateService.d.ts +10 -0
- package/build/src/services/ContentTemplateService.js +50 -24
- package/build/src/services/ContentTemplateService.js.map +1 -1
- package/build/src/services/constants.d.ts +1 -0
- package/build/src/services/constants.js +1 -0
- package/build/src/services/constants.js.map +1 -1
- 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/build/src/services/rules.service.d.ts +14 -0
- package/build/src/services/rules.service.js +50 -0
- package/build/src/services/rules.service.js.map +1 -0
- package/build/src/settings.d.ts +1 -0
- package/build/src/settings.js +1 -0
- package/build/src/settings.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/browserCoachingSubject.dto.ts +1 -0
- package/src/dto/findings.dto.ts +28 -0
- package/src/dto/index.ts +1 -0
- package/src/dto/rules.dto.ts +66 -0
- package/src/dto/tagSpecs.dto.ts +3 -2
- package/src/services/AmpSdk.ts +3 -0
- package/src/services/ContentTemplateService.ts +54 -31
- package/src/services/constants.ts +1 -0
- package/src/services/index.ts +1 -0
- package/src/services/rules.service.ts +59 -0
- package/src/settings.ts +2 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum BrowserCoachingSubject {
|
|
2
2
|
AI_SERVICE_COACHING = "AI_SERVICE_COACHING",
|
|
3
3
|
DOCUMENT_SHARING_COACHING_GOOGLE = "DOCUMENT_SHARING_COACHING_GOOGLE",
|
|
4
|
-
DOCUMENT_SHARING_COACHING_MICROSOFT = "DOCUMENT_SHARING_COACHING_MICROSOFT"
|
|
4
|
+
DOCUMENT_SHARING_COACHING_MICROSOFT = "DOCUMENT_SHARING_COACHING_MICROSOFT",
|
|
5
|
+
AI_SERVICE_SIGNALS = "AI_SERVICE_SIGNALS"
|
|
5
6
|
}
|
|
@@ -6,5 +6,6 @@ var BrowserCoachingSubject;
|
|
|
6
6
|
BrowserCoachingSubject["AI_SERVICE_COACHING"] = "AI_SERVICE_COACHING";
|
|
7
7
|
BrowserCoachingSubject["DOCUMENT_SHARING_COACHING_GOOGLE"] = "DOCUMENT_SHARING_COACHING_GOOGLE";
|
|
8
8
|
BrowserCoachingSubject["DOCUMENT_SHARING_COACHING_MICROSOFT"] = "DOCUMENT_SHARING_COACHING_MICROSOFT";
|
|
9
|
+
BrowserCoachingSubject["AI_SERVICE_SIGNALS"] = "AI_SERVICE_SIGNALS";
|
|
9
10
|
})(BrowserCoachingSubject || (exports.BrowserCoachingSubject = BrowserCoachingSubject = {}));
|
|
10
11
|
//# sourceMappingURL=browserCoachingSubject.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserCoachingSubject.dto.js","sourceRoot":"","sources":["../../../src/dto/browserCoachingSubject.dto.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"browserCoachingSubject.dto.js","sourceRoot":"","sources":["../../../src/dto/browserCoachingSubject.dto.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,+FAAqE,CAAA;IACrE,qGAA2E,CAAA;IAC3E,mEAAyC,CAAA;AAC3C,CAAC,EALW,sBAAsB,sCAAtB,sBAAsB,QAKjC"}
|
|
@@ -25,6 +25,98 @@ export declare const _FindingBucketDto: z.ZodObject<{
|
|
|
25
25
|
key: string;
|
|
26
26
|
}>;
|
|
27
27
|
export type FindingBucketDto = z.infer<typeof _FindingBucketDto>;
|
|
28
|
+
/**
|
|
29
|
+
* Zod schema for the finding-level keys (BaseDto + FindingUpsertDto).
|
|
30
|
+
* Used to derive template variable paths for Custom Content dynamic variables.
|
|
31
|
+
*/
|
|
32
|
+
export declare const _FindingDtoSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
createdAt: z.ZodString;
|
|
35
|
+
updatedAt: z.ZodString;
|
|
36
|
+
deletedAt: z.ZodNullable<z.ZodString>;
|
|
37
|
+
}, {
|
|
38
|
+
discoveredAt: z.ZodOptional<z.ZodString>;
|
|
39
|
+
closedAt: z.ZodOptional<z.ZodString>;
|
|
40
|
+
category: z.ZodString;
|
|
41
|
+
kind: z.ZodString;
|
|
42
|
+
status: z.ZodString;
|
|
43
|
+
severity: z.ZodString;
|
|
44
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
45
|
+
numberOfEngagements: z.ZodNumber;
|
|
46
|
+
displayValue: z.ZodString;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
48
|
+
cid: z.ZodString;
|
|
49
|
+
pid: z.ZodString;
|
|
50
|
+
aid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
uid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
scid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
fsid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
verificationCount: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
bucket: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
/** Bucket key */
|
|
57
|
+
key: z.ZodString;
|
|
58
|
+
/** Severity of the bucket */
|
|
59
|
+
score: z.ZodNumber;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
score: number;
|
|
62
|
+
key: string;
|
|
63
|
+
}, {
|
|
64
|
+
score: number;
|
|
65
|
+
key: string;
|
|
66
|
+
}>>;
|
|
67
|
+
}>, "strip", z.ZodTypeAny, {
|
|
68
|
+
status: string;
|
|
69
|
+
id: string;
|
|
70
|
+
cid: string;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
deletedAt: string | null;
|
|
74
|
+
displayValue: string;
|
|
75
|
+
kind: string;
|
|
76
|
+
category: string;
|
|
77
|
+
severity: string;
|
|
78
|
+
numberOfEngagements: number;
|
|
79
|
+
pid: string;
|
|
80
|
+
description?: string | undefined;
|
|
81
|
+
uid?: string | null | undefined;
|
|
82
|
+
aid?: string | null | undefined;
|
|
83
|
+
discoveredAt?: string | undefined;
|
|
84
|
+
closedAt?: string | undefined;
|
|
85
|
+
outcome?: string | undefined;
|
|
86
|
+
scid?: string | null | undefined;
|
|
87
|
+
fsid?: string | null | undefined;
|
|
88
|
+
verificationCount?: number | undefined;
|
|
89
|
+
bucket?: {
|
|
90
|
+
score: number;
|
|
91
|
+
key: string;
|
|
92
|
+
} | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
status: string;
|
|
95
|
+
id: string;
|
|
96
|
+
cid: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
deletedAt: string | null;
|
|
100
|
+
displayValue: string;
|
|
101
|
+
kind: string;
|
|
102
|
+
category: string;
|
|
103
|
+
severity: string;
|
|
104
|
+
numberOfEngagements: number;
|
|
105
|
+
pid: string;
|
|
106
|
+
description?: string | undefined;
|
|
107
|
+
uid?: string | null | undefined;
|
|
108
|
+
aid?: string | null | undefined;
|
|
109
|
+
discoveredAt?: string | undefined;
|
|
110
|
+
closedAt?: string | undefined;
|
|
111
|
+
outcome?: string | undefined;
|
|
112
|
+
scid?: string | null | undefined;
|
|
113
|
+
fsid?: string | null | undefined;
|
|
114
|
+
verificationCount?: number | undefined;
|
|
115
|
+
bucket?: {
|
|
116
|
+
score: number;
|
|
117
|
+
key: string;
|
|
118
|
+
} | undefined;
|
|
119
|
+
}>;
|
|
28
120
|
export type FindingUpsertDto = BaseUpsertDto & {
|
|
29
121
|
/** Date the finding was discoverd by the integration */
|
|
30
122
|
discoveredAt?: string;
|
|
@@ -324,6 +416,7 @@ export declare const _FindingSpecDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
324
416
|
description?: unknown;
|
|
325
417
|
cid?: string | null | undefined;
|
|
326
418
|
score?: number | undefined;
|
|
419
|
+
outcome?: FindingOutcome | undefined;
|
|
327
420
|
insights?: {
|
|
328
421
|
meta?: {
|
|
329
422
|
displayValue: string;
|
|
@@ -345,7 +438,6 @@ export declare const _FindingSpecDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
345
438
|
} | undefined;
|
|
346
439
|
} | undefined;
|
|
347
440
|
expireAfterDays?: number | null | undefined;
|
|
348
|
-
outcome?: FindingOutcome | undefined;
|
|
349
441
|
}, {
|
|
350
442
|
name: string;
|
|
351
443
|
id: string;
|
|
@@ -359,6 +451,7 @@ export declare const _FindingSpecDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
359
451
|
description?: unknown;
|
|
360
452
|
cid?: string | null | undefined;
|
|
361
453
|
score?: number | undefined;
|
|
454
|
+
outcome?: FindingOutcome | undefined;
|
|
362
455
|
insights?: {
|
|
363
456
|
meta?: {
|
|
364
457
|
displayValue: string;
|
|
@@ -380,7 +473,6 @@ export declare const _FindingSpecDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
380
473
|
} | undefined;
|
|
381
474
|
} | undefined;
|
|
382
475
|
expireAfterDays?: number | null | undefined;
|
|
383
|
-
outcome?: FindingOutcome | undefined;
|
|
384
476
|
}>;
|
|
385
477
|
export type FindingSpecDto = z.infer<typeof _FindingSpecDto>;
|
|
386
478
|
export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
@@ -396,6 +488,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
396
488
|
eventType: z.ZodString;
|
|
397
489
|
score: z.ZodOptional<z.ZodNumber>;
|
|
398
490
|
severity: z.ZodNativeEnum<typeof FindingSeverity>;
|
|
491
|
+
outcome: z.ZodOptional<z.ZodNativeEnum<typeof FindingOutcome>>;
|
|
399
492
|
insights: z.ZodOptional<z.ZodObject<{
|
|
400
493
|
meta: z.ZodOptional<z.ZodObject<{
|
|
401
494
|
kind: z.ZodNativeEnum<typeof FindingKind>;
|
|
@@ -495,7 +588,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
495
588
|
} | undefined;
|
|
496
589
|
}>>;
|
|
497
590
|
expireAfterDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
498
|
-
outcome: z.ZodOptional<z.ZodNativeEnum<typeof FindingOutcome>>;
|
|
499
591
|
}, "strip", z.ZodTypeAny, {
|
|
500
592
|
name: string;
|
|
501
593
|
displayValue: string;
|
|
@@ -509,6 +601,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
509
601
|
updatedAt?: string | undefined;
|
|
510
602
|
deletedAt?: string | null | undefined;
|
|
511
603
|
score?: number | undefined;
|
|
604
|
+
outcome?: FindingOutcome | undefined;
|
|
512
605
|
insights?: {
|
|
513
606
|
meta?: {
|
|
514
607
|
displayValue: string;
|
|
@@ -530,7 +623,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
530
623
|
} | undefined;
|
|
531
624
|
} | undefined;
|
|
532
625
|
expireAfterDays?: number | null | undefined;
|
|
533
|
-
outcome?: FindingOutcome | undefined;
|
|
534
626
|
}, {
|
|
535
627
|
name: string;
|
|
536
628
|
displayValue: string;
|
|
@@ -544,6 +636,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
544
636
|
updatedAt?: string | undefined;
|
|
545
637
|
deletedAt?: string | null | undefined;
|
|
546
638
|
score?: number | undefined;
|
|
639
|
+
outcome?: FindingOutcome | undefined;
|
|
547
640
|
insights?: {
|
|
548
641
|
meta?: {
|
|
549
642
|
displayValue: string;
|
|
@@ -565,7 +658,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
565
658
|
} | undefined;
|
|
566
659
|
} | undefined;
|
|
567
660
|
expireAfterDays?: number | null | undefined;
|
|
568
|
-
outcome?: FindingOutcome | undefined;
|
|
569
661
|
}>;
|
|
570
662
|
export type FindingSpecUpsertDto = z.infer<typeof _FindingSpecUpsertDto>;
|
|
571
663
|
export declare const _FindingSummaryDto: z.ZodObject<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._CustomFindingPayload = exports._FindingSummaryDto = exports._FindingSpecUpsertDto = exports._FindingSpecDto = exports._FindingSpecInsights = exports._FindingBucketSummaryDto = exports._FindingBucketDto = void 0;
|
|
3
|
+
exports._CustomFindingPayload = exports._FindingSummaryDto = exports._FindingSpecUpsertDto = exports._FindingSpecDto = exports._FindingSpecInsights = exports._FindingBucketSummaryDto = exports._FindingDtoSchema = exports._FindingBucketDto = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const base_dto_1 = require("./base.dto");
|
|
6
6
|
const enums_1 = require("./enums");
|
|
@@ -11,6 +11,31 @@ exports._FindingBucketDto = zod_1.z.object({
|
|
|
11
11
|
/** Severity of the bucket */
|
|
12
12
|
score: zod_1.z.number(),
|
|
13
13
|
});
|
|
14
|
+
/**
|
|
15
|
+
* Zod schema for the finding-level keys (BaseDto + FindingUpsertDto).
|
|
16
|
+
* Used to derive template variable paths for Custom Content dynamic variables.
|
|
17
|
+
*/
|
|
18
|
+
// TODO: Use this schema to infer an exported type for the finding entity.
|
|
19
|
+
exports._FindingDtoSchema = base_dto_1._BaseDto.merge(zod_1.z.object({
|
|
20
|
+
discoveredAt: zod_1.z.string().optional(),
|
|
21
|
+
closedAt: zod_1.z.string().optional(),
|
|
22
|
+
category: zod_1.z.string(),
|
|
23
|
+
kind: zod_1.z.string(),
|
|
24
|
+
status: zod_1.z.string(),
|
|
25
|
+
severity: zod_1.z.string(),
|
|
26
|
+
outcome: zod_1.z.string().optional(),
|
|
27
|
+
numberOfEngagements: zod_1.z.number(),
|
|
28
|
+
displayValue: zod_1.z.string(),
|
|
29
|
+
description: zod_1.z.string().optional(),
|
|
30
|
+
cid: zod_1.z.string(),
|
|
31
|
+
pid: zod_1.z.string(),
|
|
32
|
+
aid: zod_1.z.string().nullable().optional(),
|
|
33
|
+
uid: zod_1.z.string().nullable().optional(),
|
|
34
|
+
scid: zod_1.z.string().nullable().optional(),
|
|
35
|
+
fsid: zod_1.z.string().nullable().optional(),
|
|
36
|
+
verificationCount: zod_1.z.number().optional(),
|
|
37
|
+
bucket: exports._FindingBucketDto.optional(),
|
|
38
|
+
}));
|
|
14
39
|
exports._FindingBucketSummaryDto = zod_1.z.object({
|
|
15
40
|
id: zod_1.z.string(),
|
|
16
41
|
uid: zod_1.z.string(),
|
|
@@ -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,iBA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MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B;;OAEG;IACH,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,wCAAwC;IACxC,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;IAC/B;;;OAGG;IACH,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC;;OAEG;IACH,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC/G,CAAC,CAAC"}
|
|
@@ -89,8 +89,8 @@ export declare const _FindingsInsightsDto: z.ZodObject<{
|
|
|
89
89
|
description: string;
|
|
90
90
|
kind: FindingKind;
|
|
91
91
|
title: string;
|
|
92
|
-
severity: FindingSeverity;
|
|
93
92
|
category: Category;
|
|
93
|
+
severity: FindingSeverity;
|
|
94
94
|
number_of_engagements: number;
|
|
95
95
|
active_engagements: {
|
|
96
96
|
status: "SUCCESS" | "RUNNING" | "ERROR" | "CANCELLED" | "EXPIRED";
|
|
@@ -139,8 +139,8 @@ export declare const _FindingsInsightsDto: z.ZodObject<{
|
|
|
139
139
|
description: string;
|
|
140
140
|
kind: FindingKind;
|
|
141
141
|
title: string;
|
|
142
|
-
severity: FindingSeverity;
|
|
143
142
|
category: Category;
|
|
143
|
+
severity: FindingSeverity;
|
|
144
144
|
number_of_engagements: number;
|
|
145
145
|
active_engagements: {
|
|
146
146
|
status: "SUCCESS" | "RUNNING" | "ERROR" | "CANCELLED" | "EXPIRED";
|
package/build/src/dto/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * from './platform';
|
|
|
31
31
|
export * from './providers.dto';
|
|
32
32
|
export * from './reportResults.dto';
|
|
33
33
|
export * from './riskContributors.dto';
|
|
34
|
+
export * from './rules.dto';
|
|
34
35
|
export * from './saasAssets.dto';
|
|
35
36
|
export * from './saasComponents.dto';
|
|
36
37
|
export * from './saasUsers.dto';
|
package/build/src/dto/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __exportStar(require("./platform"), exports);
|
|
|
47
47
|
__exportStar(require("./providers.dto"), exports);
|
|
48
48
|
__exportStar(require("./reportResults.dto"), exports);
|
|
49
49
|
__exportStar(require("./riskContributors.dto"), exports);
|
|
50
|
+
__exportStar(require("./rules.dto"), exports);
|
|
50
51
|
__exportStar(require("./saasAssets.dto"), exports);
|
|
51
52
|
__exportStar(require("./saasComponents.dto"), exports);
|
|
52
53
|
__exportStar(require("./saasUsers.dto"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,kDAAgC;AAChC,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,uDAAqC;AACrC,8CAA4B;AAC5B,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,wCAAsB;AACtB,2DAAyC;AACzC,gEAA8C;AAC9C,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,yDAAuC;AACvC,qDAAmC;AACnC,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,iDAA+B;AAC/B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,wDAAsC;AACtC,kDAAgC;AAChC,8CAA4B;AAC5B,sDAAoC;AACpC,+CAA6B;AAC7B,wDAAsC;AACtC,sDAAoC;AACpC,iDAA+B;AAC/B,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,kDAAgC;AAChC,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,uDAAqC;AACrC,8CAA4B;AAC5B,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,wCAAsB;AACtB,2DAAyC;AACzC,gEAA8C;AAC9C,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,yDAAuC;AACvC,qDAAmC;AACnC,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,8CAA4B;AAC5B,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,iDAA+B;AAC/B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,wDAAsC;AACtC,kDAAgC;AAChC,8CAA4B;AAC5B,sDAAoC;AACpC,+CAA6B;AAC7B,wDAAsC;AACtC,sDAAoC;AACpC,iDAA+B;AAC/B,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C"}
|
|
@@ -133,6 +133,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<z.objectUtil.extendSha
|
|
|
133
133
|
description?: unknown;
|
|
134
134
|
cid?: string | null | undefined;
|
|
135
135
|
score?: number | undefined;
|
|
136
|
+
outcome?: import("..").FindingOutcome | undefined;
|
|
136
137
|
insights?: {
|
|
137
138
|
meta?: {
|
|
138
139
|
displayValue: string;
|
|
@@ -154,7 +155,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<z.objectUtil.extendSha
|
|
|
154
155
|
} | undefined;
|
|
155
156
|
} | undefined;
|
|
156
157
|
expireAfterDays?: number | null | undefined;
|
|
157
|
-
outcome?: import("..").FindingOutcome | undefined;
|
|
158
158
|
}, {
|
|
159
159
|
name: string;
|
|
160
160
|
id: string;
|
|
@@ -169,6 +169,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<z.objectUtil.extendSha
|
|
|
169
169
|
description?: unknown;
|
|
170
170
|
cid?: string | null | undefined;
|
|
171
171
|
score?: number | undefined;
|
|
172
|
+
outcome?: import("..").FindingOutcome | undefined;
|
|
172
173
|
insights?: {
|
|
173
174
|
meta?: {
|
|
174
175
|
displayValue: string;
|
|
@@ -190,7 +191,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<z.objectUtil.extendSha
|
|
|
190
191
|
} | undefined;
|
|
191
192
|
} | undefined;
|
|
192
193
|
expireAfterDays?: number | null | undefined;
|
|
193
|
-
outcome?: import("..").FindingOutcome | undefined;
|
|
194
194
|
}>;
|
|
195
195
|
export type PlatformFindingSpecDto = z.infer<typeof _PlatformFindingSpecDto>;
|
|
196
196
|
export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -206,6 +206,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.ext
|
|
|
206
206
|
eventType: z.ZodString;
|
|
207
207
|
score: z.ZodOptional<z.ZodNumber>;
|
|
208
208
|
severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
|
|
209
|
+
outcome: z.ZodOptional<z.ZodNativeEnum<typeof import("..").FindingOutcome>>;
|
|
209
210
|
insights: z.ZodOptional<z.ZodObject<{
|
|
210
211
|
meta: z.ZodOptional<z.ZodObject<{
|
|
211
212
|
kind: z.ZodNativeEnum<typeof import("..").FindingKind>;
|
|
@@ -305,7 +306,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.ext
|
|
|
305
306
|
} | undefined;
|
|
306
307
|
}>>;
|
|
307
308
|
expireAfterDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
308
|
-
outcome: z.ZodOptional<z.ZodNativeEnum<typeof import("..").FindingOutcome>>;
|
|
309
309
|
}, {
|
|
310
310
|
tid: z.ZodString;
|
|
311
311
|
}>, "strip", z.ZodTypeAny, {
|
|
@@ -322,6 +322,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.ext
|
|
|
322
322
|
updatedAt?: string | undefined;
|
|
323
323
|
deletedAt?: string | null | undefined;
|
|
324
324
|
score?: number | undefined;
|
|
325
|
+
outcome?: import("..").FindingOutcome | undefined;
|
|
325
326
|
insights?: {
|
|
326
327
|
meta?: {
|
|
327
328
|
displayValue: string;
|
|
@@ -343,7 +344,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.ext
|
|
|
343
344
|
} | undefined;
|
|
344
345
|
} | undefined;
|
|
345
346
|
expireAfterDays?: number | null | undefined;
|
|
346
|
-
outcome?: import("..").FindingOutcome | undefined;
|
|
347
347
|
}, {
|
|
348
348
|
name: string;
|
|
349
349
|
tid: string;
|
|
@@ -358,6 +358,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.ext
|
|
|
358
358
|
updatedAt?: string | undefined;
|
|
359
359
|
deletedAt?: string | null | undefined;
|
|
360
360
|
score?: number | undefined;
|
|
361
|
+
outcome?: import("..").FindingOutcome | undefined;
|
|
361
362
|
insights?: {
|
|
362
363
|
meta?: {
|
|
363
364
|
displayValue: string;
|
|
@@ -379,6 +380,5 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<z.objectUtil.ext
|
|
|
379
380
|
} | undefined;
|
|
380
381
|
} | undefined;
|
|
381
382
|
expireAfterDays?: number | null | undefined;
|
|
382
|
-
outcome?: import("..").FindingOutcome | undefined;
|
|
383
383
|
}>;
|
|
384
384
|
export type PlatformFindingSpecUpsertDto = z.infer<typeof _PlatformFindingSpecUpsertDto>;
|
|
@@ -20,8 +20,8 @@ export declare const _PlatformWebhookProviderDto: import("zod").ZodObject<import
|
|
|
20
20
|
createdAt: string;
|
|
21
21
|
updatedAt: string;
|
|
22
22
|
deletedAt: string | null;
|
|
23
|
-
enabled: boolean;
|
|
24
23
|
pid: string;
|
|
24
|
+
enabled: boolean;
|
|
25
25
|
supportedEvents: string[];
|
|
26
26
|
description?: string | null | undefined;
|
|
27
27
|
timeout?: number | null | undefined;
|
|
@@ -33,8 +33,8 @@ export declare const _PlatformWebhookProviderDto: import("zod").ZodObject<import
|
|
|
33
33
|
createdAt: string;
|
|
34
34
|
updatedAt: string;
|
|
35
35
|
deletedAt: string | null;
|
|
36
|
-
enabled: boolean;
|
|
37
36
|
pid: string;
|
|
37
|
+
enabled: boolean;
|
|
38
38
|
supportedEvents: string[];
|
|
39
39
|
description?: string | null | undefined;
|
|
40
40
|
timeout?: number | null | undefined;
|
|
@@ -48,16 +48,16 @@ export declare const _PlatformWebhookProviderUpsertDto: import("zod").ZodObject<
|
|
|
48
48
|
createdAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
49
49
|
updatedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
50
50
|
deletedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
51
|
+
pid: import("zod").ZodString;
|
|
51
52
|
timeout: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
|
|
52
53
|
enabled: import("zod").ZodBoolean;
|
|
53
54
|
displayName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
-
pid: import("zod").ZodString;
|
|
55
55
|
supportedEvents: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
56
56
|
defaultSecret: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
57
57
|
retryAttempts: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
|
|
58
58
|
}, "strip", import("zod").ZodTypeAny, {
|
|
59
|
-
enabled: boolean;
|
|
60
59
|
pid: string;
|
|
60
|
+
enabled: boolean;
|
|
61
61
|
supportedEvents: string[];
|
|
62
62
|
description?: string | null | undefined;
|
|
63
63
|
id?: string | undefined;
|
|
@@ -69,8 +69,8 @@ export declare const _PlatformWebhookProviderUpsertDto: import("zod").ZodObject<
|
|
|
69
69
|
defaultSecret?: string | null | undefined;
|
|
70
70
|
retryAttempts?: number | null | undefined;
|
|
71
71
|
}, {
|
|
72
|
-
enabled: boolean;
|
|
73
72
|
pid: string;
|
|
73
|
+
enabled: boolean;
|
|
74
74
|
supportedEvents: string[];
|
|
75
75
|
description?: string | null | undefined;
|
|
76
76
|
id?: string | undefined;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const _CreateRuleSchema: z.ZodObject<{
|
|
3
|
+
cid: z.ZodString;
|
|
4
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
conditions: z.ZodOptional<z.ZodAny>;
|
|
6
|
+
actions: z.ZodOptional<z.ZodAny>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
cid: string;
|
|
9
|
+
priority: number;
|
|
10
|
+
actions?: any;
|
|
11
|
+
conditions?: any;
|
|
12
|
+
}, {
|
|
13
|
+
cid: string;
|
|
14
|
+
actions?: any;
|
|
15
|
+
priority?: number | undefined;
|
|
16
|
+
conditions?: any;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const _RuleUpsertSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
conditions: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
actions: z.ZodOptional<z.ZodAny>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
id: string;
|
|
25
|
+
actions?: any;
|
|
26
|
+
priority?: number | undefined;
|
|
27
|
+
conditions?: any;
|
|
28
|
+
}, {
|
|
29
|
+
id: string;
|
|
30
|
+
actions?: any;
|
|
31
|
+
priority?: number | undefined;
|
|
32
|
+
conditions?: any;
|
|
33
|
+
}>;
|
|
34
|
+
export type CreateRuleDtoSchema = z.infer<typeof _CreateRuleSchema> & {
|
|
35
|
+
tid: string;
|
|
36
|
+
};
|
|
37
|
+
export type RuleUpsertDtoSchema = z.infer<typeof _RuleUpsertSchema>;
|
|
38
|
+
export type CompiledLeafCondition = {
|
|
39
|
+
type: string;
|
|
40
|
+
name: string;
|
|
41
|
+
operator: string;
|
|
42
|
+
value: unknown;
|
|
43
|
+
};
|
|
44
|
+
export type CompiledCompositeCondition = {
|
|
45
|
+
any?: CompiledConditionNode[];
|
|
46
|
+
all?: CompiledConditionNode[];
|
|
47
|
+
};
|
|
48
|
+
export type CompiledConditionNode = CompiledLeafCondition | CompiledCompositeCondition;
|
|
49
|
+
export type CompiledActionData = {
|
|
50
|
+
type: string;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Map of action_type → array of action payloads.
|
|
55
|
+
* e.g. { then: [{ type: "ADD_TAG", ... }], else: [{ type: "SKIP" }] }
|
|
56
|
+
*/
|
|
57
|
+
export type CompiledActions = {
|
|
58
|
+
[action_type: string]: CompiledActionData[];
|
|
59
|
+
};
|
|
60
|
+
/** Compiled rule as produced by compileRulesToJson */
|
|
61
|
+
export type CompiledRule = {
|
|
62
|
+
priority: number;
|
|
63
|
+
conditions: CompiledConditionNode | null;
|
|
64
|
+
actions: CompiledActions;
|
|
65
|
+
};
|
|
66
|
+
export type RuleSetByIdResult = {
|
|
67
|
+
ruleId: string;
|
|
68
|
+
ruleSet: CompiledRule[];
|
|
69
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._RuleUpsertSchema = exports._CreateRuleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/* ─── Create / Upsert Schemas ──── */
|
|
6
|
+
exports._CreateRuleSchema = zod_1.z.object({
|
|
7
|
+
cid: zod_1.z.string(),
|
|
8
|
+
priority: zod_1.z.number().default(0),
|
|
9
|
+
conditions: zod_1.z.any().optional(),
|
|
10
|
+
actions: zod_1.z.any().optional(),
|
|
11
|
+
});
|
|
12
|
+
exports._RuleUpsertSchema = zod_1.z.object({
|
|
13
|
+
id: zod_1.z.string(),
|
|
14
|
+
priority: zod_1.z.number().optional(),
|
|
15
|
+
conditions: zod_1.z.any().optional(),
|
|
16
|
+
actions: zod_1.z.any().optional(),
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=rules.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.dto.js","sourceRoot":"","sources":["../../../src/dto/rules.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,sCAAsC;AACzB,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/B,UAAU,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,UAAU,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
3
|
+
import { CompiledRule } from './rules.dto';
|
|
3
4
|
/**
|
|
4
5
|
* ------------------------
|
|
5
6
|
* Base TagSpec schema
|
|
@@ -144,7 +145,7 @@ export declare const _TagSpecWithRuleSetDto: z.ZodObject<{
|
|
|
144
145
|
config?: any;
|
|
145
146
|
notify?: boolean | undefined;
|
|
146
147
|
}>;
|
|
147
|
-
ruleSet: z.ZodAny
|
|
148
|
+
ruleSet: z.ZodArray<z.ZodAny, "many">;
|
|
148
149
|
}, "strip", z.ZodTypeAny, {
|
|
149
150
|
tagSpec: {
|
|
150
151
|
name: string;
|
|
@@ -155,7 +156,7 @@ export declare const _TagSpecWithRuleSetDto: z.ZodObject<{
|
|
|
155
156
|
description?: string | null | undefined;
|
|
156
157
|
config?: any;
|
|
157
158
|
};
|
|
158
|
-
ruleSet
|
|
159
|
+
ruleSet: any[];
|
|
159
160
|
}, {
|
|
160
161
|
tagSpec: {
|
|
161
162
|
name: string;
|
|
@@ -166,9 +167,9 @@ export declare const _TagSpecWithRuleSetDto: z.ZodObject<{
|
|
|
166
167
|
config?: any;
|
|
167
168
|
notify?: boolean | undefined;
|
|
168
169
|
};
|
|
169
|
-
ruleSet
|
|
170
|
+
ruleSet: any[];
|
|
170
171
|
}>;
|
|
171
172
|
export type TagSpecWithRuleSetDto = {
|
|
172
173
|
tagSpec: TagSpecDto;
|
|
173
|
-
ruleSet:
|
|
174
|
+
ruleSet: CompiledRule[];
|
|
174
175
|
};
|
|
@@ -43,6 +43,6 @@ exports._TagSpecDto = exports._TagSpecBase.extend({
|
|
|
43
43
|
*/
|
|
44
44
|
exports._TagSpecWithRuleSetDto = zod_1.z.object({
|
|
45
45
|
tagSpec: exports._TagSpecDto,
|
|
46
|
-
ruleSet: zod_1.z.any(), //
|
|
46
|
+
ruleSet: zod_1.z.array(zod_1.z.any()), // CompiledRule[] — z.any() per element keeps Zod simple
|
|
47
47
|
});
|
|
48
48
|
//# sourceMappingURL=tagSpecs.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagSpecs.dto.js","sourceRoot":"","sources":["../../../src/dto/tagSpecs.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;
|
|
1
|
+
{"version":3,"file":"tagSpecs.dto.js","sourceRoot":"","sources":["../../../src/dto/tagSpecs.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAItB;;;;GAIG;AACU,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,gBAAgB;IAChB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IAEf,cAAc;IACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IAEf,mBAAmB;IACnB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAEhB,2BAA2B;IAC3B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAEjC,8BAA8B;IAC9B,MAAM,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAE1B,2BAA2B;IAC3B,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACnC,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,oBAAY,CAAC;AAI9C;;;;GAIG;AACU,QAAA,WAAW,GAAG,oBAAY,CAAC,MAAM,CAAC;IAC7C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAIH;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,mBAAW;IACpB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,EAAE,wDAAwD;CACpF,CAAC,CAAC"}
|
|
@@ -18,8 +18,8 @@ export declare const _WebhookProviderDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
18
18
|
createdAt: string;
|
|
19
19
|
updatedAt: string;
|
|
20
20
|
deletedAt: string | null;
|
|
21
|
-
enabled: boolean;
|
|
22
21
|
pid: string;
|
|
22
|
+
enabled: boolean;
|
|
23
23
|
supportedEvents: string[];
|
|
24
24
|
description?: string | null | undefined;
|
|
25
25
|
timeout?: number | null | undefined;
|
|
@@ -31,8 +31,8 @@ export declare const _WebhookProviderDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
31
31
|
createdAt: string;
|
|
32
32
|
updatedAt: string;
|
|
33
33
|
deletedAt: string | null;
|
|
34
|
-
enabled: boolean;
|
|
35
34
|
pid: string;
|
|
35
|
+
enabled: boolean;
|
|
36
36
|
supportedEvents: string[];
|
|
37
37
|
description?: string | null | undefined;
|
|
38
38
|
timeout?: number | null | undefined;
|
|
@@ -46,16 +46,16 @@ export declare const _WebhookProviderUpsertDto: z.ZodObject<{
|
|
|
46
46
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
47
47
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
48
48
|
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
pid: z.ZodString;
|
|
49
50
|
timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
51
|
enabled: z.ZodBoolean;
|
|
51
52
|
displayName: z.ZodOptional<z.ZodString>;
|
|
52
|
-
pid: z.ZodString;
|
|
53
53
|
supportedEvents: z.ZodArray<z.ZodString, "many">;
|
|
54
54
|
defaultSecret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
55
|
retryAttempts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
56
56
|
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
enabled: boolean;
|
|
58
57
|
pid: string;
|
|
58
|
+
enabled: boolean;
|
|
59
59
|
supportedEvents: string[];
|
|
60
60
|
description?: string | null | undefined;
|
|
61
61
|
id?: string | undefined;
|
|
@@ -67,8 +67,8 @@ export declare const _WebhookProviderUpsertDto: z.ZodObject<{
|
|
|
67
67
|
defaultSecret?: string | null | undefined;
|
|
68
68
|
retryAttempts?: number | null | undefined;
|
|
69
69
|
}, {
|
|
70
|
-
enabled: boolean;
|
|
71
70
|
pid: string;
|
|
71
|
+
enabled: boolean;
|
|
72
72
|
supportedEvents: string[];
|
|
73
73
|
description?: string | null | undefined;
|
|
74
74
|
id?: string | undefined;
|
|
@@ -14,6 +14,7 @@ import { FindingsService } from './findings.service';
|
|
|
14
14
|
import { EngagementService } from './engagements.service';
|
|
15
15
|
import { AmpSdkTagSpecsService } from './tagSpecs.service';
|
|
16
16
|
import { AmpSdkFindingsTagsService } from './findingsTags.service';
|
|
17
|
+
import { RulesService } from './rules.service';
|
|
17
18
|
export type AmpSdkOptions = AmpRestClientOptions;
|
|
18
19
|
/**
|
|
19
20
|
* AMP API
|
|
@@ -48,6 +49,7 @@ export declare class AmpSdkServices {
|
|
|
48
49
|
readonly providers: AmpEntityService<PlatformProviderUpsertDto, ProviderDto>;
|
|
49
50
|
readonly reportResults: AmpSaaSEntityService<PlatformReportResultUpsertDto, PlatformReportResultDto>;
|
|
50
51
|
readonly riskContributors: AmpSaaSEntityService<PlatformRiskContributorUpsertDto, PlatformRiskContributorDto>;
|
|
52
|
+
readonly rules: RulesService;
|
|
51
53
|
readonly saasAssets: AmpSdkSaasAssetService;
|
|
52
54
|
readonly saasComponents: AmpSdkSaasComponentService;
|
|
53
55
|
readonly saasUsers: AmpSdkSaasUserService;
|
|
@@ -17,6 +17,7 @@ const findings_service_1 = require("./findings.service");
|
|
|
17
17
|
const engagements_service_1 = require("./engagements.service");
|
|
18
18
|
const tagSpecs_service_1 = require("./tagSpecs.service");
|
|
19
19
|
const findingsTags_service_1 = require("./findingsTags.service");
|
|
20
|
+
const rules_service_1 = require("./rules.service");
|
|
20
21
|
/**
|
|
21
22
|
* AMP API
|
|
22
23
|
* This client is a wrapper around the AMP REST API meant to be used by
|
|
@@ -55,6 +56,7 @@ class AmpSdkServices {
|
|
|
55
56
|
this.providers = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.PROVIDERS, constants_1.TARGET_API_PLATFORM);
|
|
56
57
|
this.reportResults = new saasEntity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.REPORT_RESULTS, constants_1.TARGET_API_PLATFORM);
|
|
57
58
|
this.riskContributors = new saasEntity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.RISK_CONTRIBUTORS, constants_1.TARGET_API_PLATFORM);
|
|
59
|
+
this.rules = new rules_service_1.RulesService(rest, constants_1.KIND.RULES, constants_1.TARGET_API_PLATFORM);
|
|
58
60
|
this.saasAssets = new saasEntity_service_1.AmpSdkSaasAssetService(rest, constants_1.TARGET_API_PLATFORM);
|
|
59
61
|
this.saasComponents = new saasEntity_service_1.AmpSdkSaasComponentService(rest, constants_1.TARGET_API_PLATFORM);
|
|
60
62
|
this.saasUsers = new saasEntity_service_1.AmpSdkSaasUserService(rest, constants_1.TARGET_API_PLATFORM);
|