@ampsec/platform-client 29.1.1 → 31.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.
@@ -1,5 +1,10 @@
1
1
  import { BaseDto, BaseUpsertDto } from './base.dto';
2
2
  export type AmpSettingKey = string;
3
+ export type AmpSettingDisplayableValue = {
4
+ cid?: string;
5
+ displayValue: string;
6
+ };
7
+ export type AmpSettingValue = unknown | AmpSettingDisplayableValue;
3
8
  export type AmpSettingUpsertDto = BaseUpsertDto & {
4
9
  /** Tenant ID */
5
10
  tid: string;
@@ -8,6 +13,6 @@ export type AmpSettingUpsertDto = BaseUpsertDto & {
8
13
  /** Setting key */
9
14
  key: AmpSettingKey;
10
15
  /** Setting value */
11
- value?: unknown;
16
+ value?: AmpSettingValue;
12
17
  };
13
18
  export type AmpSettingDto = BaseDto & AmpSettingUpsertDto;
@@ -0,0 +1,3 @@
1
+ export declare enum AmpSettingKeys {
2
+ DEFAULT_NOTIFICATION_CONNECTOR = "DEFAULT_NOTIFICATION_CONNECTOR"
3
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmpSettingKeys = void 0;
4
+ /* eslint-disable no-unused-vars */
5
+ var AmpSettingKeys;
6
+ (function (AmpSettingKeys) {
7
+ AmpSettingKeys["DEFAULT_NOTIFICATION_CONNECTOR"] = "DEFAULT_NOTIFICATION_CONNECTOR";
8
+ })(AmpSettingKeys || (exports.AmpSettingKeys = AmpSettingKeys = {}));
9
+ //# sourceMappingURL=ampSettingKeys.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ampSettingKeys.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/ampSettingKeys.enum.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,mFAAiE,CAAA;AACnE,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB"}
@@ -1,5 +1,6 @@
1
1
  export * from './auth.role';
2
2
  export * from './agent.status';
3
+ export * from './ampSettingKeys.enum';
3
4
  export * from './category';
4
5
  export * from './connector.status';
5
6
  export * from './findingKind';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth.role"), exports);
18
18
  __exportStar(require("./agent.status"), exports);
19
+ __exportStar(require("./ampSettingKeys.enum"), exports);
19
20
  __exportStar(require("./category"), exports);
20
21
  __exportStar(require("./connector.status"), exports);
21
22
  __exportStar(require("./findingKind"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,6CAA2B;AAC3B,qDAAmC;AACnC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC"}
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,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC"}
@@ -1,4 +1,5 @@
1
1
  export declare enum NotificationStatus {
2
+ INVALID = "INVALID",
2
3
  PENDING = "PENDING",
3
4
  READ = "READ",
4
5
  SENT = "SENT"
@@ -4,6 +4,7 @@ exports.NotificationStatus = void 0;
4
4
  /* eslint-disable no-unused-vars */
5
5
  var NotificationStatus;
6
6
  (function (NotificationStatus) {
7
+ NotificationStatus["INVALID"] = "INVALID";
7
8
  NotificationStatus["PENDING"] = "PENDING";
8
9
  NotificationStatus["READ"] = "READ";
9
10
  NotificationStatus["SENT"] = "SENT";
@@ -1 +1 @@
1
- {"version":3,"file":"notification.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/notification.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,mCAAa,CAAA;AACf,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B"}
1
+ {"version":3,"file":"notification.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/notification.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B"}
@@ -37,12 +37,6 @@ export type FindingUpsertDto = BaseUpsertDto & {
37
37
  uid?: string | undefined | null;
38
38
  /** Id of the SaasComponent related to the given finding */
39
39
  scid?: string | undefined | null;
40
- /**
41
- * Used as the naive implementation of notification schedules inside Flows.
42
- * "Resets" notifications schedule after pause or failed verification.
43
- * Defaults to "NOW".
44
- */
45
- nextNotificationAfter?: string;
46
40
  /** Number of times this finding was marked PENDING_VERIFIED. Defaults to `0` */
47
41
  verificationCount?: number;
48
42
  /** Optionally populated when requested through query param `include=user` */
@@ -48,11 +48,5 @@ export type SaasComponentUpsertDto = ChangeAwareUpsertDto & {
48
48
  extKey: string;
49
49
  /** Component display value */
50
50
  displayValue: string;
51
- /**
52
- * Used as the naive implementation of notification schedules inside Flows.
53
- * "Resets" notifications schedule after pause or failed verification.
54
- * Defaults to "NOW".
55
- */
56
- nextNotificationAfter?: string;
57
51
  };
58
52
  export type SaasComponentDto = ChangeAwareDto & SaasComponentUpsertDto;
@@ -37,11 +37,5 @@ export type UserUpsertDto = ChangeAwareUpsertDto & {
37
37
  riskContributors: RiskContributorUpsertDto[];
38
38
  /** Health score associated with the user */
39
39
  score?: number;
40
- /**
41
- * Used as the naive implementation of notification schedules inside Flows.
42
- * "Resets" notifications schedule after pause or failed verification.
43
- * Defaults to "NOW".
44
- */
45
- nextNotificationAfter?: string;
46
40
  };
47
41
  export type UserDto = ChangeAwareDto & UserUpsertDto;
@@ -3,7 +3,7 @@ import { WorkflowStepType } from './enums/workflowStep.type';
3
3
  import { WorkflowTriggerType } from './enums/workflowTrigger.type';
4
4
  export type NotificationStepData = {
5
5
  /** Name of the device to which the notification of finding applies */
6
- deviceName: string;
6
+ deviceName: string | null;
7
7
  /** Estimated time to remediate the finding, in minutes */
8
8
  duration: number;
9
9
  /** Name of the software to which the finding applies */
@@ -71,5 +71,11 @@ export type WorkflowProgressUpsertDto = {
71
71
  uid: string;
72
72
  /** whether or not this instance of the workflow has been completed */
73
73
  workflowCompleted: boolean;
74
+ /**
75
+ * Used as the naive implementation of notification schedules inside Flows.
76
+ * "Resets" notifications schedule after pause or failed verification.
77
+ * Defaults to "NOW".
78
+ */
79
+ nextNotificationAfter?: string;
74
80
  };
75
81
  export type WorkflowProgressDto = BaseDto & WorkflowProgressUpsertDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "29.1.1",
3
+ "version": "31.0.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -2,6 +2,13 @@ import {BaseDto, BaseUpsertDto} from './base.dto';
2
2
 
3
3
  export type AmpSettingKey = string;
4
4
 
5
+ export type AmpSettingDisplayableValue = {
6
+ cid?: string;
7
+ displayValue: string;
8
+ };
9
+
10
+ export type AmpSettingValue = unknown | AmpSettingDisplayableValue;
11
+
5
12
  export type AmpSettingUpsertDto = BaseUpsertDto & {
6
13
  /** Tenant ID */
7
14
  tid: string;
@@ -10,7 +17,7 @@ export type AmpSettingUpsertDto = BaseUpsertDto & {
10
17
  /** Setting key */
11
18
  key: AmpSettingKey;
12
19
  /** Setting value */
13
- value?: unknown;
20
+ value?: AmpSettingValue;
14
21
  };
15
22
 
16
23
  export type AmpSettingDto = BaseDto & AmpSettingUpsertDto;
@@ -0,0 +1,4 @@
1
+ /* eslint-disable no-unused-vars */
2
+ export enum AmpSettingKeys {
3
+ DEFAULT_NOTIFICATION_CONNECTOR = 'DEFAULT_NOTIFICATION_CONNECTOR',
4
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './auth.role';
2
2
  export * from './agent.status';
3
+ export * from './ampSettingKeys.enum';
3
4
  export * from './category';
4
5
  export * from './connector.status';
5
6
  export * from './findingKind';
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  export enum NotificationStatus {
3
+ INVALID = 'INVALID',
3
4
  PENDING = 'PENDING',
4
5
  READ = 'READ',
5
6
  SENT = 'SENT',
@@ -39,12 +39,6 @@ export type FindingUpsertDto = BaseUpsertDto & {
39
39
  uid?: string | undefined | null;
40
40
  /** Id of the SaasComponent related to the given finding */
41
41
  scid?: string | undefined | null;
42
- /**
43
- * Used as the naive implementation of notification schedules inside Flows.
44
- * "Resets" notifications schedule after pause or failed verification.
45
- * Defaults to "NOW".
46
- */
47
- nextNotificationAfter?: string;
48
42
  /** Number of times this finding was marked PENDING_VERIFIED. Defaults to `0` */
49
43
  verificationCount?: number;
50
44
  /** Optionally populated when requested through query param `include=user` */
@@ -50,12 +50,6 @@ export type SaasComponentUpsertDto = ChangeAwareUpsertDto & {
50
50
  extKey: string;
51
51
  /** Component display value */
52
52
  displayValue: string;
53
- /**
54
- * Used as the naive implementation of notification schedules inside Flows.
55
- * "Resets" notifications schedule after pause or failed verification.
56
- * Defaults to "NOW".
57
- */
58
- nextNotificationAfter?: string;
59
53
  };
60
54
 
61
55
  export type SaasComponentDto = ChangeAwareDto & SaasComponentUpsertDto;
@@ -39,12 +39,6 @@ export type UserUpsertDto = ChangeAwareUpsertDto & {
39
39
  riskContributors: RiskContributorUpsertDto[];
40
40
  /** Health score associated with the user */
41
41
  score?: number;
42
- /**
43
- * Used as the naive implementation of notification schedules inside Flows.
44
- * "Resets" notifications schedule after pause or failed verification.
45
- * Defaults to "NOW".
46
- */
47
- nextNotificationAfter?: string;
48
42
  };
49
43
 
50
44
  export type UserDto = ChangeAwareDto & UserUpsertDto;
@@ -4,7 +4,7 @@ import {WorkflowTriggerType} from './enums/workflowTrigger.type';
4
4
 
5
5
  export type NotificationStepData = {
6
6
  /** Name of the device to which the notification of finding applies */
7
- deviceName: string;
7
+ deviceName: string | null;
8
8
  /** Estimated time to remediate the finding, in minutes */
9
9
  duration: number;
10
10
  /** Name of the software to which the finding applies */
@@ -87,6 +87,12 @@ export type WorkflowProgressUpsertDto = {
87
87
  uid: string;
88
88
  /** whether or not this instance of the workflow has been completed */
89
89
  workflowCompleted: boolean;
90
+ /**
91
+ * Used as the naive implementation of notification schedules inside Flows.
92
+ * "Resets" notifications schedule after pause or failed verification.
93
+ * Defaults to "NOW".
94
+ */
95
+ nextNotificationAfter?: string;
90
96
  };
91
97
 
92
98
  export type WorkflowProgressDto = BaseDto & WorkflowProgressUpsertDto;