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.
- package/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +201 -0
- package/NOTICE +182 -0
- package/README.md +165 -2
- package/lib/Account/Reference.d.ts +89 -0
- package/lib/Account/Reference.d.ts.map +1 -0
- package/lib/Account/Reference.js +90 -0
- package/lib/Account/Reference.js.map +1 -0
- package/lib/Account/Team.d.ts +69 -0
- package/lib/Account/Team.d.ts.map +1 -0
- package/lib/Account/Team.js +74 -0
- package/lib/Account/Team.js.map +1 -0
- package/lib/Account/TeamMember.d.ts +78 -0
- package/lib/Account/TeamMember.d.ts.map +1 -0
- package/lib/Account/TeamMember.js +159 -0
- package/lib/Account/TeamMember.js.map +1 -0
- package/lib/Account/index.d.ts +25 -0
- package/lib/Account/index.d.ts.map +1 -0
- package/lib/Account/index.js +25 -0
- package/lib/Account/index.js.map +1 -0
- package/lib/AuthProvider.d.ts +38 -0
- package/lib/AuthProvider.d.ts.map +1 -0
- package/lib/AuthProvider.js +134 -0
- package/lib/AuthProvider.js.map +1 -0
- package/lib/BetterStackBindings.d.ts +227 -0
- package/lib/BetterStackBindings.d.ts.map +1 -0
- package/lib/BetterStackBindings.js +223 -0
- package/lib/BetterStackBindings.js.map +1 -0
- package/lib/Cloud/Bootstrap.d.ts +20 -0
- package/lib/Cloud/Bootstrap.d.ts.map +1 -0
- package/lib/Cloud/Bootstrap.js +85 -0
- package/lib/Cloud/Bootstrap.js.map +1 -0
- package/lib/Cloud/Certificate.d.ts +97 -0
- package/lib/Cloud/Certificate.d.ts.map +1 -0
- package/lib/Cloud/Certificate.js +96 -0
- package/lib/Cloud/Certificate.js.map +1 -0
- package/lib/Cloud/ClickHouse.d.ts +184 -0
- package/lib/Cloud/ClickHouse.d.ts.map +1 -0
- package/lib/Cloud/ClickHouse.js +179 -0
- package/lib/Cloud/ClickHouse.js.map +1 -0
- package/lib/Cloud/ClickHouseScheduledSnapshot.d.ts +77 -0
- package/lib/Cloud/ClickHouseScheduledSnapshot.d.ts.map +1 -0
- package/lib/Cloud/ClickHouseScheduledSnapshot.js +76 -0
- package/lib/Cloud/ClickHouseScheduledSnapshot.js.map +1 -0
- package/lib/Cloud/ClickHouseSnapshot.d.ts +107 -0
- package/lib/Cloud/ClickHouseSnapshot.d.ts.map +1 -0
- package/lib/Cloud/ClickHouseSnapshot.js +78 -0
- package/lib/Cloud/ClickHouseSnapshot.js.map +1 -0
- package/lib/Cloud/Firewall.d.ts +134 -0
- package/lib/Cloud/Firewall.d.ts.map +1 -0
- package/lib/Cloud/Firewall.js +169 -0
- package/lib/Cloud/Firewall.js.map +1 -0
- package/lib/Cloud/FirewallRule.d.ts +114 -0
- package/lib/Cloud/FirewallRule.d.ts.map +1 -0
- package/lib/Cloud/FirewallRule.js +130 -0
- package/lib/Cloud/FirewallRule.js.map +1 -0
- package/lib/Cloud/InferEnv.d.ts +28 -0
- package/lib/Cloud/InferEnv.d.ts.map +1 -0
- package/lib/Cloud/InferEnv.js +1 -0
- package/lib/Cloud/InferEnv.js.map +1 -0
- package/lib/Cloud/Kafka.d.ts +204 -0
- package/lib/Cloud/Kafka.d.ts.map +1 -0
- package/lib/Cloud/Kafka.js +194 -0
- package/lib/Cloud/Kafka.js.map +1 -0
- package/lib/Cloud/KafkaTopic.d.ts +90 -0
- package/lib/Cloud/KafkaTopic.d.ts.map +1 -0
- package/lib/Cloud/KafkaTopic.js +83 -0
- package/lib/Cloud/KafkaTopic.js.map +1 -0
- package/lib/Cloud/KafkaUser.d.ts +121 -0
- package/lib/Cloud/KafkaUser.d.ts.map +1 -0
- package/lib/Cloud/KafkaUser.js +103 -0
- package/lib/Cloud/KafkaUser.js.map +1 -0
- package/lib/Cloud/KubernetesCluster.d.ts +204 -0
- package/lib/Cloud/KubernetesCluster.d.ts.map +1 -0
- package/lib/Cloud/KubernetesCluster.js +190 -0
- package/lib/Cloud/KubernetesCluster.js.map +1 -0
- package/lib/Cloud/KubernetesNodePool.d.ts +100 -0
- package/lib/Cloud/KubernetesNodePool.d.ts.map +1 -0
- package/lib/Cloud/KubernetesNodePool.js +133 -0
- package/lib/Cloud/KubernetesNodePool.js.map +1 -0
- package/lib/Cloud/KubernetesScheduledSnapshot.d.ts +73 -0
- package/lib/Cloud/KubernetesScheduledSnapshot.d.ts.map +1 -0
- package/lib/Cloud/KubernetesScheduledSnapshot.js +78 -0
- package/lib/Cloud/KubernetesScheduledSnapshot.js.map +1 -0
- package/lib/Cloud/LoadBalancer.d.ts +187 -0
- package/lib/Cloud/LoadBalancer.d.ts.map +1 -0
- package/lib/Cloud/LoadBalancer.js +228 -0
- package/lib/Cloud/LoadBalancer.js.map +1 -0
- package/lib/Cloud/LoadBalancerService.d.ts +116 -0
- package/lib/Cloud/LoadBalancerService.d.ts.map +1 -0
- package/lib/Cloud/LoadBalancerService.js +132 -0
- package/lib/Cloud/LoadBalancerService.js.map +1 -0
- package/lib/Cloud/LoadBalancerTarget.d.ts +110 -0
- package/lib/Cloud/LoadBalancerTarget.d.ts.map +1 -0
- package/lib/Cloud/LoadBalancerTarget.js +138 -0
- package/lib/Cloud/LoadBalancerTarget.js.map +1 -0
- package/lib/Cloud/MountVolume.d.ts +109 -0
- package/lib/Cloud/MountVolume.d.ts.map +1 -0
- package/lib/Cloud/MountVolume.js +59 -0
- package/lib/Cloud/MountVolume.js.map +1 -0
- package/lib/Cloud/MySQL.d.ts +285 -0
- package/lib/Cloud/MySQL.d.ts.map +1 -0
- package/lib/Cloud/MySQL.js +225 -0
- package/lib/Cloud/MySQL.js.map +1 -0
- package/lib/Cloud/MySQLScheduledSnapshot.d.ts +74 -0
- package/lib/Cloud/MySQLScheduledSnapshot.d.ts.map +1 -0
- package/lib/Cloud/MySQLScheduledSnapshot.js +73 -0
- package/lib/Cloud/MySQLScheduledSnapshot.js.map +1 -0
- package/lib/Cloud/MySQLSnapshot.d.ts +107 -0
- package/lib/Cloud/MySQLSnapshot.d.ts.map +1 -0
- package/lib/Cloud/MySQLSnapshot.js +78 -0
- package/lib/Cloud/MySQLSnapshot.js.map +1 -0
- package/lib/Cloud/Network.d.ts +69 -0
- package/lib/Cloud/Network.d.ts.map +1 -0
- package/lib/Cloud/Network.js +80 -0
- package/lib/Cloud/Network.js.map +1 -0
- package/lib/Cloud/ObjectCache.d.ts +226 -0
- package/lib/Cloud/ObjectCache.d.ts.map +1 -0
- package/lib/Cloud/ObjectCache.js +258 -0
- package/lib/Cloud/ObjectCache.js.map +1 -0
- package/lib/Cloud/ObjectCacheBucket.d.ts +112 -0
- package/lib/Cloud/ObjectCacheBucket.d.ts.map +1 -0
- package/lib/Cloud/ObjectCacheBucket.js +123 -0
- package/lib/Cloud/ObjectCacheBucket.js.map +1 -0
- package/lib/Cloud/Otlp.d.ts +93 -0
- package/lib/Cloud/Otlp.d.ts.map +1 -0
- package/lib/Cloud/Otlp.js +79 -0
- package/lib/Cloud/Otlp.js.map +1 -0
- package/lib/Cloud/PlacementGroup.d.ts +85 -0
- package/lib/Cloud/PlacementGroup.d.ts.map +1 -0
- package/lib/Cloud/PlacementGroup.js +86 -0
- package/lib/Cloud/PlacementGroup.js.map +1 -0
- package/lib/Cloud/Postgres.d.ts +331 -0
- package/lib/Cloud/Postgres.d.ts.map +1 -0
- package/lib/Cloud/Postgres.js +255 -0
- package/lib/Cloud/Postgres.js.map +1 -0
- package/lib/Cloud/PostgresDatabase.d.ts +77 -0
- package/lib/Cloud/PostgresDatabase.d.ts.map +1 -0
- package/lib/Cloud/PostgresDatabase.js +79 -0
- package/lib/Cloud/PostgresDatabase.js.map +1 -0
- package/lib/Cloud/PostgresScheduledSnapshot.d.ts +74 -0
- package/lib/Cloud/PostgresScheduledSnapshot.d.ts.map +1 -0
- package/lib/Cloud/PostgresScheduledSnapshot.js +73 -0
- package/lib/Cloud/PostgresScheduledSnapshot.js.map +1 -0
- package/lib/Cloud/PostgresSnapshot.d.ts +107 -0
- package/lib/Cloud/PostgresSnapshot.d.ts.map +1 -0
- package/lib/Cloud/PostgresSnapshot.js +78 -0
- package/lib/Cloud/PostgresSnapshot.js.map +1 -0
- package/lib/Cloud/PostgresUser.d.ts +118 -0
- package/lib/Cloud/PostgresUser.d.ts.map +1 -0
- package/lib/Cloud/PostgresUser.js +102 -0
- package/lib/Cloud/PostgresUser.js.map +1 -0
- package/lib/Cloud/Reference.d.ts +508 -0
- package/lib/Cloud/Reference.d.ts.map +1 -0
- package/lib/Cloud/Reference.js +542 -0
- package/lib/Cloud/Reference.js.map +1 -0
- package/lib/Cloud/ReservedIp.d.ts +113 -0
- package/lib/Cloud/ReservedIp.d.ts.map +1 -0
- package/lib/Cloud/ReservedIp.js +146 -0
- package/lib/Cloud/ReservedIp.js.map +1 -0
- package/lib/Cloud/ScheduledSnapshot.d.ts +49 -0
- package/lib/Cloud/ScheduledSnapshot.d.ts.map +1 -0
- package/lib/Cloud/ScheduledSnapshot.js +43 -0
- package/lib/Cloud/ScheduledSnapshot.js.map +1 -0
- package/lib/Cloud/ScheduledVolumeSnapshot.d.ts +48 -0
- package/lib/Cloud/ScheduledVolumeSnapshot.d.ts.map +1 -0
- package/lib/Cloud/ScheduledVolumeSnapshot.js +42 -0
- package/lib/Cloud/ScheduledVolumeSnapshot.js.map +1 -0
- package/lib/Cloud/Server.d.ts +375 -0
- package/lib/Cloud/Server.d.ts.map +1 -0
- package/lib/Cloud/Server.js +966 -0
- package/lib/Cloud/Server.js.map +1 -0
- package/lib/Cloud/ServerPool.d.ts +64 -0
- package/lib/Cloud/ServerPool.d.ts.map +1 -0
- package/lib/Cloud/ServerPool.js +59 -0
- package/lib/Cloud/ServerPool.js.map +1 -0
- package/lib/Cloud/ServerPrivateIp.d.ts +62 -0
- package/lib/Cloud/ServerPrivateIp.d.ts.map +1 -0
- package/lib/Cloud/ServerPrivateIp.js +68 -0
- package/lib/Cloud/ServerPrivateIp.js.map +1 -0
- package/lib/Cloud/Service.d.ts +554 -0
- package/lib/Cloud/Service.d.ts.map +1 -0
- package/lib/Cloud/Service.js +765 -0
- package/lib/Cloud/Service.js.map +1 -0
- package/lib/Cloud/ServiceHandler.d.ts +10 -0
- package/lib/Cloud/ServiceHandler.d.ts.map +1 -0
- package/lib/Cloud/ServiceHandler.js +102 -0
- package/lib/Cloud/ServiceHandler.js.map +1 -0
- package/lib/Cloud/Snapshot.d.ts +103 -0
- package/lib/Cloud/Snapshot.d.ts.map +1 -0
- package/lib/Cloud/Snapshot.js +96 -0
- package/lib/Cloud/Snapshot.js.map +1 -0
- package/lib/Cloud/Ssh.d.ts +241 -0
- package/lib/Cloud/Ssh.d.ts.map +1 -0
- package/lib/Cloud/Ssh.js +292 -0
- package/lib/Cloud/Ssh.js.map +1 -0
- package/lib/Cloud/SshKey.d.ts +120 -0
- package/lib/Cloud/SshKey.d.ts.map +1 -0
- package/lib/Cloud/SshKey.js +161 -0
- package/lib/Cloud/SshKey.js.map +1 -0
- package/lib/Cloud/Valkey.d.ts +212 -0
- package/lib/Cloud/Valkey.d.ts.map +1 -0
- package/lib/Cloud/Valkey.js +155 -0
- package/lib/Cloud/Valkey.js.map +1 -0
- package/lib/Cloud/ValkeyScheduledSnapshot.d.ts +75 -0
- package/lib/Cloud/ValkeyScheduledSnapshot.d.ts.map +1 -0
- package/lib/Cloud/ValkeyScheduledSnapshot.js +74 -0
- package/lib/Cloud/ValkeyScheduledSnapshot.js.map +1 -0
- package/lib/Cloud/ValkeySnapshot.d.ts +107 -0
- package/lib/Cloud/ValkeySnapshot.d.ts.map +1 -0
- package/lib/Cloud/ValkeySnapshot.js +80 -0
- package/lib/Cloud/ValkeySnapshot.js.map +1 -0
- package/lib/Cloud/Volume.d.ts +133 -0
- package/lib/Cloud/Volume.d.ts.map +1 -0
- package/lib/Cloud/Volume.js +329 -0
- package/lib/Cloud/Volume.js.map +1 -0
- package/lib/Cloud/VolumeSnapshot.d.ts +95 -0
- package/lib/Cloud/VolumeSnapshot.d.ts.map +1 -0
- package/lib/Cloud/VolumeSnapshot.js +88 -0
- package/lib/Cloud/VolumeSnapshot.js.map +1 -0
- package/lib/Cloud/Webhook.d.ts +93 -0
- package/lib/Cloud/Webhook.d.ts.map +1 -0
- package/lib/Cloud/Webhook.js +92 -0
- package/lib/Cloud/Webhook.js.map +1 -0
- package/lib/Cloud/Website/Astro.d.ts +106 -0
- package/lib/Cloud/Website/Astro.d.ts.map +1 -0
- package/lib/Cloud/Website/Astro.js +76 -0
- package/lib/Cloud/Website/Astro.js.map +1 -0
- package/lib/Cloud/Website/Foldkit.d.ts +70 -0
- package/lib/Cloud/Website/Foldkit.d.ts.map +1 -0
- package/lib/Cloud/Website/Foldkit.js +67 -0
- package/lib/Cloud/Website/Foldkit.js.map +1 -0
- package/lib/Cloud/Website/FrameworkSite.d.ts +277 -0
- package/lib/Cloud/Website/FrameworkSite.d.ts.map +1 -0
- package/lib/Cloud/Website/FrameworkSite.js +245 -0
- package/lib/Cloud/Website/FrameworkSite.js.map +1 -0
- package/lib/Cloud/Website/Nextjs.d.ts +70 -0
- package/lib/Cloud/Website/Nextjs.d.ts.map +1 -0
- package/lib/Cloud/Website/Nextjs.js +66 -0
- package/lib/Cloud/Website/Nextjs.js.map +1 -0
- package/lib/Cloud/Website/Nuxt.d.ts +71 -0
- package/lib/Cloud/Website/Nuxt.d.ts.map +1 -0
- package/lib/Cloud/Website/Nuxt.js +60 -0
- package/lib/Cloud/Website/Nuxt.js.map +1 -0
- package/lib/Cloud/Website/Octane.d.ts +64 -0
- package/lib/Cloud/Website/Octane.d.ts.map +1 -0
- package/lib/Cloud/Website/Octane.js +58 -0
- package/lib/Cloud/Website/Octane.js.map +1 -0
- package/lib/Cloud/Website/Providers.d.ts +16 -0
- package/lib/Cloud/Website/Providers.d.ts.map +1 -0
- package/lib/Cloud/Website/Providers.js +16 -0
- package/lib/Cloud/Website/Providers.js.map +1 -0
- package/lib/Cloud/Website/ReactRouter.d.ts +96 -0
- package/lib/Cloud/Website/ReactRouter.d.ts.map +1 -0
- package/lib/Cloud/Website/ReactRouter.js +90 -0
- package/lib/Cloud/Website/ReactRouter.js.map +1 -0
- package/lib/Cloud/Website/SolidStart.d.ts +108 -0
- package/lib/Cloud/Website/SolidStart.d.ts.map +1 -0
- package/lib/Cloud/Website/SolidStart.js +90 -0
- package/lib/Cloud/Website/SolidStart.js.map +1 -0
- package/lib/Cloud/Website/StaticSite.d.ts +170 -0
- package/lib/Cloud/Website/StaticSite.d.ts.map +1 -0
- package/lib/Cloud/Website/StaticSite.js +193 -0
- package/lib/Cloud/Website/StaticSite.js.map +1 -0
- package/lib/Cloud/Website/SvelteKit.d.ts +70 -0
- package/lib/Cloud/Website/SvelteKit.d.ts.map +1 -0
- package/lib/Cloud/Website/SvelteKit.js +59 -0
- package/lib/Cloud/Website/SvelteKit.js.map +1 -0
- package/lib/Cloud/Website/TanStackStart.d.ts +91 -0
- package/lib/Cloud/Website/TanStackStart.d.ts.map +1 -0
- package/lib/Cloud/Website/TanStackStart.js +85 -0
- package/lib/Cloud/Website/TanStackStart.js.map +1 -0
- package/lib/Cloud/Website/Vinext.d.ts +80 -0
- package/lib/Cloud/Website/Vinext.d.ts.map +1 -0
- package/lib/Cloud/Website/Vinext.js +75 -0
- package/lib/Cloud/Website/Vinext.js.map +1 -0
- package/lib/Cloud/Website/Vite.d.ts +114 -0
- package/lib/Cloud/Website/Vite.d.ts.map +1 -0
- package/lib/Cloud/Website/Vite.js +112 -0
- package/lib/Cloud/Website/Vite.js.map +1 -0
- package/lib/Cloud/Website/Vocs.d.ts +67 -0
- package/lib/Cloud/Website/Vocs.d.ts.map +1 -0
- package/lib/Cloud/Website/Vocs.js +56 -0
- package/lib/Cloud/Website/Vocs.js.map +1 -0
- package/lib/Cloud/Website/Waku.d.ts +71 -0
- package/lib/Cloud/Website/Waku.d.ts.map +1 -0
- package/lib/Cloud/Website/Waku.js +59 -0
- package/lib/Cloud/Website/Waku.js.map +1 -0
- package/lib/Cloud/Website/index.d.ts +16 -0
- package/lib/Cloud/Website/index.d.ts.map +1 -0
- package/lib/Cloud/Website/index.js +17 -0
- package/lib/Cloud/Website/index.js.map +1 -0
- package/lib/Cloud/hosted.d.ts +324 -0
- package/lib/Cloud/hosted.d.ts.map +1 -0
- package/lib/Cloud/hosted.js +750 -0
- package/lib/Cloud/hosted.js.map +1 -0
- package/lib/Cloud/index.d.ts +111 -0
- package/lib/Cloud/index.d.ts.map +1 -0
- package/lib/Cloud/index.js +156 -0
- package/lib/Cloud/index.js.map +1 -0
- package/lib/Contributions.d.ts +12 -0
- package/lib/Contributions.d.ts.map +1 -0
- package/lib/Contributions.js +12 -0
- package/lib/Contributions.js.map +1 -0
- package/lib/Credentials.d.ts +25 -0
- package/lib/Credentials.d.ts.map +1 -0
- package/lib/Credentials.js +35 -0
- package/lib/Credentials.js.map +1 -0
- package/lib/Errors/Application.d.ts +136 -0
- package/lib/Errors/Application.d.ts.map +1 -0
- package/lib/Errors/Application.js +146 -0
- package/lib/Errors/Application.js.map +1 -0
- package/lib/Errors/ApplicationGroup.d.ts +67 -0
- package/lib/Errors/ApplicationGroup.d.ts.map +1 -0
- package/lib/Errors/ApplicationGroup.js +72 -0
- package/lib/Errors/ApplicationGroup.js.map +1 -0
- package/lib/Errors/Dsn.d.ts +87 -0
- package/lib/Errors/Dsn.d.ts.map +1 -0
- package/lib/Errors/Dsn.js +34 -0
- package/lib/Errors/Dsn.js.map +1 -0
- package/lib/Errors/JiraIntegration.d.ts +69 -0
- package/lib/Errors/JiraIntegration.d.ts.map +1 -0
- package/lib/Errors/JiraIntegration.js +64 -0
- package/lib/Errors/JiraIntegration.js.map +1 -0
- package/lib/Errors/LinearIntegration.d.ts +71 -0
- package/lib/Errors/LinearIntegration.d.ts.map +1 -0
- package/lib/Errors/LinearIntegration.js +66 -0
- package/lib/Errors/LinearIntegration.js.map +1 -0
- package/lib/Errors/MicrosoftTeamsIntegration.d.ts +75 -0
- package/lib/Errors/MicrosoftTeamsIntegration.d.ts.map +1 -0
- package/lib/Errors/MicrosoftTeamsIntegration.js +72 -0
- package/lib/Errors/MicrosoftTeamsIntegration.js.map +1 -0
- package/lib/Errors/Reference.d.ts +133 -0
- package/lib/Errors/Reference.d.ts.map +1 -0
- package/lib/Errors/Reference.js +123 -0
- package/lib/Errors/Reference.js.map +1 -0
- package/lib/Errors/RegisterRelease.d.ts +66 -0
- package/lib/Errors/RegisterRelease.d.ts.map +1 -0
- package/lib/Errors/RegisterRelease.js +3 -0
- package/lib/Errors/RegisterRelease.js.map +1 -0
- package/lib/Errors/RegisterReleaseHttp.d.ts +13 -0
- package/lib/Errors/RegisterReleaseHttp.d.ts.map +1 -0
- package/lib/Errors/RegisterReleaseHttp.js +29 -0
- package/lib/Errors/RegisterReleaseHttp.js.map +1 -0
- package/lib/Errors/Release.d.ts +97 -0
- package/lib/Errors/Release.d.ts.map +1 -0
- package/lib/Errors/Release.js +161 -0
- package/lib/Errors/Release.js.map +1 -0
- package/lib/Errors/SlackIntegration.d.ts +66 -0
- package/lib/Errors/SlackIntegration.d.ts.map +1 -0
- package/lib/Errors/SlackIntegration.js +61 -0
- package/lib/Errors/SlackIntegration.js.map +1 -0
- package/lib/Errors/index.d.ts +38 -0
- package/lib/Errors/index.d.ts.map +1 -0
- package/lib/Errors/index.js +46 -0
- package/lib/Errors/index.js.map +1 -0
- package/lib/Incidents/AcknowledgeIncident.d.ts +61 -0
- package/lib/Incidents/AcknowledgeIncident.d.ts.map +1 -0
- package/lib/Incidents/AcknowledgeIncident.js +3 -0
- package/lib/Incidents/AcknowledgeIncident.js.map +1 -0
- package/lib/Incidents/AcknowledgeIncidentHttp.d.ts +12 -0
- package/lib/Incidents/AcknowledgeIncidentHttp.d.ts.map +1 -0
- package/lib/Incidents/AcknowledgeIncidentHttp.js +19 -0
- package/lib/Incidents/AcknowledgeIncidentHttp.js.map +1 -0
- package/lib/Incidents/AmazonSnsIntegration.d.ts +83 -0
- package/lib/Incidents/AmazonSnsIntegration.d.ts.map +1 -0
- package/lib/Incidents/AmazonSnsIntegration.js +91 -0
- package/lib/Incidents/AmazonSnsIntegration.js.map +1 -0
- package/lib/Incidents/AwsCloudWatchIntegration.d.ts +64 -0
- package/lib/Incidents/AwsCloudWatchIntegration.d.ts.map +1 -0
- package/lib/Incidents/AwsCloudWatchIntegration.js +64 -0
- package/lib/Incidents/AwsCloudWatchIntegration.js.map +1 -0
- package/lib/Incidents/AzureIntegration.d.ts +63 -0
- package/lib/Incidents/AzureIntegration.d.ts.map +1 -0
- package/lib/Incidents/AzureIntegration.js +63 -0
- package/lib/Incidents/AzureIntegration.js.map +1 -0
- package/lib/Incidents/BindingHttp.d.ts +28 -0
- package/lib/Incidents/BindingHttp.d.ts.map +1 -0
- package/lib/Incidents/BindingHttp.js +28 -0
- package/lib/Incidents/BindingHttp.js.map +1 -0
- package/lib/Incidents/CatalogRecord.d.ts +69 -0
- package/lib/Incidents/CatalogRecord.d.ts.map +1 -0
- package/lib/Incidents/CatalogRecord.js +69 -0
- package/lib/Incidents/CatalogRecord.js.map +1 -0
- package/lib/Incidents/CatalogRelation.d.ts +78 -0
- package/lib/Incidents/CatalogRelation.d.ts.map +1 -0
- package/lib/Incidents/CatalogRelation.js +79 -0
- package/lib/Incidents/CatalogRelation.js.map +1 -0
- package/lib/Incidents/CreateIncident.d.ts +67 -0
- package/lib/Incidents/CreateIncident.d.ts.map +1 -0
- package/lib/Incidents/CreateIncident.js +3 -0
- package/lib/Incidents/CreateIncident.js.map +1 -0
- package/lib/Incidents/CreateIncidentHttp.d.ts +12 -0
- package/lib/Incidents/CreateIncidentHttp.d.ts.map +1 -0
- package/lib/Incidents/CreateIncidentHttp.js +19 -0
- package/lib/Incidents/CreateIncidentHttp.js.map +1 -0
- package/lib/Incidents/CreateStatusReport.d.ts +71 -0
- package/lib/Incidents/CreateStatusReport.d.ts.map +1 -0
- package/lib/Incidents/CreateStatusReport.js +3 -0
- package/lib/Incidents/CreateStatusReport.js.map +1 -0
- package/lib/Incidents/CreateStatusReportHttp.d.ts +12 -0
- package/lib/Incidents/CreateStatusReportHttp.d.ts.map +1 -0
- package/lib/Incidents/CreateStatusReportHttp.js +27 -0
- package/lib/Incidents/CreateStatusReportHttp.js.map +1 -0
- package/lib/Incidents/CreateStatusUpdate.d.ts +67 -0
- package/lib/Incidents/CreateStatusUpdate.d.ts.map +1 -0
- package/lib/Incidents/CreateStatusUpdate.js +3 -0
- package/lib/Incidents/CreateStatusUpdate.js.map +1 -0
- package/lib/Incidents/CreateStatusUpdateHttp.d.ts +12 -0
- package/lib/Incidents/CreateStatusUpdateHttp.d.ts.map +1 -0
- package/lib/Incidents/CreateStatusUpdateHttp.js +27 -0
- package/lib/Incidents/CreateStatusUpdateHttp.js.map +1 -0
- package/lib/Incidents/DatadogIntegration.d.ts +70 -0
- package/lib/Incidents/DatadogIntegration.d.ts.map +1 -0
- package/lib/Incidents/DatadogIntegration.js +70 -0
- package/lib/Incidents/DatadogIntegration.js.map +1 -0
- package/lib/Incidents/ElasticIntegration.d.ts +62 -0
- package/lib/Incidents/ElasticIntegration.d.ts.map +1 -0
- package/lib/Incidents/ElasticIntegration.js +62 -0
- package/lib/Incidents/ElasticIntegration.js.map +1 -0
- package/lib/Incidents/EscalationPolicy.d.ts +106 -0
- package/lib/Incidents/EscalationPolicy.d.ts.map +1 -0
- package/lib/Incidents/EscalationPolicy.js +103 -0
- package/lib/Incidents/EscalationPolicy.js.map +1 -0
- package/lib/Incidents/EscalationPolicyGroup.d.ts +49 -0
- package/lib/Incidents/EscalationPolicyGroup.d.ts.map +1 -0
- package/lib/Incidents/EscalationPolicyGroup.js +48 -0
- package/lib/Incidents/EscalationPolicyGroup.js.map +1 -0
- package/lib/Incidents/FailHeartbeat.d.ts +49 -0
- package/lib/Incidents/FailHeartbeat.d.ts.map +1 -0
- package/lib/Incidents/FailHeartbeat.js +3 -0
- package/lib/Incidents/FailHeartbeat.js.map +1 -0
- package/lib/Incidents/FailHeartbeatHttp.d.ts +12 -0
- package/lib/Incidents/FailHeartbeatHttp.d.ts.map +1 -0
- package/lib/Incidents/FailHeartbeatHttp.js +22 -0
- package/lib/Incidents/FailHeartbeatHttp.js.map +1 -0
- package/lib/Incidents/GoogleMonitoringIntegration.d.ts +63 -0
- package/lib/Incidents/GoogleMonitoringIntegration.d.ts.map +1 -0
- package/lib/Incidents/GoogleMonitoringIntegration.js +63 -0
- package/lib/Incidents/GoogleMonitoringIntegration.js.map +1 -0
- package/lib/Incidents/GrafanaIntegration.d.ts +73 -0
- package/lib/Incidents/GrafanaIntegration.d.ts.map +1 -0
- package/lib/Incidents/GrafanaIntegration.js +73 -0
- package/lib/Incidents/GrafanaIntegration.js.map +1 -0
- package/lib/Incidents/Heartbeat.d.ts +99 -0
- package/lib/Incidents/Heartbeat.d.ts.map +1 -0
- package/lib/Incidents/Heartbeat.js +104 -0
- package/lib/Incidents/Heartbeat.js.map +1 -0
- package/lib/Incidents/HeartbeatGroup.d.ts +49 -0
- package/lib/Incidents/HeartbeatGroup.d.ts.map +1 -0
- package/lib/Incidents/HeartbeatGroup.js +48 -0
- package/lib/Incidents/HeartbeatGroup.js.map +1 -0
- package/lib/Incidents/IncomingEmailIntegration.d.ts +71 -0
- package/lib/Incidents/IncomingEmailIntegration.d.ts.map +1 -0
- package/lib/Incidents/IncomingEmailIntegration.js +81 -0
- package/lib/Incidents/IncomingEmailIntegration.js.map +1 -0
- package/lib/Incidents/IncomingWebhookIntegration.d.ts +85 -0
- package/lib/Incidents/IncomingWebhookIntegration.d.ts.map +1 -0
- package/lib/Incidents/IncomingWebhookIntegration.js +95 -0
- package/lib/Incidents/IncomingWebhookIntegration.js.map +1 -0
- package/lib/Incidents/JiraIntegration.d.ts +59 -0
- package/lib/Incidents/JiraIntegration.d.ts.map +1 -0
- package/lib/Incidents/JiraIntegration.js +50 -0
- package/lib/Incidents/JiraIntegration.js.map +1 -0
- package/lib/Incidents/LinearIntegration.d.ts +62 -0
- package/lib/Incidents/LinearIntegration.d.ts.map +1 -0
- package/lib/Incidents/LinearIntegration.js +60 -0
- package/lib/Incidents/LinearIntegration.js.map +1 -0
- package/lib/Incidents/Metadata.d.ts +85 -0
- package/lib/Incidents/Metadata.d.ts.map +1 -0
- package/lib/Incidents/Metadata.js +91 -0
- package/lib/Incidents/Metadata.js.map +1 -0
- package/lib/Incidents/Monitor.d.ts +91 -0
- package/lib/Incidents/Monitor.d.ts.map +1 -0
- package/lib/Incidents/Monitor.js +107 -0
- package/lib/Incidents/Monitor.js.map +1 -0
- package/lib/Incidents/MonitorGroup.d.ts +57 -0
- package/lib/Incidents/MonitorGroup.d.ts.map +1 -0
- package/lib/Incidents/MonitorGroup.js +56 -0
- package/lib/Incidents/MonitorGroup.js.map +1 -0
- package/lib/Incidents/NewRelicIntegration.d.ts +70 -0
- package/lib/Incidents/NewRelicIntegration.d.ts.map +1 -0
- package/lib/Incidents/NewRelicIntegration.js +70 -0
- package/lib/Incidents/NewRelicIntegration.js.map +1 -0
- package/lib/Incidents/OnCallRotation.d.ts +96 -0
- package/lib/Incidents/OnCallRotation.d.ts.map +1 -0
- package/lib/Incidents/OnCallRotation.js +206 -0
- package/lib/Incidents/OnCallRotation.js.map +1 -0
- package/lib/Incidents/OnCallSchedule.d.ts +80 -0
- package/lib/Incidents/OnCallSchedule.d.ts.map +1 -0
- package/lib/Incidents/OnCallSchedule.js +73 -0
- package/lib/Incidents/OnCallSchedule.js.map +1 -0
- package/lib/Incidents/OutgoingEmailIntegration.d.ts +54 -0
- package/lib/Incidents/OutgoingEmailIntegration.d.ts.map +1 -0
- package/lib/Incidents/OutgoingEmailIntegration.js +53 -0
- package/lib/Incidents/OutgoingEmailIntegration.js.map +1 -0
- package/lib/Incidents/OutgoingPagerDutyIntegration.d.ts +48 -0
- package/lib/Incidents/OutgoingPagerDutyIntegration.d.ts.map +1 -0
- package/lib/Incidents/OutgoingPagerDutyIntegration.js +47 -0
- package/lib/Incidents/OutgoingPagerDutyIntegration.js.map +1 -0
- package/lib/Incidents/OutgoingWebhookIntegration.d.ts +83 -0
- package/lib/Incidents/OutgoingWebhookIntegration.d.ts.map +1 -0
- package/lib/Incidents/OutgoingWebhookIntegration.js +98 -0
- package/lib/Incidents/OutgoingWebhookIntegration.js.map +1 -0
- package/lib/Incidents/PrometheusIntegration.d.ts +77 -0
- package/lib/Incidents/PrometheusIntegration.d.ts.map +1 -0
- package/lib/Incidents/PrometheusIntegration.js +77 -0
- package/lib/Incidents/PrometheusIntegration.js.map +1 -0
- package/lib/Incidents/Reference.d.ts +140 -0
- package/lib/Incidents/Reference.d.ts.map +1 -0
- package/lib/Incidents/Reference.js +136 -0
- package/lib/Incidents/Reference.js.map +1 -0
- package/lib/Incidents/ReportHeartbeat.d.ts +106 -0
- package/lib/Incidents/ReportHeartbeat.d.ts.map +1 -0
- package/lib/Incidents/ReportHeartbeat.js +63 -0
- package/lib/Incidents/ReportHeartbeat.js.map +1 -0
- package/lib/Incidents/ReportHeartbeatHttp.d.ts +12 -0
- package/lib/Incidents/ReportHeartbeatHttp.d.ts.map +1 -0
- package/lib/Incidents/ReportHeartbeatHttp.js +22 -0
- package/lib/Incidents/ReportHeartbeatHttp.js.map +1 -0
- package/lib/Incidents/ResolveIncident.d.ts +60 -0
- package/lib/Incidents/ResolveIncident.d.ts.map +1 -0
- package/lib/Incidents/ResolveIncident.js +3 -0
- package/lib/Incidents/ResolveIncident.js.map +1 -0
- package/lib/Incidents/ResolveIncidentHttp.d.ts +12 -0
- package/lib/Incidents/ResolveIncidentHttp.d.ts.map +1 -0
- package/lib/Incidents/ResolveIncidentHttp.js +19 -0
- package/lib/Incidents/ResolveIncidentHttp.js.map +1 -0
- package/lib/Incidents/SendHeartbeat.d.ts +56 -0
- package/lib/Incidents/SendHeartbeat.d.ts.map +1 -0
- package/lib/Incidents/SendHeartbeat.js +3 -0
- package/lib/Incidents/SendHeartbeat.js.map +1 -0
- package/lib/Incidents/SendHeartbeatHttp.d.ts +12 -0
- package/lib/Incidents/SendHeartbeatHttp.d.ts.map +1 -0
- package/lib/Incidents/SendHeartbeatHttp.js +22 -0
- package/lib/Incidents/SendHeartbeatHttp.js.map +1 -0
- package/lib/Incidents/Severity.d.ts +83 -0
- package/lib/Incidents/Severity.d.ts.map +1 -0
- package/lib/Incidents/Severity.js +79 -0
- package/lib/Incidents/Severity.js.map +1 -0
- package/lib/Incidents/SeverityGroup.d.ts +51 -0
- package/lib/Incidents/SeverityGroup.d.ts.map +1 -0
- package/lib/Incidents/SeverityGroup.js +50 -0
- package/lib/Incidents/SeverityGroup.js.map +1 -0
- package/lib/Incidents/SplunkOnCallIntegration.d.ts +46 -0
- package/lib/Incidents/SplunkOnCallIntegration.d.ts.map +1 -0
- package/lib/Incidents/SplunkOnCallIntegration.js +45 -0
- package/lib/Incidents/SplunkOnCallIntegration.js.map +1 -0
- package/lib/Incidents/StatusPage.d.ts +125 -0
- package/lib/Incidents/StatusPage.d.ts.map +1 -0
- package/lib/Incidents/StatusPage.js +133 -0
- package/lib/Incidents/StatusPage.js.map +1 -0
- package/lib/Incidents/StatusPageGroup.d.ts +50 -0
- package/lib/Incidents/StatusPageGroup.d.ts.map +1 -0
- package/lib/Incidents/StatusPageGroup.js +49 -0
- package/lib/Incidents/StatusPageGroup.js.map +1 -0
- package/lib/Incidents/StatusPageResource.d.ts +91 -0
- package/lib/Incidents/StatusPageResource.d.ts.map +1 -0
- package/lib/Incidents/StatusPageResource.js +87 -0
- package/lib/Incidents/StatusPageResource.js.map +1 -0
- package/lib/Incidents/StatusPageSection.d.ts +65 -0
- package/lib/Incidents/StatusPageSection.d.ts.map +1 -0
- package/lib/Incidents/StatusPageSection.js +65 -0
- package/lib/Incidents/StatusPageSection.js.map +1 -0
- package/lib/Incidents/StatusPageSubscriber.d.ts +93 -0
- package/lib/Incidents/StatusPageSubscriber.d.ts.map +1 -0
- package/lib/Incidents/StatusPageSubscriber.js +100 -0
- package/lib/Incidents/StatusPageSubscriber.js.map +1 -0
- package/lib/Incidents/index.d.ts +108 -0
- package/lib/Incidents/index.d.ts.map +1 -0
- package/lib/Incidents/index.js +143 -0
- package/lib/Incidents/index.js.map +1 -0
- package/lib/Incidents/integrationFields.d.ts +124 -0
- package/lib/Incidents/integrationFields.d.ts.map +1 -0
- package/lib/Incidents/integrationFields.js +74 -0
- package/lib/Incidents/integrationFields.js.map +1 -0
- package/lib/Providers.d.ts +36 -0
- package/lib/Providers.d.ts.map +1 -0
- package/lib/Providers.js +54 -0
- package/lib/Providers.js.map +1 -0
- package/lib/Telemetry/Alert.d.ts +99 -0
- package/lib/Telemetry/Alert.d.ts.map +1 -0
- package/lib/Telemetry/Alert.js +91 -0
- package/lib/Telemetry/Alert.js.map +1 -0
- package/lib/Telemetry/AwsLogGroupSubscription.d.ts +57 -0
- package/lib/Telemetry/AwsLogGroupSubscription.d.ts.map +1 -0
- package/lib/Telemetry/AwsLogGroupSubscription.js +57 -0
- package/lib/Telemetry/AwsLogGroupSubscription.js.map +1 -0
- package/lib/Telemetry/BindingHttp.d.ts +23 -0
- package/lib/Telemetry/BindingHttp.d.ts.map +1 -0
- package/lib/Telemetry/BindingHttp.js +25 -0
- package/lib/Telemetry/BindingHttp.js.map +1 -0
- package/lib/Telemetry/Chart.d.ts +171 -0
- package/lib/Telemetry/Chart.d.ts.map +1 -0
- package/lib/Telemetry/Chart.js +92 -0
- package/lib/Telemetry/Chart.js.map +1 -0
- package/lib/Telemetry/Collector.d.ts +78 -0
- package/lib/Telemetry/Collector.d.ts.map +1 -0
- package/lib/Telemetry/Collector.js +111 -0
- package/lib/Telemetry/Collector.js.map +1 -0
- package/lib/Telemetry/CollectorTarget.d.ts +69 -0
- package/lib/Telemetry/CollectorTarget.d.ts.map +1 -0
- package/lib/Telemetry/CollectorTarget.js +69 -0
- package/lib/Telemetry/CollectorTarget.js.map +1 -0
- package/lib/Telemetry/Connection.d.ts +79 -0
- package/lib/Telemetry/Connection.d.ts.map +1 -0
- package/lib/Telemetry/Connection.js +128 -0
- package/lib/Telemetry/Connection.js.map +1 -0
- package/lib/Telemetry/Dashboard.d.ts +108 -0
- package/lib/Telemetry/Dashboard.d.ts.map +1 -0
- package/lib/Telemetry/Dashboard.js +112 -0
- package/lib/Telemetry/Dashboard.js.map +1 -0
- package/lib/Telemetry/DashboardChart.d.ts +104 -0
- package/lib/Telemetry/DashboardChart.d.ts.map +1 -0
- package/lib/Telemetry/DashboardChart.js +119 -0
- package/lib/Telemetry/DashboardChart.js.map +1 -0
- package/lib/Telemetry/DashboardGroup.d.ts +53 -0
- package/lib/Telemetry/DashboardGroup.d.ts.map +1 -0
- package/lib/Telemetry/DashboardGroup.js +47 -0
- package/lib/Telemetry/DashboardGroup.js.map +1 -0
- package/lib/Telemetry/DashboardSection.d.ts +65 -0
- package/lib/Telemetry/DashboardSection.d.ts.map +1 -0
- package/lib/Telemetry/DashboardSection.js +65 -0
- package/lib/Telemetry/DashboardSection.js.map +1 -0
- package/lib/Telemetry/Exploration.d.ts +77 -0
- package/lib/Telemetry/Exploration.d.ts.map +1 -0
- package/lib/Telemetry/Exploration.js +97 -0
- package/lib/Telemetry/Exploration.js.map +1 -0
- package/lib/Telemetry/ExplorationGroup.d.ts +58 -0
- package/lib/Telemetry/ExplorationGroup.d.ts.map +1 -0
- package/lib/Telemetry/ExplorationGroup.js +52 -0
- package/lib/Telemetry/ExplorationGroup.js.map +1 -0
- package/lib/Telemetry/Export.d.ts +183 -0
- package/lib/Telemetry/Export.d.ts.map +1 -0
- package/lib/Telemetry/Export.js +152 -0
- package/lib/Telemetry/Export.js.map +1 -0
- package/lib/Telemetry/ExtractedMetric.d.ts +67 -0
- package/lib/Telemetry/ExtractedMetric.d.ts.map +1 -0
- package/lib/Telemetry/ExtractedMetric.js +66 -0
- package/lib/Telemetry/ExtractedMetric.js.map +1 -0
- package/lib/Telemetry/IngestLogs.d.ts +87 -0
- package/lib/Telemetry/IngestLogs.d.ts.map +1 -0
- package/lib/Telemetry/IngestLogs.js +3 -0
- package/lib/Telemetry/IngestLogs.js.map +1 -0
- package/lib/Telemetry/IngestLogsHttp.d.ts +12 -0
- package/lib/Telemetry/IngestLogsHttp.d.ts.map +1 -0
- package/lib/Telemetry/IngestLogsHttp.js +21 -0
- package/lib/Telemetry/IngestLogsHttp.js.map +1 -0
- package/lib/Telemetry/IngestMetrics.d.ts +68 -0
- package/lib/Telemetry/IngestMetrics.d.ts.map +1 -0
- package/lib/Telemetry/IngestMetrics.js +3 -0
- package/lib/Telemetry/IngestMetrics.js.map +1 -0
- package/lib/Telemetry/IngestMetricsHttp.d.ts +12 -0
- package/lib/Telemetry/IngestMetricsHttp.d.ts.map +1 -0
- package/lib/Telemetry/IngestMetricsHttp.js +21 -0
- package/lib/Telemetry/IngestMetricsHttp.js.map +1 -0
- package/lib/Telemetry/OtelHeaders.d.ts +36 -0
- package/lib/Telemetry/OtelHeaders.d.ts.map +1 -0
- package/lib/Telemetry/OtelHeaders.js +34 -0
- package/lib/Telemetry/OtelHeaders.js.map +1 -0
- package/lib/Telemetry/Query.d.ts +66 -0
- package/lib/Telemetry/Query.d.ts.map +1 -0
- package/lib/Telemetry/Query.js +3 -0
- package/lib/Telemetry/Query.js.map +1 -0
- package/lib/Telemetry/QueryHttp.d.ts +12 -0
- package/lib/Telemetry/QueryHttp.d.ts.map +1 -0
- package/lib/Telemetry/QueryHttp.js +24 -0
- package/lib/Telemetry/QueryHttp.js.map +1 -0
- package/lib/Telemetry/Reference.d.ts +115 -0
- package/lib/Telemetry/Reference.d.ts.map +1 -0
- package/lib/Telemetry/Reference.js +110 -0
- package/lib/Telemetry/Reference.js.map +1 -0
- package/lib/Telemetry/ShipLogs.d.ts +89 -0
- package/lib/Telemetry/ShipLogs.d.ts.map +1 -0
- package/lib/Telemetry/ShipLogs.js +119 -0
- package/lib/Telemetry/ShipLogs.js.map +1 -0
- package/lib/Telemetry/Source.d.ts +184 -0
- package/lib/Telemetry/Source.d.ts.map +1 -0
- package/lib/Telemetry/Source.js +238 -0
- package/lib/Telemetry/Source.js.map +1 -0
- package/lib/Telemetry/SourceAwsAccount.d.ts +73 -0
- package/lib/Telemetry/SourceAwsAccount.d.ts.map +1 -0
- package/lib/Telemetry/SourceAwsAccount.js +57 -0
- package/lib/Telemetry/SourceAwsAccount.js.map +1 -0
- package/lib/Telemetry/SourceGcpProject.d.ts +81 -0
- package/lib/Telemetry/SourceGcpProject.d.ts.map +1 -0
- package/lib/Telemetry/SourceGcpProject.js +69 -0
- package/lib/Telemetry/SourceGcpProject.js.map +1 -0
- package/lib/Telemetry/SourceGroup.d.ts +65 -0
- package/lib/Telemetry/SourceGroup.d.ts.map +1 -0
- package/lib/Telemetry/SourceGroup.js +67 -0
- package/lib/Telemetry/SourceGroup.js.map +1 -0
- package/lib/Telemetry/customBucket.d.ts +26 -0
- package/lib/Telemetry/customBucket.d.ts.map +1 -0
- package/lib/Telemetry/customBucket.js +45 -0
- package/lib/Telemetry/customBucket.js.map +1 -0
- package/lib/Telemetry/index.d.ts +64 -0
- package/lib/Telemetry/index.d.ts.map +1 -0
- package/lib/Telemetry/index.js +81 -0
- package/lib/Telemetry/index.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/DeployRetry.d.ts +19 -0
- package/lib/internal/DeployRetry.d.ts.map +1 -0
- package/lib/internal/DeployRetry.js +52 -0
- package/lib/internal/DeployRetry.js.map +1 -0
- package/lib/internal/actionWait.d.ts +12 -0
- package/lib/internal/actionWait.d.ts.map +1 -0
- package/lib/internal/actionWait.js +21 -0
- package/lib/internal/actionWait.js.map +1 -0
- package/lib/internal/applicationIds.d.ts +17 -0
- package/lib/internal/applicationIds.d.ts.map +1 -0
- package/lib/internal/applicationIds.js +12 -0
- package/lib/internal/applicationIds.js.map +1 -0
- package/lib/internal/attachments.d.ts +23 -0
- package/lib/internal/attachments.d.ts.map +1 -0
- package/lib/internal/attachments.js +22 -0
- package/lib/internal/attachments.js.map +1 -0
- package/lib/internal/budget.d.ts +46 -0
- package/lib/internal/budget.d.ts.map +1 -0
- package/lib/internal/budget.js +44 -0
- package/lib/internal/budget.js.map +1 -0
- package/lib/internal/connection.d.ts +65 -0
- package/lib/internal/connection.d.ts.map +1 -0
- package/lib/internal/connection.js +160 -0
- package/lib/internal/connection.js.map +1 -0
- package/lib/internal/crud.d.ts +195 -0
- package/lib/internal/crud.d.ts.map +1 -0
- package/lib/internal/crud.js +614 -0
- package/lib/internal/crud.js.map +1 -0
- package/lib/internal/errors.d.ts +35 -0
- package/lib/internal/errors.d.ts.map +1 -0
- package/lib/internal/errors.js +19 -0
- package/lib/internal/errors.js.map +1 -0
- package/lib/internal/fields.d.ts +47 -0
- package/lib/internal/fields.d.ts.map +1 -0
- package/lib/internal/fields.js +136 -0
- package/lib/internal/fields.js.map +1 -0
- package/lib/internal/gone.d.ts +13 -0
- package/lib/internal/gone.d.ts.map +1 -0
- package/lib/internal/gone.js +14 -0
- package/lib/internal/gone.js.map +1 -0
- package/lib/internal/managedDatabase.d.ts +137 -0
- package/lib/internal/managedDatabase.d.ts.map +1 -0
- package/lib/internal/managedDatabase.js +186 -0
- package/lib/internal/managedDatabase.js.map +1 -0
- package/lib/internal/managedService.d.ts +184 -0
- package/lib/internal/managedService.d.ts.map +1 -0
- package/lib/internal/managedService.js +208 -0
- package/lib/internal/managedService.js.map +1 -0
- package/lib/internal/migrations.d.ts +138 -0
- package/lib/internal/migrations.d.ts.map +1 -0
- package/lib/internal/migrations.js +288 -0
- package/lib/internal/migrations.js.map +1 -0
- package/lib/internal/ops.d.ts +43 -0
- package/lib/internal/ops.d.ts.map +1 -0
- package/lib/internal/ops.js +46 -0
- package/lib/internal/ops.js.map +1 -0
- package/lib/internal/ownership.d.ts +55 -0
- package/lib/internal/ownership.d.ts.map +1 -0
- package/lib/internal/ownership.js +74 -0
- package/lib/internal/ownership.js.map +1 -0
- package/lib/internal/reference.d.ts +36 -0
- package/lib/internal/reference.d.ts.map +1 -0
- package/lib/internal/reference.js +49 -0
- package/lib/internal/reference.js.map +1 -0
- package/lib/internal/scope.d.ts +51 -0
- package/lib/internal/scope.d.ts.map +1 -0
- package/lib/internal/scope.js +34 -0
- package/lib/internal/scope.js.map +1 -0
- package/lib/internal/snapshot.d.ts +120 -0
- package/lib/internal/snapshot.d.ts.map +1 -0
- package/lib/internal/snapshot.js +92 -0
- package/lib/internal/snapshot.js.map +1 -0
- package/lib/internal/unpaged.d.ts +22 -0
- package/lib/internal/unpaged.d.ts.map +1 -0
- package/lib/internal/unpaged.js +17 -0
- package/lib/internal/unpaged.js.map +1 -0
- package/lib/internal/wait.d.ts +55 -0
- package/lib/internal/wait.d.ts.map +1 -0
- package/lib/internal/wait.js +56 -0
- package/lib/internal/wait.js.map +1 -0
- package/lib/sdk/credentials.d.ts +97 -0
- package/lib/sdk/credentials.d.ts.map +1 -0
- package/lib/sdk/credentials.js +135 -0
- package/lib/sdk/credentials.js.map +1 -0
- package/lib/sdk/errors.d.ts +98 -0
- package/lib/sdk/errors.d.ts.map +1 -0
- package/lib/sdk/errors.js +86 -0
- package/lib/sdk/errors.js.map +1 -0
- package/lib/sdk/index.d.ts +49 -0
- package/lib/sdk/index.d.ts.map +1 -0
- package/lib/sdk/index.js +49 -0
- package/lib/sdk/index.js.map +1 -0
- package/lib/sdk/pagination.d.ts +35 -0
- package/lib/sdk/pagination.d.ts.map +1 -0
- package/lib/sdk/pagination.js +80 -0
- package/lib/sdk/pagination.js.map +1 -0
- package/lib/sdk/protocol.d.ts +109 -0
- package/lib/sdk/protocol.d.ts.map +1 -0
- package/lib/sdk/protocol.js +451 -0
- package/lib/sdk/protocol.js.map +1 -0
- package/lib/sdk/retry.d.ts +32 -0
- package/lib/sdk/retry.d.ts.map +1 -0
- package/lib/sdk/retry.js +33 -0
- package/lib/sdk/retry.js.map +1 -0
- package/lib/sdk/services/account.d.ts +372 -0
- package/lib/sdk/services/account.d.ts.map +1 -0
- package/lib/sdk/services/account.js +553 -0
- package/lib/sdk/services/account.js.map +1 -0
- package/lib/sdk/services/cloud.d.ts +11910 -0
- package/lib/sdk/services/cloud.d.ts.map +1 -0
- package/lib/sdk/services/cloud.js +18446 -0
- package/lib/sdk/services/cloud.js.map +1 -0
- package/lib/sdk/services/errors.d.ts +2203 -0
- package/lib/sdk/services/errors.d.ts.map +1 -0
- package/lib/sdk/services/errors.js +2676 -0
- package/lib/sdk/services/errors.js.map +1 -0
- package/lib/sdk/services/heartbeat.d.ts +36 -0
- package/lib/sdk/services/heartbeat.d.ts.map +1 -0
- package/lib/sdk/services/heartbeat.js +94 -0
- package/lib/sdk/services/heartbeat.js.map +1 -0
- package/lib/sdk/services/incidents.d.ts +9948 -0
- package/lib/sdk/services/incidents.d.ts.map +1 -0
- package/lib/sdk/services/incidents.js +9730 -0
- package/lib/sdk/services/incidents.js.map +1 -0
- package/lib/sdk/services/index.d.ts +8 -0
- package/lib/sdk/services/index.d.ts.map +1 -0
- package/lib/sdk/services/index.js +9 -0
- package/lib/sdk/services/index.js.map +1 -0
- package/lib/sdk/services/ingest.d.ts +158 -0
- package/lib/sdk/services/ingest.d.ts.map +1 -0
- package/lib/sdk/services/ingest.js +200 -0
- package/lib/sdk/services/ingest.js.map +1 -0
- package/lib/sdk/services/telemetry.d.ts +6789 -0
- package/lib/sdk/services/telemetry.d.ts.map +1 -0
- package/lib/sdk/services/telemetry.js +5613 -0
- package/lib/sdk/services/telemetry.js.map +1 -0
- package/lib/sdk/traits.d.ts +26 -0
- package/lib/sdk/traits.d.ts.map +1 -0
- package/lib/sdk/traits.js +15 -0
- package/lib/sdk/traits.js.map +1 -0
- package/package.json +190 -4
- package/src/Account/Reference.ts +120 -0
- package/src/Account/Team.ts +106 -0
- package/src/Account/TeamMember.ts +218 -0
- package/src/Account/index.ts +27 -0
- package/src/AuthProvider.ts +172 -0
- package/src/BetterStackBindings.ts +447 -0
- package/src/Cloud/Bootstrap.ts +116 -0
- package/src/Cloud/Certificate.ts +146 -0
- package/src/Cloud/ClickHouse.ts +272 -0
- package/src/Cloud/ClickHouseScheduledSnapshot.ts +114 -0
- package/src/Cloud/ClickHouseSnapshot.ts +137 -0
- package/src/Cloud/Firewall.ts +277 -0
- package/src/Cloud/FirewallRule.ts +175 -0
- package/src/Cloud/InferEnv.ts +30 -0
- package/src/Cloud/Kafka.ts +301 -0
- package/src/Cloud/KafkaTopic.ts +129 -0
- package/src/Cloud/KafkaUser.ts +175 -0
- package/src/Cloud/KubernetesCluster.ts +312 -0
- package/src/Cloud/KubernetesNodePool.ts +196 -0
- package/src/Cloud/KubernetesScheduledSnapshot.ts +116 -0
- package/src/Cloud/LoadBalancer.ts +336 -0
- package/src/Cloud/LoadBalancerService.ts +181 -0
- package/src/Cloud/LoadBalancerTarget.ts +203 -0
- package/src/Cloud/MountVolume.ts +167 -0
- package/src/Cloud/MySQL.ts +363 -0
- package/src/Cloud/MySQLScheduledSnapshot.ts +111 -0
- package/src/Cloud/MySQLSnapshot.ts +133 -0
- package/src/Cloud/Network.ts +116 -0
- package/src/Cloud/ObjectCache.ts +420 -0
- package/src/Cloud/ObjectCacheBucket.ts +197 -0
- package/src/Cloud/Otlp.ts +131 -0
- package/src/Cloud/PlacementGroup.ts +132 -0
- package/src/Cloud/Postgres.ts +410 -0
- package/src/Cloud/PostgresDatabase.ts +118 -0
- package/src/Cloud/PostgresScheduledSnapshot.ts +111 -0
- package/src/Cloud/PostgresSnapshot.ts +133 -0
- package/src/Cloud/PostgresUser.ts +175 -0
- package/src/Cloud/Reference.ts +743 -0
- package/src/Cloud/ReservedIp.ts +214 -0
- package/src/Cloud/ScheduledSnapshot.ts +75 -0
- package/src/Cloud/ScheduledVolumeSnapshot.ts +76 -0
- package/src/Cloud/Server.ts +1469 -0
- package/src/Cloud/ServerPool.ts +100 -0
- package/src/Cloud/ServerPrivateIp.ts +109 -0
- package/src/Cloud/Service.ts +1101 -0
- package/src/Cloud/ServiceHandler.ts +113 -0
- package/src/Cloud/Snapshot.ts +161 -0
- package/src/Cloud/Ssh.ts +528 -0
- package/src/Cloud/SshKey.ts +241 -0
- package/src/Cloud/Valkey.ts +284 -0
- package/src/Cloud/ValkeyScheduledSnapshot.ts +112 -0
- package/src/Cloud/ValkeySnapshot.ts +135 -0
- package/src/Cloud/Volume.ts +522 -0
- package/src/Cloud/VolumeSnapshot.ts +153 -0
- package/src/Cloud/Webhook.ts +145 -0
- package/src/Cloud/Website/Astro.ts +118 -0
- package/src/Cloud/Website/Foldkit.ts +78 -0
- package/src/Cloud/Website/FrameworkSite.ts +499 -0
- package/src/Cloud/Website/Nextjs.ts +70 -0
- package/src/Cloud/Website/Nuxt.ts +72 -0
- package/src/Cloud/Website/Octane.ts +63 -0
- package/src/Cloud/Website/Providers.ts +20 -0
- package/src/Cloud/Website/ReactRouter.ts +96 -0
- package/src/Cloud/Website/SolidStart.ts +109 -0
- package/src/Cloud/Website/StaticSite.ts +273 -0
- package/src/Cloud/Website/SvelteKit.ts +71 -0
- package/src/Cloud/Website/TanStackStart.ts +91 -0
- package/src/Cloud/Website/Vinext.ts +79 -0
- package/src/Cloud/Website/Vite.ts +131 -0
- package/src/Cloud/Website/Vocs.ts +69 -0
- package/src/Cloud/Website/Waku.ts +76 -0
- package/src/Cloud/Website/index.ts +16 -0
- package/src/Cloud/hosted.ts +1022 -0
- package/src/Cloud/index.ts +223 -0
- package/src/Contributions.ts +15 -0
- package/src/Credentials.ts +70 -0
- package/src/Errors/Application.ts +208 -0
- package/src/Errors/ApplicationGroup.ts +119 -0
- package/src/Errors/Dsn.ts +119 -0
- package/src/Errors/JiraIntegration.ts +108 -0
- package/src/Errors/LinearIntegration.ts +112 -0
- package/src/Errors/MicrosoftTeamsIntegration.ts +121 -0
- package/src/Errors/Reference.ts +189 -0
- package/src/Errors/RegisterRelease.ts +77 -0
- package/src/Errors/RegisterReleaseHttp.ts +47 -0
- package/src/Errors/Release.ts +241 -0
- package/src/Errors/SlackIntegration.ts +105 -0
- package/src/Errors/index.ts +60 -0
- package/src/Incidents/AcknowledgeIncident.ts +78 -0
- package/src/Incidents/AcknowledgeIncidentHttp.ts +28 -0
- package/src/Incidents/AmazonSnsIntegration.ts +134 -0
- package/src/Incidents/AwsCloudWatchIntegration.ts +99 -0
- package/src/Incidents/AzureIntegration.ts +95 -0
- package/src/Incidents/BindingHttp.ts +62 -0
- package/src/Incidents/CatalogRecord.ts +106 -0
- package/src/Incidents/CatalogRelation.ts +111 -0
- package/src/Incidents/CreateIncident.ts +81 -0
- package/src/Incidents/CreateIncidentHttp.ts +28 -0
- package/src/Incidents/CreateStatusReport.ts +88 -0
- package/src/Incidents/CreateStatusReportHttp.ts +35 -0
- package/src/Incidents/CreateStatusUpdate.ts +84 -0
- package/src/Incidents/CreateStatusUpdateHttp.ts +35 -0
- package/src/Incidents/DatadogIntegration.ts +102 -0
- package/src/Incidents/ElasticIntegration.ts +94 -0
- package/src/Incidents/EscalationPolicy.ts +144 -0
- package/src/Incidents/EscalationPolicyGroup.ts +82 -0
- package/src/Incidents/FailHeartbeat.ts +55 -0
- package/src/Incidents/FailHeartbeatHttp.ts +28 -0
- package/src/Incidents/GoogleMonitoringIntegration.ts +98 -0
- package/src/Incidents/GrafanaIntegration.ts +105 -0
- package/src/Incidents/Heartbeat.ts +143 -0
- package/src/Incidents/HeartbeatGroup.ts +83 -0
- package/src/Incidents/IncomingEmailIntegration.ts +120 -0
- package/src/Incidents/IncomingWebhookIntegration.ts +141 -0
- package/src/Incidents/JiraIntegration.ts +83 -0
- package/src/Incidents/LinearIntegration.ts +94 -0
- package/src/Incidents/Metadata.ts +133 -0
- package/src/Incidents/Monitor.ts +150 -0
- package/src/Incidents/MonitorGroup.ts +91 -0
- package/src/Incidents/NewRelicIntegration.ts +102 -0
- package/src/Incidents/OnCallRotation.ts +295 -0
- package/src/Incidents/OnCallSchedule.ts +115 -0
- package/src/Incidents/OutgoingEmailIntegration.ts +84 -0
- package/src/Incidents/OutgoingPagerDutyIntegration.ts +78 -0
- package/src/Incidents/OutgoingWebhookIntegration.ts +147 -0
- package/src/Incidents/PrometheusIntegration.ts +109 -0
- package/src/Incidents/Reference.ts +210 -0
- package/src/Incidents/ReportHeartbeat.ts +149 -0
- package/src/Incidents/ReportHeartbeatHttp.ts +30 -0
- package/src/Incidents/ResolveIncident.ts +74 -0
- package/src/Incidents/ResolveIncidentHttp.ts +28 -0
- package/src/Incidents/SendHeartbeat.ts +62 -0
- package/src/Incidents/SendHeartbeatHttp.ts +28 -0
- package/src/Incidents/Severity.ts +123 -0
- package/src/Incidents/SeverityGroup.ts +82 -0
- package/src/Incidents/SplunkOnCallIntegration.ts +76 -0
- package/src/Incidents/StatusPage.ts +178 -0
- package/src/Incidents/StatusPageGroup.ts +81 -0
- package/src/Incidents/StatusPageResource.ts +128 -0
- package/src/Incidents/StatusPageSection.ts +105 -0
- package/src/Incidents/StatusPageSubscriber.ts +163 -0
- package/src/Incidents/index.ts +213 -0
- package/src/Incidents/integrationFields.ts +174 -0
- package/src/Providers.ts +78 -0
- package/src/Telemetry/Alert.ts +135 -0
- package/src/Telemetry/AwsLogGroupSubscription.ts +97 -0
- package/src/Telemetry/BindingHttp.ts +40 -0
- package/src/Telemetry/Chart.ts +251 -0
- package/src/Telemetry/Collector.ts +157 -0
- package/src/Telemetry/CollectorTarget.ts +108 -0
- package/src/Telemetry/Connection.ts +182 -0
- package/src/Telemetry/Dashboard.ts +152 -0
- package/src/Telemetry/DashboardChart.ts +177 -0
- package/src/Telemetry/DashboardGroup.ts +86 -0
- package/src/Telemetry/DashboardSection.ts +115 -0
- package/src/Telemetry/Exploration.ts +139 -0
- package/src/Telemetry/ExplorationGroup.ts +93 -0
- package/src/Telemetry/Export.ts +263 -0
- package/src/Telemetry/ExtractedMetric.ts +112 -0
- package/src/Telemetry/IngestLogs.ts +95 -0
- package/src/Telemetry/IngestLogsHttp.ts +28 -0
- package/src/Telemetry/IngestMetrics.ts +76 -0
- package/src/Telemetry/IngestMetricsHttp.ts +28 -0
- package/src/Telemetry/OtelHeaders.ts +52 -0
- package/src/Telemetry/Query.ts +75 -0
- package/src/Telemetry/QueryHttp.ts +40 -0
- package/src/Telemetry/Reference.ts +164 -0
- package/src/Telemetry/ShipLogs.ts +162 -0
- package/src/Telemetry/Source.ts +328 -0
- package/src/Telemetry/SourceAwsAccount.ts +110 -0
- package/src/Telemetry/SourceGcpProject.ts +125 -0
- package/src/Telemetry/SourceGroup.ts +111 -0
- package/src/Telemetry/customBucket.ts +62 -0
- package/src/Telemetry/index.ts +104 -0
- package/src/globals.d.ts +4 -0
- package/src/index.ts +13 -0
- package/src/internal/DeployRetry.ts +64 -0
- package/src/internal/actionWait.ts +23 -0
- package/src/internal/applicationIds.ts +21 -0
- package/src/internal/attachments.ts +40 -0
- package/src/internal/budget.ts +69 -0
- package/src/internal/connection.ts +233 -0
- package/src/internal/crud.ts +1053 -0
- package/src/internal/errors.ts +32 -0
- package/src/internal/fields.ts +162 -0
- package/src/internal/gone.ts +19 -0
- package/src/internal/managedDatabase.ts +331 -0
- package/src/internal/managedService.ts +419 -0
- package/src/internal/migrations.ts +484 -0
- package/src/internal/ops.ts +86 -0
- package/src/internal/ownership.ts +84 -0
- package/src/internal/reference.ts +100 -0
- package/src/internal/scope.ts +84 -0
- package/src/internal/snapshot.ts +170 -0
- package/src/internal/unpaged.ts +29 -0
- package/src/internal/wait.ts +88 -0
- package/src/sdk/credentials.ts +222 -0
- package/src/sdk/errors.ts +125 -0
- package/src/sdk/index.ts +69 -0
- package/src/sdk/pagination.ts +100 -0
- package/src/sdk/protocol.ts +565 -0
- package/src/sdk/retry.ts +50 -0
- package/src/sdk/services/account.ts +1079 -0
- package/src/sdk/services/cloud.ts +38638 -0
- package/src/sdk/services/errors.ts +6182 -0
- package/src/sdk/services/heartbeat.ts +144 -0
- package/src/sdk/services/incidents.ts +25835 -0
- package/src/sdk/services/index.ts +8 -0
- package/src/sdk/services/ingest.ts +383 -0
- package/src/sdk/services/telemetry.ts +14868 -0
- package/src/sdk/traits.ts +77 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as Provider from "alchemy/Provider";
|
|
2
|
+
import type { ResourceClassLike, ResourceLike } from "alchemy/Resource";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
import type * as Duration from "effect/Duration";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import * as Redacted from "effect/Redacted";
|
|
8
|
+
import type { CrudRequirements } from "./crud.ts";
|
|
9
|
+
/**
|
|
10
|
+
* Where the migrations are, the shapes `@alchemy.run/sql/Migrations` accepts:
|
|
11
|
+
* a directory path; `{ dir, table? }` to name the bookkeeping table; or a
|
|
12
|
+
* `Drizzle.Schema` resource (anything with `out`, its migrations directory).
|
|
13
|
+
* Flat `.sql` files, drizzle-kit and Prisma directory layouts are read; a
|
|
14
|
+
* database migrated before by drizzle-kit or Prisma is adopted once.
|
|
15
|
+
*/
|
|
16
|
+
export type MigrationsInput = string | {
|
|
17
|
+
/** Directory containing the migration files. */
|
|
18
|
+
dir: string;
|
|
19
|
+
/** The bookkeeping table. Defaults to `__alchemy_migrations`. */
|
|
20
|
+
table?: string;
|
|
21
|
+
} | {
|
|
22
|
+
/** A `Drizzle.Schema`-shaped resource output: its migrations directory. */
|
|
23
|
+
out: string;
|
|
24
|
+
};
|
|
25
|
+
/** The `migrations` prop of a SQL database resource. */
|
|
26
|
+
export interface MigrationsProps {
|
|
27
|
+
/**
|
|
28
|
+
* SQL migrations to apply on deploy, after the instance is `running`: a
|
|
29
|
+
* directory (flat `.sql` files sorted by name, or a drizzle-kit / Prisma
|
|
30
|
+
* layout), `{ dir, table }`, or a `Drizzle.Schema`. Applied over the
|
|
31
|
+
* instance's PUBLIC endpoint from the deploying machine (needs
|
|
32
|
+
* `publicAccess: true` and a firewall rule for that machine). History is
|
|
33
|
+
* forward-only: a new file must sort after every applied one
|
|
34
|
+
* (`NonLinearMigrationHistoryError` otherwise), and an applied file that
|
|
35
|
+
* was edited or removed fails the deploy with
|
|
36
|
+
* `RewrittenMigrationHistoryError`; add a new migration instead. Renaming
|
|
37
|
+
* an applied file without changing it keeps it applied. Bookkeeping is the
|
|
38
|
+
* `__alchemy_migrations` table. Needs the optional peer dependencies
|
|
39
|
+
* `@alchemy.run/sql` and the driver (`pg` or `mysql2`).
|
|
40
|
+
*/
|
|
41
|
+
migrations?: MigrationsInput;
|
|
42
|
+
}
|
|
43
|
+
/** The attributes every SQL database resource with `migrations` exposes. */
|
|
44
|
+
export interface MigrationsAttributes {
|
|
45
|
+
/** Directory of the applied SQL migrations (`undefined` without `migrations`). */
|
|
46
|
+
migrationsDir: string | undefined;
|
|
47
|
+
/** The bookkeeping table the migrations were recorded in. */
|
|
48
|
+
migrationsTable: string | undefined;
|
|
49
|
+
/** Content hash (sha256) of every applied migration file, by name. */
|
|
50
|
+
migrationsHashes: Record<string, string>;
|
|
51
|
+
}
|
|
52
|
+
declare const MigrationsUnreachable_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
53
|
+
readonly _tag: "MigrationsUnreachable";
|
|
54
|
+
} & Readonly<A>;
|
|
55
|
+
/**
|
|
56
|
+
* The migrations could not reach the database from the deploying machine.
|
|
57
|
+
* `reason`: `no-public-endpoint` — the instance has no public endpoint
|
|
58
|
+
* (`publicAccess` is off); `connection-failed` — the endpoint refused or
|
|
59
|
+
* dropped the connection (a firewall, TLS, a wrong password). The message
|
|
60
|
+
* says what to set; it never carries a secret.
|
|
61
|
+
*/
|
|
62
|
+
export declare class MigrationsUnreachable extends MigrationsUnreachable_base<{
|
|
63
|
+
readonly message: string;
|
|
64
|
+
readonly resourceType: string;
|
|
65
|
+
readonly reason: "no-public-endpoint" | "connection-failed";
|
|
66
|
+
/** `host:port` the deploy tried, when it had one. */
|
|
67
|
+
readonly endpoint?: string | undefined;
|
|
68
|
+
}> {
|
|
69
|
+
}
|
|
70
|
+
declare const MissingPeerDependency_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
71
|
+
readonly _tag: "MissingPeerDependency";
|
|
72
|
+
} & Readonly<A>;
|
|
73
|
+
/**
|
|
74
|
+
* `migrations` needs an optional peer dependency that isn't installed (or
|
|
75
|
+
* can't be loaded): `@alchemy.run/sql`, or the driver (`pg` for Postgres,
|
|
76
|
+
* `mysql2` for MySQL). The message names the package and the install line.
|
|
77
|
+
*/
|
|
78
|
+
export declare class MissingPeerDependency extends MissingPeerDependency_base<{
|
|
79
|
+
readonly message: string;
|
|
80
|
+
/** The package to install. */
|
|
81
|
+
readonly package: string;
|
|
82
|
+
/** The install command, such as `npm install pg`. */
|
|
83
|
+
readonly install: string;
|
|
84
|
+
readonly cause?: unknown;
|
|
85
|
+
}> {
|
|
86
|
+
}
|
|
87
|
+
/** How the optional peers are loaded (`import()`; tests swap it). */
|
|
88
|
+
export type ImportModule = (specifier: string) => Promise<unknown>;
|
|
89
|
+
/** The optional peers, overridable (tests simulate one that isn't installed). */
|
|
90
|
+
export declare const MigrationsPeers: Context.Reference<{
|
|
91
|
+
readonly importModule: ImportModule;
|
|
92
|
+
}>;
|
|
93
|
+
/** What a migrations run needs to know about the database it targets. */
|
|
94
|
+
export interface MigrationTarget {
|
|
95
|
+
readonly dialect: "postgres" | "mysql";
|
|
96
|
+
readonly resourceType: string;
|
|
97
|
+
/** The direct public URI with the password (`publicConnectionUri`). */
|
|
98
|
+
readonly publicConnectionUri: Redacted.Redacted<string> | undefined;
|
|
99
|
+
/** The CA (PEM) that signs the server certificate (`caCertificate`). */
|
|
100
|
+
readonly caCertificate: string | undefined;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* `@alchemy.run/sql`'s `SqlExecutor`, structurally (so its types stay out of
|
|
104
|
+
* this package's declarations): what the shared engine runs migrations on.
|
|
105
|
+
*/
|
|
106
|
+
export interface MigrationExecutor {
|
|
107
|
+
readonly dialect: "postgres" | "mysql";
|
|
108
|
+
readonly query: (sql: string, params?: ReadonlyArray<unknown>) => Effect.Effect<Array<Record<string, unknown>>, any>;
|
|
109
|
+
readonly batch: (statements: ReadonlyArray<string>) => Effect.Effect<void, any>;
|
|
110
|
+
}
|
|
111
|
+
/** Opens a connection to `target`, hands its executor to `apply`, always closes it. */
|
|
112
|
+
export interface MigrationsTransportShape {
|
|
113
|
+
readonly withExecutor: (target: MigrationTarget, apply: (executor: MigrationExecutor) => Effect.Effect<void, any, any>) => Effect.Effect<void, any, any>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The default transport: a `pg` / `mysql2` connection from the deploying
|
|
117
|
+
* machine to the instance's public URI, TLS verified against its
|
|
118
|
+
* `caCertificate` (`rejectUnauthorized`). A connect is retried a few times on
|
|
119
|
+
* a hostname or port that isn't up yet (`publicAccess` just turned on).
|
|
120
|
+
*/
|
|
121
|
+
export declare const publicEndpointTransport: (options?: {
|
|
122
|
+
readonly retries?: number;
|
|
123
|
+
readonly interval?: Duration.Input;
|
|
124
|
+
readonly importModule?: ImportModule;
|
|
125
|
+
}) => MigrationsTransportShape;
|
|
126
|
+
/**
|
|
127
|
+
* The transport migrations use. Defaults to {@link publicEndpointTransport};
|
|
128
|
+
* a layer overrides it (tests run the migrations on an in-process engine or
|
|
129
|
+
* a recording fake). Read once, when the provider layer is built.
|
|
130
|
+
*/
|
|
131
|
+
export declare const MigrationsTransport: Context.Reference<MigrationsTransportShape>;
|
|
132
|
+
export interface MigrationsSpec {
|
|
133
|
+
readonly dialect: "postgres" | "mysql";
|
|
134
|
+
}
|
|
135
|
+
/** Wrap a SQL engine's provider layer with the `migrations` prop (see the module doc). */
|
|
136
|
+
export declare const withMigrations: <R extends ResourceLike>(resource: ResourceClassLike<R>, layer: Layer.Layer<Provider.Provider<R>, never, CrudRequirements>, spec: MigrationsSpec) => Layer.Layer<Provider.Provider<R>, never, CrudRequirements>;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|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typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* `withMigrations(resource, layer, spec)` — the `migrations` prop of the SQL
|
|
11
|
+
* engines (`Cloud.Postgres`, `Cloud.MySQL`), on Alchemy's shared engine in
|
|
12
|
+
* `@alchemy.run/sql/Migrations` (the provider supplies only a `SqlExecutor`,
|
|
13
|
+
* as Alchemy's doctrine for SQL databases says: "SQL database migrations"
|
|
14
|
+
* in Alchemy's AGENTS.md).
|
|
15
|
+
*
|
|
16
|
+
* - `diff`: unchanged props, but pending files in the directory (or a moved
|
|
17
|
+
* bookkeeping table) → `update`; an edited or deleted applied file is an
|
|
18
|
+
* `update` too, whose apply then fails with `RewrittenMigrationHistoryError`
|
|
19
|
+
* (history is forward-only: never re-run, never replace the database).
|
|
20
|
+
* - `reconcile`: last, after the instance is `running` and its credentials
|
|
21
|
+
* are attributes; `runMigrations` hashes the directory, opens one
|
|
22
|
+
* connection (the {@link MigrationsTransport}), applies the pending files
|
|
23
|
+
* in order — each file's statements and its `__alchemy_migrations` row in
|
|
24
|
+
* one transaction — and the hashes land in `migrationsHashes`.
|
|
25
|
+
* - `read`/`lookup`: carry the migration attributes over from the state, so
|
|
26
|
+
* a drift check of an unchanged database is clean.
|
|
27
|
+
*
|
|
28
|
+
* `@alchemy.run/sql` (and `pg` / `mysql2`) are optional peer dependencies:
|
|
29
|
+
* they are imported only when a resource has `migrations`, so the package
|
|
30
|
+
* loads without them.
|
|
31
|
+
*
|
|
32
|
+
* Transport: the deploying machine connects over the instance's PUBLIC
|
|
33
|
+
* connection URI, TLS verified against its `caCertificate`. Nothing is opened
|
|
34
|
+
* implicitly: without `publicAccess` (or when the connection is refused, e.g.
|
|
35
|
+
* by a firewall) the deploy fails with the typed {@link MigrationsUnreachable}
|
|
36
|
+
* that says what to set. Tests swap the transport with a
|
|
37
|
+
* {@link MigrationsTransport} layer.
|
|
38
|
+
*/
|
|
39
|
+
import { Unowned } from "alchemy/AdoptPolicy";
|
|
40
|
+
import { isResolved } from "alchemy/Diff";
|
|
41
|
+
import * as Provider from "alchemy/Provider";
|
|
42
|
+
import * as Context from "effect/Context";
|
|
43
|
+
import * as Data from "effect/Data";
|
|
44
|
+
import * as Effect from "effect/Effect";
|
|
45
|
+
import * as Layer from "effect/Layer";
|
|
46
|
+
import * as Redacted from "effect/Redacted";
|
|
47
|
+
/**
|
|
48
|
+
* The migrations could not reach the database from the deploying machine.
|
|
49
|
+
* `reason`: `no-public-endpoint` — the instance has no public endpoint
|
|
50
|
+
* (`publicAccess` is off); `connection-failed` — the endpoint refused or
|
|
51
|
+
* dropped the connection (a firewall, TLS, a wrong password). The message
|
|
52
|
+
* says what to set; it never carries a secret.
|
|
53
|
+
*/
|
|
54
|
+
export class MigrationsUnreachable extends Data.TaggedError("MigrationsUnreachable") {
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `migrations` needs an optional peer dependency that isn't installed (or
|
|
58
|
+
* can't be loaded): `@alchemy.run/sql`, or the driver (`pg` for Postgres,
|
|
59
|
+
* `mysql2` for MySQL). The message names the package and the install line.
|
|
60
|
+
*/
|
|
61
|
+
export class MissingPeerDependency extends Data.TaggedError("MissingPeerDependency") {
|
|
62
|
+
}
|
|
63
|
+
/** The optional peers, overridable (tests simulate one that isn't installed). */
|
|
64
|
+
export const MigrationsPeers = Context.Reference("betterstack-alchemy/MigrationsPeers", { defaultValue: () => ({ importModule: (specifier) => import(__rewriteRelativeImportExtension(specifier)) }) });
|
|
65
|
+
const VERSIONED = { "@alchemy.run/sql": "@alchemy.run/sql@2.0.0-beta.87" };
|
|
66
|
+
/** Load `specifier` (from the optional peer `pkg`), failing with {@link MissingPeerDependency}. */
|
|
67
|
+
const loadPeer = (importModule, specifier, pkg, resourceType) => {
|
|
68
|
+
const install = `npm install ${VERSIONED[pkg] ?? pkg}`;
|
|
69
|
+
return Effect.tryPromise({
|
|
70
|
+
try: () => importModule(specifier),
|
|
71
|
+
catch: (cause) => new MissingPeerDependency({
|
|
72
|
+
package: pkg,
|
|
73
|
+
install,
|
|
74
|
+
cause,
|
|
75
|
+
message: `${resourceType}: \`migrations\` needs the optional peer dependency \`${pkg}\`, which ` +
|
|
76
|
+
`could not be loaded. Install it in your project: \`${install}\` (or \`bun add ` +
|
|
77
|
+
`${VERSIONED[pkg] ?? pkg}\`).`,
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const PORTS = { postgres: 5432, mysql: 3306 };
|
|
82
|
+
/** `text` with every occurrence of the URI's password replaced (error messages). */
|
|
83
|
+
const scrub = (text, uri) => {
|
|
84
|
+
const password = URL.canParse(uri) ? decodeURIComponent(new URL(uri).password) : "";
|
|
85
|
+
return [password, encodeURIComponent(password), uri]
|
|
86
|
+
.filter((secret) => secret.length >= 4)
|
|
87
|
+
.reduce((out, secret) => out.split(secret).join("<redacted>"), text);
|
|
88
|
+
};
|
|
89
|
+
/** A connect failure worth retrying: the public hostname or port isn't there yet. */
|
|
90
|
+
const retriable = (cause) => {
|
|
91
|
+
const code = cause?.code;
|
|
92
|
+
return code === "ENOTFOUND" || code === "EAI_AGAIN" || code === "ECONNREFUSED";
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* The default transport: a `pg` / `mysql2` connection from the deploying
|
|
96
|
+
* machine to the instance's public URI, TLS verified against its
|
|
97
|
+
* `caCertificate` (`rejectUnauthorized`). A connect is retried a few times on
|
|
98
|
+
* a hostname or port that isn't up yet (`publicAccess` just turned on).
|
|
99
|
+
*/
|
|
100
|
+
export const publicEndpointTransport = (options = {}) => ({
|
|
101
|
+
withExecutor: (target, apply) => Effect.gen(function* () {
|
|
102
|
+
const uri = target.publicConnectionUri;
|
|
103
|
+
const port = PORTS[target.dialect];
|
|
104
|
+
if (uri === undefined) {
|
|
105
|
+
return yield* new MigrationsUnreachable({
|
|
106
|
+
resourceType: target.resourceType,
|
|
107
|
+
reason: "no-public-endpoint",
|
|
108
|
+
message: `${target.resourceType}: migrations run from the deploying machine over the instance's ` +
|
|
109
|
+
`public endpoint, and it has none. Set \`publicAccess: true\` and attach a ` +
|
|
110
|
+
`\`Cloud.Firewall\` (\`firewallIds\`) with an inbound rule admitting this machine's ` +
|
|
111
|
+
`address on TCP ${port} — or leave out \`migrations\` and run them from a ` +
|
|
112
|
+
`\`Cloud.Service\` inside the instance's network.`,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const raw = Redacted.value(uri);
|
|
116
|
+
const url = new URL(raw);
|
|
117
|
+
const endpoint = `${url.hostname}:${url.port || port}`;
|
|
118
|
+
const ssl = {
|
|
119
|
+
rejectUnauthorized: true,
|
|
120
|
+
...(target.caCertificate ? { ca: target.caCertificate } : {}),
|
|
121
|
+
};
|
|
122
|
+
const importModule = options.importModule ?? ((specifier) => import(__rewriteRelativeImportExtension(specifier)));
|
|
123
|
+
const sql = yield* loadPeer(importModule, "@alchemy.run/sql/Migrations", "@alchemy.run/sql", target.resourceType);
|
|
124
|
+
// The driver: loaded here so a missing one is named, not read as a refused connection.
|
|
125
|
+
yield* loadPeer(importModule, target.dialect === "postgres" ? "pg" : "mysql2/promise", target.dialect === "postgres" ? "pg" : "mysql2", target.resourceType);
|
|
126
|
+
let connectFailed = false;
|
|
127
|
+
const connect = {
|
|
128
|
+
retryConnect: {
|
|
129
|
+
while: retriable,
|
|
130
|
+
times: options.retries ?? 6,
|
|
131
|
+
interval: options.interval ?? "5 seconds",
|
|
132
|
+
},
|
|
133
|
+
onConnectFailure: (error) => {
|
|
134
|
+
connectFailed = true;
|
|
135
|
+
return error;
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
const run = target.dialect === "postgres"
|
|
139
|
+
? Effect.gen(function* () {
|
|
140
|
+
const { stripSslQueryParams } = yield* loadPeer(importModule, "@alchemy.run/sql/PostgresDriver", "@alchemy.run/sql", target.resourceType);
|
|
141
|
+
return yield* sql.withPgExecutor({
|
|
142
|
+
connectionString: stripSslQueryParams(raw),
|
|
143
|
+
ssl,
|
|
144
|
+
connectionTimeoutMillis: 15_000,
|
|
145
|
+
}, (executor) => apply(executor), connect);
|
|
146
|
+
})
|
|
147
|
+
: sql.withMySqlExecutor({
|
|
148
|
+
host: url.hostname,
|
|
149
|
+
port: Number(url.port || port),
|
|
150
|
+
user: decodeURIComponent(url.username),
|
|
151
|
+
password: decodeURIComponent(url.password),
|
|
152
|
+
database: decodeURIComponent(url.pathname.replace(/^\//, "")) || undefined,
|
|
153
|
+
ssl,
|
|
154
|
+
connectTimeout: 15_000,
|
|
155
|
+
}, (executor) => apply(executor), connect);
|
|
156
|
+
return yield* run.pipe(Effect.mapError((error) => connectFailed
|
|
157
|
+
? new MigrationsUnreachable({
|
|
158
|
+
resourceType: target.resourceType,
|
|
159
|
+
reason: "connection-failed",
|
|
160
|
+
endpoint,
|
|
161
|
+
message: `${target.resourceType}: migrations could not connect to ${endpoint} ` +
|
|
162
|
+
`(${scrub(String(error?.message ?? error), raw)}). The deploying machine ` +
|
|
163
|
+
`needs \`publicAccess: true\` on the instance and a \`Cloud.Firewall\` rule ` +
|
|
164
|
+
`admitting its address on TCP ${port}; TLS is verified against the ` +
|
|
165
|
+
`instance's \`caCertificate\`.`,
|
|
166
|
+
})
|
|
167
|
+
: error?._tag === "MigrationError"
|
|
168
|
+
? Object.assign(error, { message: scrub(String(error.message), raw) })
|
|
169
|
+
: error));
|
|
170
|
+
}),
|
|
171
|
+
});
|
|
172
|
+
/**
|
|
173
|
+
* The transport migrations use. Defaults to {@link publicEndpointTransport};
|
|
174
|
+
* a layer overrides it (tests run the migrations on an in-process engine or
|
|
175
|
+
* a recording fake). Read once, when the provider layer is built.
|
|
176
|
+
*/
|
|
177
|
+
export const MigrationsTransport = Context.Reference("betterstack-alchemy/MigrationsTransport", { defaultValue: () => publicEndpointTransport() });
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
// The provider wrapper
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
const DEFAULT_TABLE = "__alchemy_migrations";
|
|
182
|
+
const inputOf = (props) => {
|
|
183
|
+
const migrations = props?.migrations;
|
|
184
|
+
if (migrations === undefined)
|
|
185
|
+
return undefined;
|
|
186
|
+
if (typeof migrations === "string")
|
|
187
|
+
return { dir: migrations };
|
|
188
|
+
if ("out" in migrations)
|
|
189
|
+
return { dir: migrations.out };
|
|
190
|
+
return migrations;
|
|
191
|
+
};
|
|
192
|
+
/** The migration attributes kept from the previous state (no migrations run). */
|
|
193
|
+
const carried = (input, previous) => ({
|
|
194
|
+
migrationsDir: input?.dir ?? previous?.migrationsDir,
|
|
195
|
+
migrationsTable: previous?.migrationsTable,
|
|
196
|
+
migrationsHashes: previous?.migrationsHashes ?? {},
|
|
197
|
+
});
|
|
198
|
+
/** Wrap a SQL engine's provider layer with the `migrations` prop (see the module doc). */
|
|
199
|
+
export const withMigrations = (resource, layer, spec) => {
|
|
200
|
+
const tag = Provider.Provider(resource.Type);
|
|
201
|
+
return Layer.effect(tag, Effect.gen(function* () {
|
|
202
|
+
const service = yield* tag;
|
|
203
|
+
const transport = yield* MigrationsTransport;
|
|
204
|
+
const lookup = service.lookup;
|
|
205
|
+
const { importModule } = yield* MigrationsPeers;
|
|
206
|
+
const registry = loadPeer(importModule, "@alchemy.run/sql/Migrations", "@alchemy.run/sql", resource.Type);
|
|
207
|
+
return {
|
|
208
|
+
...service,
|
|
209
|
+
diff: (input) => Effect.gen(function* () {
|
|
210
|
+
const diff = yield* service.diff(input);
|
|
211
|
+
if (diff !== undefined && diff.action !== "noop")
|
|
212
|
+
return diff;
|
|
213
|
+
if (!isResolved(input.news) || inputOf(input.news) === undefined)
|
|
214
|
+
return diff;
|
|
215
|
+
const { diffMigrations } = yield* registry;
|
|
216
|
+
const output = input.output ?? undefined;
|
|
217
|
+
const changed = yield* diffMigrations({
|
|
218
|
+
news: input.news,
|
|
219
|
+
output: output === undefined
|
|
220
|
+
? undefined
|
|
221
|
+
: {
|
|
222
|
+
migrationsTable: output.migrationsTable,
|
|
223
|
+
migrationsHashes: output.migrationsHashes ?? {},
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
// Pending (or rewritten) files update in place; never a replace.
|
|
227
|
+
return changed ? { action: "update" } : diff;
|
|
228
|
+
}),
|
|
229
|
+
reconcile: (input) => Effect.gen(function* () {
|
|
230
|
+
const attrs = yield* service.reconcile(input);
|
|
231
|
+
const migrations = inputOf(input.news);
|
|
232
|
+
const previous = input.output;
|
|
233
|
+
if (migrations === undefined)
|
|
234
|
+
return { ...attrs, ...carried(undefined, previous) };
|
|
235
|
+
const { classifyMigrationHistory, runMigrations } = yield* registry;
|
|
236
|
+
// Nothing pending against the hashes this same database recorded: no
|
|
237
|
+
// connection at all (so `publicAccess` can be turned off once migrated, and a
|
|
238
|
+
// firewall that no longer admits the deployer doesn't fail unrelated changes).
|
|
239
|
+
if (previous !== undefined &&
|
|
240
|
+
previous.id === attrs.id &&
|
|
241
|
+
previous.migrationsTable !== undefined) {
|
|
242
|
+
const change = yield* classifyMigrationHistory({
|
|
243
|
+
news: input.news,
|
|
244
|
+
output: {
|
|
245
|
+
migrationsTable: previous.migrationsTable,
|
|
246
|
+
migrationsHashes: previous.migrationsHashes ?? {},
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
if (change.kind === "none") {
|
|
250
|
+
return {
|
|
251
|
+
...attrs,
|
|
252
|
+
migrationsDir: migrations.dir,
|
|
253
|
+
migrationsTable: previous.migrationsTable,
|
|
254
|
+
migrationsHashes: previous.migrationsHashes ?? {},
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const run = yield* Effect.withSpan(runMigrations({
|
|
259
|
+
input: migrations,
|
|
260
|
+
stamped: { table: previous?.migrationsTable },
|
|
261
|
+
withExecutor: (apply) => transport.withExecutor({
|
|
262
|
+
dialect: spec.dialect,
|
|
263
|
+
resourceType: resource.Type,
|
|
264
|
+
publicConnectionUri: attrs.publicConnectionUri,
|
|
265
|
+
caCertificate: attrs.caCertificate,
|
|
266
|
+
}, apply),
|
|
267
|
+
}), "betterstack.migrations.apply", { attributes: { "migrations.dir": migrations.dir, "db.system": spec.dialect } });
|
|
268
|
+
return {
|
|
269
|
+
...attrs,
|
|
270
|
+
migrationsDir: migrations.dir,
|
|
271
|
+
migrationsTable: run.resolved.table ?? migrations.table ?? DEFAULT_TABLE,
|
|
272
|
+
migrationsHashes: run.hashes,
|
|
273
|
+
};
|
|
274
|
+
}),
|
|
275
|
+
read: (input) => Effect.gen(function* () {
|
|
276
|
+
const found = yield* service.read(input);
|
|
277
|
+
if (found === undefined)
|
|
278
|
+
return found;
|
|
279
|
+
const attrs = { ...found, ...carried(inputOf(input.olds), input.output) };
|
|
280
|
+
return Unowned.is(found) ? Unowned(attrs) : attrs;
|
|
281
|
+
}),
|
|
282
|
+
lookup: lookup === undefined
|
|
283
|
+
? undefined
|
|
284
|
+
: (input) => Effect.map(lookup(input), (found) => found === undefined ? undefined : { ...found, ...carried(undefined, undefined) }),
|
|
285
|
+
};
|
|
286
|
+
})).pipe(Layer.provide(layer));
|
|
287
|
+
};
|
|
288
|
+
//# sourceMappingURL=migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../src/internal/migrations.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM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AG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CACjF;SACV,CAAC;IACJ,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAQ,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapters over generated SDK operations that keep their input schema, so a
|
|
3
|
+
* wrapped operation can still be handed to `crud` (which reads an
|
|
4
|
+
* operation's members from that schema):
|
|
5
|
+
*
|
|
6
|
+
* - `keepInput` / `wrapOp` — any hand-written call, carrying an operation's input schema.
|
|
7
|
+
* - `withInput` — send extra members on every call (`force: true` on a delete).
|
|
8
|
+
* - `mapOutput` / `mapItems` — reshape a response, or every item of a list
|
|
9
|
+
* (a member typed as a string that the response answers as a number).
|
|
10
|
+
* - `withParent` / `listWithParent` — child resources whose responses omit the
|
|
11
|
+
* parent's id (a dashboard chart has no `dashboard_id`, a status page
|
|
12
|
+
* section no `status_page_id`): stamp the request's parent members, as
|
|
13
|
+
* strings, onto every response, so the attributes, `list` and `lookup`
|
|
14
|
+
* always carry the full key.
|
|
15
|
+
* - `withoutNulls` — an object without its `null` members.
|
|
16
|
+
*/
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Stream from "effect/Stream";
|
|
19
|
+
import type { BetterStackOpContext } from "../sdk/protocol.ts";
|
|
20
|
+
import type { Call, ListCall, Tagged } from "./crud.ts";
|
|
21
|
+
import type { HasInputSchema } from "./fields.ts";
|
|
22
|
+
type Op<I, O, E> = ((input: I) => Effect.Effect<O, E, BetterStackOpContext>) & HasInputSchema;
|
|
23
|
+
type ListOp<I, O, E> = HasInputSchema & {
|
|
24
|
+
readonly items: (input: I) => Stream.Stream<O, E, BetterStackOpContext>;
|
|
25
|
+
};
|
|
26
|
+
/** `target` carrying `source`'s input schema (a hand-written call standing in for an SDK operation). */
|
|
27
|
+
export declare const keepInput: <F extends object>(target: F, source: HasInputSchema) => F & HasInputSchema;
|
|
28
|
+
/** `call` in place of `op`, with `op`'s input schema (so `crud` derives the same members). */
|
|
29
|
+
export declare const wrapOp: <O, E extends Tagged>(op: HasInputSchema, call: (input: any) => Effect.Effect<O, E, BetterStackOpContext>) => Call<O, E>;
|
|
30
|
+
/** `op` with `extra` merged into every input (after the caller's members). */
|
|
31
|
+
export declare const withInput: <I, O, E>(op: Op<I, O, E>, extra: Partial<I>) => Op<I, O, E>;
|
|
32
|
+
/** `op` with its response passed through `f`. */
|
|
33
|
+
export declare const mapOutput: <I, O, B, E>(op: Op<I, O, E>, f: (output: O) => B) => Op<I, B, E>;
|
|
34
|
+
/** A paginated `op` with every item passed through `f`. */
|
|
35
|
+
export declare const mapItems: <I, O, B, E>(op: ListOp<I, O, E>, f: (item: O) => B) => ListOp<I, B, E>;
|
|
36
|
+
/** `op`, with the request's parent members (`dashboardId`, `sourceId`, …) added to its response. */
|
|
37
|
+
export declare const withParent: <O extends object, E extends Tagged, K extends string>(op: Call<O, E>, keys: ReadonlyArray<K>) => Call<O & { [P in K]: string; }, E>;
|
|
38
|
+
/** `list`, with the request's parent members added to every item. */
|
|
39
|
+
export declare const listWithParent: <O extends object, E extends Tagged, K extends string>(list: ListCall<O, E>, keys: ReadonlyArray<K>) => ListCall<O & { [P in K]: string; }, E>;
|
|
40
|
+
/** `item` without its `null` members (a reference's `name: null` on a plain `String` value). */
|
|
41
|
+
export declare const withoutNulls: <T extends object>(item: T) => T;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops.d.ts","sourceRoot":"","sources":["../../src/internal/ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oB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EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAChC,CAAC;AAExD,2DAA2D;AAC3D,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CACpB,CAAC;AAWzE,oGAAoG;AACpG,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,MACzE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,QACR,aAAa,CAAC,CAAC,CAAC,KACrB,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAE,EAAE,CAAC,CAGhC,CAAC;AAEJ,qEAAqE;AACrE,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,QAC3E,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,QACd,aAAa,CAAC,CAAC,CAAC,KACrB,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAE,EAAE,CAAC,CAIrC,CAAC;AAEH,gGAAgG;AAChG,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,QAAQ,CAAC,KAAG,CAC4B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapters over generated SDK operations that keep their input schema, so a
|
|
3
|
+
* wrapped operation can still be handed to `crud` (which reads an
|
|
4
|
+
* operation's members from that schema):
|
|
5
|
+
*
|
|
6
|
+
* - `keepInput` / `wrapOp` — any hand-written call, carrying an operation's input schema.
|
|
7
|
+
* - `withInput` — send extra members on every call (`force: true` on a delete).
|
|
8
|
+
* - `mapOutput` / `mapItems` — reshape a response, or every item of a list
|
|
9
|
+
* (a member typed as a string that the response answers as a number).
|
|
10
|
+
* - `withParent` / `listWithParent` — child resources whose responses omit the
|
|
11
|
+
* parent's id (a dashboard chart has no `dashboard_id`, a status page
|
|
12
|
+
* section no `status_page_id`): stamp the request's parent members, as
|
|
13
|
+
* strings, onto every response, so the attributes, `list` and `lookup`
|
|
14
|
+
* always carry the full key.
|
|
15
|
+
* - `withoutNulls` — an object without its `null` members.
|
|
16
|
+
*/
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Stream from "effect/Stream";
|
|
19
|
+
/** `target` carrying `source`'s input schema (a hand-written call standing in for an SDK operation). */
|
|
20
|
+
export const keepInput = (target, source) => Object.defineProperty(target, "input", {
|
|
21
|
+
get: () => source.input,
|
|
22
|
+
enumerable: true,
|
|
23
|
+
});
|
|
24
|
+
/** `call` in place of `op`, with `op`'s input schema (so `crud` derives the same members). */
|
|
25
|
+
export const wrapOp = (op, call) => keepInput((input) => call(input), op);
|
|
26
|
+
/** `op` with `extra` merged into every input (after the caller's members). */
|
|
27
|
+
export const withInput = (op, extra) => keepInput((input) => op({ ...input, ...extra }), op);
|
|
28
|
+
/** `op` with its response passed through `f`. */
|
|
29
|
+
export const mapOutput = (op, f) => keepInput((input) => Effect.map(op(input), f), op);
|
|
30
|
+
/** A paginated `op` with every item passed through `f`. */
|
|
31
|
+
export const mapItems = (op, f) => keepInput({ items: (input) => Stream.map(op.items(input), f) }, op);
|
|
32
|
+
/** The parent members `keys` of a request, as strings (absent ones left out). */
|
|
33
|
+
const parentOf = (input, keys) => Object.fromEntries(keys.flatMap((key) => {
|
|
34
|
+
const value = input?.[key];
|
|
35
|
+
return value === undefined || value === null ? [] : [[key, String(value)]];
|
|
36
|
+
}));
|
|
37
|
+
/** `op`, with the request's parent members (`dashboardId`, `sourceId`, …) added to its response. */
|
|
38
|
+
export const withParent = (op, keys) => wrapOp(op, (input) => Effect.map(op(input), (response) => ({ ...response, ...parentOf(input, keys) })));
|
|
39
|
+
/** `list`, with the request's parent members added to every item. */
|
|
40
|
+
export const listWithParent = (list, keys) => ({
|
|
41
|
+
input: list.input,
|
|
42
|
+
items: (input) => Stream.map(list.items(input), (item) => ({ ...item, ...parentOf(input, keys) })),
|
|
43
|
+
});
|
|
44
|
+
/** `item` without its `null` members (a reference's `name: null` on a plain `String` value). */
|
|
45
|
+
export const withoutNulls = (item) => Object.fromEntries(Object.entries(item).filter(([, value]) => value !== null));
|
|
46
|
+
//# sourceMappingURL=ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../src/internal/ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAUxC,wGAAwG;AACxG,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,MAAS,EACT,MAAsB,EACF,EAAE,CACtB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;IACrC,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK;IACvB,UAAU,EAAE,IAAI;CACjB,CAAuB,CAAC;AAE3B,8FAA8F;AAC9F,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,EAAkB,EAClB,IAA+D,EACnD,EAAE,CAAC,SAAS,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AAE5D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAU,EAAe,EAAE,KAAiB,EAAe,EAAE,CACpF,SAAS,CAAC,CAAC,KAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KA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,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CACjF,CAAC;AAEJ,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAoB,EACpB,IAAsB,EACiB,EAAE,CAAC,CAAC;IAC3C,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,KAAK,EAAE,CAAC,KAAc,EAAE,EAAE,CACxB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;CACnF,CAAC,CAAC;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAmB,IAAO,EAAK,EAAE,CAC3D,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAM,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ownership markers for Better Stack Cloud objects, the way Alchemy's Hetzner
|
|
3
|
+
* provider uses labels: every object a stack creates carries, in its
|
|
4
|
+
* `metadata` string map, one entry
|
|
5
|
+
*
|
|
6
|
+
* "alchemy": "<stack>/<stage>/<fqn>#<instance id>"
|
|
7
|
+
*
|
|
8
|
+
* (the stack name, the stage, the resource's fully-qualified logical id, and
|
|
9
|
+
* the instance id of the generation that created it — a replacement is a new
|
|
10
|
+
* generation of the same logical id, with its own marker).
|
|
11
|
+
* With it:
|
|
12
|
+
*
|
|
13
|
+
* - a create whose state was never saved (it failed or timed out after the
|
|
14
|
+
* API accepted it) is found by the next deploy's create of the same
|
|
15
|
+
* generation (same instance id), which converges it instead of creating a
|
|
16
|
+
* duplicate or colliding with its generated name;
|
|
17
|
+
* - a deploy with no state at all for a resource (a lost state store) finds
|
|
18
|
+
* an object any generation of this logical id created and adopts it;
|
|
19
|
+
* - an object that matches the props but carries another owner's marker (or
|
|
20
|
+
* none) is reported `Unowned`: it is only taken over with `--adopt`;
|
|
21
|
+
* - `list` (which backs `alchemy nuke`) returns only objects some Alchemy
|
|
22
|
+
* stack created.
|
|
23
|
+
*
|
|
24
|
+
* The marker is merged into the user's `metadata` on every write and removed
|
|
25
|
+
* from the attributes, so it never shows up in a diff and the user's own keys
|
|
26
|
+
* are untouched. It takes one of the API's 10 metadata slots.
|
|
27
|
+
*
|
|
28
|
+
* Cloud objects without `metadata` (networks, firewalls and their rules,
|
|
29
|
+
* webhooks, children of a database or cluster) fall back to their name: an
|
|
30
|
+
* object whose generated name is the one this logical id generates (names
|
|
31
|
+
* end in the resource instance's random suffix) is this stack's. That covers
|
|
32
|
+
* a create interrupted before its state was saved; it cannot recognise an
|
|
33
|
+
* object whose name was set explicitly, nor one created under another
|
|
34
|
+
* instance (a lost state store).
|
|
35
|
+
*/
|
|
36
|
+
import { Stack } from "alchemy/Stack";
|
|
37
|
+
import { Stage } from "alchemy/Stage";
|
|
38
|
+
import * as Effect from "effect/Effect";
|
|
39
|
+
/** The `metadata` key of the marker. */
|
|
40
|
+
export declare const OWNER_KEY = "alchemy";
|
|
41
|
+
/** The marker of the logical resource `fqn` of the current stack and stage (any generation). */
|
|
42
|
+
export declare const ownerOf: (fqn: string) => Effect.Effect<string, never, Stack | Stage>;
|
|
43
|
+
/** The marker of one generation (`instanceId`) of `owner` (from {@link ownerOf}). */
|
|
44
|
+
export declare const generationOf: (owner: string, instanceId: string) => string;
|
|
45
|
+
/** Whether `marker` names `owner` (from {@link ownerOf}), in any generation. */
|
|
46
|
+
export declare const belongsTo: (marker: string | undefined, owner: string) => boolean;
|
|
47
|
+
/** The marker an object carries, `undefined` when it has none. */
|
|
48
|
+
export declare const markerOf: (metadata: unknown) => string | undefined;
|
|
49
|
+
/** Whether some Alchemy stack created the object. */
|
|
50
|
+
export declare const isAlchemyOwned: (metadata: unknown) => boolean;
|
|
51
|
+
/** The user's metadata with the marker added (what is sent on create and update). */
|
|
52
|
+
export declare const withOwner: (metadata: unknown, owner: string) => Record<string, unknown>;
|
|
53
|
+
/** The metadata without the marker (what the attributes show). */
|
|
54
|
+
export declare const withoutOwner: <M>(metadata: M) => M;
|
|
55
|
+
//# sourceMappingURL=ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/internal/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,wCAAwC;AACxC,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,gGAAgG;AAChG,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAK5E,CAAC;AAEL,qFAAqF;AACrF,eAAO,MAAM,YAAY,UAAW,MAAM,cAAc,MAAM,KAAG,MAAkC,CAAC;AAEpG,gFAAgF;AAChF,eAAO,MAAM,SAAS,WAAY,MAAM,GAAG,SAAS,SAAS,MAAM,KAAG,OACQ,CAAC;AAO/E,kEAAkE;AAClE,eAAO,MAAM,QAAQ,aAAc,OAAO,KAAG,MAAM,GAAG,SAGrD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,cAAc,aAAc,OAAO,KAAG,OAA2C,CAAC;AAE/F,qFAAqF;AACrF,eAAO,MAAM,SAAS,aAAc,OAAO,SAAS,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAGjF,CAAC;AAEH,kEAAkE;AAClE,eAAO,MAAM,YAAY,GAAI,CAAC,YAAY,CAAC,KAAG,CAK7C,CAAC"}
|