@ampsec/platform-client 58.11.0 → 59.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.
Files changed (63) hide show
  1. package/build/src/dto/enums/index.d.ts +0 -6
  2. package/build/src/dto/enums/index.js +0 -6
  3. package/build/src/dto/enums/index.js.map +1 -1
  4. package/build/src/dto/index.d.ts +0 -1
  5. package/build/src/dto/index.js +0 -1
  6. package/build/src/dto/index.js.map +1 -1
  7. package/build/src/dto/notification.dto.d.ts +1168 -153
  8. package/build/src/dto/notification.dto.js +94 -0
  9. package/build/src/dto/notification.dto.js.map +1 -1
  10. package/build/src/dto/platform/index.d.ts +0 -1
  11. package/build/src/dto/platform/index.js +0 -1
  12. package/build/src/dto/platform/index.js.map +1 -1
  13. package/build/src/dto/platform/platform.notification.dto.d.ts +2 -2
  14. package/build/src/services/AmpSdk.d.ts +1 -2
  15. package/build/src/services/AmpSdk.js +0 -1
  16. package/build/src/services/AmpSdk.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/dto/enums/index.ts +0 -6
  19. package/src/dto/index.ts +0 -1
  20. package/src/dto/notification.dto.ts +127 -175
  21. package/src/dto/platform/index.ts +0 -1
  22. package/src/dto/platform/platform.notification.dto.ts +2 -2
  23. package/src/services/AmpSdk.ts +0 -4
  24. package/build/src/dto/enums/contentStrategy.kind.d.ts +0 -5
  25. package/build/src/dto/enums/contentStrategy.kind.js +0 -10
  26. package/build/src/dto/enums/contentStrategy.kind.js.map +0 -1
  27. package/build/src/dto/enums/deliveryStrategy.kind.d.ts +0 -4
  28. package/build/src/dto/enums/deliveryStrategy.kind.js +0 -9
  29. package/build/src/dto/enums/deliveryStrategy.kind.js.map +0 -1
  30. package/build/src/dto/enums/notification.status.d.ts +0 -6
  31. package/build/src/dto/enums/notification.status.js +0 -11
  32. package/build/src/dto/enums/notification.status.js.map +0 -1
  33. package/build/src/dto/enums/supportedMessageChannelKind.enum.d.ts +0 -5
  34. package/build/src/dto/enums/supportedMessageChannelKind.enum.js +0 -20
  35. package/build/src/dto/enums/supportedMessageChannelKind.enum.js.map +0 -1
  36. package/build/src/dto/enums/workflowStep.kind.d.ts +0 -4
  37. package/build/src/dto/enums/workflowStep.kind.js +0 -9
  38. package/build/src/dto/enums/workflowStep.kind.js.map +0 -1
  39. package/build/src/dto/enums/workflowTrigger.kind.d.ts +0 -5
  40. package/build/src/dto/enums/workflowTrigger.kind.js +0 -10
  41. package/build/src/dto/enums/workflowTrigger.kind.js.map +0 -1
  42. package/build/src/dto/platform/platform.workflow.dto.d.ts +0 -6
  43. package/build/src/dto/platform/platform.workflow.dto.js +0 -3
  44. package/build/src/dto/platform/platform.workflow.dto.js.map +0 -1
  45. package/build/src/dto/platform/platform.workflowAssignment.dto.d.ts +0 -4
  46. package/build/src/dto/platform/platform.workflowAssignment.dto.js +0 -3
  47. package/build/src/dto/platform/platform.workflowAssignment.dto.js.map +0 -1
  48. package/build/src/dto/workflow.dto.d.ts +0 -85
  49. package/build/src/dto/workflow.dto.js +0 -3
  50. package/build/src/dto/workflow.dto.js.map +0 -1
  51. package/build/src/dto/workflowAssignment.dto.d.ts +0 -8
  52. package/build/src/dto/workflowAssignment.dto.js +0 -3
  53. package/build/src/dto/workflowAssignment.dto.js.map +0 -1
  54. package/src/dto/enums/contentStrategy.kind.ts +0 -5
  55. package/src/dto/enums/deliveryStrategy.kind.ts +0 -4
  56. package/src/dto/enums/notification.status.ts +0 -6
  57. package/src/dto/enums/supportedMessageChannelKind.enum.ts +0 -16
  58. package/src/dto/enums/workflowStep.kind.ts +0 -4
  59. package/src/dto/enums/workflowTrigger.kind.ts +0 -5
  60. package/src/dto/platform/platform.workflow.dto.ts +0 -10
  61. package/src/dto/platform/platform.workflowAssignment.dto.ts +0 -6
  62. package/src/dto/workflow.dto.ts +0 -104
  63. package/src/dto/workflowAssignment.dto.ts +0 -10
