dt-common-device 13.0.27 → 13.1.2
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/README.md +1 -1
- package/dist/cronicle/Cronicle.service.js +3 -1
- package/dist/issues/Issue.service.d.ts +1 -1
- package/dist/issues/Issue.service.js +8 -6
- package/dist/issues/issue.types.d.ts +7 -4
- package/dist/issues/issue.types.js +5 -2
- package/package.json +1 -1
- package/dist/admin/Admin.repository.d.ts +0 -7
- package/dist/admin/Admin.service.d.ts +0 -5
- package/dist/admin/index.d.ts +0 -1
- package/dist/alerts/AlertBuilder.example.d.ts +0 -11
- package/dist/alerts/AlertService.example.d.ts +0 -55
- package/dist/audit/AuditProperties.d.ts +0 -16
- package/dist/chronicle/Cronicle.service.d.ts +0 -9
- package/dist/chronicle/IChronicle.interface.d.ts +0 -14
- package/dist/chronicle/ICronicle.interface.d.ts +0 -15
- package/dist/chronicle/chronicle.service.d.ts +0 -4
- package/dist/chronicle/index.d.ts +0 -2
- package/dist/connection/Connection.repository.d.ts +0 -8
- package/dist/connection/Connection.service.d.ts +0 -8
- package/dist/connection/IConnection.d.ts +0 -28
- package/dist/connection/index.d.ts +0 -2
- package/dist/copilotQueue/examples/CopilotQueue.example.d.ts +0 -37
- package/dist/copilotQueue/examples/index.d.ts +0 -1
- package/dist/device/cloud/entities/CloudConnection.d.ts +0 -6
- package/dist/device/cloud/entities/CloudDevice.d.ts +0 -16
- package/dist/device/cloud/entities/CloudDeviceService.d.ts +0 -5
- package/dist/device/cloud/entities/DeviceFactory.d.ts +0 -7
- package/dist/device/cloud/entities/index.d.ts +0 -3
- package/dist/device/cloud/interface.d.ts +0 -101
- package/dist/device/cloud/interfaces/ICloudConnection.d.ts +0 -5
- package/dist/device/cloud/interfaces/ICloudDevice.d.ts +0 -9
- package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +0 -4
- package/dist/device/cloud/interfaces/IConnectionService.d.ts +0 -7
- package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +0 -7
- package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +0 -4
- package/dist/device/cloud/interfaces/IDeviceService.d.ts +0 -8
- package/dist/device/cloud/interfaces/IDevicesService.d.ts +0 -9
- package/dist/device/cloud/interfaces/IHubService.d.ts +0 -5
- package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +0 -4
- package/dist/device/cloud/interfaces/IRawDevice.d.ts +0 -17
- package/dist/device/cloud/interfaces/index.d.ts +0 -5
- package/dist/device/cloud/services/CloudDevice.service.d.ts +0 -5
- package/dist/device/cloud/services/Connection.service.d.ts +0 -8
- package/dist/device/cloud/services/Device.service.d.ts +0 -39
- package/dist/device/cloud/services/DeviceCloudService.d.ts +0 -42
- package/dist/device/cloud/services/DeviceHub.service.d.ts +0 -3
- package/dist/device/cloud/services/Hub.service.d.ts +0 -25
- package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +0 -38
- package/dist/device/cloud/services/SmartThingsDeviceService.js +0 -52
- package/dist/device/cloud/services/index.d.ts +0 -2
- package/dist/device/cloud/types.d.ts +0 -52
- package/dist/device/cloud/types.js +0 -15
- package/dist/device/index.d.ts +0 -4
- package/dist/device/local/entities/AlertBuilder.d.ts +0 -87
- package/dist/device/local/entities/AlertBuilder.example.d.ts +0 -11
- package/dist/device/local/entities/IssueBuilder.d.ts +0 -109
- package/dist/device/local/entities/IssueBuilder.example.d.ts +0 -16
- package/dist/device/local/entities/IssueBuilder.example.js +0 -196
- package/dist/device/local/entities/IssueBuilder.js +0 -237
- package/dist/device/local/entities/index.d.ts +0 -2
- package/dist/device/local/events/EventHandler.d.ts +0 -11
- package/dist/device/local/events/Events.d.ts +0 -54
- package/dist/device/local/events/index.d.ts +0 -2
- package/dist/device/local/handler/EventHandler.d.ts +0 -7
- package/dist/device/local/interface.d.ts +0 -0
- package/dist/device/local/interfaces/IConnection.d.ts +0 -26
- package/dist/device/local/interfaces/IDevice.d.ts +0 -68
- package/dist/device/local/interfaces/IDtDevice.d.ts +0 -16
- package/dist/device/local/interfaces/IHub.d.ts +0 -46
- package/dist/device/local/interfaces/IProperty.d.ts +0 -29
- package/dist/device/local/interfaces/ISchedule.d.ts +0 -25
- package/dist/device/local/interfaces/index.d.ts +0 -3
- package/dist/device/local/models/Alert.model.d.ts +0 -28
- package/dist/device/local/models/Issue.model.d.ts +0 -28
- package/dist/device/local/repository/Alert.repository.d.ts +0 -106
- package/dist/device/local/repository/Connection.repository.d.ts +0 -8
- package/dist/device/local/repository/Device.repository.d.ts +0 -30
- package/dist/device/local/repository/Hub.repository.d.ts +0 -13
- package/dist/device/local/repository/Issue.repository.d.ts +0 -113
- package/dist/device/local/repository/Property.repository.d.ts +0 -8
- package/dist/device/local/repository/Property.repository.js +0 -95
- package/dist/device/local/repository/Schedule.repository.d.ts +0 -9
- package/dist/device/local/repository/Schedule.repository.js +0 -109
- package/dist/device/local/services/Alert.service.d.ts +0 -137
- package/dist/device/local/services/AlertService.example.d.ts +0 -55
- package/dist/device/local/services/Connection.service.d.ts +0 -8
- package/dist/device/local/services/Device.service.d.ts +0 -40
- package/dist/device/local/services/DeviceHub.service.d.ts +0 -11
- package/dist/device/local/services/Hub.service.d.ts +0 -12
- package/dist/device/local/services/Issue.service.d.ts +0 -168
- package/dist/device/local/services/Issue.service.js +0 -642
- package/dist/device/local/services/IssueService.example.d.ts +0 -68
- package/dist/device/local/services/IssueService.example.js +0 -177
- package/dist/device/local/services/Property.service.d.ts +0 -8
- package/dist/device/local/services/Property.service.js +0 -36
- package/dist/device/local/services/Schedule.service.d.ts +0 -9
- package/dist/device/local/services/Schedule.service.js +0 -26
- package/dist/device/local/services/index.d.ts +0 -3
- package/dist/entities/accessGroup/AccessGroup.repository.d.ts +0 -5
- package/dist/entities/accessGroup/AccessGroup.service.d.ts +0 -5
- package/dist/entities/accessGroup/IAccessGroup.d.ts +0 -14
- package/dist/entities/accessGroup/index.d.ts +0 -2
- package/dist/entities/device/local/repository/DeviceProfile.repository.d.ts +0 -5
- package/dist/entities/guest/Guest.repository.d.ts +0 -6
- package/dist/entities/guest/Guest.service.d.ts +0 -6
- package/dist/entities/guest/IGuest.d.ts +0 -12
- package/dist/entities/guest/index.d.ts +0 -2
- package/dist/entities/schedules/ISchedule.d.ts +0 -14
- package/dist/entities/schedules/Schedule.repository.d.ts +0 -6
- package/dist/entities/schedules/Schedule.repository.js +0 -74
- package/dist/entities/schedules/Schedule.service.d.ts +0 -6
- package/dist/entities/schedules/Schedule.service.js +0 -104
- package/dist/entities/schedules/index.d.ts +0 -2
- package/dist/entities/user/IUser.d.ts +0 -15
- package/dist/entities/user/IUser.js +0 -2
- package/dist/entities/user/User.repository.d.ts +0 -5
- package/dist/entities/user/User.repository.js +0 -68
- package/dist/entities/user/User.service.d.ts +0 -6
- package/dist/entities/user/User.service.js +0 -103
- package/dist/entities/zone/IZone.d.ts +0 -10
- package/dist/entities/zone/IZone.js +0 -2
- package/dist/entities/zone/Zone.repository.d.ts +0 -6
- package/dist/entities/zone/Zone.repository.js +0 -77
- package/dist/entities/zone/Zone.service.d.ts +0 -6
- package/dist/entities/zone/Zone.service.js +0 -104
- package/dist/entities/zone/index.d.ts +0 -2
- package/dist/issues/IssueBuilder.example.d.ts +0 -16
- package/dist/issues/IssueBuilder.example.js +0 -196
- package/dist/issues/IssueService.example.d.ts +0 -68
- package/dist/issues/IssueService.example.js +0 -292
- package/dist/pms/IPms.d.ts +0 -6
- package/dist/pms/index.d.ts +0 -1
- package/dist/pms/webhookQueue/examples/index.d.ts +0 -2
- package/dist/pms/webhookQueue/examples/pms-integration.d.ts +0 -65
- package/dist/pms/webhookQueue/examples/pms-integration.js +0 -254
- package/dist/pms/webhookQueue/examples/usage.d.ts +0 -7
- package/dist/pms/webhookQueue/examples/usage.js +0 -175
- package/dist/pms/webhookQueue/index.d.ts +0 -3
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.d.ts +0 -33
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.js +0 -2
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.d.ts +0 -38
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.js +0 -2
- package/dist/pms/webhookQueue/interfaces/index.d.ts +0 -1
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.d.ts +0 -38
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.js +0 -131
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.d.ts +0 -70
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.js +0 -207
- package/dist/pms/webhookQueue/services/WebhookQueueService.d.ts +0 -45
- package/dist/pms/webhookQueue/services/WebhookQueueService.js +0 -270
- package/dist/pms/webhookQueue/services/WebhookWorker.d.ts +0 -37
- package/dist/pms/webhookQueue/services/WebhookWorker.js +0 -201
- package/dist/pms/webhookQueue/services/index.d.ts +0 -1
- package/dist/pms/webhookQueue/types/index.d.ts +0 -1
- package/dist/pms/webhookQueue/types/webhook.types.d.ts +0 -39
- package/dist/pms/webhookQueue/types/webhook.types.js +0 -2
- package/dist/property/IProperty.d.ts +0 -29
- package/dist/property/Property.repository.d.ts +0 -8
- package/dist/property/Property.repository.js +0 -109
- package/dist/property/Property.service.d.ts +0 -8
- package/dist/property/Property.service.js +0 -124
- package/dist/property/index.d.ts +0 -2
- package/dist/queue/interfaces/IHttpRequestJob.d.ts +0 -9
- package/dist/types/alert.types.d.ts +0 -57
- package/dist/types/config.types.d.ts +0 -19
- package/dist/types/index.d.ts +0 -3
- package/dist/types/issue.types.d.ts +0 -90
- package/dist/types/issue.types.js +0 -40
- package/dist/utils/http-utils.d.ts +0 -13
|
@@ -1,68 +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.UserRepository = void 0;
|
|
42
|
-
const typedi_1 = require("typedi");
|
|
43
|
-
const db_1 = require("../../db");
|
|
44
|
-
let UserRepository = (() => {
|
|
45
|
-
let _classDecorators = [(0, typedi_1.Service)()];
|
|
46
|
-
let _classDescriptor;
|
|
47
|
-
let _classExtraInitializers = [];
|
|
48
|
-
let _classThis;
|
|
49
|
-
var UserRepository = _classThis = class {
|
|
50
|
-
constructor() {
|
|
51
|
-
this.postgres = (0, db_1.getPostgresClient)();
|
|
52
|
-
}
|
|
53
|
-
async getUser(userId) {
|
|
54
|
-
const user = await this.postgres.query(`SELECT * FROM dt_users WHERE "id" = $1`, [userId]);
|
|
55
|
-
return user.rows[0];
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
__setFunctionName(_classThis, "UserRepository");
|
|
59
|
-
(() => {
|
|
60
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
61
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
62
|
-
UserRepository = _classThis = _classDescriptor.value;
|
|
63
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
64
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
65
|
-
})();
|
|
66
|
-
return UserRepository = _classThis;
|
|
67
|
-
})();
|
|
68
|
-
exports.UserRepository = UserRepository;
|
|
@@ -1,103 +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.UserService = void 0;
|
|
75
|
-
const typedi_1 = __importStar(require("typedi"));
|
|
76
|
-
const User_repository_1 = require("./User.repository");
|
|
77
|
-
let UserService = (() => {
|
|
78
|
-
let _classDecorators = [(0, typedi_1.Service)()];
|
|
79
|
-
let _classDescriptor;
|
|
80
|
-
let _classExtraInitializers = [];
|
|
81
|
-
let _classThis;
|
|
82
|
-
var UserService = _classThis = class {
|
|
83
|
-
constructor() {
|
|
84
|
-
this.userRepository = typedi_1.default.get(User_repository_1.UserRepository);
|
|
85
|
-
}
|
|
86
|
-
async getUser(userId) {
|
|
87
|
-
if (!userId) {
|
|
88
|
-
throw new Error("User ID is required");
|
|
89
|
-
}
|
|
90
|
-
return await this.userRepository.getUser(userId);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
__setFunctionName(_classThis, "UserService");
|
|
94
|
-
(() => {
|
|
95
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
96
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
97
|
-
UserService = _classThis = _classDescriptor.value;
|
|
98
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
99
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
100
|
-
})();
|
|
101
|
-
return UserService = _classThis;
|
|
102
|
-
})();
|
|
103
|
-
exports.UserService = UserService;
|
|
@@ -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.ZoneRepository = void 0;
|
|
42
|
-
const db_1 = require("../../db");
|
|
43
|
-
const typedi_1 = require("typedi");
|
|
44
|
-
let ZoneRepository = (() => {
|
|
45
|
-
let _classDecorators = [(0, typedi_1.Service)()];
|
|
46
|
-
let _classDescriptor;
|
|
47
|
-
let _classExtraInitializers = [];
|
|
48
|
-
let _classThis;
|
|
49
|
-
var ZoneRepository = _classThis = class {
|
|
50
|
-
constructor() {
|
|
51
|
-
this.postgres = (0, db_1.getPostgresClient)();
|
|
52
|
-
}
|
|
53
|
-
async getZone(zoneId) {
|
|
54
|
-
try {
|
|
55
|
-
const zone = await this.postgres.query(`SELECT * FROM dt_zones WHERE "id" = $1`, [zoneId]);
|
|
56
|
-
if (zone.rows.length > 0) {
|
|
57
|
-
return zone.rows[0];
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
console.error("Error in getZone:", error);
|
|
63
|
-
throw new Error("Failed to get zone");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
__setFunctionName(_classThis, "ZoneRepository");
|
|
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
|
-
ZoneRepository = _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 ZoneRepository = _classThis;
|
|
76
|
-
})();
|
|
77
|
-
exports.ZoneRepository = ZoneRepository;
|
|
@@ -1,104 +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.ZoneService = void 0;
|
|
75
|
-
const Zone_repository_1 = require("./Zone.repository");
|
|
76
|
-
const typedi_1 = __importStar(require("typedi"));
|
|
77
|
-
let ZoneService = (() => {
|
|
78
|
-
let _classDecorators = [(0, typedi_1.Service)()];
|
|
79
|
-
let _classDescriptor;
|
|
80
|
-
let _classExtraInitializers = [];
|
|
81
|
-
let _classThis;
|
|
82
|
-
var ZoneService = _classThis = class {
|
|
83
|
-
constructor() {
|
|
84
|
-
// Use dependency injection instead of creating new instance
|
|
85
|
-
this.zoneRepository = typedi_1.default.get(Zone_repository_1.ZoneRepository);
|
|
86
|
-
}
|
|
87
|
-
async getZone(zoneId) {
|
|
88
|
-
if (!zoneId) {
|
|
89
|
-
throw new Error("Zone ID is required");
|
|
90
|
-
}
|
|
91
|
-
return await this.zoneRepository.getZone(zoneId);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
__setFunctionName(_classThis, "ZoneService");
|
|
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
|
-
ZoneService = _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 ZoneService = _classThis;
|
|
103
|
-
})();
|
|
104
|
-
exports.ZoneService = ZoneService;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Example usage of IssueBuilder
|
|
3
|
-
* This file demonstrates various ways to use the IssueBuilder pattern
|
|
4
|
-
*/
|
|
5
|
-
export declare function createBasicIssue(): import("./issue.types").CreateIssueData;
|
|
6
|
-
export declare function createDeviceIssue(): import("./issue.types").CreateIssueData;
|
|
7
|
-
export declare function createSecurityIssue(): import("./issue.types").CreateIssueData;
|
|
8
|
-
export declare function createEnergyIssue(): import("./issue.types").CreateIssueData;
|
|
9
|
-
export declare function createHubIssue(): import("./issue.types").CreateIssueData;
|
|
10
|
-
export declare function createUserIssue(): import("./issue.types").CreateIssueData;
|
|
11
|
-
export declare function createPropertyIssue(): import("./issue.types").CreateIssueData;
|
|
12
|
-
export declare function createMaintenanceIssue(): import("./issue.types").CreateIssueData;
|
|
13
|
-
export declare function createUrgentIssue(): import("./issue.types").CreateIssueData;
|
|
14
|
-
export declare function createMultipleIssues(): import("./issue.types").CreateIssueData[];
|
|
15
|
-
export declare function createIssueWithDueDate(): import("./issue.types").CreateIssueData;
|
|
16
|
-
export declare function createUnassignedIssue(): import("./issue.types").CreateIssueData;
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBasicIssue = createBasicIssue;
|
|
4
|
-
exports.createDeviceIssue = createDeviceIssue;
|
|
5
|
-
exports.createSecurityIssue = createSecurityIssue;
|
|
6
|
-
exports.createEnergyIssue = createEnergyIssue;
|
|
7
|
-
exports.createHubIssue = createHubIssue;
|
|
8
|
-
exports.createUserIssue = createUserIssue;
|
|
9
|
-
exports.createPropertyIssue = createPropertyIssue;
|
|
10
|
-
exports.createMaintenanceIssue = createMaintenanceIssue;
|
|
11
|
-
exports.createUrgentIssue = createUrgentIssue;
|
|
12
|
-
exports.createMultipleIssues = createMultipleIssues;
|
|
13
|
-
exports.createIssueWithDueDate = createIssueWithDueDate;
|
|
14
|
-
exports.createUnassignedIssue = createUnassignedIssue;
|
|
15
|
-
const IssueBuilder_1 = require("./IssueBuilder");
|
|
16
|
-
const issue_types_1 = require("./issue.types");
|
|
17
|
-
/**
|
|
18
|
-
* Example usage of IssueBuilder
|
|
19
|
-
* This file demonstrates various ways to use the IssueBuilder pattern
|
|
20
|
-
*/
|
|
21
|
-
// Example 1: Basic issue creation
|
|
22
|
-
function createBasicIssue() {
|
|
23
|
-
const issueData = new IssueBuilder_1.IssueBuilder()
|
|
24
|
-
.setCategory(issue_types_1.IssuesCategory.OPERATIONS)
|
|
25
|
-
.setPropertyId("prop123")
|
|
26
|
-
.setTitle("Device Maintenance Required")
|
|
27
|
-
.setDescription("Device requires scheduled maintenance")
|
|
28
|
-
.setEntityId("device456")
|
|
29
|
-
.setEntityType(issue_types_1.EntityType.DEVICE)
|
|
30
|
-
.setPriority(issue_types_1.IssuePriority.HIGH)
|
|
31
|
-
.setAssignedTo("tech789")
|
|
32
|
-
.setCreatedBy("user123")
|
|
33
|
-
.setDueDate(new Date("2024-01-15"))
|
|
34
|
-
.build();
|
|
35
|
-
return issueData;
|
|
36
|
-
}
|
|
37
|
-
// Example 2: Using static factory methods
|
|
38
|
-
function createDeviceIssue() {
|
|
39
|
-
const issueData = IssueBuilder_1.IssueBuilder.createDeviceIssue("device123", "prop456")
|
|
40
|
-
.setCategory(issue_types_1.IssuesCategory.READINESS)
|
|
41
|
-
.setTitle("Device Firmware Update")
|
|
42
|
-
.setDescription("Device firmware update is available")
|
|
43
|
-
.setPriority(issue_types_1.IssuePriority.MEDIUM)
|
|
44
|
-
.setAssignedTo("admin")
|
|
45
|
-
.setCreatedBy("system")
|
|
46
|
-
.setDueDate(new Date("2024-01-20"))
|
|
47
|
-
.build();
|
|
48
|
-
return issueData;
|
|
49
|
-
}
|
|
50
|
-
// Example 3: Using predefined issue types
|
|
51
|
-
function createSecurityIssue() {
|
|
52
|
-
const issueData = IssueBuilder_1.IssueBuilder.createSecurityIssue()
|
|
53
|
-
.setPropertyId("prop789")
|
|
54
|
-
.setTitle("Security Breach Detected")
|
|
55
|
-
.setDescription("Unauthorized access attempt detected")
|
|
56
|
-
.setEntityId("user123")
|
|
57
|
-
.setEntityType(issue_types_1.EntityType.USER)
|
|
58
|
-
.setAssignedTo("security-team")
|
|
59
|
-
.setCreatedBy("security-system")
|
|
60
|
-
.setDueDate(new Date("2024-01-10"))
|
|
61
|
-
.build();
|
|
62
|
-
return issueData;
|
|
63
|
-
}
|
|
64
|
-
// Example 4: Creating energy issue
|
|
65
|
-
function createEnergyIssue() {
|
|
66
|
-
const issueData = IssueBuilder_1.IssueBuilder.createEnergyIssue()
|
|
67
|
-
.setPropertyId("prop101")
|
|
68
|
-
.setTitle("High Energy Consumption")
|
|
69
|
-
.setDescription("Energy usage is 20% above normal levels")
|
|
70
|
-
.setEntityId("zone456")
|
|
71
|
-
.setEntityType(issue_types_1.EntityType.COLLECTION)
|
|
72
|
-
.setAssignedTo("energy-manager")
|
|
73
|
-
.setCreatedBy("energy-monitor")
|
|
74
|
-
.setDueDate(new Date("2024-01-25"))
|
|
75
|
-
.build();
|
|
76
|
-
return issueData;
|
|
77
|
-
}
|
|
78
|
-
// Example 5: Creating hub issue
|
|
79
|
-
function createHubIssue() {
|
|
80
|
-
const issueData = IssueBuilder_1.IssueBuilder.createHubIssue("hub789", "prop202")
|
|
81
|
-
.setCategory(issue_types_1.IssuesCategory.OPERATIONS)
|
|
82
|
-
.setTitle("Hub Connection Lost")
|
|
83
|
-
.setDescription("Hub has lost connection to the network")
|
|
84
|
-
.setPriority(issue_types_1.IssuePriority.CRITICAL)
|
|
85
|
-
.setAssignedTo("network-admin")
|
|
86
|
-
.setCreatedBy("network-monitor")
|
|
87
|
-
.setDueDate(new Date("2024-01-05"))
|
|
88
|
-
.build();
|
|
89
|
-
return issueData;
|
|
90
|
-
}
|
|
91
|
-
// Example 6: Creating user-specific issue
|
|
92
|
-
function createUserIssue() {
|
|
93
|
-
const issueData = IssueBuilder_1.IssueBuilder.createUserIssue("user456", "prop303")
|
|
94
|
-
.setCategory(issue_types_1.IssuesCategory.SECURITY)
|
|
95
|
-
.setTitle("User Access Review Required")
|
|
96
|
-
.setDescription("User access permissions need review")
|
|
97
|
-
.setPriority(issue_types_1.IssuePriority.MEDIUM)
|
|
98
|
-
.setAssignedTo("hr-admin")
|
|
99
|
-
.setCreatedBy("access-control")
|
|
100
|
-
.setDueDate(new Date("2024-01-30"))
|
|
101
|
-
.build();
|
|
102
|
-
return issueData;
|
|
103
|
-
}
|
|
104
|
-
// Example 7: Creating property-specific issue
|
|
105
|
-
function createPropertyIssue() {
|
|
106
|
-
const issueData = IssueBuilder_1.IssueBuilder.createPropertyIssue("prop404")
|
|
107
|
-
.setCategory(issue_types_1.IssuesCategory.READINESS)
|
|
108
|
-
.setTitle("Property Maintenance Schedule")
|
|
109
|
-
.setDescription("Annual property maintenance is due")
|
|
110
|
-
.setPriority(issue_types_1.IssuePriority.LOW)
|
|
111
|
-
.setAssignedTo("property-manager")
|
|
112
|
-
.setCreatedBy("maintenance-system")
|
|
113
|
-
.setDueDate(new Date("2024-02-15"))
|
|
114
|
-
.build();
|
|
115
|
-
return issueData;
|
|
116
|
-
}
|
|
117
|
-
// Example 8: Creating maintenance issue
|
|
118
|
-
function createMaintenanceIssue() {
|
|
119
|
-
const issueData = IssueBuilder_1.IssueBuilder.createMaintenanceIssue("prop505", "device789", issue_types_1.EntityType.DEVICE)
|
|
120
|
-
.setTitle("Scheduled Device Maintenance")
|
|
121
|
-
.setDescription("Regular maintenance is scheduled for this device")
|
|
122
|
-
.setAssignedTo("technician")
|
|
123
|
-
.setCreatedBy("maintenance-scheduler")
|
|
124
|
-
.setDueDate(new Date("2024-01-12"))
|
|
125
|
-
.build();
|
|
126
|
-
return issueData;
|
|
127
|
-
}
|
|
128
|
-
// Example 9: Creating urgent issue
|
|
129
|
-
function createUrgentIssue() {
|
|
130
|
-
const issueData = IssueBuilder_1.IssueBuilder.createUrgentIssue("prop606", "hub123", issue_types_1.EntityType.HUB)
|
|
131
|
-
.setTitle("Critical Hub Failure")
|
|
132
|
-
.setDescription("Hub is experiencing critical failures")
|
|
133
|
-
.setAssignedTo("emergency-tech")
|
|
134
|
-
.setCreatedBy("monitoring-system")
|
|
135
|
-
.setDueDate(new Date("2024-01-03"))
|
|
136
|
-
.build();
|
|
137
|
-
return issueData;
|
|
138
|
-
}
|
|
139
|
-
// Example 10: Reusing builder instance
|
|
140
|
-
function createMultipleIssues() {
|
|
141
|
-
const builder = new IssueBuilder_1.IssueBuilder()
|
|
142
|
-
.setPropertyId("prop707")
|
|
143
|
-
.setCreatedBy("batch-processor");
|
|
144
|
-
const issue1 = builder
|
|
145
|
-
.setCategory(issue_types_1.IssuesCategory.OPERATIONS)
|
|
146
|
-
.setTitle("Device Temperature High")
|
|
147
|
-
.setDescription("Device temperature exceeds normal operating range")
|
|
148
|
-
.setEntityId("device789")
|
|
149
|
-
.setEntityType(issue_types_1.EntityType.DEVICE)
|
|
150
|
-
.setPriority(issue_types_1.IssuePriority.HIGH)
|
|
151
|
-
.setAssignedTo("tech-support")
|
|
152
|
-
.build();
|
|
153
|
-
const issue2 = builder
|
|
154
|
-
.reset()
|
|
155
|
-
.setPropertyId("prop707")
|
|
156
|
-
.setCategory(issue_types_1.IssuesCategory.ENERGY)
|
|
157
|
-
.setTitle("Low Battery Warning")
|
|
158
|
-
.setDescription("Device battery level is below 20%")
|
|
159
|
-
.setEntityId("device789")
|
|
160
|
-
.setEntityType(issue_types_1.EntityType.DEVICE)
|
|
161
|
-
.setPriority(issue_types_1.IssuePriority.MEDIUM)
|
|
162
|
-
.setAssignedTo("maintenance-team")
|
|
163
|
-
.setCreatedBy("batch-processor")
|
|
164
|
-
.build();
|
|
165
|
-
return [issue1, issue2];
|
|
166
|
-
}
|
|
167
|
-
// Example 11: Creating issue with due date calculation
|
|
168
|
-
function createIssueWithDueDate() {
|
|
169
|
-
const dueDate = new Date();
|
|
170
|
-
dueDate.setDate(dueDate.getDate() + 7); // Due in 7 days
|
|
171
|
-
const issueData = new IssueBuilder_1.IssueBuilder()
|
|
172
|
-
.setCategory(issue_types_1.IssuesCategory.READINESS)
|
|
173
|
-
.setPropertyId("prop808")
|
|
174
|
-
.setTitle("System Update Required")
|
|
175
|
-
.setDescription("System requires critical security update")
|
|
176
|
-
.setEntityType(issue_types_1.EntityType.PROPERTY)
|
|
177
|
-
.setPriority(issue_types_1.IssuePriority.HIGH)
|
|
178
|
-
.setAssignedTo("system-admin")
|
|
179
|
-
.setCreatedBy("update-manager")
|
|
180
|
-
.setDueDate(dueDate)
|
|
181
|
-
.build();
|
|
182
|
-
return issueData;
|
|
183
|
-
}
|
|
184
|
-
// Example 12: Creating issue without assignment
|
|
185
|
-
function createUnassignedIssue() {
|
|
186
|
-
const issueData = new IssueBuilder_1.IssueBuilder()
|
|
187
|
-
.setCategory(issue_types_1.IssuesCategory.OTHER)
|
|
188
|
-
.setPropertyId("prop909")
|
|
189
|
-
.setTitle("General Inquiry")
|
|
190
|
-
.setDescription("General inquiry about system functionality")
|
|
191
|
-
.setEntityType(issue_types_1.EntityType.PROPERTY)
|
|
192
|
-
.setPriority(issue_types_1.IssuePriority.LOW)
|
|
193
|
-
.setCreatedBy("user-inquiry")
|
|
194
|
-
.build();
|
|
195
|
-
return issueData;
|
|
196
|
-
}
|