@ampsec/platform-client 47.2.0 → 47.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.
@@ -15,5 +15,6 @@ export * from './notification.status';
15
15
  export * from './requiredDataProperty.enum';
16
16
  export * from './riskContributor.type';
17
17
  export * from './saasComponentKind';
18
+ export * from './supportedMessageChannelKind.enum';
18
19
  export * from './workflowStep.kind';
19
20
  export * from './workflowTrigger.kind';
@@ -31,6 +31,7 @@ __exportStar(require("./notification.status"), exports);
31
31
  __exportStar(require("./requiredDataProperty.enum"), exports);
32
32
  __exportStar(require("./riskContributor.type"), exports);
33
33
  __exportStar(require("./saasComponentKind"), exports);
34
+ __exportStar(require("./supportedMessageChannelKind.enum"), exports);
34
35
  __exportStar(require("./workflowStep.kind"), exports);
35
36
  __exportStar(require("./workflowTrigger.kind"), exports);
36
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,wDAAsC;AACtC,6CAA2B;AAC3B,qDAAmC;AACnC,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,wDAAsC;AACtC,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,wDAAsC;AACtC,6CAA2B;AAC3B,qDAAmC;AACnC,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,wDAAsC;AACtC,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC;AACpC,qEAAmD;AACnD,sDAAoC;AACpC,yDAAuC"}
@@ -0,0 +1,5 @@
1
+ export declare enum SupportedMessageChannelKind {
2
+ SLACK = "SLACK",
3
+ UNSUPPORTED = "UNSUPPORTED"
4
+ }
5
+ export declare const getSupportedMessageChannelKindFrom: (description: string | undefined) => SupportedMessageChannelKind;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSupportedMessageChannelKindFrom = exports.SupportedMessageChannelKind = void 0;
4
+ /* eslint-disable no-unused-vars */
5
+ var SupportedMessageChannelKind;
6
+ (function (SupportedMessageChannelKind) {
7
+ SupportedMessageChannelKind["SLACK"] = "SLACK";
8
+ SupportedMessageChannelKind["UNSUPPORTED"] = "UNSUPPORTED";
9
+ })(SupportedMessageChannelKind || (exports.SupportedMessageChannelKind = SupportedMessageChannelKind = {}));
10
+ const getSupportedMessageChannelKindFrom = (description) => {
11
+ if (description) {
12
+ for (const kind in SupportedMessageChannelKind) {
13
+ if (description.toUpperCase().includes(kind)) {
14
+ return SupportedMessageChannelKind[kind];
15
+ }
16
+ }
17
+ }
18
+ return SupportedMessageChannelKind.UNSUPPORTED;
19
+ };
20
+ exports.getSupportedMessageChannelKindFrom = getSupportedMessageChannelKindFrom;
21
+ //# sourceMappingURL=supportedMessageChannelKind.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supportedMessageChannelKind.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/supportedMessageChannelKind.enum.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,8CAAe,CAAA;IACf,0DAA2B,CAAA;AAC7B,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC;AAEM,MAAM,kCAAkC,GAAG,CAAC,WAA+B,EAA+B,EAAE;IACjH,IAAI,WAAW,EAAE;QACf,KAAK,MAAM,IAAI,IAAI,2BAA2B,EAAE;YAC9C,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAC5C,OAAO,2BAA2B,CAAC,IAAgD,CAAgC,CAAC;aACrH;SACF;KACF;IAED,OAAO,2BAA2B,CAAC,WAAW,CAAC;AACjD,CAAC,CAAC;AAVW,QAAA,kCAAkC,sCAU7C"}
@@ -2,6 +2,7 @@ import { BaseDto, BaseUpsertDto } from './base.dto';
2
2
  import { Category, DeliveryStrategyKind, FindingKind, FindingSeverity, NotificationStatus } from './enums';
3
3
  import { ContentStrategyKind } from './enums/contentStrategy.kind';
4
4
  import { FindingOutcome } from './enums/finding.outcome';
5
+ import { SupportedMessageChannelKind } from './enums/supportedMessageChannelKind.enum';
5
6
  export type NotificationAddress = {
6
7
  /** Connector ID for the notification channel */
7
8
  cid?: string;
@@ -12,7 +13,11 @@ export type NotificationAddress = {
12
13
  /** Webhook URLs to which the notification is being sent */
13
14
  webhooks?: string[];
14
15
  };
15
- export type SlackNotificationAddress = NotificationAddress & {
16
+ export type MessageNotificationAddress = NotificationAddress & {
17
+ /** Channel kind for messaging applications */
18
+ kind: SupportedMessageChannelKind;
19
+ };
20
+ export type SlackNotificationAddress = MessageNotificationAddress & {
16
21
  teamId: string;
17
22
  };
18
23
  export type AssetNotificationContext = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "47.2.0",
3
+ "version": "47.3.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -15,5 +15,6 @@ export * from './notification.status';
15
15
  export * from './requiredDataProperty.enum';
16
16
  export * from './riskContributor.type';
17
17
  export * from './saasComponentKind';
18
+ export * from './supportedMessageChannelKind.enum';
18
19
  export * from './workflowStep.kind';
19
20
  export * from './workflowTrigger.kind';
@@ -0,0 +1,17 @@
1
+ /* eslint-disable no-unused-vars */
2
+ export enum SupportedMessageChannelKind {
3
+ SLACK = 'SLACK',
4
+ UNSUPPORTED = 'UNSUPPORTED',
5
+ }
6
+
7
+ export const getSupportedMessageChannelKindFrom = (description: string | undefined): SupportedMessageChannelKind => {
8
+ if (description) {
9
+ for (const kind in SupportedMessageChannelKind) {
10
+ if (description.toUpperCase().includes(kind)) {
11
+ return SupportedMessageChannelKind[kind as keyof typeof SupportedMessageChannelKind] as SupportedMessageChannelKind;
12
+ }
13
+ }
14
+ }
15
+
16
+ return SupportedMessageChannelKind.UNSUPPORTED;
17
+ };
@@ -2,6 +2,7 @@ import {BaseDto, BaseUpsertDto} from './base.dto';
2
2
  import {Category, DeliveryStrategyKind, FindingKind, FindingSeverity, NotificationStatus} from './enums';
3
3
  import {ContentStrategyKind} from './enums/contentStrategy.kind';
4
4
  import {FindingOutcome} from './enums/finding.outcome';
5
+ import {SupportedMessageChannelKind} from './enums/supportedMessageChannelKind.enum';
5
6
 
6
7
  export type NotificationAddress = {
7
8
  /** Connector ID for the notification channel */
@@ -14,7 +15,12 @@ export type NotificationAddress = {
14
15
  webhooks?: string[];
15
16
  };
16
17
 
17
- export type SlackNotificationAddress = NotificationAddress & {
18
+ export type MessageNotificationAddress = NotificationAddress & {
19
+ /** Channel kind for messaging applications */
20
+ kind: SupportedMessageChannelKind;
21
+ };
22
+
23
+ export type SlackNotificationAddress = MessageNotificationAddress & {
18
24
  teamId: string;
19
25
  };
20
26