@oneuptime/common 11.0.10 → 11.0.13

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 (148) hide show
  1. package/Models/DatabaseModels/CephCluster.ts +134 -0
  2. package/Models/DatabaseModels/CloudResource.ts +134 -0
  3. package/Models/DatabaseModels/DockerHost.ts +134 -0
  4. package/Models/DatabaseModels/DockerSwarmCluster.ts +134 -0
  5. package/Models/DatabaseModels/Host.ts +134 -0
  6. package/Models/DatabaseModels/KubernetesCluster.ts +134 -0
  7. package/Models/DatabaseModels/PodmanHost.ts +134 -0
  8. package/Models/DatabaseModels/ProxmoxCluster.ts +134 -0
  9. package/Models/DatabaseModels/RumApplication.ts +134 -0
  10. package/Models/DatabaseModels/ServerlessFunction.ts +134 -0
  11. package/Models/DatabaseModels/Service.ts +134 -0
  12. package/Models/DatabaseModels/StatusPage.ts +0 -42
  13. package/README.md +1 -1
  14. package/Scripts/generate-service-worker.js +46 -36
  15. package/Server/Infrastructure/Postgres/DataSourceOptions.ts +4 -2
  16. package/Server/Infrastructure/Postgres/SchemaMigrations/1782600000000-AddArchiveToResources.ts +331 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/1782700000000-RemoveDeprecatedEnableSubscribersFromStatusPage.ts +35 -0
  18. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  19. package/Server/Infrastructure/Postgres/SchemaMigrations/Readme.md +3 -3
  20. package/Server/Infrastructure/Queue.ts +122 -0
  21. package/Server/Services/AIAgentService.ts +9 -4
  22. package/Server/Services/AnalyticsDatabaseService.ts +89 -56
  23. package/Server/Services/CephClusterService.ts +6 -4
  24. package/Server/Services/CloudResourceService.ts +6 -4
  25. package/Server/Services/DatabaseService.ts +126 -0
  26. package/Server/Services/DockerHostService.ts +6 -4
  27. package/Server/Services/DockerSwarmClusterService.ts +6 -4
  28. package/Server/Services/HostService.ts +6 -4
  29. package/Server/Services/KubernetesClusterService.ts +6 -4
  30. package/Server/Services/PodmanHostService.ts +6 -4
  31. package/Server/Services/ProbeService.ts +10 -4
  32. package/Server/Services/ProxmoxClusterService.ts +6 -4
  33. package/Server/Services/RumApplicationService.ts +6 -4
  34. package/Server/Services/ServerlessFunctionService.ts +6 -4
  35. package/Server/Services/ServiceService.ts +17 -4
  36. package/Server/Types/Markdown.ts +103 -0
  37. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +5 -2
  38. package/Server/Utils/CodeRepository/CodeRepository.ts +78 -0
  39. package/Server/Utils/Execute.ts +6 -0
  40. package/Server/Utils/Logger.ts +66 -0
  41. package/Server/Utils/Monitor/MonitorResource.ts +24 -10
  42. package/Server/Utils/Telemetry/EntityRegistry.ts +10 -5
  43. package/Server/Utils/Workspace/Slack/app-manifest.json +86 -92
  44. package/Tests/Server/Services/UpdateColumnsByIdWithoutHooks.test.ts +154 -0
  45. package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +87 -9
  46. package/Tests/Types/DiskSize.test.ts +49 -0
  47. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.ts +11 -0
  48. package/Types/Icon/IconProp.ts +1 -0
  49. package/Types/Monitor/MonitorType.ts +15 -31
  50. package/Types/Monitor/schema.json +32 -35
  51. package/UI/Components/BulkUpdate/BulkArchiveActions.tsx +150 -0
  52. package/UI/Components/Icon/Icon.tsx +42 -126
  53. package/UI/Components/Navbar/NavBarMenuModal.tsx +2 -5
  54. package/UI/esbuild-config.js +136 -110
  55. package/Utils/ClientAPI/README.md +1 -1
  56. package/build/dist/Models/DatabaseModels/CephCluster.js +136 -0
  57. package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -1
  58. package/build/dist/Models/DatabaseModels/CloudResource.js +136 -0
  59. package/build/dist/Models/DatabaseModels/CloudResource.js.map +1 -1
  60. package/build/dist/Models/DatabaseModels/DockerHost.js +136 -0
  61. package/build/dist/Models/DatabaseModels/DockerHost.js.map +1 -1
  62. package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js +136 -0
  63. package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js.map +1 -1
  64. package/build/dist/Models/DatabaseModels/Host.js +136 -0
  65. package/build/dist/Models/DatabaseModels/Host.js.map +1 -1
  66. package/build/dist/Models/DatabaseModels/KubernetesCluster.js +136 -0
  67. package/build/dist/Models/DatabaseModels/KubernetesCluster.js.map +1 -1
  68. package/build/dist/Models/DatabaseModels/PodmanHost.js +136 -0
  69. package/build/dist/Models/DatabaseModels/PodmanHost.js.map +1 -1
  70. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +136 -0
  71. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -1
  72. package/build/dist/Models/DatabaseModels/RumApplication.js +136 -0
  73. package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
  74. package/build/dist/Models/DatabaseModels/ServerlessFunction.js +136 -0
  75. package/build/dist/Models/DatabaseModels/ServerlessFunction.js.map +1 -1
  76. package/build/dist/Models/DatabaseModels/Service.js +136 -0
  77. package/build/dist/Models/DatabaseModels/Service.js.map +1 -1
  78. package/build/dist/Models/DatabaseModels/StatusPage.js +0 -44
  79. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  80. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +4 -2
  81. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
  82. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1782600000000-AddArchiveToResources.js +120 -0
  83. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1782600000000-AddArchiveToResources.js.map +1 -0
  84. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1782700000000-RemoveDeprecatedEnableSubscribersFromStatusPage.js +28 -0
  85. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1782700000000-RemoveDeprecatedEnableSubscribersFromStatusPage.js.map +1 -0
  86. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  87. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  88. package/build/dist/Server/Infrastructure/Queue.js +63 -0
  89. package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
  90. package/build/dist/Server/Services/AIAgentService.js +9 -4
  91. package/build/dist/Server/Services/AIAgentService.js.map +1 -1
  92. package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -17
  93. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  94. package/build/dist/Server/Services/CephClusterService.js +6 -4
  95. package/build/dist/Server/Services/CephClusterService.js.map +1 -1
  96. package/build/dist/Server/Services/CloudResourceService.js +6 -4
  97. package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
  98. package/build/dist/Server/Services/DatabaseService.js +101 -0
  99. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  100. package/build/dist/Server/Services/DockerHostService.js +6 -4
  101. package/build/dist/Server/Services/DockerHostService.js.map +1 -1
  102. package/build/dist/Server/Services/DockerSwarmClusterService.js +6 -4
  103. package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
  104. package/build/dist/Server/Services/HostService.js +6 -4
  105. package/build/dist/Server/Services/HostService.js.map +1 -1
  106. package/build/dist/Server/Services/KubernetesClusterService.js +6 -4
  107. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  108. package/build/dist/Server/Services/PodmanHostService.js +6 -4
  109. package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
  110. package/build/dist/Server/Services/ProbeService.js +10 -4
  111. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  112. package/build/dist/Server/Services/ProxmoxClusterService.js +6 -4
  113. package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
  114. package/build/dist/Server/Services/RumApplicationService.js +6 -4
  115. package/build/dist/Server/Services/RumApplicationService.js.map +1 -1
  116. package/build/dist/Server/Services/ServerlessFunctionService.js +6 -4
  117. package/build/dist/Server/Services/ServerlessFunctionService.js.map +1 -1
  118. package/build/dist/Server/Services/ServiceService.js +17 -4
  119. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  120. package/build/dist/Server/Types/Markdown.js +87 -0
  121. package/build/dist/Server/Types/Markdown.js.map +1 -1
  122. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +3 -0
  123. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  124. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +60 -0
  125. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
  126. package/build/dist/Server/Utils/Execute.js +1 -3
  127. package/build/dist/Server/Utils/Execute.js.map +1 -1
  128. package/build/dist/Server/Utils/Logger.js +49 -1
  129. package/build/dist/Server/Utils/Logger.js.map +1 -1
  130. package/build/dist/Server/Utils/Monitor/MonitorResource.js +24 -10
  131. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  132. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +10 -5
  133. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  134. package/build/dist/Server/Utils/Workspace/Slack/app-manifest.json +3 -9
  135. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js.map +1 -1
  136. package/build/dist/Types/Icon/IconProp.js +1 -0
  137. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  138. package/build/dist/Types/Monitor/MonitorType.js +15 -31
  139. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  140. package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js +96 -0
  141. package/build/dist/UI/Components/BulkUpdate/BulkArchiveActions.js.map +1 -0
  142. package/build/dist/UI/Components/Icon/Icon.js +17 -41
  143. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  144. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -3
  145. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
  146. package/jest.config.json +47 -66
  147. package/package.json +1 -1
  148. package/tsconfig.json +109 -113
