@oneuptime/common 14.0.104 → 14.0.105

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 (88) hide show
  1. package/Models/DatabaseModels/CloudAccount.d.mts +1 -0
  2. package/Models/DatabaseModels/CloudAccount.d.ts +1 -0
  3. package/Models/DatabaseModels/CloudAccount.js +21 -0
  4. package/Models/DatabaseModels/CloudBudget.d.mts +1 -0
  5. package/Models/DatabaseModels/CloudBudget.d.ts +1 -0
  6. package/Models/DatabaseModels/CloudBudget.js +38 -3
  7. package/Models/DatabaseModels/CloudCostRecommendation.d.mts +2 -0
  8. package/Models/DatabaseModels/CloudCostRecommendation.d.ts +2 -0
  9. package/Models/DatabaseModels/CloudCostRecommendation.js +30 -2
  10. package/Models/DatabaseModels/DetectionRule.js +8 -7
  11. package/Types/AI/ResourceAiAccessApi.d.mts +1 -0
  12. package/Types/AI/ResourceAiAccessApi.d.ts +1 -0
  13. package/Types/AI/ResourceAiAccessApi.js +6 -1
  14. package/Types/AI/ResourceAiAccessApi.mjs +1 -0
  15. package/Types/AI/ResourceAiAccessPermissions.d.mts +2 -0
  16. package/Types/AI/ResourceAiAccessPermissions.d.ts +2 -0
  17. package/Types/AI/ResourceAiAccessPermissions.js +13 -0
  18. package/Types/AI/ResourceAiAccessPermissions.mjs +2 -0
  19. package/Types/Cloud/CloudCost.d.mts +8 -0
  20. package/Types/Cloud/CloudCost.d.ts +8 -0
  21. package/Types/Cloud/CloudCost.js +37 -0
  22. package/Types/Cloud/CloudCost.mjs +1 -0
  23. package/Types/Cloud/CloudCostAnomaly.d.mts +34 -0
  24. package/Types/Cloud/CloudCostAnomaly.d.ts +34 -0
  25. package/Types/Cloud/CloudCostAnomaly.js +236 -0
  26. package/Types/Cloud/CloudCostAnomaly.mjs +18 -0
  27. package/Types/Cloud/CloudLogGroups.d.mts +6 -1
  28. package/Types/Cloud/CloudLogGroups.d.ts +6 -1
  29. package/Types/Cloud/CloudLogGroups.js +59 -3
  30. package/Types/Cloud/CloudLogGroups.mjs +1 -0
  31. package/Types/Cloud/CloudPlatform.js +9 -8
  32. package/Types/Cloud/CloudRightSizing.d.mts +140 -0
  33. package/Types/Cloud/CloudRightSizing.d.ts +140 -0
  34. package/Types/Cloud/CloudRightSizing.js +867 -0
  35. package/Types/Cloud/CloudRightSizing.mjs +53 -0
  36. package/Types/CloudConnection/CloudAiAgentKey.d.mts +65 -0
  37. package/Types/CloudConnection/CloudAiAgentKey.d.ts +65 -0
  38. package/Types/CloudConnection/CloudAiAgentKey.js +289 -0
  39. package/Types/CloudConnection/CloudAiAgentKey.mjs +18 -0
  40. package/Types/CloudConnection/CloudAiAgentSetupCommands.d.mts +5 -2
  41. package/Types/CloudConnection/CloudAiAgentSetupCommands.d.ts +5 -2
  42. package/Types/CloudConnection/CloudAiAgentSetupCommands.js +114 -43
  43. package/Types/CloudConnection/CloudAiAgentSetupCommands.mjs +4 -1
  44. package/Types/CloudConnection/CloudStream.d.mts +4 -0
  45. package/Types/CloudConnection/CloudStream.d.ts +4 -0
  46. package/Types/CloudConnection/CloudStream.js +18 -1
  47. package/Types/CloudConnection/CloudStream.mjs +4 -0
  48. package/Types/CloudConnection/CloudStreamTemplate.d.mts +2 -0
  49. package/Types/CloudConnection/CloudStreamTemplate.d.ts +2 -0
  50. package/Types/CloudConnection/CloudStreamTemplate.js +89 -6
  51. package/Types/CloudConnection/CloudStreamTemplate.mjs +2 -0
  52. package/Types/InstallScripts/InstallScripts.js +1 -1
  53. package/Types/ResourceAiAgent/CloudAiAgentNames.d.mts +6 -0
  54. package/Types/ResourceAiAgent/CloudAiAgentNames.d.ts +6 -0
  55. package/Types/ResourceAiAgent/CloudAiAgentNames.js +11 -1
  56. package/Types/ResourceAiAgent/CloudAiAgentNames.mjs +3 -0
  57. package/Types/ResourceAiAgent/ResourceAiAccess.d.mts +3 -1
  58. package/Types/ResourceAiAgent/ResourceAiAccess.d.ts +3 -1
  59. package/Types/ResourceAiAgent/ResourceAiAccess.js +13 -2
  60. package/Types/ResourceAiAgent/ResourceAiAccess.mjs +2 -0
  61. package/Types/SecurityCase/SecurityCaseContext.d.mts +2 -1
  62. package/Types/SecurityCase/SecurityCaseContext.d.ts +2 -1
  63. package/Types/SecurityCase/SecurityConnection.d.mts +2 -1
  64. package/Types/SecurityCase/SecurityConnection.d.ts +2 -1
  65. package/Types/SecurityEvent/RealTimeDetection.d.mts +14 -5
  66. package/Types/SecurityEvent/RealTimeDetection.d.ts +14 -5
  67. package/Types/SecurityEvent/RealTimeDetection.js +75 -25
  68. package/Types/SecurityEvent/RealTimeDetection.mjs +3 -3
  69. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +4 -2
  70. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +4 -2
  71. package/Types/SecurityPlaybook/SecurityPlaybookAction.js +22 -3
  72. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +7 -2
  73. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +7 -2
  74. package/Types/SecurityPlaybook/SecurityPlaybookStep.js +96 -39
  75. package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +2 -0
  76. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.mts +17 -2
  77. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.ts +17 -2
  78. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.js +174 -33
  79. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.mjs +7 -0
  80. package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +5 -0
  81. package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +5 -0
  82. package/Utils/SecurityCase/SecurityCaseMarkdown.js +10 -0
  83. package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +1 -0
  84. package/Utils/Telemetry/CloudChangeTitle.d.mts +37 -0
  85. package/Utils/Telemetry/CloudChangeTitle.d.ts +37 -0
  86. package/Utils/Telemetry/CloudChangeTitle.js +315 -3
  87. package/Utils/Telemetry/CloudChangeTitle.mjs +13 -0
  88. package/package.json +1 -1
