dt-common-device 13.0.19 → 13.0.22

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 (165) hide show
  1. package/dist/cronicle/Cronicle.service.js +5 -2
  2. package/dist/cronicle/ICronicle.interface.d.ts +1 -0
  3. package/package.json +1 -1
  4. package/dist/admin/Admin.repository.d.ts +0 -7
  5. package/dist/admin/Admin.service.d.ts +0 -5
  6. package/dist/admin/index.d.ts +0 -1
  7. package/dist/alerts/AlertBuilder.example.d.ts +0 -11
  8. package/dist/alerts/AlertService.example.d.ts +0 -55
  9. package/dist/audit/AuditProperties.d.ts +0 -16
  10. package/dist/chronicle/Cronicle.service.d.ts +0 -9
  11. package/dist/chronicle/IChronicle.interface.d.ts +0 -14
  12. package/dist/chronicle/ICronicle.interface.d.ts +0 -15
  13. package/dist/chronicle/chronicle.service.d.ts +0 -4
  14. package/dist/chronicle/index.d.ts +0 -2
  15. package/dist/connection/Connection.repository.d.ts +0 -8
  16. package/dist/connection/Connection.service.d.ts +0 -8
  17. package/dist/connection/IConnection.d.ts +0 -28
  18. package/dist/connection/index.d.ts +0 -2
  19. package/dist/copilotQueue/examples/CopilotQueue.example.d.ts +0 -37
  20. package/dist/copilotQueue/examples/index.d.ts +0 -1
  21. package/dist/device/cloud/entities/CloudConnection.d.ts +0 -6
  22. package/dist/device/cloud/entities/CloudDevice.d.ts +0 -16
  23. package/dist/device/cloud/entities/CloudDeviceService.d.ts +0 -5
  24. package/dist/device/cloud/entities/DeviceFactory.d.ts +0 -7
  25. package/dist/device/cloud/entities/index.d.ts +0 -3
  26. package/dist/device/cloud/interface.d.ts +0 -101
  27. package/dist/device/cloud/interfaces/ICloudConnection.d.ts +0 -5
  28. package/dist/device/cloud/interfaces/ICloudDevice.d.ts +0 -9
  29. package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +0 -4
  30. package/dist/device/cloud/interfaces/IConnectionService.d.ts +0 -7
  31. package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +0 -7
  32. package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +0 -4
  33. package/dist/device/cloud/interfaces/IDeviceService.d.ts +0 -8
  34. package/dist/device/cloud/interfaces/IDevicesService.d.ts +0 -9
  35. package/dist/device/cloud/interfaces/IHubService.d.ts +0 -5
  36. package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +0 -4
  37. package/dist/device/cloud/interfaces/IRawDevice.d.ts +0 -17
  38. package/dist/device/cloud/interfaces/index.d.ts +0 -5
  39. package/dist/device/cloud/services/CloudDevice.service.d.ts +0 -5
  40. package/dist/device/cloud/services/Connection.service.d.ts +0 -8
  41. package/dist/device/cloud/services/Device.service.d.ts +0 -39
  42. package/dist/device/cloud/services/DeviceCloudService.d.ts +0 -42
  43. package/dist/device/cloud/services/DeviceHub.service.d.ts +0 -3
  44. package/dist/device/cloud/services/Hub.service.d.ts +0 -25
  45. package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +0 -38
  46. package/dist/device/cloud/services/SmartThingsDeviceService.js +0 -52
  47. package/dist/device/cloud/services/index.d.ts +0 -2
  48. package/dist/device/cloud/types.d.ts +0 -52
  49. package/dist/device/cloud/types.js +0 -15
  50. package/dist/device/index.d.ts +0 -4
  51. package/dist/device/local/entities/AlertBuilder.d.ts +0 -87
  52. package/dist/device/local/entities/AlertBuilder.example.d.ts +0 -11
  53. package/dist/device/local/entities/IssueBuilder.d.ts +0 -109
  54. package/dist/device/local/entities/IssueBuilder.example.d.ts +0 -16
  55. package/dist/device/local/entities/IssueBuilder.example.js +0 -196
  56. package/dist/device/local/entities/IssueBuilder.js +0 -237
  57. package/dist/device/local/entities/index.d.ts +0 -2
  58. package/dist/device/local/events/EventHandler.d.ts +0 -11
  59. package/dist/device/local/events/Events.d.ts +0 -54
  60. package/dist/device/local/events/index.d.ts +0 -2
  61. package/dist/device/local/handler/EventHandler.d.ts +0 -7
  62. package/dist/device/local/interface.d.ts +0 -0
  63. package/dist/device/local/interfaces/IConnection.d.ts +0 -26
  64. package/dist/device/local/interfaces/IDevice.d.ts +0 -68
  65. package/dist/device/local/interfaces/IDtDevice.d.ts +0 -16
  66. package/dist/device/local/interfaces/IHub.d.ts +0 -46
  67. package/dist/device/local/interfaces/IProperty.d.ts +0 -29
  68. package/dist/device/local/interfaces/ISchedule.d.ts +0 -25
  69. package/dist/device/local/interfaces/index.d.ts +0 -3
  70. package/dist/device/local/models/Alert.model.d.ts +0 -28
  71. package/dist/device/local/models/Issue.model.d.ts +0 -28
  72. package/dist/device/local/repository/Alert.repository.d.ts +0 -106
  73. package/dist/device/local/repository/Connection.repository.d.ts +0 -8
  74. package/dist/device/local/repository/Device.repository.d.ts +0 -30
  75. package/dist/device/local/repository/Hub.repository.d.ts +0 -13
  76. package/dist/device/local/repository/Issue.repository.d.ts +0 -113
  77. package/dist/device/local/repository/Property.repository.d.ts +0 -8
  78. package/dist/device/local/repository/Property.repository.js +0 -95
  79. package/dist/device/local/repository/Schedule.repository.d.ts +0 -9
  80. package/dist/device/local/repository/Schedule.repository.js +0 -109
  81. package/dist/device/local/services/Alert.service.d.ts +0 -137
  82. package/dist/device/local/services/AlertService.example.d.ts +0 -55
  83. package/dist/device/local/services/Connection.service.d.ts +0 -8
  84. package/dist/device/local/services/Device.service.d.ts +0 -40
  85. package/dist/device/local/services/DeviceHub.service.d.ts +0 -11
  86. package/dist/device/local/services/Hub.service.d.ts +0 -12
  87. package/dist/device/local/services/Issue.service.d.ts +0 -168
  88. package/dist/device/local/services/Issue.service.js +0 -642
  89. package/dist/device/local/services/IssueService.example.d.ts +0 -68
  90. package/dist/device/local/services/IssueService.example.js +0 -177
  91. package/dist/device/local/services/Property.service.d.ts +0 -8
  92. package/dist/device/local/services/Property.service.js +0 -36
  93. package/dist/device/local/services/Schedule.service.d.ts +0 -9
  94. package/dist/device/local/services/Schedule.service.js +0 -26
  95. package/dist/device/local/services/index.d.ts +0 -3
  96. package/dist/entities/accessGroup/AccessGroup.repository.d.ts +0 -5
  97. package/dist/entities/accessGroup/AccessGroup.service.d.ts +0 -5
  98. package/dist/entities/accessGroup/IAccessGroup.d.ts +0 -14
  99. package/dist/entities/accessGroup/index.d.ts +0 -2
  100. package/dist/entities/device/local/repository/DeviceProfile.repository.d.ts +0 -5
  101. package/dist/entities/guest/Guest.repository.d.ts +0 -6
  102. package/dist/entities/guest/Guest.service.d.ts +0 -6
  103. package/dist/entities/guest/IGuest.d.ts +0 -12
  104. package/dist/entities/guest/index.d.ts +0 -2
  105. package/dist/entities/schedules/ISchedule.d.ts +0 -14
  106. package/dist/entities/schedules/Schedule.repository.d.ts +0 -6
  107. package/dist/entities/schedules/Schedule.repository.js +0 -74
  108. package/dist/entities/schedules/Schedule.service.d.ts +0 -6
  109. package/dist/entities/schedules/Schedule.service.js +0 -104
  110. package/dist/entities/schedules/index.d.ts +0 -2
  111. package/dist/entities/user/IUser.d.ts +0 -15
  112. package/dist/entities/user/IUser.js +0 -2
  113. package/dist/entities/user/User.repository.d.ts +0 -5
  114. package/dist/entities/user/User.repository.js +0 -68
  115. package/dist/entities/user/User.service.d.ts +0 -6
  116. package/dist/entities/user/User.service.js +0 -103
  117. package/dist/entities/zone/IZone.d.ts +0 -10
  118. package/dist/entities/zone/IZone.js +0 -2
  119. package/dist/entities/zone/Zone.repository.d.ts +0 -6
  120. package/dist/entities/zone/Zone.repository.js +0 -77
  121. package/dist/entities/zone/Zone.service.d.ts +0 -6
  122. package/dist/entities/zone/Zone.service.js +0 -104
  123. package/dist/entities/zone/index.d.ts +0 -2
  124. package/dist/issues/IssueBuilder.example.d.ts +0 -16
  125. package/dist/issues/IssueBuilder.example.js +0 -196
  126. package/dist/issues/IssueService.example.d.ts +0 -68
  127. package/dist/issues/IssueService.example.js +0 -292
  128. package/dist/pms/IPms.d.ts +0 -6
  129. package/dist/pms/index.d.ts +0 -1
  130. package/dist/pms/webhookQueue/examples/index.d.ts +0 -2
  131. package/dist/pms/webhookQueue/examples/pms-integration.d.ts +0 -65
  132. package/dist/pms/webhookQueue/examples/pms-integration.js +0 -254
  133. package/dist/pms/webhookQueue/examples/usage.d.ts +0 -7
  134. package/dist/pms/webhookQueue/examples/usage.js +0 -175
  135. package/dist/pms/webhookQueue/index.d.ts +0 -3
  136. package/dist/pms/webhookQueue/interfaces/IWebhookQueue.d.ts +0 -33
  137. package/dist/pms/webhookQueue/interfaces/IWebhookQueue.js +0 -2
  138. package/dist/pms/webhookQueue/interfaces/IWebhookWorker.d.ts +0 -38
  139. package/dist/pms/webhookQueue/interfaces/IWebhookWorker.js +0 -2
  140. package/dist/pms/webhookQueue/interfaces/index.d.ts +0 -1
  141. package/dist/pms/webhookQueue/services/WebhookQueueFactory.d.ts +0 -38
  142. package/dist/pms/webhookQueue/services/WebhookQueueFactory.js +0 -131
  143. package/dist/pms/webhookQueue/services/WebhookQueueIntegration.d.ts +0 -70
  144. package/dist/pms/webhookQueue/services/WebhookQueueIntegration.js +0 -207
  145. package/dist/pms/webhookQueue/services/WebhookQueueService.d.ts +0 -45
  146. package/dist/pms/webhookQueue/services/WebhookQueueService.js +0 -270
  147. package/dist/pms/webhookQueue/services/WebhookWorker.d.ts +0 -37
  148. package/dist/pms/webhookQueue/services/WebhookWorker.js +0 -201
  149. package/dist/pms/webhookQueue/services/index.d.ts +0 -1
  150. package/dist/pms/webhookQueue/types/index.d.ts +0 -1
  151. package/dist/pms/webhookQueue/types/webhook.types.d.ts +0 -39
  152. package/dist/pms/webhookQueue/types/webhook.types.js +0 -2
  153. package/dist/property/IProperty.d.ts +0 -29
  154. package/dist/property/Property.repository.d.ts +0 -8
  155. package/dist/property/Property.repository.js +0 -109
  156. package/dist/property/Property.service.d.ts +0 -8
  157. package/dist/property/Property.service.js +0 -124
  158. package/dist/property/index.d.ts +0 -2
  159. package/dist/queue/interfaces/IHttpRequestJob.d.ts +0 -9
  160. package/dist/types/alert.types.d.ts +0 -57
  161. package/dist/types/config.types.d.ts +0 -19
  162. package/dist/types/index.d.ts +0 -3
  163. package/dist/types/issue.types.d.ts +0 -90
  164. package/dist/types/issue.types.js +0 -40
  165. package/dist/utils/http-utils.d.ts +0 -13
