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,1469 @@
1
+ // The OpenSSH deploy-key encoding and the first-boot bootstrap idea are adapted from
2
+ // @alchemy.run/hetzner@2.0.0-beta.87 (Apache-2.0), src/Server.ts; modified.
3
+ import { generateKeyPairSync, randomBytes } from "node:crypto";
4
+ import { Unowned } from "alchemy/AdoptPolicy";
5
+ import { isResolved } from "alchemy/Diff";
6
+ import { createPhysicalName } from "alchemy/PhysicalName";
7
+ import * as Provider from "alchemy/Provider";
8
+ import { Resource } from "alchemy/Resource";
9
+ import * as Data from "effect/Data";
10
+ import * as Duration from "effect/Duration";
11
+ import * as Effect from "effect/Effect";
12
+ import * as Redacted from "effect/Redacted";
13
+ import * as Schedule from "effect/Schedule";
14
+ import * as Stream from "effect/Stream";
15
+ import { afterAction } from "../internal/actionWait.ts";
16
+ import { budgetsFor, type WaitBudget } from "../internal/budget.ts";
17
+ import { membersOf, pick, rejectedFields, same } from "../internal/fields.ts";
18
+ import {
19
+ belongsTo,
20
+ generationOf,
21
+ isAlchemyOwned,
22
+ markerOf,
23
+ ownerOf,
24
+ withOwner,
25
+ withoutOwner,
26
+ } from "../internal/ownership.ts";
27
+ import {
28
+ resolveScope,
29
+ type Scope,
30
+ type TeamProp,
31
+ type ZoneAttribute,
32
+ type ZoneProp,
33
+ } from "../internal/scope.ts";
34
+ import { waitFor, WaitFailed, WaitTimeout } from "../internal/wait.ts";
35
+ import type { Providers } from "../Providers.ts";
36
+ import * as Cloud from "../sdk/services/cloud.ts";
37
+ import { hostKeyOf, probeSsh, SshReadiness, type SshProbe, type SshServices } from "./Ssh.ts";
38
+
39
+ /** `<type> <base64>` of a public key line we generated (always well-formed). */
40
+ const hostKeyOfLine = (line: string): string => hostKeyOf(line) ?? line;
41
+
42
+ const TYPE = "BetterStack.Cloud.Server";
43
+
44
+ /** Props of {@link Server}. */
45
+ export interface ServerProps
46
+ extends
47
+ Omit<
48
+ Cloud.CreateServerRequest,
49
+ "teamId" | "availabilityZone" | "name" | "sshKeys" | "userData" | "term"
50
+ >,
51
+ TeamProp,
52
+ ZoneProp {
53
+ /**
54
+ * The server's name, unique among the organization's servers that aren't
55
+ * destroyed or terminated. Defaults to a unique lowercase name generated
56
+ * from the stack, stage and logical id. Changes in place (a rename); a
57
+ * replacement that keeps an explicit name deletes the old server first.
58
+ */
59
+ name?: string;
60
+ /**
61
+ * Slugs of your own `Cloud.SshKey`s to authorize for `root`. Optional: the
62
+ * server always gets Alchemy's deploy key as well (unless `bootstrap` is
63
+ * `false`). Changes in place through attach/detach actions; only keys this
64
+ * prop listed before are detached, so keys attached elsewhere (an
65
+ * `SshKey`'s `serverIds`) are left alone.
66
+ */
67
+ sshKeys?: Array<string>;
68
+ /**
69
+ * A cloud-init `#cloud-config` document or a script starting with `#!`,
70
+ * run on the first boot, at most 32 KiB. The API never returns it.
71
+ * Without it, Alchemy sends its own bootstrap script (it preinstalls
72
+ * Node.js for `Cloud.Service`); with it, your document is sent unchanged
73
+ * instead (the Cloud API takes one document, not a multipart one) and
74
+ * `Cloud.Service` installs Node.js over SSH when it is missing. Cloud-init
75
+ * runs once, so changing it replaces the server.
76
+ */
77
+ userData?: string | Redacted.Redacted<string>;
78
+ /**
79
+ * The billing term: `monthly` (the default) or `annual`. `annual` commits
80
+ * you to paying for a whole year. The server's public IPs and add-ons are
81
+ * billed on the same term. Changes in place.
82
+ */
83
+ term?: "monthly" | "annual";
84
+ /**
85
+ * Whether Alchemy manages a deploy key for the server and proves it
86
+ * answers SSH before the deploy continues. `false` makes a plain server:
87
+ * no deploy key, no bootstrap script, no SSH check, and so no
88
+ * `Cloud.Ssh` / `Cloud.Service` without your own key. Changing it
89
+ * replaces the server.
90
+ *
91
+ * @default true
92
+ */
93
+ bootstrap?: boolean;
94
+ }
95
+
96
+ /** Attributes of {@link Server}: the server as the API returns it, plus how to reach it. */
97
+ export interface ServerAttributes
98
+ extends
99
+ Omit<
100
+ Cloud.Server,
101
+ "id" | "name" | "status" | "serverType" | "sshKeys" | "networkIds" | "firewallIds"
102
+ >,
103
+ ZoneAttribute {
104
+ /** The server's ID. */
105
+ id: string;
106
+ /** Same as {@link id}: lets props that take a `serverId` accept the server's attributes. */
107
+ serverId: string;
108
+ /** The server's name. */
109
+ name: string;
110
+ /** The server's power and lifecycle status; `running` after every successful deploy. */
111
+ status: string;
112
+ /** The server type, such as `AM1`. */
113
+ serverType: string;
114
+ /** Slugs of every SSH key on the server, the deploy key included. */
115
+ sshKeys: Array<string>;
116
+ /** IDs of the private networks the server is attached to. */
117
+ networkIds: Array<string>;
118
+ /** IDs of the firewalls attached to the server (at most one). */
119
+ firewallIds: Array<string>;
120
+ /** The first public IPv4 address, or `undefined` for a server without one (`publicIpv4: false`). */
121
+ ipv4: string | undefined;
122
+ /** The first public IPv6 address, or `undefined`. */
123
+ ipv6: string | undefined;
124
+ /** The address to SSH to: {@link ipv4}, else {@link ipv6}. */
125
+ sshHost: string | undefined;
126
+ /** The user to SSH as: always `root` on Better Stack Cloud. */
127
+ sshUser: string;
128
+ /**
129
+ * The Alchemy-managed deploy key's private half (OpenSSH format), kept in
130
+ * state. `Cloud.Ssh` and `Cloud.Service` log in with it. `undefined` for
131
+ * `bootstrap: false` and for looked-up or adopted servers Alchemy did not
132
+ * create (until a deploy installs a new deploy key).
133
+ */
134
+ privateKey?: Redacted.Redacted<string> | undefined;
135
+ /** Slug of the deploy key's `SshKey` (not a stack resource: the server creates and deletes it). */
136
+ deployKeySlug?: string | undefined;
137
+ /** The deploy key's public half (`ssh-ed25519 …`). */
138
+ deployPublicKey?: string | undefined;
139
+ /**
140
+ * Deploy keys of earlier servers of this resource that were deleted out of
141
+ * band, which the API still refused to delete (a destroyed server's record
142
+ * holds its keys for a while). Every later deploy retries them, and
143
+ * `destroy` fails until they are gone, so none is left behind.
144
+ */
145
+ staleDeployKeySlugs?: Array<string> | undefined;
146
+ /**
147
+ * The server's SSH host key (`ssh-ed25519 <base64>`), required by every
148
+ * connection `Cloud.Ssh` / `Cloud.Service` make (`StrictHostKeyChecking=yes`
149
+ * against a per-session `known_hosts`). See "SSH host keys" above for how it
150
+ * was obtained: {@link hostKeyTrust}.
151
+ */
152
+ hostPublicKey?: string | undefined;
153
+ /**
154
+ * How {@link hostPublicKey} is known. `pinned`: Alchemy generated the host
155
+ * key pair and installed it through the first-boot bootstrap, so even the
156
+ * first connection was verified. `first-use`: learned from the server on
157
+ * the first login (a server with your own `userData`, or one Alchemy took
158
+ * back or adopted), then required on every later connection. `undefined`:
159
+ * none known (`bootstrap: false`, looked-up servers): each session trusts
160
+ * the key it is shown.
161
+ */
162
+ hostKeyTrust?: "pinned" | "first-use" | undefined;
163
+ /** The reserved IPs this stack assigned (the API never returns them). */
164
+ reservedIpIds?: Array<string> | undefined;
165
+ /**
166
+ * The reserved IPs the server was created with: its boot addresses. The API
167
+ * refuses to unassign them (`IpIsPrimary`), so removing one from
168
+ * `reservedIpIds` replaces the server.
169
+ */
170
+ bootReservedIpIds?: Array<string> | undefined;
171
+ /** Whether the server was created with a public IPv4 address (the API never returns it). */
172
+ publicIpv4?: boolean | undefined;
173
+ }
174
+
175
+ /**
176
+ * What a server collects from what binds to it (`Cloud.MountVolume`,
177
+ * `Cloud.Service` environment), as on `@alchemy.run/hetzner`'s `Server`.
178
+ */
179
+ export interface ServerBinding {
180
+ /** Environment variables collected from bindings. */
181
+ env?: Record<string, any>;
182
+ /** Volumes to attach and mount, from `Cloud.MountVolume`. */
183
+ volumes?: Array<{ volumeId: string; path: string }>;
184
+ }
185
+
186
+ /** Props for {@link Server.lookup}: a server this stack doesn't manage, by id or by name. */
187
+ export interface ServerLookup {
188
+ /** The server's ID. */
189
+ id?: string;
190
+ /** The server's name (unique among live servers). */
191
+ name?: string;
192
+ /** Zone it lives in, such as `us-west-2a`. Defaults to the credentials' zone. */
193
+ availabilityZone?: string;
194
+ }
195
+
196
+ export type Server = Resource<
197
+ "BetterStack.Cloud.Server",
198
+ ServerProps,
199
+ ServerAttributes,
200
+ ServerBinding,
201
+ Providers,
202
+ ServerLookup
203
+ >;
204
+
205
+ /**
206
+ * A Better Stack Cloud server: a virtual machine running Ubuntu, with NVMe
207
+ * storage, public IPv4 and IPv6, private networks and a firewall, billed
208
+ * hourly up to a monthly cap. It is both a compute primitive and the host
209
+ * `Cloud.Service` and `Cloud.Website.*` deploy code onto.
210
+ *
211
+ * **Sizes and images.** `serverType` is a type name such as `AM1` (the
212
+ * smallest) or `AM4`; `image` is an image slug such as `ubuntu-26-04`. List
213
+ * them with the Cloud lookups (`listServerType` / `listImage` in the SDK,
214
+ * `betterstack server-type list` / `betterstack image list` in the CLI).
215
+ *
216
+ * **Billing.** `term` defaults to `monthly`. `annual` commits you to a full
217
+ * year of the server (about two months cheaper); leave it out unless you
218
+ * mean that.
219
+ *
220
+ * **What replaces, what changes in place.** `image`, `userData`,
221
+ * `bootstrap`, `publicIpv4`, `placementGroupId`, `ddosProtection`,
222
+ * `observability`, `aiEngineerAccess`, `teamId` and `availabilityZone`
223
+ * replace the server (a new server is created, dependents move to it, the
224
+ * old one is deleted; with an explicit `name` or shared `reservedIpIds` the
225
+ * old one is deleted first). Everything else changes in place: `name`,
226
+ * `metadata`, `subdomain`, `term` and `vulnerabilityMonitoring` through an
227
+ * update; `serverType` through a rescale (the server reboots, and the deploy
228
+ * waits until it runs again with the new type); `networkIds`,
229
+ * `firewallIds` and `sshKeys` through attach/detach actions; reserved IPs
230
+ * ADDED to `reservedIpIds` after the create through assign/unassign. The
231
+ * reserved IPs a server is created with are its boot addresses: the API
232
+ * won't unassign them, so removing one replaces the server. A list prop left
233
+ * out is not managed: only items it listed before are ever detached. A prop
234
+ * that points at a resource created or replaced in the same deploy (a new
235
+ * `PlacementGroup`'s id, say) is not known at plan time: when it is a
236
+ * replacing prop, the plan replaces the server.
237
+ *
238
+ * **Networking.** The attributes carry `ipv4`, `ipv6`, `privateIps` (one
239
+ * address per attached network) and `ipAddresses`. Give a server a fixed
240
+ * address in a network with `Cloud.ServerPrivateIp`, block storage with
241
+ * `Cloud.Volume`, a stable public address with `reservedIpIds`.
242
+ *
243
+ * **The deploy key, and SSH.** For every server it creates, Alchemy
244
+ * generates an ed25519 key pair, registers the public half as a team SSH key
245
+ * (slug `<stack>-<id>-<stage>-…-deploy-<hex>`, in `deployKeySlug`) installed on
246
+ * the server at first boot, and keeps the private half `Redacted` in the
247
+ * server's state (`privateKey`). A deploy returns only once the server is
248
+ * `running` **and** an SSH login as `root` with that key has succeeded, so
249
+ * the next resource can SSH in at once. Open a session with `Cloud.Ssh`, or
250
+ * by hand: `ssh -i <privateKey file> root@<sshHost>`. Deleting the server
251
+ * detaches every key from it and then deletes the deploy key.
252
+ *
253
+ * **SSH host keys.** Every connection checks the server's host key — never
254
+ * `StrictHostKeyChecking=no`. For a server it creates with its own bootstrap
255
+ * (no `userData`), Alchemy generates the ed25519 host key pair locally and
256
+ * the bootstrap installs it as `/etc/ssh/ssh_host_ed25519_key` before
257
+ * anything else; `hostPublicKey` holds the public half (`hostKeyTrust:
258
+ * "pinned"`), so even the very first login (the deploy's readiness check)
259
+ * only succeeds against that key — until the bootstrap has swapped the
260
+ * key, logins are refused and retried. The private half travels in the
261
+ * server's `user_data` only (never in state); anyone who can read the
262
+ * server's user data (root on it, Better Stack) could impersonate the host.
263
+ * A server with your own `userData` can't be given the key (the Cloud API
264
+ * takes one first-boot document), nor can one Alchemy recovers or adopts:
265
+ * those are trust-on-first-use — the key shown at the first login is
266
+ * recorded (`hostKeyTrust: "first-use"`) and required from then on. With
267
+ * `bootstrap: false` (and for looked-up servers) no key is known: each
268
+ * `Cloud.Ssh` session trusts the key it is shown and logs a warning. A
269
+ * mismatch fails with `SshError` `reason: "host-key-mismatch"` and sends
270
+ * nothing.
271
+ *
272
+ * Waits are bounded: 15 minutes for a create, 30 for a rescale, 5 for an
273
+ * attachment and for SSH, 10 for a delete; each fails with a typed
274
+ * `WaitTimeout` (or `WaitFailed` when the server reaches `stopped`,
275
+ * `destroyed`, `terminating` or `terminated`). A create whose server fails
276
+ * deletes it again; one that times out leaves it, and the next deploy finds
277
+ * it by name and carries on.
278
+ *
279
+ * **Ownership.** Every object the stack creates carries an `alchemy` entry in its
280
+ * `metadata` (`<stack>/<stage>/<resource id>#<instance>`), added on every write and left
281
+ * out of the attributes and of diffs; your own keys are untouched (it takes one of the
282
+ * 10 slots). A deploy that lost track of an object it created (a create that failed
283
+ * or timed out after the API accepted it) finds it by that marker and converges it
284
+ * instead of creating another; `list` (and so `alchemy nuke`) returns only
285
+ * Alchemy-created objects; an object with the same name but no marker of this
286
+ * resource is taken over only with `--adopt`.
287
+ *
288
+ * **`PaymentRequired` on the first create.** The first billable create of an
289
+ * account can be refused with a typed `PaymentRequired` (HTTP 402
290
+ * `payment_required`) whose message carries a payment link. Paying through
291
+ * that link creates the object FROM THE REFUSED REQUEST, later and outside
292
+ * the deploy (observed live 2026-12-01 for a server: our name, ownership
293
+ * marker, type and `ssh_keys`). Deploy again after paying: the deploy finds
294
+ * the object by its ownership marker and converges it instead of creating a
295
+ * second one (proven offline; a recovered server's host key is then
296
+ * trust-on-first-use and its deploy key is replaced).
297
+ *
298
+ * **Verified live** (one `AM1` in `us-west-2a`, 2026-12-01): `AM1` +
299
+ * `ubuntu-26-04` boot to `running`; deploy-key login as `root`; Node.js 26
300
+ * from NodeSource through the bootstrap; rename and `metadata` in place (the
301
+ * ownership marker survives); network attach/detach and firewall
302
+ * detach/attach in place; a private IP configured on the interface; delete
303
+ * removes the server and its deploy key. NOT live-verified: rescale,
304
+ * replacement, reserved IPs, server pools, `bootstrap: false`, your own
305
+ * `userData`, and the host-key pinning described above (added after that
306
+ * run; proven offline and against a fake `ssh` only).
307
+ *
308
+ * @see https://betterstack.com/docs/cloud/servers/
309
+ *
310
+ * ### Creating a server
311
+ * **Example:** The smallest server
312
+ * ```typescript
313
+ * const server = yield* BetterStack.Cloud.Server("web", {
314
+ * serverType: "AM1",
315
+ * image: "ubuntu-26-04",
316
+ * });
317
+ * ```
318
+ *
319
+ * **Example:** Named, with your own key, tags and a monthly term
320
+ * ```typescript
321
+ * const key = yield* BetterStack.Cloud.SshKey("laptop", {
322
+ * publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEF0uIiLF54lpavoiG7O95cChLJ80vbi0Nh08Kf3+G/a me@example.com",
323
+ * });
324
+ * const server = yield* BetterStack.Cloud.Server("api", {
325
+ * name: "api-1",
326
+ * serverType: "AM1",
327
+ * image: "ubuntu-26-04",
328
+ * term: "monthly",
329
+ * sshKeys: [key.slug],
330
+ * metadata: { role: "api" },
331
+ * });
332
+ * ```
333
+ *
334
+ * ### Networking
335
+ * **Example:** A private network and a firewall
336
+ * ```typescript
337
+ * const network = yield* BetterStack.Cloud.Network("private", {
338
+ * ipPrefix: "10.0.0.0",
339
+ * ipPrefixLength: 24,
340
+ * });
341
+ * const firewall = yield* BetterStack.Cloud.Firewall("public", {});
342
+ * const server = yield* BetterStack.Cloud.Server("web", {
343
+ * serverType: "AM1",
344
+ * image: "ubuntu-26-04",
345
+ * networkIds: [network.id],
346
+ * firewallIds: [firewall.id],
347
+ * });
348
+ * ```
349
+ *
350
+ * ### First boot
351
+ * **Example:** A cloud-config document
352
+ * ```typescript
353
+ * const server = yield* BetterStack.Cloud.Server("web", {
354
+ * serverType: "AM1",
355
+ * image: "ubuntu-26-04",
356
+ * userData: `#cloud-config
357
+ * packages:
358
+ * - nginx`,
359
+ * });
360
+ * ```
361
+ *
362
+ * ### SSH
363
+ * **Example:** Run a command with the deploy key
364
+ * ```typescript
365
+ * const ssh = yield* BetterStack.Cloud.Ssh(server);
366
+ * const { stdout } = yield* ssh.exec("uname -a");
367
+ * ```
368
+ *
369
+ * ### Looking up an existing server
370
+ * A looked-up server has no `privateKey`: Alchemy holds deploy keys only
371
+ * for servers it created.
372
+ *
373
+ * **Example:** Reference a server by name
374
+ * ```typescript
375
+ * const existing = BetterStack.Cloud.Server.lookup({ name: "web-1" });
376
+ * ```
377
+ *
378
+ * @resource
379
+ * @product Cloud
380
+ */
381
+ export const Server = Resource<Server>("BetterStack.Cloud.Server");
382
+
383
+ /** The composed first-boot document is over the Cloud API's 32 KiB `user_data` limit. */
384
+ /** Deploy keys a destroyed server still holds could not be deleted yet; destroy again later. */
385
+ export class ServerDeployKeysHeld extends Data.TaggedError("ServerDeployKeysHeld")<{
386
+ readonly message: string;
387
+ readonly slugs: ReadonlyArray<string>;
388
+ }> {}
389
+
390
+ export class ServerUserDataTooLarge extends Data.TaggedError("ServerUserDataTooLarge")<{
391
+ readonly message: string;
392
+ readonly bytes: number;
393
+ readonly limit: number;
394
+ }> {}
395
+
396
+ /** Statuses a create never recovers from (catalog `waits.create.failure`). */
397
+ const CREATE_FAILED = new Set(["stopped", "destroyed", "terminating", "terminated"]);
398
+ /** Statuses that, without the requested type, end a rescale (catalog rescale wait). */
399
+ const RESCALE_FAILED = new Set(["running", "stopped", "destroyed", "terminating", "terminated"]);
400
+ /** A server that still answers but is gone (catalog `goneWhen`). */
401
+ const GONE = new Set(["destroyed", "terminated"]);
402
+
403
+ /** Default budgets: what the live API takes, with margin. Tests shrink them via `WaitBudgets`. */
404
+ const DEFAULTS = {
405
+ create: { timeout: "15 minutes", interval: "5 seconds" },
406
+ rescale: { timeout: "30 minutes", interval: "5 seconds" },
407
+ attach: { timeout: "5 minutes", interval: "2 seconds" },
408
+ ssh: { timeout: "5 minutes", interval: "5 seconds" },
409
+ delete: { timeout: "10 minutes", interval: "3 seconds" },
410
+ releaseKeys: { timeout: "1 minute", interval: "2 seconds" },
411
+ deployKeyDelete: { timeout: "2 minutes", interval: "5 seconds" },
412
+ reservedIp: { timeout: "15 minutes", interval: "15 seconds" },
413
+ } satisfies Record<string, WaitBudget>;
414
+
415
+ /** Cloud's `user_data` limit. */
416
+ const MAX_USER_DATA_BYTES = 32 * 1024;
417
+
418
+ /**
419
+ * Preinstall Node.js so `Cloud.Service`'s first deploy does not have to.
420
+ * Never fails the boot: `Cloud.Service` installs Node.js over SSH if this
421
+ * did not manage to.
422
+ */
423
+ export const DEPLOY_BOOTSTRAP = `#!/bin/bash
424
+ set -uo pipefail
425
+ export HOME=/root
426
+ __ALCHEMY_HOST_KEY__if ! command -v curl >/dev/null 2>&1 || ! command -v unzip >/dev/null 2>&1; then
427
+ apt-get update || true
428
+ DEBIAN_FRONTEND=noninteractive apt-get install -y curl unzip ca-certificates || true
429
+ fi
430
+ if ! command -v node >/dev/null 2>&1; then
431
+ for attempt in 1 2 3; do
432
+ curl -fsSL https://deb.nodesource.com/setup_26.x | bash - && DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs && break
433
+ sleep 5
434
+ done
435
+ fi
436
+ exit 0
437
+ `;
438
+
439
+ /** An ed25519 host key pair Alchemy installs on a server it creates (OpenSSH format). */
440
+ export interface HostKeyPair {
441
+ /** `ssh-ed25519 <base64> alchemy-host`. */
442
+ readonly publicKey: string;
443
+ readonly privateKey: string;
444
+ }
445
+
446
+ /**
447
+ * The bootstrap with `hostKey` installed as the server's ed25519 host key,
448
+ * FIRST (before the slow package installs), then sshd restarted so it
449
+ * presents it. Without a key: {@link DEPLOY_BOOTSTRAP} as before.
450
+ */
451
+ export const deployBootstrap = (hostKey?: HostKeyPair): string =>
452
+ DEPLOY_BOOTSTRAP.replace(
453
+ "__ALCHEMY_HOST_KEY__",
454
+ hostKey === undefined
455
+ ? ""
456
+ : [
457
+ `umask 077`,
458
+ `cat > /etc/ssh/ssh_host_ed25519_key <<'ALCHEMY_HOST_KEY'`,
459
+ hostKey.privateKey.trimEnd(),
460
+ `ALCHEMY_HOST_KEY`,
461
+ `printf '%s\\n' '${hostKey.publicKey}' > /etc/ssh/ssh_host_ed25519_key.pub`,
462
+ `chmod 600 /etc/ssh/ssh_host_ed25519_key`,
463
+ `chmod 644 /etc/ssh/ssh_host_ed25519_key.pub`,
464
+ `umask 022`,
465
+ `systemctl restart ssh.service 2>/dev/null || systemctl restart sshd.service 2>/dev/null || true`,
466
+ ``,
467
+ ].join("\n"),
468
+ );
469
+
470
+ const revealText = (value: string | Redacted.Redacted<string> | undefined) =>
471
+ value === undefined ? undefined : typeof value === "string" ? value : Redacted.value(value);
472
+
473
+ /**
474
+ * The `user_data` sent at create: the props' document unchanged, else the
475
+ * bootstrap script (with `bootstrap`), else nothing.
476
+ */
477
+ export const composeUserData = (
478
+ userData: string | Redacted.Redacted<string> | undefined,
479
+ bootstrap: boolean,
480
+ hostKey?: HostKeyPair,
481
+ ): string | undefined => {
482
+ const doc = revealText(userData);
483
+ if (doc !== undefined && doc.trim() !== "") return doc;
484
+ return bootstrap ? deployBootstrap(hostKey) : undefined;
485
+ };
486
+
487
+ // ---------------------------------------------------------------------------
488
+ // The deploy key
489
+ // ---------------------------------------------------------------------------
490
+
491
+ const u32be = (n: number) => {
492
+ const buf = Buffer.alloc(4);
493
+ buf.writeUInt32BE(n);
494
+ return buf;
495
+ };
496
+ const sshString = (data: Buffer | string) => {
497
+ const buf = typeof data === "string" ? Buffer.from(data) : data;
498
+ return Buffer.concat([u32be(buf.length), buf]);
499
+ };
500
+
501
+ /** An ed25519 key pair as OpenSSH public + private key files (`ssh -i` rejects PKCS8 ed25519 PEMs on macOS). */
502
+ const encodeOpenSshEd25519 = (publicRaw: Buffer, seed: Buffer, comment: string) => {
503
+ const algo = Buffer.from("ssh-ed25519");
504
+ const pubBlob = Buffer.concat([sshString(algo), sshString(publicRaw)]);
505
+ const publicKey = `ssh-ed25519 ${pubBlob.toString("base64")} ${comment}`;
506
+ const check = randomBytes(4);
507
+ let inner = Buffer.concat([
508
+ check,
509
+ check,
510
+ sshString(algo),
511
+ sshString(publicRaw),
512
+ sshString(Buffer.concat([seed, publicRaw])),
513
+ sshString(comment),
514
+ ]);
515
+ const padLen = (8 - (inner.length % 8)) % 8;
516
+ const pad = Buffer.alloc(padLen);
517
+ for (let i = 0; i < padLen; i++) pad[i] = i + 1;
518
+ inner = Buffer.concat([inner, pad]);
519
+ const body = Buffer.concat([
520
+ Buffer.from("openssh-key-v1\0"),
521
+ sshString("none"),
522
+ sshString("none"),
523
+ sshString(""),
524
+ u32be(1),
525
+ sshString(pubBlob),
526
+ sshString(inner),
527
+ ]);
528
+ const b64 = body.toString("base64");
529
+ const wrapped = b64.match(/.{1,70}/g)?.join("\n") ?? b64;
530
+ return {
531
+ publicKey,
532
+ privateKey: `-----BEGIN OPENSSH PRIVATE KEY-----\n${wrapped}\n-----END OPENSSH PRIVATE KEY-----\n`,
533
+ };
534
+ };
535
+
536
+ /** A fresh ed25519 deploy key pair in OpenSSH format. */
537
+ export const generateDeployKey = Effect.sync(() => {
538
+ const { publicKey, privateKey } = generateKeyPairSync("ed25519");
539
+ const spki = publicKey.export({ type: "spki", format: "der" });
540
+ const pkcs8 = privateKey.export({ type: "pkcs8", format: "der" });
541
+ return encodeOpenSshEd25519(
542
+ spki.subarray(spki.length - 32),
543
+ pkcs8.subarray(pkcs8.length - 32),
544
+ "alchemy-deploy",
545
+ );
546
+ });
547
+
548
+ /** A fresh ed25519 host key pair in OpenSSH format. */
549
+ export const generateHostKey: Effect.Effect<HostKeyPair> = Effect.sync(() => {
550
+ const { publicKey, privateKey } = generateKeyPairSync("ed25519");
551
+ const spki = publicKey.export({ type: "spki", format: "der" });
552
+ const pkcs8 = privateKey.export({ type: "pkcs8", format: "der" });
553
+ return encodeOpenSshEd25519(
554
+ spki.subarray(spki.length - 32),
555
+ pkcs8.subarray(pkcs8.length - 32),
556
+ "alchemy-host",
557
+ );
558
+ });
559
+
560
+ interface DeployKey {
561
+ readonly slug: string;
562
+ readonly publicKey: string;
563
+ readonly privateKey: Redacted.Redacted<string>;
564
+ }
565
+
566
+ // ---------------------------------------------------------------------------
567
+ // Helpers
568
+ // ---------------------------------------------------------------------------
569
+
570
+ /** The mutable server fields `update_server` carries. */
571
+ const UPDATE_FIELDS = ["name", "metadata", "subdomain", "term", "vulnerabilityMonitoring"] as const;
572
+ /** Props whose change replaces the server. */
573
+ const REPLACE_FIELDS = [
574
+ "aiEngineerAccess",
575
+ "ddosProtection",
576
+ "image",
577
+ "observability",
578
+ "placementGroupId",
579
+ "publicIpv4",
580
+ "userData",
581
+ ] as const;
582
+
583
+ const strings = (value: unknown): Array<string> =>
584
+ Array.isArray(value) ? value.filter((v) => v !== undefined && v !== null).map(String) : [];
585
+
586
+ /** The failures of the server's attach / detach actions (each its own documented union). */
587
+ type AddError =
588
+ | Cloud.AttachNetworkError
589
+ | Cloud.AttachFirewallError
590
+ | Cloud.AttachSshKeyError
591
+ | Cloud.AssignReservedIpError;
592
+ type RemoveError =
593
+ | Cloud.DetachNetworkError
594
+ | Cloud.DetachFirewallError
595
+ | Cloud.DetachSshKeyError
596
+ | Cloud.UnassignReservedIpError;
597
+
598
+ const isTag =
599
+ (...tags: ReadonlyArray<string>) =>
600
+ (error: { readonly _tag: string }) =>
601
+ tags.includes(error._tag);
602
+
603
+ const attempts = (budget: WaitBudget) =>
604
+ Math.max(
605
+ 1,
606
+ Math.ceil(
607
+ Duration.toMillis(Duration.fromInputUnsafe(budget.timeout)) /
608
+ Math.max(1, Duration.toMillis(Duration.fromInputUnsafe(budget.interval))),
609
+ ),
610
+ );
611
+
612
+ /** Retry `effect` while `retryable` holds, within `budget`. */
613
+ const retryWithin = <A, E, R>(
614
+ effect: Effect.Effect<A, E, R>,
615
+ retryable: (error: E) => boolean,
616
+ budget: WaitBudget,
617
+ ) =>
618
+ Effect.retry(effect, {
619
+ while: retryable,
620
+ schedule: Schedule.spaced(Duration.fromInputUnsafe(budget.interval)),
621
+ times: attempts(budget),
622
+ });
623
+
624
+ const toAttrs = (
625
+ server: Cloud.Server,
626
+ scope: Scope,
627
+ carry: {
628
+ readonly deploy?: DeployKey | undefined;
629
+ readonly stale?: ReadonlyArray<string> | undefined;
630
+ readonly reservedIpIds?: Array<string> | undefined;
631
+ readonly bootReservedIpIds?: Array<string> | undefined;
632
+ readonly publicIpv4?: boolean | undefined;
633
+ readonly hostKey?: { readonly key: string; readonly trust: "pinned" | "first-use" } | undefined;
634
+ },
635
+ ): ServerAttributes => {
636
+ const addresses = server.ipAddresses ?? [];
637
+ const ipv4 = addresses.find((a) => a.type === "ipv4" && a.ip)?.ip;
638
+ const ipv6 = addresses.find((a) => a.type === "ipv6" && a.ip)?.ip;
639
+ const id = String(server.id);
640
+ return {
641
+ ...server,
642
+ metadata: withoutOwner(server.metadata),
643
+ id,
644
+ serverId: id,
645
+ name: server.name ?? "",
646
+ status: server.status ?? "unknown",
647
+ serverType: server.serverType ?? "",
648
+ sshKeys: strings(server.sshKeys),
649
+ networkIds: strings(server.networkIds),
650
+ firewallIds: strings(server.firewallIds),
651
+ availabilityZone: scope.availabilityZone!,
652
+ ipv4,
653
+ ipv6,
654
+ sshHost: ipv4 ?? ipv6,
655
+ sshUser: "root",
656
+ privateKey: carry.deploy?.privateKey,
657
+ deployKeySlug: carry.deploy?.slug,
658
+ deployPublicKey: carry.deploy?.publicKey,
659
+ staleDeployKeySlugs:
660
+ carry.stale !== undefined && carry.stale.length > 0 ? [...carry.stale] : undefined,
661
+ reservedIpIds: carry.reservedIpIds,
662
+ bootReservedIpIds:
663
+ carry.bootReservedIpIds !== undefined && carry.bootReservedIpIds.length > 0
664
+ ? [...carry.bootReservedIpIds]
665
+ : undefined,
666
+ publicIpv4: carry.publicIpv4,
667
+ hostPublicKey: carry.hostKey?.key,
668
+ hostKeyTrust: carry.hostKey?.trust,
669
+ };
670
+ };
671
+
672
+ const hostKeyFrom = (attrs: ServerAttributes | undefined) =>
673
+ attrs?.hostPublicKey !== undefined && attrs.hostKeyTrust !== undefined
674
+ ? { key: attrs.hostPublicKey, trust: attrs.hostKeyTrust }
675
+ : undefined;
676
+
677
+ const deployOf = (attrs: ServerAttributes | undefined): DeployKey | undefined =>
678
+ attrs?.privateKey !== undefined &&
679
+ attrs.deployKeySlug !== undefined &&
680
+ attrs.deployPublicKey !== undefined
681
+ ? { slug: attrs.deployKeySlug, publicKey: attrs.deployPublicKey, privateKey: attrs.privateKey }
682
+ : undefined;
683
+
684
+ // ---------------------------------------------------------------------------
685
+ // Provider
686
+ // ---------------------------------------------------------------------------
687
+
688
+ export const ServerProvider = () =>
689
+ Provider.effect(
690
+ Server,
691
+ Effect.gen(function* () {
692
+ const budget = yield* budgetsFor(TYPE);
693
+ const override = yield* SshReadiness;
694
+ const platform = yield* Effect.context<SshServices>();
695
+ const probe: SshProbe =
696
+ override ?? ((target) => probeSsh(target).pipe(Effect.provideContext(platform)));
697
+ const createMembers = membersOf(Cloud.createServer);
698
+
699
+ /** The live server, `undefined` when it is gone (404, `destroyed`, `terminated`). */
700
+ const observe = (id: string, scope: Scope) =>
701
+ Cloud.getServer({ id, availabilityZone: scope.availabilityZone }).pipe(
702
+ Effect.map((server) =>
703
+ server.status !== undefined && GONE.has(server.status) ? undefined : server,
704
+ ),
705
+ Effect.catchTag("NotFound", () => Effect.succeed(undefined)),
706
+ );
707
+
708
+ const findByName = (name: string, scope: Scope) =>
709
+ Cloud.listServer.items({ availabilityZone: scope.availabilityZone }).pipe(
710
+ Stream.filter(
711
+ (server) =>
712
+ server.name === name && !(server.status !== undefined && GONE.has(server.status)),
713
+ ),
714
+ Stream.runHead,
715
+ Effect.map((head) => (head._tag === "Some" ? head.value : undefined)),
716
+ );
717
+
718
+ /** A live server carrying `marker` (exactly, or any generation of it), except `previous`. */
719
+ const findByMarker = (
720
+ marker: string,
721
+ exact: boolean,
722
+ scope: Scope,
723
+ previous?: ServerAttributes,
724
+ ) =>
725
+ Cloud.listServer.items({ availabilityZone: scope.availabilityZone }).pipe(
726
+ Stream.filter((server) => {
727
+ if (server.status !== undefined && GONE.has(server.status)) return false;
728
+ if (previous !== undefined && String(server.id) === previous.id) return false;
729
+ const found = markerOf(server.metadata);
730
+ return exact ? found === marker : belongsTo(found, marker);
731
+ }),
732
+ Stream.runHead,
733
+ Effect.map((head) => (head._tag === "Some" ? head.value : undefined)),
734
+ );
735
+
736
+ /** The server's name: the props', else the recorded one, else a generated one. */
737
+ const nameOf = (id: string, props: ServerProps | undefined, output?: ServerAttributes) =>
738
+ props?.name !== undefined
739
+ ? Effect.succeed(props.name)
740
+ : output?.name
741
+ ? Effect.succeed(output.name)
742
+ : createPhysicalName({ id, maxLength: 63, lowercase: true });
743
+
744
+ /** Deploy key slugs of this server generation start with this prefix: the ownership marker. */
745
+ const deployPrefix = (id: string) =>
746
+ Effect.map(
747
+ createPhysicalName({ id, maxLength: 40, lowercase: true }),
748
+ (base) => `${base}-deploy`,
749
+ );
750
+
751
+ const ownedBy = (server: Cloud.Server, prefix: string) =>
752
+ strings(server.sshKeys).some((slug) => slug.startsWith(`${prefix}-`));
753
+
754
+ const createDeployKey = Effect.fn(function* (id: string, name: string, scope: Scope) {
755
+ const prefix = yield* deployPrefix(id);
756
+ const pair = yield* generateDeployKey;
757
+ const slug = `${prefix}-${randomBytes(3).toString("hex")}`;
758
+ yield* Cloud.createSshKey({
759
+ slug,
760
+ publicKey: pair.publicKey,
761
+ teamId: scope.teamId,
762
+ availabilityZone: scope.availabilityZone,
763
+ metadata: { purpose: "alchemy-deploy", server: name.slice(0, 200) },
764
+ });
765
+ return {
766
+ slug,
767
+ publicKey: pair.publicKey,
768
+ privateKey: Redacted.make(pair.privateKey),
769
+ } satisfies DeployKey;
770
+ });
771
+
772
+ /** Delete a deploy key; the API refuses (`SshKeyInUse`) while a server still holds it, so retry briefly. */
773
+ const deleteDeployKey = (slug: string | undefined, scope: Scope) =>
774
+ slug === undefined
775
+ ? Effect.void
776
+ : retryWithin(
777
+ Cloud.deleteSshKey({ slug, availabilityZone: scope.availabilityZone }),
778
+ isTag("SshKeyInUse"),
779
+ budget("deployKeyDelete", DEFAULTS.deployKeyDelete),
780
+ ).pipe(
781
+ Effect.catchTag("NotFound", () => Effect.void),
782
+ Effect.asVoid,
783
+ );
784
+
785
+ /**
786
+ * Delete the deploy key of a server that went away out of band. The API
787
+ * refuses (`SshKeyInUse`) while that server's record
788
+ * still holds the key, and a gone server can't be detached from: retried
789
+ * within the `deployKeyDelete` budget. Succeeds with whether the key is
790
+ * gone; still refused after the budget, it is `false` (the caller keeps
791
+ * the slug and tries again later).
792
+ */
793
+ const dropOrphanKey = (slug: string, serverId: string, scope: Scope) =>
794
+ Cloud.detachSshKey({
795
+ slug,
796
+ serverIds: [serverId],
797
+ availabilityZone: scope.availabilityZone,
798
+ }).pipe(
799
+ Effect.ignore,
800
+ Effect.andThen(
801
+ retryWithin(
802
+ Cloud.deleteSshKey({ slug, availabilityZone: scope.availabilityZone }),
803
+ isTag("SshKeyInUse"),
804
+ budget("deployKeyDelete", DEFAULTS.deployKeyDelete),
805
+ ),
806
+ ),
807
+ Effect.as(true),
808
+ Effect.catchTag("NotFound", () => Effect.succeed(true)),
809
+ Effect.catchIf(isTag("SshKeyInUse"), (error) =>
810
+ Effect.as(
811
+ Effect.logWarning(
812
+ `${TYPE}: deploy key '${slug}' of server ${serverId} (deleted out of band) is still held by the destroyed server (${error._tag}); it is retried on the next deploy and on destroy`,
813
+ ),
814
+ false,
815
+ ),
816
+ ),
817
+ );
818
+
819
+ /** Retry the stale keys (one round each); what is still refused. */
820
+ const retryStale = (stale: ReadonlyArray<string> | undefined, scope: Scope) =>
821
+ Effect.filter(stale ?? [], (slug) =>
822
+ Cloud.deleteSshKey({ slug, availabilityZone: scope.availabilityZone }).pipe(
823
+ Effect.as(false),
824
+ Effect.catchTag("NotFound", () => Effect.succeed(false)),
825
+ Effect.catchIf(isTag("SshKeyInUse"), () => Effect.succeed(true)),
826
+ ),
827
+ );
828
+
829
+ const waitUntil = (
830
+ id: string,
831
+ scope: Scope,
832
+ phase: string,
833
+ policy: {
834
+ until: (server: Cloud.Server | undefined) => boolean;
835
+ failWhen?: (server: Cloud.Server) => boolean;
836
+ },
837
+ window: WaitBudget,
838
+ ) => waitFor(observe(id, scope), { ...policy, ...window }, { resourceType: TYPE, phase });
839
+
840
+ /** Until the server runs; fails on a status a create never recovers from or when it disappears. */
841
+ const waitRunning = (id: string, scope: Scope, phase: string, window: WaitBudget) =>
842
+ waitUntil(
843
+ id,
844
+ scope,
845
+ phase,
846
+ {
847
+ until: (s) => s === undefined || s.status === "running",
848
+ failWhen: (s) => s.status !== undefined && CREATE_FAILED.has(s.status),
849
+ },
850
+ window,
851
+ ).pipe(
852
+ Effect.flatMap((server) =>
853
+ server === undefined
854
+ ? Effect.fail(
855
+ new WaitFailed({
856
+ message: `${TYPE}: ${phase}: the server disappeared`,
857
+ resourceType: TYPE,
858
+ phase,
859
+ last: undefined,
860
+ }),
861
+ )
862
+ : Effect.succeed(server),
863
+ ),
864
+ );
865
+
866
+ /**
867
+ * SSH works: log in as root with the deploy key, retried within the `ssh`
868
+ * budget, verifying `hostKey` when one is known (a pinned key is refused
869
+ * until the bootstrap has installed it: retried too). Resolves to the
870
+ * host key now known: the given one, or the one learned on this first use.
871
+ */
872
+ const waitSsh = (
873
+ server: Cloud.Server,
874
+ scope: Scope,
875
+ deploy: DeployKey,
876
+ hostKey: { readonly key: string; readonly trust: "pinned" | "first-use" } | undefined,
877
+ ) =>
878
+ Effect.gen(function* () {
879
+ const host = toAttrs(server, scope, {}).sshHost;
880
+ if (host === undefined) return hostKey;
881
+ const window = budget("ssh", DEFAULTS.ssh);
882
+ const learned = yield* probe({
883
+ host,
884
+ privateKey: deploy.privateKey,
885
+ user: "root",
886
+ hostKey: hostKey?.key,
887
+ }).pipe(
888
+ Effect.retry({
889
+ schedule: Schedule.spaced(Duration.fromInputUnsafe(window.interval)),
890
+ times: attempts(window),
891
+ }),
892
+ Effect.mapError(
893
+ (error) =>
894
+ new WaitTimeout({
895
+ message: `${TYPE}: ssh root@${host} did not succeed within ${Duration.format(Duration.fromInputUnsafe(window.timeout))}: ${error.message}`,
896
+ resourceType: TYPE,
897
+ phase: "ssh",
898
+ last: error.message,
899
+ }),
900
+ ),
901
+ );
902
+ if (hostKey !== undefined) return hostKey;
903
+ return typeof learned === "string"
904
+ ? { key: learned, trust: "first-use" as const }
905
+ : undefined;
906
+ });
907
+
908
+ /**
909
+ * Sync one list attachment: add what is wanted and missing (adds
910
+ * first), remove what was listed before and is no longer wanted. A
911
+ * `FirewallLimitReached` / `LimitReached` add (one firewall per server)
912
+ * removes first, retries, and adds the removed items back when it still
913
+ * fails. A 404 on a remove is done; an add refused as already done
914
+ * (`AlreadyAttached` for a firewall, `IpAlreadyAssigned` for a reserved
915
+ * IP; a bare `Conflict` for networks and SSH keys, whose docs name no
916
+ * code) is done when the item is there.
917
+ */
918
+ const syncSet = Effect.fn(function* (input: {
919
+ readonly field: "networkIds" | "firewallIds" | "sshKeys";
920
+ readonly serverId: string;
921
+ readonly scope: Scope;
922
+ readonly live: ReadonlyArray<string>;
923
+ readonly want: ReadonlyArray<string>;
924
+ readonly before: ReadonlyArray<string>;
925
+ readonly add: (item: string) => Effect.Effect<unknown, AddError, any>;
926
+ readonly remove: (item: string) => Effect.Effect<unknown, RemoveError, any>;
927
+ readonly readBack: boolean;
928
+ /** Whether `item` is attached here now (default: listed in the server's `field`). */
929
+ readonly isAttached?: (item: string) => Effect.Effect<boolean, never, any>;
930
+ }) {
931
+ const adds = input.want.filter((item) => !input.live.includes(item));
932
+ const removes = input.before.filter(
933
+ (item) => !input.want.includes(item) && input.live.includes(item),
934
+ );
935
+ if (adds.length === 0 && removes.length === 0) return false;
936
+ const remove = (item: string) =>
937
+ input.remove(item).pipe(Effect.catchTag("NotFound", () => Effect.void));
938
+ const listed = (item: string) =>
939
+ input.isAttached !== undefined
940
+ ? input.isAttached(item)
941
+ : observe(input.serverId, input.scope).pipe(
942
+ Effect.map((server) => strings(server?.[input.field]).includes(item)),
943
+ );
944
+ let removed = false;
945
+ for (const item of adds) {
946
+ yield* input.add(item).pipe(
947
+ Effect.catchTag(["AlreadyAttached", "IpAlreadyAssigned", "Conflict"], (error) =>
948
+ Effect.flatMap(listed(item), (there) => (there ? Effect.void : Effect.fail(error))),
949
+ ),
950
+ Effect.catchTag(["FirewallLimitReached", "LimitReached"], (error) =>
951
+ removes.length === 0 || removed
952
+ ? Effect.fail(error)
953
+ : Effect.gen(function* () {
954
+ for (const old of removes) yield* remove(old);
955
+ removed = true;
956
+ yield* input
957
+ .add(item)
958
+ .pipe(
959
+ Effect.tapError(() =>
960
+ Effect.forEach(removes, (old) => input.add(old).pipe(Effect.ignore)),
961
+ ),
962
+ );
963
+ }),
964
+ ),
965
+ );
966
+ }
967
+ if (!removed) for (const item of removes) yield* remove(item);
968
+ if (input.readBack) {
969
+ yield* waitUntil(
970
+ input.serverId,
971
+ input.scope,
972
+ input.field,
973
+ {
974
+ until: (server) => {
975
+ const now = strings(server?.[input.field]);
976
+ return (
977
+ adds.every((item) => now.includes(item)) &&
978
+ removes.every((item) => !now.includes(item))
979
+ );
980
+ },
981
+ },
982
+ budget("attach", DEFAULTS.attach),
983
+ );
984
+ }
985
+ return true;
986
+ });
987
+
988
+ /** Delete a server: detach every key, delete, wait until gone. */
989
+ const destroy = Effect.fn(function* (id: string, scope: Scope) {
990
+ const live = yield* observe(id, scope);
991
+ if (live === undefined) return false;
992
+ const keys = strings(live.sshKeys);
993
+ const detached: Array<string> = [];
994
+ for (const slug of keys) {
995
+ const ok = yield* Cloud.detachSshKey({
996
+ slug,
997
+ serverIds: [id],
998
+ availabilityZone: scope.availabilityZone,
999
+ }).pipe(
1000
+ Effect.as(true),
1001
+ // A detach the API refuses is skipped (catalog delete precondition): the codes
1002
+ // detach_ssh_key documents, and the bare statuses for anything else.
1003
+ Effect.catchTag(
1004
+ [
1005
+ "NotFound",
1006
+ "KubernetesManaged",
1007
+ "ServerNotRunning",
1008
+ "TeamRequired",
1009
+ "ValidationFailed",
1010
+ "Conflict",
1011
+ "UnprocessableEntity",
1012
+ ],
1013
+ () => Effect.succeed(false),
1014
+ ),
1015
+ );
1016
+ if (ok) detached.push(slug);
1017
+ }
1018
+ if (detached.length > 0) {
1019
+ yield* waitUntil(
1020
+ id,
1021
+ scope,
1022
+ "release ssh keys",
1023
+ {
1024
+ until: (server) =>
1025
+ server === undefined ||
1026
+ !strings(server.sshKeys).some((slug) => detached.includes(slug)),
1027
+ },
1028
+ budget("releaseKeys", DEFAULTS.releaseKeys),
1029
+ ).pipe(Effect.catchTag("WaitTimeout", () => Effect.void));
1030
+ }
1031
+ yield* Cloud.deleteServer({ id, availabilityZone: scope.availabilityZone }).pipe(
1032
+ Effect.catchTag("NotFound", () => Effect.void),
1033
+ // Refused: give the keys back, then fail.
1034
+ Effect.tapError(() =>
1035
+ Effect.forEach(detached, (slug) =>
1036
+ Cloud.attachSshKey({
1037
+ slug,
1038
+ serverIds: [id],
1039
+ availabilityZone: scope.availabilityZone,
1040
+ }).pipe(Effect.ignore),
1041
+ ),
1042
+ ),
1043
+ );
1044
+ yield* waitUntil(
1045
+ id,
1046
+ scope,
1047
+ "delete",
1048
+ { until: (server) => server === undefined },
1049
+ budget("delete", DEFAULTS.delete),
1050
+ );
1051
+ return true;
1052
+ });
1053
+
1054
+ return {
1055
+ stables: [
1056
+ "id",
1057
+ "serverId",
1058
+ "teamId",
1059
+ "availabilityZone",
1060
+ "createdAt",
1061
+ "image",
1062
+ "privateKey",
1063
+ "deployKeySlug",
1064
+ "deployPublicKey",
1065
+ "sshUser",
1066
+ "publicIpv4",
1067
+ ],
1068
+
1069
+ diff: Effect.fn(function* ({ news, olds, output }) {
1070
+ if (!isResolved(news)) {
1071
+ // A replacing prop that points at a resource created or replaced in this deploy
1072
+ // (a new PlacementGroup's id) is a new value: replace. Returning `undefined` would
1073
+ // make the engine plan an update, and the server would silently keep the old one
1074
+ // (finding Y1; AGENTS.md "Unresolved props at plan time").
1075
+ const pending = news as Record<string, unknown>;
1076
+ for (const key of [...REPLACE_FIELDS, "teamId", "availabilityZone", "bootstrap"]) {
1077
+ if (!isResolved(pending[key] as never)) {
1078
+ return { action: "replace", deleteFirst: false } as const;
1079
+ }
1080
+ }
1081
+ return undefined;
1082
+ }
1083
+ const next = news as ServerProps;
1084
+ const prev = (olds ?? {}) as ServerProps;
1085
+ const deleteFirst =
1086
+ (next.name !== undefined && next.name === (prev.name ?? output?.name)) ||
1087
+ strings(next.reservedIpIds).some((ip) => strings(prev.reservedIpIds).includes(ip));
1088
+ const replace = { action: "replace", deleteFirst } as const;
1089
+ for (const key of ["teamId", "availabilityZone"] as const) {
1090
+ if (next[key] !== undefined && next[key] !== (prev[key] ?? output?.[key])) {
1091
+ return replace;
1092
+ }
1093
+ }
1094
+ if ((next.bootstrap !== false) !== (prev.bootstrap !== false)) return replace;
1095
+ for (const key of REPLACE_FIELDS) {
1096
+ if (!same(next[key], prev[key])) return replace;
1097
+ }
1098
+ // A boot address can't be unassigned: dropping one needs a new server (Y3).
1099
+ const boot = output?.bootReservedIpIds ?? [];
1100
+ if (boot.some((ip) => !strings(next.reservedIpIds).includes(ip))) return replace;
1101
+ return same(next, prev) ? ({ action: "noop" } as const) : ({ action: "update" } as const);
1102
+ }),
1103
+
1104
+ read: Effect.fn(function* ({ id, fqn, olds, output, previous }) {
1105
+ const props = olds as ServerProps | undefined;
1106
+ const scope = yield* resolveScope(true, TYPE, props as never, output);
1107
+ const carry = {
1108
+ reservedIpIds: props?.reservedIpIds ?? output?.reservedIpIds,
1109
+ publicIpv4: props?.publicIpv4 ?? output?.publicIpv4,
1110
+ };
1111
+ if (output !== undefined) {
1112
+ const live = yield* observe(output.id, scope);
1113
+ return live === undefined
1114
+ ? undefined
1115
+ : toAttrs(live, scope, {
1116
+ ...carry,
1117
+ deploy: deployOf(output),
1118
+ // What only state knows survives a refresh (drift repair, Y13).
1119
+ stale: output.staleDeployKeySlugs,
1120
+ bootReservedIpIds: output.bootReservedIpIds,
1121
+ hostKey: hostKeyFrom(output),
1122
+ });
1123
+ }
1124
+ if (props === undefined) return undefined;
1125
+ // No state: a server this logical id created (its marker), ours whatever its name.
1126
+ const mine = yield* findByMarker(yield* ownerOf(fqn), false, scope, previous);
1127
+ if (mine !== undefined) return toAttrs(mine, scope, carry);
1128
+ // Else a server with this name may exist (an interrupted
1129
+ // create of this generation, or one to adopt).
1130
+ const name = yield* nameOf(id, props);
1131
+ const found = yield* findByName(name, scope);
1132
+ if (found === undefined) return undefined;
1133
+ if (previous !== undefined && String(found.id) === previous.id) return undefined;
1134
+ const attrs = toAttrs(found, scope, carry);
1135
+ return ownedBy(found, yield* deployPrefix(id)) ? attrs : Unowned(attrs);
1136
+ }),
1137
+
1138
+ reconcile: Effect.fn(function* ({ id, fqn, instanceId, news, olds, output }) {
1139
+ const props = news as ServerProps;
1140
+ // This generation's ownership marker, merged into `metadata` on every write.
1141
+ const marker = generationOf(yield* ownerOf(fqn), instanceId);
1142
+ const previous = olds as ServerProps | undefined;
1143
+ const scope = yield* resolveScope(true, TYPE, props as never, output);
1144
+ const bootstrap = props.bootstrap !== false;
1145
+ const name = yield* nameOf(id, props, output);
1146
+ const carry: {
1147
+ reservedIpIds: Array<string> | undefined;
1148
+ bootReservedIpIds: Array<string> | undefined;
1149
+ publicIpv4: boolean | undefined;
1150
+ hostKey: { readonly key: string; readonly trust: "pinned" | "first-use" } | undefined;
1151
+ } = {
1152
+ reservedIpIds: props.reservedIpIds,
1153
+ bootReservedIpIds: output?.bootReservedIpIds,
1154
+ publicIpv4: props.publicIpv4 ?? output?.publicIpv4,
1155
+ hostKey: hostKeyFrom(output),
1156
+ };
1157
+ let deploy = deployOf(output);
1158
+ // Whether the server (re)booted or got a new key in this deploy: then SSH is proven.
1159
+ let fresh = false;
1160
+ // Deploy keys of earlier, out-of-band-deleted servers still waiting to be deleted.
1161
+ const stale: Array<string> = [...(yield* retryStale(output?.staleDeployKeySlugs, scope))];
1162
+
1163
+ // Observe — `output` is a cache of the identity, never proof it exists.
1164
+ let live: Cloud.Server | undefined =
1165
+ output !== undefined ? yield* observe(output.id, scope) : undefined;
1166
+ if (live === undefined && output === undefined) {
1167
+ // An interrupted create of this generation left a server behind: take it back
1168
+ // (found by its marker, or by its name and deploy key).
1169
+ const byName = yield* findByName(name, scope);
1170
+ const found =
1171
+ (yield* findByMarker(marker, true, scope)) ??
1172
+ (byName !== undefined && ownedBy(byName, yield* deployPrefix(id))
1173
+ ? byName
1174
+ : undefined);
1175
+ if (found !== undefined) {
1176
+ live = yield* waitRunning(
1177
+ String(found.id),
1178
+ scope,
1179
+ "create",
1180
+ budget("create", DEFAULTS.create),
1181
+ );
1182
+ }
1183
+ }
1184
+
1185
+ // Ensure — create when missing.
1186
+ if (live === undefined) {
1187
+ // Our own bootstrap installs a host key generated here: the first login is
1188
+ // already verified. Your own userData can't carry it: trust on first use.
1189
+ const ownDocument = (revealText(props.userData) ?? "").trim() !== "";
1190
+ const hostKey = bootstrap && !ownDocument ? yield* generateHostKey : undefined;
1191
+ carry.hostKey =
1192
+ hostKey !== undefined
1193
+ ? { key: hostKeyOfLine(hostKey.publicKey), trust: "pinned" }
1194
+ : undefined;
1195
+ const userData = composeUserData(props.userData, bootstrap, hostKey);
1196
+ const bytes = userData === undefined ? 0 : Buffer.byteLength(userData, "utf8");
1197
+ if (bytes > MAX_USER_DATA_BYTES) {
1198
+ return yield* new ServerUserDataTooLarge({
1199
+ message: `${TYPE} '${id}': user data is ${bytes} bytes, over the ${MAX_USER_DATA_BYTES}-byte limit`,
1200
+ bytes,
1201
+ limit: MAX_USER_DATA_BYTES,
1202
+ });
1203
+ }
1204
+ if (output?.deployKeySlug !== undefined) {
1205
+ // The recorded server was deleted out of band: drop its deploy key, or keep
1206
+ // its slug to retry while the destroyed server still holds it.
1207
+ if (!(yield* dropOrphanKey(output.deployKeySlug, output.id, scope))) {
1208
+ stale.push(output.deployKeySlug);
1209
+ }
1210
+ }
1211
+ deploy = bootstrap ? yield* createDeployKey(id, name, scope) : undefined;
1212
+ const body = {
1213
+ ...pick(props as unknown as Record<string, unknown>, createMembers),
1214
+ teamId: scope.teamId,
1215
+ availabilityZone: scope.availabilityZone,
1216
+ name,
1217
+ metadata: withOwner(props.metadata, marker),
1218
+ sshKeys: [...strings(props.sshKeys), ...(deploy ? [deploy.slug] : [])],
1219
+ userData,
1220
+ } as Cloud.CreateServerRequest;
1221
+ const created = yield* retryWithin(
1222
+ Cloud.createServer(body),
1223
+ // A reserved IP freed by a delete stays attached until that delete finishes.
1224
+ (error) =>
1225
+ error._tag === "ValidationFailed" &&
1226
+ strings(props.reservedIpIds).length > 0 &&
1227
+ rejectedFields(error).includes("reserved_ip_ids"),
1228
+ budget("reservedIp", DEFAULTS.reservedIp),
1229
+ ).pipe(Effect.tapError(() => deleteDeployKey(deploy?.slug, scope).pipe(Effect.ignore)));
1230
+ const serverId = String(created.id);
1231
+ carry.bootReservedIpIds = strings(props.reservedIpIds);
1232
+ live = yield* waitRunning(
1233
+ serverId,
1234
+ scope,
1235
+ "create",
1236
+ budget("create", DEFAULTS.create),
1237
+ ).pipe(
1238
+ // A server that failed to boot is useless: delete it (and its key), then fail.
1239
+ Effect.tapErrorTag("WaitFailed", () =>
1240
+ destroy(serverId, scope).pipe(
1241
+ Effect.andThen(deleteDeployKey(deploy?.slug, scope)),
1242
+ Effect.ignore,
1243
+ ),
1244
+ ),
1245
+ );
1246
+ fresh = true;
1247
+ } else {
1248
+ const serverId = String(live.id);
1249
+ // Deploy key: install a new one when it was lost (adoption, an interrupted create).
1250
+ if (
1251
+ bootstrap &&
1252
+ (deploy === undefined || !strings(live.sshKeys).includes(deploy.slug))
1253
+ ) {
1254
+ // Earlier deploy keys of this generation whose private half is lost.
1255
+ const prefix = yield* deployPrefix(id);
1256
+ const ours = strings(live.sshKeys).filter((slug) => slug.startsWith(`${prefix}-`));
1257
+ deploy = yield* createDeployKey(id, name, scope);
1258
+ const key = deploy;
1259
+ yield* Cloud.attachSshKey({
1260
+ slug: key.slug,
1261
+ serverIds: [serverId],
1262
+ availabilityZone: scope.availabilityZone,
1263
+ }).pipe(Effect.tapError(() => deleteDeployKey(key.slug, scope).pipe(Effect.ignore)));
1264
+ for (const old of ours) {
1265
+ yield* Cloud.detachSshKey({
1266
+ slug: old,
1267
+ serverIds: [serverId],
1268
+ availabilityZone: scope.availabilityZone,
1269
+ }).pipe(Effect.ignore);
1270
+ yield* deleteDeployKey(old, scope).pipe(Effect.ignore);
1271
+ }
1272
+ live = (yield* observe(serverId, scope)) ?? live;
1273
+ fresh = true;
1274
+ }
1275
+
1276
+ // Update — only what differs from the live server.
1277
+ const delta: Record<string, unknown> = {};
1278
+ const wanted: Record<string, unknown> = {
1279
+ ...(props as unknown as Record<string, unknown>),
1280
+ name,
1281
+ // The marker with the user's metadata (an update replaces all of it); no metadata
1282
+ // in the config keeps what the server has.
1283
+ metadata: withOwner(props.metadata ?? live.metadata, marker),
1284
+ };
1285
+ const observed = live as unknown as Record<string, unknown>;
1286
+ for (const key of UPDATE_FIELDS) {
1287
+ const want = wanted[key];
1288
+ if (want === undefined) continue;
1289
+ if (!same(want, observed[key])) delta[key] = want;
1290
+ }
1291
+ if (Object.keys(delta).length > 0) {
1292
+ yield* Cloud.updateServer({
1293
+ id: serverId,
1294
+ availabilityZone: scope.availabilityZone,
1295
+ ...delta,
1296
+ });
1297
+ }
1298
+
1299
+ // Rescale — then wait until the server is back in its status with the new type.
1300
+ if (props.serverType !== live.serverType) {
1301
+ const before = live.status;
1302
+ yield* Cloud.rescaleServer({
1303
+ id: serverId,
1304
+ serverType: props.serverType,
1305
+ availabilityZone: scope.availabilityZone,
1306
+ });
1307
+ live = yield* waitUntil(
1308
+ serverId,
1309
+ scope,
1310
+ "serverType",
1311
+ {
1312
+ until: (s) =>
1313
+ s === undefined || (s.status === before && s.serverType === props.serverType),
1314
+ // Right after the call the server still answers `running` with the old
1315
+ // type: only a settled status after the rescale started is a failure (Y7).
1316
+ failWhen: afterAction(
1317
+ (s: Cloud.Server) => s.status !== undefined && RESCALE_FAILED.has(s.status),
1318
+ (s: Cloud.Server) => s.status !== before || s.serverType === props.serverType,
1319
+ ),
1320
+ },
1321
+ budget("rescale", DEFAULTS.rescale),
1322
+ );
1323
+ if (live === undefined) {
1324
+ return yield* new WaitFailed({
1325
+ message: `${TYPE}: rescale: the server disappeared`,
1326
+ resourceType: TYPE,
1327
+ phase: "serverType",
1328
+ last: undefined,
1329
+ });
1330
+ }
1331
+ fresh = true;
1332
+ }
1333
+
1334
+ // Attachments.
1335
+ const az = scope.availabilityZone;
1336
+ let changed = false;
1337
+ if (props.networkIds !== undefined) {
1338
+ changed =
1339
+ (yield* syncSet({
1340
+ field: "networkIds",
1341
+ serverId,
1342
+ scope,
1343
+ live: strings(live.networkIds),
1344
+ want: strings(props.networkIds),
1345
+ before: strings(previous?.networkIds),
1346
+ add: (item) => Cloud.attachNetwork({ id: item, serverId, availabilityZone: az }),
1347
+ remove: (item) =>
1348
+ Cloud.detachNetwork({ id: item, serverId, availabilityZone: az }),
1349
+ readBack: true,
1350
+ })) || changed;
1351
+ }
1352
+ if (props.firewallIds !== undefined) {
1353
+ changed =
1354
+ (yield* syncSet({
1355
+ field: "firewallIds",
1356
+ serverId,
1357
+ scope,
1358
+ live: strings(live.firewallIds),
1359
+ want: strings(props.firewallIds),
1360
+ before: strings(previous?.firewallIds),
1361
+ add: (item) => Cloud.attachFirewall({ id: item, serverId, availabilityZone: az }),
1362
+ remove: (item) =>
1363
+ Cloud.detachFirewall({ id: item, serverId, availabilityZone: az }),
1364
+ readBack: true,
1365
+ })) || changed;
1366
+ }
1367
+ changed =
1368
+ (yield* syncSet({
1369
+ field: "sshKeys",
1370
+ serverId,
1371
+ scope,
1372
+ live: strings(live.sshKeys),
1373
+ want: [...strings(props.sshKeys), ...(deploy ? [deploy.slug] : [])],
1374
+ before: strings(previous?.sshKeys),
1375
+ add: (item) =>
1376
+ Cloud.attachSshKey({ slug: item, serverIds: [serverId], availabilityZone: az }),
1377
+ remove: (item) =>
1378
+ Cloud.detachSshKey({ slug: item, serverIds: [serverId], availabilityZone: az }),
1379
+ readBack: true,
1380
+ })) || changed;
1381
+ if (props.reservedIpIds !== undefined) {
1382
+ // Never returned by the API: diff against what this stack assigned before. The
1383
+ // boot addresses are never unassigned (the diff replaces instead).
1384
+ const boot = carry.bootReservedIpIds ?? [];
1385
+ const assigned = strings(previous?.reservedIpIds ?? output?.reservedIpIds);
1386
+ changed =
1387
+ (yield* syncSet({
1388
+ field: "sshKeys",
1389
+ serverId,
1390
+ scope,
1391
+ live: assigned,
1392
+ want: strings(props.reservedIpIds),
1393
+ before: assigned.filter((ip) => !boot.includes(ip)),
1394
+ add: (item) =>
1395
+ Cloud.assignReservedIp({ id: item, serverId, availabilityZone: az }),
1396
+ remove: (item) => Cloud.unassignReservedIp({ id: item, availabilityZone: az }),
1397
+ readBack: false,
1398
+ // The reserved IP names its server (the server's own lists don't carry it).
1399
+ isAttached: (item) =>
1400
+ Cloud.getReservedIp({ id: item, availabilityZone: az }).pipe(
1401
+ Effect.map((ip) => ip.serverId === serverId),
1402
+ // Unreadable: not shown to be here, so the add's own error stands.
1403
+ Effect.catch(() => Effect.succeed(false)),
1404
+ ),
1405
+ })) || changed;
1406
+ }
1407
+ if (changed || Object.keys(delta).length > 0) {
1408
+ live = (yield* observe(serverId, scope)) ?? live;
1409
+ }
1410
+ }
1411
+
1412
+ // Ready means SSH works, not only `status: running` (and the host key is known).
1413
+ if (fresh && bootstrap && deploy !== undefined) {
1414
+ carry.hostKey = yield* waitSsh(live, scope, deploy, carry.hostKey);
1415
+ }
1416
+ return toAttrs(live, scope, { ...carry, deploy: bootstrap ? deploy : undefined, stale });
1417
+ }),
1418
+
1419
+ delete: Effect.fn(function* ({ olds, output }) {
1420
+ const scope = yield* resolveScope(true, TYPE, olds as never, output);
1421
+ const existed = yield* destroy(output.id, scope);
1422
+ // `destroy` detached the key from a live server; one gone out of band may still hold it.
1423
+ const left: Array<string> = [];
1424
+ if (output.deployKeySlug !== undefined) {
1425
+ if (existed) yield* deleteDeployKey(output.deployKeySlug, scope);
1426
+ else if (!(yield* dropOrphanKey(output.deployKeySlug, output.id, scope))) {
1427
+ left.push(output.deployKeySlug);
1428
+ }
1429
+ }
1430
+ for (const slug of output.staleDeployKeySlugs ?? []) {
1431
+ if (!(yield* dropOrphanKey(slug, output.id, scope))) left.push(slug);
1432
+ }
1433
+ if (left.length > 0) {
1434
+ // Fail, so the state row stays and the next destroy retries: never leave a key behind.
1435
+ return yield* new ServerDeployKeysHeld({
1436
+ message: `${TYPE}: deploy keys ${left.join(", ")} are still held by destroyed servers; run destroy again later`,
1437
+ slugs: left,
1438
+ });
1439
+ }
1440
+ }),
1441
+
1442
+ list: () =>
1443
+ Effect.gen(function* () {
1444
+ const scope = yield* resolveScope(true, TYPE, undefined, undefined);
1445
+ const servers = yield* Stream.runCollect(
1446
+ Cloud.listServer.items({ availabilityZone: scope.availabilityZone }),
1447
+ );
1448
+ return (
1449
+ Array.from(servers)
1450
+ .filter((server) => !(server.status !== undefined && GONE.has(server.status)))
1451
+ // Only servers some Alchemy stack created (this backs nuke).
1452
+ .filter((server) => isAlchemyOwned(server.metadata))
1453
+ .map((server) => toAttrs(server, scope, {}))
1454
+ );
1455
+ }),
1456
+
1457
+ lookup: Effect.fn(function* (lookup: ServerLookup) {
1458
+ const scope = yield* resolveScope(true, TYPE, lookup as never, undefined);
1459
+ const found =
1460
+ lookup.id !== undefined
1461
+ ? yield* observe(lookup.id, scope)
1462
+ : lookup.name !== undefined
1463
+ ? yield* findByName(lookup.name, scope)
1464
+ : undefined;
1465
+ return found === undefined ? undefined : toAttrs(found, scope, {});
1466
+ }),
1467
+ };
1468
+ }),
1469
+ );