@@ -3,9 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SecurityPlaybookStepOutcome = void 0;
6
+ exports.SECURITY_PLAYBOOK_MAX_CONDITIONS_PER_STEP = exports.SecurityPlaybookConditionMatch = exports.SecurityPlaybookStepOutcome = void 0;
7
7
  exports.getSecurityPlaybookFinds = getSecurityPlaybookFinds;
8
8
  exports.isSecurityPlaybookStepOutcome = isSecurityPlaybookStepOutcome;
9
+ exports.isSecurityPlaybookConditionMatch = isSecurityPlaybookConditionMatch;
10
+ exports.isSecurityPlaybookStepConditionGroup = isSecurityPlaybookStepConditionGroup;
11
+ exports.getSecurityPlaybookStepConditions = getSecurityPlaybookStepConditions;
12
+ exports.getSecurityPlaybookConditionMatch = getSecurityPlaybookConditionMatch;
13
+ exports.buildSecurityPlaybookStepRunIf = buildSecurityPlaybookStepRunIf;
9
14
  exports.getSecurityPlaybookStepOutcomes = getSecurityPlaybookStepOutcomes;
10
15
  exports.describeSecurityPlaybookStepOutcome = describeSecurityPlaybookStepOutcome;
11
16
  exports.readSecurityPlaybookStepCondition = readSecurityPlaybookStepCondition;
