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,565 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better Stack protocols -- hand-written.
|
|
3
|
+
*
|
|
4
|
+
* One protocol per API (`IncidentsProtocol`, `TelemetryProtocol`,
|
|
5
|
+
* `ErrorsProtocol`, `AccountProtocol`, `CloudProtocol`), each core's
|
|
6
|
+
* `restProtocol` underneath:
|
|
7
|
+
*
|
|
8
|
+
* request: `Authorization: Bearer <apiToken>`; base URL from
|
|
9
|
+
* `Config.endpoints[<api>]`, resolved on the calling fiber per
|
|
10
|
+
* request. Bodies are flat JSON at the root, keys snake_case on
|
|
11
|
+
* the wire (the generated schemas own the camelCase <-> snake_case
|
|
12
|
+
* mapping). When the credentials name a team (`Config.teamId`),
|
|
13
|
+
* the operation takes a `team_id` query parameter and the caller
|
|
14
|
+
* did not pass `teamId`, the team is sent as `team_id`.
|
|
15
|
+
*
|
|
16
|
+
* response: the operation's `x-response-envelope` (the generated
|
|
17
|
+
* `T.ResponseEnvelope` on its input) is unwrapped before key
|
|
18
|
+
* mapping, so a resource comes back flat as `{ id, ...attributes }`
|
|
19
|
+
* and a list as `{ data: [flat resources], pagination }`. Secrets
|
|
20
|
+
* (`x-sensitive`) come back `Redacted`. A failed response becomes
|
|
21
|
+
* the typed error for its status (see `errors.ts`), its message
|
|
22
|
+
* read from Better Stack's `errors` member.
|
|
23
|
+
*
|
|
24
|
+
* Cloud: the endpoint is a template (`https://{availability_zone}.betterstackcloud.com`).
|
|
25
|
+
* Every Cloud operation's input has an optional `availabilityZone` (convert
|
|
26
|
+
* adds it from the spec's server variable); the protocol puts the call's
|
|
27
|
+
* zone, else the credentials' `availabilityZone`, into the host (checked to
|
|
28
|
+
* be one DNS label) and never sends it as a member. A Cloud call with neither
|
|
29
|
+
* fails with `InvalidInput`.
|
|
30
|
+
*/
|
|
31
|
+
import { InvalidInput } from "@distilled.cloud/core/errors";
|
|
32
|
+
import { setOwnKey } from "@distilled.cloud/core/plain-values";
|
|
33
|
+
import type { ErrorOf, Operation, Protocol, ProtocolOf } from "@distilled.cloud/core/protocol";
|
|
34
|
+
import type { DecodeArgs, EncodeArgs } from "@distilled.cloud/core/protocol";
|
|
35
|
+
import { getAnn, getProps, isHostLabel } from "@distilled.cloud/core/protocol-http";
|
|
36
|
+
import {
|
|
37
|
+
restProtocolMethods,
|
|
38
|
+
type RestErrorEnvelope,
|
|
39
|
+
unknownErrorProps,
|
|
40
|
+
} from "@distilled.cloud/core/protocol-rest";
|
|
41
|
+
import * as Effect from "effect/Effect";
|
|
42
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
43
|
+
import * as HttpClientError from "effect/http/HttpClientError";
|
|
44
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
45
|
+
import * as Redacted from "effect/Redacted";
|
|
46
|
+
import type * as AST from "effect/SchemaAST";
|
|
47
|
+
import {
|
|
48
|
+
Credentials,
|
|
49
|
+
IngestCredentials,
|
|
50
|
+
type Config,
|
|
51
|
+
type Endpoints,
|
|
52
|
+
type IngestConfig,
|
|
53
|
+
} from "./credentials.ts";
|
|
54
|
+
import {
|
|
55
|
+
BetterStackParseError,
|
|
56
|
+
UnknownBetterStackError,
|
|
57
|
+
type BetterStackServiceError,
|
|
58
|
+
type IngestServiceError,
|
|
59
|
+
} from "./errors.ts";
|
|
60
|
+
import { responseEnvelopeSymbol, type ResponseEnvelopeTrait } from "./traits.ts";
|
|
61
|
+
|
|
62
|
+
/** Context (requirements) shared by every generated Better Stack operation. */
|
|
63
|
+
export type BetterStackOpContext = Credentials | HttpClient.HttpClient;
|
|
64
|
+
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Errors
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
|
|
69
|
+
/** Better Stack's `errors` member as one line: a string, a list, or messages by attribute. */
|
|
70
|
+
export const errorMessageOf = (errors: unknown): string | undefined => {
|
|
71
|
+
if (typeof errors === "string") return errors;
|
|
72
|
+
if (Array.isArray(errors)) {
|
|
73
|
+
const parts = errors.map(errorMessageOf).filter((s): s is string => s !== undefined);
|
|
74
|
+
return parts.length > 0 ? parts.join("; ") : undefined;
|
|
75
|
+
}
|
|
76
|
+
if (errors !== null && typeof errors === "object") {
|
|
77
|
+
const parts = Object.entries(errors as Record<string, unknown>).flatMap(([key, value]) => {
|
|
78
|
+
const text = errorMessageOf(value);
|
|
79
|
+
return text === undefined ? [] : [key === "base" ? text : `${key}: ${text}`];
|
|
80
|
+
});
|
|
81
|
+
return parts.length > 0 ? parts.join("; ") : undefined;
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const codeOf = (value: unknown): string | number | undefined =>
|
|
87
|
+
typeof value === "string" || typeof value === "number" ? value : undefined;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The message and code of a failed response: `{ errors }` (Incidents,
|
|
91
|
+
* Telemetry, Errors, Account), `{ error: { message, code, details } }`
|
|
92
|
+
* (Cloud), else the common `{ message | error, code }`.
|
|
93
|
+
*/
|
|
94
|
+
export const errorEnvelope = (body: unknown): RestErrorEnvelope | undefined => {
|
|
95
|
+
if (body === null || typeof body !== "object") return undefined;
|
|
96
|
+
const b = body as Record<string, unknown>;
|
|
97
|
+
const nested =
|
|
98
|
+
b.error !== null && typeof b.error === "object" && !Array.isArray(b.error)
|
|
99
|
+
? (b.error as Record<string, unknown>)
|
|
100
|
+
: undefined;
|
|
101
|
+
const message =
|
|
102
|
+
errorMessageOf(b.errors) ??
|
|
103
|
+
(typeof b.message === "string" ? b.message : undefined) ??
|
|
104
|
+
(typeof nested?.message === "string" ? nested.message : undefined) ??
|
|
105
|
+
errorMessageOf(b.error);
|
|
106
|
+
// Cloud's `payment_required` says "Open this link to pay" and carries the
|
|
107
|
+
// link in `error.first_purchase`, not in the message: without it the
|
|
108
|
+
// message cannot be acted on.
|
|
109
|
+
const purchase = firstPurchaseOf(nested?.first_purchase);
|
|
110
|
+
return {
|
|
111
|
+
code: codeOf(b.code) ?? codeOf(nested?.code),
|
|
112
|
+
message: message !== undefined && purchase !== undefined ? `${message} ${purchase}` : message,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** `value` when it is an `http(s)` URL. */
|
|
117
|
+
const linkOf = (value: unknown): string | undefined => {
|
|
118
|
+
if (typeof value !== "string") return undefined;
|
|
119
|
+
const parsed = URL.parse(value);
|
|
120
|
+
return parsed !== null && (parsed.protocol === "https:" || parsed.protocol === "http:")
|
|
121
|
+
? value
|
|
122
|
+
: undefined;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The first-payment link of a Cloud `payment_required` error: the URL itself, or a URL
|
|
127
|
+
* under a recognised key. Anything else is left out of the message (never dumped).
|
|
128
|
+
*/
|
|
129
|
+
const firstPurchaseOf = (value: unknown): string | undefined => {
|
|
130
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return linkOf(value);
|
|
131
|
+
const record = value as Record<string, unknown>;
|
|
132
|
+
for (const key of ["url", "link", "checkout_url", "payment_url"]) {
|
|
133
|
+
const link = linkOf(record[key]);
|
|
134
|
+
if (link !== undefined) return link;
|
|
135
|
+
}
|
|
136
|
+
return undefined;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
// Response envelope
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
|
|
143
|
+
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
144
|
+
value !== null && typeof value === "object" && !Array.isArray(value);
|
|
145
|
+
|
|
146
|
+
const getIn = (value: unknown, path: readonly string[]): unknown => {
|
|
147
|
+
let current = value;
|
|
148
|
+
for (const key of path) {
|
|
149
|
+
if (!isRecord(current)) return undefined;
|
|
150
|
+
current = current[key];
|
|
151
|
+
}
|
|
152
|
+
return current;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/** `{ id, type, attributes, relationships }` -> `{ id, ...attributes, relationships }`. */
|
|
156
|
+
const flattenResource = (resource: unknown, envelope: ResponseEnvelopeTrait): unknown => {
|
|
157
|
+
if (envelope.attributes.length === 0 || !isRecord(resource)) return resource;
|
|
158
|
+
const attributes = getIn(resource, envelope.attributes);
|
|
159
|
+
if (!isRecord(attributes)) return resource;
|
|
160
|
+
const out: Record<string, unknown> = {};
|
|
161
|
+
for (const [key, value] of Object.entries(attributes)) setOwnKey(out, key, value);
|
|
162
|
+
if (envelope.id !== undefined && envelope.id.length > 0) {
|
|
163
|
+
const id = getIn(resource, envelope.id);
|
|
164
|
+
if (id !== undefined) setOwnKey(out, envelope.id[envelope.id.length - 1]!, id);
|
|
165
|
+
}
|
|
166
|
+
if (resource.relationships !== undefined && !("relationships" in out)) {
|
|
167
|
+
out.relationships = resource.relationships;
|
|
168
|
+
}
|
|
169
|
+
return out;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/** Replace the value at `path` in a copy of `body`. */
|
|
173
|
+
const replaceIn = (body: unknown, path: readonly string[], value: unknown): unknown => {
|
|
174
|
+
if (path.length === 0) return value;
|
|
175
|
+
if (!isRecord(body)) return body;
|
|
176
|
+
const [head, ...rest] = path;
|
|
177
|
+
const out: Record<string, unknown> = {};
|
|
178
|
+
for (const [key, v] of Object.entries(body)) setOwnKey(out, key, v);
|
|
179
|
+
setOwnKey(out, head!, replaceIn(body[head!], rest, value));
|
|
180
|
+
return out;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/** One JSON:API resource (`{ id?, type?, attributes: {...} }`) where a list was expected. */
|
|
184
|
+
const isSingleResource = (found: unknown, envelope: ResponseEnvelopeTrait): boolean =>
|
|
185
|
+
isRecord(found) && envelope.attributes.length > 0 && isRecord(getIn(found, envelope.attributes));
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Unwrap a 2xx body by the operation's envelope. A body that does not have
|
|
189
|
+
* the documented shape (an empty 204, an error-free oddity) is returned as
|
|
190
|
+
* the wire sent it: strict response validation reports it, lenient mode
|
|
191
|
+
* passes it through.
|
|
192
|
+
*/
|
|
193
|
+
export const unwrapEnvelope =
|
|
194
|
+
(envelope: ResponseEnvelopeTrait) =>
|
|
195
|
+
(body: unknown): unknown => {
|
|
196
|
+
const found = getIn(body, envelope.path);
|
|
197
|
+
if (envelope.kind === "list") {
|
|
198
|
+
// A list filtered down to one match can answer a single resource
|
|
199
|
+
// document (`GET /api/v3/team-members?email=...` answers
|
|
200
|
+
// `{ data: { id, type, attributes } }`): read it as a one-item list.
|
|
201
|
+
if (isSingleResource(found, envelope)) {
|
|
202
|
+
return replaceIn(body, envelope.path, [flattenResource(found, envelope)]);
|
|
203
|
+
}
|
|
204
|
+
if (!Array.isArray(found)) return body;
|
|
205
|
+
return replaceIn(
|
|
206
|
+
body,
|
|
207
|
+
envelope.path,
|
|
208
|
+
found.map((resource) => flattenResource(resource, envelope)),
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
if (found === undefined) return body;
|
|
212
|
+
return flattenResource(found, envelope);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const envelopeOf = (inputAst: AST.AST | undefined): ResponseEnvelopeTrait | undefined =>
|
|
216
|
+
inputAst === undefined
|
|
217
|
+
? undefined
|
|
218
|
+
: (getAnn(inputAst, responseEnvelopeSymbol) as ResponseEnvelopeTrait | undefined);
|
|
219
|
+
|
|
220
|
+
// ---------------------------------------------------------------------------
|
|
221
|
+
// Team selection
|
|
222
|
+
// ---------------------------------------------------------------------------
|
|
223
|
+
|
|
224
|
+
/** Input member names per input schema, read once. */
|
|
225
|
+
const memberNames = new WeakMap<AST.AST, ReadonlySet<string>>();
|
|
226
|
+
const membersOf = (inputAst: AST.AST): ReadonlySet<string> => {
|
|
227
|
+
let names = memberNames.get(inputAst);
|
|
228
|
+
if (names === undefined) {
|
|
229
|
+
names = new Set(getProps(inputAst).map((prop) => String(prop.name)));
|
|
230
|
+
memberNames.set(inputAst, names);
|
|
231
|
+
}
|
|
232
|
+
return names;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The input with the credentials' team as `teamId`, when the operation takes
|
|
237
|
+
* one and the caller did not choose a team.
|
|
238
|
+
*/
|
|
239
|
+
export const withTeam = (config: Config, inputAst: AST.AST, input: unknown): unknown => {
|
|
240
|
+
if (config.teamId === undefined || config.teamId === "") return input;
|
|
241
|
+
if (!membersOf(inputAst).has("teamId")) return input;
|
|
242
|
+
const record = (input ?? {}) as Record<string, unknown>;
|
|
243
|
+
if (record.teamId !== undefined) return input;
|
|
244
|
+
return { ...record, teamId: config.teamId };
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// ---------------------------------------------------------------------------
|
|
248
|
+
// Protocols
|
|
249
|
+
// ---------------------------------------------------------------------------
|
|
250
|
+
|
|
251
|
+
/** The input member carrying a Cloud operation's availability zone. */
|
|
252
|
+
export const AVAILABILITY_ZONE_MEMBER = "availabilityZone";
|
|
253
|
+
const AVAILABILITY_ZONE_PLACEHOLDER = "{availability_zone}";
|
|
254
|
+
|
|
255
|
+
const restFor = (
|
|
256
|
+
baseUrl: (config: Config) => string,
|
|
257
|
+
envelope: ResponseEnvelopeTrait | undefined,
|
|
258
|
+
) =>
|
|
259
|
+
restProtocolMethods({
|
|
260
|
+
credentials: Credentials,
|
|
261
|
+
baseUrl,
|
|
262
|
+
headers: (config: Config) => ({
|
|
263
|
+
Authorization: `Bearer ${Redacted.value(config.apiToken)}`,
|
|
264
|
+
Accept: "application/json",
|
|
265
|
+
}),
|
|
266
|
+
errorEnvelope,
|
|
267
|
+
...(envelope === undefined ? {} : { transformResponse: unwrapEnvelope(envelope) }),
|
|
268
|
+
unknownError: (info) => new UnknownBetterStackError(unknownErrorProps(info)),
|
|
269
|
+
parseError: ({ body, cause }) => new BetterStackParseError({ body, cause }),
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
type RestMethods = ReturnType<typeof restFor>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* A typed error an operation declares carries `code`, which core fills from
|
|
276
|
+
* the body's numeric error code, or `0` when the body has none -- and Better
|
|
277
|
+
* Stack's bodies never have one. Put the HTTP status there instead, so a 422
|
|
278
|
+
* reads `code: 422` rather than `0`. Errors without a `code` field (core's
|
|
279
|
+
* status classes) and errors with a real code are left as they are.
|
|
280
|
+
*/
|
|
281
|
+
export const withStatusCode = <A, E, R>(
|
|
282
|
+
effect: Effect.Effect<A, E, R>,
|
|
283
|
+
): Effect.Effect<A, E, R | HttpClient.HttpClient> =>
|
|
284
|
+
Effect.suspend(() => {
|
|
285
|
+
let status: number | undefined;
|
|
286
|
+
return effect.pipe(
|
|
287
|
+
Effect.mapError((error) => statusCoded(error, status)),
|
|
288
|
+
Effect.updateService(HttpClient.HttpClient, (client) =>
|
|
289
|
+
HttpClient.tap(client, (response) =>
|
|
290
|
+
Effect.sync(() => {
|
|
291
|
+
status = response.status;
|
|
292
|
+
}),
|
|
293
|
+
),
|
|
294
|
+
),
|
|
295
|
+
);
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
const statusCoded = <E>(error: E, status: number | undefined): E => {
|
|
299
|
+
if (status === undefined || status < 400) return error;
|
|
300
|
+
if (error === null || typeof error !== "object") return error;
|
|
301
|
+
// Cast: `E` is an unconstrained error class; its own members are read generically.
|
|
302
|
+
const record = error as unknown as Record<string, unknown>;
|
|
303
|
+
if (record.code !== 0 || !Object.hasOwn(record, "code")) return error;
|
|
304
|
+
const Class = (error as { constructor: new (props: Record<string, unknown>) => E }).constructor;
|
|
305
|
+
const props: Record<string, unknown> = {};
|
|
306
|
+
for (const key of Object.keys(record)) props[key] = record[key];
|
|
307
|
+
// `message` lives on the Error, not as an own enumerable key.
|
|
308
|
+
props.message = record.message;
|
|
309
|
+
props.code = status;
|
|
310
|
+
try {
|
|
311
|
+
return new Class(props);
|
|
312
|
+
} catch {
|
|
313
|
+
// A class that refuses the props keeps the original error.
|
|
314
|
+
return error;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The protocol of one API. `hostFor` picks the base URL from the
|
|
320
|
+
* credentials and the (team-resolved) input; it fails for an input that
|
|
321
|
+
* cannot address a host.
|
|
322
|
+
*/
|
|
323
|
+
const makeProtocol = (
|
|
324
|
+
baseUrlFor: (config: Config, input: Record<string, unknown>) => string | InvalidInput,
|
|
325
|
+
consumes: ReadonlyArray<string>,
|
|
326
|
+
) => {
|
|
327
|
+
/** One REST protocol per (base URL, envelope): built on first use. */
|
|
328
|
+
const cache = new Map<string, RestMethods>();
|
|
329
|
+
const restOf = (baseUrl: string, envelope: ResponseEnvelopeTrait | undefined): RestMethods => {
|
|
330
|
+
const key = `${baseUrl} ${envelope === undefined ? "" : JSON.stringify(envelope)}`;
|
|
331
|
+
let rest = cache.get(key);
|
|
332
|
+
if (rest === undefined) {
|
|
333
|
+
rest = restFor(() => baseUrl, envelope);
|
|
334
|
+
cache.set(key, rest);
|
|
335
|
+
}
|
|
336
|
+
return rest;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
/** Team injection + host choice, then `f` on the REST protocol and the input it sends. */
|
|
340
|
+
const prepare = <A, E, R>(
|
|
341
|
+
inputAst: AST.AST,
|
|
342
|
+
input: unknown,
|
|
343
|
+
f: (rest: RestMethods, input: unknown) => Effect.Effect<A, E, R>,
|
|
344
|
+
): Effect.Effect<A, E | InvalidInput, R | Credentials> =>
|
|
345
|
+
Effect.flatMap(Effect.flatten(Credentials), (config): Effect.Effect<A, E | InvalidInput, R> => {
|
|
346
|
+
const teamed = withTeam(config, inputAst, input) as Record<string, unknown>;
|
|
347
|
+
const baseUrl = baseUrlFor(config, teamed ?? {});
|
|
348
|
+
if (typeof baseUrl !== "string") return Effect.fail(baseUrl);
|
|
349
|
+
let sent: unknown = teamed;
|
|
350
|
+
if (consumes.length > 0 && teamed !== undefined) {
|
|
351
|
+
const copy: Record<string, unknown> = { ...teamed };
|
|
352
|
+
for (const key of consumes) delete copy[key];
|
|
353
|
+
sent = copy;
|
|
354
|
+
}
|
|
355
|
+
return f(restOf(baseUrl, envelopeOf(inputAst)), sent);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
const methods = {
|
|
359
|
+
encode: (args: EncodeArgs) =>
|
|
360
|
+
prepare(args.inputAst, args.input, (rest, input) => rest.encode({ ...args, input })),
|
|
361
|
+
decode: (args: DecodeArgs) =>
|
|
362
|
+
// `decode` alone has no input to choose a host from; the envelope is
|
|
363
|
+
// all it needs, and any REST protocol decodes the same way.
|
|
364
|
+
restOf("", envelopeOf(args.config.input?.ast)).decode(args),
|
|
365
|
+
call: (op: Operation, input: unknown) =>
|
|
366
|
+
withStatusCode(prepare(op.inputAst, input, (rest, sent) => rest.call!(op, sent))),
|
|
367
|
+
} satisfies Protocol<unknown, unknown>;
|
|
368
|
+
return methods;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
const fixedEndpoint = (api: Exclude<keyof Endpoints, "cloud">) => (config: Config) =>
|
|
372
|
+
config.endpoints[api];
|
|
373
|
+
|
|
374
|
+
/** The Cloud host for an input: the endpoint template with its availability zone. */
|
|
375
|
+
const cloudEndpoint = (config: Config, input: Record<string, unknown>): string | InvalidInput => {
|
|
376
|
+
const template = config.endpoints.cloud;
|
|
377
|
+
if (!template.includes(AVAILABILITY_ZONE_PLACEHOLDER)) return template;
|
|
378
|
+
// The call's zone wins over the credentials' default.
|
|
379
|
+
const given = input[AVAILABILITY_ZONE_MEMBER];
|
|
380
|
+
const zone = given === undefined || given === "" ? config.availabilityZone : given;
|
|
381
|
+
if (typeof zone !== "string" || zone === "") {
|
|
382
|
+
return new InvalidInput({
|
|
383
|
+
member: AVAILABILITY_ZONE_MEMBER,
|
|
384
|
+
message:
|
|
385
|
+
"Better Stack Cloud operations need an availabilityZone: pass one, or set it on the credentials",
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
if (!isHostLabel(zone)) {
|
|
389
|
+
return new InvalidInput({
|
|
390
|
+
member: AVAILABILITY_ZONE_MEMBER,
|
|
391
|
+
message: `availabilityZone must be one DNS label, got ${JSON.stringify(zone)}`,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
return template.split(AVAILABILITY_ZONE_PLACEHOLDER).join(zone);
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const incidents = /*@__PURE__*/ makeProtocol(fixedEndpoint("incidents"), []);
|
|
398
|
+
const telemetry = /*@__PURE__*/ makeProtocol(fixedEndpoint("telemetry"), []);
|
|
399
|
+
const errors = /*@__PURE__*/ makeProtocol(fixedEndpoint("errors"), []);
|
|
400
|
+
const account = /*@__PURE__*/ makeProtocol(fixedEndpoint("account"), []);
|
|
401
|
+
const cloud = /*@__PURE__*/ makeProtocol(cloudEndpoint, [AVAILABILITY_ZONE_MEMBER]);
|
|
402
|
+
|
|
403
|
+
export const IncidentsProtocol: ProtocolOf<typeof incidents> = incidents;
|
|
404
|
+
export const TelemetryProtocol: ProtocolOf<typeof telemetry> = telemetry;
|
|
405
|
+
export const ErrorsProtocol: ProtocolOf<typeof errors> = errors;
|
|
406
|
+
export const AccountProtocol: ProtocolOf<typeof account> = account;
|
|
407
|
+
export const CloudProtocol: ProtocolOf<typeof cloud> = cloud;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* What every generated Better Stack operation fails with besides its own
|
|
411
|
+
* errors: the errors declared on the service and the errors the protocol
|
|
412
|
+
* declares (the parse error, the unknown-error fallback, `InvalidInput`,
|
|
413
|
+
* `SdkError`, transport errors). Nobody lists the protocol's: its type
|
|
414
|
+
* carries them.
|
|
415
|
+
*/
|
|
416
|
+
export type BetterStackOpError = BetterStackServiceError | ErrorOf<typeof IncidentsProtocol>;
|
|
417
|
+
|
|
418
|
+
// ---------------------------------------------------------------------------
|
|
419
|
+
// Data plane
|
|
420
|
+
// ---------------------------------------------------------------------------
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* The ingest protocol (`services/ingest.ts`): logs, metrics and OTLP sent to
|
|
424
|
+
* a source's ingesting host with the source's token,
|
|
425
|
+
* `Authorization: Bearer <source token>` (https://betterstack.com/docs/logs/ingesting-data/http/logs/).
|
|
426
|
+
* No JSON:API envelope and no team; a success is `202` with an empty body
|
|
427
|
+
* (OTLP: `200` with a JSON body). Failures are plain text (`Unauthorized`,
|
|
428
|
+
* `Quota exceeded`, ...), which becomes the error's `message`; an invalid
|
|
429
|
+
* token is a 403 (`Forbidden`).
|
|
430
|
+
*/
|
|
431
|
+
const ingest = /*@__PURE__*/ restProtocolMethods({
|
|
432
|
+
credentials: IngestCredentials,
|
|
433
|
+
baseUrl: (config: IngestConfig) => config.endpoint,
|
|
434
|
+
headers: (config: IngestConfig) => ({
|
|
435
|
+
Authorization: `Bearer ${Redacted.value(config.token)}`,
|
|
436
|
+
}),
|
|
437
|
+
errorEnvelope,
|
|
438
|
+
unknownError: (info) => new UnknownBetterStackError(unknownErrorProps(info)),
|
|
439
|
+
parseError: ({ body, cause }) => new BetterStackParseError({ body, cause }),
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
export const IngestProtocol: ProtocolOf<typeof ingest> = ingest;
|
|
443
|
+
|
|
444
|
+
/** Context (requirements) of every ingest operation. */
|
|
445
|
+
export type IngestOpContext = IngestCredentials | HttpClient.HttpClient;
|
|
446
|
+
|
|
447
|
+
/** What every ingest operation fails with besides its own errors. */
|
|
448
|
+
export type IngestOpError = IngestServiceError | ErrorOf<typeof IngestProtocol>;
|
|
449
|
+
|
|
450
|
+
/** The input member carrying a heartbeat's own URL. */
|
|
451
|
+
export const HEARTBEAT_URL_MEMBER = "url";
|
|
452
|
+
|
|
453
|
+
/** The heartbeat URL of an input: an `http(s)` URL, without a trailing slash. */
|
|
454
|
+
const heartbeatUrl = (input: Record<string, unknown>): string | InvalidInput => {
|
|
455
|
+
const raw = input[HEARTBEAT_URL_MEMBER];
|
|
456
|
+
const value = Redacted.isRedacted(raw) ? Redacted.value(raw as Redacted.Redacted<string>) : raw;
|
|
457
|
+
const parsed = typeof value === "string" ? URL.parse(value) : null;
|
|
458
|
+
if (parsed === null || (parsed.protocol !== "https:" && parsed.protocol !== "http:")) {
|
|
459
|
+
// Never echo the value: it holds the heartbeat's secret token.
|
|
460
|
+
return new InvalidInput({
|
|
461
|
+
member: HEARTBEAT_URL_MEMBER,
|
|
462
|
+
message: "url must be the heartbeat's URL (https://.../api/v1/heartbeat/<token>)",
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
return `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}`;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
const heartbeatRest = (baseUrl: string) =>
|
|
469
|
+
restProtocolMethods({
|
|
470
|
+
credentials: Effect.succeed({}),
|
|
471
|
+
baseUrl: () => baseUrl,
|
|
472
|
+
headers: () => ({}),
|
|
473
|
+
errorEnvelope,
|
|
474
|
+
unknownError: (info) => new UnknownBetterStackError(unknownErrorProps(info)),
|
|
475
|
+
parseError: ({ body, cause }) => new BetterStackParseError({ body, cause }),
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The heartbeat protocol (`services/heartbeat.ts`): a request to the
|
|
480
|
+
* heartbeat's own secret URL, which the input carries as `url` (a heartbeat's
|
|
481
|
+
* `url` from the Incidents API) -- no credentials, no API token. The URL is
|
|
482
|
+
* the base of the request and is never sent as a member; `send_heartbeat`
|
|
483
|
+
* (path `/`) goes to the URL exactly, without a trailing slash.
|
|
484
|
+
* https://betterstack.com/docs/uptime/cron-and-heartbeat-monitor/
|
|
485
|
+
*/
|
|
486
|
+
const heartbeatPrepare = <A, E, R>(
|
|
487
|
+
input: unknown,
|
|
488
|
+
f: (
|
|
489
|
+
rest: ReturnType<typeof heartbeatRest>,
|
|
490
|
+
sent: unknown,
|
|
491
|
+
base: string,
|
|
492
|
+
) => Effect.Effect<A, E, R>,
|
|
493
|
+
): Effect.Effect<A, E | InvalidInput, R> => {
|
|
494
|
+
const record = (input ?? {}) as Record<string, unknown>;
|
|
495
|
+
const base = heartbeatUrl(record);
|
|
496
|
+
if (typeof base !== "string") return Effect.fail(base);
|
|
497
|
+
const { [HEARTBEAT_URL_MEMBER]: _url, ...sent } = record;
|
|
498
|
+
return f(heartbeatRest(base), sent, base);
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* The request as the heartbeat endpoint takes it: `<base>/` -> `<base>` (the
|
|
503
|
+
* ping is the heartbeat URL itself), and a raw output body sent as
|
|
504
|
+
* `text/plain` (it is the job's output) rather than core's
|
|
505
|
+
* `application/octet-stream` for raw bodies.
|
|
506
|
+
*/
|
|
507
|
+
const heartbeatRequest = (base: string) => (request: HttpClientRequest.HttpClientRequest) => {
|
|
508
|
+
const exact = request.url === `${base}/` ? HttpClientRequest.setUrl(request, base) : request;
|
|
509
|
+
return exact.body._tag === "Uint8Array" || exact.body._tag === "Raw"
|
|
510
|
+
? HttpClientRequest.setHeader(exact, "content-type", "text/plain; charset=utf-8")
|
|
511
|
+
: exact;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
const exactUrl = (base: string) =>
|
|
515
|
+
Effect.updateService(HttpClient.HttpClient, (client: HttpClient.HttpClient) =>
|
|
516
|
+
HttpClient.mapRequest(client, heartbeatRequest(base)),
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* A failed heartbeat request without the heartbeat's URL path: the token in it is the
|
|
521
|
+
* heartbeat's whole credential, and transport errors print the request URL (and keep it,
|
|
522
|
+
* and the platform's own error, as their cause). The request keeps its method and origin,
|
|
523
|
+
* the path becomes `/REDACTED`; the cause is dropped and the description scrubbed.
|
|
524
|
+
* Failures with a response never get here (the REST layer turns statuses into typed errors).
|
|
525
|
+
*/
|
|
526
|
+
const withoutHeartbeatPath =
|
|
527
|
+
(base: string) =>
|
|
528
|
+
<E>(error: E): E | HttpClientError.HttpClientError => {
|
|
529
|
+
if (!HttpClientError.isHttpClientError(error) || "response" in error.reason) return error;
|
|
530
|
+
const reason = error.reason;
|
|
531
|
+
const origin = URL.parse(base)?.origin ?? "";
|
|
532
|
+
const props = {
|
|
533
|
+
request: HttpClientRequest.setUrl(reason.request, `${origin}/REDACTED`),
|
|
534
|
+
...(reason.description !== undefined
|
|
535
|
+
? { description: reason.description.split(base).join(`${origin}/REDACTED`) }
|
|
536
|
+
: {}),
|
|
537
|
+
};
|
|
538
|
+
const redacted =
|
|
539
|
+
reason._tag === "EncodeError"
|
|
540
|
+
? new HttpClientError.EncodeError(props)
|
|
541
|
+
: reason._tag === "InvalidUrlError"
|
|
542
|
+
? new HttpClientError.InvalidUrlError(props)
|
|
543
|
+
: new HttpClientError.TransportError(props);
|
|
544
|
+
return new HttpClientError.HttpClientError({ reason: redacted });
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
const heartbeat = {
|
|
548
|
+
encode: (args: EncodeArgs) =>
|
|
549
|
+
heartbeatPrepare(args.input, (rest, input, base) =>
|
|
550
|
+
Effect.map(rest.encode({ ...args, input }), heartbeatRequest(base)),
|
|
551
|
+
),
|
|
552
|
+
decode: (args: DecodeArgs) => heartbeatRest("").decode(args),
|
|
553
|
+
call: (op: Operation, input: unknown) =>
|
|
554
|
+
heartbeatPrepare(input, (rest, sent, base) =>
|
|
555
|
+
rest.call!(op, sent).pipe(exactUrl(base), Effect.mapError(withoutHeartbeatPath(base))),
|
|
556
|
+
),
|
|
557
|
+
} satisfies Protocol<unknown, unknown>;
|
|
558
|
+
|
|
559
|
+
export const HeartbeatProtocol: ProtocolOf<typeof heartbeat> = heartbeat;
|
|
560
|
+
|
|
561
|
+
/** Context (requirements) of every heartbeat operation: only an HTTP client. */
|
|
562
|
+
export type HeartbeatOpContext = HttpClient.HttpClient;
|
|
563
|
+
|
|
564
|
+
/** What every heartbeat operation fails with besides its own errors. */
|
|
565
|
+
export type HeartbeatOpError = BetterStackServiceError | ErrorOf<typeof HeartbeatProtocol>;
|
package/src/sdk/retry.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Policy, throttlingFactory, transientFactory } from "@distilled.cloud/core/retry";
|
|
2
|
+
/**
|
|
3
|
+
* Better Stack retry configuration.
|
|
4
|
+
*
|
|
5
|
+
* Defines the per-SDK `Retry` Context.Service tag that generated operations
|
|
6
|
+
* wire into `API.make`. Callers can install a blanket retry policy at the
|
|
7
|
+
* layer level and have every Better Stack API call below it pick it up:
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import * as BetterStack from "betterstack-alchemy/sdk/index";
|
|
12
|
+
*
|
|
13
|
+
* myEffect.pipe(BetterStack.Retry.transient);
|
|
14
|
+
* Effect.provide(myEffect, Layer.succeed(BetterStack.Retry.Retry, customPolicy));
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import * as Context from "effect/Context";
|
|
18
|
+
import * as Effect from "effect/Effect";
|
|
19
|
+
import * as Layer from "effect/Layer";
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
type Options,
|
|
23
|
+
type Factory,
|
|
24
|
+
type Policy,
|
|
25
|
+
makeDefault,
|
|
26
|
+
jittered,
|
|
27
|
+
capped,
|
|
28
|
+
throttlingOptions,
|
|
29
|
+
transientOptions,
|
|
30
|
+
throttlingFactory,
|
|
31
|
+
transientFactory,
|
|
32
|
+
} from "@distilled.cloud/core/retry";
|
|
33
|
+
|
|
34
|
+
/** Context tag for configuring retry behavior of Better Stack API calls. */
|
|
35
|
+
export class Retry extends /*@__PURE__*/ Context.Service<Retry, Policy>()("BetterStackRetry") {}
|
|
36
|
+
|
|
37
|
+
/** Provides a custom retry policy to every Better Stack API call below it. */
|
|
38
|
+
export const policy = (optionsOrFactory: Policy) =>
|
|
39
|
+
Effect.provide(Layer.succeed(Retry, optionsOrFactory));
|
|
40
|
+
|
|
41
|
+
/** Disables all automatic retries. */
|
|
42
|
+
export const none = /*@__PURE__*/ Effect.provide(
|
|
43
|
+
/*@__PURE__*/ Layer.succeed(Retry, { while: () => false }),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
/** Apply the throttling retry policy (retries throttling errors indefinitely). */
|
|
47
|
+
export const throttling = /*@__PURE__*/ policy(throttlingFactory);
|
|
48
|
+
|
|
49
|
+
/** Apply the transient retry policy (retries all transient errors indefinitely). */
|
|
50
|
+
export const transient = /*@__PURE__*/ policy(transientFactory);
|