@oneuptime/common 14.0.95 → 14.0.96

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 (45) hide show
  1. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
  2. package/Models/DatabaseModels/DetectionRuleException.d.mts +25 -0
  3. package/Models/DatabaseModels/DetectionRuleException.d.ts +25 -0
  4. package/Models/DatabaseModels/DetectionRuleException.js +412 -0
  5. package/Models/DatabaseModels/DetectionRuleException.mjs +2 -0
  6. package/Models/DatabaseModels/Index.js +2 -0
  7. package/Types/Database/TableColumn.d.mts +8 -0
  8. package/Types/Database/TableColumn.d.ts +8 -0
  9. package/Types/Database/TableColumn.js +69 -23
  10. package/Types/Database/TableColumn.mjs +1 -0
  11. package/Types/JSONFunctions.js +16 -1
  12. package/Types/Monitor/MonitorType.js +5 -4
  13. package/Types/Monitor/TelemetryAlertRule.d.mts +111 -0
  14. package/Types/Monitor/TelemetryAlertRule.d.ts +111 -0
  15. package/Types/Monitor/TelemetryAlertRule.js +886 -0
  16. package/Types/Monitor/TelemetryAlertRule.mjs +5 -0
  17. package/Types/Monitor/TelemetryRulePreview.d.mts +57 -0
  18. package/Types/Monitor/TelemetryRulePreview.d.ts +57 -0
  19. package/Types/Monitor/TelemetryRulePreview.js +190 -0
  20. package/Types/Monitor/TelemetryRulePreview.mjs +6 -0
  21. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +23 -0
  22. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +23 -0
  23. package/Types/OnCallDutyPolicy/EveryNewEventRules.js +105 -0
  24. package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +9 -0
  25. package/Types/ProviderLogo/ProviderLogo.d.mts +17 -1
  26. package/Types/ProviderLogo/ProviderLogo.d.ts +17 -1
  27. package/Types/ProviderLogo/ProviderLogo.js +33 -0
  28. package/Types/SecurityEvent/DetectionRetrohunt.d.mts +38 -0
  29. package/Types/SecurityEvent/DetectionRetrohunt.d.ts +38 -0
  30. package/Types/SecurityEvent/DetectionRetrohunt.js +147 -0
  31. package/Types/SecurityEvent/DetectionRetrohunt.mjs +10 -0
  32. package/Types/SecurityEvent/DetectionRuleException.d.mts +65 -0
  33. package/Types/SecurityEvent/DetectionRuleException.d.ts +65 -0
  34. package/Types/SecurityEvent/DetectionRuleException.js +441 -0
  35. package/Types/SecurityEvent/DetectionRuleException.mjs +24 -0
  36. package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
  37. package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
  38. package/Types/Telemetry/OpenTelemetryGuides.js +419 -0
  39. package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
  40. package/Utils/Schema/OpenApiMetadataRegistry.d.mts +4 -0
  41. package/Utils/Schema/OpenApiMetadataRegistry.d.ts +4 -0
  42. package/Utils/Schema/OpenApiMetadataRegistry.js +20 -0
  43. package/Utils/Schema/OpenApiMetadataRegistry.mjs +2 -0
  44. package/Utils/Schema/Zod.js +6 -0
  45. package/package.json +1 -1
@@ -90,16 +90,13 @@ class DatabaseBaseModel extends typeorm_1.BaseEntity {
90
90
  this.id = id;
91
91
  }
92
92
  }
93
+ /*
94
+ * The column lists below are made once per class (getTableColumnNames)
95
+ * and copied here, as each call used to build a fresh one.
96
+ */
93
97
  getHashedColumns() {
94
- var _a;
95
- const dictionary = (0, TableColumn_1.getTableColumns)(this);
96
- const columns = [];
97
- for (const key in dictionary) {
98
- if ((_a = dictionary[key]) === null || _a === void 0 ? void 0 : _a.hashed) {
99
- columns.push(key);
100
- }
101
- }
102
- return new Columns_1.default(columns);
98
+ const names = (0, TableColumn_1.getTableColumnNames)(this);
99
+ return new Columns_1.default([...names.hashed]);
103
100
  }