@@ -1,3 +1,97 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._CreateNotificationDto = exports._NotificationDto = exports._NotificationUpsertDto = exports._EmailNotificationUpsertDto = exports._SlackNotificationUpsertDto = exports._BaseNotificationUpsertDto = exports._EmailDeliveryStrategy = exports._SlackDeliveryStrategy = exports._FindingContentStrategy = exports._TemplateContentStrategy = exports._RawContentStrategy = exports._NotificationAddress = exports.DeliveryStrategyKind = exports.ContentStrategyKind = exports.NotificationStatus = void 0;
4
+ const zod_1 = require("zod");
5
+ const base_dto_1 = require("./base.dto");
6
+ var NotificationStatus;
7
+ (function (NotificationStatus) {
8
+ NotificationStatus["INVALID"] = "INVALID";
9
+ NotificationStatus["PENDING"] = "PENDING";
10
+ NotificationStatus["READ"] = "READ";
11
+ NotificationStatus["SENT"] = "SENT";
12
+ })(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
13
+ var ContentStrategyKind;
14
+ (function (ContentStrategyKind) {
15
+ ContentStrategyKind["RAW"] = "RAW";
16
+ ContentStrategyKind["TEMPLATE"] = "TEMPLATE";
17
+ ContentStrategyKind["FINDING"] = "FINDING";
18
+ })(ContentStrategyKind || (exports.ContentStrategyKind = ContentStrategyKind = {}));
19
+ var DeliveryStrategyKind;
20
+ (function (DeliveryStrategyKind) {
21
+ DeliveryStrategyKind["EMAIL"] = "EMAIL";
22
+ /** @deprecated Use SLACK Instead */
23
+ DeliveryStrategyKind["MESSAGING"] = "MESSAGING";
24
+ DeliveryStrategyKind["SLACK"] = "SLACK";
25
+ })(DeliveryStrategyKind || (exports.DeliveryStrategyKind = DeliveryStrategyKind = {}));
26
+ exports._NotificationAddress = zod_1.z.object({
27
+ cid: zod_1.z.string().optional(),
28
+ groups: zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number()])).optional(),
29
+ users: zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number()])).optional(),
30
+ webhooks: zod_1.z.array(zod_1.z.string()).optional(),
31
+ });
32
+ exports._RawContentStrategy = zod_1.z.object({
33
+ kind: zod_1.z.literal(ContentStrategyKind.RAW),
34
+ content: zod_1.z.string(),
35
+ subject: zod_1.z.string().optional(),
36
+ context: zod_1.z.record(zod_1.z.string()).optional(),
37
+ });
38
+ exports._TemplateContentStrategy = zod_1.z.object({
39
+ kind: zod_1.z.literal(ContentStrategyKind.TEMPLATE),
40
+ templateId: zod_1.z.string(),
41
+ context: zod_1.z.record(zod_1.z.string()),
42
+ });
43
+ exports._FindingContentStrategy = zod_1.z.object({
44
+ kind: zod_1.z.literal(ContentStrategyKind.FINDING),
45
+ fid: zod_1.z.string(),
46
+ });
47
+ const _BaseDeliveryStrategy = zod_1.z.object({
48
+ copySecOpsTeam: zod_1.z.boolean().optional(),
49
+ });
50
+ exports._SlackDeliveryStrategy = _BaseDeliveryStrategy.merge(zod_1.z.object({
51
+ to: zod_1.z.object({
52
+ cid: zod_1.z.string().optional(),
53
+ groups: zod_1.z.array(zod_1.z.string()).optional(),
54
+ users: zod_1.z.array(zod_1.z.string()).optional(),
55
+ webhooks: zod_1.z.array(zod_1.z.string()).optional(),
56
+ }),
57
+ teamId: zod_1.z.string(),
58
+ }));
59
+ exports._EmailDeliveryStrategy = _BaseDeliveryStrategy.merge(zod_1.z.object({
60
+ to: zod_1.z.object({
61
+ users: zod_1.z.array(zod_1.z.string()),
62
+ }),
63
+ subject: zod_1.z.string(),
64
+ }));
65
+ exports._BaseNotificationUpsertDto = base_dto_1._BaseUpsertDto.merge(zod_1.z.object({
66
+ status: zod_1.z.nativeEnum(NotificationStatus),
67
+ // TODO when will this happen? or will it happen at all? https://github.com/colinhacks/zod/issues/2106 🤷‍♂️
68
+ contentStrategy: zod_1.z.discriminatedUnion('kind', [exports._RawContentStrategy, exports._FindingContentStrategy, exports._TemplateContentStrategy]),
69
+ fid: zod_1.z.string().optional(),
70
+ uid: zod_1.z.string().optional(),
71
+ agentId: zod_1.z.string().optional(),
72
+ }));
73
+ exports._SlackNotificationUpsertDto = exports._BaseNotificationUpsertDto.merge(zod_1.z.object({
74
+ deliveryChannel: zod_1.z.literal(DeliveryStrategyKind.SLACK),
75
+ deliveryStrategy: exports._SlackDeliveryStrategy,
76
+ }));
77
+ exports._EmailNotificationUpsertDto = exports._BaseNotificationUpsertDto.merge(zod_1.z.object({
78
+ deliveryChannel: zod_1.z.literal(DeliveryStrategyKind.EMAIL),
79
+ deliveryStrategy: exports._EmailDeliveryStrategy,
80
+ }));
81
+ // TODO when will this happen? or will it happen at all? https://github.com/colinhacks/zod/issues/2106 🤷‍♂️
82
+ exports._NotificationUpsertDto = zod_1.z.discriminatedUnion('deliveryChannel', [exports._SlackNotificationUpsertDto, exports._EmailNotificationUpsertDto]);
83
+ exports._NotificationDto = exports._NotificationUpsertDto.and(base_dto_1._BaseDto);
84
+ exports._CreateNotificationDto = base_dto_1._BaseUpsertDto.merge(zod_1.z.object({
85
+ test: zod_1.z.boolean().optional(),
86
+ channel: zod_1.z.nativeEnum(DeliveryStrategyKind),
87
+ content: exports._RawContentStrategy,
88
+ options: zod_1.z.object({
89
+ copySecOpsTeam: zod_1.z.boolean().optional(),
90
+ }),
91
+ uid: zod_1.z.string().optional(),
92
+ fid: zod_1.z.string().optional(),
93
+ /** @deprecated ID of the agent from which the notification was sent */
94
+ faid: zod_1.z.string().optional(),
95
+ agentId: zod_1.z.string().optional(),
96
+ }));
3
97
  //# sourceMappingURL=notification.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.dto.js","sourceRoot":"","sources":["../../../src/dto/notification.dto.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"notification.dto.js","sourceRoot":"","sources":["../../../src/dto/notification.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,yCAA6D;AAE7D,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAED,IAAY,mBAIX;AAJD,WAAY,mB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C,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,OAAO,EAAE,OAAC,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAC3C,OAAO,EAAE,2BAAmB;IAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACvC,CAAC;IACF,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,uEAAuE;IACvE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CACH,CAAC"}
