@uniorganization/uni-lib 4.0.44 → 4.0.45
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.
- package/dist/entities/inbox/agent-extension-backup.entity.d.ts +24 -0
- package/dist/entities/inbox/agent-extension-backup.entity.js +102 -0
- package/dist/entities/inbox/agent-extension.entity.d.ts +2 -0
- package/dist/entities/inbox/agent-extension.entity.js +17 -2
- package/dist/entities/inbox/index.d.ts +1 -0
- package/dist/entities/inbox/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Users } from '../usr.entity';
|
|
2
|
+
import { AgentExtensionEntity } from './agent-extension.entity';
|
|
3
|
+
export declare enum AgentExtensionBackupStatus {
|
|
4
|
+
ACTIVE = "active",
|
|
5
|
+
EXPIRED = "expired",
|
|
6
|
+
CANCELLED = "cancelled"
|
|
7
|
+
}
|
|
8
|
+
export declare class AgentExtensionBackupEntity {
|
|
9
|
+
id: string;
|
|
10
|
+
agentExtension: AgentExtensionEntity;
|
|
11
|
+
agentExtensionId: string;
|
|
12
|
+
backupUser: Users;
|
|
13
|
+
backupUserId: number;
|
|
14
|
+
startDate: string;
|
|
15
|
+
endDate: string;
|
|
16
|
+
status: AgentExtensionBackupStatus;
|
|
17
|
+
createdByUser: Users;
|
|
18
|
+
createdByUserId: number;
|
|
19
|
+
cancelledByUser?: Users | null;
|
|
20
|
+
cancelledByUserId: number | null;
|
|
21
|
+
endedAt: Date | null;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentExtensionBackupEntity = exports.AgentExtensionBackupStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const usr_entity_1 = require("../usr.entity");
|
|
15
|
+
const agent_extension_entity_1 = require("./agent-extension.entity");
|
|
16
|
+
var AgentExtensionBackupStatus;
|
|
17
|
+
(function (AgentExtensionBackupStatus) {
|
|
18
|
+
AgentExtensionBackupStatus["ACTIVE"] = "active";
|
|
19
|
+
AgentExtensionBackupStatus["EXPIRED"] = "expired";
|
|
20
|
+
AgentExtensionBackupStatus["CANCELLED"] = "cancelled";
|
|
21
|
+
})(AgentExtensionBackupStatus || (exports.AgentExtensionBackupStatus = AgentExtensionBackupStatus = {}));
|
|
22
|
+
let AgentExtensionBackupEntity = class AgentExtensionBackupEntity {
|
|
23
|
+
};
|
|
24
|
+
exports.AgentExtensionBackupEntity = AgentExtensionBackupEntity;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: 'bigint' }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AgentExtensionBackupEntity.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => agent_extension_entity_1.AgentExtensionEntity, { onDelete: 'RESTRICT' }),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: 'agent_extension_id' }),
|
|
32
|
+
__metadata("design:type", agent_extension_entity_1.AgentExtensionEntity)
|
|
33
|
+
], AgentExtensionBackupEntity.prototype, "agentExtension", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ name: 'agent_extension_id', type: 'bigint', nullable: false }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], AgentExtensionBackupEntity.prototype, "agentExtensionId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(() => usr_entity_1.Users, { onDelete: 'RESTRICT' }),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: 'backup_user_id' }),
|
|
41
|
+
__metadata("design:type", usr_entity_1.Users)
|
|
42
|
+
], AgentExtensionBackupEntity.prototype, "backupUser", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ name: 'backup_user_id', type: 'numeric', nullable: false }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], AgentExtensionBackupEntity.prototype, "backupUserId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ name: 'start_date', type: 'date', nullable: false }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], AgentExtensionBackupEntity.prototype, "startDate", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'end_date', type: 'date', nullable: false }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], AgentExtensionBackupEntity.prototype, "endDate", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({
|
|
57
|
+
name: 'status',
|
|
58
|
+
type: 'varchar',
|
|
59
|
+
length: 20,
|
|
60
|
+
nullable: false,
|
|
61
|
+
default: AgentExtensionBackupStatus.ACTIVE,
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], AgentExtensionBackupEntity.prototype, "status", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.ManyToOne)(() => usr_entity_1.Users, { onDelete: 'RESTRICT' }),
|
|
67
|
+
(0, typeorm_1.JoinColumn)({ name: 'created_by_user_id' }),
|
|
68
|
+
__metadata("design:type", usr_entity_1.Users)
|
|
69
|
+
], AgentExtensionBackupEntity.prototype, "createdByUser", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ name: 'created_by_user_id', type: 'numeric', nullable: false }),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], AgentExtensionBackupEntity.prototype, "createdByUserId", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.ManyToOne)(() => usr_entity_1.Users, { onDelete: 'RESTRICT', nullable: true }),
|
|
76
|
+
(0, typeorm_1.JoinColumn)({ name: 'cancelled_by_user_id' }),
|
|
77
|
+
__metadata("design:type", usr_entity_1.Users)
|
|
78
|
+
], AgentExtensionBackupEntity.prototype, "cancelledByUser", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ name: 'cancelled_by_user_id', type: 'numeric', nullable: true }),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], AgentExtensionBackupEntity.prototype, "cancelledByUserId", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ name: 'ended_at', type: 'timestamp', nullable: true }),
|
|
85
|
+
__metadata("design:type", Date)
|
|
86
|
+
], AgentExtensionBackupEntity.prototype, "endedAt", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamp' }),
|
|
89
|
+
__metadata("design:type", Date)
|
|
90
|
+
], AgentExtensionBackupEntity.prototype, "createdAt", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamp' }),
|
|
93
|
+
__metadata("design:type", Date)
|
|
94
|
+
], AgentExtensionBackupEntity.prototype, "updatedAt", void 0);
|
|
95
|
+
exports.AgentExtensionBackupEntity = AgentExtensionBackupEntity = __decorate([
|
|
96
|
+
(0, typeorm_1.Entity)('agent_extension_backups', { schema: 'voicemail' }),
|
|
97
|
+
(0, typeorm_1.Index)('ux_agent_extension_backups_active_extension', ['agentExtensionId'], {
|
|
98
|
+
unique: true,
|
|
99
|
+
where: 'status = $$active$$',
|
|
100
|
+
}),
|
|
101
|
+
(0, typeorm_1.Index)('ix_agent_extension_backups_active_end_date', ['status', 'endDate'])
|
|
102
|
+
], AgentExtensionBackupEntity);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Users } from '../usr.entity';
|
|
2
|
+
import { AgentExtensionBackupEntity } from './agent-extension-backup.entity';
|
|
2
3
|
export declare class AgentExtensionEntity {
|
|
3
4
|
id: string;
|
|
4
5
|
extension: string;
|
|
@@ -9,6 +10,7 @@ export declare class AgentExtensionEntity {
|
|
|
9
10
|
isActive: boolean;
|
|
10
11
|
validFrom: Date | null;
|
|
11
12
|
validTo: Date | null;
|
|
13
|
+
backups?: AgentExtensionBackupEntity[];
|
|
12
14
|
createdBy?: Users | null;
|
|
13
15
|
createdByUserId: number | null;
|
|
14
16
|
createdAt: Date;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AgentExtensionEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const usr_entity_1 = require("../usr.entity");
|
|
15
|
+
const agent_extension_backup_entity_1 = require("./agent-extension-backup.entity");
|
|
15
16
|
let AgentExtensionEntity = class AgentExtensionEntity {
|
|
16
17
|
};
|
|
17
18
|
exports.AgentExtensionEntity = AgentExtensionEntity;
|
|
@@ -43,11 +44,21 @@ __decorate([
|
|
|
43
44
|
__metadata("design:type", String)
|
|
44
45
|
], AgentExtensionEntity.prototype, "source", void 0);
|
|
45
46
|
__decorate([
|
|
46
|
-
(0, typeorm_1.Column)({
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
name: 'is_primary',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
nullable: false,
|
|
51
|
+
default: false,
|
|
52
|
+
}),
|
|
47
53
|
__metadata("design:type", Boolean)
|
|
48
54
|
], AgentExtensionEntity.prototype, "isPrimary", void 0);
|
|
49
55
|
__decorate([
|
|
50
|
-
(0, typeorm_1.Column)({
|
|
56
|
+
(0, typeorm_1.Column)({
|
|
57
|
+
name: 'is_active',
|
|
58
|
+
type: 'boolean',
|
|
59
|
+
nullable: false,
|
|
60
|
+
default: true,
|
|
61
|
+
}),
|
|
51
62
|
__metadata("design:type", Boolean)
|
|
52
63
|
], AgentExtensionEntity.prototype, "isActive", void 0);
|
|
53
64
|
__decorate([
|
|
@@ -58,6 +69,10 @@ __decorate([
|
|
|
58
69
|
(0, typeorm_1.Column)({ name: 'valid_to', type: 'timestamp', nullable: true }),
|
|
59
70
|
__metadata("design:type", Date)
|
|
60
71
|
], AgentExtensionEntity.prototype, "validTo", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.OneToMany)(() => agent_extension_backup_entity_1.AgentExtensionBackupEntity, (backup) => backup.agentExtension),
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], AgentExtensionEntity.prototype, "backups", void 0);
|
|
61
76
|
__decorate([
|
|
62
77
|
(0, typeorm_1.ManyToOne)(() => usr_entity_1.Users),
|
|
63
78
|
(0, typeorm_1.JoinColumn)({ name: 'created_by_user_id' }),
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./agent-extension.entity"), exports);
|
|
18
|
+
__exportStar(require("./agent-extension-backup.entity"), exports);
|
|
18
19
|
__exportStar(require("./sla-policy.entity"), exports);
|
|
19
20
|
__exportStar(require("./inbound-message.entity"), exports);
|
|
20
21
|
__exportStar(require("./message-case.entity"), exports);
|