@@ -15,10 +20,10 @@ const BadDataException_1 = __importDefault(require("../Exception/BadDataExceptio
15
20
  const SecurityPlaybookAction_1 = require("./SecurityPlaybookAction");
16
21
  const SecurityPlaybookRunStatus_1 = require("./SecurityPlaybookRunStatus");
17
22
  /*
18
- * BRANCHING: a step that runs only after an earlier step's result.
23
+ * BRANCHING: a step that runs only after earlier steps' results.
19
24
  *
20
- * A playbook stays a list read top to bottom; a step may wait on one
21
- * earlier step of the same playbook (`runIf`) and run only when that step:
25
+ * A playbook stays a list read top to bottom; a step may wait on earlier
26
+ * steps of the same playbook (`runIf`) and run only when one of them:
22
27
  *
23
28
  * - succeeded, or failed (a step that fails stops the run unless it
24
29
  * carries on, so "failed" can be waited on only for one that does);
@@ -26,15 +31,21 @@ const SecurityPlaybookRunStatus_1 = require("./SecurityPlaybookRunStatus");
26
31
  * something, or found nothing - "contain only what threat intel knows
27
32
  * is bad", and its else: "if it found nothing, leave a task to check".
28
33
  *
34
+ * A step may wait on one result, or on several - all of them, or any one
35
+ * (SecurityPlaybookStepConditionGroup): "contain only when threat intel
36
+ * knows the user AND the sign-in was confirmed", "page on-call when either
37
+ * lookup found something". One result is stored as it always was, so a
38
+ * playbook saved before groups came reads, and saves, unchanged.
39
+ *
29
40
  * Two steps waiting on opposite results of one step are an if and an else.
30
- * A step whose condition does not hold is skipped, saying which result it
41
+ * A step whose condition does not hold is skipped, saying which results it
31
42
  * waited on, before it asks for an approval or acts on anything. A step
32
43
  * the one it waits on never reached (it was skipped, or the run ended
33
44
  * first) does not run either: nothing is contained on a result nobody saw.
34
45
  *
35
- * The condition names the earlier step by its id, so moving steps keeps
36
- * what each waits on; a playbook is refused on save when a step waits on
37
- * one that is not before it, on a result that step cannot have, or on the
46
+ * A condition names an earlier step by its id, so moving steps keeps what
47
+ * each waits on; a playbook is refused on save when a step waits on one
48
+ * that is not before it, on a result that step cannot have, or on the
38
49
  * failure of a step that stops the run (assertSecurityPlaybookStepConditions).
39
50
  */
40
51
  var SecurityPlaybookStepOutcome;
@@ -46,6 +57,16 @@ var SecurityPlaybookStepOutcome;
46
57
  // ...or looked, and found nothing.
47
58
  SecurityPlaybookStepOutcome["FoundNothing"] = "Found Nothing";
48
59
  })(SecurityPlaybookStepOutcome || (exports.SecurityPlaybookStepOutcome = SecurityPlaybookStepOutcome = {}));
