@oneuptime/common 10.5.8 → 10.5.9

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.
@@ -9,6 +9,7 @@ import User from "./User";
9
9
  import OnCallDutyPolicy from "./OnCallDutyPolicy";
10
10
  import OnCallDutyPolicyEscalationRule from "./OnCallDutyPolicyEscalationRule";
11
11
  import OnCallDutyPolicySchedule from "./OnCallDutyPolicySchedule";
12
+ import UserOnCallLogTimeline from "./UserOnCallLogTimeline";
12
13
  import Team from "./Team";
13
14
  import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
14
15
  import Route from "../../Types/API/Route";
@@ -258,6 +259,54 @@ export default class SmsLog extends BaseModel {
258
259
  })
259
260
  public status?: SmsStatus = undefined;
260
261
 
262
+ @ColumnAccessControl({
263
+ create: [],
264
+ read: [
265
+ Permission.ProjectOwner,
266
+ Permission.ProjectAdmin,
267
+ Permission.ProjectMember,
268
+ Permission.Viewer,
269
+ Permission.ReadSmsLog,
270
+ ],
271
+ update: [],
272
+ })
273
+ @TableColumn({
274
+ required: false,
275
+ type: TableColumnType.ShortText,
276
+ title: "Provider Error Code",
277
+ description:
278
+ "Error code returned by the SMS provider (e.g. Twilio error code 30007 for carrier filtering) when the message could not be delivered.",
279
+ canReadOnRelationQuery: false,
280
+ example: "30007",
281
+ })
282
+ @Column({
283
+ nullable: true,
284
+ type: ColumnType.ShortText,
285
+ length: ColumnLength.ShortText,
286
+ })
287
+ public errorCode?: string = undefined;
288
+
289
+ @ColumnAccessControl({
290
+ create: [],
291
+ read: [],
292
+ update: [],
293
+ })
294
+ @TableColumn({
295
+ required: false,
296
+ type: TableColumnType.ShortText,
297
+ title: "Status Callback Token",
298
+ description:
299
+ "Secret token embedded in the provider delivery-status callback URL. Used to authenticate incoming delivery-status callbacks. Never exposed via the API.",
300
+ canReadOnRelationQuery: false,
301
+ hideColumnInDocumentation: true,
302
+ })
303
+ @Column({
304
+ nullable: true,
305
+ type: ColumnType.ShortText,
306
+ length: ColumnLength.ShortText,
307
+ })
308
+ public statusCallbackToken?: string = undefined;
309
+
261
310
  @ColumnAccessControl({
262
311
  create: [],
263
312
  read: [
@@ -895,6 +944,68 @@ export default class SmsLog extends BaseModel {
895
944
  })
896
945
  public onCallDutyPolicyScheduleId?: ObjectID = undefined;
897
946
 
947
+ @ColumnAccessControl({
948
+ create: [],
949
+ read: [
950
+ Permission.ProjectOwner,
951
+ Permission.ProjectAdmin,
952
+ Permission.ProjectMember,
953
+ Permission.Viewer,
954
+ Permission.ReadSmsLog,
955
+ ],
956
+ update: [],
957
+ })
958
+ @TableColumn({
959
+ manyToOneRelationColumn: "userOnCallLogTimelineId",
960
+ type: TableColumnType.Entity,
961
+ modelType: UserOnCallLogTimeline,
962
+ title: "User On-Call Log Timeline",
963
+ description:
964
+ "On-call notification timeline entry this SMS was sent for (if any). Lets the delivery outcome be reflected back onto the on-call log.",
965
+ example: "f1a2b3c4-d5e6-47f8-9a0b-1c2d3e4f5a6b",
966
+ })
967
+ @ManyToOne(
968
+ () => {
969
+ return UserOnCallLogTimeline;
970
+ },
971
+ {
972
+ eager: false,
973
+ nullable: true,
974
+ onDelete: "CASCADE",
975
+ orphanedRowAction: "nullify",
976
+ },
977
+ )
978
+ @JoinColumn({ name: "userOnCallLogTimelineId" })
979
+ public userOnCallLogTimeline?: UserOnCallLogTimeline = undefined;
980
+
981
+ @ColumnAccessControl({
982
+ create: [],
983
+ read: [
984
+ Permission.ProjectOwner,
985
+ Permission.ProjectAdmin,
986
+ Permission.ProjectMember,
987
+ Permission.Viewer,
988
+ Permission.ReadSmsLog,
989
+ ],
990
+ update: [],
991
+ })
992
+ @Index()
993
+ @TableColumn({
994
+ type: TableColumnType.ObjectID,
995
+ required: false,
996
+ canReadOnRelationQuery: true,
997
+ title: "User On-Call Log Timeline ID",
998
+ description:
999
+ "ID of the on-call notification timeline entry this SMS was sent for (if any).",
1000
+ example: "f1a2b3c4-d5e6-47f8-9a0b-1c2d3e4f5a6b",
1001
+ })
1002
+ @Column({
1003
+ type: ColumnType.ObjectID,
1004
+ nullable: true,
1005
+ transformer: ObjectID.getDatabaseTransformer(),
1006
+ })
1007
+ public userOnCallLogTimelineId?: ObjectID = undefined;
1008
+
898
1009
  @ColumnAccessControl({
899
1010
  create: [],
900
1011
  read: [