betterstack-alchemy 0.0.0-stage → 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1056) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSES/Apache-2.0.txt +201 -0
  3. package/NOTICE +182 -0
  4. package/README.md +165 -2
  5. package/lib/Account/Reference.d.ts +89 -0
  6. package/lib/Account/Reference.d.ts.map +1 -0
  7. package/lib/Account/Reference.js +90 -0
  8. package/lib/Account/Reference.js.map +1 -0
  9. package/lib/Account/Team.d.ts +69 -0
  10. package/lib/Account/Team.d.ts.map +1 -0
  11. package/lib/Account/Team.js +74 -0
  12. package/lib/Account/Team.js.map +1 -0
  13. package/lib/Account/TeamMember.d.ts +78 -0
  14. package/lib/Account/TeamMember.d.ts.map +1 -0
  15. package/lib/Account/TeamMember.js +159 -0
  16. package/lib/Account/TeamMember.js.map +1 -0
  17. package/lib/Account/index.d.ts +25 -0
  18. package/lib/Account/index.d.ts.map +1 -0
  19. package/lib/Account/index.js +25 -0
  20. package/lib/Account/index.js.map +1 -0
  21. package/lib/AuthProvider.d.ts +38 -0
  22. package/lib/AuthProvider.d.ts.map +1 -0
  23. package/lib/AuthProvider.js +134 -0
  24. package/lib/AuthProvider.js.map +1 -0
  25. package/lib/BetterStackBindings.d.ts +227 -0
  26. package/lib/BetterStackBindings.d.ts.map +1 -0
  27. package/lib/BetterStackBindings.js +223 -0
  28. package/lib/BetterStackBindings.js.map +1 -0
  29. package/lib/Cloud/Bootstrap.d.ts +20 -0
  30. package/lib/Cloud/Bootstrap.d.ts.map +1 -0
  31. package/lib/Cloud/Bootstrap.js +85 -0
  32. package/lib/Cloud/Bootstrap.js.map +1 -0
  33. package/lib/Cloud/Certificate.d.ts +97 -0
  34. package/lib/Cloud/Certificate.d.ts.map +1 -0
  35. package/lib/Cloud/Certificate.js +96 -0
  36. package/lib/Cloud/Certificate.js.map +1 -0
  37. package/lib/Cloud/ClickHouse.d.ts +184 -0
  38. package/lib/Cloud/ClickHouse.d.ts.map +1 -0
  39. package/lib/Cloud/ClickHouse.js +179 -0
  40. package/lib/Cloud/ClickHouse.js.map +1 -0
  41. package/lib/Cloud/ClickHouseScheduledSnapshot.d.ts +77 -0
  42. package/lib/Cloud/ClickHouseScheduledSnapshot.d.ts.map +1 -0
  43. package/lib/Cloud/ClickHouseScheduledSnapshot.js +76 -0
  44. package/lib/Cloud/ClickHouseScheduledSnapshot.js.map +1 -0
  45. package/lib/Cloud/ClickHouseSnapshot.d.ts +107 -0
  46. package/lib/Cloud/ClickHouseSnapshot.d.ts.map +1 -0
  47. package/lib/Cloud/ClickHouseSnapshot.js +78 -0
  48. package/lib/Cloud/ClickHouseSnapshot.js.map +1 -0
  49. package/lib/Cloud/Firewall.d.ts +134 -0
  50. package/lib/Cloud/Firewall.d.ts.map +1 -0
  51. package/lib/Cloud/Firewall.js +169 -0
  52. package/lib/Cloud/Firewall.js.map +1 -0
  53. package/lib/Cloud/FirewallRule.d.ts +114 -0
  54. package/lib/Cloud/FirewallRule.d.ts.map +1 -0
  55. package/lib/Cloud/FirewallRule.js +130 -0
  56. package/lib/Cloud/FirewallRule.js.map +1 -0
  57. package/lib/Cloud/InferEnv.d.ts +28 -0
  58. package/lib/Cloud/InferEnv.d.ts.map +1 -0
  59. package/lib/Cloud/InferEnv.js +1 -0
  60. package/lib/Cloud/InferEnv.js.map +1 -0
  61. package/lib/Cloud/Kafka.d.ts +204 -0
  62. package/lib/Cloud/Kafka.d.ts.map +1 -0
  63. package/lib/Cloud/Kafka.js +194 -0
  64. package/lib/Cloud/Kafka.js.map +1 -0
  65. package/lib/Cloud/KafkaTopic.d.ts +90 -0
  66. package/lib/Cloud/KafkaTopic.d.ts.map +1 -0
  67. package/lib/Cloud/KafkaTopic.js +83 -0
  68. package/lib/Cloud/KafkaTopic.js.map +1 -0
  69. package/lib/Cloud/KafkaUser.d.ts +121 -0
  70. package/lib/Cloud/KafkaUser.d.ts.map +1 -0
  71. package/lib/Cloud/KafkaUser.js +103 -0
  72. package/lib/Cloud/KafkaUser.js.map +1 -0
  73. package/lib/Cloud/KubernetesCluster.d.ts +204 -0
  74. package/lib/Cloud/KubernetesCluster.d.ts.map +1 -0
  75. package/lib/Cloud/KubernetesCluster.js +190 -0
  76. package/lib/Cloud/KubernetesCluster.js.map +1 -0
  77. package/lib/Cloud/KubernetesNodePool.d.ts +100 -0
  78. package/lib/Cloud/KubernetesNodePool.d.ts.map +1 -0
  79. package/lib/Cloud/KubernetesNodePool.js +133 -0
  80. package/lib/Cloud/KubernetesNodePool.js.map +1 -0
  81. package/lib/Cloud/KubernetesScheduledSnapshot.d.ts +73 -0
  82. package/lib/Cloud/KubernetesScheduledSnapshot.d.ts.map +1 -0
  83. package/lib/Cloud/KubernetesScheduledSnapshot.js +78 -0
  84. package/lib/Cloud/KubernetesScheduledSnapshot.js.map +1 -0
  85. package/lib/Cloud/LoadBalancer.d.ts +187 -0
  86. package/lib/Cloud/LoadBalancer.d.ts.map +1 -0
  87. package/lib/Cloud/LoadBalancer.js +228 -0
  88. package/lib/Cloud/LoadBalancer.js.map +1 -0
  89. package/lib/Cloud/LoadBalancerService.d.ts +116 -0
  90. package/lib/Cloud/LoadBalancerService.d.ts.map +1 -0
  91. package/lib/Cloud/LoadBalancerService.js +132 -0
  92. package/lib/Cloud/LoadBalancerService.js.map +1 -0
  93. package/lib/Cloud/LoadBalancerTarget.d.ts +110 -0
  94. package/lib/Cloud/LoadBalancerTarget.d.ts.map +1 -0
  95. package/lib/Cloud/LoadBalancerTarget.js +138 -0
  96. package/lib/Cloud/LoadBalancerTarget.js.map +1 -0
  97. package/lib/Cloud/MountVolume.d.ts +109 -0
  98. package/lib/Cloud/MountVolume.d.ts.map +1 -0
  99. package/lib/Cloud/MountVolume.js +59 -0
  100. package/lib/Cloud/MountVolume.js.map +1 -0
  101. package/lib/Cloud/MySQL.d.ts +285 -0
  102. package/lib/Cloud/MySQL.d.ts.map +1 -0
  103. package/lib/Cloud/MySQL.js +225 -0
  104. package/lib/Cloud/MySQL.js.map +1 -0
  105. package/lib/Cloud/MySQLScheduledSnapshot.d.ts +74 -0
  106. package/lib/Cloud/MySQLScheduledSnapshot.d.ts.map +1 -0
  107. package/lib/Cloud/MySQLScheduledSnapshot.js +73 -0
  108. package/lib/Cloud/MySQLScheduledSnapshot.js.map +1 -0
  109. package/lib/Cloud/MySQLSnapshot.d.ts +107 -0
  110. package/lib/Cloud/MySQLSnapshot.d.ts.map +1 -0
  111. package/lib/Cloud/MySQLSnapshot.js +78 -0
  112. package/lib/Cloud/MySQLSnapshot.js.map +1 -0
  113. package/lib/Cloud/Network.d.ts +69 -0
  114. package/lib/Cloud/Network.d.ts.map +1 -0
  115. package/lib/Cloud/Network.js +80 -0
  116. package/lib/Cloud/Network.js.map +1 -0
  117. package/lib/Cloud/ObjectCache.d.ts +226 -0
  118. package/lib/Cloud/ObjectCache.d.ts.map +1 -0
  119. package/lib/Cloud/ObjectCache.js +258 -0
  120. package/lib/Cloud/ObjectCache.js.map +1 -0
  121. package/lib/Cloud/ObjectCacheBucket.d.ts +112 -0
  122. package/lib/Cloud/ObjectCacheBucket.d.ts.map +1 -0
  123. package/lib/Cloud/ObjectCacheBucket.js +123 -0
  124. package/lib/Cloud/ObjectCacheBucket.js.map +1 -0
  125. package/lib/Cloud/Otlp.d.ts +93 -0
  126. package/lib/Cloud/Otlp.d.ts.map +1 -0
  127. package/lib/Cloud/Otlp.js +79 -0
  128. package/lib/Cloud/Otlp.js.map +1 -0
  129. package/lib/Cloud/PlacementGroup.d.ts +85 -0
  130. package/lib/Cloud/PlacementGroup.d.ts.map +1 -0
  131. package/lib/Cloud/PlacementGroup.js +86 -0
  132. package/lib/Cloud/PlacementGroup.js.map +1 -0
  133. package/lib/Cloud/Postgres.d.ts +331 -0
  134. package/lib/Cloud/Postgres.d.ts.map +1 -0
  135. package/lib/Cloud/Postgres.js +255 -0
  136. package/lib/Cloud/Postgres.js.map +1 -0
  137. package/lib/Cloud/PostgresDatabase.d.ts +77 -0
  138. package/lib/Cloud/PostgresDatabase.d.ts.map +1 -0
  139. package/lib/Cloud/PostgresDatabase.js +79 -0
  140. package/lib/Cloud/PostgresDatabase.js.map +1 -0
  141. package/lib/Cloud/PostgresScheduledSnapshot.d.ts +74 -0
  142. package/lib/Cloud/PostgresScheduledSnapshot.d.ts.map +1 -0
  143. package/lib/Cloud/PostgresScheduledSnapshot.js +73 -0
  144. package/lib/Cloud/PostgresScheduledSnapshot.js.map +1 -0
  145. package/lib/Cloud/PostgresSnapshot.d.ts +107 -0
  146. package/lib/Cloud/PostgresSnapshot.d.ts.map +1 -0
  147. package/lib/Cloud/PostgresSnapshot.js +78 -0
  148. package/lib/Cloud/PostgresSnapshot.js.map +1 -0
  149. package/lib/Cloud/PostgresUser.d.ts +118 -0
  150. package/lib/Cloud/PostgresUser.d.ts.map +1 -0
  151. package/lib/Cloud/PostgresUser.js +102 -0
  152. package/lib/Cloud/PostgresUser.js.map +1 -0
  153. package/lib/Cloud/Reference.d.ts +508 -0
  154. package/lib/Cloud/Reference.d.ts.map +1 -0
  155. package/lib/Cloud/Reference.js +542 -0
  156. package/lib/Cloud/Reference.js.map +1 -0
  157. package/lib/Cloud/ReservedIp.d.ts +113 -0
  158. package/lib/Cloud/ReservedIp.d.ts.map +1 -0
  159. package/lib/Cloud/ReservedIp.js +146 -0
  160. package/lib/Cloud/ReservedIp.js.map +1 -0
  161. package/lib/Cloud/ScheduledSnapshot.d.ts +49 -0
  162. package/lib/Cloud/ScheduledSnapshot.d.ts.map +1 -0
  163. package/lib/Cloud/ScheduledSnapshot.js +43 -0
  164. package/lib/Cloud/ScheduledSnapshot.js.map +1 -0
  165. package/lib/Cloud/ScheduledVolumeSnapshot.d.ts +48 -0
  166. package/lib/Cloud/ScheduledVolumeSnapshot.d.ts.map +1 -0
  167. package/lib/Cloud/ScheduledVolumeSnapshot.js +42 -0
  168. package/lib/Cloud/ScheduledVolumeSnapshot.js.map +1 -0
  169. package/lib/Cloud/Server.d.ts +375 -0
  170. package/lib/Cloud/Server.d.ts.map +1 -0
  171. package/lib/Cloud/Server.js +966 -0
  172. package/lib/Cloud/Server.js.map +1 -0
  173. package/lib/Cloud/ServerPool.d.ts +64 -0
  174. package/lib/Cloud/ServerPool.d.ts.map +1 -0
  175. package/lib/Cloud/ServerPool.js +59 -0
  176. package/lib/Cloud/ServerPool.js.map +1 -0
  177. package/lib/Cloud/ServerPrivateIp.d.ts +62 -0
  178. package/lib/Cloud/ServerPrivateIp.d.ts.map +1 -0
  179. package/lib/Cloud/ServerPrivateIp.js +68 -0
  180. package/lib/Cloud/ServerPrivateIp.js.map +1 -0
  181. package/lib/Cloud/Service.d.ts +554 -0
  182. package/lib/Cloud/Service.d.ts.map +1 -0
  183. package/lib/Cloud/Service.js +765 -0
  184. package/lib/Cloud/Service.js.map +1 -0
  185. package/lib/Cloud/ServiceHandler.d.ts +10 -0
  186. package/lib/Cloud/ServiceHandler.d.ts.map +1 -0
  187. package/lib/Cloud/ServiceHandler.js +102 -0
  188. package/lib/Cloud/ServiceHandler.js.map +1 -0
  189. package/lib/Cloud/Snapshot.d.ts +103 -0
  190. package/lib/Cloud/Snapshot.d.ts.map +1 -0
  191. package/lib/Cloud/Snapshot.js +96 -0
  192. package/lib/Cloud/Snapshot.js.map +1 -0
  193. package/lib/Cloud/Ssh.d.ts +241 -0
  194. package/lib/Cloud/Ssh.d.ts.map +1 -0
  195. package/lib/Cloud/Ssh.js +292 -0
  196. package/lib/Cloud/Ssh.js.map +1 -0
  197. package/lib/Cloud/SshKey.d.ts +120 -0
  198. package/lib/Cloud/SshKey.d.ts.map +1 -0
  199. package/lib/Cloud/SshKey.js +161 -0
  200. package/lib/Cloud/SshKey.js.map +1 -0
  201. package/lib/Cloud/Valkey.d.ts +212 -0
  202. package/lib/Cloud/Valkey.d.ts.map +1 -0
  203. package/lib/Cloud/Valkey.js +155 -0
  204. package/lib/Cloud/Valkey.js.map +1 -0
  205. package/lib/Cloud/ValkeyScheduledSnapshot.d.ts +75 -0
  206. package/lib/Cloud/ValkeyScheduledSnapshot.d.ts.map +1 -0
  207. package/lib/Cloud/ValkeyScheduledSnapshot.js +74 -0
  208. package/lib/Cloud/ValkeyScheduledSnapshot.js.map +1 -0
  209. package/lib/Cloud/ValkeySnapshot.d.ts +107 -0
  210. package/lib/Cloud/ValkeySnapshot.d.ts.map +1 -0
  211. package/lib/Cloud/ValkeySnapshot.js +80 -0
  212. package/lib/Cloud/ValkeySnapshot.js.map +1 -0
  213. package/lib/Cloud/Volume.d.ts +133 -0
  214. package/lib/Cloud/Volume.d.ts.map +1 -0
  215. package/lib/Cloud/Volume.js +329 -0
  216. package/lib/Cloud/Volume.js.map +1 -0
  217. package/lib/Cloud/VolumeSnapshot.d.ts +95 -0
  218. package/lib/Cloud/VolumeSnapshot.d.ts.map +1 -0
  219. package/lib/Cloud/VolumeSnapshot.js +88 -0
  220. package/lib/Cloud/VolumeSnapshot.js.map +1 -0
  221. package/lib/Cloud/Webhook.d.ts +93 -0
  222. package/lib/Cloud/Webhook.d.ts.map +1 -0
  223. package/lib/Cloud/Webhook.js +92 -0
  224. package/lib/Cloud/Webhook.js.map +1 -0
  225. package/lib/Cloud/Website/Astro.d.ts +106 -0
  226. package/lib/Cloud/Website/Astro.d.ts.map +1 -0
  227. package/lib/Cloud/Website/Astro.js +76 -0
  228. package/lib/Cloud/Website/Astro.js.map +1 -0
  229. package/lib/Cloud/Website/Foldkit.d.ts +70 -0
  230. package/lib/Cloud/Website/Foldkit.d.ts.map +1 -0
  231. package/lib/Cloud/Website/Foldkit.js +67 -0
  232. package/lib/Cloud/Website/Foldkit.js.map +1 -0
  233. package/lib/Cloud/Website/FrameworkSite.d.ts +277 -0
  234. package/lib/Cloud/Website/FrameworkSite.d.ts.map +1 -0
  235. package/lib/Cloud/Website/FrameworkSite.js +245 -0
  236. package/lib/Cloud/Website/FrameworkSite.js.map +1 -0
  237. package/lib/Cloud/Website/Nextjs.d.ts +70 -0
  238. package/lib/Cloud/Website/Nextjs.d.ts.map +1 -0
  239. package/lib/Cloud/Website/Nextjs.js +66 -0
  240. package/lib/Cloud/Website/Nextjs.js.map +1 -0
  241. package/lib/Cloud/Website/Nuxt.d.ts +71 -0
  242. package/lib/Cloud/Website/Nuxt.d.ts.map +1 -0
  243. package/lib/Cloud/Website/Nuxt.js +60 -0
  244. package/lib/Cloud/Website/Nuxt.js.map +1 -0
  245. package/lib/Cloud/Website/Octane.d.ts +64 -0
  246. package/lib/Cloud/Website/Octane.d.ts.map +1 -0
  247. package/lib/Cloud/Website/Octane.js +58 -0
  248. package/lib/Cloud/Website/Octane.js.map +1 -0
  249. package/lib/Cloud/Website/Providers.d.ts +16 -0
  250. package/lib/Cloud/Website/Providers.d.ts.map +1 -0
  251. package/lib/Cloud/Website/Providers.js +16 -0
  252. package/lib/Cloud/Website/Providers.js.map +1 -0
  253. package/lib/Cloud/Website/ReactRouter.d.ts +96 -0
  254. package/lib/Cloud/Website/ReactRouter.d.ts.map +1 -0
  255. package/lib/Cloud/Website/ReactRouter.js +90 -0
  256. package/lib/Cloud/Website/ReactRouter.js.map +1 -0
  257. package/lib/Cloud/Website/SolidStart.d.ts +108 -0
  258. package/lib/Cloud/Website/SolidStart.d.ts.map +1 -0
  259. package/lib/Cloud/Website/SolidStart.js +90 -0
  260. package/lib/Cloud/Website/SolidStart.js.map +1 -0
  261. package/lib/Cloud/Website/StaticSite.d.ts +170 -0
  262. package/lib/Cloud/Website/StaticSite.d.ts.map +1 -0
  263. package/lib/Cloud/Website/StaticSite.js +193 -0
  264. package/lib/Cloud/Website/StaticSite.js.map +1 -0
  265. package/lib/Cloud/Website/SvelteKit.d.ts +70 -0
  266. package/lib/Cloud/Website/SvelteKit.d.ts.map +1 -0
  267. package/lib/Cloud/Website/SvelteKit.js +59 -0
  268. package/lib/Cloud/Website/SvelteKit.js.map +1 -0
  269. package/lib/Cloud/Website/TanStackStart.d.ts +91 -0
  270. package/lib/Cloud/Website/TanStackStart.d.ts.map +1 -0
  271. package/lib/Cloud/Website/TanStackStart.js +85 -0
  272. package/lib/Cloud/Website/TanStackStart.js.map +1 -0
  273. package/lib/Cloud/Website/Vinext.d.ts +80 -0
  274. package/lib/Cloud/Website/Vinext.d.ts.map +1 -0
  275. package/lib/Cloud/Website/Vinext.js +75 -0
  276. package/lib/Cloud/Website/Vinext.js.map +1 -0
  277. package/lib/Cloud/Website/Vite.d.ts +114 -0
  278. package/lib/Cloud/Website/Vite.d.ts.map +1 -0
  279. package/lib/Cloud/Website/Vite.js +112 -0
  280. package/lib/Cloud/Website/Vite.js.map +1 -0
  281. package/lib/Cloud/Website/Vocs.d.ts +67 -0
  282. package/lib/Cloud/Website/Vocs.d.ts.map +1 -0
  283. package/lib/Cloud/Website/Vocs.js +56 -0
  284. package/lib/Cloud/Website/Vocs.js.map +1 -0
  285. package/lib/Cloud/Website/Waku.d.ts +71 -0
  286. package/lib/Cloud/Website/Waku.d.ts.map +1 -0
  287. package/lib/Cloud/Website/Waku.js +59 -0
  288. package/lib/Cloud/Website/Waku.js.map +1 -0
  289. package/lib/Cloud/Website/index.d.ts +16 -0
  290. package/lib/Cloud/Website/index.d.ts.map +1 -0
  291. package/lib/Cloud/Website/index.js +17 -0
  292. package/lib/Cloud/Website/index.js.map +1 -0
  293. package/lib/Cloud/hosted.d.ts +324 -0
  294. package/lib/Cloud/hosted.d.ts.map +1 -0
  295. package/lib/Cloud/hosted.js +750 -0
  296. package/lib/Cloud/hosted.js.map +1 -0
  297. package/lib/Cloud/index.d.ts +111 -0
  298. package/lib/Cloud/index.d.ts.map +1 -0
  299. package/lib/Cloud/index.js +156 -0
  300. package/lib/Cloud/index.js.map +1 -0
  301. package/lib/Contributions.d.ts +12 -0
  302. package/lib/Contributions.d.ts.map +1 -0
  303. package/lib/Contributions.js +12 -0
  304. package/lib/Contributions.js.map +1 -0
  305. package/lib/Credentials.d.ts +25 -0
  306. package/lib/Credentials.d.ts.map +1 -0
  307. package/lib/Credentials.js +35 -0
  308. package/lib/Credentials.js.map +1 -0
  309. package/lib/Errors/Application.d.ts +136 -0
  310. package/lib/Errors/Application.d.ts.map +1 -0
  311. package/lib/Errors/Application.js +146 -0
  312. package/lib/Errors/Application.js.map +1 -0
  313. package/lib/Errors/ApplicationGroup.d.ts +67 -0
  314. package/lib/Errors/ApplicationGroup.d.ts.map +1 -0
  315. package/lib/Errors/ApplicationGroup.js +72 -0
  316. package/lib/Errors/ApplicationGroup.js.map +1 -0
  317. package/lib/Errors/Dsn.d.ts +87 -0
  318. package/lib/Errors/Dsn.d.ts.map +1 -0
  319. package/lib/Errors/Dsn.js +34 -0
  320. package/lib/Errors/Dsn.js.map +1 -0
  321. package/lib/Errors/JiraIntegration.d.ts +69 -0
  322. package/lib/Errors/JiraIntegration.d.ts.map +1 -0
  323. package/lib/Errors/JiraIntegration.js +64 -0
  324. package/lib/Errors/JiraIntegration.js.map +1 -0
  325. package/lib/Errors/LinearIntegration.d.ts +71 -0
  326. package/lib/Errors/LinearIntegration.d.ts.map +1 -0
  327. package/lib/Errors/LinearIntegration.js +66 -0
  328. package/lib/Errors/LinearIntegration.js.map +1 -0
  329. package/lib/Errors/MicrosoftTeamsIntegration.d.ts +75 -0
  330. package/lib/Errors/MicrosoftTeamsIntegration.d.ts.map +1 -0
  331. package/lib/Errors/MicrosoftTeamsIntegration.js +72 -0
  332. package/lib/Errors/MicrosoftTeamsIntegration.js.map +1 -0
  333. package/lib/Errors/Reference.d.ts +133 -0
  334. package/lib/Errors/Reference.d.ts.map +1 -0
  335. package/lib/Errors/Reference.js +123 -0
  336. package/lib/Errors/Reference.js.map +1 -0
  337. package/lib/Errors/RegisterRelease.d.ts +66 -0
  338. package/lib/Errors/RegisterRelease.d.ts.map +1 -0
  339. package/lib/Errors/RegisterRelease.js +3 -0
  340. package/lib/Errors/RegisterRelease.js.map +1 -0
  341. package/lib/Errors/RegisterReleaseHttp.d.ts +13 -0
  342. package/lib/Errors/RegisterReleaseHttp.d.ts.map +1 -0
  343. package/lib/Errors/RegisterReleaseHttp.js +29 -0
  344. package/lib/Errors/RegisterReleaseHttp.js.map +1 -0
  345. package/lib/Errors/Release.d.ts +97 -0
  346. package/lib/Errors/Release.d.ts.map +1 -0
  347. package/lib/Errors/Release.js +161 -0
  348. package/lib/Errors/Release.js.map +1 -0
  349. package/lib/Errors/SlackIntegration.d.ts +66 -0
  350. package/lib/Errors/SlackIntegration.d.ts.map +1 -0
  351. package/lib/Errors/SlackIntegration.js +61 -0
  352. package/lib/Errors/SlackIntegration.js.map +1 -0
  353. package/lib/Errors/index.d.ts +38 -0
  354. package/lib/Errors/index.d.ts.map +1 -0
  355. package/lib/Errors/index.js +46 -0
  356. package/lib/Errors/index.js.map +1 -0
  357. package/lib/Incidents/AcknowledgeIncident.d.ts +61 -0
  358. package/lib/Incidents/AcknowledgeIncident.d.ts.map +1 -0
  359. package/lib/Incidents/AcknowledgeIncident.js +3 -0
  360. package/lib/Incidents/AcknowledgeIncident.js.map +1 -0
  361. package/lib/Incidents/AcknowledgeIncidentHttp.d.ts +12 -0
  362. package/lib/Incidents/AcknowledgeIncidentHttp.d.ts.map +1 -0
  363. package/lib/Incidents/AcknowledgeIncidentHttp.js +19 -0
  364. package/lib/Incidents/AcknowledgeIncidentHttp.js.map +1 -0
  365. package/lib/Incidents/AmazonSnsIntegration.d.ts +83 -0
  366. package/lib/Incidents/AmazonSnsIntegration.d.ts.map +1 -0
  367. package/lib/Incidents/AmazonSnsIntegration.js +91 -0
  368. package/lib/Incidents/AmazonSnsIntegration.js.map +1 -0
  369. package/lib/Incidents/AwsCloudWatchIntegration.d.ts +64 -0
  370. package/lib/Incidents/AwsCloudWatchIntegration.d.ts.map +1 -0
  371. package/lib/Incidents/AwsCloudWatchIntegration.js +64 -0
  372. package/lib/Incidents/AwsCloudWatchIntegration.js.map +1 -0
  373. package/lib/Incidents/AzureIntegration.d.ts +63 -0
  374. package/lib/Incidents/AzureIntegration.d.ts.map +1 -0
  375. package/lib/Incidents/AzureIntegration.js +63 -0
  376. package/lib/Incidents/AzureIntegration.js.map +1 -0
  377. package/lib/Incidents/BindingHttp.d.ts +28 -0
  378. package/lib/Incidents/BindingHttp.d.ts.map +1 -0
  379. package/lib/Incidents/BindingHttp.js +28 -0
  380. package/lib/Incidents/BindingHttp.js.map +1 -0
  381. package/lib/Incidents/CatalogRecord.d.ts +69 -0
  382. package/lib/Incidents/CatalogRecord.d.ts.map +1 -0
  383. package/lib/Incidents/CatalogRecord.js +69 -0
  384. package/lib/Incidents/CatalogRecord.js.map +1 -0
  385. package/lib/Incidents/CatalogRelation.d.ts +78 -0
  386. package/lib/Incidents/CatalogRelation.d.ts.map +1 -0
  387. package/lib/Incidents/CatalogRelation.js +79 -0
  388. package/lib/Incidents/CatalogRelation.js.map +1 -0
  389. package/lib/Incidents/CreateIncident.d.ts +67 -0
  390. package/lib/Incidents/CreateIncident.d.ts.map +1 -0
  391. package/lib/Incidents/CreateIncident.js +3 -0
  392. package/lib/Incidents/CreateIncident.js.map +1 -0
  393. package/lib/Incidents/CreateIncidentHttp.d.ts +12 -0
  394. package/lib/Incidents/CreateIncidentHttp.d.ts.map +1 -0
  395. package/lib/Incidents/CreateIncidentHttp.js +19 -0
  396. package/lib/Incidents/CreateIncidentHttp.js.map +1 -0
  397. package/lib/Incidents/CreateStatusReport.d.ts +71 -0
  398. package/lib/Incidents/CreateStatusReport.d.ts.map +1 -0
  399. package/lib/Incidents/CreateStatusReport.js +3 -0
  400. package/lib/Incidents/CreateStatusReport.js.map +1 -0
  401. package/lib/Incidents/CreateStatusReportHttp.d.ts +12 -0
  402. package/lib/Incidents/CreateStatusReportHttp.d.ts.map +1 -0
  403. package/lib/Incidents/CreateStatusReportHttp.js +27 -0
  404. package/lib/Incidents/CreateStatusReportHttp.js.map +1 -0
  405. package/lib/Incidents/CreateStatusUpdate.d.ts +67 -0
  406. package/lib/Incidents/CreateStatusUpdate.d.ts.map +1 -0
  407. package/lib/Incidents/CreateStatusUpdate.js +3 -0
  408. package/lib/Incidents/CreateStatusUpdate.js.map +1 -0
  409. package/lib/Incidents/CreateStatusUpdateHttp.d.ts +12 -0
  410. package/lib/Incidents/CreateStatusUpdateHttp.d.ts.map +1 -0
  411. package/lib/Incidents/CreateStatusUpdateHttp.js +27 -0
  412. package/lib/Incidents/CreateStatusUpdateHttp.js.map +1 -0
  413. package/lib/Incidents/DatadogIntegration.d.ts +70 -0
  414. package/lib/Incidents/DatadogIntegration.d.ts.map +1 -0
  415. package/lib/Incidents/DatadogIntegration.js +70 -0
  416. package/lib/Incidents/DatadogIntegration.js.map +1 -0
  417. package/lib/Incidents/ElasticIntegration.d.ts +62 -0
  418. package/lib/Incidents/ElasticIntegration.d.ts.map +1 -0
  419. package/lib/Incidents/ElasticIntegration.js +62 -0
  420. package/lib/Incidents/ElasticIntegration.js.map +1 -0
  421. package/lib/Incidents/EscalationPolicy.d.ts +106 -0
  422. package/lib/Incidents/EscalationPolicy.d.ts.map +1 -0
  423. package/lib/Incidents/EscalationPolicy.js +103 -0
  424. package/lib/Incidents/EscalationPolicy.js.map +1 -0
  425. package/lib/Incidents/EscalationPolicyGroup.d.ts +49 -0
  426. package/lib/Incidents/EscalationPolicyGroup.d.ts.map +1 -0
  427. package/lib/Incidents/EscalationPolicyGroup.js +48 -0
  428. package/lib/Incidents/EscalationPolicyGroup.js.map +1 -0
  429. package/lib/Incidents/FailHeartbeat.d.ts +49 -0
  430. package/lib/Incidents/FailHeartbeat.d.ts.map +1 -0
  431. package/lib/Incidents/FailHeartbeat.js +3 -0
  432. package/lib/Incidents/FailHeartbeat.js.map +1 -0
  433. package/lib/Incidents/FailHeartbeatHttp.d.ts +12 -0
  434. package/lib/Incidents/FailHeartbeatHttp.d.ts.map +1 -0
  435. package/lib/Incidents/FailHeartbeatHttp.js +22 -0
  436. package/lib/Incidents/FailHeartbeatHttp.js.map +1 -0
  437. package/lib/Incidents/GoogleMonitoringIntegration.d.ts +63 -0
  438. package/lib/Incidents/GoogleMonitoringIntegration.d.ts.map +1 -0
  439. package/lib/Incidents/GoogleMonitoringIntegration.js +63 -0
  440. package/lib/Incidents/GoogleMonitoringIntegration.js.map +1 -0
  441. package/lib/Incidents/GrafanaIntegration.d.ts +73 -0
  442. package/lib/Incidents/GrafanaIntegration.d.ts.map +1 -0
  443. package/lib/Incidents/GrafanaIntegration.js +73 -0
  444. package/lib/Incidents/GrafanaIntegration.js.map +1 -0
  445. package/lib/Incidents/Heartbeat.d.ts +99 -0
  446. package/lib/Incidents/Heartbeat.d.ts.map +1 -0
  447. package/lib/Incidents/Heartbeat.js +104 -0
  448. package/lib/Incidents/Heartbeat.js.map +1 -0
  449. package/lib/Incidents/HeartbeatGroup.d.ts +49 -0
  450. package/lib/Incidents/HeartbeatGroup.d.ts.map +1 -0
  451. package/lib/Incidents/HeartbeatGroup.js +48 -0
  452. package/lib/Incidents/HeartbeatGroup.js.map +1 -0
  453. package/lib/Incidents/IncomingEmailIntegration.d.ts +71 -0
  454. package/lib/Incidents/IncomingEmailIntegration.d.ts.map +1 -0
  455. package/lib/Incidents/IncomingEmailIntegration.js +81 -0
  456. package/lib/Incidents/IncomingEmailIntegration.js.map +1 -0
  457. package/lib/Incidents/IncomingWebhookIntegration.d.ts +85 -0
  458. package/lib/Incidents/IncomingWebhookIntegration.d.ts.map +1 -0
  459. package/lib/Incidents/IncomingWebhookIntegration.js +95 -0
  460. package/lib/Incidents/IncomingWebhookIntegration.js.map +1 -0
  461. package/lib/Incidents/JiraIntegration.d.ts +59 -0
  462. package/lib/Incidents/JiraIntegration.d.ts.map +1 -0
  463. package/lib/Incidents/JiraIntegration.js +50 -0
  464. package/lib/Incidents/JiraIntegration.js.map +1 -0
  465. package/lib/Incidents/LinearIntegration.d.ts +62 -0
  466. package/lib/Incidents/LinearIntegration.d.ts.map +1 -0
  467. package/lib/Incidents/LinearIntegration.js +60 -0
  468. package/lib/Incidents/LinearIntegration.js.map +1 -0
  469. package/lib/Incidents/Metadata.d.ts +85 -0
  470. package/lib/Incidents/Metadata.d.ts.map +1 -0
  471. package/lib/Incidents/Metadata.js +91 -0
  472. package/lib/Incidents/Metadata.js.map +1 -0
  473. package/lib/Incidents/Monitor.d.ts +91 -0
  474. package/lib/Incidents/Monitor.d.ts.map +1 -0
  475. package/lib/Incidents/Monitor.js +107 -0
  476. package/lib/Incidents/Monitor.js.map +1 -0
  477. package/lib/Incidents/MonitorGroup.d.ts +57 -0
  478. package/lib/Incidents/MonitorGroup.d.ts.map +1 -0
  479. package/lib/Incidents/MonitorGroup.js +56 -0
  480. package/lib/Incidents/MonitorGroup.js.map +1 -0
  481. package/lib/Incidents/NewRelicIntegration.d.ts +70 -0
  482. package/lib/Incidents/NewRelicIntegration.d.ts.map +1 -0
  483. package/lib/Incidents/NewRelicIntegration.js +70 -0
  484. package/lib/Incidents/NewRelicIntegration.js.map +1 -0
  485. package/lib/Incidents/OnCallRotation.d.ts +96 -0
  486. package/lib/Incidents/OnCallRotation.d.ts.map +1 -0
  487. package/lib/Incidents/OnCallRotation.js +206 -0
  488. package/lib/Incidents/OnCallRotation.js.map +1 -0
  489. package/lib/Incidents/OnCallSchedule.d.ts +80 -0
  490. package/lib/Incidents/OnCallSchedule.d.ts.map +1 -0
  491. package/lib/Incidents/OnCallSchedule.js +73 -0
  492. package/lib/Incidents/OnCallSchedule.js.map +1 -0
  493. package/lib/Incidents/OutgoingEmailIntegration.d.ts +54 -0
  494. package/lib/Incidents/OutgoingEmailIntegration.d.ts.map +1 -0
  495. package/lib/Incidents/OutgoingEmailIntegration.js +53 -0
  496. package/lib/Incidents/OutgoingEmailIntegration.js.map +1 -0
  497. package/lib/Incidents/OutgoingPagerDutyIntegration.d.ts +48 -0
  498. package/lib/Incidents/OutgoingPagerDutyIntegration.d.ts.map +1 -0
  499. package/lib/Incidents/OutgoingPagerDutyIntegration.js +47 -0
  500. package/lib/Incidents/OutgoingPagerDutyIntegration.js.map +1 -0
  501. package/lib/Incidents/OutgoingWebhookIntegration.d.ts +83 -0
  502. package/lib/Incidents/OutgoingWebhookIntegration.d.ts.map +1 -0
  503. package/lib/Incidents/OutgoingWebhookIntegration.js +98 -0
  504. package/lib/Incidents/OutgoingWebhookIntegration.js.map +1 -0
  505. package/lib/Incidents/PrometheusIntegration.d.ts +77 -0
  506. package/lib/Incidents/PrometheusIntegration.d.ts.map +1 -0
  507. package/lib/Incidents/PrometheusIntegration.js +77 -0
  508. package/lib/Incidents/PrometheusIntegration.js.map +1 -0
  509. package/lib/Incidents/Reference.d.ts +140 -0
  510. package/lib/Incidents/Reference.d.ts.map +1 -0
  511. package/lib/Incidents/Reference.js +136 -0
  512. package/lib/Incidents/Reference.js.map +1 -0
  513. package/lib/Incidents/ReportHeartbeat.d.ts +106 -0
  514. package/lib/Incidents/ReportHeartbeat.d.ts.map +1 -0
  515. package/lib/Incidents/ReportHeartbeat.js +63 -0
  516. package/lib/Incidents/ReportHeartbeat.js.map +1 -0
  517. package/lib/Incidents/ReportHeartbeatHttp.d.ts +12 -0
  518. package/lib/Incidents/ReportHeartbeatHttp.d.ts.map +1 -0
  519. package/lib/Incidents/ReportHeartbeatHttp.js +22 -0
  520. package/lib/Incidents/ReportHeartbeatHttp.js.map +1 -0
  521. package/lib/Incidents/ResolveIncident.d.ts +60 -0
  522. package/lib/Incidents/ResolveIncident.d.ts.map +1 -0
  523. package/lib/Incidents/ResolveIncident.js +3 -0
  524. package/lib/Incidents/ResolveIncident.js.map +1 -0
  525. package/lib/Incidents/ResolveIncidentHttp.d.ts +12 -0
  526. package/lib/Incidents/ResolveIncidentHttp.d.ts.map +1 -0
  527. package/lib/Incidents/ResolveIncidentHttp.js +19 -0
  528. package/lib/Incidents/ResolveIncidentHttp.js.map +1 -0
  529. package/lib/Incidents/SendHeartbeat.d.ts +56 -0
  530. package/lib/Incidents/SendHeartbeat.d.ts.map +1 -0
  531. package/lib/Incidents/SendHeartbeat.js +3 -0
  532. package/lib/Incidents/SendHeartbeat.js.map +1 -0
  533. package/lib/Incidents/SendHeartbeatHttp.d.ts +12 -0
  534. package/lib/Incidents/SendHeartbeatHttp.d.ts.map +1 -0
  535. package/lib/Incidents/SendHeartbeatHttp.js +22 -0
  536. package/lib/Incidents/SendHeartbeatHttp.js.map +1 -0
  537. package/lib/Incidents/Severity.d.ts +83 -0
  538. package/lib/Incidents/Severity.d.ts.map +1 -0
  539. package/lib/Incidents/Severity.js +79 -0
  540. package/lib/Incidents/Severity.js.map +1 -0
  541. package/lib/Incidents/SeverityGroup.d.ts +51 -0
  542. package/lib/Incidents/SeverityGroup.d.ts.map +1 -0
  543. package/lib/Incidents/SeverityGroup.js +50 -0
  544. package/lib/Incidents/SeverityGroup.js.map +1 -0
  545. package/lib/Incidents/SplunkOnCallIntegration.d.ts +46 -0
  546. package/lib/Incidents/SplunkOnCallIntegration.d.ts.map +1 -0
  547. package/lib/Incidents/SplunkOnCallIntegration.js +45 -0
  548. package/lib/Incidents/SplunkOnCallIntegration.js.map +1 -0
  549. package/lib/Incidents/StatusPage.d.ts +125 -0
  550. package/lib/Incidents/StatusPage.d.ts.map +1 -0
  551. package/lib/Incidents/StatusPage.js +133 -0
  552. package/lib/Incidents/StatusPage.js.map +1 -0
  553. package/lib/Incidents/StatusPageGroup.d.ts +50 -0
  554. package/lib/Incidents/StatusPageGroup.d.ts.map +1 -0
  555. package/lib/Incidents/StatusPageGroup.js +49 -0
  556. package/lib/Incidents/StatusPageGroup.js.map +1 -0
  557. package/lib/Incidents/StatusPageResource.d.ts +91 -0
  558. package/lib/Incidents/StatusPageResource.d.ts.map +1 -0
  559. package/lib/Incidents/StatusPageResource.js +87 -0
  560. package/lib/Incidents/StatusPageResource.js.map +1 -0
  561. package/lib/Incidents/StatusPageSection.d.ts +65 -0
  562. package/lib/Incidents/StatusPageSection.d.ts.map +1 -0
  563. package/lib/Incidents/StatusPageSection.js +65 -0
  564. package/lib/Incidents/StatusPageSection.js.map +1 -0
  565. package/lib/Incidents/StatusPageSubscriber.d.ts +93 -0
  566. package/lib/Incidents/StatusPageSubscriber.d.ts.map +1 -0
  567. package/lib/Incidents/StatusPageSubscriber.js +100 -0
  568. package/lib/Incidents/StatusPageSubscriber.js.map +1 -0
  569. package/lib/Incidents/index.d.ts +108 -0
  570. package/lib/Incidents/index.d.ts.map +1 -0
  571. package/lib/Incidents/index.js +143 -0
  572. package/lib/Incidents/index.js.map +1 -0
  573. package/lib/Incidents/integrationFields.d.ts +124 -0
  574. package/lib/Incidents/integrationFields.d.ts.map +1 -0
  575. package/lib/Incidents/integrationFields.js +74 -0
  576. package/lib/Incidents/integrationFields.js.map +1 -0
  577. package/lib/Providers.d.ts +36 -0
  578. package/lib/Providers.d.ts.map +1 -0
  579. package/lib/Providers.js +54 -0
  580. package/lib/Providers.js.map +1 -0
  581. package/lib/Telemetry/Alert.d.ts +99 -0
  582. package/lib/Telemetry/Alert.d.ts.map +1 -0
  583. package/lib/Telemetry/Alert.js +91 -0
  584. package/lib/Telemetry/Alert.js.map +1 -0
  585. package/lib/Telemetry/AwsLogGroupSubscription.d.ts +57 -0
  586. package/lib/Telemetry/AwsLogGroupSubscription.d.ts.map +1 -0
  587. package/lib/Telemetry/AwsLogGroupSubscription.js +57 -0
  588. package/lib/Telemetry/AwsLogGroupSubscription.js.map +1 -0
  589. package/lib/Telemetry/BindingHttp.d.ts +23 -0
  590. package/lib/Telemetry/BindingHttp.d.ts.map +1 -0
  591. package/lib/Telemetry/BindingHttp.js +25 -0
  592. package/lib/Telemetry/BindingHttp.js.map +1 -0
  593. package/lib/Telemetry/Chart.d.ts +171 -0
  594. package/lib/Telemetry/Chart.d.ts.map +1 -0
  595. package/lib/Telemetry/Chart.js +92 -0
  596. package/lib/Telemetry/Chart.js.map +1 -0
  597. package/lib/Telemetry/Collector.d.ts +78 -0
  598. package/lib/Telemetry/Collector.d.ts.map +1 -0
  599. package/lib/Telemetry/Collector.js +111 -0
  600. package/lib/Telemetry/Collector.js.map +1 -0
  601. package/lib/Telemetry/CollectorTarget.d.ts +69 -0
  602. package/lib/Telemetry/CollectorTarget.d.ts.map +1 -0
  603. package/lib/Telemetry/CollectorTarget.js +69 -0
  604. package/lib/Telemetry/CollectorTarget.js.map +1 -0
  605. package/lib/Telemetry/Connection.d.ts +79 -0
  606. package/lib/Telemetry/Connection.d.ts.map +1 -0
  607. package/lib/Telemetry/Connection.js +128 -0
  608. package/lib/Telemetry/Connection.js.map +1 -0
  609. package/lib/Telemetry/Dashboard.d.ts +108 -0
  610. package/lib/Telemetry/Dashboard.d.ts.map +1 -0
  611. package/lib/Telemetry/Dashboard.js +112 -0
  612. package/lib/Telemetry/Dashboard.js.map +1 -0
  613. package/lib/Telemetry/DashboardChart.d.ts +104 -0
  614. package/lib/Telemetry/DashboardChart.d.ts.map +1 -0
  615. package/lib/Telemetry/DashboardChart.js +119 -0
  616. package/lib/Telemetry/DashboardChart.js.map +1 -0
  617. package/lib/Telemetry/DashboardGroup.d.ts +53 -0
  618. package/lib/Telemetry/DashboardGroup.d.ts.map +1 -0
  619. package/lib/Telemetry/DashboardGroup.js +47 -0
  620. package/lib/Telemetry/DashboardGroup.js.map +1 -0
  621. package/lib/Telemetry/DashboardSection.d.ts +65 -0
  622. package/lib/Telemetry/DashboardSection.d.ts.map +1 -0
  623. package/lib/Telemetry/DashboardSection.js +65 -0
  624. package/lib/Telemetry/DashboardSection.js.map +1 -0
  625. package/lib/Telemetry/Exploration.d.ts +77 -0
  626. package/lib/Telemetry/Exploration.d.ts.map +1 -0
  627. package/lib/Telemetry/Exploration.js +97 -0
  628. package/lib/Telemetry/Exploration.js.map +1 -0
  629. package/lib/Telemetry/ExplorationGroup.d.ts +58 -0
  630. package/lib/Telemetry/ExplorationGroup.d.ts.map +1 -0
  631. package/lib/Telemetry/ExplorationGroup.js +52 -0
  632. package/lib/Telemetry/ExplorationGroup.js.map +1 -0
  633. package/lib/Telemetry/Export.d.ts +183 -0
  634. package/lib/Telemetry/Export.d.ts.map +1 -0
  635. package/lib/Telemetry/Export.js +152 -0
  636. package/lib/Telemetry/Export.js.map +1 -0
  637. package/lib/Telemetry/ExtractedMetric.d.ts +67 -0
  638. package/lib/Telemetry/ExtractedMetric.d.ts.map +1 -0
  639. package/lib/Telemetry/ExtractedMetric.js +66 -0
  640. package/lib/Telemetry/ExtractedMetric.js.map +1 -0
  641. package/lib/Telemetry/IngestLogs.d.ts +87 -0
  642. package/lib/Telemetry/IngestLogs.d.ts.map +1 -0
  643. package/lib/Telemetry/IngestLogs.js +3 -0
  644. package/lib/Telemetry/IngestLogs.js.map +1 -0
  645. package/lib/Telemetry/IngestLogsHttp.d.ts +12 -0
  646. package/lib/Telemetry/IngestLogsHttp.d.ts.map +1 -0
  647. package/lib/Telemetry/IngestLogsHttp.js +21 -0
  648. package/lib/Telemetry/IngestLogsHttp.js.map +1 -0
  649. package/lib/Telemetry/IngestMetrics.d.ts +68 -0
  650. package/lib/Telemetry/IngestMetrics.d.ts.map +1 -0
  651. package/lib/Telemetry/IngestMetrics.js +3 -0
  652. package/lib/Telemetry/IngestMetrics.js.map +1 -0
  653. package/lib/Telemetry/IngestMetricsHttp.d.ts +12 -0
  654. package/lib/Telemetry/IngestMetricsHttp.d.ts.map +1 -0
  655. package/lib/Telemetry/IngestMetricsHttp.js +21 -0
  656. package/lib/Telemetry/IngestMetricsHttp.js.map +1 -0
  657. package/lib/Telemetry/OtelHeaders.d.ts +36 -0
  658. package/lib/Telemetry/OtelHeaders.d.ts.map +1 -0
  659. package/lib/Telemetry/OtelHeaders.js +34 -0
  660. package/lib/Telemetry/OtelHeaders.js.map +1 -0
  661. package/lib/Telemetry/Query.d.ts +66 -0
  662. package/lib/Telemetry/Query.d.ts.map +1 -0
  663. package/lib/Telemetry/Query.js +3 -0
  664. package/lib/Telemetry/Query.js.map +1 -0
  665. package/lib/Telemetry/QueryHttp.d.ts +12 -0
  666. package/lib/Telemetry/QueryHttp.d.ts.map +1 -0
  667. package/lib/Telemetry/QueryHttp.js +24 -0
  668. package/lib/Telemetry/QueryHttp.js.map +1 -0
  669. package/lib/Telemetry/Reference.d.ts +115 -0
  670. package/lib/Telemetry/Reference.d.ts.map +1 -0
  671. package/lib/Telemetry/Reference.js +110 -0
  672. package/lib/Telemetry/Reference.js.map +1 -0
  673. package/lib/Telemetry/ShipLogs.d.ts +89 -0
  674. package/lib/Telemetry/ShipLogs.d.ts.map +1 -0
  675. package/lib/Telemetry/ShipLogs.js +119 -0
  676. package/lib/Telemetry/ShipLogs.js.map +1 -0
  677. package/lib/Telemetry/Source.d.ts +184 -0
  678. package/lib/Telemetry/Source.d.ts.map +1 -0
  679. package/lib/Telemetry/Source.js +238 -0
  680. package/lib/Telemetry/Source.js.map +1 -0
  681. package/lib/Telemetry/SourceAwsAccount.d.ts +73 -0
  682. package/lib/Telemetry/SourceAwsAccount.d.ts.map +1 -0
  683. package/lib/Telemetry/SourceAwsAccount.js +57 -0
  684. package/lib/Telemetry/SourceAwsAccount.js.map +1 -0
  685. package/lib/Telemetry/SourceGcpProject.d.ts +81 -0
  686. package/lib/Telemetry/SourceGcpProject.d.ts.map +1 -0
  687. package/lib/Telemetry/SourceGcpProject.js +69 -0
  688. package/lib/Telemetry/SourceGcpProject.js.map +1 -0
  689. package/lib/Telemetry/SourceGroup.d.ts +65 -0
  690. package/lib/Telemetry/SourceGroup.d.ts.map +1 -0
  691. package/lib/Telemetry/SourceGroup.js +67 -0
  692. package/lib/Telemetry/SourceGroup.js.map +1 -0
  693. package/lib/Telemetry/customBucket.d.ts +26 -0
  694. package/lib/Telemetry/customBucket.d.ts.map +1 -0
  695. package/lib/Telemetry/customBucket.js +45 -0
  696. package/lib/Telemetry/customBucket.js.map +1 -0
  697. package/lib/Telemetry/index.d.ts +64 -0
  698. package/lib/Telemetry/index.d.ts.map +1 -0
  699. package/lib/Telemetry/index.js +81 -0
  700. package/lib/Telemetry/index.js.map +1 -0
  701. package/lib/index.d.ts +14 -0
  702. package/lib/index.d.ts.map +1 -0
  703. package/lib/index.js +14 -0
  704. package/lib/index.js.map +1 -0
  705. package/lib/internal/DeployRetry.d.ts +19 -0
  706. package/lib/internal/DeployRetry.d.ts.map +1 -0
  707. package/lib/internal/DeployRetry.js +52 -0
  708. package/lib/internal/DeployRetry.js.map +1 -0
  709. package/lib/internal/actionWait.d.ts +12 -0
  710. package/lib/internal/actionWait.d.ts.map +1 -0
  711. package/lib/internal/actionWait.js +21 -0
  712. package/lib/internal/actionWait.js.map +1 -0
  713. package/lib/internal/applicationIds.d.ts +17 -0
  714. package/lib/internal/applicationIds.d.ts.map +1 -0
  715. package/lib/internal/applicationIds.js +12 -0
  716. package/lib/internal/applicationIds.js.map +1 -0
  717. package/lib/internal/attachments.d.ts +23 -0
  718. package/lib/internal/attachments.d.ts.map +1 -0
  719. package/lib/internal/attachments.js +22 -0
  720. package/lib/internal/attachments.js.map +1 -0
  721. package/lib/internal/budget.d.ts +46 -0
  722. package/lib/internal/budget.d.ts.map +1 -0
  723. package/lib/internal/budget.js +44 -0
  724. package/lib/internal/budget.js.map +1 -0
  725. package/lib/internal/connection.d.ts +65 -0
  726. package/lib/internal/connection.d.ts.map +1 -0
  727. package/lib/internal/connection.js +160 -0
  728. package/lib/internal/connection.js.map +1 -0
  729. package/lib/internal/crud.d.ts +195 -0
  730. package/lib/internal/crud.d.ts.map +1 -0
  731. package/lib/internal/crud.js +614 -0
  732. package/lib/internal/crud.js.map +1 -0
  733. package/lib/internal/errors.d.ts +35 -0
  734. package/lib/internal/errors.d.ts.map +1 -0
  735. package/lib/internal/errors.js +19 -0
  736. package/lib/internal/errors.js.map +1 -0
  737. package/lib/internal/fields.d.ts +47 -0
  738. package/lib/internal/fields.d.ts.map +1 -0
  739. package/lib/internal/fields.js +136 -0
  740. package/lib/internal/fields.js.map +1 -0
  741. package/lib/internal/gone.d.ts +13 -0
  742. package/lib/internal/gone.d.ts.map +1 -0
  743. package/lib/internal/gone.js +14 -0
  744. package/lib/internal/gone.js.map +1 -0
  745. package/lib/internal/managedDatabase.d.ts +137 -0
  746. package/lib/internal/managedDatabase.d.ts.map +1 -0
  747. package/lib/internal/managedDatabase.js +186 -0
  748. package/lib/internal/managedDatabase.js.map +1 -0
  749. package/lib/internal/managedService.d.ts +184 -0
  750. package/lib/internal/managedService.d.ts.map +1 -0
  751. package/lib/internal/managedService.js +208 -0
  752. package/lib/internal/managedService.js.map +1 -0
  753. package/lib/internal/migrations.d.ts +138 -0
  754. package/lib/internal/migrations.d.ts.map +1 -0
  755. package/lib/internal/migrations.js +288 -0
  756. package/lib/internal/migrations.js.map +1 -0
  757. package/lib/internal/ops.d.ts +43 -0
  758. package/lib/internal/ops.d.ts.map +1 -0
  759. package/lib/internal/ops.js +46 -0
  760. package/lib/internal/ops.js.map +1 -0
  761. package/lib/internal/ownership.d.ts +55 -0
  762. package/lib/internal/ownership.d.ts.map +1 -0
  763. package/lib/internal/ownership.js +74 -0
  764. package/lib/internal/ownership.js.map +1 -0
  765. package/lib/internal/reference.d.ts +36 -0
  766. package/lib/internal/reference.d.ts.map +1 -0
  767. package/lib/internal/reference.js +49 -0
  768. package/lib/internal/reference.js.map +1 -0
  769. package/lib/internal/scope.d.ts +51 -0
  770. package/lib/internal/scope.d.ts.map +1 -0
  771. package/lib/internal/scope.js +34 -0
  772. package/lib/internal/scope.js.map +1 -0
  773. package/lib/internal/snapshot.d.ts +120 -0
  774. package/lib/internal/snapshot.d.ts.map +1 -0
  775. package/lib/internal/snapshot.js +92 -0
  776. package/lib/internal/snapshot.js.map +1 -0
  777. package/lib/internal/unpaged.d.ts +22 -0
  778. package/lib/internal/unpaged.d.ts.map +1 -0
  779. package/lib/internal/unpaged.js +17 -0
  780. package/lib/internal/unpaged.js.map +1 -0
  781. package/lib/internal/wait.d.ts +55 -0
  782. package/lib/internal/wait.d.ts.map +1 -0
  783. package/lib/internal/wait.js +56 -0
  784. package/lib/internal/wait.js.map +1 -0
  785. package/lib/sdk/credentials.d.ts +97 -0
  786. package/lib/sdk/credentials.d.ts.map +1 -0
  787. package/lib/sdk/credentials.js +135 -0
  788. package/lib/sdk/credentials.js.map +1 -0
  789. package/lib/sdk/errors.d.ts +98 -0
  790. package/lib/sdk/errors.d.ts.map +1 -0
  791. package/lib/sdk/errors.js +86 -0
  792. package/lib/sdk/errors.js.map +1 -0
  793. package/lib/sdk/index.d.ts +49 -0
  794. package/lib/sdk/index.d.ts.map +1 -0
  795. package/lib/sdk/index.js +49 -0
  796. package/lib/sdk/index.js.map +1 -0
  797. package/lib/sdk/pagination.d.ts +35 -0
  798. package/lib/sdk/pagination.d.ts.map +1 -0
  799. package/lib/sdk/pagination.js +80 -0
  800. package/lib/sdk/pagination.js.map +1 -0
  801. package/lib/sdk/protocol.d.ts +109 -0
  802. package/lib/sdk/protocol.d.ts.map +1 -0
  803. package/lib/sdk/protocol.js +451 -0
  804. package/lib/sdk/protocol.js.map +1 -0
  805. package/lib/sdk/retry.d.ts +32 -0
  806. package/lib/sdk/retry.d.ts.map +1 -0
  807. package/lib/sdk/retry.js +33 -0
  808. package/lib/sdk/retry.js.map +1 -0
  809. package/lib/sdk/services/account.d.ts +372 -0
  810. package/lib/sdk/services/account.d.ts.map +1 -0
  811. package/lib/sdk/services/account.js +553 -0
  812. package/lib/sdk/services/account.js.map +1 -0
  813. package/lib/sdk/services/cloud.d.ts +11910 -0
  814. package/lib/sdk/services/cloud.d.ts.map +1 -0
  815. package/lib/sdk/services/cloud.js +18446 -0
  816. package/lib/sdk/services/cloud.js.map +1 -0
  817. package/lib/sdk/services/errors.d.ts +2203 -0
  818. package/lib/sdk/services/errors.d.ts.map +1 -0
  819. package/lib/sdk/services/errors.js +2676 -0
  820. package/lib/sdk/services/errors.js.map +1 -0
  821. package/lib/sdk/services/heartbeat.d.ts +36 -0
  822. package/lib/sdk/services/heartbeat.d.ts.map +1 -0
  823. package/lib/sdk/services/heartbeat.js +94 -0
  824. package/lib/sdk/services/heartbeat.js.map +1 -0
  825. package/lib/sdk/services/incidents.d.ts +9948 -0
  826. package/lib/sdk/services/incidents.d.ts.map +1 -0
  827. package/lib/sdk/services/incidents.js +9730 -0
  828. package/lib/sdk/services/incidents.js.map +1 -0
  829. package/lib/sdk/services/index.d.ts +8 -0
  830. package/lib/sdk/services/index.d.ts.map +1 -0
  831. package/lib/sdk/services/index.js +9 -0
  832. package/lib/sdk/services/index.js.map +1 -0
  833. package/lib/sdk/services/ingest.d.ts +158 -0
  834. package/lib/sdk/services/ingest.d.ts.map +1 -0
  835. package/lib/sdk/services/ingest.js +200 -0
  836. package/lib/sdk/services/ingest.js.map +1 -0
  837. package/lib/sdk/services/telemetry.d.ts +6789 -0
  838. package/lib/sdk/services/telemetry.d.ts.map +1 -0
  839. package/lib/sdk/services/telemetry.js +5613 -0
  840. package/lib/sdk/services/telemetry.js.map +1 -0
  841. package/lib/sdk/traits.d.ts +26 -0
  842. package/lib/sdk/traits.d.ts.map +1 -0
  843. package/lib/sdk/traits.js +15 -0
  844. package/lib/sdk/traits.js.map +1 -0
  845. package/package.json +190 -4
  846. package/src/Account/Reference.ts +120 -0
  847. package/src/Account/Team.ts +106 -0
  848. package/src/Account/TeamMember.ts +218 -0
  849. package/src/Account/index.ts +27 -0
  850. package/src/AuthProvider.ts +172 -0
  851. package/src/BetterStackBindings.ts +447 -0
  852. package/src/Cloud/Bootstrap.ts +116 -0
  853. package/src/Cloud/Certificate.ts +146 -0
  854. package/src/Cloud/ClickHouse.ts +272 -0
  855. package/src/Cloud/ClickHouseScheduledSnapshot.ts +114 -0
  856. package/src/Cloud/ClickHouseSnapshot.ts +137 -0
  857. package/src/Cloud/Firewall.ts +277 -0
  858. package/src/Cloud/FirewallRule.ts +175 -0
  859. package/src/Cloud/InferEnv.ts +30 -0
  860. package/src/Cloud/Kafka.ts +301 -0
  861. package/src/Cloud/KafkaTopic.ts +129 -0
  862. package/src/Cloud/KafkaUser.ts +175 -0
  863. package/src/Cloud/KubernetesCluster.ts +312 -0
  864. package/src/Cloud/KubernetesNodePool.ts +196 -0
  865. package/src/Cloud/KubernetesScheduledSnapshot.ts +116 -0
  866. package/src/Cloud/LoadBalancer.ts +336 -0
  867. package/src/Cloud/LoadBalancerService.ts +181 -0
  868. package/src/Cloud/LoadBalancerTarget.ts +203 -0
  869. package/src/Cloud/MountVolume.ts +167 -0
  870. package/src/Cloud/MySQL.ts +363 -0
  871. package/src/Cloud/MySQLScheduledSnapshot.ts +111 -0
  872. package/src/Cloud/MySQLSnapshot.ts +133 -0
  873. package/src/Cloud/Network.ts +116 -0
  874. package/src/Cloud/ObjectCache.ts +420 -0
  875. package/src/Cloud/ObjectCacheBucket.ts +197 -0
  876. package/src/Cloud/Otlp.ts +131 -0
  877. package/src/Cloud/PlacementGroup.ts +132 -0
  878. package/src/Cloud/Postgres.ts +410 -0
  879. package/src/Cloud/PostgresDatabase.ts +118 -0
  880. package/src/Cloud/PostgresScheduledSnapshot.ts +111 -0
  881. package/src/Cloud/PostgresSnapshot.ts +133 -0
  882. package/src/Cloud/PostgresUser.ts +175 -0
  883. package/src/Cloud/Reference.ts +743 -0
  884. package/src/Cloud/ReservedIp.ts +214 -0
  885. package/src/Cloud/ScheduledSnapshot.ts +75 -0
  886. package/src/Cloud/ScheduledVolumeSnapshot.ts +76 -0
  887. package/src/Cloud/Server.ts +1469 -0
  888. package/src/Cloud/ServerPool.ts +100 -0
  889. package/src/Cloud/ServerPrivateIp.ts +109 -0
  890. package/src/Cloud/Service.ts +1101 -0
  891. package/src/Cloud/ServiceHandler.ts +113 -0
  892. package/src/Cloud/Snapshot.ts +161 -0
  893. package/src/Cloud/Ssh.ts +528 -0
  894. package/src/Cloud/SshKey.ts +241 -0
  895. package/src/Cloud/Valkey.ts +284 -0
  896. package/src/Cloud/ValkeyScheduledSnapshot.ts +112 -0
  897. package/src/Cloud/ValkeySnapshot.ts +135 -0
  898. package/src/Cloud/Volume.ts +522 -0
  899. package/src/Cloud/VolumeSnapshot.ts +153 -0
  900. package/src/Cloud/Webhook.ts +145 -0
  901. package/src/Cloud/Website/Astro.ts +118 -0
  902. package/src/Cloud/Website/Foldkit.ts +78 -0
  903. package/src/Cloud/Website/FrameworkSite.ts +499 -0
  904. package/src/Cloud/Website/Nextjs.ts +70 -0
  905. package/src/Cloud/Website/Nuxt.ts +72 -0
  906. package/src/Cloud/Website/Octane.ts +63 -0
  907. package/src/Cloud/Website/Providers.ts +20 -0
  908. package/src/Cloud/Website/ReactRouter.ts +96 -0
  909. package/src/Cloud/Website/SolidStart.ts +109 -0
  910. package/src/Cloud/Website/StaticSite.ts +273 -0
  911. package/src/Cloud/Website/SvelteKit.ts +71 -0
  912. package/src/Cloud/Website/TanStackStart.ts +91 -0
  913. package/src/Cloud/Website/Vinext.ts +79 -0
  914. package/src/Cloud/Website/Vite.ts +131 -0
  915. package/src/Cloud/Website/Vocs.ts +69 -0
  916. package/src/Cloud/Website/Waku.ts +76 -0
  917. package/src/Cloud/Website/index.ts +16 -0
  918. package/src/Cloud/hosted.ts +1022 -0
  919. package/src/Cloud/index.ts +223 -0
  920. package/src/Contributions.ts +15 -0
  921. package/src/Credentials.ts +70 -0
  922. package/src/Errors/Application.ts +208 -0
  923. package/src/Errors/ApplicationGroup.ts +119 -0
  924. package/src/Errors/Dsn.ts +119 -0
  925. package/src/Errors/JiraIntegration.ts +108 -0
  926. package/src/Errors/LinearIntegration.ts +112 -0
  927. package/src/Errors/MicrosoftTeamsIntegration.ts +121 -0
  928. package/src/Errors/Reference.ts +189 -0
  929. package/src/Errors/RegisterRelease.ts +77 -0
  930. package/src/Errors/RegisterReleaseHttp.ts +47 -0
  931. package/src/Errors/Release.ts +241 -0
  932. package/src/Errors/SlackIntegration.ts +105 -0
  933. package/src/Errors/index.ts +60 -0
  934. package/src/Incidents/AcknowledgeIncident.ts +78 -0
  935. package/src/Incidents/AcknowledgeIncidentHttp.ts +28 -0
  936. package/src/Incidents/AmazonSnsIntegration.ts +134 -0
  937. package/src/Incidents/AwsCloudWatchIntegration.ts +99 -0
  938. package/src/Incidents/AzureIntegration.ts +95 -0
  939. package/src/Incidents/BindingHttp.ts +62 -0
  940. package/src/Incidents/CatalogRecord.ts +106 -0
  941. package/src/Incidents/CatalogRelation.ts +111 -0
  942. package/src/Incidents/CreateIncident.ts +81 -0
  943. package/src/Incidents/CreateIncidentHttp.ts +28 -0
  944. package/src/Incidents/CreateStatusReport.ts +88 -0
  945. package/src/Incidents/CreateStatusReportHttp.ts +35 -0
  946. package/src/Incidents/CreateStatusUpdate.ts +84 -0
  947. package/src/Incidents/CreateStatusUpdateHttp.ts +35 -0
  948. package/src/Incidents/DatadogIntegration.ts +102 -0
  949. package/src/Incidents/ElasticIntegration.ts +94 -0
  950. package/src/Incidents/EscalationPolicy.ts +144 -0
  951. package/src/Incidents/EscalationPolicyGroup.ts +82 -0
  952. package/src/Incidents/FailHeartbeat.ts +55 -0
  953. package/src/Incidents/FailHeartbeatHttp.ts +28 -0
  954. package/src/Incidents/GoogleMonitoringIntegration.ts +98 -0
  955. package/src/Incidents/GrafanaIntegration.ts +105 -0
  956. package/src/Incidents/Heartbeat.ts +143 -0
  957. package/src/Incidents/HeartbeatGroup.ts +83 -0
  958. package/src/Incidents/IncomingEmailIntegration.ts +120 -0
  959. package/src/Incidents/IncomingWebhookIntegration.ts +141 -0
  960. package/src/Incidents/JiraIntegration.ts +83 -0
  961. package/src/Incidents/LinearIntegration.ts +94 -0
  962. package/src/Incidents/Metadata.ts +133 -0
  963. package/src/Incidents/Monitor.ts +150 -0
  964. package/src/Incidents/MonitorGroup.ts +91 -0
  965. package/src/Incidents/NewRelicIntegration.ts +102 -0
  966. package/src/Incidents/OnCallRotation.ts +295 -0
  967. package/src/Incidents/OnCallSchedule.ts +115 -0
  968. package/src/Incidents/OutgoingEmailIntegration.ts +84 -0
  969. package/src/Incidents/OutgoingPagerDutyIntegration.ts +78 -0
  970. package/src/Incidents/OutgoingWebhookIntegration.ts +147 -0
  971. package/src/Incidents/PrometheusIntegration.ts +109 -0
  972. package/src/Incidents/Reference.ts +210 -0
  973. package/src/Incidents/ReportHeartbeat.ts +149 -0
  974. package/src/Incidents/ReportHeartbeatHttp.ts +30 -0
  975. package/src/Incidents/ResolveIncident.ts +74 -0
  976. package/src/Incidents/ResolveIncidentHttp.ts +28 -0
  977. package/src/Incidents/SendHeartbeat.ts +62 -0
  978. package/src/Incidents/SendHeartbeatHttp.ts +28 -0
  979. package/src/Incidents/Severity.ts +123 -0
  980. package/src/Incidents/SeverityGroup.ts +82 -0
  981. package/src/Incidents/SplunkOnCallIntegration.ts +76 -0
  982. package/src/Incidents/StatusPage.ts +178 -0
  983. package/src/Incidents/StatusPageGroup.ts +81 -0
  984. package/src/Incidents/StatusPageResource.ts +128 -0
  985. package/src/Incidents/StatusPageSection.ts +105 -0
  986. package/src/Incidents/StatusPageSubscriber.ts +163 -0
  987. package/src/Incidents/index.ts +213 -0
  988. package/src/Incidents/integrationFields.ts +174 -0
  989. package/src/Providers.ts +78 -0
  990. package/src/Telemetry/Alert.ts +135 -0
  991. package/src/Telemetry/AwsLogGroupSubscription.ts +97 -0
  992. package/src/Telemetry/BindingHttp.ts +40 -0
  993. package/src/Telemetry/Chart.ts +251 -0
  994. package/src/Telemetry/Collector.ts +157 -0
  995. package/src/Telemetry/CollectorTarget.ts +108 -0
  996. package/src/Telemetry/Connection.ts +182 -0
  997. package/src/Telemetry/Dashboard.ts +152 -0
  998. package/src/Telemetry/DashboardChart.ts +177 -0
  999. package/src/Telemetry/DashboardGroup.ts +86 -0
  1000. package/src/Telemetry/DashboardSection.ts +115 -0
  1001. package/src/Telemetry/Exploration.ts +139 -0
  1002. package/src/Telemetry/ExplorationGroup.ts +93 -0
  1003. package/src/Telemetry/Export.ts +263 -0
  1004. package/src/Telemetry/ExtractedMetric.ts +112 -0
  1005. package/src/Telemetry/IngestLogs.ts +95 -0
  1006. package/src/Telemetry/IngestLogsHttp.ts +28 -0
  1007. package/src/Telemetry/IngestMetrics.ts +76 -0
  1008. package/src/Telemetry/IngestMetricsHttp.ts +28 -0
  1009. package/src/Telemetry/OtelHeaders.ts +52 -0
  1010. package/src/Telemetry/Query.ts +75 -0
  1011. package/src/Telemetry/QueryHttp.ts +40 -0
  1012. package/src/Telemetry/Reference.ts +164 -0
  1013. package/src/Telemetry/ShipLogs.ts +162 -0
  1014. package/src/Telemetry/Source.ts +328 -0
  1015. package/src/Telemetry/SourceAwsAccount.ts +110 -0
  1016. package/src/Telemetry/SourceGcpProject.ts +125 -0
  1017. package/src/Telemetry/SourceGroup.ts +111 -0
  1018. package/src/Telemetry/customBucket.ts +62 -0
  1019. package/src/Telemetry/index.ts +104 -0
  1020. package/src/globals.d.ts +4 -0
  1021. package/src/index.ts +13 -0
  1022. package/src/internal/DeployRetry.ts +64 -0
  1023. package/src/internal/actionWait.ts +23 -0
  1024. package/src/internal/applicationIds.ts +21 -0
  1025. package/src/internal/attachments.ts +40 -0
  1026. package/src/internal/budget.ts +69 -0
  1027. package/src/internal/connection.ts +233 -0
  1028. package/src/internal/crud.ts +1053 -0
  1029. package/src/internal/errors.ts +32 -0
  1030. package/src/internal/fields.ts +162 -0
  1031. package/src/internal/gone.ts +19 -0
  1032. package/src/internal/managedDatabase.ts +331 -0
  1033. package/src/internal/managedService.ts +419 -0
  1034. package/src/internal/migrations.ts +484 -0
  1035. package/src/internal/ops.ts +86 -0
  1036. package/src/internal/ownership.ts +84 -0
  1037. package/src/internal/reference.ts +100 -0
  1038. package/src/internal/scope.ts +84 -0
  1039. package/src/internal/snapshot.ts +170 -0
  1040. package/src/internal/unpaged.ts +29 -0
  1041. package/src/internal/wait.ts +88 -0
  1042. package/src/sdk/credentials.ts +222 -0
  1043. package/src/sdk/errors.ts +125 -0
  1044. package/src/sdk/index.ts +69 -0
  1045. package/src/sdk/pagination.ts +100 -0
  1046. package/src/sdk/protocol.ts +565 -0
  1047. package/src/sdk/retry.ts +50 -0
  1048. package/src/sdk/services/account.ts +1079 -0
  1049. package/src/sdk/services/cloud.ts +38638 -0
  1050. package/src/sdk/services/errors.ts +6182 -0
  1051. package/src/sdk/services/heartbeat.ts +144 -0
  1052. package/src/sdk/services/incidents.ts +25835 -0
  1053. package/src/sdk/services/index.ts +8 -0
  1054. package/src/sdk/services/ingest.ts +383 -0
  1055. package/src/sdk/services/telemetry.ts +14868 -0
  1056. package/src/sdk/traits.ts +77 -0