60
+ // How a step that waits on several results reads them.
61
+ var SecurityPlaybookConditionMatch;
62
+ (function (SecurityPlaybookConditionMatch) {
63
+ // It runs when every one of them happened.
64
+ SecurityPlaybookConditionMatch["All"] = "All";
65
+ // ...or when any one of them did.
66
+ SecurityPlaybookConditionMatch["Any"] = "Any";
67
+ })(SecurityPlaybookConditionMatch || (exports.SecurityPlaybookConditionMatch = SecurityPlaybookConditionMatch = {}));
68
+ // The most results one step waits on.
69
+ exports.SECURITY_PLAYBOOK_MAX_CONDITIONS_PER_STEP = 5;
49
70
  const FINDS_BY_ACTION = {
50
71
  [SecurityPlaybookAction_1.SecurityPlaybookActionType.CheckThreatIntel]: {
51
72
  found: "found a known-bad entity",
@@ -72,13 +93,65 @@ function isSecurityPlaybookStepOutcome(value) {
72
93
  return (typeof value === "string" &&
73
94
  Object.values(SecurityPlaybookStepOutcome).includes(value));
74
95
  }
96
+ function isSecurityPlaybookConditionMatch(value) {
97
+ return (typeof value === "string" &&
98
+ Object.values(SecurityPlaybookConditionMatch).includes(value));
99
+ }
100
+ function isSecurityPlaybookStepConditionGroup(runIf) {
101
+ return Boolean(runIf &&
102
+ Array.isArray(runIf.conditions));
103
+ }
104
+ // The results a step waits on, in the order they were picked: none for a step that always runs.
105
+ function getSecurityPlaybookStepConditions(runIf) {
106
+ if (!runIf) {
107
+ return [];
108
+ }
109
+ return isSecurityPlaybookStepConditionGroup(runIf)
110
+ ? runIf.conditions
111
+ : [runIf];
112
+ }
113
+ // How a step reads the results it waits on: all of them, unless it said any.
114
+ function getSecurityPlaybookConditionMatch(runIf) {
115
+ return isSecurityPlaybookStepConditionGroup(runIf)
116
+ ? runIf.match
117
+ : SecurityPlaybookConditionMatch.All;
118
+ }
119
+ function sameCondition(a, b) {
120
+ return a.stepId === b.stepId && a.outcome === b.outcome;
121
+ }
122
+ /*
123
+ * What a step waits on, from the results picked: none (it always runs),
124
+ * one - stored as a step always stored it - or a group of two or more, the
125
+ * same result never twice.
126
+ */
127
+ function buildSecurityPlaybookStepRunIf(conditions, match = SecurityPlaybookConditionMatch.All) {
128
+ const unique = [];
129
+ for (const condition of conditions) {
130
+ if (!unique.some((kept) => {
131
+ return sameCondition(kept, condition);
132
+ })) {
133
+ unique.push({ stepId: condition.stepId, outcome: condition.outcome });
134
+ }
135
+ }
136
+ if (unique.length === 0) {
137
+ return undefined;
138
+ }
139
+ if (unique.length === 1) {
140
+ return unique[0];
141
+ }
142
+ return { match, conditions: unique };
143
+ }
75
144
  /*
76
145
  * The results a later step can wait on for a step of this action: found or
77
146
  * found nothing for one that looks something up, succeeded otherwise - and
78
147
  * failed for one that carries on when it fails, the only kind a later step
79
- * ever sees fail.
148
+ * ever sees fail. A step that stops the run has none: nothing after it
149
+ * runs.
80
150
  */
81
151
  function getSecurityPlaybookStepOutcomes(step) {
152
+ if (step.action === SecurityPlaybookAction_1.SecurityPlaybookActionType.StopRun) {
153
+ return [];
154
+ }
82
155
  const outcomes = getSecurityPlaybookFinds(step.action)
83
156
  ? [
84
157
  SecurityPlaybookStepOutcome.Found,
@@ -108,13 +181,10 @@ function describeSecurityPlaybookStepOutcome(action, outcome) {
108
181
  }
109
182
  }
110
183
  /*
111
- * A stored or posted condition, read. None (undefined) for a step that runs
112
- * always: no condition, null, or an empty one. One that is there but does
113
- * not read - no step, or a result that is not one - is refused, naming the
114
- * step: dropped instead, the step would run always, and a containment step
115
- * meant to wait on threat intel would contain on its own.
184
+ * One stored condition, read: the earlier step and the result. Refused,
185
+ * naming the step, when it does not read.
116
186
  */
117
- function readSecurityPlaybookStepCondition(value, label) {
187
+ function readOneCondition(value, label) {
118
188
  if (value === undefined || value === null || value === "") {
119
189
  return undefined;
120
190
  }
@@ -136,6 +206,50 @@ function readSecurityPlaybookStepCondition(value, label) {
136
206
  }
137
207
  return { stepId, outcome };
138
208
  }
209
+ /*
210
+ * A stored or posted condition, read: one result, or a group of results
211
+ * with how they are read (all of them, or any). None (undefined) for a step
212
+ * that runs always: no condition, null, an empty one, or a group with
213
+ * nothing in it. One that is there but does not read - no step, a result
214
+ * that is not one, a group that cannot say how it reads - is refused,
215
+ * naming the step: dropped instead, the step would run always, and a
216
+ * containment step meant to wait on threat intel would contain on its own.
217
+ * A group of one is that one result.
218
+ */
219
+ function readSecurityPlaybookStepCondition(value, label) {
220
+ if (value &&
221
+ typeof value === "object" &&
222
+ !Array.isArray(value) &&
223
+ value["conditions"] !== undefined) {
224
+ const record = value;
225
+ const items = record["conditions"];
226
+ if (!Array.isArray(items)) {
227
+ throw new BadDataException_1.default(`${label}: when it runs is not something a playbook can read. Choose again when it runs.`);
228
+ }
229
+ const match = record["match"];
230
+ if (match !== undefined &&
231
+ match !== null &&
232
+ !isSecurityPlaybookConditionMatch(match)) {
233
+ throw new BadDataException_1.default(`${label}: choose whether it runs after all of the results it waits on, or any one of them.`);
234
+ }
235
+ const conditions = [];
236
+ for (const item of items) {
237
+ const condition = readOneCondition(item, label);
238
+ if (condition) {
239
+ conditions.push(condition);
240
+ }
241
+ }
242
+ const runIf = buildSecurityPlaybookStepRunIf(conditions, isSecurityPlaybookConditionMatch(match)
243
+ ? match
244
+ : SecurityPlaybookConditionMatch.All);
245
+ if (getSecurityPlaybookStepConditions(runIf).length >
246
+ exports.SECURITY_PLAYBOOK_MAX_CONDITIONS_PER_STEP) {
247
+ throw new BadDataException_1.default(`${label}: a step waits on at most ${exports.SECURITY_PLAYBOOK_MAX_CONDITIONS_PER_STEP} results of earlier steps.`);
248
+ }
249
+ return runIf;
250
+ }
251
+ return readOneCondition(value, label);
252
+ }
139
253
  /*
140
254
  * Whether an earlier step's result is the one a condition waits on. A step
141
255
  * that never ran to an end - skipped, rejected, still pending - has no
@@ -155,34 +269,61 @@ function doesStepResultMeetOutcome(result, outcome) {
155
269
  return result.status === SecurityPlaybookRunStatus_1.SecurityPlaybookStepStatus.Succeeded;
156
270
  }
157
271
  }
272
+ /*
273
+ * Clauses joined the way a sentence lists them: "a", "a and b", "a, b and
274
+ * c" - or with "or".
275
+ */
276
+ function joinClauses(clauses, word) {
277
+ if (clauses.length <= 1) {
278
+ return clauses.join("");
279
+ }
280
+ return `${clauses.slice(0, -1).join(", ")} ${word} ${clauses[clauses.length - 1]}`;
281
+ }
158
282
  /*
159
283
  * A step's condition, read against the run so far. `steps` and `results`
160
284
  * are the run's, in step order; `index` is the step's own place. Holds when
161
- * the step waits on nothing; otherwise when the step it waits on, before
162
- * it, ended with the result it waits on. `reason` says why it does not, in
163
- * a sentence a run shows under the skipped step.
285
+ * the step waits on nothing; otherwise when the steps it waits on, before
286
+ * it, ended with the results it waits on - every one of them, or any one
287
+ * for a step that said any. `reason` says why it does not, in a sentence a
288
+ * run shows under the skipped step.
164
289
  */
165
290
  function evaluateSecurityPlaybookStepCondition(data) {
166
- const condition = data.condition;
167
- if (!condition) {
291
+ const conditions = getSecurityPlaybookStepConditions(data.condition);
292
+ if (conditions.length === 0) {
168
293
  return { holds: true };
169
294
  }
170
- const waitedOn = data.steps.findIndex((step) => {
171
- return step.id === condition.stepId;
172
- });
173
- if (waitedOn < 0 || waitedOn >= data.index) {
174
- return {
175
- holds: false,
176
- reason: "Skipped: the step it runs after is not before it in this run.",
177
- };
178
- }
179
- const waitedOnStep = data.steps[waitedOn];
180
- const definition = (0, SecurityPlaybookAction_1.getSecurityPlaybookAction)(waitedOnStep.action);
181
- if (doesStepResultMeetOutcome(data.results[waitedOn] || { status: SecurityPlaybookRunStatus_1.SecurityPlaybookStepStatus.Pending }, condition.outcome)) {
295
+ const match = getSecurityPlaybookConditionMatch(data.condition);
296
+ const clauses = [];
297
+ let held = 0;
298
+ for (const condition of conditions) {
299
+ const waitedOn = data.steps.findIndex((step) => {
300
+ return step.id === condition.stepId;
301
+ });
302
+ if (waitedOn < 0 || waitedOn >= data.index) {
303
+ return {
304
+ holds: false,
305
+ reason: conditions.length === 1
306
+ ? "Skipped: the step it runs after is not before it in this run."
307
+ : "Skipped: a step it runs after is not before it in this run.",
308
+ };
309
+ }
310
+ const waitedOnStep = data.steps[waitedOn];
311
+ const definition = (0, SecurityPlaybookAction_1.getSecurityPlaybookAction)(waitedOnStep.action);
312
+ if (doesStepResultMeetOutcome(data.results[waitedOn] || {
313
+ status: SecurityPlaybookRunStatus_1.SecurityPlaybookStepStatus.Pending,
314
+ }, condition.outcome)) {
315
+ held++;
316
+ }
317
+ clauses.push(`step ${waitedOn + 1} (${(definition === null || definition === void 0 ? void 0 : definition.title) || waitedOnStep.action}) ${describeSecurityPlaybookStepOutcome(waitedOnStep.action, condition.outcome)}`);
318
+ }
319
+ const holds = match === SecurityPlaybookConditionMatch.Any
320
+ ? held > 0
321
+ : held === conditions.length;
322
+ if (holds) {
182
323
  return { holds: true };
183
324
  }
184
325
  return {
185
326
  holds: false,
186
- reason: `Skipped: it runs only if step ${waitedOn + 1} (${(definition === null || definition === void 0 ? void 0 : definition.title) || waitedOnStep.action}) ${describeSecurityPlaybookStepOutcome(waitedOnStep.action, condition.outcome)}.`,
327
+ reason: `Skipped: it runs only if ${joinClauses(clauses, match === SecurityPlaybookConditionMatch.Any ? "or" : "and")}.`,
187
328
  };
188
329
  }
@@ -1,9 +1,16 @@
1
1
  import commonJsModule from "./SecurityPlaybookStepCondition.js";
2
+ export const SECURITY_PLAYBOOK_MAX_CONDITIONS_PER_STEP = commonJsModule.SECURITY_PLAYBOOK_MAX_CONDITIONS_PER_STEP;
3
+ export const SecurityPlaybookConditionMatch = commonJsModule.SecurityPlaybookConditionMatch;
2
4
  export const SecurityPlaybookStepOutcome = commonJsModule.SecurityPlaybookStepOutcome;
5
+ export const buildSecurityPlaybookStepRunIf = commonJsModule.buildSecurityPlaybookStepRunIf;
3
6
  export const describeSecurityPlaybookStepOutcome = commonJsModule.describeSecurityPlaybookStepOutcome;
4
7
  export const doesStepResultMeetOutcome = commonJsModule.doesStepResultMeetOutcome;
5
8
  export const evaluateSecurityPlaybookStepCondition = commonJsModule.evaluateSecurityPlaybookStepCondition;
9
+ export const getSecurityPlaybookConditionMatch = commonJsModule.getSecurityPlaybookConditionMatch;
6
10
  export const getSecurityPlaybookFinds = commonJsModule.getSecurityPlaybookFinds;
11
+ export const getSecurityPlaybookStepConditions = commonJsModule.getSecurityPlaybookStepConditions;
7
12
  export const getSecurityPlaybookStepOutcomes = commonJsModule.getSecurityPlaybookStepOutcomes;
13
+ export const isSecurityPlaybookConditionMatch = commonJsModule.isSecurityPlaybookConditionMatch;
14
+ export const isSecurityPlaybookStepConditionGroup = commonJsModule.isSecurityPlaybookStepConditionGroup;
8
15
  export const isSecurityPlaybookStepOutcome = commonJsModule.isSecurityPlaybookStepOutcome;
9
16
  export const readSecurityPlaybookStepCondition = commonJsModule.readSecurityPlaybookStepCondition;
@@ -83,6 +83,11 @@ export declare function playbookFinishedMarkdown(data: {
83
83
  skipped: number;
84
84
  failed: number;
85
85
  }): MarkdownText;
86
+ export declare function playbookStoppedMarkdown(data: {
87
+ playbookName: string;
88
+ stepNumber: number;
89
+ reason?: string | undefined;
90
+ }): MarkdownText;
86
91
  export declare function playbookFailedMarkdown(data: {
87
92
  playbookName: string;
88
93
  stepNumber: number;
@@ -83,6 +83,11 @@ export declare function playbookFinishedMarkdown(data: {
83
83
  skipped: number;
84
84
  failed: number;
85
85
  }): MarkdownText;
86
+ export declare function playbookStoppedMarkdown(data: {
87
+ playbookName: string;
88
+ stepNumber: number;
89
+ reason?: string | undefined;
90
+ }): MarkdownText;
86
91
  export declare function playbookFailedMarkdown(data: {
87
92
  playbookName: string;
88
93
  stepNumber: number;
@@ -48,6 +48,7 @@ exports.renderSecurityCaseTemplate = renderSecurityCaseTemplate;
48
48
  exports.playbookStartedMarkdown = playbookStartedMarkdown;
49
49
  exports.playbookCancelledMarkdown = playbookCancelledMarkdown;
50
50
  exports.playbookFinishedMarkdown = playbookFinishedMarkdown;
51
+ exports.playbookStoppedMarkdown = playbookStoppedMarkdown;
51
52
  exports.playbookFailedMarkdown = playbookFailedMarkdown;
52
53
  exports.playbookStepMarkdown = playbookStepMarkdown;
53
54
  exports.approvalRequestedMarkdown = approvalRequestedMarkdown;
@@ -277,6 +278,15 @@ function playbookFinishedMarkdown(data) {
277
278
  }
278
279
  return (0, FeedMarkdown_1.mdText) `🏁 Playbook **${data.playbookName}** finished: ${FeedMarkdown_1.default.join(parts)}.`;
279
280
  }
281
+ /*
282
+ * A run a Stop step ended, as done: where, and why in the playbook's own
283
+ * words when it says.
284
+ */
285
+ function playbookStoppedMarkdown(data) {
286
+ return data.reason
287
+ ? (0, FeedMarkdown_1.mdText) `🏁 Playbook **${data.playbookName}** stopped at step ${String(data.stepNumber)}: ${data.reason}`
288
+ : (0, FeedMarkdown_1.mdText) `🏁 Playbook **${data.playbookName}** stopped at step ${String(data.stepNumber)}, as it says to.`;
289
+ }
280
290
  function playbookFailedMarkdown(data) {
281
291
  return (0, FeedMarkdown_1.mdText) `❌ Playbook **${data.playbookName}** stopped: step ${String(data.stepNumber)} (${data.stepTitle}) failed.`;
282
292
  }
@@ -25,6 +25,7 @@ export const playbookFinishedMarkdown = commonJsModule.playbookFinishedMarkdown;
25
25
  export const playbookInterruptedMarkdown = commonJsModule.playbookInterruptedMarkdown;
26
26
  export const playbookStartedMarkdown = commonJsModule.playbookStartedMarkdown;
27
27
  export const playbookStepMarkdown = commonJsModule.playbookStepMarkdown;
28
+ export const playbookStoppedMarkdown = commonJsModule.playbookStoppedMarkdown;
28
29
  export const priorityChangedMarkdown = commonJsModule.priorityChangedMarkdown;
29
30
  export const renderSecurityCaseTemplate = commonJsModule.renderSecurityCaseTemplate;
30
31
  export const securityCaseSummaryMarkdown = commonJsModule.securityCaseSummaryMarkdown;
@@ -1,4 +1,5 @@
1
1
  import Dictionary from "../../Types/Dictionary.mjs";
2
+ import { ReadingDirection } from "../../Types/ReadingDirection.mjs";
2
3
  import { SentenceOptions, Translator } from "../../Types/Translator.mjs";
3
4
  export interface CloudChangeTitleFacts {
4
5
  operation: string;
@@ -21,10 +22,46 @@ export declare function readCloudChangeTitleFacts(change: {
21
22
  attributes?: Dictionary<unknown> | null | undefined;
22
23
  }): CloudChangeTitleFacts | null;
23
24
  export declare function readCloudChangeTitleFactsJson(value: unknown): CloudChangeTitleFacts | null;
25
+ export declare enum CloudHealthSource {
26
+ Aws = "aws",
27
+ AzureService = "azure-service",
28
+ AzureResource = "azure-resource",
29
+ GoogleCloud = "gcp"
30
+ }
31
+ export interface CloudHealthTitleFacts {
32
+ source: CloudHealthSource;
33
+ event: string;
34
+ status: string;
35
+ awsEventTypeCode?: string | undefined;
36
+ }
37
+ export declare function describeAwsHealthEventType(code: string): string;
38
+ export declare function parseAwsHealthEventType(code: string): {
39
+ service: string;
40
+ kind: string;
41
+ } | null;
42
+ export declare const AWS_HEALTH_EVENT_KIND_WORDS: Readonly<Record<string, string>>;
43
+ export declare const CLOUD_HEALTH_UNNAMED_EVENTS: Readonly<Partial<Record<CloudHealthSource, string>>>;
44
+ export declare const CLOUD_HEALTH_TITLE_SENTENCES: Record<CloudHealthSource, string>;
45
+ export declare const CLOUD_HEALTH_STATUS_SENTENCES: Readonly<Partial<Record<CloudHealthSource, Readonly<Record<string, string>>>>>;
46
+ export declare const AZURE_RESOURCE_HEALTH_CHANGE_SENTENCE: string;
47
+ export declare const AZURE_RESOURCE_HEALTH_STATES: Readonly<Record<string, string>>;
48
+ export declare function readCloudHealthTitleFacts(change: {
49
+ title?: string | null | undefined;
50
+ attributes?: Dictionary<unknown> | null | undefined;
51
+ }): CloudHealthTitleFacts | null;
52
+ export declare function getCloudHealthTitle(facts: CloudHealthTitleFacts, translator?: Translator, options?: SentenceOptions | undefined): string;
53
+ export declare function readCloudHealthTitleFactsJson(value: unknown): CloudHealthTitleFacts | null;
24
54
  export declare function getChangeTitleForReader(data: {
25
55
  title?: string | null | undefined;
26
56
  eventType?: string | null | undefined;
27
57
  facts: CloudChangeTitleFacts | null | undefined;
58
+ health?: CloudHealthTitleFacts | null | undefined;
28
59
  translator: Translator;
29
60
  options?: SentenceOptions | undefined;
30
61
  }): string;
62
+ export type ChangeTitleDirection = ReadingDirection | "auto";
63
+ export declare function getChangeTitleDirection(data: {
64
+ facts: CloudChangeTitleFacts | null | undefined;
65
+ health?: CloudHealthTitleFacts | null | undefined;
66
+ translator: Translator;
67
+ }): ChangeTitleDirection;
@@ -1,4 +1,5 @@
1
1
  import Dictionary from "../../Types/Dictionary";
2
+ import { ReadingDirection } from "../../Types/ReadingDirection";
2
3
  import { SentenceOptions, Translator } from "../../Types/Translator";
3
4
  export interface CloudChangeTitleFacts {
4
5
  operation: string;
@@ -21,10 +22,46 @@ export declare function readCloudChangeTitleFacts(change: {
21
22
  attributes?: Dictionary<unknown> | null | undefined;
22
23
  }): CloudChangeTitleFacts | null;
23
24
  export declare function readCloudChangeTitleFactsJson(value: unknown): CloudChangeTitleFacts | null;
25
+ export declare enum CloudHealthSource {
26
+ Aws = "aws",
27
+ AzureService = "azure-service",
28
+ AzureResource = "azure-resource",
29
+ GoogleCloud = "gcp"
30
+ }
31
+ export interface CloudHealthTitleFacts {
32
+ source: CloudHealthSource;
33
+ event: string;
34
+ status: string;
35
+ awsEventTypeCode?: string | undefined;
36
+ }
37
+ export declare function describeAwsHealthEventType(code: string): string;
38
+ export declare function parseAwsHealthEventType(code: string): {
39
+ service: string;
40
+ kind: string;
41
+ } | null;
42
+ export declare const AWS_HEALTH_EVENT_KIND_WORDS: Readonly<Record<string, string>>;
43
+ export declare const CLOUD_HEALTH_UNNAMED_EVENTS: Readonly<Partial<Record<CloudHealthSource, string>>>;
44
+ export declare const CLOUD_HEALTH_TITLE_SENTENCES: Record<CloudHealthSource, string>;
45
+ export declare const CLOUD_HEALTH_STATUS_SENTENCES: Readonly<Partial<Record<CloudHealthSource, Readonly<Record<string, string>>>>>;
46
+ export declare const AZURE_RESOURCE_HEALTH_CHANGE_SENTENCE: string;
47
+ export declare const AZURE_RESOURCE_HEALTH_STATES: Readonly<Record<string, string>>;
48
+ export declare function readCloudHealthTitleFacts(change: {
49
+ title?: string | null | undefined;
50
+ attributes?: Dictionary<unknown> | null | undefined;
51
+ }): CloudHealthTitleFacts | null;
52
+ export declare function getCloudHealthTitle(facts: CloudHealthTitleFacts, translator?: Translator, options?: SentenceOptions | undefined): string;
53
+ export declare function readCloudHealthTitleFactsJson(value: unknown): CloudHealthTitleFacts | null;
24
54
  export declare function getChangeTitleForReader(data: {
25
55
  title?: string | null | undefined;
26
56
  eventType?: string | null | undefined;
27
57
  facts: CloudChangeTitleFacts | null | undefined;
58
+ health?: CloudHealthTitleFacts | null | undefined;
28
59
  translator: Translator;
29
60
  options?: SentenceOptions | undefined;
30
61
  }): string;
62
+ export type ChangeTitleDirection = ReadingDirection | "auto";
63
+ export declare function getChangeTitleDirection(data: {
64
+ facts: CloudChangeTitleFacts | null | undefined;
65
+ health?: CloudHealthTitleFacts | null | undefined;
66
+ translator: Translator;
67
+ }): ChangeTitleDirection;