@@ -17,4 +17,3 @@ export * from './platform.ampSetting.dto';
17
17
  export * from './platform.tenants.dto';
18
18
  export * from './platform.users.dto';
19
19
  export * from './tenant.based.dto';
20
- export * from './platform.workflow.dto';
@@ -33,5 +33,4 @@ __exportStar(require("./platform.ampSetting.dto"), exports);
33
33
  __exportStar(require("./platform.tenants.dto"), exports);
34
34
  __exportStar(require("./platform.users.dto"), exports);
35
35
  __exportStar(require("./tenant.based.dto"), exports);
36
- __exportStar(require("./platform.workflow.dto"), exports);
37
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/platform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,0DAAwC;AACxC,uDAAqC;AACrC,mEAAiD;AACjD,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,+DAA6C;AAC7C,iEAA+C;AAC/C,4DAA0C;AAC1C,gEAA8C;AAC9C,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,qDAAmC;AACnC,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/platform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,0DAAwC;AACxC,uDAAqC;AACrC,mEAAiD;AACjD,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,+DAA6C;AAC7C,iEAA+C;AAC/C,4DAA0C;AAC1C,gEAA8C;AAC9C,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,qDAAmC"}
@@ -1,4 +1,4 @@
1
1
  import { NotificationDto, NotificationUpsertDto } from '../notification.dto';
2
- import { TenantBased } from './tenant.based.dto';
3
- export type PlatformNotificationUpsertDto = NotificationUpsertDto & TenantBased;
2
+ import { TenantBased, UpsertTenantBased } from './tenant.based.dto';
3
+ export type PlatformNotificationUpsertDto = NotificationUpsertDto & UpsertTenantBased;
4
4
  export type PlatformNotificationDto = NotificationDto & TenantBased;
