dt-common-device 12.0.3 → 13.0.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.
Files changed (59) hide show
  1. package/dist/entities/connection/Connection.repository.d.ts +2 -0
  2. package/dist/entities/connection/Connection.repository.js +28 -0
  3. package/dist/entities/connection/Connection.service.d.ts +2 -0
  4. package/dist/entities/connection/Connection.service.js +12 -0
  5. package/package.json +1 -1
  6. package/dist/alerts/AlertBuilder.example.d.ts +0 -11
  7. package/dist/alerts/AlertBuilder.example.js +0 -117
  8. package/dist/alerts/AlertService.example.d.ts +0 -55
  9. package/dist/alerts/AlertService.example.js +0 -150
  10. package/dist/chronicle/Cronicle.service.d.ts +0 -13
  11. package/dist/chronicle/Cronicle.service.js +0 -93
  12. package/dist/chronicle/ICronicle.interface.d.ts +0 -16
  13. package/dist/chronicle/ICronicle.interface.js +0 -2
  14. package/dist/chronicle/index.d.ts +0 -2
  15. package/dist/chronicle/index.js +0 -5
  16. package/dist/entities/accessGroup/AccessGroup.repository.d.ts +0 -6
  17. package/dist/entities/accessGroup/AccessGroup.repository.js +0 -75
  18. package/dist/entities/accessGroup/AccessGroup.service.d.ts +0 -6
  19. package/dist/entities/accessGroup/AccessGroup.service.js +0 -106
  20. package/dist/entities/accessGroup/IAccessGroup.d.ts +0 -14
  21. package/dist/entities/accessGroup/IAccessGroup.js +0 -2
  22. package/dist/entities/accessGroup/index.d.ts +0 -2
  23. package/dist/entities/accessGroup/index.js +0 -18
  24. package/dist/entities/device/local/repository/DeviceProfile.repository.d.ts +0 -5
  25. package/dist/entities/device/local/repository/DeviceProfile.repository.js +0 -75
  26. package/dist/entities/guest/Guest.repository.d.ts +0 -6
  27. package/dist/entities/guest/Guest.repository.js +0 -77
  28. package/dist/entities/guest/Guest.service.d.ts +0 -6
  29. package/dist/entities/guest/Guest.service.js +0 -107
  30. package/dist/entities/guest/IGuest.d.ts +0 -12
  31. package/dist/entities/guest/IGuest.js +0 -2
  32. package/dist/entities/guest/index.d.ts +0 -2
  33. package/dist/entities/guest/index.js +0 -18
  34. package/dist/entities/schedules/ISchedule.d.ts +0 -14
  35. package/dist/entities/schedules/ISchedule.js +0 -2
  36. package/dist/entities/schedules/Schedule.repository.d.ts +0 -6
  37. package/dist/entities/schedules/Schedule.repository.js +0 -77
  38. package/dist/entities/schedules/Schedule.service.d.ts +0 -6
  39. package/dist/entities/schedules/Schedule.service.js +0 -107
  40. package/dist/entities/schedules/index.d.ts +0 -2
  41. package/dist/entities/schedules/index.js +0 -18
  42. package/dist/entities/user/IUser.d.ts +0 -15
  43. package/dist/entities/user/IUser.js +0 -2
  44. package/dist/entities/user/User.repository.d.ts +0 -5
  45. package/dist/entities/user/User.repository.js +0 -71
  46. package/dist/entities/user/User.service.d.ts +0 -6
  47. package/dist/entities/user/User.service.js +0 -106
  48. package/dist/entities/zone/IZone.d.ts +0 -10
  49. package/dist/entities/zone/IZone.js +0 -2
  50. package/dist/entities/zone/Zone.repository.d.ts +0 -6
  51. package/dist/entities/zone/Zone.repository.js +0 -77
  52. package/dist/entities/zone/Zone.service.d.ts +0 -6
  53. package/dist/entities/zone/Zone.service.js +0 -107
  54. package/dist/entities/zone/index.d.ts +0 -2
  55. package/dist/entities/zone/index.js +0 -18
  56. package/dist/issues/IssueBuilder.example.d.ts +0 -16
  57. package/dist/issues/IssueBuilder.example.js +0 -196
  58. package/dist/issues/IssueService.example.d.ts +0 -68
  59. package/dist/issues/IssueService.example.js +0 -292