@@ -1,68 +0,0 @@
1
- import { IssueService } from "./Issue.service";
2
- /**
3
- * Example usage of the updated IssueService with IssueBuilder integration
4
- * This file demonstrates various ways to use the IssueService with the new IssueBuilder
5
- */
6
- export declare class IssueServiceExample {
7
- private readonly issueService;
8
- constructor(issueService: IssueService);
9
- /**
10
- * Example 1: Using the updated createIssue method with IssueBuilder
11
- */
12
- createIssueWithBuilder(): Promise<import("./issue.types").IssueDocument>;
13
- /**
14
- * Example 2: Using convenience methods for specific issue types
15
- */
16
- createSpecificIssues(): Promise<{
17
- readinessIssue: import("./issue.types").IssueDocument;
18
- operationsIssue: import("./issue.types").IssueDocument;
19
- securityIssue: import("./issue.types").IssueDocument;
20
- energyIssue: import("./issue.types").IssueDocument;
21
- }>;
22
- /**
23
- * Example 3: Using device-specific issue methods
24
- */
25
- createDeviceIssues(): Promise<{
26
- deviceIssue1: import("./issue.types").IssueDocument;
27
- deviceIssue2: import("./issue.types").IssueDocument;
28
- }>;
29
- /**
30
- * Example 4: Using hub-specific issue methods
31
- */
32
- createHubIssues(): Promise<{
33
- hubIssue1: import("./issue.types").IssueDocument;
34
- hubIssue2: import("./issue.types").IssueDocument;
35
- }>;
36
- /**
37
- * Example 5: Using user-specific issue methods
38
- */
39
- createUserIssues(): Promise<{
40
- userIssue: import("./issue.types").IssueDocument;
41
- }>;
42
- /**
43
- * Example 6: Using maintenance and urgent issue methods
44
- */
45
- createMaintenanceAndUrgentIssues(): Promise<{
46
- maintenanceIssue: import("./issue.types").IssueDocument;
47
- urgentIssue: import("./issue.types").IssueDocument;
48
- }>;
49
- /**
50
- * Example 7: Using static factory methods with IssueBuilder
51
- */
52
- createIssuesWithStaticMethods(): Promise<{
53
- issue1: import("./issue.types").IssueDocument;
54
- issue2: import("./issue.types").IssueDocument;
55
- }>;
56
- /**
57
- * Example 8: Creating multiple issues efficiently
58
- */
59
- createMultipleIssues(): Promise<import("./issue.types").IssueDocument[]>;
60
- /**
61
- * Example 9: Creating issue with due date calculation
62
- */
63
- createIssueWithDueDate(): Promise<import("./issue.types").IssueDocument>;
64
- /**
65
- * Example 10: Backward compatibility - still works with CreateIssueData
66
- */
67
- createIssueWithLegacyData(): Promise<import("./issue.types").IssueDocument>;
68
- }
@@ -1,292 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IssueServiceExample = void 0;
4
- const constants_1 = require("../constants");
5
- const IssueBuilder_1 = require("./IssueBuilder");
6
- const issue_types_1 = require("./issue.types");
7
- /**
8
- * Example usage of the updated IssueService with IssueBuilder integration
9
- * This file demonstrates various ways to use the IssueService with the new IssueBuilder
10
- */
11
- class IssueServiceExample {
12
- constructor(issueService) {
13
- this.issueService = issueService;
14
- }
15
- /**
16
- * Example 1: Using the updated createIssue method with IssueBuilder
17
- */
18
- async createIssueWithBuilder() {
19
- const issueBuilder = new IssueBuilder_1.IssueBuilder()
20
- .setCategory(issue_types_1.IssuesCategory.OPERATIONS)
21
- .setPropertyId("prop123")
22
- .setTitle("Device Maintenance Required")
23
- .setDescription("Device requires scheduled maintenance")
24
- .setEntityId("device456")
25
- .setEntityType(issue_types_1.EntityType.DEVICE)
26
- .setPriority(issue_types_1.IssuePriority.HIGH)
27
- .setAssignedTo("tech789")
28
- .setCreatedBy("user123")
29
- .setDueDate(new Date("2024-01-15"));
30
- // Pass the IssueBuilder directly to createIssue
31
- const issue = await this.issueService.createIssue(issueBuilder);
32
- return issue;
33
- }
34
- /**
35
- * Example 2: Using convenience methods for specific issue types
36
- */
37
- async createSpecificIssues() {
38
- // Create a readiness issue
39
- const readinessIssue = await this.issueService.createReadinessIssue({
40
- propertyId: "prop123",
41
- title: "System Maintenance Required",
42
- description: "System maintenance is scheduled for tonight",
43
- createdBy: "admin",
44
- entityId: "system456",
45
- entityType: issue_types_1.EntityType.PROPERTY,
46
- assignedTo: "maintenance-team",
47
- dueDate: new Date("2024-01-20"),
48
- category: issue_types_1.IssuesCategory.READINESS,
49
- });
50
- // Create an operations issue
51
- const operationsIssue = await this.issueService.createOperationsIssue({
52
- propertyId: "prop123",
53
- title: "Device Temperature High",
54
- description: "Device temperature exceeds normal operating range",
55
- createdBy: "monitor",
56
- entityId: "device789",
57
- entityType: issue_types_1.EntityType.DEVICE,
58
- assignedTo: "tech-support",
59
- dueDate: new Date("2024-01-10"),
60
- category: issue_types_1.IssuesCategory.OPERATIONS,
61
- });
62
- // Create a security issue
63
- const securityIssue = await this.issueService.createSecurityIssue({
64
- propertyId: "prop123",
65
- title: "Unauthorized Access Attempt",
66
- description: "Multiple failed login attempts detected",
67
- createdBy: "security-system",
68
- entityId: "user123",
69
- entityType: issue_types_1.EntityType.USER,
70
- assignedTo: "security-team",
71
- dueDate: new Date("2024-01-05"),
72
- category: issue_types_1.IssuesCategory.SECURITY,
73
- });
74
- // Create an energy issue
75
- const energyIssue = await this.issueService.createEnergyIssue({
76
- propertyId: "prop123",
77
- title: "High Energy Consumption",
78
- description: "Energy usage is 20% above normal levels",
79
- createdBy: "energy-monitor",
80
- entityId: "zone456",
81
- entityType: issue_types_1.EntityType.COLLECTION,
82
- assignedTo: "energy-manager",
83
- dueDate: new Date("2024-01-25"),
84
- category: issue_types_1.IssuesCategory.ENERGY,
85
- });
86
- return { readinessIssue, operationsIssue, securityIssue, energyIssue };
87
- }
88
- /**
89
- * Example 3: Using device-specific issue methods
90
- */
91
- async createDeviceIssues() {
92
- // Create a device issue with default category and priority
93
- const deviceIssue1 = await this.issueService.createDeviceIssue({
94
- entityId: "device123",
95
- propertyId: "prop456",
96
- title: "Device Battery Low",
97
- description: "Device battery level is below 20%",
98
- createdBy: constants_1.Source.CLOUD_EVENT,
99
- category: issue_types_1.IssuesCategory.READINESS,
100
- priority: issue_types_1.IssuePriority.MEDIUM,
101
- assignedTo: "maintenance-team",
102
- dueDate: new Date("2024-01-12"),
103
- entityType: issue_types_1.EntityType.DEVICE,
104
- });
105
- // Create a device issue with custom category and priority
106
- const deviceIssue2 = await this.issueService.createDeviceIssue({
107
- entityId: "device789",
108
- propertyId: "prop456",
109
- title: "Device Firmware Update Available",
110
- description: "New firmware version is available for installation",
111
- createdBy: constants_1.Source.CLOUD_EVENT,
112
- category: issue_types_1.IssuesCategory.READINESS,
113
- priority: issue_types_1.IssuePriority.MEDIUM,
114
- assignedTo: "admin",
115
- dueDate: new Date("2024-01-20"),
116
- entityType: issue_types_1.EntityType.DEVICE,
117
- });
118
- return { deviceIssue1, deviceIssue2 };
119
- }
120
- /**
121
- * Example 4: Using hub-specific issue methods
122
- */
123
- async createHubIssues() {
124
- // Create a hub issue with default settings
125
- const hubIssue1 = await this.issueService.createHubIssue({
126
- entityId: "hub123",
127
- propertyId: "prop456",
128
- title: "Hub Connection Lost",
129
- description: "Hub has lost connection to the network",
130
- createdBy: "network-monitor",
131
- category: issue_types_1.IssuesCategory.READINESS,
132
- priority: issue_types_1.IssuePriority.MEDIUM,
133
- assignedTo: "network-admin",
134
- dueDate: new Date("2024-01-05"),
135
- entityType: issue_types_1.EntityType.HUB,
136
- });
137
- // Create a hub issue with custom settings
138
- const hubIssue2 = await this.issueService.createHubIssue({
139
- entityId: "hub789",
140
- propertyId: "prop456",
141
- title: "Hub Maintenance Required",
142
- description: "Hub requires scheduled maintenance",
143
- createdBy: "maintenance-system",
144
- category: issue_types_1.IssuesCategory.READINESS,
145
- priority: issue_types_1.IssuePriority.LOW,
146
- assignedTo: "technician",
147
- dueDate: new Date("2024-01-15"),
148
- entityType: issue_types_1.EntityType.HUB,
149
- });
150
- return { hubIssue1, hubIssue2 };
151
- }
152
- /**
153
- * Example 5: Using user-specific issue methods
154
- */
155
- async createUserIssues() {
156
- // Create a user issue
157
- const userIssue = await this.issueService.createUserIssue({
158
- entityId: "user456",
159
- propertyId: "prop303",
160
- title: "User Access Review Required",
161
- description: "User access permissions need review",
162
- createdBy: "access-control",
163
- category: issue_types_1.IssuesCategory.SECURITY,
164
- priority: issue_types_1.IssuePriority.MEDIUM,
165
- assignedTo: "hr-admin",
166
- dueDate: new Date("2024-01-30"),
167
- entityType: issue_types_1.EntityType.USER,
168
- });
169
- return { userIssue };
170
- }
171
- /**
172
- * Example 6: Using maintenance and urgent issue methods
173
- */
174
- async createMaintenanceAndUrgentIssues() {
175
- // Create a maintenance issue
176
- const maintenanceIssue = await this.issueService.createMaintenanceIssue({
177
- propertyId: "prop505",
178
- title: "Scheduled Device Maintenance",
179
- description: "Regular maintenance is scheduled for this device",
180
- createdBy: "maintenance-scheduler",
181
- entityId: "device789",
182
- entityType: issue_types_1.EntityType.DEVICE,
183
- assignedTo: "technician",
184
- dueDate: new Date("2024-01-12"),
185
- category: issue_types_1.IssuesCategory.READINESS,
186
- priority: issue_types_1.IssuePriority.MEDIUM,
187
- });
188
- // Create an urgent issue
189
- const urgentIssue = await this.issueService.createUrgentIssue({
190
- propertyId: "prop606",
191
- title: "Critical Hub Failure",
192
- description: "Hub is experiencing critical failures",
193
- createdBy: "monitoring-system",
194
- entityId: "hub123",
195
- entityType: issue_types_1.EntityType.HUB,
196
- assignedTo: "emergency-tech",
197
- dueDate: new Date("2024-01-03"),
198
- category: issue_types_1.IssuesCategory.READINESS,
199
- priority: issue_types_1.IssuePriority.CRITICAL,
200
- });
201
- return { maintenanceIssue, urgentIssue };
202
- }
203
- /**
204
- * Example 7: Using static factory methods with IssueBuilder
205
- */
206
- async createIssuesWithStaticMethods() {
207
- // Create a device issue using static factory method
208
- const deviceIssue = IssueBuilder_1.IssueBuilder.createDeviceIssue("device123", "prop456")
209
- .setCategory(issue_types_1.IssuesCategory.OPERATIONS)
210
- .setTitle("Device Offline")
211
- .setDescription("Device has been offline for more than 5 minutes")
212
- .setPriority(issue_types_1.IssuePriority.HIGH)
213
- .setAssignedTo("tech-support")
214
- .setCreatedBy("monitor")
215
- .setDueDate(new Date("2024-01-10"));
216
- const issue1 = await this.issueService.createIssue(deviceIssue);
217
- // Create a hub issue using static factory method
218
- const hubIssue = IssueBuilder_1.IssueBuilder.createHubIssue("hub789", "prop202")
219
- .setCategory(issue_types_1.IssuesCategory.SECURITY)
220
- .setTitle("Hub Security Breach")
221
- .setDescription("Unauthorized access attempt detected on hub")
222
- .setPriority(issue_types_1.IssuePriority.CRITICAL)
223
- .setAssignedTo("security-team")
224
- .setCreatedBy("security-system")
225
- .setDueDate(new Date("2024-01-05"));
226
- const issue2 = await this.issueService.createIssue(hubIssue);
227
- return { issue1, issue2 };
228
- }
229
- /**
230
- * Example 8: Creating multiple issues efficiently
231
- */
232
- async createMultipleIssues() {
233
- const issues = [];
234
- // Create multiple device issues efficiently
235
- const deviceIds = ["device1", "device2", "device3"];
236
- const propertyId = "prop123";
237
- for (const deviceId of deviceIds) {
238
- const issueBuilder = IssueBuilder_1.IssueBuilder.createDeviceIssue(deviceId, propertyId)
239
- .setCategory(issue_types_1.IssuesCategory.OPERATIONS)
240
- .setTitle(`Device ${deviceId} Status`)
241
- .setDescription(`Status check for device ${deviceId}`)
242
- .setPriority(issue_types_1.IssuePriority.MEDIUM)
243
- .setAssignedTo("batch-processor")
244
- .setCreatedBy("batch-processor")
245
- .setDueDate(new Date("2024-01-15"));
246
- const issue = await this.issueService.createIssue(issueBuilder);
247
- issues.push(issue);
248
- }
249
- return issues;
250
- }
251
- /**
252
- * Example 9: Creating issue with due date calculation
253
- */
254
- async createIssueWithDueDate() {
255
- const dueDate = new Date();
256
- dueDate.setDate(dueDate.getDate() + 7); // Due in 7 days
257
- const issueBuilder = new IssueBuilder_1.IssueBuilder()
258
- .setCategory(issue_types_1.IssuesCategory.READINESS)
259
- .setPropertyId("prop808")
260
- .setTitle("System Update Required")
261
- .setDescription("System requires critical security update")
262
- .setEntityType(issue_types_1.EntityType.PROPERTY)
263
- .setPriority(issue_types_1.IssuePriority.HIGH)
264
- .setAssignedTo("system-admin")
265
- .setCreatedBy("update-manager")
266
- .setDueDate(dueDate);
267
- const issue = await this.issueService.createIssue(issueBuilder);
268
- return issue;
269
- }
270
- /**
271
- * Example 10: Backward compatibility - still works with CreateIssueData
272
- */
273
- async createIssueWithLegacyData() {
274
- const issueData = {
275
- category: issue_types_1.IssuesCategory.OPERATIONS,
276
- propertyId: "prop123",
277
- title: "Legacy Issue",
278
- description: "This issue was created using the old CreateIssueData format",
279
- entityId: "device456",
280
- entityType: issue_types_1.EntityType.DEVICE,
281
- priority: issue_types_1.IssuePriority.MEDIUM,
282
- assignedTo: "tech-support",
283
- createdBy: "legacy-system",
284
- dueDate: new Date("2024-01-20"),
285
- source: constants_1.Source.CLOUD_EVENT,
286
- };
287
- // This still works with the updated createIssue method
288
- const issue = await this.issueService.createIssue(issueData);
289
- return issue;
290
- }
291
- }
292
- exports.IssueServiceExample = IssueServiceExample;
@@ -1,6 +0,0 @@
1
- export declare enum PmsProvider {
2
- Cloudbeds = "Cloudbeds",
3
- StayNTouch = "StayNTouch",
4
- HotelKey = "HotelKey",
5
- Yanolja = "Yanolja"
6
- }
@@ -1 +0,0 @@
1
- export * from "./webhookQueue";
@@ -1,2 +0,0 @@
1
- export * from "./pms-integration";
2
- export * from "./usage";
@@ -1,65 +0,0 @@
1
- export declare class ExamplePmsServiceWithQueue {
2
- private webhookQueueIntegration;
3
- constructor();
4
- /**
5
- * Initialize the webhook queue system
6
- */
7
- initializeWebhookQueue(): Promise<void>;
8
- /**
9
- * Your existing webhook processing method
10
- * This will be called by the queue worker
11
- */
12
- processWebhook(webhookData: any, pmsType: string): Promise<any>;
13
- /**
14
- * Modified webhook handler that queues webhooks instead of processing directly
15
- */
16
- handleWebhookWithQueue(webhookData: any, pmsType: string, propertyId: string): Promise<string>;
17
- /**
18
- * Get webhook queue status for monitoring
19
- */
20
- getWebhookQueueStatus(propertyId: string, pmsType: string): Promise<import("../types/webhook.types").IWebhookQueueStatus>;
21
- /**
22
- * Get all webhook queue statuses for a property
23
- */
24
- getAllWebhookQueueStatuses(propertyId: string): Promise<Record<string, import("../types/webhook.types").IWebhookQueueStatus>>;
25
- /**
26
- * Clean up old webhook jobs
27
- */
28
- cleanupWebhookQueues(propertyId: string): Promise<void>;
29
- /**
30
- * Shutdown webhook queue system
31
- */
32
- shutdownWebhookQueue(): Promise<void>;
33
- private extractPropertyIdFromWebhook;
34
- private simulateWebhookProcessing;
35
- }
36
- export declare class ExamplePmsController {
37
- private pmsService;
38
- constructor();
39
- /**
40
- * Initialize the service (call this when your app starts)
41
- */
42
- initialize(): Promise<void>;
43
- /**
44
- * Modified webhook endpoint that uses the queue
45
- */
46
- handleWebhook(payload: any, pmsType: string): Promise<any>;
47
- /**
48
- * Get webhook queue status
49
- */
50
- getWebhookQueueStatus(propertyId: string, pmsType: string): Promise<import("../types/webhook.types").IWebhookQueueStatus>;
51
- /**
52
- * Get all webhook queue statuses for a property
53
- */
54
- getAllWebhookQueueStatuses(propertyId: string): Promise<Record<string, import("../types/webhook.types").IWebhookQueueStatus>>;
55
- /**
56
- * Cleanup webhook queues
57
- */
58
- cleanupWebhookQueues(propertyId: string): Promise<void>;
59
- /**
60
- * Shutdown the service
61
- */
62
- shutdown(): Promise<void>;
63
- private extractPropertyIdFromPayload;
64
- }
65
- export declare function exampleUsage(): Promise<void>;