@@ -1,4 +1,4 @@
1
- import { PlatformAgentDto, PlatformAgentUpsertDto, PlatformConnectorDto, PlatformConnectorUpsertDto, PlatformFindingDto, PlatformFindingUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformWorkflowProgressDto, PlatformWorkflowProgressUpsertDto, ProviderDto, TenantDto, TenantUpsertDto } from '../dto';
1
+ import { PlatformAgentDto, PlatformAgentUpsertDto, PlatformConnectorDto, PlatformConnectorUpsertDto, PlatformFindingDto, PlatformFindingUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, ProviderDto, TenantDto, TenantUpsertDto } from '../dto';
2
2
  import { AmpEntityService, AmpSdkAssetService, AmpSdkTenantService, AmpSdkUserService } from './entity.service';
3
3
  import { AmpRestClientOptions, RestClient } from './rest';
4
4
  import { PlatformJobSpecDto, PlatformJobSpecUpsertDto } from '../dto/platform/platform.jobSpec.dto';
@@ -41,7 +41,6 @@ export declare class AmpSdkServices {
41
41
  readonly settings: AmpSdkSettingsService;
42
42
  readonly tenants: AmpSdkTenantService<TenantUpsertDto, TenantDto>;
43
43
  readonly users: AmpSdkUserService;
44
- readonly workflowsProgress: AmpEntityService<PlatformWorkflowProgressUpsertDto, PlatformWorkflowProgressDto>;
45
44
  constructor(rest: RestClient);
46
45
  static instance(options: AmpSdkOptions): AmpSdkServices;
47
46
  }
@@ -41,7 +41,6 @@ class AmpSdkServices {
41
41
  this.settings = new settings_service_1.AmpSdkSettingsService(rest);
42
42
  this.tenants = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.TENANTS, constants_1.TARGET_API_PLATFORM);
43
43
  this.users = new entity_service_1.AmpSdkUserService(rest, constants_1.TARGET_API_PLATFORM);
44
- this.workflowsProgress = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.WORKFLOW_PROGRESS, constants_1.TARGET_API_PLATFORM);
45
44
  }