@@ -1,106 +0,0 @@
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.AccessGroupService = void 0;
75
- const typedi_1 = __importStar(require("typedi"));
76
- const AccessGroup_repository_1 = require("./AccessGroup.repository");
77
- let AccessGroupService = (() => {
78
- let _classDecorators = [(0, typedi_1.Service)()];
79
- let _classDescriptor;
80
- let _classExtraInitializers = [];
81
- let _classThis;
82
- var AccessGroupService = _classThis = class {
83
- constructor() {
84
- this.accessGroupRepository = typedi_1.default.get(AccessGroup_repository_1.AccessGroupRepository);
85
- }
86
- async getAccessGroup(accessGroupId) {
87
- if (!accessGroupId) {
88
- throw new Error("Access Group ID is required");
89
- }
90
- const accessGroup = await this.accessGroupRepository.getAccessGroup(accessGroupId);
91
- if (!accessGroup)
92
- return null;
93
- return accessGroup;
94
- }
95
- };
96
- __setFunctionName(_classThis, "AccessGroupService");
97
- (() => {
98
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
99
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
100
- AccessGroupService = _classThis = _classDescriptor.value;
101
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
102
- __runInitializers(_classThis, _classExtraInitializers);
103
- })();
104
- return AccessGroupService = _classThis;
105
- })();
106
- exports.AccessGroupService = AccessGroupService;
@@ -1,14 +0,0 @@
1
- export interface IAccessGroup {
2
- id: string;
3
- propertyId: string;
4
- name: string;
5
- displayName: string;
6
- type: string;
7
- externalId?: string;
8
- refId?: string;
9
- isDeleted: boolean;
10
- createdBy: string;
11
- createdAt: Date;
12
- updatedAt: Date;
13
- accessibleBy: string[];
14
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export * from "./AccessGroup.service";
2
- export * from "./IAccessGroup";
@@ -1,18 +0,0 @@
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("./AccessGroup.service"), exports);
18
- __exportStar(require("./IAccessGroup"), exports);
@@ -1,5 +0,0 @@
1
- export declare class DeviceProfileRepository {
2
- private readonly axiosInstance;
3
- constructor();
4
- getDeviceBaseLine(deviceId: string): Promise<any>;
5
- }
@@ -1,75 +0,0 @@
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;
@@ -1,6 +0,0 @@
1
- import { IGuest } from "./IGuest";
2
- export declare class GuestRepository {
3
- private readonly pmsPostgres;
4
- constructor();
5
- getGuest(guestId: string): Promise<IGuest | null>;
6
- }
@@ -1,77 +0,0 @@
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_guest WHERE "id" = $1`, [guestId]);
56
- if (guest.rows.length > 0) {
57
- return guest.rows[0];
58
- }
59
- return null;
60
- }
61
- catch (error) {
62
- console.error("Error in getGuest:", error);
63
- throw new Error("Failed to get guest");
64
- }
65
- }
66
- };
67
- __setFunctionName(_classThis, "GuestRepository");
68
- (() => {
69
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
70
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
71
- GuestRepository = _classThis = _classDescriptor.value;
72
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
73
- __runInitializers(_classThis, _classExtraInitializers);
74
- })();
75
- return GuestRepository = _classThis;
76
- })();
77
- exports.GuestRepository = GuestRepository;
@@ -1,6 +0,0 @@
1
- import { IGuest } from "./IGuest";
2
- export declare class GuestService {
3
- private readonly guestRepository;
4
- constructor();
5
- getGuest(guestId: string): Promise<IGuest | null>;
6
- }
@@ -1,107 +0,0 @@
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
- const guest = await this.guestRepository.getGuest(guestId);
92
- if (!guest)
93
- return null;
94
- return guest;
95
- }
96
- };
97
- __setFunctionName(_classThis, "GuestService");
98
- (() => {
99
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
100
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
101
- GuestService = _classThis = _classDescriptor.value;
102
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
103
- __runInitializers(_classThis, _classExtraInitializers);
104
- })();
105
- return GuestService = _classThis;
106
- })();
107
- exports.GuestService = GuestService;
@@ -1,12 +0,0 @@
1
- export interface IGuest {
2
- id: string;
3
- firstName: string;
4
- lastName: string;
5
- email: string;
6
- phoneNumber: string;
7
- phoneNumberCountryCode: string;
8
- guestRefId?: string;
9
- countryCode: string;
10
- createdAt: string;
11
- updatedAt: string;
12
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export * from "./IGuest";
2
- export * from "./Guest.service";
@@ -1,18 +0,0 @@
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);
@@ -1,14 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { ISchedule } from "./ISchedule";
2
- export declare class ScheduleRepository {
3
- private readonly pmsPostgres;
4
- constructor();
5
- getSchedule(scheduleId: string): Promise<ISchedule | null>;
6
- }
@@ -1,77 +0,0 @@
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_schedule WHERE "id" = $1`, [scheduleId]);
56
- if (schedule.rows.length > 0) {
57
- return schedule.rows[0];
58
- }
59
- return null;
60
- }
61
- catch (error) {
62
- console.error("Error in getSchedule:", error);
63
- throw new Error("Failed to get schedule");
64
- }
65
- }
66
- };
67
- __setFunctionName(_classThis, "ScheduleRepository");
68
- (() => {
69
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
70
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
71
- ScheduleRepository = _classThis = _classDescriptor.value;
72
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
73
- __runInitializers(_classThis, _classExtraInitializers);
74
- })();
75
- return ScheduleRepository = _classThis;
76
- })();
77
- exports.ScheduleRepository = ScheduleRepository;
@@ -1,6 +0,0 @@
1
- import { ISchedule } from "./ISchedule";
2
- export declare class ScheduleService {
3
- private readonly scheduleRepository;
4
- constructor();
5
- getSchedule(scheduleId: string): Promise<ISchedule | null>;
6
- }