104
101
  getDisplayColumnPlaceholderAs(columnName) {
105
102
  var _a;
@@ -114,18 +111,12 @@ class DatabaseBaseModel extends typeorm_1.BaseEntity {
114
111
  return ((_a = (0, TableColumn_1.getTableColumn)(this, columnName)) === null || _a === void 0 ? void 0 : _a.description) || null;
115
112
  }
116
113
  getEncryptedColumns() {
117
- var _a;
118
- const dictionary = (0, TableColumn_1.getTableColumns)(this);
119
- const columns = [];
120
- for (const key in dictionary) {
121
- if ((_a = dictionary[key]) === null || _a === void 0 ? void 0 : _a.encrypted) {
122
- columns.push(key);
123
- }
124
- }
125
- return new Columns_1.default(columns);
114
+ const names = (0, TableColumn_1.getTableColumnNames)(this);
115
+ return new Columns_1.default([...names.encrypted]);
126
116
  }
127
117
  getTableColumns() {
128
- return new Columns_1.default(Object.keys((0, TableColumn_1.getTableColumns)(this)));
118
+ const names = (0, TableColumn_1.getTableColumnNames)(this);
119
+ return new Columns_1.default([...names.all]);
129
120
  }
130
121
  getFirstColorColumn() {
131
122
  return (0, ColorField_1.getFirstColorFieldColumn)(this);
@@ -185,15 +176,8 @@ class DatabaseBaseModel extends typeorm_1.BaseEntity {
185
176
  : null;
186
177
  }
187
178
  getUniqueColumns() {
188
- var _a;
189
- const dictionary = (0, TableColumn_1.getTableColumns)(this);
190
- const columns = [];
191
- for (const key in dictionary) {
192
- if ((_a = dictionary[key]) === null || _a === void 0 ? void 0 : _a.unique) {
193
- columns.push(key);
194
- }
195
- }
196
- return new Columns_1.default(columns);
179
+ const names = (0, TableColumn_1.getTableColumnNames)(this);
180
+ return new Columns_1.default([...names.unique]);
197
181
  }
198
182
  setSlugifyColumn(columnName) {
199
183
  this.slugifyColumn = columnName;
@@ -219,15 +203,8 @@ class DatabaseBaseModel extends typeorm_1.BaseEntity {
219
203
  return this.listOrder || null;
220
204
  }
221
205
  getRequiredColumns() {
222
- var _a;
223
- const dictionary = (0, TableColumn_1.getTableColumns)(this);
224
- const columns = [];
225
- for (const key in dictionary) {
226
- if ((_a = dictionary[key]) === null || _a === void 0 ? void 0 : _a.required) {
227
- columns.push(key);
228
- }
229
- }
230
- return new Columns_1.default(columns);
206
+ const names = (0, TableColumn_1.getTableColumnNames)(this);
207
+ return new Columns_1.default([...names.required]);
231
208
  }
232
209
  getSlugifyColumn() {
233
210
  return this.slugifyColumn;
@@ -0,0 +1,25 @@
1
+ import DetectionRule from "./DetectionRule.mjs";
2
+ import Project from "./Project.mjs";
3
+ import User from "./User.mjs";
4
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel.mjs";
5
+ import ObjectID from "../../Types/ObjectID.mjs";
6
+ import { SecurityEntityType } from "../../Types/SecurityCase/SecurityEntity.mjs";
7
+ import { DetectionRuleExceptionKind } from "../../Types/SecurityEvent/DetectionRuleException.mjs";
8
+ export default class DetectionRuleException extends BaseModel {
9
+ project?: Project;
10
+ projectId?: ObjectID;
11
+ detectionRule?: DetectionRule;
12
+ detectionRuleId?: ObjectID;
13
+ kind?: DetectionRuleExceptionKind;
14
+ entityType?: SecurityEntityType;
15
+ fieldName?: string;
16
+ value?: string;
17
+ startsAt?: Date;
18
+ endsAt?: Date;
19
+ reason?: string;
20
+ expiresAt?: Date;
21
+ createdByUser?: User;
22
+ createdByUserId?: ObjectID;
23
+ deletedByUser?: User;
24
+ deletedByUserId?: ObjectID;
25
+ }
@@ -0,0 +1,25 @@
1
+ import DetectionRule from "./DetectionRule";
2
+ import Project from "./Project";
3
+ import User from "./User";
4
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
5
+ import ObjectID from "../../Types/ObjectID";
6
+ import { SecurityEntityType } from "../../Types/SecurityCase/SecurityEntity";
7
+ import { DetectionRuleExceptionKind } from "../../Types/SecurityEvent/DetectionRuleException";
8
+ export default class DetectionRuleException extends BaseModel {
9
+ project?: Project;
10
+ projectId?: ObjectID;
11
+ detectionRule?: DetectionRule;
12
+ detectionRuleId?: ObjectID;
13
+ kind?: DetectionRuleExceptionKind;
14
+ entityType?: SecurityEntityType;
15
+ fieldName?: string;
16
+ value?: string;
17
+ startsAt?: Date;
18
+ endsAt?: Date;
19
+ reason?: string;
20
+ expiresAt?: Date;
21
+ createdByUser?: User;
22
+ createdByUserId?: ObjectID;
23
+ deletedByUser?: User;
24
+ deletedByUserId?: ObjectID;
25
+ }
@@ -0,0 +1,412 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const DetectionRule_1 = __importDefault(require("./DetectionRule"));
16
+ const Project_1 = __importDefault(require("./Project"));
17
+ const User_1 = __importDefault(require("./User"));
18
+ const DatabaseBaseModel_1 = __importDefault(require("./DatabaseBaseModel/DatabaseBaseModel"));
19
+ const Route_1 = __importDefault(require("../../Types/API/Route"));
20
+ const ColumnAccessControl_1 = __importDefault(require("../../Types/Database/AccessControl/ColumnAccessControl"));
21
+ const TableAccessControl_1 = __importDefault(require("../../Types/Database/AccessControl/TableAccessControl"));
22
+ const TableBillingAccessControl_1 = __importDefault(require("../../Types/Database/AccessControl/TableBillingAccessControl"));
23
+ const ColumnLength_1 = __importDefault(require("../../Types/Database/ColumnLength"));
24
+ const ColumnType_1 = __importDefault(require("../../Types/Database/ColumnType"));
25
+ const CrudApiEndpoint_1 = __importDefault(require("../../Types/Database/CrudApiEndpoint"));
26
+ const EnableAuditLog_1 = __importDefault(require("../../Types/Database/EnableAuditLog"));
27
+ const EnableDocumentation_1 = __importDefault(require("../../Types/Database/EnableDocumentation"));
28
+ const TableColumn_1 = __importDefault(require("../../Types/Database/TableColumn"));
29
+ const TableColumnType_1 = __importDefault(require("../../Types/Database/TableColumnType"));
30
+ const TableMetadata_1 = __importDefault(require("../../Types/Database/TableMetadata"));
31
+ const TenantColumn_1 = __importDefault(require("../../Types/Database/TenantColumn"));
32
+ const IconProp_1 = __importDefault(require("../../Types/Icon/IconProp"));
33
+ const ObjectID_1 = __importDefault(require("../../Types/ObjectID"));
34
+ const Permission_1 = __importDefault(require("../../Types/Permission"));
35
+ const SubscriptionPlan_1 = require("../../Types/Billing/SubscriptionPlan");
36
+ const SecurityEntity_1 = require("../../Types/SecurityCase/SecurityEntity");
37
+ const DetectionRuleException_1 = require("../../Types/SecurityEvent/DetectionRuleException");
38
+ const typeorm_1 = require("typeorm");
39
+ /*
40
+ * Something a detection rule skips: an entity, a value or a time window,
41
+ * with why it is safe to skip and, for an entity or a value, when the rule
42
+ * sees it again (Types/SecurityEvent/DetectionRuleException has the
43
+ * matching rules).
44
+ *
45
+ * An exception changes what a rule sees, so it is kept like the rule
46
+ * itself: whoever may edit detection rules adds, changes and removes
47
+ * exceptions, and every Security tier reads them - an exception is a blind
48
+ * spot, and the team must be able to see each one, who added it and why.
49
+ * Every change is audited.
50
+ */
51
+ const readPermissions = [
52
+ Permission_1.default.ProjectOwner,
53
+ Permission_1.default.ProjectAdmin,
54
+ Permission_1.default.SecurityAdmin,
55
+ Permission_1.default.SecurityMember,
56
+ Permission_1.default.SecurityViewer,
57
+ Permission_1.default.ReadProjectDetectionRule,
58
+ ];
59
+ const writePermissions = [
60
+ Permission_1.default.ProjectOwner,
61
+ Permission_1.default.ProjectAdmin,
62
+ Permission_1.default.SecurityAdmin,
63
+ Permission_1.default.SecurityMember,
64
+ Permission_1.default.EditProjectDetectionRule,
65
+ ];
66
+ const editableColumnAccess = {
67
+ create: writePermissions,
68
+ read: readPermissions,
69
+ update: writePermissions,
70
+ };
71
+ let DetectionRuleException = class DetectionRuleException extends DatabaseBaseModel_1.default {
72
+ constructor() {
73
+ super(...arguments);
74
+ this.project = undefined;
75
+ this.projectId = undefined;
76
+ this.detectionRule = undefined;
77
+ this.detectionRuleId = undefined;
78
+ this.kind = undefined;
79
+ this.entityType = undefined;
80
+ this.fieldName = undefined;
81
+ this.value = undefined;
82
+ this.startsAt = undefined;
83
+ this.endsAt = undefined;
84
+ this.reason = undefined;
85
+ this.expiresAt = undefined;
86
+ this.createdByUser = undefined;
87
+ this.createdByUserId = undefined;
88
+ this.deletedByUser = undefined;
89
+ this.deletedByUserId = undefined;
90
+ }
91
+ };
92
+ __decorate([
93
+ (0, ColumnAccessControl_1.default)({
94
+ create: writePermissions,
95
+ read: readPermissions,
96
+ update: [],
97
+ }),
98
+ (0, TableColumn_1.default)({
99
+ manyToOneRelationColumn: "projectId",
100
+ type: TableColumnType_1.default.Entity,
101
+ modelType: Project_1.default,
102
+ title: "Project",
103
+ description: "Relation to the project this exception belongs to.",
104
+ }),
105
+ (0, typeorm_1.ManyToOne)(() => {
106
+ return Project_1.default;
107
+ }, {
108
+ eager: false,
109
+ nullable: true,
110
+ onDelete: "CASCADE",
111
+ orphanedRowAction: "nullify",
112
+ }),
113
+ (0, typeorm_1.JoinColumn)({ name: "projectId" }),
114
+ __metadata("design:type", Project_1.default)
115
+ ], DetectionRuleException.prototype, "project", void 0);
116
+ __decorate([
117
+ (0, ColumnAccessControl_1.default)({
118
+ create: writePermissions,
119
+ read: readPermissions,
120
+ update: [],
121
+ }),
122
+ (0, typeorm_1.Index)(),
123
+ (0, TableColumn_1.default)({
124
+ type: TableColumnType_1.default.ObjectID,
125
+ required: true,
126
+ canReadOnRelationQuery: true,
127
+ title: "Project ID",
128
+ description: "ID of the project this exception belongs to.",
129
+ }),
130
+ (0, typeorm_1.Column)({
131
+ type: ColumnType_1.default.ObjectID,
132
+ nullable: false,
133
+ transformer: ObjectID_1.default.getDatabaseTransformer(),
134
+ }),
135
+ __metadata("design:type", ObjectID_1.default)
136
+ ], DetectionRuleException.prototype, "projectId", void 0);
137
+ __decorate([
138
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
139
+ (0, TableColumn_1.default)({
140
+ manyToOneRelationColumn: "detectionRuleId",
141
+ type: TableColumnType_1.default.Entity,
142
+ modelType: DetectionRule_1.default,
143
+ title: "Detection Rule",
144
+ description: "The detection rule that skips what this exception names.",
145
+ }),
146
+ (0, typeorm_1.ManyToOne)(() => {
147
+ return DetectionRule_1.default;
148
+ }, {
149
+ eager: false,
150
+ nullable: true,
151
+ onDelete: "CASCADE",
152
+ orphanedRowAction: "nullify",
153
+ }),
154
+ (0, typeorm_1.JoinColumn)({ name: "detectionRuleId" }),
155
+ __metadata("design:type", DetectionRule_1.default)
156
+ ], DetectionRuleException.prototype, "detectionRule", void 0);
157
+ __decorate([
158
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
159
+ (0, typeorm_1.Index)(),
160
+ (0, TableColumn_1.default)({
161
+ type: TableColumnType_1.default.ObjectID,
162
+ required: true,
163
+ canReadOnRelationQuery: true,
164
+ title: "Detection Rule ID",
165
+ description: "ID of the detection rule that skips what this names.",
166
+ }),
167
+ (0, typeorm_1.Column)({
168
+ type: ColumnType_1.default.ObjectID,
169
+ nullable: false,
170
+ transformer: ObjectID_1.default.getDatabaseTransformer(),
171
+ }),
172
+ __metadata("design:type", ObjectID_1.default)
173
+ ], DetectionRuleException.prototype, "detectionRuleId", void 0);
174
+ __decorate([
175
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
176
+ (0, TableColumn_1.default)({
177
+ required: true,
178
+ type: TableColumnType_1.default.ShortText,
179
+ canReadOnRelationQuery: true,
180
+ title: "Kind",
181
+ description: "What the rule skips: Entity (a user, host or IP address), Value (one event field's value) or Time Window (every event between two times).",
182
+ }),
183
+ (0, typeorm_1.Column)({
184
+ nullable: false,
185
+ type: ColumnType_1.default.ShortText,
186
+ length: ColumnLength_1.default.ShortText,
187
+ }),
188
+ __metadata("design:type", String)
189
+ ], DetectionRuleException.prototype, "kind", void 0);
190
+ __decorate([
191
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
192
+ (0, TableColumn_1.default)({
193
+ required: false,
194
+ type: TableColumnType_1.default.ShortText,
195
+ canReadOnRelationQuery: true,
196
+ title: "Entity Type",
197
+ description: "For an Entity: User, Host or IP Address. The rule skips every event that names it, as who acted, as who was acted on, or among its observables.",
198
+ }),
199
+ (0, typeorm_1.Column)({
200
+ nullable: true,
201
+ type: ColumnType_1.default.ShortText,
202
+ length: ColumnLength_1.default.ShortText,
203
+ }),
204
+ __metadata("design:type", String)
205
+ ], DetectionRuleException.prototype, "entityType", void 0);
206
+ __decorate([
207
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
208
+ (0, TableColumn_1.default)({
209
+ required: false,
210
+ type: TableColumnType_1.default.ShortText,
211
+ canReadOnRelationQuery: true,
212
+ title: "Field",
213
+ description: "For a Value: the event field to match, named as in a Sigma rule - principalUser, processName, an attribute key such as http.user_agent.",
214
+ }),
215
+ (0, typeorm_1.Column)({
216
+ nullable: true,
217
+ type: ColumnType_1.default.ShortText,
218
+ length: ColumnLength_1.default.ShortText,
219
+ }),
220
+ __metadata("design:type", String)
221
+ ], DetectionRuleException.prototype, "fieldName", void 0);
222
+ __decorate([
223
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
224
+ (0, TableColumn_1.default)({
225
+ required: false,
226
+ type: TableColumnType_1.default.LongText,
227
+ canReadOnRelationQuery: true,
228
+ title: "Value",
229
+ description: "For an Entity or a Value: what the rule skips, matched whatever the case. * stands for any run of characters (svc-* skips every service account), and an IP address may be a range such as 10.20.0.0/16.",
230
+ }),
231
+ (0, typeorm_1.Column)({
232
+ nullable: true,
233
+ type: ColumnType_1.default.LongText,
234
+ length: ColumnLength_1.default.LongText,
235
+ }),
236
+ __metadata("design:type", String)
237
+ ], DetectionRuleException.prototype, "value", void 0);
238
+ __decorate([
239
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
240
+ (0, TableColumn_1.default)({
241
+ required: false,
242
+ type: TableColumnType_1.default.Date,
243
+ canReadOnRelationQuery: true,
244
+ title: "Starts At",
245
+ description: "For a Time Window: the first moment the rule skips.",
246
+ }),
247
+ (0, typeorm_1.Column)({
248
+ nullable: true,
249
+ type: ColumnType_1.default.Date,
250
+ }),
251
+ __metadata("design:type", Date)
252
+ ], DetectionRuleException.prototype, "startsAt", void 0);
253
+ __decorate([
254
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
255
+ (0, TableColumn_1.default)({
256
+ required: false,
257
+ type: TableColumnType_1.default.Date,
258
+ canReadOnRelationQuery: true,
259
+ title: "Ends At",
260
+ description: "For a Time Window: when the rule sees events again. A window is at most 30 days.",
261
+ }),
262
+ (0, typeorm_1.Column)({
263
+ nullable: true,
264
+ type: ColumnType_1.default.Date,
265
+ }),
266
+ __metadata("design:type", Date)
267
+ ], DetectionRuleException.prototype, "endsAt", void 0);
268
+ __decorate([
269
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
270
+ (0, TableColumn_1.default)({
271
+ required: true,
272
+ type: TableColumnType_1.default.LongText,
273
+ canReadOnRelationQuery: true,
274
+ title: "Reason",
275
+ description: "Why it is safe for the rule to skip this, for whoever reads the list later.",
276
+ }),
277
+ (0, typeorm_1.Column)({
278
+ nullable: false,
279
+ type: ColumnType_1.default.LongText,
280
+ length: ColumnLength_1.default.LongText,
281
+ }),
282
+ __metadata("design:type", String)
283
+ ], DetectionRuleException.prototype, "reason", void 0);
284
+ __decorate([
285
+ (0, ColumnAccessControl_1.default)(editableColumnAccess),
286
+ (0, TableColumn_1.default)({
287
+ required: false,
288
+ type: TableColumnType_1.default.Date,
289
+ canReadOnRelationQuery: true,
290
+ title: "Expires At",
291
+ description: "For an Entity or a Value: when the rule sees it again. Empty: until someone deletes the exception.",
292
+ }),
293
+ (0, typeorm_1.Column)({
294
+ nullable: true,
295
+ type: ColumnType_1.default.Date,
296
+ }),
297
+ __metadata("design:type", Date)
298
+ ], DetectionRuleException.prototype, "expiresAt", void 0);
299
+ __decorate([
300
+ (0, ColumnAccessControl_1.default)({
301
+ create: writePermissions,
302
+ read: readPermissions,
303
+ update: [],
304
+ }),
305
+ (0, TableColumn_1.default)({
306
+ manyToOneRelationColumn: "createdByUserId",
307
+ type: TableColumnType_1.default.Entity,
308
+ modelType: User_1.default,
309
+ title: "Created By User",
310
+ description: "The person who added the exception.",
311
+ }),
312
+ (0, typeorm_1.ManyToOne)(() => {
313
+ return User_1.default;
314
+ }, {
315
+ eager: false,
316
+ nullable: true,
317
+ onDelete: "SET NULL",
318
+ orphanedRowAction: "nullify",
319
+ }),
320
+ (0, typeorm_1.JoinColumn)({ name: "createdByUserId" }),
321
+ __metadata("design:type", User_1.default)
322
+ ], DetectionRuleException.prototype, "createdByUser", void 0);
323
+ __decorate([
324
+ (0, ColumnAccessControl_1.default)({
325
+ create: writePermissions,
326
+ read: readPermissions,
327
+ update: [],
328
+ }),
329
+ (0, TableColumn_1.default)({
330
+ type: TableColumnType_1.default.ObjectID,
331
+ title: "Created By User ID",
332
+ description: "ID of the person who added the exception.",
333
+ }),
334
+ (0, typeorm_1.Column)({
335
+ type: ColumnType_1.default.ObjectID,
336
+ nullable: true,
337
+ transformer: ObjectID_1.default.getDatabaseTransformer(),
338
+ }),
339
+ __metadata("design:type", ObjectID_1.default)
340
+ ], DetectionRuleException.prototype, "createdByUserId", void 0);
341
+ __decorate([
342
+ (0, ColumnAccessControl_1.default)({
343
+ create: [],
344
+ read: readPermissions,
345
+ update: [],
346
+ }),
347
+ (0, TableColumn_1.default)({
348
+ manyToOneRelationColumn: "deletedByUserId",
349
+ type: TableColumnType_1.default.Entity,
350
+ modelType: User_1.default,
351
+ title: "Deleted By User",
352
+ description: "The person who removed the exception.",
353
+ }),
354
+ (0, typeorm_1.ManyToOne)(() => {
355
+ return User_1.default;
356
+ }, {
357
+ eager: false,
358
+ nullable: true,
359
+ onDelete: "SET NULL",
360
+ orphanedRowAction: "nullify",
361
+ }),
362
+ (0, typeorm_1.JoinColumn)({ name: "deletedByUserId" }),
363
+ __metadata("design:type", User_1.default)
364
+ ], DetectionRuleException.prototype, "deletedByUser", void 0);
365
+ __decorate([
366
+ (0, ColumnAccessControl_1.default)({
367
+ create: [],
368
+ read: readPermissions,
369
+ update: [],
370
+ }),
371
+ (0, TableColumn_1.default)({
372
+ type: TableColumnType_1.default.ObjectID,
373
+ title: "Deleted By User ID",
374
+ description: "ID of the person who removed the exception.",
375
+ }),
376
+ (0, typeorm_1.Column)({
377
+ type: ColumnType_1.default.ObjectID,
378
+ nullable: true,
379
+ transformer: ObjectID_1.default.getDatabaseTransformer(),
380
+ }),
381
+ __metadata("design:type", ObjectID_1.default)
382
+ ], DetectionRuleException.prototype, "deletedByUserId", void 0);
383
+ DetectionRuleException = __decorate([
384
+ (0, EnableDocumentation_1.default)(),
385
+ (0, EnableAuditLog_1.default)(),
386
+ (0, TableBillingAccessControl_1.default)({
387
+ create: SubscriptionPlan_1.PlanType.Free,
388
+ read: SubscriptionPlan_1.PlanType.Free,
389
+ update: SubscriptionPlan_1.PlanType.Free,
390
+ delete: SubscriptionPlan_1.PlanType.Free,
391
+ }),
392
+ (0, TenantColumn_1.default)("projectId"),
393
+ (0, TableAccessControl_1.default)({
394
+ create: writePermissions,
395
+ read: readPermissions,
396
+ delete: writePermissions,
397
+ update: writePermissions,
398
+ }),
399
+ (0, CrudApiEndpoint_1.default)(new Route_1.default("/detection-rule-exception")),
400
+ (0, typeorm_1.Entity)({
401
+ name: "DetectionRuleException",
402
+ }),
403
+ (0, TableMetadata_1.default)({
404
+ tableName: "DetectionRuleException",
405
+ singularName: "Rule Exception",
406
+ pluralName: "Rule Exceptions",
407
+ icon: IconProp_1.default.EyeSlash,
408
+ tableDescription: "What a detection rule skips: an entity, a value or a time window, with who added it, why, and when it expires.",
409
+ }),
410
+ (0, typeorm_1.Index)(["projectId", "detectionRuleId"])
411
+ ], DetectionRuleException);
412
+ exports.default = DetectionRuleException;
@@ -0,0 +1,2 @@
1
+ import commonJsModule from "./DetectionRuleException.js";
2
+ export default commonJsModule.default;
@@ -164,6 +164,7 @@ const LogPipeline_1 = __importDefault(require("./LogPipeline"));
164
164
  const LogPipelineProcessor_1 = __importDefault(require("./LogPipelineProcessor"));
165
165
  const LogDropFilter_1 = __importDefault(require("./LogDropFilter"));
166
166
  const DetectionRule_1 = __importDefault(require("./DetectionRule"));
167
+ const DetectionRuleException_1 = __importDefault(require("./DetectionRuleException"));
167
168
  const SecurityEventConnection_1 = __importDefault(require("./SecurityEventConnection"));
168
169
  const SecurityEventConnectionRun_1 = __importDefault(require("./SecurityEventConnectionRun"));
169
170
  const ToolImportRun_1 = __importDefault(require("./ToolImportRun"));
@@ -578,6 +579,7 @@ const AllModelTypes = [
578
579
  LogPipelineProcessor_1.default,
579
580
  LogDropFilter_1.default,
580
581
  DetectionRule_1.default,
582
+ DetectionRuleException_1.default,
581
583
  SecurityEventConnection_1.default,
582
584
  SecurityEventConnectionRun_1.default,
583
585
  ToolImportRun_1.default,
@@ -36,3 +36,11 @@ type GetTableColumnFunction = <T extends BaseModel>(target: T, propertyKey: stri
36
36
  export declare const getTableColumn: GetTableColumnFunction;
37
37
  type GetTableColumnsFunction = <T extends BaseModel>(target: T) => Dictionary<TableColumnMetadata>;
38
38
  export declare const getTableColumns: GetTableColumnsFunction;
39
+ export interface TableColumnNames {
40
+ all: ReadonlyArray<string>;
41
+ encrypted: ReadonlyArray<string>;
42
+ hashed: ReadonlyArray<string>;
43
+ unique: ReadonlyArray<string>;
44
+ required: ReadonlyArray<string>;
45
+ }
46
+ export declare const getTableColumnNames: <T extends BaseModel>(target: T) => TableColumnNames;
@@ -36,3 +36,11 @@ type GetTableColumnFunction = <T extends BaseModel>(target: T, propertyKey: stri
36
36
  export declare const getTableColumn: GetTableColumnFunction;
37
37
  type GetTableColumnsFunction = <T extends BaseModel>(target: T) => Dictionary<TableColumnMetadata>;
38
38
  export declare const getTableColumns: GetTableColumnsFunction;
39
+ export interface TableColumnNames {
40
+ all: ReadonlyArray<string>;
41
+ encrypted: ReadonlyArray<string>;
42
+ hashed: ReadonlyArray<string>;
43
+ unique: ReadonlyArray<string>;
44
+ required: ReadonlyArray<string>;
45
+ }
46
+ export declare const getTableColumnNames: <T extends BaseModel>(target: T) => TableColumnNames;