@attraccess/database-entities 1.6.0 → 1.8.0
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/package.json +1 -1
- package/src/lib/entities/attractapCrashReport.entity.d.ts +20 -0
- package/src/lib/entities/attractapCrashReport.entity.js +153 -0
- package/src/lib/entities/attractapCrashReport.entity.js.map +1 -0
- package/src/lib/entities/conversation-participant.entity.d.ts +11 -0
- package/src/lib/entities/conversation-participant.entity.js +61 -0
- package/src/lib/entities/conversation-participant.entity.js.map +1 -0
- package/src/lib/entities/conversation.entity.d.ts +5 -0
- package/src/lib/entities/conversation.entity.js +34 -0
- package/src/lib/entities/conversation.entity.js.map +1 -0
- package/src/lib/entities/email-template.entity.d.ts +8 -1
- package/src/lib/entities/email-template.entity.js +7 -0
- package/src/lib/entities/email-template.entity.js.map +1 -1
- package/src/lib/entities/message.entity.d.ts +19 -0
- package/src/lib/entities/message.entity.js +99 -0
- package/src/lib/entities/message.entity.js.map +1 -0
- package/src/lib/entities/notification-preference.entity.d.ts +9 -0
- package/src/lib/entities/notification-preference.entity.js +58 -0
- package/src/lib/entities/notification-preference.entity.js.map +1 -0
- package/src/lib/entities/push-subscription.entity.d.ts +12 -0
- package/src/lib/entities/push-subscription.entity.js +72 -0
- package/src/lib/entities/push-subscription.entity.js.map +1 -0
- package/src/lib/entities/resource-maintenance-request.entity.d.ts +21 -0
- package/src/lib/entities/resource-maintenance-request.entity.js +113 -0
- package/src/lib/entities/resource-maintenance-request.entity.js.map +1 -0
- package/src/lib/entities/resource.entity.d.ts +9 -0
- package/src/lib/entities/resource.entity.js +88 -0
- package/src/lib/entities/resource.entity.js.map +1 -1
- package/src/lib/entities/resource.supervision.d.ts +20 -0
- package/src/lib/entities/resource.supervision.js +26 -0
- package/src/lib/entities/resource.supervision.js.map +1 -0
- package/src/lib/entities/resourceGroup.entity.d.ts +4 -0
- package/src/lib/entities/resourceGroup.entity.js +38 -0
- package/src/lib/entities/resourceGroup.entity.js.map +1 -1
- package/src/lib/entities/resourceIntroducer.entity.d.ts +5 -0
- package/src/lib/entities/resourceIntroducer.entity.js +20 -1
- package/src/lib/entities/resourceIntroducer.entity.js.map +1 -1
- package/src/lib/entities/resourceIntroduction.entity.d.ts +1 -0
- package/src/lib/entities/resourceIntroduction.entity.js +10 -0
- package/src/lib/entities/resourceIntroduction.entity.js.map +1 -1
- package/src/lib/entities/resourceUsage.entity.d.ts +2 -0
- package/src/lib/entities/resourceUsage.entity.js +20 -0
- package/src/lib/entities/resourceUsage.entity.js.map +1 -1
- package/src/lib/entities-index.d.ts +17 -2
- package/src/lib/entities-index.js +29 -2
- package/src/lib/entities-index.js.map +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Attractap } from './attractap.entity';
|
|
2
|
+
export declare class AttractapCrashReport {
|
|
3
|
+
id: number;
|
|
4
|
+
attractapId: number;
|
|
5
|
+
resetReason: string;
|
|
6
|
+
rebootReason: string | null;
|
|
7
|
+
heapFreeBytes: number | null;
|
|
8
|
+
largestFreeBlockBytes: number | null;
|
|
9
|
+
uptimeBeforeResetMs: number | null;
|
|
10
|
+
wsState: string | null;
|
|
11
|
+
wifiState: string | null;
|
|
12
|
+
firmwareVersion: string | null;
|
|
13
|
+
coredumpSize: number | null;
|
|
14
|
+
coredump: Buffer | null;
|
|
15
|
+
coredumpBuildId: string | null;
|
|
16
|
+
symbolicationStatus: string | null;
|
|
17
|
+
symbolizedBacktrace: string | null;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
attractap: Attractap;
|
|
20
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttractapCrashReport = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const class_transformer_1 = require("class-transformer");
|
|
8
|
+
const attractap_entity_1 = require("./attractap.entity");
|
|
9
|
+
let AttractapCrashReport = class AttractapCrashReport {
|
|
10
|
+
};
|
|
11
|
+
exports.AttractapCrashReport = AttractapCrashReport;
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
14
|
+
(0, swagger_1.ApiProperty)({ description: 'The unique identifier of the crash report', example: 1 }),
|
|
15
|
+
tslib_1.__metadata("design:type", Number)
|
|
16
|
+
], AttractapCrashReport.prototype, "id", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
19
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the reader this crash report belongs to', example: 1 }),
|
|
20
|
+
tslib_1.__metadata("design:type", Number)
|
|
21
|
+
], AttractapCrashReport.prototype, "attractapId", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
24
|
+
(0, swagger_1.ApiProperty)({
|
|
25
|
+
description: 'The reset reason reported by the reader (esp_reset_reason)',
|
|
26
|
+
example: 'TASK_WDT',
|
|
27
|
+
}),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], AttractapCrashReport.prototype, "resetReason", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
32
|
+
(0, swagger_1.ApiProperty)({
|
|
33
|
+
description: 'Deliberate reboot reason set by the firmware before a self-triggered restart (e.g. websocket reconnect heap recovery). Null for ordinary/unexpected resets.',
|
|
34
|
+
example: 'WEBSOCKET_RECONNECT_HEAP_EXHAUSTION',
|
|
35
|
+
nullable: true,
|
|
36
|
+
}),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], AttractapCrashReport.prototype, "rebootReason", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
description: 'Free heap in bytes captured before the freeze/reset',
|
|
43
|
+
example: 48213,
|
|
44
|
+
nullable: true,
|
|
45
|
+
}),
|
|
46
|
+
tslib_1.__metadata("design:type", Number)
|
|
47
|
+
], AttractapCrashReport.prototype, "heapFreeBytes", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
50
|
+
(0, swagger_1.ApiProperty)({
|
|
51
|
+
description: 'Largest contiguous free heap block in bytes before the freeze/reset',
|
|
52
|
+
example: 20480,
|
|
53
|
+
nullable: true,
|
|
54
|
+
}),
|
|
55
|
+
tslib_1.__metadata("design:type", Number)
|
|
56
|
+
], AttractapCrashReport.prototype, "largestFreeBlockBytes", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
59
|
+
(0, swagger_1.ApiProperty)({
|
|
60
|
+
description: 'Uptime in milliseconds before the reset occurred',
|
|
61
|
+
example: 372000,
|
|
62
|
+
nullable: true,
|
|
63
|
+
}),
|
|
64
|
+
tslib_1.__metadata("design:type", Number)
|
|
65
|
+
], AttractapCrashReport.prototype, "uptimeBeforeResetMs", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
68
|
+
(0, swagger_1.ApiProperty)({
|
|
69
|
+
description: 'WebSocket connection state at the time of the freeze/reset',
|
|
70
|
+
example: 'CONNECTED',
|
|
71
|
+
nullable: true,
|
|
72
|
+
}),
|
|
73
|
+
tslib_1.__metadata("design:type", String)
|
|
74
|
+
], AttractapCrashReport.prototype, "wsState", void 0);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
77
|
+
(0, swagger_1.ApiProperty)({
|
|
78
|
+
description: 'WiFi connection state at the time of the freeze/reset',
|
|
79
|
+
example: 'GOT_IP',
|
|
80
|
+
nullable: true,
|
|
81
|
+
}),
|
|
82
|
+
tslib_1.__metadata("design:type", String)
|
|
83
|
+
], AttractapCrashReport.prototype, "wifiState", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
86
|
+
(0, swagger_1.ApiProperty)({
|
|
87
|
+
description: 'Firmware version string reported by the reader at crash time',
|
|
88
|
+
example: '1.2.3',
|
|
89
|
+
nullable: true,
|
|
90
|
+
}),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], AttractapCrashReport.prototype, "firmwareVersion", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
95
|
+
(0, swagger_1.ApiProperty)({
|
|
96
|
+
description: 'Size of the attached coredump blob in bytes, if any',
|
|
97
|
+
example: 16384,
|
|
98
|
+
nullable: true,
|
|
99
|
+
}),
|
|
100
|
+
tslib_1.__metadata("design:type", Number)
|
|
101
|
+
], AttractapCrashReport.prototype, "coredumpSize", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ type: 'blob', nullable: true, select: false }),
|
|
104
|
+
(0, class_transformer_1.Exclude)(),
|
|
105
|
+
tslib_1.__metadata("design:type", Buffer)
|
|
106
|
+
], AttractapCrashReport.prototype, "coredump", void 0);
|
|
107
|
+
tslib_1.__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
109
|
+
(0, swagger_1.ApiProperty)({
|
|
110
|
+
description: 'Build id (app ELF SHA256) extracted from the coredump, used to match the ELF',
|
|
111
|
+
example: 'f6899cb1067e5043',
|
|
112
|
+
nullable: true,
|
|
113
|
+
}),
|
|
114
|
+
tslib_1.__metadata("design:type", String)
|
|
115
|
+
], AttractapCrashReport.prototype, "coredumpBuildId", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
118
|
+
(0, swagger_1.ApiProperty)({
|
|
119
|
+
description: 'Status of server-side coredump symbolication',
|
|
120
|
+
example: 'success',
|
|
121
|
+
enum: ['pending', 'success', 'failed', 'skipped', 'unavailable'],
|
|
122
|
+
nullable: true,
|
|
123
|
+
}),
|
|
124
|
+
tslib_1.__metadata("design:type", String)
|
|
125
|
+
], AttractapCrashReport.prototype, "symbolicationStatus", void 0);
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
128
|
+
(0, swagger_1.ApiProperty)({
|
|
129
|
+
description: 'Symbolized backtrace, task list, and register dump produced from the coredump + ELF',
|
|
130
|
+
example: '#0 0x42066718 in app_loop() at main.cpp:120',
|
|
131
|
+
nullable: true,
|
|
132
|
+
}),
|
|
133
|
+
tslib_1.__metadata("design:type", String)
|
|
134
|
+
], AttractapCrashReport.prototype, "symbolizedBacktrace", void 0);
|
|
135
|
+
tslib_1.__decorate([
|
|
136
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
137
|
+
(0, swagger_1.ApiProperty)({
|
|
138
|
+
description: 'When this crash report was received by the server',
|
|
139
|
+
example: '2026-06-02T12:00:00.000Z',
|
|
140
|
+
}),
|
|
141
|
+
tslib_1.__metadata("design:type", Date)
|
|
142
|
+
], AttractapCrashReport.prototype, "createdAt", void 0);
|
|
143
|
+
tslib_1.__decorate([
|
|
144
|
+
(0, typeorm_1.ManyToOne)(() => attractap_entity_1.Attractap, { onDelete: 'CASCADE' }),
|
|
145
|
+
(0, typeorm_1.JoinColumn)({ name: 'attractapId' }),
|
|
146
|
+
(0, class_transformer_1.Exclude)(),
|
|
147
|
+
tslib_1.__metadata("design:type", attractap_entity_1.Attractap)
|
|
148
|
+
], AttractapCrashReport.prototype, "attractap", void 0);
|
|
149
|
+
exports.AttractapCrashReport = AttractapCrashReport = tslib_1.__decorate([
|
|
150
|
+
(0, typeorm_1.Entity)('attractap_crash_report'),
|
|
151
|
+
(0, typeorm_1.Index)(['attractapId', 'createdAt'])
|
|
152
|
+
], AttractapCrashReport);
|
|
153
|
+
//# sourceMappingURL=attractapCrashReport.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attractapCrashReport.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/attractapCrashReport.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAQiB;AACjB,6CAA8C;AAC9C,yDAA4C;AAC5C,yDAA+C;AAIxC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAyHhC,CAAA;AAzHY,oDAAoB;AAG/B;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDAC1E;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACzE;AAOrB;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE,UAAU;KACpB,CAAC;;yDACmB;AASrB;IAPC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC;QACX,WAAW,EACT,6JAA6J;QAC/J,OAAO,EAAE,qCAAqC;QAC9C,QAAQ,EAAE,IAAI;KACf,CAAC;;0DAC2B;AAQ7B;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QA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AKjB;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAS,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACnD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACnC,IAAA,2BAAO,GAAE;sCACE,4BAAS;uDAAC;+BAxHX,oBAAoB;IAFhC,IAAA,gBAAM,EAAC,wBAAwB,CAAC;IAChC,IAAA,eAAK,EAAC,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;GACvB,oBAAoB,CAyHhC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { Conversation } from './conversation.entity';
|
|
3
|
+
export declare class ConversationParticipant {
|
|
4
|
+
id: number;
|
|
5
|
+
conversationId: number;
|
|
6
|
+
userId: number;
|
|
7
|
+
lastReadAt: Date | null;
|
|
8
|
+
lastNotifiedAt: Date | null;
|
|
9
|
+
conversation: Conversation;
|
|
10
|
+
user: User;
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationParticipant = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const user_entity_1 = require("./user.entity");
|
|
8
|
+
const conversation_entity_1 = require("./conversation.entity");
|
|
9
|
+
let ConversationParticipant = class ConversationParticipant {
|
|
10
|
+
};
|
|
11
|
+
exports.ConversationParticipant = ConversationParticipant;
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
14
|
+
(0, swagger_1.ApiProperty)({ description: 'The unique identifier of the participant entry', example: 1 }),
|
|
15
|
+
tslib_1.__metadata("design:type", Number)
|
|
16
|
+
], ConversationParticipant.prototype, "id", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
19
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the conversation this participant belongs to', example: 1 }),
|
|
20
|
+
tslib_1.__metadata("design:type", Number)
|
|
21
|
+
], ConversationParticipant.prototype, "conversationId", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
24
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the participating user', example: 1 }),
|
|
25
|
+
tslib_1.__metadata("design:type", Number)
|
|
26
|
+
], ConversationParticipant.prototype, "userId", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
29
|
+
(0, swagger_1.ApiProperty)({
|
|
30
|
+
description: 'When this participant last read the conversation',
|
|
31
|
+
example: '2025-01-18T12:30:00.000Z',
|
|
32
|
+
nullable: true,
|
|
33
|
+
}),
|
|
34
|
+
tslib_1.__metadata("design:type", Date)
|
|
35
|
+
], ConversationParticipant.prototype, "lastReadAt", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
38
|
+
(0, swagger_1.ApiProperty)({
|
|
39
|
+
description: 'When this participant was last sent an offline email notification for this conversation. Used to debounce email fallback to once per unread burst.',
|
|
40
|
+
example: '2025-01-18T12:30:00.000Z',
|
|
41
|
+
nullable: true,
|
|
42
|
+
}),
|
|
43
|
+
tslib_1.__metadata("design:type", Date)
|
|
44
|
+
], ConversationParticipant.prototype, "lastNotifiedAt", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(() => conversation_entity_1.Conversation, { onDelete: 'CASCADE' }),
|
|
47
|
+
(0, typeorm_1.JoinColumn)({ name: 'conversationId' }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({ description: 'The conversation this participant belongs to', type: () => conversation_entity_1.Conversation }),
|
|
49
|
+
tslib_1.__metadata("design:type", conversation_entity_1.Conversation)
|
|
50
|
+
], ConversationParticipant.prototype, "conversation", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
53
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
54
|
+
(0, swagger_1.ApiProperty)({ description: 'The participating user', type: () => user_entity_1.User }),
|
|
55
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
56
|
+
], ConversationParticipant.prototype, "user", void 0);
|
|
57
|
+
exports.ConversationParticipant = ConversationParticipant = tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.Entity)(),
|
|
59
|
+
(0, typeorm_1.Index)(['conversationId', 'userId'], { unique: true })
|
|
60
|
+
], ConversationParticipant);
|
|
61
|
+
//# sourceMappingURL=conversation-participant.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-participant.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/conversation-participant.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA+F;AAC/F,6CAA8C;AAC9C,+CAAqC;AACrC,+DAAqD;AAI9C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAuCnC,CAAA;AAvCY,0DAAuB;AAGlC;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDAC/E;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DAC3E;AAIxB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS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AAgB,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACzC,uBAAuB,CAuCnC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Conversation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
let Conversation = class Conversation {
|
|
8
|
+
};
|
|
9
|
+
exports.Conversation = Conversation;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
12
|
+
(0, swagger_1.ApiProperty)({ description: 'The unique identifier of the conversation', example: 1 }),
|
|
13
|
+
tslib_1.__metadata("design:type", Number)
|
|
14
|
+
], Conversation.prototype, "id", void 0);
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
17
|
+
(0, swagger_1.ApiProperty)({
|
|
18
|
+
description: 'When this conversation was created',
|
|
19
|
+
example: '2025-01-18T12:00:00.000Z',
|
|
20
|
+
}),
|
|
21
|
+
tslib_1.__metadata("design:type", Date)
|
|
22
|
+
], Conversation.prototype, "createdAt", void 0);
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
25
|
+
(0, swagger_1.ApiProperty)({
|
|
26
|
+
description: 'When this conversation was last updated',
|
|
27
|
+
example: '2025-01-18T12:30:00.000Z',
|
|
28
|
+
}),
|
|
29
|
+
tslib_1.__metadata("design:type", Date)
|
|
30
|
+
], Conversation.prototype, "updatedAt", void 0);
|
|
31
|
+
exports.Conversation = Conversation = tslib_1.__decorate([
|
|
32
|
+
(0, typeorm_1.Entity)()
|
|
33
|
+
], Conversation);
|
|
34
|
+
//# sourceMappingURL=conversation.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/conversation.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA6F;AAC7F,6CAA8C;AAGvC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAkBxB,CAAA;AAlBY,oCAAY;AAGvB;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wCAC1E;AAOZ;IALC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,oCAAoC;QACjD,OAAO,EAAE,0BAA0B;KACpC,CAAC;sCACU,IAAI;+CAAC;AAOjB;IALC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,0BAA0B;KACpC,CAAC;sCACU,IAAI;+CAAC;uBAjBN,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAkBxB"}
|
|
@@ -7,7 +7,14 @@ export declare enum EmailTemplateType {
|
|
|
7
7
|
RESOURCE_USAGE_BILLING_TRANSACTION_SUMMARY = "resource-usage-billing-transaction-summary",
|
|
8
8
|
PROJECT_INVITATION = "project-invitation",
|
|
9
9
|
DELETE_ACCOUNT_CONFIRMATION = "delete-account-confirmation",
|
|
10
|
-
RESOURCE_HEALTH_CHANGED = "resource-health-changed"
|
|
10
|
+
RESOURCE_HEALTH_CHANGED = "resource-health-changed",
|
|
11
|
+
USER_RETRAINING_REQUIRED = "user-retraining-required",
|
|
12
|
+
MAINTENANCE_REQUEST_CREATED = "maintenance-request-created",
|
|
13
|
+
MESSAGE_RECEIVED = "message-received",
|
|
14
|
+
RESOURCE_USAGE_NOTE_ADDED = "resource-usage-note-added",
|
|
15
|
+
RESOURCE_TAKEOVER = "resource-takeover",
|
|
16
|
+
ACCESS_CHANGE = "access-change",
|
|
17
|
+
RESOURCE_SESSION_ENDED = "resource-session-ended"
|
|
11
18
|
}
|
|
12
19
|
export declare class EmailTemplate {
|
|
13
20
|
type: EmailTemplateType;
|
|
@@ -16,6 +16,13 @@ var EmailTemplateType;
|
|
|
16
16
|
EmailTemplateType["PROJECT_INVITATION"] = "project-invitation";
|
|
17
17
|
EmailTemplateType["DELETE_ACCOUNT_CONFIRMATION"] = "delete-account-confirmation";
|
|
18
18
|
EmailTemplateType["RESOURCE_HEALTH_CHANGED"] = "resource-health-changed";
|
|
19
|
+
EmailTemplateType["USER_RETRAINING_REQUIRED"] = "user-retraining-required";
|
|
20
|
+
EmailTemplateType["MAINTENANCE_REQUEST_CREATED"] = "maintenance-request-created";
|
|
21
|
+
EmailTemplateType["MESSAGE_RECEIVED"] = "message-received";
|
|
22
|
+
EmailTemplateType["RESOURCE_USAGE_NOTE_ADDED"] = "resource-usage-note-added";
|
|
23
|
+
EmailTemplateType["RESOURCE_TAKEOVER"] = "resource-takeover";
|
|
24
|
+
EmailTemplateType["ACCESS_CHANGE"] = "access-change";
|
|
25
|
+
EmailTemplateType["RESOURCE_SESSION_ENDED"] = "resource-session-ended";
|
|
19
26
|
})(EmailTemplateType || (exports.EmailTemplateType = EmailTemplateType = {}));
|
|
20
27
|
let EmailTemplate = class EmailTemplate {
|
|
21
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/email-template.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA4F;AAC5F,6CAA8C;AAE9C,oCAAoC;AACpC,IAAY,
|
|
1
|
+
{"version":3,"file":"email-template.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/email-template.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA4F;AAC5F,6CAA8C;AAE9C,oCAAoC;AACpC,IAAY,iBAiBX;AAjBD,WAAY,iBAAiB;IAC3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EAAC,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;IAC1E,IAAA,0BAAgB,GAAE;sCACP,IAAI;gDAAC;AAIjB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;IAC/E,IAAA,0BAAgB,GAAE;sCACP,IAAI;gDAAC;wBA/BN,aAAa;IADzB,IAAA,gBAAM,EAAC,iBAAiB,CAAC;GACb,aAAa,CAgCzB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { Conversation } from './conversation.entity';
|
|
3
|
+
export declare enum MessageReferenceType {
|
|
4
|
+
RESOURCE = "RESOURCE",
|
|
5
|
+
ACTIVITY = "ACTIVITY"
|
|
6
|
+
}
|
|
7
|
+
export declare class Message {
|
|
8
|
+
id: number;
|
|
9
|
+
conversationId: number;
|
|
10
|
+
senderId: number;
|
|
11
|
+
content: string;
|
|
12
|
+
referenceType: MessageReferenceType | null;
|
|
13
|
+
referenceId: number | null;
|
|
14
|
+
referenceLabel: string | null;
|
|
15
|
+
referenceUrl: string | null;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
conversation: Conversation;
|
|
18
|
+
sender: User;
|
|
19
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Message = exports.MessageReferenceType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const user_entity_1 = require("./user.entity");
|
|
8
|
+
const conversation_entity_1 = require("./conversation.entity");
|
|
9
|
+
var MessageReferenceType;
|
|
10
|
+
(function (MessageReferenceType) {
|
|
11
|
+
MessageReferenceType["RESOURCE"] = "RESOURCE";
|
|
12
|
+
MessageReferenceType["ACTIVITY"] = "ACTIVITY";
|
|
13
|
+
})(MessageReferenceType || (exports.MessageReferenceType = MessageReferenceType = {}));
|
|
14
|
+
let Message = class Message {
|
|
15
|
+
};
|
|
16
|
+
exports.Message = Message;
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
19
|
+
(0, swagger_1.ApiProperty)({ description: 'The unique identifier of the message', example: 1 }),
|
|
20
|
+
tslib_1.__metadata("design:type", Number)
|
|
21
|
+
], Message.prototype, "id", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
24
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the conversation this message belongs to', example: 1 }),
|
|
25
|
+
tslib_1.__metadata("design:type", Number)
|
|
26
|
+
], Message.prototype, "conversationId", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
29
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the user who sent this message', example: 1 }),
|
|
30
|
+
tslib_1.__metadata("design:type", Number)
|
|
31
|
+
], Message.prototype, "senderId", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'The text content of the message', example: 'Hello there' }),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], Message.prototype, "content", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true, enum: MessageReferenceType }),
|
|
39
|
+
(0, swagger_1.ApiProperty)({
|
|
40
|
+
description: 'Optional type of context this message references',
|
|
41
|
+
enum: MessageReferenceType,
|
|
42
|
+
example: MessageReferenceType.RESOURCE,
|
|
43
|
+
nullable: true,
|
|
44
|
+
}),
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
46
|
+
], Message.prototype, "referenceType", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
49
|
+
(0, swagger_1.ApiProperty)({
|
|
50
|
+
description: 'Optional ID of the referenced entity, scoped by referenceType',
|
|
51
|
+
example: 1,
|
|
52
|
+
nullable: true,
|
|
53
|
+
}),
|
|
54
|
+
tslib_1.__metadata("design:type", Number)
|
|
55
|
+
], Message.prototype, "referenceId", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
58
|
+
(0, swagger_1.ApiProperty)({
|
|
59
|
+
description: 'Optional cached label of the referenced entity for rendering',
|
|
60
|
+
example: 'Laser Cutter',
|
|
61
|
+
nullable: true,
|
|
62
|
+
}),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], Message.prototype, "referenceLabel", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
67
|
+
(0, swagger_1.ApiProperty)({
|
|
68
|
+
description: 'Optional cached URL of the referenced entity for rendering',
|
|
69
|
+
example: '/resources/1',
|
|
70
|
+
nullable: true,
|
|
71
|
+
}),
|
|
72
|
+
tslib_1.__metadata("design:type", String)
|
|
73
|
+
], Message.prototype, "referenceUrl", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
76
|
+
(0, swagger_1.ApiProperty)({
|
|
77
|
+
description: 'When this message was created',
|
|
78
|
+
example: '2025-01-18T12:00:00.000Z',
|
|
79
|
+
}),
|
|
80
|
+
tslib_1.__metadata("design:type", Date)
|
|
81
|
+
], Message.prototype, "createdAt", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, typeorm_1.ManyToOne)(() => conversation_entity_1.Conversation, { onDelete: 'CASCADE' }),
|
|
84
|
+
(0, typeorm_1.JoinColumn)({ name: 'conversationId' }),
|
|
85
|
+
(0, swagger_1.ApiProperty)({ description: 'The conversation this message belongs to', type: () => conversation_entity_1.Conversation }),
|
|
86
|
+
tslib_1.__metadata("design:type", conversation_entity_1.Conversation)
|
|
87
|
+
], Message.prototype, "conversation", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
90
|
+
(0, typeorm_1.JoinColumn)({ name: 'senderId' }),
|
|
91
|
+
(0, swagger_1.ApiProperty)({ description: 'The user who sent this message', type: () => user_entity_1.User }),
|
|
92
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
93
|
+
], Message.prototype, "sender", void 0);
|
|
94
|
+
exports.Message = Message = tslib_1.__decorate([
|
|
95
|
+
(0, typeorm_1.Entity)(),
|
|
96
|
+
(0, typeorm_1.Index)(['conversationId', 'createdAt']),
|
|
97
|
+
(0, typeorm_1.Index)(['senderId'])
|
|
98
|
+
], Message);
|
|
99
|
+
//# sourceMappingURL=message.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/message.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAiH;AACjH,6CAA8C;AAC9C,+CAAqC;AACrC,+DAAqD;AAErD,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B;AAKM,IAAM,OAAO,GAAb,MAAM,OAAO;CAkEnB,CAAA;AAlEY,0BAAO;AAGlB;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mCACrE;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW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AAW,EAAC;QACX,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;;6CAC2B;AAO7B;IALC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,+BAA+B;QAC5C,OAAO,EAAE,0BAA0B;KACpC,CAAC;sCACU,IAAI;0CAAC;AAKjB;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACtC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;sCACpF,kCAAY;6CAAC;AAK5B;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAChC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;sCACxE,kBAAI;uCAAC;kBAjEH,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACtC,IAAA,eAAK,EAAC,CAAC,UAAU,CAAC,CAAC;GACP,OAAO,CAkEnB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationPreference = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const user_entity_1 = require("./user.entity");
|
|
8
|
+
let NotificationPreference = class NotificationPreference {
|
|
9
|
+
};
|
|
10
|
+
exports.NotificationPreference = NotificationPreference;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
13
|
+
(0, swagger_1.ApiProperty)({ description: 'The unique identifier of the notification preference entry', example: 1 }),
|
|
14
|
+
tslib_1.__metadata("design:type", Number)
|
|
15
|
+
], NotificationPreference.prototype, "id", void 0);
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
18
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the user these preferences belong to', example: 1 }),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], NotificationPreference.prototype, "userId", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
23
|
+
(0, swagger_1.ApiProperty)({
|
|
24
|
+
description: 'Whether to send an email fallback when a direct message arrives while the user is offline. Defaults to true (opt-out).',
|
|
25
|
+
example: true,
|
|
26
|
+
default: true,
|
|
27
|
+
}),
|
|
28
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
29
|
+
], NotificationPreference.prototype, "messagesEmailOnOffline", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
32
|
+
(0, swagger_1.ApiProperty)({
|
|
33
|
+
description: 'Whether to send a browser push notification when a direct message arrives while the user is offline. Defaults to true (opt-out).',
|
|
34
|
+
example: true,
|
|
35
|
+
default: true,
|
|
36
|
+
}),
|
|
37
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
38
|
+
], NotificationPreference.prototype, "messagesPushEnabled", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
description: 'JSON map of notification categories to enabled channels.',
|
|
43
|
+
required: false,
|
|
44
|
+
nullable: true,
|
|
45
|
+
}),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], NotificationPreference.prototype, "categoryChannels", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
50
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
51
|
+
(0, swagger_1.ApiProperty)({ description: 'The user these preferences belong to', type: () => user_entity_1.User }),
|
|
52
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
53
|
+
], NotificationPreference.prototype, "user", void 0);
|
|
54
|
+
exports.NotificationPreference = NotificationPreference = tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Entity)(),
|
|
56
|
+
(0, typeorm_1.Index)(['userId'], { unique: true })
|
|
57
|
+
], NotificationPreference);
|
|
58
|
+
//# sourceMappingURL=notification-preference.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-preference.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/notification-preference.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA+F;AAC/F,6CAA8C;AAC9C,+CAAqC;AAI9B,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAuClC,CAAA;AAvCY,wDAAsB;AAGjC;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4DAA4D,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDAC3F;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDAC3E;AAShB;IAPC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1C,IAAA,qBAAW,EAAC;QACX,WAAW,EACT,wHAAwH;QAC1H,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CAAC;;sEAC+B;AASjC;IAPC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1C,IAAA,qBAAW,EAAC;QACX,WAAW,EACT,kIAAkI;QACpI,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CAAC;;mEAC4B;AAQ9B;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,0DAA0D;QACvE,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;KACf,CAAC;;gEAC+B;AAKjC;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;sCAChF,kBAAI;oDAAC;iCAtCD,sBAAsB;IAFlC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACvB,sBAAsB,CAuClC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
export declare class PushSubscription {
|
|
3
|
+
id: number;
|
|
4
|
+
userId: number;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
p256dh: string;
|
|
7
|
+
auth: string;
|
|
8
|
+
userAgent: string | null;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
lastSeenAt: Date | null;
|
|
11
|
+
user: User;
|
|
12
|
+
}
|