46
45
  static instance(options) {
47
46
  const rest = (0, rest_1.getAmpRestClient)(options);
@@ -1 +1 @@
1
- {"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AAoBA,qDAAoI;AACpI,iCAA0E;AAC1E,2CAAsD;AAGtD,oDAAmE;AACnE,yDAAyD;AACzD,6DAA+J;AAC/J,6DAAuD;AACvD,yEAAmE;AAKnE;;;;;;;;GAQG;AACH,MAAa,cAAc;IAwBzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,K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I,CAAC,aAAa,EAAE,+BAAmB,CAAC,CAAC;QACrJ,IAAI,CAAC,SAAS,GAAG,IAAI,qCAAoB,CAAyC,IAAI,EAAE,gBAAI,CAAC,SAAS,EAAE,+BAAmB,CAAC,CAAC;QAC7H,IAAI,CAAC,aAAa,GAAG,IAAI,6CAAwB,CAAyD,IAAI,EAAE,gBAAI,CAAC,cAAc,EAAE,+BAAmB,CAAC,CAAC;QAC1J,IAAI,CAAC,gBAAgB,GAAG,IAAI,6CAAwB,CAA+D,IAAI,EAAE,gBAAI,CAAC,iBAAiB,EAAE,+BAAmB,CAAC,CAAC;QACtK,IAAI,CAAC,UAAU,GAAG,IAAI,2CAAsB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,GAAG,IAAI,+CAA0B,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAChF,IAAI,CAAC,SAAS,GAAG,IAAI,0CAAqB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QACtE,IAAI,CAAC,QAAQ,GAAG,IAAI,wCAAqB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,IAAI,qCAAoB,CAA6B,IAAI,EAAE,gBAAI,CAAC,OAAO,EAAE,+BAAmB,CAAC,CAAC;QAC7G,IAAI,CAAC,KAAK,GAAG,IAAI,kCAAiB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAsB;QACpC,MAAM,IAAI,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AAnDD,wCAmDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "58.11.0",
3
+ "version": "59.0.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -6,8 +6,6 @@ export * from './category';
6
6
  export * from './computer.os.enum';
7
7
  export * from './connector.status';
8
8
  export * from './contact.type';
9
- export * from './contentStrategy.kind';
10
- export * from './deliveryStrategy.kind';
11
9
  export * from './findingKind';
12
10
  export * from './finding.severity';
13
11
  export * from './finding.status';
@@ -16,11 +14,7 @@ export * from './globalAsset.type';
16
14
  export * from './globalUser.type';
17
15
  export * from './jobExecution.status';
18
16
  export * from './mobile.os.enum';
19
- export * from './notification.status';
20
17
  export * from './requiredDataProperty.enum';
21
18
  export * from './riskContributor.type';
22
19
  export * from './saasComponentKind';
23
- export * from './supportedMessageChannelKind.enum';
24
- export * from './workflowStep.kind';
25
- export * from './workflowTrigger.kind';
26
20
  export * from './aiServiceModelName';
package/src/dto/index.ts CHANGED
@@ -27,5 +27,4 @@ export * from './saasUsers.dto';
27
27
  export * from './ampSetting.dto';
28
28
  export * from './tenants.dto';
29
29
  export * from './users.dto';
30
- export * from './workflow.dto';
31
30
  export * from './messagingChannels';
@@ -1,176 +1,128 @@
1
- import {BaseDto, BaseUpsertDto} from './base.dto';
2
- import {Category, DeliveryStrategyKind, FindingKind, FindingSeverity, NotificationStatus} from './enums';
3
- import {ContentStrategyKind} from './enums/contentStrategy.kind';
4
- import {FindingOutcome} from './enums/finding.outcome';
5
- import {SupportedMessageChannelKind} from './enums/supportedMessageChannelKind.enum';
6
-
7
- export type NotificationAddress = {
8
- /** Connector ID for the notification channel */
9
- cid?: string;
10
- /** Group IDs to which the notification is being sent */
11
- groups?: string[] | number[];
12
- /** User IDs to which the notification is being sent */
13
- users?: string[] | number[];
14
- /** Webhook URLs to which the notification is being sent */
15
- webhooks?: string[];
16
- };
17
-
18
- export type MessageNotificationAddress = NotificationAddress & {
19
- /** Channel kind for messaging applications */
20
- kind: SupportedMessageChannelKind;
21
- };
22
-
23
- export type SlackNotificationAddress = MessageNotificationAddress & {
24
- teamId: string;
25
- };
26
-
27
- export type AssetNotificationContext = {
28
- /** Name of the asset */
29
- deviceName: string;
30
- };
31
-
32
- export type CreateNotificationOptions = {
33
- /** Whether to CC the secops team of the notification, likely a tenant setting once implemented */
34
- copySecOpsTeam: boolean;
35
- };
36
-
37
- export type CreateNotificationContent = {
38
- /** Kind of the content strategy */
39
- kind: ContentStrategyKind; // Future kinds will exist, but for now we only support RAW
40
- /** Content of the notification */
41
- content: string;
42
- };
43
-
44
- export type CreateNotificationDto = BaseUpsertDto & {
45
- /** Channel type that should be used for sending the notificaiton */
46
- channel: DeliveryStrategyKind;
47
- /** Content settings of the notification */
48
- content: CreateNotificationContent;
49
- /** Additional options for the notification */
50
- options?: CreateNotificationOptions;
51
- /** The user id this notification will be sent to, optional as not all findings are associated to a user */
52
- uid?: string;
53
- /** The finding id this notification is in regards to */
54
- fid?: string;
55
- /** ID of the agent from which the notification was sent */
56
- faid?: string | null;
57
- };
58
-
59
- export type FindingNotificationContext = {
60
- /** Severity of the finding */
61
- severity: FindingSeverity;
62
- /** Category of the finding */
63
- category: Category;
64
- /** Kind of the finding */
65
- kind: FindingKind;
66
- /** Desired outcome of surfacing the finding */
67
- outcome: FindingOutcome;
68
- };
69
-
70
- export type VulnerabilityNotificationContext = {
71
- /** Summary of the vulnerability. */
72
- description: string;
73
- /** Summary of the remediation action. */
74
- solution?: string;
75
- /** CVSS score of the vulnerability. */
76
- cvss?: number;
77
- /** CVE of the vulnerability */
78
- cve?: string;
79
- };
80
-
81
- export type TrainingNotificationContext = {
82
- /** Title of the training */
83
- title: string;
84
- /** Date enrolled in the training */
85
- enrollDate: string | null | undefined;
86
- /** Date started the training */
87
- startDate: string | null | undefined;
88
- };
89
-
90
- export type UserNotificationContext = {
91
- /** First name of the user */
92
- firstName: string;
93
- /** Last name of the user */
94
- lastName: string;
95
- /** Title of the user */
96
- title: string;
97
- /** Department of the user */
98
- department: string;
99
- };
100
-
101
- export type ProviderNotificationContext = {
102
- /** Name of the provider */
103
- softwareName: string;
104
- };
105
-
106
- export type NotificationContext = {
107
- /** Estimated completion time for the remediation described by the notification */
108
- estimatedCompletionTime: number;
109
- /** Asset to which the notification refers */
110
- asset?: AssetNotificationContext;
111
- /** Finding that generated the notification */
112
- finding?: FindingNotificationContext;
113
- /** Provider to which the notification is associated */
114
- provider?: ProviderNotificationContext;
115
- /** Training to which the notification refers */
116
- training?: TrainingNotificationContext;
117
- /** User to which the notification is being sent */
118
- user?: UserNotificationContext;
119
- /** Vulnerability to which the notification refers */
120
- vulnerability?: VulnerabilityNotificationContext;
121
- };
122
-
123
- export type ContentStrategySpecification = {
124
- /** Kind of the content strategy */
125
- kind: ContentStrategyKind;
126
- };
127
-
128
- export type TemplateContentStrategySpec = ContentStrategySpecification & {
129
- /** ID of the template to be used for the notification */
130
- templateId: string;
131
- /** Context for the notification */
132
- context: NotificationContext;
133
- };
134
-
135
- export type RawContentStrategySpec = ContentStrategySpecification & {
136
- /** Content of the notification */
137
- content: string;
138
- };
139
-
140
- export type LlmContentStrategySpec = ContentStrategySpecification & {
141
- /** Context for the notification */
142
- context: NotificationContext;
143
- history?: {role: 'user' | 'system' | 'assistant'; content: string}[];
144
- };
145
-
146
- export type DeliveryStrategySpec = {
147
- /** Channel type that should be used for sending the notificaiton */
148
- kind: DeliveryStrategyKind;
149
- /** Recipient address to which the notification is being sent */
150
- to: NotificationAddress | SlackNotificationAddress;
151
- };
152
-
153
- export type EmailDeliveryStrategySpec = DeliveryStrategySpec & {
154
- subject: string;
155
- };
156
-
157
- export type NotificationUpsertDto = BaseUpsertDto & {
158
- /** Workflow ID for which the notification is being created */
159
- wfid?: string | null;
160
- /** Step number in the workflow for which the notification is being created */
161
- stepNumber?: number | null;
162
- /** Status of the notification */
163
- status: NotificationStatus;
164
- /** Data to be used for the notification */
165
- contentStrategy: TemplateContentStrategySpec | RawContentStrategySpec | LlmContentStrategySpec;
166
- /** Method of delivery */
167
- deliveryStrategy: DeliveryStrategySpec;
168
- /** Finding ID for which the notification is being created */
169
- fid?: string | null;
170
- /** ID of the user to which the notification is being sent */
171
- uid?: string | null;
172
- /** ID of the agent from which the notification was sent */
173
- faid?: string | null;
174
- };
175
-
1
+ import {z} from 'zod';
2
+ import {BaseDto, _BaseDto, _BaseUpsertDto} from './base.dto';
3
+
4
+ export enum NotificationStatus {
5
+ INVALID = 'INVALID',
6
+ PENDING = 'PENDING',
7
+ READ = 'READ',
8
+ SENT = 'SENT',
9
+ }
10
+
11
+ export enum ContentStrategyKind {
12
+ RAW = 'RAW',
13
+ TEMPLATE = 'TEMPLATE',
14
+ FINDING = 'FINDING',
15
+ }
16
+
17
+ export enum DeliveryStrategyKind {
18
+ EMAIL = 'EMAIL',
19
+ /** @deprecated Use SLACK Instead */
20
+ MESSAGING = 'MESSAGING',
21
+ SLACK = 'SLACK',
22
+ }
23
+
24
+ export const _NotificationAddress = z.object({
25
+ cid: z.string().optional(),
26
+ groups: z.array(z.union([z.string(), z.number()])).optional(),
27
+ users: z.array(z.union([z.string(), z.number()])).optional(),
28
+ webhooks: z.array(z.string()).optional(),
29
+ });
30
+
31
+ export const _RawContentStrategy = z.object({
32
+ kind: z.literal(ContentStrategyKind.RAW),
33
+ content: z.string(),
34
+ subject: z.string().optional(),
35
+ context: z.record(z.string()).optional(),
36
+ });
37
+ export type RawContentStrategy = z.infer<typeof _RawContentStrategy>;
38
+
39
+ export const _TemplateContentStrategy = z.object({
40
+ kind: z.literal(ContentStrategyKind.TEMPLATE),
41
+ templateId: z.string(),
42
+ context: z.record(z.string()),
43
+ });
44
+ export type TemplateContentStrategy = z.infer<typeof _TemplateContentStrategy>;
45
+
46
+ export const _FindingContentStrategy = z.object({
47
+ kind: z.literal(ContentStrategyKind.FINDING),
48
+ fid: z.string(),
49
+ });
50
+ export type FindingContentStrategy = z.infer<typeof _FindingContentStrategy>;
51
+
52
+ const _BaseDeliveryStrategy = z.object({
53
+ copySecOpsTeam: z.boolean().optional(),
54
+ });
55
+
56
+ export const _SlackDeliveryStrategy = _BaseDeliveryStrategy.merge(
57
+ z.object({
58
+ to: z.object({
59
+ cid: z.string().optional(),
60
+ groups: z.array(z.string()).optional(),
61
+ users: z.array(z.string()).optional(),
62
+ webhooks: z.array(z.string()).optional(),
63
+ }),
64
+ teamId: z.string(),
65
+ })
66
+ );
67
+ export type SlackDeliveryStrategy = z.infer<typeof _SlackDeliveryStrategy>;
68
+
69
+ export const _EmailDeliveryStrategy = _BaseDeliveryStrategy.merge(
70
+ z.object({
71
+ to: z.object({
72
+ users: z.array(z.string()),
73
+ }),
74
+ subject: z.string(),
75
+ })
76
+ );
77
+ export type EmailDeliveryStrategy = z.infer<typeof _EmailDeliveryStrategy>;
78
+
79
+ export const _BaseNotificationUpsertDto = _BaseUpsertDto.merge(
80
+ z.object({
81
+ status: z.nativeEnum(NotificationStatus),
82
+ // TODO when will this happen? or will it happen at all? https://github.com/colinhacks/zod/issues/2106 🤷‍♂️
83
+ contentStrategy: z.discriminatedUnion('kind', [_RawContentStrategy, _FindingContentStrategy, _TemplateContentStrategy]),
84
+ fid: z.string().optional(),
85
+ uid: z.string().optional(),
86
+ agentId: z.string().optional(),
87
+ })
88
+ );
89
+
90
+ export const _SlackNotificationUpsertDto = _BaseNotificationUpsertDto.merge(
91
+ z.object({
92
+ deliveryChannel: z.literal(DeliveryStrategyKind.SLACK),
93
+ deliveryStrategy: _SlackDeliveryStrategy,
94
+ })
95
+ );
96
+ export type SlackNotificationUpsertDto = z.infer<typeof _SlackNotificationUpsertDto>;
97
+
98
+ export const _EmailNotificationUpsertDto = _BaseNotificationUpsertDto.merge(
99
+ z.object({
100
+ deliveryChannel: z.literal(DeliveryStrategyKind.EMAIL),
101
+ deliveryStrategy: _EmailDeliveryStrategy,
102
+ })
103
+ );
104
+ export type EmailNotificationUpsertDto = z.infer<typeof _EmailNotificationUpsertDto>;
105
+
106
+ // TODO when will this happen? or will it happen at all? https://github.com/colinhacks/zod/issues/2106 🤷‍♂️
107
+ export const _NotificationUpsertDto = z.discriminatedUnion('deliveryChannel', [_SlackNotificationUpsertDto, _EmailNotificationUpsertDto]);
108
+ export type NotificationUpsertDto = z.infer<typeof _NotificationUpsertDto>;
109
+
110
+ export const _NotificationDto = _NotificationUpsertDto.and(_BaseDto);
176
111
  export type NotificationDto = NotificationUpsertDto & BaseDto;
112
+
113
+ export const _CreateNotificationDto = _BaseUpsertDto.merge(
114
+ z.object({
115
+ test: z.boolean().optional(),
116
+ channel: z.nativeEnum(DeliveryStrategyKind),
117
+ content: _RawContentStrategy,
118
+ options: z.object({
119
+ copySecOpsTeam: z.boolean().optional(),
120
+ }),
121
+ uid: z.string().optional(),
122
+ fid: z.string().optional(),
123
+ /** @deprecated ID of the agent from which the notification was sent */
124
+ faid: z.string().optional(),
125
+ agentId: z.string().optional(),
126
+ })
127
+ );
128
+ export type CreateNotificationDto = z.infer<typeof _CreateNotificationDto>;
@@ -17,4 +17,3 @@ export * from './platform.ampSetting.dto';
17
17
  export * from './platform.tenants.dto';
18
18
  export * from './platform.users.dto';
19
19
  export * from './tenant.based.dto';
20
- export * from './platform.workflow.dto';
@@ -1,6 +1,6 @@
1
1
  import {NotificationDto, NotificationUpsertDto} from '../notification.dto';
2
- import {TenantBased} from './tenant.based.dto';
2
+ import {TenantBased, UpsertTenantBased} from './tenant.based.dto';
3
3
 
4
- export type PlatformNotificationUpsertDto = NotificationUpsertDto & TenantBased;
4
+ export type PlatformNotificationUpsertDto = NotificationUpsertDto & UpsertTenantBased;
5
5
 
6
6
  export type PlatformNotificationDto = NotificationDto & TenantBased;
@@ -12,8 +12,6 @@ import {
12
12
  PlatformReportResultUpsertDto,
13
13
  PlatformRiskContributorDto,
14
14
  PlatformRiskContributorUpsertDto,
15
- PlatformWorkflowProgressDto,
16
- PlatformWorkflowProgressUpsertDto,
17
15
  ProviderDto,
18
16
  TenantDto,
19
17
  TenantUpsertDto,
@@ -63,7 +61,6 @@ export class AmpSdkServices {
63
61
  readonly settings: AmpSdkSettingsService;
64
62
  readonly tenants: AmpSdkTenantService<TenantUpsertDto, TenantDto>;
65
63
  readonly users: AmpSdkUserService;
66
- readonly workflowsProgress: AmpEntityService<PlatformWorkflowProgressUpsertDto, PlatformWorkflowProgressDto>;
67
64
 
68
65
  constructor(rest: RestClient) {
69
66
  this.agents = new AmpEntityServiceImpl<PlatformAgentUpsertDto, PlatformAgentDto>(rest, KIND.AGENTS, TARGET_API_PLATFORM);
@@ -87,7 +84,6 @@ export class AmpSdkServices {
87
84
  this.settings = new AmpSdkSettingsService(rest);
88
85
  this.tenants = new AmpEntityServiceImpl<TenantUpsertDto, TenantDto>(rest, KIND.TENANTS, TARGET_API_PLATFORM);
89
86
  this.users = new AmpSdkUserService(rest, TARGET_API_PLATFORM);
90
- this.workflowsProgress = new AmpEntityServiceImpl<PlatformWorkflowProgressUpsertDto, PlatformWorkflowProgressDto>(rest, KIND.WORKFLOW_PROGRESS, TARGET_API_PLATFORM);
91
87
  }
92
88
 
93
89
  static instance(options: AmpSdkOptions): AmpSdkServices {
@@ -1,5 +0,0 @@
1
- export declare enum ContentStrategyKind {
2
- LLM = "LLM",
3
- RAW = "RAW",
4
- TEMPLATE = "TEMPLATE"
5
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContentStrategyKind = void 0;
4
- var ContentStrategyKind;
5
- (function (ContentStrategyKind) {
6
- ContentStrategyKind["LLM"] = "LLM";
7
- ContentStrategyKind["RAW"] = "RAW";
8
- ContentStrategyKind["TEMPLATE"] = "TEMPLATE";
9
- })(ContentStrategyKind || (exports.ContentStrategyKind = ContentStrategyKind = {}));
10
- //# sourceMappingURL=contentStrategy.kind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contentStrategy.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/contentStrategy.kind.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,kCAAW,CAAA;IACX,4CAAqB,CAAA;AACvB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B"}
@@ -1,4 +0,0 @@
1
- export declare enum DeliveryStrategyKind {
2
- EMAIL = "EMAIL",
3
- MESSAGING = "MESSAGING"
4
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeliveryStrategyKind = void 0;
4
- var DeliveryStrategyKind;
5
- (function (DeliveryStrategyKind) {
6
- DeliveryStrategyKind["EMAIL"] = "EMAIL";
7
- DeliveryStrategyKind["MESSAGING"] = "MESSAGING";
8
- })(DeliveryStrategyKind || (exports.DeliveryStrategyKind = DeliveryStrategyKind = {}));
9
- //# sourceMappingURL=deliveryStrategy.kind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deliveryStrategy.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/deliveryStrategy.kind.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,+CAAuB,CAAA;AACzB,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B"}
@@ -1,6 +0,0 @@
1
- export declare enum NotificationStatus {
2
- INVALID = "INVALID",
3
- PENDING = "PENDING",
4
- READ = "READ",
5
- SENT = "SENT"
6
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationStatus = void 0;
4
- var NotificationStatus;
5
- (function (NotificationStatus) {
6
- NotificationStatus["INVALID"] = "INVALID";
7
- NotificationStatus["PENDING"] = "PENDING";
8
- NotificationStatus["READ"] = "READ";
9
- NotificationStatus["SENT"] = "SENT";
10
- })(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
11
- //# sourceMappingURL=notification.status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/notification.status.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B"}
@@ -1,5 +0,0 @@
1
- export declare enum SupportedMessageChannelKind {
2
- SLACK = "SLACK",
3
- UNSUPPORTED = "UNSUPPORTED"
4
- }
5
- export declare const getSupportedMessageChannelKindFrom: (description: string | undefined) => SupportedMessageChannelKind;