@@ -0,0 +1,331 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class AddArchiveToResources1782600000000 implements MigrationInterface {
4
+ public name = "AddArchiveToResources1782600000000";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `ALTER TABLE "KubernetesCluster" ADD "isArchived" boolean NOT NULL DEFAULT false`,
9
+ );
10
+ await queryRunner.query(
11
+ `ALTER TABLE "KubernetesCluster" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
12
+ );
13
+ await queryRunner.query(
14
+ `ALTER TABLE "KubernetesCluster" ADD "archivedByUserId" uuid`,
15
+ );
16
+ await queryRunner.query(
17
+ `ALTER TABLE "DockerHost" ADD "isArchived" boolean NOT NULL DEFAULT false`,
18
+ );
19
+ await queryRunner.query(
20
+ `ALTER TABLE "DockerHost" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
21
+ );
22
+ await queryRunner.query(
23
+ `ALTER TABLE "DockerHost" ADD "archivedByUserId" uuid`,
24
+ );
25
+ await queryRunner.query(
26
+ `ALTER TABLE "PodmanHost" ADD "isArchived" boolean NOT NULL DEFAULT false`,
27
+ );
28
+ await queryRunner.query(
29
+ `ALTER TABLE "PodmanHost" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
30
+ );
31
+ await queryRunner.query(
32
+ `ALTER TABLE "PodmanHost" ADD "archivedByUserId" uuid`,
33
+ );
34
+ await queryRunner.query(
35
+ `ALTER TABLE "CephCluster" ADD "isArchived" boolean NOT NULL DEFAULT false`,
36
+ );
37
+ await queryRunner.query(
38
+ `ALTER TABLE "CephCluster" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
39
+ );
40
+ await queryRunner.query(
41
+ `ALTER TABLE "CephCluster" ADD "archivedByUserId" uuid`,
42
+ );
43
+ await queryRunner.query(
44
+ `ALTER TABLE "ProxmoxCluster" ADD "isArchived" boolean NOT NULL DEFAULT false`,
45
+ );
46
+ await queryRunner.query(
47
+ `ALTER TABLE "ProxmoxCluster" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
48
+ );
49
+ await queryRunner.query(
50
+ `ALTER TABLE "ProxmoxCluster" ADD "archivedByUserId" uuid`,
51
+ );
52
+ await queryRunner.query(
53
+ `ALTER TABLE "DockerSwarmCluster" ADD "isArchived" boolean NOT NULL DEFAULT false`,
54
+ );
55
+ await queryRunner.query(
56
+ `ALTER TABLE "DockerSwarmCluster" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
57
+ );
58
+ await queryRunner.query(
59
+ `ALTER TABLE "DockerSwarmCluster" ADD "archivedByUserId" uuid`,
60
+ );
61
+ await queryRunner.query(
62
+ `ALTER TABLE "Host" ADD "isArchived" boolean NOT NULL DEFAULT false`,
63
+ );
64
+ await queryRunner.query(
65
+ `ALTER TABLE "Host" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
66
+ );
67
+ await queryRunner.query(`ALTER TABLE "Host" ADD "archivedByUserId" uuid`);
68
+ await queryRunner.query(
69
+ `ALTER TABLE "ServerlessFunction" ADD "isArchived" boolean NOT NULL DEFAULT false`,
70
+ );
71
+ await queryRunner.query(
72
+ `ALTER TABLE "ServerlessFunction" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
73
+ );
74
+ await queryRunner.query(
75
+ `ALTER TABLE "ServerlessFunction" ADD "archivedByUserId" uuid`,
76
+ );
77
+ await queryRunner.query(
78
+ `ALTER TABLE "CloudResource" ADD "isArchived" boolean NOT NULL DEFAULT false`,
79
+ );
80
+ await queryRunner.query(
81
+ `ALTER TABLE "CloudResource" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
82
+ );
83
+ await queryRunner.query(
84
+ `ALTER TABLE "CloudResource" ADD "archivedByUserId" uuid`,
85
+ );
86
+ await queryRunner.query(
87
+ `ALTER TABLE "RumApplication" ADD "isArchived" boolean NOT NULL DEFAULT false`,
88
+ );
89
+ await queryRunner.query(
90
+ `ALTER TABLE "RumApplication" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
91
+ );
92
+ await queryRunner.query(
93
+ `ALTER TABLE "RumApplication" ADD "archivedByUserId" uuid`,
94
+ );
95
+ await queryRunner.query(
96
+ `ALTER TABLE "Service" ADD "isArchived" boolean NOT NULL DEFAULT false`,
97
+ );
98
+ await queryRunner.query(
99
+ `ALTER TABLE "Service" ADD "archivedAt" TIMESTAMP WITH TIME ZONE`,
100
+ );
101
+ await queryRunner.query(
102
+ `ALTER TABLE "Service" ADD "archivedByUserId" uuid`,
103
+ );
104
+ await queryRunner.query(
105
+ `CREATE INDEX "IDX_2e68523616c139af2a6f427b50" ON "KubernetesCluster" ("projectId", "isArchived") `,
106
+ );
107
+ await queryRunner.query(
108
+ `CREATE INDEX "IDX_480536268f3e7c7740aebf9837" ON "DockerHost" ("projectId", "isArchived") `,
109
+ );
110
+ await queryRunner.query(
111
+ `CREATE INDEX "IDX_035d6d86c31bd346fddfd27dca" ON "PodmanHost" ("projectId", "isArchived") `,
112
+ );
113
+ await queryRunner.query(
114
+ `CREATE INDEX "IDX_c0bca37302822c94b92d03a79e" ON "CephCluster" ("projectId", "isArchived") `,
115
+ );
116
+ await queryRunner.query(
117
+ `CREATE INDEX "IDX_e0d11d80b631c899c5420284a4" ON "ProxmoxCluster" ("projectId", "isArchived") `,
118
+ );
119
+ await queryRunner.query(
120
+ `CREATE INDEX "IDX_02a9ef1a2046de01247de73489" ON "DockerSwarmCluster" ("projectId", "isArchived") `,
121
+ );
122
+ await queryRunner.query(
123
+ `CREATE INDEX "IDX_03a64f2cea32c536d997d20df5" ON "Host" ("projectId", "isArchived") `,
124
+ );
125
+ await queryRunner.query(
126
+ `CREATE INDEX "IDX_61db725961bfe77256f928d569" ON "ServerlessFunction" ("projectId", "isArchived") `,
127
+ );
128
+ await queryRunner.query(
129
+ `CREATE INDEX "IDX_c3ae2234d4831e8a8960a130f5" ON "CloudResource" ("projectId", "isArchived") `,
130
+ );
131
+ await queryRunner.query(
132
+ `CREATE INDEX "IDX_88a7961a4488a9a5347bebcab1" ON "RumApplication" ("projectId", "isArchived") `,
133
+ );
134
+ await queryRunner.query(
135
+ `CREATE INDEX "IDX_3e4e3fa4f8382a1c387cb73690" ON "Service" ("projectId", "isArchived") `,
136
+ );
137
+ await queryRunner.query(
138
+ `ALTER TABLE "KubernetesCluster" ADD CONSTRAINT "FK_db7407d6c9ad5db6925987bf06a" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
139
+ );
140
+ await queryRunner.query(
141
+ `ALTER TABLE "DockerHost" ADD CONSTRAINT "FK_c798bcf4ecc488fffbff2532554" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
142
+ );
143
+ await queryRunner.query(
144
+ `ALTER TABLE "PodmanHost" ADD CONSTRAINT "FK_e8419fd09ba908d63ae0b24384c" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
145
+ );
146
+ await queryRunner.query(
147
+ `ALTER TABLE "CephCluster" ADD CONSTRAINT "FK_820e4a8bb82d829b2dd4780436e" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
148
+ );
149
+ await queryRunner.query(
150
+ `ALTER TABLE "ProxmoxCluster" ADD CONSTRAINT "FK_21ec00575b9a1066ca080cd1613" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
151
+ );
152
+ await queryRunner.query(
153
+ `ALTER TABLE "DockerSwarmCluster" ADD CONSTRAINT "FK_287be1bac3e53f2c0057bf8dc5b" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
154
+ );
155
+ await queryRunner.query(
156
+ `ALTER TABLE "Host" ADD CONSTRAINT "FK_9955d46d73b0a64abaaa23f2a20" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
157
+ );
158
+ await queryRunner.query(
159
+ `ALTER TABLE "ServerlessFunction" ADD CONSTRAINT "FK_320c19144bd79a91c0c163771a5" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
160
+ );
161
+ await queryRunner.query(
162
+ `ALTER TABLE "CloudResource" ADD CONSTRAINT "FK_a70f673d44b95123116d4d363f6" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
163
+ );
164
+ await queryRunner.query(
165
+ `ALTER TABLE "RumApplication" ADD CONSTRAINT "FK_85b1c18f1bf26abcb9e64ea0f60" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
166
+ );
167
+ await queryRunner.query(
168
+ `ALTER TABLE "Service" ADD CONSTRAINT "FK_a765077833343efb3b10cdb7b89" FOREIGN KEY ("archivedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
169
+ );
170
+ }
171
+
172
+ public async down(queryRunner: QueryRunner): Promise<void> {
173
+ await queryRunner.query(
174
+ `ALTER TABLE "Service" DROP CONSTRAINT "FK_a765077833343efb3b10cdb7b89"`,
175
+ );
176
+ await queryRunner.query(
177
+ `ALTER TABLE "RumApplication" DROP CONSTRAINT "FK_85b1c18f1bf26abcb9e64ea0f60"`,
178
+ );
179
+ await queryRunner.query(
180
+ `ALTER TABLE "CloudResource" DROP CONSTRAINT "FK_a70f673d44b95123116d4d363f6"`,
181
+ );
182
+ await queryRunner.query(
183
+ `ALTER TABLE "ServerlessFunction" DROP CONSTRAINT "FK_320c19144bd79a91c0c163771a5"`,
184
+ );
185
+ await queryRunner.query(
186
+ `ALTER TABLE "Host" DROP CONSTRAINT "FK_9955d46d73b0a64abaaa23f2a20"`,
187
+ );
188
+ await queryRunner.query(
189
+ `ALTER TABLE "DockerSwarmCluster" DROP CONSTRAINT "FK_287be1bac3e53f2c0057bf8dc5b"`,
190
+ );
191
+ await queryRunner.query(
192
+ `ALTER TABLE "ProxmoxCluster" DROP CONSTRAINT "FK_21ec00575b9a1066ca080cd1613"`,
193
+ );
194
+ await queryRunner.query(
195
+ `ALTER TABLE "CephCluster" DROP CONSTRAINT "FK_820e4a8bb82d829b2dd4780436e"`,
196
+ );
197
+ await queryRunner.query(
198
+ `ALTER TABLE "PodmanHost" DROP CONSTRAINT "FK_e8419fd09ba908d63ae0b24384c"`,
199
+ );
200
+ await queryRunner.query(
201
+ `ALTER TABLE "DockerHost" DROP CONSTRAINT "FK_c798bcf4ecc488fffbff2532554"`,
202
+ );
203
+ await queryRunner.query(
204
+ `ALTER TABLE "KubernetesCluster" DROP CONSTRAINT "FK_db7407d6c9ad5db6925987bf06a"`,
205
+ );
206
+ await queryRunner.query(
207
+ `DROP INDEX "public"."IDX_3e4e3fa4f8382a1c387cb73690"`,
208
+ );
209
+ await queryRunner.query(
210
+ `DROP INDEX "public"."IDX_88a7961a4488a9a5347bebcab1"`,
211
+ );
212
+ await queryRunner.query(
213
+ `DROP INDEX "public"."IDX_c3ae2234d4831e8a8960a130f5"`,
214
+ );
215
+ await queryRunner.query(
216
+ `DROP INDEX "public"."IDX_61db725961bfe77256f928d569"`,
217
+ );
218
+ await queryRunner.query(
219
+ `DROP INDEX "public"."IDX_03a64f2cea32c536d997d20df5"`,
220
+ );
221
+ await queryRunner.query(
222
+ `DROP INDEX "public"."IDX_02a9ef1a2046de01247de73489"`,
223
+ );
224
+ await queryRunner.query(
225
+ `DROP INDEX "public"."IDX_e0d11d80b631c899c5420284a4"`,
226
+ );
227
+ await queryRunner.query(
228
+ `DROP INDEX "public"."IDX_c0bca37302822c94b92d03a79e"`,
229
+ );
230
+ await queryRunner.query(
231
+ `DROP INDEX "public"."IDX_035d6d86c31bd346fddfd27dca"`,
232
+ );
233
+ await queryRunner.query(
234
+ `DROP INDEX "public"."IDX_480536268f3e7c7740aebf9837"`,
235
+ );
236
+ await queryRunner.query(
237
+ `DROP INDEX "public"."IDX_2e68523616c139af2a6f427b50"`,
238
+ );
239
+ await queryRunner.query(
240
+ `ALTER TABLE "Service" DROP COLUMN "archivedByUserId"`,
241
+ );
242
+ await queryRunner.query(`ALTER TABLE "Service" DROP COLUMN "archivedAt"`);
243
+ await queryRunner.query(`ALTER TABLE "Service" DROP COLUMN "isArchived"`);
244
+ await queryRunner.query(
245
+ `ALTER TABLE "RumApplication" DROP COLUMN "archivedByUserId"`,
246
+ );
247
+ await queryRunner.query(
248
+ `ALTER TABLE "RumApplication" DROP COLUMN "archivedAt"`,
249
+ );
250
+ await queryRunner.query(
251
+ `ALTER TABLE "RumApplication" DROP COLUMN "isArchived"`,
252
+ );
253
+ await queryRunner.query(
254
+ `ALTER TABLE "CloudResource" DROP COLUMN "archivedByUserId"`,
255
+ );
256
+ await queryRunner.query(
257
+ `ALTER TABLE "CloudResource" DROP COLUMN "archivedAt"`,
258
+ );
259
+ await queryRunner.query(
260
+ `ALTER TABLE "CloudResource" DROP COLUMN "isArchived"`,
261
+ );
262
+ await queryRunner.query(
263
+ `ALTER TABLE "ServerlessFunction" DROP COLUMN "archivedByUserId"`,
264
+ );
265
+ await queryRunner.query(
266
+ `ALTER TABLE "ServerlessFunction" DROP COLUMN "archivedAt"`,
267
+ );
268
+ await queryRunner.query(
269
+ `ALTER TABLE "ServerlessFunction" DROP COLUMN "isArchived"`,
270
+ );
271
+ await queryRunner.query(
272
+ `ALTER TABLE "Host" DROP COLUMN "archivedByUserId"`,
273
+ );
274
+ await queryRunner.query(`ALTER TABLE "Host" DROP COLUMN "archivedAt"`);
275
+ await queryRunner.query(`ALTER TABLE "Host" DROP COLUMN "isArchived"`);
276
+ await queryRunner.query(
277
+ `ALTER TABLE "DockerSwarmCluster" DROP COLUMN "archivedByUserId"`,
278
+ );
279
+ await queryRunner.query(
280
+ `ALTER TABLE "DockerSwarmCluster" DROP COLUMN "archivedAt"`,
281
+ );
282
+ await queryRunner.query(
283
+ `ALTER TABLE "DockerSwarmCluster" DROP COLUMN "isArchived"`,
284
+ );
285
+ await queryRunner.query(
286
+ `ALTER TABLE "ProxmoxCluster" DROP COLUMN "archivedByUserId"`,
287
+ );
288
+ await queryRunner.query(
289
+ `ALTER TABLE "ProxmoxCluster" DROP COLUMN "archivedAt"`,
290
+ );
291
+ await queryRunner.query(
292
+ `ALTER TABLE "ProxmoxCluster" DROP COLUMN "isArchived"`,
293
+ );
294
+ await queryRunner.query(
295
+ `ALTER TABLE "CephCluster" DROP COLUMN "archivedByUserId"`,
296
+ );
297
+ await queryRunner.query(
298
+ `ALTER TABLE "CephCluster" DROP COLUMN "archivedAt"`,
299
+ );
300
+ await queryRunner.query(
301
+ `ALTER TABLE "CephCluster" DROP COLUMN "isArchived"`,
302
+ );
303
+ await queryRunner.query(
304
+ `ALTER TABLE "PodmanHost" DROP COLUMN "archivedByUserId"`,
305
+ );
306
+ await queryRunner.query(
307
+ `ALTER TABLE "PodmanHost" DROP COLUMN "archivedAt"`,
308
+ );
309
+ await queryRunner.query(
310
+ `ALTER TABLE "PodmanHost" DROP COLUMN "isArchived"`,
311
+ );
312
+ await queryRunner.query(
313
+ `ALTER TABLE "DockerHost" DROP COLUMN "archivedByUserId"`,
314
+ );
315
+ await queryRunner.query(
316
+ `ALTER TABLE "DockerHost" DROP COLUMN "archivedAt"`,
317
+ );
318
+ await queryRunner.query(
319
+ `ALTER TABLE "DockerHost" DROP COLUMN "isArchived"`,
320
+ );
321
+ await queryRunner.query(
322
+ `ALTER TABLE "KubernetesCluster" DROP COLUMN "archivedByUserId"`,
323
+ );
324
+ await queryRunner.query(
325
+ `ALTER TABLE "KubernetesCluster" DROP COLUMN "archivedAt"`,
326
+ );
327
+ await queryRunner.query(
328
+ `ALTER TABLE "KubernetesCluster" DROP COLUMN "isArchived"`,
329
+ );
330
+ }
331
+ }
@@ -0,0 +1,35 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ /*
4
+ * Drops the deprecated StatusPage.enableSubscribers column.
5
+ *
6
+ * enableSubscribers was the old master "Can subscribers subscribe?" toggle,
7
+ * superseded by showSubscriberPageOnStatusPage + the per-channel
8
+ * enableEmailSubscribers / enableSmsSubscribers / enableSlackSubscribers flags.
9
+ * It was already marked deprecated in the model and gated nothing at runtime —
10
+ * its only consumer was a dashboard warning banner that wrongly claimed "no
11
+ * notifications will be sent" when it was off. That banner has been corrected,
12
+ * so this column now has no readers and is safe to remove.
13
+ *
14
+ * NOTE: the SQL below is exactly what `npm run generate-postgres-migration`
15
+ * produced for this model change; the generator additionally emitted unrelated
16
+ * cosmetic JSON-default churn on OnCallDutyPolicyScheduleLayer, which was
17
+ * stripped so this migration only does the intended drop.
18
+ */
19
+ export class RemoveDeprecatedEnableSubscribersFromStatusPage1782700000000
20
+ implements MigrationInterface
21
+ {
22
+ public name = "RemoveDeprecatedEnableSubscribersFromStatusPage1782700000000";
23
+
24
+ public async up(queryRunner: QueryRunner): Promise<void> {
25
+ await queryRunner.query(
26
+ `ALTER TABLE "StatusPage" DROP COLUMN "enableSubscribers"`,
27
+ );
28
+ }
29
+
30
+ public async down(queryRunner: QueryRunner): Promise<void> {
31
+ await queryRunner.query(
32
+ `ALTER TABLE "StatusPage" ADD "enableSubscribers" boolean NOT NULL DEFAULT true`,
33
+ );
34
+ }
35
+ }
@@ -397,6 +397,8 @@ import { MoveRequireSsoForLoginToGlobalConfig1782300000000 } from "./17823000000
397
397
  import { MigrationName1782310000000 } from "./1782310000000-MigrationName";
398
398
  import { RemoveIsTestedFromGlobalSsoAndOidc1782400000000 } from "./1782400000000-RemoveIsTestedFromGlobalSsoAndOidc";
399
399
  import { OptimizeTelemetryExceptionWritePath1782500000000 } from "./1782500000000-OptimizeTelemetryExceptionWritePath";
400
+ import { AddArchiveToResources1782600000000 } from "./1782600000000-AddArchiveToResources";
401
+ import { RemoveDeprecatedEnableSubscribersFromStatusPage1782700000000 } from "./1782700000000-RemoveDeprecatedEnableSubscribersFromStatusPage";
400
402
 
401
403
  export default [
402
404
  InitialMigration,
@@ -798,4 +800,6 @@ export default [
798
800
  MigrationName1782310000000,
799
801
  RemoveIsTestedFromGlobalSsoAndOidc1782400000000,
800
802
  OptimizeTelemetryExceptionWritePath1782500000000,
803
+ AddArchiveToResources1782600000000,
804
+ RemoveDeprecatedEnableSubscribersFromStatusPage1782700000000,
801
805
  ];
@@ -1,11 +1,11 @@
1
- To create a new migration:
1
+ To create a new migration:
2
2
 
3
3
  ```
4
4
  bash migration-create.sh <name>
5
5
  ```
6
6
 
7
- To run a migration:
7
+ To run a migration:
8
8
 
9
9
  ```
10
10
  bash migration-run.sh
11
- ```
11
+ ```
@@ -440,4 +440,126 @@ export default class Queue {
440
440
  return result;
441
441
  });
