@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,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSupportedMessageChannelKindFrom = exports.SupportedMessageChannelKind = void 0;
4
- var SupportedMessageChannelKind;
5
- (function (SupportedMessageChannelKind) {
6
- SupportedMessageChannelKind["SLACK"] = "SLACK";
7
- SupportedMessageChannelKind["UNSUPPORTED"] = "UNSUPPORTED";
8
- })(SupportedMessageChannelKind || (exports.SupportedMessageChannelKind = SupportedMessageChannelKind = {}));
9
- const getSupportedMessageChannelKindFrom = (description) => {
10
- if (description) {
11
- for (const kind in SupportedMessageChannelKind) {
12
- if (description.toUpperCase().includes(kind)) {
13
- return SupportedMessageChannelKind[kind];
14
- }
15
- }
16
- }
17
- return SupportedMessageChannelKind.UNSUPPORTED;
18
- };
19
- exports.getSupportedMessageChannelKindFrom = getSupportedMessageChannelKindFrom;
20
- //# sourceMappingURL=supportedMessageChannelKind.enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"supportedMessageChannelKind.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/supportedMessageChannelKind.enum.ts"],"names":[],"mappings":";;;AAAA,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,CAAC;QAChB,KAAK,MAAM,IAAI,IAAI,2BAA2B,EAAE,CAAC;YAC/C,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,OAAO,2BAA2B,CAAC,IAAgD,CAAgC,CAAC;YACtH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,2BAA2B,CAAC,WAAW,CAAC;AACjD,CAAC,CAAC;AAVW,QAAA,kCAAkC,sCAU7C"}
@@ -1,4 +0,0 @@
1
- export declare enum WorkflowStepKind {
2
- NOTIFICATION = "NOTIFICATION",
3
- PAUSE = "PAUSE"
4
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WorkflowStepKind = void 0;
4
- var WorkflowStepKind;
5
- (function (WorkflowStepKind) {
6
- WorkflowStepKind["NOTIFICATION"] = "NOTIFICATION";
7
- WorkflowStepKind["PAUSE"] = "PAUSE";
8
- })(WorkflowStepKind || (exports.WorkflowStepKind = WorkflowStepKind = {}));
9
- //# sourceMappingURL=workflowStep.kind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflowStep.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/workflowStep.kind.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B"}
@@ -1,5 +0,0 @@
1
- export declare enum WorkflowTriggerKind {
2
- FINDING = "FINDING",
3
- USER = "USER",
4
- SAAS_COMPONENT = "SAAS_COMPONENT"
5
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WorkflowTriggerKind = void 0;
4
- var WorkflowTriggerKind;
5
- (function (WorkflowTriggerKind) {
6
- WorkflowTriggerKind["FINDING"] = "FINDING";
7
- WorkflowTriggerKind["USER"] = "USER";
8
- WorkflowTriggerKind["SAAS_COMPONENT"] = "SAAS_COMPONENT";
9
- })(WorkflowTriggerKind || (exports.WorkflowTriggerKind = WorkflowTriggerKind = {}));
10
- //# sourceMappingURL=workflowTrigger.kind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflowTrigger.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/workflowTrigger.kind.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,wDAAiC,CAAA;AACnC,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B"}
@@ -1,6 +0,0 @@
1
- import { WorkflowDto, WorkflowProgressDto, WorkflowProgressUpsertDto, WorkflowUpsertDto } from '../workflow.dto';
2
- import { TenantBased } from './tenant.based.dto';
3
- export type PlatformWorkflowUpsertDto = WorkflowUpsertDto & TenantBased;
4
- export type PlatformWorkflowDto = WorkflowDto & TenantBased;
5
- export type PlatformWorkflowProgressUpsertDto = WorkflowProgressUpsertDto & TenantBased;
6
- export type PlatformWorkflowProgressDto = WorkflowProgressDto & TenantBased;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=platform.workflow.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform.workflow.dto.js","sourceRoot":"","sources":["../../../../src/dto/platform/platform.workflow.dto.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- import { WorkflowAssignmentUpsertDto } from '../workflowAssignment.dto';
2
- import { TenantBased } from './tenant.based.dto';
3
- export type PlatformWorkflowAssignmentUpsertDto = WorkflowAssignmentUpsertDto & TenantBased;
4
- export type PlatformWorkflowAssignmentDto = PlatformWorkflowAssignmentUpsertDto & TenantBased;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=platform.workflowAssignment.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform.workflowAssignment.dto.js","sourceRoot":"","sources":["../../../../src/dto/platform/platform.workflowAssignment.dto.ts"],"names":[],"mappings":""}
@@ -1,85 +0,0 @@
1
- import { BaseDto } from './base.dto';
2
- import { ContentStrategyKind, DeliveryStrategyKind } from './enums';
3
- import { FindingOutcome } from './enums/finding.outcome';
4
- import { WorkflowStepKind } from './enums/workflowStep.kind';
5
- import { WorkflowTriggerKind } from './enums/workflowTrigger.kind';
6
- export type WorflowStepDescriptor = {
7
- /** Type of the notification step, either NOTIFICATION or PAUSE */
8
- kind: WorkflowStepKind;
9
- /** Optional default values to be used of no other is provided */
10
- defaults?: {
11
- [propName: string]: string | number | boolean | FindingOutcome;
12
- };
13
- };
14
- export type NotificationStepDescriptor = WorflowStepDescriptor & {
15
- /** Delivery strategy to be used for the notification */
16
- deliveryStrategyKinds: DeliveryStrategyKind[];
17
- };
18
- export type PauseStepDescriptor = WorflowStepDescriptor & {
19
- /** Duration, in days, to wait before executing the next step in the workflow */
20
- pauseDuration: number;
21
- };
22
- export type ContentDescriptor = {
23
- /** Kind of the content that will be generated for the notification */
24
- kind: ContentStrategyKind;
25
- };
26
- export type TemplateContentDescriptor = ContentDescriptor & {
27
- /** ID of the template to be used for the notification */
28
- templateId: string;
29
- };
30
- export type WorkflowStep = {
31
- /** Indicates the type of workflow step and contains relevant information for each */
32
- stepDescriptor: NotificationStepDescriptor | PauseStepDescriptor;
33
- /** Content to be used for the notification */
34
- contentDescriptor?: ContentDescriptor | TemplateContentDescriptor;
35
- /** Step number to transition the workflow to on success */
36
- successStepNumber: number | null;
37
- /** Step number to transition the workflow to on failure */
38
- failureStepNumber: number | null;
39
- };
40
- export type WorkflowSteps = {
41
- [propName: number]: WorkflowStep;
42
- };
43
- export type WorkflowTriggerRule = {
44
- [propName: string]: string | number | boolean | null | {
45
- [propName: string]: string | number | boolean | WorkflowTriggerRule;
46
- } | WorkflowTriggerRule[];
47
- };
48
- export type WorkflowTrigger = {
49
- /** Kind of the trigger */
50
- kind: WorkflowTriggerKind;
51
- /** Rule to which the applicable entity type must conform to trigger the workflow */
52
- rule: unknown;
53
- /** Number of days a finding has to exist in addition to matching the above rule */
54
- sla?: number;
55
- };
56
- export type WorkflowUpsertDto = {
57
- /** Name of the workflow */
58
- name: string;
59
- /** Description of the workflow */
60
- description?: string;
61
- /** Trigger that begins execution of the workflow */
62
- trigger: WorkflowTrigger;
63
- /** Steps in the workflow */
64
- steps: WorkflowSteps;
65
- };
66
- export type WorkflowDto = BaseDto & WorkflowUpsertDto;
67
- export type WorkflowProgressUpsertDto = {
68
- /** ID of the workflow */
69
- wfid: string;
70
- /** ID of the finding for which the workflow is being executed */
71
- fid?: string | null;
72
- /** Step number to transition the workflow to next */
73
- nextStep: number | null;
74
- /** ID of the user for which the workflow is being executed */
75
- uid: string;
76
- /** whether or not this instance of the workflow has been completed */
77
- workflowCompleted: boolean;
78
- /**
79
- * Used as the naive implementation of notification schedules inside Flows.
80
- * "Resets" notifications schedule after pause or failed verification.
81
- * Defaults to "NOW".
82
- */
83
- nextNotificationAfter?: string;
84
- };
85
- export type WorkflowProgressDto = BaseDto & WorkflowProgressUpsertDto;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=workflow.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.dto.js","sourceRoot":"","sources":["../../../src/dto/workflow.dto.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { BaseDto } from './base.dto';
2
- export type WorkflowAssignmentUpsertDto = {
3
- /** ID of the workflow */
4
- wfid: string;
5
- /** ID of the user to which the workflow is being assigned */
6
- uid: string;
7
- };
8
- export type WorkflowAssignmentDto = BaseDto & WorkflowAssignmentUpsertDto;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=workflowAssignment.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflowAssignment.dto.js","sourceRoot":"","sources":["../../../src/dto/workflowAssignment.dto.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export enum ContentStrategyKind {
2
- LLM = 'LLM',
3
- RAW = 'RAW',
4
- TEMPLATE = 'TEMPLATE',
5
- }
@@ -1,4 +0,0 @@
1
- export enum DeliveryStrategyKind {
2
- EMAIL = 'EMAIL',
3
- MESSAGING = 'MESSAGING',
4
- }
@@ -1,6 +0,0 @@
1
- export enum NotificationStatus {
2
- INVALID = 'INVALID',
3
- PENDING = 'PENDING',
4
- READ = 'READ',
5
- SENT = 'SENT',
6
- }
@@ -1,16 +0,0 @@
1
- export enum SupportedMessageChannelKind {
2
- SLACK = 'SLACK',
3
- UNSUPPORTED = 'UNSUPPORTED',
4
- }
5
-
6
- export const getSupportedMessageChannelKindFrom = (description: string | undefined): SupportedMessageChannelKind => {
7
- if (description) {
8
- for (const kind in SupportedMessageChannelKind) {
9
- if (description.toUpperCase().includes(kind)) {
10
- return SupportedMessageChannelKind[kind as keyof typeof SupportedMessageChannelKind] as SupportedMessageChannelKind;
11
- }
12
- }
13
- }
14
-
15
- return SupportedMessageChannelKind.UNSUPPORTED;
16
- };
@@ -1,4 +0,0 @@
1
- export enum WorkflowStepKind {
2
- NOTIFICATION = 'NOTIFICATION',
3
- PAUSE = 'PAUSE',
4
- }
@@ -1,5 +0,0 @@
1
- export enum WorkflowTriggerKind {
2
- FINDING = 'FINDING',
3
- USER = 'USER',
4
- SAAS_COMPONENT = 'SAAS_COMPONENT',
5
- }
@@ -1,10 +0,0 @@
1
- import {WorkflowDto, WorkflowProgressDto, WorkflowProgressUpsertDto, WorkflowUpsertDto} from '../workflow.dto';
2
- import {TenantBased} from './tenant.based.dto';
3
-
4
- export type PlatformWorkflowUpsertDto = WorkflowUpsertDto & TenantBased;
5
-
6
- export type PlatformWorkflowDto = WorkflowDto & TenantBased;
7
-
8
- export type PlatformWorkflowProgressUpsertDto = WorkflowProgressUpsertDto & TenantBased;
9
-
10
- export type PlatformWorkflowProgressDto = WorkflowProgressDto & TenantBased;
@@ -1,6 +0,0 @@
1
- import {WorkflowAssignmentUpsertDto} from '../workflowAssignment.dto';
2
- import {TenantBased} from './tenant.based.dto';
3
-
4
- export type PlatformWorkflowAssignmentUpsertDto = WorkflowAssignmentUpsertDto & TenantBased;
5
-
6
- export type PlatformWorkflowAssignmentDto = PlatformWorkflowAssignmentUpsertDto & TenantBased;
@@ -1,104 +0,0 @@
1
- import {BaseDto} from './base.dto';
2
- import {ContentStrategyKind, DeliveryStrategyKind} from './enums';
3
- import {FindingOutcome} from './enums/finding.outcome';
4
- import {WorkflowStepKind} from './enums/workflowStep.kind';
5
- import {WorkflowTriggerKind} from './enums/workflowTrigger.kind';
6
-
7
- export type WorflowStepDescriptor = {
8
- /** Type of the notification step, either NOTIFICATION or PAUSE */
9
- kind: WorkflowStepKind;
10
- /** Optional default values to be used of no other is provided */
11
- defaults?: {
12
- [propName: string]: string | number | boolean | FindingOutcome;
13
- };
14
- };
15
-
16
- export type NotificationStepDescriptor = WorflowStepDescriptor & {
17
- /** Delivery strategy to be used for the notification */
18
- deliveryStrategyKinds: DeliveryStrategyKind[];
19
- };
20
-
21
- export type PauseStepDescriptor = WorflowStepDescriptor & {
22
- /** Duration, in days, to wait before executing the next step in the workflow */
23
- pauseDuration: number;
24
- };
25
-
26
- export type ContentDescriptor = {
27
- /** Kind of the content that will be generated for the notification */
28
- kind: ContentStrategyKind;
29
- };
30
-
31
- export type TemplateContentDescriptor = ContentDescriptor & {
32
- /** ID of the template to be used for the notification */
33
- templateId: string;
34
- };
35
-
36
- export type WorkflowStep = {
37
- /** Indicates the type of workflow step and contains relevant information for each */
38
- stepDescriptor: NotificationStepDescriptor | PauseStepDescriptor;
39
- /** Content to be used for the notification */
40
- contentDescriptor?: ContentDescriptor | TemplateContentDescriptor;
41
- /** Step number to transition the workflow to on success */
42
- successStepNumber: number | null;
43
- /** Step number to transition the workflow to on failure */
44
- failureStepNumber: number | null;
45
- };
46
-
47
- export type WorkflowSteps = {
48
- [propName: number]: WorkflowStep;
49
- };
50
-
51
- export type WorkflowTriggerRule = {
52
- [propName: string]:
53
- | string
54
- | number
55
- | boolean
56
- | null
57
- | {
58
- [propName: string]: string | number | boolean | WorkflowTriggerRule;
59
- }
60
- | WorkflowTriggerRule[];
61
- };
62
-
63
- export type WorkflowTrigger = {
64
- /** Kind of the trigger */
65
- kind: WorkflowTriggerKind;
66
- /** Rule to which the applicable entity type must conform to trigger the workflow */
67
- rule: unknown;
68
- /** Number of days a finding has to exist in addition to matching the above rule */
69
- sla?: number;
70
- };
71
-
72
- export type WorkflowUpsertDto = {
73
- /** Name of the workflow */
74
- name: string;
75
- /** Description of the workflow */
76
- description?: string;
77
- /** Trigger that begins execution of the workflow */
78
- trigger: WorkflowTrigger;
79
- /** Steps in the workflow */
80
- steps: WorkflowSteps;
81
- };
82
-
83
- export type WorkflowDto = BaseDto & WorkflowUpsertDto;
84
-
85
- export type WorkflowProgressUpsertDto = {
86
- /** ID of the workflow */
87
- wfid: string;
88
- /** ID of the finding for which the workflow is being executed */
89
- fid?: string | null;
90
- /** Step number to transition the workflow to next */
91
- nextStep: number | null;
92
- /** ID of the user for which the workflow is being executed */
93
- uid: string;
94
- /** whether or not this instance of the workflow has been completed */
95
- workflowCompleted: boolean;
96
- /**
97
- * Used as the naive implementation of notification schedules inside Flows.
98
- * "Resets" notifications schedule after pause or failed verification.
99
- * Defaults to "NOW".
100
- */
101
- nextNotificationAfter?: string;
102
- };
103
-
104
- export type WorkflowProgressDto = BaseDto & WorkflowProgressUpsertDto;
@@ -1,10 +0,0 @@
1
- import {BaseDto} from './base.dto';
2
-
3
- export type WorkflowAssignmentUpsertDto = {
4
- /** ID of the workflow */
5
- wfid: string;
6
- /** ID of the user to which the workflow is being assigned */
7
- uid: string;
8
- };
9
-
10
- export type WorkflowAssignmentDto = BaseDto & WorkflowAssignmentUpsertDto;