@@ -0,0 +1,1101 @@
1
+ // Adapted from @alchemy.run/hetzner@2.0.0-beta.87 (Apache-2.0), src/Service.ts; modified.
2
+ import { DockerLive } from "@alchemy.run/docker/Docker";
3
+ import {
4
+ buildImageArchive,
5
+ hashImageArchive,
6
+ type ImageArchiveSource,
7
+ } from "@alchemy.run/docker/ImageArchive";
8
+ import * as Bundle from "alchemy/Bundle/Bundle";
9
+ import { diffBindings, havePropsChanged, isResolved } from "alchemy/Diff";
10
+ import type { InputProps } from "alchemy/Input";
11
+ import { createPhysicalName } from "alchemy/PhysicalName";
12
+ import { Platform, type Main, type PlatformIdentity, type PlatformProps } from "alchemy/Platform";
13
+ import * as Provider from "alchemy/Provider";
14
+ import { Resource, type ResourceBinding } from "alchemy/Resource";
15
+ import type { ServerHost } from "alchemy/Runtime/Process";
16
+ import { Stack } from "alchemy/Stack";
17
+ import * as Context from "effect/Context";
18
+ import * as Data from "effect/Data";
19
+ import * as Duration from "effect/Duration";
20
+ import * as Effect from "effect/Effect";
21
+ import * as FileSystem from "effect/FileSystem";
22
+ import * as Redacted from "effect/Redacted";
23
+ import * as Semaphore from "effect/Semaphore";
24
+ import { budgetsFor, type WaitBudget } from "../internal/budget.ts";
25
+ import type { Providers } from "../Providers.ts";
26
+ import * as Cloud from "../sdk/services/cloud.ts";
27
+ import {
28
+ appDirOf,
29
+ classifyExit,
30
+ collectBindingState,
31
+ composeEnv,
32
+ containerEnvFile,
33
+ createCloudHostedSupport,
34
+ createCloudHostRuntimeContext,
35
+ dockerScript,
36
+ ensureAttached,
37
+ healthScript,
38
+ mountScript,
39
+ nodeScript,
40
+ removeScript,
41
+ renderImageUnit,
42
+ renderUnit,
43
+ startImageScript,
44
+ startScript,
45
+ systemdEnvFile,
46
+ toolsScript,
47
+ unmountScript,
48
+ waitForSsh,
49
+ ServiceStepTimeout,
50
+ type BoundVolume,
51
+ type CloudBuildOptions,
52
+ type CloudHostRuntimeContext,
53
+ } from "./hosted.ts";
54
+ import { isValidMountPath, MountPathInvalid, type ServiceBinding } from "./MountVolume.ts";
55
+ import type { Server } from "./Server.ts";
56
+ import {
57
+ openSshClient,
58
+ shellQuote,
59
+ sshHostOf,
60
+ SshConnector,
61
+ type SshConnect,
62
+ type SshServices,
63
+ type SshSession,
64
+ } from "./Ssh.ts";
65
+
66
+ export {
67
+ InvalidEnvKey,
68
+ MountVolumeError,
69
+ ServiceHostSetupFailed,
70
+ ServiceNotHealthy,
71
+ ServiceStepTimeout,
72
+ type CloudBuildOptions,
73
+ } from "./hosted.ts";
74
+
75
+ const TYPE = "BetterStack.Cloud.Service";
76
+
77
+ /**
78
+ * A resource-valued prop: the resource itself, or an Effect that produces
79
+ * it (so `yield* Server(...)` and a module-scope `Server(...)` both type-check).
80
+ */
81
+ type Ref<T> = T | Effect.Effect<T, never, Providers>;
82
+
83
+ /** Props of {@link Service}. */
84
+ export interface ServiceProps<
85
+ Env extends Record<string, any> = Record<string, any>,
86
+ > extends PlatformProps {
87
+ /**
88
+ * The `Cloud.Server` this Service runs on: the resource, or an Effect that
89
+ * produces it (a module-scope `Cloud.Server(...)` declaration). The server
90
+ * must have Alchemy's deploy key (the default `bootstrap: true`); a server
91
+ * with its own `userData` works too, and the deploy installs Node.js over
92
+ * SSH when it is missing. Changing the server replaces the Service.
93
+ */
94
+ server: Ref<Server>;
95
+ /**
96
+ * Module entrypoint, usually `import.meta.url`. Bundled with Rolldown
97
+ * into one ESM file and run by `node` under systemd. Set this or
98
+ * {@link context}.
99
+ */
100
+ main?: string;
101
+ /**
102
+ * A Docker build context the Service runs as a container instead of a
103
+ * bundled `main`: built on the deploying machine for {@link platform},
104
+ * copied over SSH, loaded into Docker (installed if missing) and run under
105
+ * systemd on the host network. The image's own `CMD` runs, with
106
+ * {@link env}. Set this or {@link main}.
107
+ */
108
+ context?: string;
109
+ /**
110
+ * The Dockerfile for {@link context}, relative to it unless absolute.
111
+ * @default "Dockerfile"
112
+ */
113
+ dockerfile?: string;
114
+ /**
115
+ * The platform a {@link context} image is built for.
116
+ * @default "linux/amd64"
117
+ */
118
+ platform?: "linux/amd64" | "linux/arm64";
119
+ /**
120
+ * Port the HTTP server listens on. Written to `PORT`, gates the deploy on
121
+ * `GET http://127.0.0.1:<port>/health`, and builds the `url` attribute.
122
+ * Leave it out for a background Service (the bootstrap still serves a
123
+ * returned `fetch` on 3000, without the health gate).
124
+ *
125
+ * @default 3000
126
+ */
127
+ port?: number;
128
+ /**
129
+ * Named export of `main` to run.
130
+ *
131
+ * @default "default"
132
+ */
133
+ handler?: string;
134
+ /**
135
+ * Environment variables of the process, written to the unit's
136
+ * `EnvironmentFile` (mode 0600 under `/opt/<unitName>/env`). Values may be
137
+ * strings, `Redacted` secrets (written in clear text to that file only,
138
+ * never to logs or attributes), Outputs of other resources, or anything
139
+ * JSON-serializable. Merged after binding-injected env and Alchemy's own
140
+ * (`ALCHEMY_STACK_NAME`, `ALCHEMY_STAGE`, `PORT`), so these win.
141
+ */
142
+ env?: Env;
143
+ /**
144
+ * Bundler configuration for `main`: rolldown `input`/`output` overrides,
145
+ * pure-annotation options (`pure`), and `install` for packages that must
146
+ * ship as real `node_modules` (installed with `npm` on the server).
147
+ */
148
+ build?: CloudBuildOptions;
149
+ /**
150
+ * Extra local files or directories packed into the unit's archive next to
151
+ * the entry (e.g. static assets). Hashed into `code.hash`, so a change
152
+ * redeploys. `destination` is relative to `/opt/<unitName>/`.
153
+ */
154
+ extraFiles?: ReadonlyArray<{ source: string; destination: string }>;
155
+ /**
156
+ * `main` is an already-built Node program (a framework's server output):
157
+ * copy it and {@link extraFiles} as they are instead of bundling.
158
+ * `Cloud.Website.*` sets it.
159
+ *
160
+ * @default false
161
+ */
162
+ prebuilt?: boolean;
163
+ }
164
+
165
+ /** Attributes of {@link Service}. */
166
+ export interface ServiceAttributes {
167
+ /** ID of the `Cloud.Server` the unit runs on. */
168
+ serverId: string;
169
+ /** Zone the server lives in. */
170
+ availabilityZone: string | undefined;
171
+ /** The server's public IPv4, if it has one. */
172
+ ipv4: string | undefined;
173
+ /** The server's public IPv6, if it has one. */
174
+ ipv6: string | undefined;
175
+ /** Port the process listens on. */
176
+ port: number;
177
+ /** `http://<ipv4>:<port>` (or `http://[<ipv6>]:<port>` on an IPv6-only server). */
178
+ url: string | undefined;
179
+ /** systemd unit name (`<unitName>.service`, files under `/opt/<unitName>`). */
180
+ unitName: string;
181
+ /** Content hash of the deployed program (bundle + extra files, or the image's inputs). */
182
+ code: { hash: string };
183
+ /** Volumes this Service mounted (from `Cloud.MountVolume`). */
184
+ volumes: Array<{ volumeId: string; path: string }>;
185
+ }
186
+
187
+ export type Service<Env extends Record<string, any> = Record<string, any>> = Resource<
188
+ "BetterStack.Cloud.Service",
189
+ ServiceProps<Env>,
190
+ ServiceAttributes,
191
+ ServiceBinding,
192
+ Providers
193
+ >;
194
+
195
+ export const isService = (value: unknown): value is Service =>
196
+ typeof value === "object" &&
197
+ value !== null &&
198
+ (value as { Type?: string }).Type === "BetterStack.Cloud.Service";
199
+
200
+ /** What a Service's implementation may `yield*` besides the platform services: `ServerHost` (`run`). */
201
+ export type ServiceServices = ServerHost;
202
+
203
+ /** What a Service's implementation returns: `{ fetch }` for an HTTP Service, nothing for a background one. */
204
+ export type ServiceShape = Main<ServiceServices>;
205
+
206
+ export type ServiceRuntimeContext = CloudHostRuntimeContext;
207
+
208
+ /**
209
+ * Your own code on a Better Stack Cloud server: an Effect program Alchemy
210
+ * bundles with Rolldown, copies over SSH to a {@link Server}, and runs as a
211
+ * systemd unit with `Restart=always`. HTTP Services (`fetch`, gated on
212
+ * `/health` at deploy), background Services (`ServerHost.run`), `env` and
213
+ * `Config`, several Services per server, volumes through
214
+ * `Cloud.MountVolume`, a container form (`context`) and an async form (a
215
+ * plain `fetch(request, env)` handler). The port of `@alchemy.run/hetzner`'s
216
+ * `Service`: switching providers is changing the import and the server.
217
+ *
218
+ * @see https://betterstack.com/docs/cloud/servers/
219
+ *
220
+ * ### Declaring a Service
221
+ * A Service is a class: an id, the infrastructure props, and the program.
222
+ * `server` is the machine (a `Cloud.Server`, or the module-scope
223
+ * declaration of one); `main: import.meta.url` makes this file the bundle's
224
+ * entry; `port` is written to `PORT`. Returning `fetch` boots an HTTP server
225
+ * on that port. The resolved Service exposes `url`, `port`, `unitName`,
226
+ * `serverId`, `ipv4`/`ipv6` and the bundle's `code.hash`.
227
+ *
228
+ * **Example:** An HTTP Service
229
+ * ```typescript
230
+ * // src/server.ts
231
+ * export const Box = BetterStack.Cloud.Server("Box", {
232
+ * serverType: "AM1",
233
+ * image: "ubuntu-26-04",
234
+ * });
235
+ *
236
+ * // src/api.ts
237
+ * export default class Api extends BetterStack.Cloud.Service<Api>()(
238
+ * "Api",
239
+ * { server: Box, main: import.meta.url, port: 3000 },
240
+ * Effect.gen(function* () {
241
+ * return {
242
+ * fetch: Effect.gen(function* () {
243
+ * const request = yield* HttpServerRequest;
244
+ * if (new URL(request.url, "http://x").pathname === "/health") {
245
+ * return yield* HttpServerResponse.json({ ok: true });
246
+ * }
247
+ * return HttpServerResponse.text("hello");
248
+ * }),
249
+ * };
250
+ * }),
251
+ * ) {}
252
+ *
253
+ * // alchemy.run.ts
254
+ * const api = yield* Api;
255
+ * // api.url === "http://<server ipv4>:3000"
256
+ * ```
257
+ *
258
+ * ### What a deploy does
259
+ * One SSH session as `root` with the server's Alchemy-managed deploy key:
260
+ *
261
+ * 1. Bundle `main` with Rolldown into one ESM file, `index.mjs`. A generated
262
+ * entry imports only `betterstack-alchemy/Cloud/Bootstrap` and your
263
+ * module; the bootstrap wires the Node HTTP server, logging, and
264
+ * `Config` from the environment.
265
+ * 2. Wait for SSH, then for cloud-init (`cloud-init status --wait`: the
266
+ * server's bootstrap installs Node.js), install `curl`/`unzip` if
267
+ * missing, and Node.js 26 from NodeSource if missing or older (a server
268
+ * with its own `userData` has none).
269
+ * 3. Attach and mount any bound volumes (see "Volumes").
270
+ * 4. Copy `bundle.zip`, the env file and the unit, unpack into
271
+ * `/opt/<unitName>/`, `systemctl daemon-reload`, `enable --now`,
272
+ * `restart`. The unit:
273
+ *
274
+ * ```ini
275
+ * [Service]
276
+ * Type=simple
277
+ * WorkingDirectory=/opt/<unitName>
278
+ * EnvironmentFile=-/opt/<unitName>/env
279
+ * Environment=HOST=0.0.0.0
280
+ * Environment=ALCHEMY_SHUTDOWN_TIMEOUT_MS=30000
281
+ * ExecStart=/usr/bin/env node /opt/<unitName>/index.mjs
282
+ * KillSignal=SIGTERM
283
+ * TimeoutStopSec=30
284
+ * Restart=always
285
+ * RestartSec=5
286
+ * ```
287
+ *
288
+ * 5. Wait until the unit is active and, when `port` is set,
289
+ * `http://127.0.0.1:<port>/health` answers 2xx (60 seconds, polled every
290
+ * 2). Otherwise the deploy fails with `ServiceNotHealthy`, whose message
291
+ * holds `systemctl status` and the unit's last 80 journal lines.
292
+ *
293
+ * On later deploys Alchemy compares the bundle's content hash with the
294
+ * deployed one: unchanged code, env and bindings are a no-op with no SSH
295
+ * at all; changed code or env re-copies and restarts the unit, a few
296
+ * seconds end to end. A new `server` replaces the Service (deployed on the
297
+ * new server, then removed from the old). Deleting stops and disables the
298
+ * unit and removes its files.
299
+ *
300
+ * ### Graceful stop
301
+ * `systemctl stop` and every redeploy's `restart` send SIGTERM. The process
302
+ * then stops accepting connections, lets in-flight requests finish, stops
303
+ * `ServerHost.run` loops and closes its scopes, so finalizers run (a
304
+ * `Telemetry.ShipLogs` / OTLP exporter flushes its buffer) before it exits.
305
+ * The budget is 30 seconds (`ALCHEMY_SHUTDOWN_TIMEOUT_MS`, alchemy's managed
306
+ * shutdown): connections still open at 80% of it are closed, and at 90% the
307
+ * process exits anyway, before systemd's `TimeoutStopSec` would kill it.
308
+ * An async Service's `fetch` handler gets the same drain.
309
+ *
310
+ * ### Trust: host keys
311
+ * Every SSH connection a deploy makes requires the server's host key
312
+ * (`StrictHostKeyChecking=yes` against a per-session `known_hosts`): the key
313
+ * Alchemy generated and installed through the server's bootstrap
314
+ * (`hostKeyTrust: "pinned"`), or the one recorded at the server's first login
315
+ * (`"first-use"`, a server with your own `userData`). A server that presents
316
+ * another key gets nothing — no bundle, no env file — and the deploy fails
317
+ * with `SshError` `reason: "host-key-mismatch"`. A server with no recorded
318
+ * key (created before host keys were pinned, `bootstrap: false`) is
319
+ * trusted on first use for that deploy, with a warning.
320
+ *
321
+ * ### Verified live
322
+ * On one `AM1` (2026-12-01): an HTTP Service with `/health` and a
323
+ * background worker deployed, updated with new code and env, and removed
324
+ * cleanly (units, files and the mount gone); `Cloud.MountVolume` at a custom
325
+ * path with our fstab line once; the unit's 30 s stop timeout; a
326
+ * `Website.StaticSite` on the same server. NOT live-verified: the container
327
+ * form, the async form, host-key pinning (added after that run), a step
328
+ * timeout, `build.install`.
329
+ *
330
+ * ### The /health rule
331
+ * A Service with a `port` **must serve `/health`**: the deploy polls it and
332
+ * fails, with the unit's journal, when it never answers. Keep it trivial.
333
+ *
334
+ * ### Reachability
335
+ * `url` is the server's public IP and the Service's port: no proxy in
336
+ * between. A Better Stack Cloud server with a `Cloud.Firewall` attached
337
+ * admits only what its rules allow, so open the port (and keep `tcp/22`
338
+ * open to the deploying machine, which the deploy needs):
339
+ *
340
+ * **Example:** Open the Service's port
341
+ * ```typescript
342
+ * const firewall = yield* BetterStack.Cloud.Firewall("Fw", {});
343
+ * yield* BetterStack.Cloud.FirewallRule("Ssh", {
344
+ * firewallId: firewall.id,
345
+ * direction: "inbound",
346
+ * protocol: "tcp",
347
+ * portFrom: 22,
348
+ * ipAddresses: ["0.0.0.0/0", "::/0"],
349
+ * });
350
+ * yield* BetterStack.Cloud.FirewallRule("Api", {
351
+ * firewallId: firewall.id,
352
+ * direction: "inbound",
353
+ * protocol: "tcp",
354
+ * portFrom: 3000,
355
+ * ipAddresses: ["0.0.0.0/0", "::/0"],
356
+ * });
357
+ * ```
358
+ *
359
+ * For a stable front door with health checks and TLS, put a
360
+ * `Cloud.LoadBalancer` in front and allow the port from the private
361
+ * network only.
362
+ *
363
+ * ### Environment and Config
364
+ * Pass values with `env` and read them through Effect's `Config` (the
365
+ * runtime's `ConfigProvider` reads the process environment). Alchemy also
366
+ * sets `PORT` (with `port`), `HOST`, `ALCHEMY_STACK_NAME`, `ALCHEMY_STAGE`
367
+ * and `ALCHEMY_PHASE=runtime`. A `Config` read in the implementation at
368
+ * deploy time is captured into the env as well. `Redacted` values (an
369
+ * Errors DSN, a source token, a value a binding sets through
370
+ * `RuntimeContext`) land in clear text only in the env file on the server
371
+ * (`/opt/<unitName>/env`, mode 600), never in SSH command lines, the
372
+ * Service's attributes or the plan output (shown `(redacted)`). The state
373
+ * file keeps them inside the state store's `__redacted__` marker — in clear
374
+ * text there with the default local state, as it keeps every secret
375
+ * (the server's deploy key included): protect `.alchemy/state`.
376
+ *
377
+ * **Example:** `env` + `Config`
378
+ * ```typescript
379
+ * export default class Api extends BetterStack.Cloud.Service<Api>()(
380
+ * "Api",
381
+ * { server: Box, main: import.meta.url, port: 3000, env: { GREETING: "hello" } },
382
+ * Effect.gen(function* () {
383
+ * return {
384
+ * fetch: Effect.gen(function* () {
385
+ * const greeting = yield* Config.String("GREETING");
386
+ * return HttpServerResponse.text(greeting);
387
+ * }).pipe(Effect.orDie),
388
+ * };
389
+ * }),
390
+ * ) {}
391
+ * ```
392
+ *
393
+ * ### Background services
394
+ * Leave out `port` and `fetch` and register a long-running loop with
395
+ * `ServerHost.run`: a worker, a queue consumer, a scheduler. systemd
396
+ * supervises it: when the loop exits or crashes, the unit restarts after
397
+ * 5 seconds.
398
+ *
399
+ * **Example:** A worker
400
+ * ```typescript
401
+ * export default class Worker extends BetterStack.Cloud.Service<Worker>()(
402
+ * "Worker",
403
+ * { server: Box, main: import.meta.url },
404
+ * Effect.gen(function* () {
405
+ * const host = yield* ServerHost;
406
+ * yield* host.run(
407
+ * Effect.gen(function* () {
408
+ * yield* Effect.log("tick");
409
+ * }).pipe(Effect.repeat(Schedule.spaced("1 minute")), Effect.asVoid),
410
+ * );
411
+ * }),
412
+ * ) {}
413
+ * ```
414
+ *
415
+ * ### Several Services on one server
416
+ * Each Service is its own unit with its own bundle, env file and
417
+ * lifecycle. Point several at the same `server`; two Services mounting the
418
+ * same volume at the same path share one attach and one mount.
419
+ *
420
+ * ### Volumes
421
+ * Bind a `Cloud.Volume` with `Cloud.MountVolume` inside the implementation
422
+ * and use it as a directory. The deploy attaches it to the Service's server
423
+ * (Cloud API), mounts its device at the path and adds a `nofail`
424
+ * `/etc/fstab` line; when no Service binds the path any more it is
425
+ * unmounted again.
426
+ *
427
+ * **Example:** Mount a volume
428
+ * ```typescript
429
+ * export default class Api extends BetterStack.Cloud.Service<Api>()(
430
+ * "Api",
431
+ * { server: Box, main: import.meta.url, port: 3000 },
432
+ * Effect.gen(function* () {
433
+ * const mount = yield* BetterStack.Cloud.MountVolume(Data, { path: "/data" });
434
+ * return {
435
+ * fetch: Effect.gen(function* () {
436
+ * const fs = yield* FileSystem.FileSystem;
437
+ * const text = yield* fs.readFileString(`${mount.path}/hello.txt`);
438
+ * return HttpServerResponse.text(text);
439
+ * }).pipe(Effect.orDie),
440
+ * };
441
+ * }).pipe(Effect.provide(BetterStack.Cloud.MountVolumeLive)),
442
+ * ) {}
443
+ * ```
444
+ *
445
+ * ### Logs
446
+ * A Service logs to the systemd journal. Read it over SSH:
447
+ *
448
+ * ```sh
449
+ * ssh root@<sshHost> journalctl -u <unitName> -f
450
+ * ```
451
+ *
452
+ * or from a stack with `Cloud.Ssh`. Ship the logs to Better Stack with a
453
+ * `Telemetry.Source` (see "Observability"). A failed deploy already prints
454
+ * the last 80 journal lines.
455
+ *
456
+ * ### Running your own image
457
+ * **Example:** A Dockerfile build, run with Docker on the server
458
+ * ```typescript
459
+ * const worker = yield* BetterStack.Cloud.Service("Worker", {
460
+ * server,
461
+ * context: "./worker",
462
+ * env: { QUEUE: "jobs" },
463
+ * });
464
+ * ```
465
+ *
466
+ * The image is built with the local Docker CLI for `platform`, saved, copied
467
+ * over SSH and `docker load`ed; the unit runs `docker run --network host`
468
+ * with the env (multi-line values included) and the bound volumes as
469
+ * `-v <path>:<path>`.
470
+ *
471
+ * ### Async Services
472
+ * You don't have to use Effect. Call `Service` with `main` pointing at a
473
+ * file and no implementation: the file is bundled with a small `node:http`
474
+ * adapter and no Effect runtime. A `default` export with
475
+ * `fetch(request, env)` is served on `PORT`; any other module simply runs
476
+ * (a plain Node program). {@link InferEnv} types `env`.
477
+ *
478
+ * **Example:** Declare an async Service
479
+ * ```typescript
480
+ * export const Ping = BetterStack.Cloud.Service("Ping", {
481
+ * server: Box,
482
+ * main: "./src/ping.ts",
483
+ * port: 3001,
484
+ * env: { GREETING: "pong" },
485
+ * });
486
+ * export type PingEnv = BetterStack.Cloud.InferEnv<typeof Ping>;
487
+ * ```
488
+ *
489
+ * **Example:** The handler
490
+ * ```typescript
491
+ * import type { PingEnv } from "../alchemy.run.ts";
492
+ *
493
+ * export default {
494
+ * async fetch(request: Request, env: PingEnv) {
495
+ * if (new URL(request.url).pathname === "/health") return new Response("ok");
496
+ * return new Response(env.GREETING);
497
+ * },
498
+ * };
499
+ * ```
500
+ *
501
+ * ### Observability
502
+ * Better Stack is also where the Service is watched from. Instrument the
503
+ * code with Effect's own OpenTelemetry — a named span per unit of work
504
+ * (`Effect.fn`), attributes on the span, structured logs with annotations,
505
+ * `Metric`s — and provide ONE `Telemetry.Export` layer: traces, logs and
506
+ * metrics reach an OpenTelemetry source with that source's own token. Error
507
+ * tracking (`Errors.Dsn`), a heartbeat (`Incidents.heartbeatJob`) and an
508
+ * uptime monitor complete it (`examples/observability` is this stack,
509
+ * runnable). Each credential arrives through a binding, as a secret in the
510
+ * env file only.
511
+ *
512
+ * **Example:** Spans, logs and metrics of the Api, exported to one source
513
+ * ```typescript
514
+ * export const Otel = BetterStack.Telemetry.Source("Otel", { platform: "open_telemetry" });
515
+ * export const Errors = BetterStack.Errors.Application("Errors", { platform: "node_errors" });
516
+ *
517
+ * const ordersPlaced = Metric.counter("orders_placed", { incremental: true });
518
+ *
519
+ * const placeOrder = Effect.fn("orders.place")(function* (orderId: string) {
520
+ * yield* Effect.annotateCurrentSpan({ "order.id": orderId });
521
+ * yield* Metric.update(ordersPlaced, 1);
522
+ * yield* Effect.logInfo("order placed").pipe(Effect.annotateLogs({ orderId }));
523
+ * });
524
+ *
525
+ * export default class Api extends BetterStack.Cloud.Service<Api>()(
526
+ * "Api",
527
+ * { server: Box, main: import.meta.url, port: 3000 },
528
+ * Effect.gen(function* () {
529
+ * yield* BetterStack.Errors.Dsn(Errors); // SENTRY_DSN for a Sentry SDK
530
+ * return {
531
+ * fetch: Effect.gen(function* () {
532
+ * yield* placeOrder("o-1");
533
+ * return HttpServerResponse.text("ok");
534
+ * }),
535
+ * };
536
+ * }).pipe(
537
+ * Effect.provide(
538
+ * Layer.mergeAll(
539
+ * BetterStack.Errors.DsnLive,
540
+ * BetterStack.Telemetry.Export({ source: Otel, serviceName: "api" }),
541
+ * ),
542
+ * ),
543
+ * ),
544
+ * ) {}
545
+ * ```
546
+ *
547
+ * **Example:** A heartbeat for the worker's job, a monitor on the Api
548
+ * ```typescript
549
+ * export const JobDone = BetterStack.Incidents.Heartbeat("JobDone", { period: 300, grace: 120 });
550
+ *
551
+ * const runJob = Effect.fn("worker.export")(function* () {
552
+ * yield* Effect.logInfo("export finished");
553
+ * });
554
+ *
555
+ * export default class Worker extends BetterStack.Cloud.Service<Worker>()(
556
+ * "Worker",
557
+ * { server: Box, main: import.meta.url },
558
+ * Effect.gen(function* () {
559
+ * const watched = yield* BetterStack.Incidents.heartbeatJob(JobDone);
560
+ * const inHost = yield* BetterStack.withHostRuntime;
561
+ * const host = yield* ServerHost;
562
+ * yield* host.run(
563
+ * inHost(watched(runJob()).pipe(Effect.ignore, Effect.repeat(Schedule.spaced("5 minutes")))),
564
+ * );
565
+ * }).pipe(
566
+ * Effect.provide(
567
+ * Layer.mergeAll(
568
+ * BetterStack.Incidents.SendHeartbeatHttp,
569
+ * BetterStack.Incidents.ReportHeartbeatHttp,
570
+ * BetterStack.Telemetry.Export({ source: Otel, serviceName: "worker" }),
571
+ * ),
572
+ * ),
573
+ * ),
574
+ * ) {}
575
+ *
576
+ * // alchemy.run.ts
577
+ * const api = yield* Api;
578
+ * yield* BetterStack.Incidents.Monitor("ApiUp", {
579
+ * url: Output.interpolate`${api.url}/health`,
580
+ * monitorType: "status",
581
+ * });
582
+ * ```
583
+ *
584
+ * The source token, DSN and heartbeat URL are `Redacted`: they reach the
585
+ * server only inside the env file. A failed or missing job run raises an
586
+ * incident; a dead Api fails the monitor.
587
+ *
588
+ * @resource
589
+ * @product Cloud
590
+ */
591
+ export const Service: {
592
+ /**
593
+ * Async (no-implementation) form: `main` is a plain handler file or Node
594
+ * program. Captures the `env` literal so {@link InferEnv} types the
595
+ * handler's `env`. Declared before the platform's own signatures so it
596
+ * wins overload resolution for a two-argument call.
597
+ */
598
+ <const Env extends Record<string, any>, PropsReq = never, const Id extends string = string>(
599
+ id: Id,
600
+ props:
601
+ | InputProps<ServiceProps<Env>>
602
+ | Effect.Effect<InputProps<ServiceProps<Env>>, never, PropsReq>,
603
+ ): Effect.Effect<Service<Env>, never, Providers | PropsReq> & PlatformIdentity<Id>;
604
+ } & Platform<Service, ServiceServices, ServiceShape, ServiceRuntimeContext> = Platform(
605
+ "BetterStack.Cloud.Service",
606
+ {
607
+ createRuntimeContext: createCloudHostRuntimeContext("BetterStack.Cloud.Service"),
608
+ // `{ server: Box }` at module scope is an Effect. Yield it here so the
609
+ // server is registered and `news.server` is its resolved attributes at
610
+ // reconcile (the same DX as `yield* Server(...)` inside Effect.gen).
611
+ transformProps: (_id, props) =>
612
+ Effect.gen(function* () {
613
+ if (globalThis.__ALCHEMY_RUNTIME__) return props;
614
+ const server = Effect.isEffect(props.server)
615
+ ? yield* props.server as Effect.Effect<Server, never, Providers>
616
+ : props.server;
617
+ return { ...props, server };
618
+ }),
619
+ },
620
+ );
621
+
622
+ /** The Service's props can't be deployed: no server, no address, no deploy key, or not exactly one of `main`/`context`. */
623
+ export class ServiceError extends Data.TaggedError("ServiceError")<{
624
+ readonly message: string;
625
+ readonly reason: "no-server" | "no-address" | "no-deploy-key" | "main-or-context";
626
+ }> {}
627
+
628
+ /** How a container Service builds its image archive (default: the local Docker CLI). */
629
+ export type ServiceImageBuild = (
630
+ source: ImageArchiveSource,
631
+ options: { readonly tag: string; readonly output: string },
632
+ ) => Effect.Effect<
633
+ Uint8Array<ArrayBufferLike>,
634
+ { readonly _tag: string; readonly message?: string }
635
+ >;
636
+
637
+ /**
638
+ * Replace how a container Service (`context`) builds its image archive
639
+ * (default `undefined`: `docker build` + `docker save` with the local Docker
640
+ * CLI). Read once, when the provider layer is built. Offline tests provide
641
+ * a fake that returns bytes.
642
+ */
643
+ export const ServiceImageBuilder = Context.Reference<ServiceImageBuild | undefined>(
644
+ "betterstack-alchemy/Cloud/ServiceImageBuilder",
645
+ { defaultValue: () => undefined },
646
+ );
647
+
648
+ const DEFAULT_PORT = 3000;
649
+
650
+ /** How long each remote step may take (each overridable as `WaitBudgets` `step-<name>`). */
651
+ const STEP_BUDGETS = {
652
+ // cloud-init on a fresh server (it installs Node.js), then apt for curl/unzip.
653
+ tools: { timeout: "20 minutes", interval: "1 second" },
654
+ node: { timeout: "15 minutes", interval: "1 second" },
655
+ docker: { timeout: "15 minutes", interval: "1 second" },
656
+ mount: { timeout: "3 minutes", interval: "1 second" },
657
+ unmount: { timeout: "2 minutes", interval: "1 second" },
658
+ chmod: { timeout: "1 minute", interval: "1 second" },
659
+ // unzip, `npm install` when `build.install` is set, systemctl.
660
+ start: { timeout: "15 minutes", interval: "1 second" },
661
+ // On top of the health budget itself.
662
+ health: { timeout: "2 minutes", interval: "1 second" },
663
+ } satisfies Record<string, WaitBudget>;
664
+
665
+ const DEFAULTS = {
666
+ ssh: { timeout: "5 minutes", interval: "5 seconds" },
667
+ health: { timeout: "60 seconds", interval: "2 seconds" },
668
+ attach: { timeout: "20 minutes", interval: "3 seconds" },
669
+ /** An attached volume's `devicePath` / `mountPath` showing up in the API. */
670
+ device: { timeout: "2 minutes", interval: "3 seconds" },
671
+ } satisfies Record<string, WaitBudget>;
672
+
673
+ /** The parts of a `Cloud.Server`'s attributes a Service reads. */
674
+ interface ServerLike {
675
+ readonly id?: unknown;
676
+ readonly serverId?: unknown;
677
+ readonly availabilityZone?: unknown;
678
+ readonly ipv4?: unknown;
679
+ readonly ipv6?: unknown;
680
+ readonly sshHost?: unknown;
681
+ readonly sshUser?: unknown;
682
+ readonly privateKey?: unknown;
683
+ readonly deployKeySlug?: unknown;
684
+ readonly hostPublicKey?: unknown;
685
+ readonly LogicalId?: unknown;
686
+ }
687
+
688
+ const text = (value: unknown): string | undefined =>
689
+ typeof value === "string" && value.length > 0 ? value : undefined;
690
+
691
+ const serverIdOf = (value: unknown): string | undefined => {
692
+ if (value === null || typeof value !== "object") return undefined;
693
+ const rec = value as ServerLike;
694
+ return text(rec.serverId) ?? text(rec.id);
695
+ };
696
+
697
+ const reveal = (value: unknown): string | undefined =>
698
+ Redacted.isRedacted(value) ? text(Redacted.value(value)) : text(value);
699
+
700
+ const createUnitName = (id: string, existing?: string) =>
701
+ existing !== undefined
702
+ ? Effect.succeed(existing)
703
+ : createPhysicalName({ id, maxLength: 64, lowercase: true }).pipe(
704
+ Effect.map((name) => name.replaceAll(/[^a-z0-9-]/g, "-")),
705
+ );
706
+
707
+ const serviceUrl = (ipv4: string | undefined, ipv6: string | undefined, port: number) =>
708
+ ipv4 !== undefined
709
+ ? `http://${ipv4}:${port}`
710
+ : ipv6 !== undefined
711
+ ? `http://[${ipv6}]:${port}`
712
+ : undefined;
713
+
714
+ /** What decides a redeploy, minus server attributes that don't matter to the unit. */
715
+ const relevant = (props: ServiceProps) => {
716
+ const server = props.server as unknown as ServerLike;
717
+ return {
718
+ ...props,
719
+ server: {
720
+ serverId: serverIdOf(server),
721
+ sshHost: text(server?.sshHost) ?? text(server?.ipv4) ?? text(server?.ipv6),
722
+ ipv4: text(server?.ipv4),
723
+ ipv6: text(server?.ipv6),
724
+ deployKeySlug: text(server?.deployKeySlug),
725
+ },
726
+ };
727
+ };
728
+
729
+ const toSeconds = (input: Duration.Input) =>
730
+ Math.max(1, Math.round(Duration.toMillis(Duration.fromInputUnsafe(input)) / 1000));
731
+
732
+ export const ServiceProvider = () =>
733
+ Provider.effect(
734
+ Service,
735
+ Effect.gen(function* () {
736
+ const stack = yield* Stack;
737
+ const budget = yield* budgetsFor(TYPE);
738
+ const virtualEntryPlugin = yield* Bundle.virtualEntryPlugin;
739
+ const hosted = createCloudHostedSupport({
740
+ stackName: stack.name,
741
+ stage: stack.stage,
742
+ virtualEntryPlugin,
743
+ });
744
+ const platform = yield* Effect.context<SshServices>();
745
+ const connectOverride = yield* SshConnector;
746
+ const connect: SshConnect =
747
+ connectOverride ??
748
+ ((target) => openSshClient(target).pipe(Effect.provideContext(platform)));
749
+ const imageOverride = yield* ServiceImageBuilder;
750
+ const buildImage: ServiceImageBuild =
751
+ imageOverride ??
752
+ ((source, options) =>
753
+ buildImageArchive(source, options).pipe(
754
+ Effect.provide(DockerLive),
755
+ Effect.provideContext(platform),
756
+ ));
757
+
758
+ const sourceOf = (props: ServiceProps): ImageArchiveSource => ({
759
+ context: props.context!,
760
+ dockerfile: props.dockerfile,
761
+ platform: props.platform ?? "linux/amd64",
762
+ });
763
+
764
+ /** The SSH target of the Service's server: its address and deploy key. */
765
+ const targetOf = (props: ServiceProps, id: string) =>
766
+ Effect.gen(function* () {
767
+ const server = props.server as unknown as ServerLike;
768
+ const host = sshHostOf(server);
769
+ if (host === undefined) {
770
+ return yield* new ServiceError({
771
+ reason: "no-address",
772
+ message: `${TYPE} '${id}': the server has no public address to SSH to`,
773
+ });
774
+ }
775
+ const privateKey = reveal(server.privateKey);
776
+ if (privateKey === undefined) {
777
+ return yield* new ServiceError({
778
+ reason: "no-deploy-key",
779
+ message: `${TYPE} '${id}': the server has no Alchemy deploy key (it was created with bootstrap: false, or looked up), so the Service can't SSH in`,
780
+ });
781
+ }
782
+ if (text(server.hostPublicKey) === undefined) {
783
+ yield* Effect.logWarning(
784
+ `${TYPE} '${id}': the server has no recorded host key (created before host keys were pinned, or with bootstrap: false): this deploy trusts the key it is shown on first use`,
785
+ );
786
+ }
787
+ return {
788
+ host,
789
+ privateKey: Redacted.make(privateKey),
790
+ user: text(server.sshUser) ?? "root",
791
+ // Required on every connection; none known: the session trusts first use (warned).
792
+ hostKey: text(server.hostPublicKey),
793
+ };
794
+ });
795
+
796
+ /** Run `body` in one SSH session, closed afterwards. */
797
+ const withSession = <A, E, R>(
798
+ target: {
799
+ host: string;
800
+ privateKey: Redacted.Redacted<string>;
801
+ user: string;
802
+ hostKey: string | undefined;
803
+ },
804
+ body: (ssh: SshSession) => Effect.Effect<A, E, R>,
805
+ ) =>
806
+ Effect.acquireUseRelease(
807
+ connect(target),
808
+ (ssh) => body(ssh).pipe(Effect.provideContext(platform)),
809
+ (ssh) => ssh.close.pipe(Effect.provideContext(platform)),
810
+ );
811
+
812
+ // Two Services binding the same volume in one deploy run concurrently:
813
+ // attach and mount it one at a time, so the second finds it attached
814
+ // and mounted instead of racing the first (one attach, one mount).
815
+ const volumeLocks = new Map<string, Semaphore.Semaphore>();
816
+ const volumeLock = (volumeId: string) => {
817
+ let lock = volumeLocks.get(volumeId);
818
+ if (lock === undefined) {
819
+ lock = Semaphore.makeUnsafe(1);
820
+ volumeLocks.set(volumeId, lock);
821
+ }
822
+ return lock;
823
+ };
824
+
825
+ const codeHash = (props: ServiceProps) =>
826
+ props.context !== undefined
827
+ ? hashImageArchive(sourceOf(props)).pipe(Effect.provideContext(platform))
828
+ : hosted
829
+ .bundleProgram({ ...props, main: props.main ?? "" })
830
+ .pipe(Effect.map(({ hash }) => hash));
831
+
832
+ return Service.Provider.of({
833
+ // Not `serverId`/`availabilityZone`: a Service moved to another server is a new one.
834
+ stables: ["unitName"],
835
+ // systemd units have no Cloud API to list them. Nuke deletes the
836
+ // server they live on; an empty list is the documented shape for
837
+ // parent-keyed resources.
838
+ nuke: { dependsOn: ["BetterStack.Cloud.Server"] },
839
+ list: () => Effect.succeed([]),
840
+
841
+ diff: Effect.fn(function* ({ news, olds, output, oldBindings, newBindings }) {
842
+ if (!isResolved(news)) {
843
+ // A server created or replaced in this deploy has no id yet: the Service moves to a
844
+ // new server, so it is a replacement (the engine would plan an update, and the old
845
+ // unit would keep running on the old server; finding Y2).
846
+ // Only the server's identity counts: a server that is merely updated in this deploy
847
+ // has its id resolved (a stable) while its other attributes are not.
848
+ const server = (news as { server?: { serverId?: unknown; id?: unknown } }).server;
849
+ const identity = server?.serverId ?? server?.id;
850
+ if (
851
+ output !== undefined &&
852
+ (identity === undefined || !isResolved(identity as never))
853
+ ) {
854
+ return { action: "replace" } as const;
855
+ }
856
+ return undefined;
857
+ }
858
+ const next = news as ServiceProps;
859
+ const nextServer = serverIdOf(next.server);
860
+ if (output !== undefined && nextServer !== undefined && output.serverId !== nextServer) {
861
+ return { action: "replace" } as const;
862
+ }
863
+ if (output === undefined) return undefined;
864
+ if ((next.main === undefined) === (next.context === undefined)) return undefined;
865
+ if ((yield* codeHash(next)) !== output.code.hash) return { action: "update" } as const;
866
+ if (havePropsChanged(relevant(olds as ServiceProps), relevant(next))) {
867
+ return { action: "update" } as const;
868
+ }
869
+ if (!isResolved(newBindings)) return undefined;
870
+ const bindingsChanged = diffBindings(
871
+ oldBindings as ResourceBinding[],
872
+ newBindings as ResourceBinding[],
873
+ ).some((binding) => binding.action !== "noop");
874
+ return bindingsChanged ? ({ action: "update" } as const) : ({ action: "noop" } as const);
875
+ }),
876
+
877
+ read: Effect.fn(function* ({ output }) {
878
+ if (output === undefined) return undefined;
879
+ const live = yield* Cloud.getServer({
880
+ id: output.serverId,
881
+ availabilityZone: output.availabilityZone,
882
+ }).pipe(Effect.catchTag("NotFound", () => Effect.succeed(undefined)));
883
+ if (live === undefined || live.status === "destroyed" || live.status === "terminated") {
884
+ return undefined;
885
+ }
886
+ const addresses = live.ipAddresses ?? [];
887
+ const ipv4 = addresses.find((a) => a.type === "ipv4" && a.ip)?.ip;
888
+ const ipv6 = addresses.find((a) => a.type === "ipv6" && a.ip)?.ip;
889
+ return { ...output, ipv4, ipv6, url: serviceUrl(ipv4, ipv6, output.port) };
890
+ }),
891
+
892
+ reconcile: Effect.fn(function* ({ id, news, output, bindings }) {
893
+ const props = news as ServiceProps;
894
+ const server = props.server as unknown as ServerLike;
895
+ const serverId = serverIdOf(server);
896
+ if (serverId === undefined) {
897
+ return yield* new ServiceError({
898
+ reason: "no-server",
899
+ message: `${TYPE} '${id}' requires a resolved Cloud.Server`,
900
+ });
901
+ }
902
+ if ((props.main === undefined) === (props.context === undefined)) {
903
+ return yield* new ServiceError({
904
+ reason: "main-or-context",
905
+ message: `${TYPE} '${id}' takes exactly one of 'main' and 'context'`,
906
+ });
907
+ }
908
+ const target = yield* targetOf(props, id);
909
+ const availabilityZone = text(server.availabilityZone);
910
+ const ipv4 = text(server.ipv4);
911
+ const ipv6 = text(server.ipv6);
912
+ const port = props.port ?? DEFAULT_PORT;
913
+ const unitName = yield* createUnitName(id, output?.unitName);
914
+ const appDir = appDirOf(unitName);
915
+ const { env: bindingEnv, volumes } = collectBindingState(
916
+ bindings as ResourceBinding<ServiceBinding>[],
917
+ );
918
+ const env = composeEnv({
919
+ bindingEnv,
920
+ alchemyEnv: hosted.alchemyEnv,
921
+ port: props.port,
922
+ env: props.env,
923
+ });
924
+ // Mount paths reach a unit file, fstab and shell scripts: plain absolute paths only (Y10).
925
+ for (const volume of [...volumes, ...(output?.volumes ?? [])]) {
926
+ if (!isValidMountPath(volume.path)) {
927
+ return yield* new MountPathInvalid({
928
+ path: volume.path,
929
+ message: `${TYPE} '${id}': mount path ${JSON.stringify(volume.path)} is not a plain absolute path (letters, digits, '.', '_', '-' and '/' only, no '..')`,
930
+ });
931
+ }
932
+ }
933
+ const mountPaths = [...new Set(volumes.map((volume) => volume.path))];
934
+ // Mounts this Service had and no longer binds (by path).
935
+ const dropped = (output?.volumes ?? []).filter(
936
+ (old) => !volumes.some((volume) => volume.path === old.path),
937
+ );
938
+
939
+ // Build locally first: nothing on the server changes when it fails.
940
+ const image =
941
+ props.context !== undefined
942
+ ? yield* Effect.gen(function* () {
943
+ const fs = yield* FileSystem.FileSystem;
944
+ const dir = yield* fs.makeTempDirectoryScoped({ prefix: "alchemy-betterstack-" });
945
+ const source = sourceOf(props);
946
+ return {
947
+ archive: yield* buildImage(source, {
948
+ tag: `alchemy-${unitName}:latest`,
949
+ output: `${dir}/image.tar`,
950
+ }),
951
+ hash: yield* hashImageArchive(source),
952
+ };
953
+ }).pipe(Effect.scoped, Effect.provideContext(platform))
954
+ : undefined;
955
+ const program =
956
+ image === undefined
957
+ ? yield* hosted.bundleProgram({ ...props, main: props.main ?? "" })
958
+ : undefined;
959
+ const hash = image?.hash ?? program!.hash;
960
+ const envFile =
961
+ image !== undefined ? yield* containerEnvFile(env) : yield* systemdEnvFile(env);
962
+ const unit =
963
+ image !== undefined
964
+ ? renderImageUnit({ unitName, mounts: mountPaths })
965
+ : renderUnit({ unitName, entryRel: program!.entryRel, mounts: mountPaths });
966
+ const health = budget("health", DEFAULTS.health);
967
+ const intervalSeconds = toSeconds(health.interval);
968
+ const attempts = Math.max(1, Math.ceil(toSeconds(health.timeout) / intervalSeconds));
969
+
970
+ yield* withSession(target, (ssh) =>
971
+ Effect.gen(function* () {
972
+ /** One remote step, bounded by its budget (finding Y12). */
973
+ const run = (
974
+ step: keyof typeof STEP_BUDGETS,
975
+ command: string,
976
+ volume?: BoundVolume,
977
+ ) => {
978
+ const limit = Duration.fromInputUnsafe(
979
+ budget(`step-${step}`, {
980
+ timeout:
981
+ step === "health"
982
+ ? Duration.sum(
983
+ Duration.fromInputUnsafe(health.timeout),
984
+ Duration.fromInputUnsafe(STEP_BUDGETS.health.timeout),
985
+ )
986
+ : STEP_BUDGETS[step].timeout,
987
+ interval: "1 second",
988
+ }).timeout,
989
+ );
990
+ return ssh.exec(command).pipe(
991
+ Effect.catch(classifyExit({ unitName, host: target.host, volume })),
992
+ Effect.timeoutOrElse({
993
+ duration: limit,
994
+ orElse: () =>
995
+ Effect.fail(
996
+ new ServiceStepTimeout({
997
+ step,
998
+ unitName,
999
+ host: target.host,
1000
+ message: `${TYPE} '${id}': the remote step '${step}' on ${target.host} did not finish within ${Duration.format(limit)}; the SSH command was stopped`,
1001
+ }),
1002
+ ),
1003
+ }),
1004
+ );
1005
+ };
1006
+ yield* waitForSsh(ssh, budget("ssh", DEFAULTS.ssh));
1007
+ yield* run("tools", toolsScript(appDir));
1008
+ yield* run(
1009
+ image !== undefined ? "docker" : "node",
1010
+ image !== undefined ? dockerScript : nodeScript,
1011
+ );
1012
+ for (const volume of volumes) {
1013
+ yield* Effect.gen(function* () {
1014
+ const { device, fallbackMount, fsType } = yield* ensureAttached({
1015
+ volume,
1016
+ serverId,
1017
+ availabilityZone,
1018
+ attach: budget("attach", DEFAULTS.attach),
1019
+ device: budget("device", DEFAULTS.device),
1020
+ });
1021
+ yield* run(
1022
+ "mount",
1023
+ mountScript({ unitName, device, fallbackMount, path: volume.path, fsType }),
1024
+ volume,
1025
+ );
1026
+ }).pipe(volumeLock(volume.volumeId).withPermits(1));
1027
+ }
1028
+ for (const volume of dropped) {
1029
+ yield* run("unmount", unmountScript({ unitName, path: volume.path }));
1030
+ }
1031
+ if (image !== undefined) {
1032
+ yield* ssh.scp(image.archive, `${appDir}/image.tar`);
1033
+ } else {
1034
+ yield* ssh.scp(program!.archive, `${appDir}/bundle.zip`);
1035
+ }
1036
+ // Created 0600 (staged with that mode, `scp -p`): never readable by others (Y11).
1037
+ yield* ssh.scp(new TextEncoder().encode(envFile), `${appDir}/env`, { mode: 0o600 });
1038
+ yield* run("chmod", `chmod 600 ${shellQuote(`${appDir}/env`)}`);
1039
+ yield* ssh.scp(
1040
+ new TextEncoder().encode(unit),
1041
+ `/etc/systemd/system/${unitName}.service`,
1042
+ );
1043
+ yield* run(
1044
+ "start",
1045
+ image !== undefined ? startImageScript(unitName) : startScript(unitName),
1046
+ );
1047
+ yield* run(
1048
+ "health",
1049
+ healthScript({
1050
+ unitName,
1051
+ // A container's health is only "active" (as on Hetzner).
1052
+ port: image === undefined ? props.port : undefined,
1053
+ attempts,
1054
+ intervalSeconds,
1055
+ }),
1056
+ );
1057
+ }),
1058
+ );
1059
+
1060
+ return {
1061
+ serverId,
1062
+ availabilityZone,
1063
+ ipv4,
1064
+ ipv6,
1065
+ port,
1066
+ url: serviceUrl(ipv4, ipv6, port),
1067
+ unitName,
1068
+ code: { hash },
1069
+ volumes: volumes.map((volume) => ({ volumeId: volume.volumeId, path: volume.path })),
1070
+ } satisfies ServiceAttributes;
1071
+ }),
1072
+
1073
+ delete: Effect.fn(function* ({ id, olds, output }) {
1074
+ const target = yield* targetOf(olds as ServiceProps, id).pipe(
1075
+ Effect.catchTag("ServiceError", (error) =>
1076
+ Effect.logWarning(`${error.message}; unit ${output.unitName} left in place`).pipe(
1077
+ Effect.as(undefined),
1078
+ ),
1079
+ ),
1080
+ );
1081
+ if (target === undefined) return;
1082
+ yield* withSession(target, (ssh) =>
1083
+ Effect.gen(function* () {
1084
+ // Stop the unit first: a running process keeps its mount busy.
1085
+ yield* ssh.exec(removeScript(output.unitName));
1086
+ for (const volume of output.volumes ?? []) {
1087
+ yield* ssh.exec(unmountScript({ unitName: output.unitName, path: volume.path }));
1088
+ }
1089
+ }),
1090
+ ).pipe(
1091
+ // The server is gone (deleted out of band, or unreachable): nothing to stop.
1092
+ Effect.catchTag("SshError", (error) =>
1093
+ Effect.logWarning(
1094
+ `${TYPE} '${id}': could not reach the server to remove unit ${output.unitName}: ${error.message}`,
1095
+ ),
1096
+ ),
1097
+ );
1098
+ }),
1099
+ });
1100
+ }),
1101
+ );