dt-common-device 13.0.2 → 13.0.7
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/admin/Admin.repository.d.ts +7 -0
- package/dist/admin/Admin.repository.js +182 -0
- package/dist/admin/Admin.service.d.ts +5 -0
- package/dist/admin/Admin.service.js +17 -0
- package/dist/admin/index.d.ts +1 -0
- package/dist/admin/index.js +17 -0
- package/dist/alerts/AlertBuilder.example.d.ts +11 -0
- package/dist/alerts/AlertBuilder.example.js +117 -0
- package/dist/alerts/AlertService.example.d.ts +55 -0
- package/dist/alerts/AlertService.example.js +150 -0
- package/dist/audit/AuditProperties.d.ts +16 -0
- package/dist/audit/AuditProperties.js +2 -0
- package/dist/chronicle/Cronicle.service.d.ts +9 -0
- package/dist/chronicle/Cronicle.service.js +76 -0
- package/dist/chronicle/IChronicle.interface.d.ts +14 -0
- package/dist/chronicle/IChronicle.interface.js +2 -0
- package/dist/chronicle/ICronicle.interface.d.ts +15 -0
- package/dist/chronicle/ICronicle.interface.js +2 -0
- package/dist/chronicle/chronicle.service.d.ts +4 -0
- package/dist/chronicle/chronicle.service.js +44 -0
- package/dist/chronicle/index.d.ts +2 -0
- package/dist/chronicle/index.js +5 -0
- package/dist/connection/Connection.repository.d.ts +8 -0
- package/dist/connection/Connection.repository.js +92 -0
- package/dist/connection/Connection.service.d.ts +8 -0
- package/dist/connection/Connection.service.js +32 -0
- package/dist/connection/IConnection.d.ts +28 -0
- package/dist/connection/IConnection.js +16 -0
- package/dist/connection/index.d.ts +2 -0
- package/dist/connection/index.js +18 -0
- package/dist/copilotQueue/examples/CopilotQueue.example.d.ts +37 -0
- package/dist/copilotQueue/examples/CopilotQueue.example.js +140 -0
- package/dist/copilotQueue/examples/index.d.ts +1 -0
- package/dist/copilotQueue/examples/index.js +17 -0
- package/dist/device/cloud/entities/CloudConnection.d.ts +6 -0
- package/dist/device/cloud/entities/CloudConnection.js +6 -0
- package/dist/device/cloud/entities/CloudDevice.d.ts +16 -0
- package/dist/device/cloud/entities/CloudDevice.js +26 -0
- package/dist/device/cloud/entities/CloudDeviceService.d.ts +5 -0
- package/dist/device/cloud/entities/CloudDeviceService.js +9 -0
- package/dist/device/cloud/entities/DeviceFactory.d.ts +7 -0
- package/dist/device/cloud/entities/DeviceFactory.js +80 -0
- package/dist/device/cloud/entities/index.d.ts +3 -0
- package/dist/device/cloud/entities/index.js +19 -0
- package/dist/device/cloud/interface.d.ts +101 -0
- package/dist/device/cloud/interface.js +3 -0
- package/dist/device/cloud/interfaces/ICloudConnection.d.ts +5 -0
- package/dist/device/cloud/interfaces/ICloudConnection.js +2 -0
- package/dist/device/cloud/interfaces/ICloudDevice.d.ts +9 -0
- package/dist/device/cloud/interfaces/ICloudDevice.js +2 -0
- package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +4 -0
- package/dist/device/cloud/interfaces/ICloudDeviceService.js +2 -0
- package/dist/device/cloud/interfaces/IConnectionService.d.ts +7 -0
- package/dist/device/cloud/interfaces/IConnectionService.js +2 -0
- package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +7 -0
- package/dist/device/cloud/interfaces/IDeviceConnectionService.js +3 -0
- package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +4 -0
- package/dist/device/cloud/interfaces/IDeviceFactory.js +2 -0
- package/dist/device/cloud/interfaces/IDeviceService.d.ts +8 -0
- package/dist/device/cloud/interfaces/IDeviceService.js +2 -0
- package/dist/device/cloud/interfaces/IDevicesService.d.ts +9 -0
- package/dist/device/cloud/interfaces/IDevicesService.js +2 -0
- package/dist/device/cloud/interfaces/IHubService.d.ts +5 -0
- package/dist/device/cloud/interfaces/IHubService.js +2 -0
- package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +4 -0
- package/dist/device/cloud/interfaces/IRawDataTransformer.js +2 -0
- package/dist/device/cloud/interfaces/IRawDevice.d.ts +17 -0
- package/dist/device/cloud/interfaces/IRawDevice.js +11 -0
- package/dist/device/cloud/interfaces/index.d.ts +5 -0
- package/dist/device/cloud/interfaces/index.js +21 -0
- package/dist/device/cloud/services/CloudDevice.service.d.ts +5 -0
- package/dist/device/cloud/services/CloudDevice.service.js +9 -0
- package/dist/device/cloud/services/Connection.service.d.ts +8 -0
- package/dist/device/cloud/services/Connection.service.js +6 -0
- package/dist/device/cloud/services/Device.service.d.ts +39 -0
- package/dist/device/cloud/services/Device.service.js +9 -0
- package/dist/device/cloud/services/DeviceCloudService.d.ts +42 -0
- package/dist/device/cloud/services/DeviceCloudService.js +59 -0
- package/dist/device/cloud/services/DeviceHub.service.d.ts +3 -0
- package/dist/device/cloud/services/DeviceHub.service.js +6 -0
- package/dist/device/cloud/services/Hub.service.d.ts +25 -0
- package/dist/device/cloud/services/Hub.service.js +9 -0
- package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +38 -0
- package/dist/device/cloud/services/SmartThingsDeviceService.js +52 -0
- package/dist/device/cloud/services/index.d.ts +2 -0
- package/dist/device/cloud/services/index.js +18 -0
- package/dist/device/cloud/types.d.ts +52 -0
- package/dist/device/cloud/types.js +15 -0
- package/dist/device/index.d.ts +4 -0
- package/dist/device/index.js +20 -0
- package/dist/device/local/entities/AlertBuilder.d.ts +87 -0
- package/dist/device/local/entities/AlertBuilder.example.d.ts +11 -0
- package/dist/device/local/entities/AlertBuilder.example.js +117 -0
- package/dist/device/local/entities/AlertBuilder.js +179 -0
- package/dist/device/local/entities/IssueBuilder.d.ts +109 -0
- package/dist/device/local/entities/IssueBuilder.example.d.ts +16 -0
- package/dist/device/local/entities/IssueBuilder.example.js +196 -0
- package/dist/device/local/entities/IssueBuilder.js +237 -0
- package/dist/device/local/entities/index.d.ts +2 -0
- package/dist/device/local/entities/index.js +7 -0
- package/dist/device/local/events/EventHandler.d.ts +11 -0
- package/dist/device/local/events/EventHandler.js +86 -0
- package/dist/device/local/events/Events.d.ts +54 -0
- package/dist/device/local/events/Events.js +57 -0
- package/dist/device/local/events/index.d.ts +2 -0
- package/dist/device/local/events/index.js +7 -0
- package/dist/device/local/handler/EventHandler.d.ts +7 -0
- package/dist/device/local/handler/EventHandler.js +44 -0
- package/dist/device/local/interface.d.ts +0 -0
- package/dist/device/local/interface.js +1 -0
- package/dist/device/local/interfaces/IConnection.d.ts +26 -0
- package/dist/device/local/interfaces/IConnection.js +14 -0
- package/dist/device/local/interfaces/IDevice.d.ts +68 -0
- package/dist/device/local/interfaces/IDevice.js +10 -0
- package/dist/device/local/interfaces/IDtDevice.d.ts +16 -0
- package/dist/device/local/interfaces/IDtDevice.js +2 -0
- package/dist/device/local/interfaces/IHub.d.ts +46 -0
- package/dist/device/local/interfaces/IHub.js +2 -0
- package/dist/device/local/interfaces/IProperty.d.ts +29 -0
- package/dist/device/local/interfaces/IProperty.js +2 -0
- package/dist/device/local/interfaces/ISchedule.d.ts +25 -0
- package/dist/device/local/interfaces/ISchedule.js +2 -0
- package/dist/device/local/interfaces/index.d.ts +3 -0
- package/dist/device/local/interfaces/index.js +19 -0
- package/dist/device/local/models/Alert.model.d.ts +28 -0
- package/dist/device/local/models/Alert.model.js +222 -0
- package/dist/device/local/models/Issue.model.d.ts +28 -0
- package/dist/device/local/models/Issue.model.js +260 -0
- package/dist/device/local/repository/Alert.repository.d.ts +106 -0
- package/dist/device/local/repository/Alert.repository.js +374 -0
- package/dist/device/local/repository/Connection.repository.d.ts +8 -0
- package/dist/device/local/repository/Connection.repository.js +92 -0
- package/dist/device/local/repository/Device.repository.d.ts +30 -0
- package/dist/device/local/repository/Device.repository.js +325 -0
- package/dist/device/local/repository/Hub.repository.d.ts +13 -0
- package/dist/device/local/repository/Hub.repository.js +139 -0
- package/dist/device/local/repository/Issue.repository.d.ts +113 -0
- package/dist/device/local/repository/Issue.repository.js +401 -0
- package/dist/device/local/repository/Property.repository.d.ts +8 -0
- package/dist/device/local/repository/Property.repository.js +95 -0
- package/dist/device/local/repository/Schedule.repository.d.ts +9 -0
- package/dist/device/local/repository/Schedule.repository.js +109 -0
- package/dist/device/local/services/Alert.service.d.ts +137 -0
- package/dist/device/local/services/Alert.service.js +475 -0
- package/dist/device/local/services/AlertService.example.d.ts +55 -0
- package/dist/device/local/services/AlertService.example.js +148 -0
- package/dist/device/local/services/Connection.service.d.ts +8 -0
- package/dist/device/local/services/Connection.service.js +32 -0
- package/dist/device/local/services/Device.service.d.ts +40 -0
- package/dist/device/local/services/Device.service.js +391 -0
- package/dist/device/local/services/DeviceHub.service.d.ts +11 -0
- package/dist/device/local/services/DeviceHub.service.js +40 -0
- package/dist/device/local/services/Hub.service.d.ts +12 -0
- package/dist/device/local/services/Hub.service.js +107 -0
- package/dist/device/local/services/Issue.service.d.ts +168 -0
- package/dist/device/local/services/Issue.service.js +642 -0
- package/dist/device/local/services/IssueService.example.d.ts +68 -0
- package/dist/device/local/services/IssueService.example.js +177 -0
- package/dist/device/local/services/Property.service.d.ts +8 -0
- package/dist/device/local/services/Property.service.js +36 -0
- package/dist/device/local/services/Schedule.service.d.ts +9 -0
- package/dist/device/local/services/Schedule.service.js +26 -0
- package/dist/device/local/services/index.d.ts +3 -0
- package/dist/device/local/services/index.js +19 -0
- package/dist/entities/accessGroup/AccessGroup.repository.d.ts +5 -0
- package/dist/entities/accessGroup/AccessGroup.repository.js +72 -0
- package/dist/entities/accessGroup/AccessGroup.service.d.ts +5 -0
- package/dist/entities/accessGroup/AccessGroup.service.js +105 -0
- package/dist/entities/accessGroup/IAccessGroup.d.ts +14 -0
- package/dist/entities/accessGroup/IAccessGroup.js +2 -0
- package/dist/entities/accessGroup/index.d.ts +2 -0
- package/dist/entities/accessGroup/index.js +18 -0
- package/dist/entities/admin/Admin.repository.d.ts +1 -1
- package/dist/entities/admin/Admin.repository.js +8 -4
- package/dist/entities/admin/Admin.service.d.ts +2 -2
- package/dist/entities/admin/Admin.service.js +4 -3
- package/dist/entities/connection/Connection.service.js +87 -34
- package/dist/entities/device/local/repository/DeviceProfile.repository.d.ts +5 -0
- package/dist/entities/device/local/repository/DeviceProfile.repository.js +75 -0
- package/dist/entities/guest/Guest.repository.d.ts +6 -0
- package/dist/entities/guest/Guest.repository.js +74 -0
- package/dist/entities/guest/Guest.service.d.ts +6 -0
- package/dist/entities/guest/Guest.service.js +104 -0
- package/dist/entities/guest/IGuest.d.ts +12 -0
- package/dist/entities/guest/IGuest.js +2 -0
- package/dist/entities/guest/index.d.ts +2 -0
- package/dist/entities/guest/index.js +18 -0
- package/dist/entities/schedules/ISchedule.d.ts +14 -0
- package/dist/entities/schedules/ISchedule.js +2 -0
- package/dist/entities/schedules/Schedule.repository.d.ts +6 -0
- package/dist/entities/schedules/Schedule.repository.js +74 -0
- package/dist/entities/schedules/Schedule.service.d.ts +6 -0
- package/dist/entities/schedules/Schedule.service.js +104 -0
- package/dist/entities/schedules/index.d.ts +2 -0
- package/dist/entities/schedules/index.js +18 -0
- package/dist/entities/user/IUser.d.ts +15 -0
- package/dist/entities/user/IUser.js +2 -0
- package/dist/entities/user/User.repository.d.ts +5 -0
- package/dist/entities/user/User.repository.js +68 -0
- package/dist/entities/user/User.service.d.ts +6 -0
- package/dist/entities/user/User.service.js +103 -0
- package/dist/entities/zone/IZone.d.ts +10 -0
- package/dist/entities/zone/IZone.js +2 -0
- package/dist/entities/zone/Zone.repository.d.ts +6 -0
- package/dist/entities/zone/Zone.repository.js +77 -0
- package/dist/entities/zone/Zone.service.d.ts +6 -0
- package/dist/entities/zone/Zone.service.js +104 -0
- package/dist/entities/zone/index.d.ts +2 -0
- package/dist/entities/zone/index.js +18 -0
- package/dist/issues/IssueBuilder.example.d.ts +16 -0
- package/dist/issues/IssueBuilder.example.js +196 -0
- package/dist/issues/IssueService.example.d.ts +68 -0
- package/dist/issues/IssueService.example.js +292 -0
- package/dist/pms/IPms.d.ts +6 -0
- package/dist/pms/IPms.js +10 -0
- package/dist/pms/index.d.ts +1 -0
- package/dist/pms/index.js +18 -0
- package/dist/pms/webhookQueue/examples/index.d.ts +2 -0
- package/dist/pms/webhookQueue/examples/index.js +18 -0
- package/dist/pms/webhookQueue/examples/pms-integration.d.ts +65 -0
- package/dist/pms/webhookQueue/examples/pms-integration.js +254 -0
- package/dist/pms/webhookQueue/examples/usage.d.ts +7 -0
- package/dist/pms/webhookQueue/examples/usage.js +175 -0
- package/dist/pms/webhookQueue/index.d.ts +3 -0
- package/dist/pms/webhookQueue/index.js +20 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.d.ts +33 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.js +2 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.d.ts +38 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.js +2 -0
- package/dist/pms/webhookQueue/interfaces/index.d.ts +1 -0
- package/dist/pms/webhookQueue/interfaces/index.js +17 -0
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.d.ts +38 -0
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.js +131 -0
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.d.ts +70 -0
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.js +207 -0
- package/dist/pms/webhookQueue/services/WebhookQueueService.d.ts +45 -0
- package/dist/pms/webhookQueue/services/WebhookQueueService.js +270 -0
- package/dist/pms/webhookQueue/services/WebhookWorker.d.ts +37 -0
- package/dist/pms/webhookQueue/services/WebhookWorker.js +201 -0
- package/dist/pms/webhookQueue/services/index.d.ts +1 -0
- package/dist/pms/webhookQueue/services/index.js +17 -0
- package/dist/pms/webhookQueue/types/index.d.ts +1 -0
- package/dist/pms/webhookQueue/types/index.js +17 -0
- package/dist/pms/webhookQueue/types/webhook.types.d.ts +39 -0
- package/dist/pms/webhookQueue/types/webhook.types.js +2 -0
- package/dist/property/IProperty.d.ts +29 -0
- package/dist/property/IProperty.js +2 -0
- package/dist/property/Property.repository.d.ts +8 -0
- package/dist/property/Property.repository.js +109 -0
- package/dist/property/Property.service.d.ts +8 -0
- package/dist/property/Property.service.js +124 -0
- package/dist/property/index.d.ts +2 -0
- package/dist/property/index.js +18 -0
- package/dist/queue/interfaces/IHttpRequestJob.d.ts +9 -0
- package/dist/queue/interfaces/IHttpRequestJob.js +2 -0
- package/dist/types/alert.types.d.ts +57 -0
- package/dist/types/alert.types.js +22 -0
- package/dist/types/config.types.d.ts +19 -0
- package/dist/types/config.types.js +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +19 -0
- package/dist/types/issue.types.d.ts +90 -0
- package/dist/types/issue.types.js +40 -0
- package/dist/utils/http-utils.d.ts +13 -0
- package/dist/utils/http-utils.js +117 -0
- package/package.json +1 -1
|
@@ -91,14 +91,15 @@ let AdminService = (() => {
|
|
|
91
91
|
}
|
|
92
92
|
catch (error) {
|
|
93
93
|
console.log(error);
|
|
94
|
+
return [];
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
async getZonesByAccessGroups(accessGroupIds) {
|
|
97
|
+
async getZonesByAccessGroups(accessGroupIds, type) {
|
|
97
98
|
try {
|
|
98
|
-
return await this.adminRepository.getZonesByAccessGroups(accessGroupIds);
|
|
99
|
+
return await this.adminRepository.getZonesByAccessGroups(accessGroupIds, type);
|
|
99
100
|
}
|
|
100
101
|
catch (error) {
|
|
101
|
-
|
|
102
|
+
return [];
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
async getAccessGroup(accessGroupId, propertyId) {
|
|
@@ -1,44 +1,97 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
2
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
41
|
exports.LocalConnectionService = void 0;
|
|
4
42
|
const typedi_1 = require("typedi");
|
|
5
43
|
const Connection_repository_1 = require("./Connection.repository");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
!data.connectionProvider) {
|
|
15
|
-
throw new Error("Missing required fields");
|
|
16
|
-
}
|
|
17
|
-
return await this.connectionRepository.createConnection(data);
|
|
18
|
-
}
|
|
19
|
-
async getConnection(connectionId) {
|
|
20
|
-
if (!connectionId) {
|
|
21
|
-
throw new Error("Connection ID is required");
|
|
44
|
+
let LocalConnectionService = (() => {
|
|
45
|
+
let _classDecorators = [(0, typedi_1.Service)()];
|
|
46
|
+
let _classDescriptor;
|
|
47
|
+
let _classExtraInitializers = [];
|
|
48
|
+
let _classThis;
|
|
49
|
+
var LocalConnectionService = _classThis = class {
|
|
50
|
+
constructor() {
|
|
51
|
+
this.connectionRepository = typedi_1.Container.get(Connection_repository_1.ConnectionRepository);
|
|
22
52
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
async createConnection(data) {
|
|
54
|
+
if (!data.connectionName ||
|
|
55
|
+
!data.connectionRefId ||
|
|
56
|
+
!data.propertyId ||
|
|
57
|
+
!data.connectionProvider) {
|
|
58
|
+
throw new Error("Missing required fields");
|
|
59
|
+
}
|
|
60
|
+
return await this.connectionRepository.createConnection(data);
|
|
28
61
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
62
|
+
async getConnection(connectionId) {
|
|
63
|
+
if (!connectionId) {
|
|
64
|
+
throw new Error("Connection ID is required");
|
|
65
|
+
}
|
|
66
|
+
return await this.connectionRepository.getConnectionById(connectionId);
|
|
34
67
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
async getConnectionsByPropertyId(propertyId) {
|
|
69
|
+
if (!propertyId) {
|
|
70
|
+
throw new Error("Property ID is required");
|
|
71
|
+
}
|
|
72
|
+
return await this.connectionRepository.getConnectionsByPropertyId(propertyId);
|
|
40
73
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
74
|
+
async queryConnections(query) {
|
|
75
|
+
if (!query || Object.keys(query).length === 0) {
|
|
76
|
+
throw new Error("Query is required");
|
|
77
|
+
}
|
|
78
|
+
return await this.connectionRepository.queryConnections(query);
|
|
79
|
+
}
|
|
80
|
+
async updateConnection(connectionId, data) {
|
|
81
|
+
if (!connectionId) {
|
|
82
|
+
throw new Error("Connection ID is required");
|
|
83
|
+
}
|
|
84
|
+
return await this.connectionRepository.updateConnection(connectionId, data);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
__setFunctionName(_classThis, "LocalConnectionService");
|
|
88
|
+
(() => {
|
|
89
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
90
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
91
|
+
LocalConnectionService = _classThis = _classDescriptor.value;
|
|
92
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
93
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
94
|
+
})();
|
|
95
|
+
return LocalConnectionService = _classThis;
|
|
96
|
+
})();
|
|
44
97
|
exports.LocalConnectionService = LocalConnectionService;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.DeviceProfileRepository = void 0;
|
|
42
|
+
const typedi_1 = require("typedi");
|
|
43
|
+
const utils_1 = require("../../../../utils");
|
|
44
|
+
const config_1 = require("../../../../config/config");
|
|
45
|
+
let DeviceProfileRepository = (() => {
|
|
46
|
+
let _classDecorators = [(0, typedi_1.Service)()];
|
|
47
|
+
let _classDescriptor;
|
|
48
|
+
let _classExtraInitializers = [];
|
|
49
|
+
let _classThis;
|
|
50
|
+
var DeviceProfileRepository = _classThis = class {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.axiosInstance = (0, utils_1.getDeviceProfileServiceAxiosInstance)();
|
|
53
|
+
}
|
|
54
|
+
async getDeviceBaseLine(deviceId) {
|
|
55
|
+
try {
|
|
56
|
+
const response = await this.axiosInstance.get(`/baseline/${deviceId}`);
|
|
57
|
+
return response.data;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
(0, config_1.getConfig)().LOGGER.error(`Failed to get device baseline for ${deviceId}:`, error);
|
|
61
|
+
throw new Error(`Failed to get device baseline: ${error.message || "Unknown error"}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
__setFunctionName(_classThis, "DeviceProfileRepository");
|
|
66
|
+
(() => {
|
|
67
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
68
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
69
|
+
DeviceProfileRepository = _classThis = _classDescriptor.value;
|
|
70
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
71
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
72
|
+
})();
|
|
73
|
+
return DeviceProfileRepository = _classThis;
|
|
74
|
+
})();
|
|
75
|
+
exports.DeviceProfileRepository = DeviceProfileRepository;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.GuestRepository = void 0;
|
|
42
|
+
const db_1 = require("../../db");
|
|
43
|
+
const typedi_1 = require("typedi");
|
|
44
|
+
let GuestRepository = (() => {
|
|
45
|
+
let _classDecorators = [(0, typedi_1.Service)()];
|
|
46
|
+
let _classDescriptor;
|
|
47
|
+
let _classExtraInitializers = [];
|
|
48
|
+
let _classThis;
|
|
49
|
+
var GuestRepository = _classThis = class {
|
|
50
|
+
constructor() {
|
|
51
|
+
this.pmsPostgres = (0, db_1.getPmsPostgresClient)();
|
|
52
|
+
}
|
|
53
|
+
async getGuest(guestId) {
|
|
54
|
+
try {
|
|
55
|
+
const guest = await this.pmsPostgres.query(`SELECT * FROM dt_guests WHERE "id" = $1`, [guestId]);
|
|
56
|
+
return guest.rows[0];
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error("Error in getGuest:", error);
|
|
60
|
+
throw new Error("Failed to get guest");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
__setFunctionName(_classThis, "GuestRepository");
|
|
65
|
+
(() => {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
67
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
68
|
+
GuestRepository = _classThis = _classDescriptor.value;
|
|
69
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
70
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
71
|
+
})();
|
|
72
|
+
return GuestRepository = _classThis;
|
|
73
|
+
})();
|
|
74
|
+
exports.GuestRepository = GuestRepository;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
19
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
20
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
21
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
22
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
23
|
+
var _, done = false;
|
|
24
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
25
|
+
var context = {};
|
|
26
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
27
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
28
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
29
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
30
|
+
if (kind === "accessor") {
|
|
31
|
+
if (result === void 0) continue;
|
|
32
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
33
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
34
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
35
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
36
|
+
}
|
|
37
|
+
else if (_ = accept(result)) {
|
|
38
|
+
if (kind === "field") initializers.unshift(_);
|
|
39
|
+
else descriptor[key] = _;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
43
|
+
done = true;
|
|
44
|
+
};
|
|
45
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
46
|
+
var useValue = arguments.length > 2;
|
|
47
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
48
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
49
|
+
}
|
|
50
|
+
return useValue ? value : void 0;
|
|
51
|
+
};
|
|
52
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
53
|
+
var ownKeys = function(o) {
|
|
54
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
55
|
+
var ar = [];
|
|
56
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
57
|
+
return ar;
|
|
58
|
+
};
|
|
59
|
+
return ownKeys(o);
|
|
60
|
+
};
|
|
61
|
+
return function (mod) {
|
|
62
|
+
if (mod && mod.__esModule) return mod;
|
|
63
|
+
var result = {};
|
|
64
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
65
|
+
__setModuleDefault(result, mod);
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
})();
|
|
69
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
70
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
71
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
72
|
+
};
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
exports.GuestService = void 0;
|
|
75
|
+
const Guest_repository_1 = require("./Guest.repository");
|
|
76
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
77
|
+
let GuestService = (() => {
|
|
78
|
+
let _classDecorators = [(0, typedi_1.Service)()];
|
|
79
|
+
let _classDescriptor;
|
|
80
|
+
let _classExtraInitializers = [];
|
|
81
|
+
let _classThis;
|
|
82
|
+
var GuestService = _classThis = class {
|
|
83
|
+
constructor() {
|
|
84
|
+
// Use dependency injection instead of creating new instance
|
|
85
|
+
this.guestRepository = typedi_1.default.get(Guest_repository_1.GuestRepository);
|
|
86
|
+
}
|
|
87
|
+
async getGuest(guestId) {
|
|
88
|
+
if (!guestId) {
|
|
89
|
+
throw new Error("Guest ID is required");
|
|
90
|
+
}
|
|
91
|
+
return await this.guestRepository.getGuest(guestId);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
__setFunctionName(_classThis, "GuestService");
|
|
95
|
+
(() => {
|
|
96
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
97
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
98
|
+
GuestService = _classThis = _classDescriptor.value;
|
|
99
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
100
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
101
|
+
})();
|
|
102
|
+
return GuestService = _classThis;
|
|
103
|
+
})();
|
|
104
|
+
exports.GuestService = GuestService;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IGuest"), exports);
|
|
18
|
+
__exportStar(require("./Guest.service"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ISchedule {
|
|
2
|
+
id: string;
|
|
3
|
+
propertyId: string;
|
|
4
|
+
referenceId: string;
|
|
5
|
+
startTime: string;
|
|
6
|
+
endTime: string;
|
|
7
|
+
source: string;
|
|
8
|
+
status: string;
|
|
9
|
+
isExpired: boolean;
|
|
10
|
+
isDeleted: boolean;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
createdBy: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.ScheduleRepository = void 0;
|
|
42
|
+
const db_1 = require("../../db");
|
|
43
|
+
const typedi_1 = require("typedi");
|
|
44
|
+
let ScheduleRepository = (() => {
|
|
45
|
+
let _classDecorators = [(0, typedi_1.Service)()];
|
|
46
|
+
let _classDescriptor;
|
|
47
|
+
let _classExtraInitializers = [];
|
|
48
|
+
let _classThis;
|
|
49
|
+
var ScheduleRepository = _classThis = class {
|
|
50
|
+
constructor() {
|
|
51
|
+
this.pmsPostgres = (0, db_1.getPmsPostgresClient)();
|
|
52
|
+
}
|
|
53
|
+
async getSchedule(scheduleId) {
|
|
54
|
+
try {
|
|
55
|
+
const schedule = await this.pmsPostgres.query(`SELECT * FROM dt_schedules WHERE "id" = $1`, [scheduleId]);
|
|
56
|
+
return schedule.rows[0];
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error("Error in getSchedule:", error);
|
|
60
|
+
throw new Error("Failed to get schedule");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
__setFunctionName(_classThis, "ScheduleRepository");
|
|
65
|
+
(() => {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
67
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
68
|
+
ScheduleRepository = _classThis = _classDescriptor.value;
|
|
69
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
70
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
71
|
+
})();
|
|
72
|
+
return ScheduleRepository = _classThis;
|
|
73
|
+
})();
|
|
74
|
+
exports.ScheduleRepository = ScheduleRepository;
|