442
442
  }
443
+
444
+ /**
445
+ * Like getFailedJobs, but returns the FULL job for deep debugging: the job
446
+ * body (data), its options, return value, progress, all the timing/attempt
447
+ * metadata, and the per-job log lines BullMQ keeps (job.log()/getJobLogs).
448
+ * Used by the master-admin health dashboard / support bundle. The caller is
449
+ * responsible for redacting / size-capping before exposing this, since the
450
+ * job body can contain customer data.
451
+ */
452
+ @CaptureSpan()
453
+ public static async getFailedJobsWithDetails(
454
+ queueName: QueueName,
455
+ options?: {
456
+ start?: number;
457
+ end?: number;
458
+ },
459
+ ): Promise<
460
+ Array<{
461
+ id: string;
462
+ name: string;
463
+ data: JSONObject;
464
+ opts: JSONObject;
465
+ returnValue: unknown;
466
+ progress: number | Record<string, unknown> | null;
467
+ failedReason: string;
468
+ stackTrace: Array<string>;
469
+ logs: Array<string>;
470
+ attemptsMade: number;
471
+ attemptsStarted: number | null;
472
+ stalledCounter: number | null;
473
+ priority: number | null;
474
+ delay: number | null;
475
+ createdAt: Date | null;
476
+ processedOn: Date | null;
477
+ finishedOn: Date | null;
478
+ queueQualifiedName: string | null;
479
+ repeatJobKey: string | null;
480
+ deduplicationId: string | null;
481
+ processedBy: string | null;
482
+ parentKey: string | null;
483
+ }>
484
+ > {
485
+ const queue: BullQueue = this.getQueue(queueName);
486
+ const start: number = options?.start || 0;
487
+ const end: number = options?.end ?? 100;
488
+ const failed: Job[] = await queue.getFailed(start, end);
489
+
490
+ const results: Array<{
491
+ id: string;
492
+ name: string;
493
+ data: JSONObject;
494
+ opts: JSONObject;
495
+ returnValue: unknown;
496
+ progress: number | Record<string, unknown> | null;
497
+ failedReason: string;
498
+ stackTrace: Array<string>;
499
+ logs: Array<string>;
500
+ attemptsMade: number;
501
+ attemptsStarted: number | null;
502
+ stalledCounter: number | null;
503
+ priority: number | null;
504
+ delay: number | null;
505
+ createdAt: Date | null;
506
+ processedOn: Date | null;
507
+ finishedOn: Date | null;
508
+ queueQualifiedName: string | null;
509
+ repeatJobKey: string | null;
510
+ deduplicationId: string | null;
511
+ processedBy: string | null;
512
+ parentKey: string | null;
513
+ }> = [];
514
+
515
+ for (const job of failed) {
516
+ // Per-job log lines are best-effort — older jobs may have none.
517
+ let logs: Array<string> = [];
518
+
519
+ try {
520
+ if (job.id) {
521
+ const jobLogs: { logs: string[]; count: number } =
522
+ await queue.getJobLogs(job.id, 0, -1);
523
+ logs = jobLogs?.logs || [];
524
+ }
525
+ } catch (err) {
526
+ logger.debug(`Failed to read logs for job ${job.id} on ${queueName}`);
527
+ logger.debug(err);
528
+ }
529
+
530
+ results.push({
531
+ id: job.id || "unknown",
532
+ name: job.name || "unknown",
533
+ data: (job.data as JSONObject) || {},
534
+ opts: (job.opts as unknown as JSONObject) || {},
535
+ returnValue: job.returnvalue ?? null,
536
+ progress: (job.progress as number | Record<string, unknown>) ?? null,
537
+ failedReason: job.failedReason || "No reason provided",
538
+ stackTrace: job.stacktrace || [],
539
+ logs: logs,
540
+ attemptsMade: job.attemptsMade || 0,
541
+ attemptsStarted:
542
+ typeof job.attemptsStarted === "number" ? job.attemptsStarted : null,
543
+ stalledCounter:
544
+ typeof job.stalledCounter === "number" ? job.stalledCounter : null,
545
+ priority: typeof job.priority === "number" ? job.priority : null,
546
+ delay: typeof job.delay === "number" ? job.delay : null,
547
+ createdAt:
548
+ typeof job.timestamp === "number" ? new Date(job.timestamp) : null,
549
+ processedOn:
550
+ typeof job.processedOn === "number"
551
+ ? new Date(job.processedOn)
552
+ : null,
553
+ finishedOn:
554
+ typeof job.finishedOn === "number" ? new Date(job.finishedOn) : null,
555
+ queueQualifiedName: job.queueQualifiedName || null,
556
+ repeatJobKey: job.repeatJobKey || null,
557
+ deduplicationId: job.deduplicationId || null,
558
+ processedBy: job.processedBy || null,
559
+ parentKey: job.parentKey || null,
560
+ });
561
+ }
562
+
563
+ return results;
564
+ }
443
565
  }
@@ -120,14 +120,19 @@ export class Service extends DatabaseService<Model> {
120
120
 
121
121
  const now: Date = OneUptimeDate.getCurrentDate();
122
122
 
123
- await this.updateOneById({
123
+ /*
124
+ * Heartbeat write: a single-statement UPDATE with no hooks and no
125
+ * `version` bump. Fires on every AI-agent ingest/alive request, so it
126
+ * must not head the hot-row Postgres lock convoy the full updateOneById
127
+ * pipeline causes. A lastAlive-only write never sets connectionStatus,
128
+ * so the connection-status-change hooks are inert here. See
129
+ * ServiceService.updateLastSeen.
130
+ */
131
+ await this.updateColumnsByIdWithoutHooks({
124
132
  id: aiAgentId,
125
133
  data: {
126
134
  lastAlive: now,
127
135
  },
128
- props: {
129
- isRoot: true,
130
- },
131
136
  });
132
137
  }
133
138