mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-01-16 23:00:51 +00:00
- Replaced all instances of TelemetryService with Service in components, pages, and utilities. - Updated related imports and state management to reflect the new Service model. - Removed the TelemetryServices view and associated routes, as it is no longer needed. - Adjusted breadcrumb and route mappings to remove references to Telemetry Services. - Ensured that all relevant functionality, such as logs and metrics, now utilize the Service model.
1001 lines
25 KiB
TypeScript
1001 lines
25 KiB
TypeScript
import Project from "./Project";
|
|
import User from "./User";
|
|
import Team from "./Team";
|
|
import Route from "../../Types/API/Route";
|
|
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
import ColumnType from "../../Types/Database/ColumnType";
|
|
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
import TableColumn from "../../Types/Database/TableColumn";
|
|
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
import IconProp from "../../Types/Icon/IconProp";
|
|
import ObjectID from "../../Types/ObjectID";
|
|
import Permission from "../../Types/Permission";
|
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
import DatabaseBaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
import Service from "./Service";
|
|
|
|
@EnableDocumentation()
|
|
@TenantColumn("projectId")
|
|
@TableAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
delete: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.DeleteTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@CrudApiEndpoint(new Route("/telemetry-exception"))
|
|
@TableMetadata({
|
|
tableName: "TelemetryException",
|
|
singularName: "Exception",
|
|
pluralName: "Exceptions",
|
|
icon: IconProp.Error,
|
|
tableDescription:
|
|
"List of all Telemetry Exceptions created for the telemetry service for this OneUptime project and it's status.",
|
|
})
|
|
@Entity({
|
|
name: "TelemetryException",
|
|
})
|
|
export default class TelemetryException extends DatabaseBaseModel {
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "projectId",
|
|
type: TableColumnType.Entity,
|
|
modelType: Project,
|
|
title: "Project",
|
|
description: "Relation to Project Resource in which this object belongs",
|
|
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return Project;
|
|
},
|
|
{
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "CASCADE",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "projectId" })
|
|
public project?: Project = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [],
|
|
})
|
|
@Index()
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
required: true,
|
|
canReadOnRelationQuery: true,
|
|
title: "Project ID",
|
|
description: "ID of your OneUptime Project in which this object belongs",
|
|
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: false,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public projectId?: ObjectID = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "serviceId",
|
|
type: TableColumnType.Entity,
|
|
modelType: Service,
|
|
title: "Service",
|
|
description: "Relation to Service Resource in which this object belongs",
|
|
example: "d4e5f6a7-b8c9-0123-def1-234567890123",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return Service;
|
|
},
|
|
{
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "CASCADE",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "serviceId" })
|
|
public service?: Service = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@Index()
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
required: true,
|
|
title: "Service ID",
|
|
description: "ID of your Service resource where this object belongs",
|
|
example: "d4e5f6a7-b8c9-0123-def1-234567890123",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: false,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public serviceId?: ObjectID = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.VeryLongText,
|
|
canReadOnRelationQuery: false,
|
|
title: "Exception Message",
|
|
description: "Exception message that was thrown by the telemetry service",
|
|
example: "NullPointerException: Cannot read property 'id' of null",
|
|
})
|
|
@Column({
|
|
nullable: true,
|
|
type: ColumnType.VeryLongText,
|
|
})
|
|
public message?: string = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.VeryLongText,
|
|
canReadOnRelationQuery: false,
|
|
title: "Stack Trace",
|
|
description:
|
|
"Stack trace of the exception that was thrown by the telemetry service",
|
|
example:
|
|
"at getUserData (/app/src/services/user.js:42:15)\nat processRequest (/app/src/controllers/user.js:89:20)",
|
|
})
|
|
@Column({
|
|
nullable: true,
|
|
type: ColumnType.VeryLongText,
|
|
})
|
|
public stackTrace?: string = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.VeryLongText,
|
|
canReadOnRelationQuery: false,
|
|
title: "Exception Type",
|
|
description:
|
|
"Type of the exception that was thrown by the telemetry service",
|
|
example: "NullPointerException",
|
|
})
|
|
@Column({
|
|
nullable: true,
|
|
type: ColumnType.VeryLongText,
|
|
})
|
|
public exceptionType?: string = undefined;
|
|
|
|
@Index()
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.ShortText,
|
|
canReadOnRelationQuery: false,
|
|
title: "Finger Print",
|
|
description:
|
|
"Finger print of the exception that was thrown by the telemetry service",
|
|
example: "a8b7c6d5e4f3g2h1",
|
|
})
|
|
@Column({
|
|
nullable: true,
|
|
type: ColumnType.ShortText,
|
|
length: ColumnLength.ShortText,
|
|
})
|
|
public fingerprint?: string = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "createdByUserId",
|
|
type: TableColumnType.Entity,
|
|
modelType: User,
|
|
title: "Created by User",
|
|
description:
|
|
"Relation to User who created this object (if this object was created by a User)",
|
|
example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return User;
|
|
},
|
|
{
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "SET NULL",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "createdByUserId" })
|
|
public createdByUser?: User = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [],
|
|
})
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
title: "Created by User ID",
|
|
description:
|
|
"User ID who created this object (if this object was created by a User)",
|
|
example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: true,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public createdByUserId?: ObjectID = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "deletedByUserId",
|
|
type: TableColumnType.Entity,
|
|
title: "Deleted by User",
|
|
modelType: User,
|
|
description:
|
|
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
example: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return User;
|
|
},
|
|
{
|
|
cascade: false,
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "SET NULL",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "deletedByUserId" })
|
|
public deletedByUser?: User = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
title: "Deleted by User ID",
|
|
description:
|
|
"User ID who deleted this object (if this object was deleted by a User)",
|
|
example: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: true,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public deletedByUserId?: ObjectID = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.Date,
|
|
title: "Accepted Invitation At",
|
|
description: "When did this team member accept invitation",
|
|
example: "2025-12-12T14:30:00.000Z",
|
|
})
|
|
@Column({
|
|
type: ColumnType.Date,
|
|
nullable: true,
|
|
unique: false,
|
|
})
|
|
public markedAsResolvedAt?: Date = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.Date,
|
|
title: "Accepted Invitation At",
|
|
description: "When did this team member accept invitation",
|
|
example: "2025-12-12T15:45:00.000Z",
|
|
})
|
|
@Column({
|
|
type: ColumnType.Date,
|
|
nullable: true,
|
|
unique: false,
|
|
})
|
|
public markedAsArchivedAt?: Date = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.Date,
|
|
title: "Accepted Invitation At",
|
|
description: "When did this team member accept invitation",
|
|
example: "2025-12-10T08:15:00.000Z",
|
|
})
|
|
@Column({
|
|
type: ColumnType.Date,
|
|
nullable: true,
|
|
unique: false,
|
|
})
|
|
public firstSeenAt?: Date = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
required: false,
|
|
type: TableColumnType.Date,
|
|
title: "Accepted Invitation At",
|
|
description: "When did this team member accept invitation",
|
|
example: "2025-12-12T16:20:00.000Z",
|
|
})
|
|
@Column({
|
|
type: ColumnType.Date,
|
|
nullable: true,
|
|
unique: false,
|
|
})
|
|
public lastSeenAt?: Date = undefined;
|
|
|
|
// assign to.
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "assignToUserId",
|
|
type: TableColumnType.Entity,
|
|
modelType: User,
|
|
title: "Assign to User",
|
|
description: "Relation to User who this exception is assigned to.",
|
|
example: "e5f6a7b8-c9d0-1234-efgh-234567890124",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return User;
|
|
},
|
|
{
|
|
cascade: false,
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "CASCADE",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "assignToUserId" })
|
|
public assignToUser?: User = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
title: "Assign to User ID",
|
|
description: "User ID who this exception is assigned to.",
|
|
example: "e5f6a7b8-c9d0-1234-efgh-234567890124",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: true,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public assignToUserId?: ObjectID = undefined;
|
|
|
|
// assign to team.
|
|
|
|
// assign to.
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "assignToTeamId",
|
|
type: TableColumnType.Entity,
|
|
modelType: Team,
|
|
title: "Assign to Team",
|
|
description: "Relation to Team who this exception is assigned to.",
|
|
example: "f6a7b8c9-d0e1-2345-fghi-345678901235",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return Team;
|
|
},
|
|
{
|
|
cascade: false,
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "CASCADE",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "assignToTeamId" })
|
|
public assignToTeam?: Team = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
title: "Assign to Team ID",
|
|
description: "Team ID who this exception is assigned to.",
|
|
example: "f6a7b8c9-d0e1-2345-fghi-345678901235",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: true,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public assignToTeamId?: ObjectID = undefined;
|
|
|
|
// mark as resolved by.
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "markedAsResolvedByUserId",
|
|
type: TableColumnType.Entity,
|
|
modelType: User,
|
|
title: "Marked as Resolved By User",
|
|
description:
|
|
"Mark as resolved by User who marked this exception as resolved.",
|
|
example: "a7b8c9d0-e1f2-3456-ghij-456789012346",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return User;
|
|
},
|
|
{
|
|
cascade: false,
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "CASCADE",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "markedAsResolvedByUserId" })
|
|
public markedAsResolvedByUser?: User = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
title: "Marked as Resolved By User ID",
|
|
description: "User ID who marked this exception as resolved.",
|
|
example: "a7b8c9d0-e1f2-3456-ghij-456789012346",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: true,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public markedAsResolvedByUserId?: ObjectID = undefined;
|
|
|
|
// Mark as archived by.
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
manyToOneRelationColumn: "markedAsArchivedByUserId",
|
|
type: TableColumnType.Entity,
|
|
modelType: User,
|
|
title: "Mark as Archived By User",
|
|
description: "Mark as archived by User",
|
|
example: "b8c9d0e1-f2a3-4567-hijk-567890123457",
|
|
})
|
|
@ManyToOne(
|
|
() => {
|
|
return User;
|
|
},
|
|
{
|
|
cascade: false,
|
|
eager: false,
|
|
nullable: true,
|
|
onDelete: "CASCADE",
|
|
orphanedRowAction: "nullify",
|
|
},
|
|
)
|
|
@JoinColumn({ name: "markedAsArchivedByUserId" })
|
|
public markedAsArchivedByUser?: User = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
type: TableColumnType.ObjectID,
|
|
title: "Mark as Archived By User ID",
|
|
description: "User ID who marked this exception as archived.",
|
|
example: "b8c9d0e1-f2a3-4567-hijk-567890123457",
|
|
})
|
|
@Column({
|
|
type: ColumnType.ObjectID,
|
|
nullable: true,
|
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
})
|
|
public markedAsArchivedByUserId?: ObjectID = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
title: "Is Resolved",
|
|
description: "Is this exception resolved?",
|
|
isDefaultValueColumn: true,
|
|
required: true,
|
|
type: TableColumnType.Boolean,
|
|
defaultValue: false,
|
|
example: false,
|
|
})
|
|
@Column({
|
|
type: ColumnType.Boolean,
|
|
nullable: false,
|
|
unique: false,
|
|
default: false,
|
|
})
|
|
public isResolved?: boolean = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
title: "Is Archived",
|
|
description: "Is this exception archived?",
|
|
isDefaultValueColumn: true,
|
|
required: true,
|
|
type: TableColumnType.Boolean,
|
|
defaultValue: false,
|
|
example: false,
|
|
})
|
|
@Column({
|
|
type: ColumnType.Boolean,
|
|
nullable: false,
|
|
unique: false,
|
|
default: false,
|
|
})
|
|
public isArchived?: boolean = undefined;
|
|
|
|
@ColumnAccessControl({
|
|
create: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.CreateTelemetryException,
|
|
],
|
|
read: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.ProjectMember,
|
|
Permission.ReadTelemetryException,
|
|
],
|
|
update: [
|
|
Permission.ProjectOwner,
|
|
Permission.ProjectAdmin,
|
|
Permission.EditTelemetryException,
|
|
],
|
|
})
|
|
@TableColumn({
|
|
title: "Occurances",
|
|
description: "Number of times this exception has occurred",
|
|
isDefaultValueColumn: true,
|
|
required: true,
|
|
type: TableColumnType.Number,
|
|
defaultValue: 1,
|
|
example: 42,
|
|
})
|
|
@Column({
|
|
type: ColumnType.Number,
|
|
nullable: false,
|
|
unique: false,
|
|
default: 1,
|
|
})
|
|
public occuranceCount?: number = undefined;
|
|
}
|