@alienplatform/core 1.14.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (747) hide show
  1. package/dist/index.d.ts +467 -339
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6930 -4
  4. package/dist/index.js.map +1 -1
  5. package/package.json +4 -5
  6. package/.turbo/turbo-build.log +0 -29
  7. package/AGENTS.md +0 -90
  8. package/dist/stack.js +0 -6847
  9. package/dist/stack.js.map +0 -1
  10. package/dist/tests/index.d.ts +0 -48
  11. package/dist/tests/index.d.ts.map +0 -1
  12. package/dist/tests/index.js +0 -9
  13. package/dist/tests/index.js.map +0 -1
  14. package/kubb.config.ts +0 -44
  15. package/src/__tests__/__snapshots__/stack.test.ts.snap +0 -354
  16. package/src/__tests__/error.test.ts +0 -672
  17. package/src/__tests__/stack.test.ts +0 -537
  18. package/src/artifact-registry.ts +0 -64
  19. package/src/build.ts +0 -105
  20. package/src/common-errors.ts +0 -55
  21. package/src/compute-cluster.ts +0 -213
  22. package/src/container.ts +0 -423
  23. package/src/daemon.ts +0 -259
  24. package/src/error.ts +0 -665
  25. package/src/generated/index.ts +0 -706
  26. package/src/generated/schemas/agentStatus.json +0 -1
  27. package/src/generated/schemas/alienError.json +0 -1
  28. package/src/generated/schemas/alienEvent.json +0 -1
  29. package/src/generated/schemas/architecture.json +0 -1
  30. package/src/generated/schemas/artifactRegistry.json +0 -1
  31. package/src/generated/schemas/artifactRegistryHeartbeatData.json +0 -1
  32. package/src/generated/schemas/artifactRegistryHeartbeatStatus.json +0 -1
  33. package/src/generated/schemas/artifactRegistryOutputs.json +0 -1
  34. package/src/generated/schemas/auroraPostgresHeartbeatData.json +0 -1
  35. package/src/generated/schemas/awsArtifactRegistryImportData.json +0 -1
  36. package/src/generated/schemas/awsBuildImportData.json +0 -1
  37. package/src/generated/schemas/awsCodeBuildHeartbeatData.json +0 -1
  38. package/src/generated/schemas/awsComputeClusterHeartbeatData.json +0 -1
  39. package/src/generated/schemas/awsComputeClusterImportData.json +0 -1
  40. package/src/generated/schemas/awsCustomCertificateConfig.json +0 -1
  41. package/src/generated/schemas/awsDaemonHeartbeatData.json +0 -1
  42. package/src/generated/schemas/awsDynamoDbKeySchemaElement.json +0 -1
  43. package/src/generated/schemas/awsDynamoDbKvHeartbeatData.json +0 -1
  44. package/src/generated/schemas/awsEcrArtifactRegistryHeartbeatData.json +0 -1
  45. package/src/generated/schemas/awsEcrRepositoryHeartbeatData.json +0 -1
  46. package/src/generated/schemas/awsIamRoleServiceAccountHeartbeatData.json +0 -1
  47. package/src/generated/schemas/awsKvImportData.json +0 -1
  48. package/src/generated/schemas/awsLambdaWorkerHeartbeatData.json +0 -1
  49. package/src/generated/schemas/awsManagementConfig.json +0 -1
  50. package/src/generated/schemas/awsNetworkImportData.json +0 -1
  51. package/src/generated/schemas/awsParameterStoreVaultHeartbeatData.json +0 -1
  52. package/src/generated/schemas/awsPermissionEffect.json +0 -1
  53. package/src/generated/schemas/awsPlatformPermission.json +0 -1
  54. package/src/generated/schemas/awsPostgresImportData.json +0 -1
  55. package/src/generated/schemas/awsQueueImportData.json +0 -1
  56. package/src/generated/schemas/awsRemoteStackManagementHeartbeatData.json +0 -1
  57. package/src/generated/schemas/awsRemoteStackManagementImportData.json +0 -1
  58. package/src/generated/schemas/awsS3StorageHeartbeatData.json +0 -1
  59. package/src/generated/schemas/awsServiceAccountImportData.json +0 -1
  60. package/src/generated/schemas/awsSqsQueueHeartbeatData.json +0 -1
  61. package/src/generated/schemas/awsStorageImportData.json +0 -1
  62. package/src/generated/schemas/awsVaultImportData.json +0 -1
  63. package/src/generated/schemas/awsVpcNetworkHeartbeatData.json +0 -1
  64. package/src/generated/schemas/awsWorkerImportData.json +0 -1
  65. package/src/generated/schemas/azureArtifactRegistryImportData.json +0 -1
  66. package/src/generated/schemas/azureBlobStorageHeartbeatData.json +0 -1
  67. package/src/generated/schemas/azureBuildImportData.json +0 -1
  68. package/src/generated/schemas/azureComputeClusterHeartbeatData.json +0 -1
  69. package/src/generated/schemas/azureComputeClusterImportData.json +0 -1
  70. package/src/generated/schemas/azureContainerAppsBuildHeartbeatData.json +0 -1
  71. package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatData.json +0 -1
  72. package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatStatus.json +0 -1
  73. package/src/generated/schemas/azureContainerAppsEnvironmentImportData.json +0 -1
  74. package/src/generated/schemas/azureContainerAppsEnvironmentWorkloadProfile.json +0 -1
  75. package/src/generated/schemas/azureContainerAppsWorkerHeartbeatData.json +0 -1
  76. package/src/generated/schemas/azureContainerRegistryHeartbeatData.json +0 -1
  77. package/src/generated/schemas/azureCustomCertificateConfig.json +0 -1
  78. package/src/generated/schemas/azureDaemonHeartbeatData.json +0 -1
  79. package/src/generated/schemas/azureFlexibleServerPostgresHeartbeatData.json +0 -1
  80. package/src/generated/schemas/azureFlexibleServerPostgresImportData.json +0 -1
  81. package/src/generated/schemas/azureKeyVaultHeartbeatData.json +0 -1
  82. package/src/generated/schemas/azureKvImportData.json +0 -1
  83. package/src/generated/schemas/azureManagedIdentityServiceAccountHeartbeatData.json +0 -1
  84. package/src/generated/schemas/azureManagementConfig.json +0 -1
  85. package/src/generated/schemas/azureNetworkImportData.json +0 -1
  86. package/src/generated/schemas/azurePlatformPermission.json +0 -1
  87. package/src/generated/schemas/azureQueueImportData.json +0 -1
  88. package/src/generated/schemas/azureRemoteStackManagementHeartbeatData.json +0 -1
  89. package/src/generated/schemas/azureRemoteStackManagementImportData.json +0 -1
  90. package/src/generated/schemas/azureResourceGroupHeartbeatData.json +0 -1
  91. package/src/generated/schemas/azureResourceGroupHeartbeatStatus.json +0 -1
  92. package/src/generated/schemas/azureResourceGroupImportData.json +0 -1
  93. package/src/generated/schemas/azureResourceProviderActivationHeartbeatData.json +0 -1
  94. package/src/generated/schemas/azureServiceAccountImportData.json +0 -1
  95. package/src/generated/schemas/azureServiceActivationImportData.json +0 -1
  96. package/src/generated/schemas/azureServiceBusNamespaceHeartbeatData.json +0 -1
  97. package/src/generated/schemas/azureServiceBusNamespaceImportData.json +0 -1
  98. package/src/generated/schemas/azureServiceBusQueueHeartbeatData.json +0 -1
  99. package/src/generated/schemas/azureStorageAccountEndpoints.json +0 -1
  100. package/src/generated/schemas/azureStorageAccountHeartbeatData.json +0 -1
  101. package/src/generated/schemas/azureStorageAccountImportData.json +0 -1
  102. package/src/generated/schemas/azureStorageImportData.json +0 -1
  103. package/src/generated/schemas/azureTableKvHeartbeatData.json +0 -1
  104. package/src/generated/schemas/azureVaultImportData.json +0 -1
  105. package/src/generated/schemas/azureVnetNetworkHeartbeatData.json +0 -1
  106. package/src/generated/schemas/azureWorkerImportData.json +0 -1
  107. package/src/generated/schemas/baseResource.json +0 -1
  108. package/src/generated/schemas/baseResourceOutputs.json +0 -1
  109. package/src/generated/schemas/bindingConfigurationAwsBindingSpec.json +0 -1
  110. package/src/generated/schemas/bindingConfigurationAzureBindingSpec.json +0 -1
  111. package/src/generated/schemas/bindingConfigurationGcpBindingSpec.json +0 -1
  112. package/src/generated/schemas/bodySpec.json +0 -1
  113. package/src/generated/schemas/build.json +0 -1
  114. package/src/generated/schemas/buildConfig.json +0 -1
  115. package/src/generated/schemas/buildHeartbeatData.json +0 -1
  116. package/src/generated/schemas/buildHeartbeatStatus.json +0 -1
  117. package/src/generated/schemas/buildOutputs.json +0 -1
  118. package/src/generated/schemas/buildStatus.json +0 -1
  119. package/src/generated/schemas/capacityGroup.json +0 -1
  120. package/src/generated/schemas/capacityGroupScalePolicy.json +0 -1
  121. package/src/generated/schemas/commandResponse.json +0 -1
  122. package/src/generated/schemas/commandState.json +0 -1
  123. package/src/generated/schemas/commandStatusResponse.json +0 -1
  124. package/src/generated/schemas/computeCapacityBlocker.json +0 -1
  125. package/src/generated/schemas/computeCapacityBlockerCategory.json +0 -1
  126. package/src/generated/schemas/computeCapacityGroupStatus.json +0 -1
  127. package/src/generated/schemas/computeCapacityRecommendation.json +0 -1
  128. package/src/generated/schemas/computeChoiceRange.json +0 -1
  129. package/src/generated/schemas/computeCluster.json +0 -1
  130. package/src/generated/schemas/computeClusterHeartbeatData.json +0 -1
  131. package/src/generated/schemas/computeClusterHeartbeatStatus.json +0 -1
  132. package/src/generated/schemas/computeDrainBlocker.json +0 -1
  133. package/src/generated/schemas/computeDrainProgress.json +0 -1
  134. package/src/generated/schemas/computeDrainProgressStatus.json +0 -1
  135. package/src/generated/schemas/computePoolSelection.json +0 -1
  136. package/src/generated/schemas/computeSettings.json +0 -1
  137. package/src/generated/schemas/computeType.json +0 -1
  138. package/src/generated/schemas/container.json +0 -1
  139. package/src/generated/schemas/containerAutoscaling.json +0 -1
  140. package/src/generated/schemas/containerCode.json +0 -1
  141. package/src/generated/schemas/containerGpuSpec.json +0 -1
  142. package/src/generated/schemas/containerHeartbeatData.json +0 -1
  143. package/src/generated/schemas/containerOutputs.json +0 -1
  144. package/src/generated/schemas/containerPort.json +0 -1
  145. package/src/generated/schemas/containerStatus.json +0 -1
  146. package/src/generated/schemas/createCommandRequest.json +0 -1
  147. package/src/generated/schemas/createCommandResponse.json +0 -1
  148. package/src/generated/schemas/customCertificateConfig.json +0 -1
  149. package/src/generated/schemas/customDomainConfig.json +0 -1
  150. package/src/generated/schemas/daemon.json +0 -1
  151. package/src/generated/schemas/daemonCode.json +0 -1
  152. package/src/generated/schemas/daemonHeartbeatData.json +0 -1
  153. package/src/generated/schemas/daemonOutputs.json +0 -1
  154. package/src/generated/schemas/daemonRuntime.json +0 -1
  155. package/src/generated/schemas/daemonRuntimeMount.json +0 -1
  156. package/src/generated/schemas/deploymentModel.json +0 -1
  157. package/src/generated/schemas/deploymentStatus.json +0 -1
  158. package/src/generated/schemas/devResourceInfo.json +0 -1
  159. package/src/generated/schemas/devStatus.json +0 -1
  160. package/src/generated/schemas/devStatusState.json +0 -1
  161. package/src/generated/schemas/domainSettings.json +0 -1
  162. package/src/generated/schemas/envelope.json +0 -1
  163. package/src/generated/schemas/eventChange.json +0 -1
  164. package/src/generated/schemas/eventState.json +0 -1
  165. package/src/generated/schemas/exposeProtocol.json +0 -1
  166. package/src/generated/schemas/gcpArtifactRegistryHeartbeatData.json +0 -1
  167. package/src/generated/schemas/gcpArtifactRegistryImportData.json +0 -1
  168. package/src/generated/schemas/gcpBuildImportData.json +0 -1
  169. package/src/generated/schemas/gcpCloudBuildHeartbeatData.json +0 -1
  170. package/src/generated/schemas/gcpCloudRunWorkerHeartbeatData.json +0 -1
  171. package/src/generated/schemas/gcpCloudSqlPostgresHeartbeatData.json +0 -1
  172. package/src/generated/schemas/gcpCloudStorageHeartbeatData.json +0 -1
  173. package/src/generated/schemas/gcpComputeClusterHeartbeatData.json +0 -1
  174. package/src/generated/schemas/gcpComputeClusterImportData.json +0 -1
  175. package/src/generated/schemas/gcpCondition.json +0 -1
  176. package/src/generated/schemas/gcpCustomCertificateConfig.json +0 -1
  177. package/src/generated/schemas/gcpDaemonHeartbeatData.json +0 -1
  178. package/src/generated/schemas/gcpFirestoreKvHeartbeatData.json +0 -1
  179. package/src/generated/schemas/gcpKvImportData.json +0 -1
  180. package/src/generated/schemas/gcpManagementConfig.json +0 -1
  181. package/src/generated/schemas/gcpNetworkImportData.json +0 -1
  182. package/src/generated/schemas/gcpPlatformPermission.json +0 -1
  183. package/src/generated/schemas/gcpPostgresImportData.json +0 -1
  184. package/src/generated/schemas/gcpPubSubQueueHeartbeatData.json +0 -1
  185. package/src/generated/schemas/gcpQueueImportData.json +0 -1
  186. package/src/generated/schemas/gcpRemoteStackManagementHeartbeatData.json +0 -1
  187. package/src/generated/schemas/gcpRemoteStackManagementImportData.json +0 -1
  188. package/src/generated/schemas/gcpSecretManagerVaultHeartbeatData.json +0 -1
  189. package/src/generated/schemas/gcpServiceAccountHeartbeatData.json +0 -1
  190. package/src/generated/schemas/gcpServiceAccountImportData.json +0 -1
  191. package/src/generated/schemas/gcpServiceActivationImportData.json +0 -1
  192. package/src/generated/schemas/gcpServiceUsageActivationHeartbeatData.json +0 -1
  193. package/src/generated/schemas/gcpStorageImportData.json +0 -1
  194. package/src/generated/schemas/gcpVaultImportData.json +0 -1
  195. package/src/generated/schemas/gcpVpcNetworkHeartbeatData.json +0 -1
  196. package/src/generated/schemas/gcpWorkerImportData.json +0 -1
  197. package/src/generated/schemas/gpuSpec.json +0 -1
  198. package/src/generated/schemas/healthCheck.json +0 -1
  199. package/src/generated/schemas/heartbeatBackend.json +0 -1
  200. package/src/generated/schemas/heartbeatCollectionIssue.json +0 -1
  201. package/src/generated/schemas/heartbeatCollectionIssueReason.json +0 -1
  202. package/src/generated/schemas/heartbeatIssueSeverity.json +0 -1
  203. package/src/generated/schemas/heartbeatsMode.json +0 -1
  204. package/src/generated/schemas/horizonContainerHeartbeatData.json +0 -1
  205. package/src/generated/schemas/horizonWorkloadSchedulingMode.json +0 -1
  206. package/src/generated/schemas/httpMethod.json +0 -1
  207. package/src/generated/schemas/importSourceKind.json +0 -1
  208. package/src/generated/schemas/importedResource.json +0 -1
  209. package/src/generated/schemas/kubernetesBuildHeartbeatData.json +0 -1
  210. package/src/generated/schemas/kubernetesCertificateMode.json +0 -1
  211. package/src/generated/schemas/kubernetesCloudReference.json +0 -1
  212. package/src/generated/schemas/kubernetesClusterHeartbeatData.json +0 -1
  213. package/src/generated/schemas/kubernetesClusterNodeStatus.json +0 -1
  214. package/src/generated/schemas/kubernetesClusterOwnership.json +0 -1
  215. package/src/generated/schemas/kubernetesClusterSettings.json +0 -1
  216. package/src/generated/schemas/kubernetesContainerHeartbeatData.json +0 -1
  217. package/src/generated/schemas/kubernetesCustomCertificateConfig.json +0 -1
  218. package/src/generated/schemas/kubernetesDaemonHeartbeatData.json +0 -1
  219. package/src/generated/schemas/kubernetesEventInvolvedObject.json +0 -1
  220. package/src/generated/schemas/kubernetesEventSnapshot.json +0 -1
  221. package/src/generated/schemas/kubernetesEventSource.json +0 -1
  222. package/src/generated/schemas/kubernetesExposureSettings.json +0 -1
  223. package/src/generated/schemas/kubernetesGatewayRouteProfile.json +0 -1
  224. package/src/generated/schemas/kubernetesIngressRouteProfile.json +0 -1
  225. package/src/generated/schemas/kubernetesNodeConditionStatus.json +0 -1
  226. package/src/generated/schemas/kubernetesNodeResources.json +0 -1
  227. package/src/generated/schemas/kubernetesNodeUsage.json +0 -1
  228. package/src/generated/schemas/kubernetesOwnerReference.json +0 -1
  229. package/src/generated/schemas/kubernetesPodRuntimeUnitStatus.json +0 -1
  230. package/src/generated/schemas/kubernetesRouteProfile.json +0 -1
  231. package/src/generated/schemas/kubernetesRouteProviderOptions.json +0 -1
  232. package/src/generated/schemas/kubernetesSecretVaultHeartbeatData.json +0 -1
  233. package/src/generated/schemas/kubernetesSettings.json +0 -1
  234. package/src/generated/schemas/kubernetesTlsSecretRef.json +0 -1
  235. package/src/generated/schemas/kubernetesWorkerHeartbeatData.json +0 -1
  236. package/src/generated/schemas/kubernetesWorkloadCondition.json +0 -1
  237. package/src/generated/schemas/kubernetesWorkloadKind.json +0 -1
  238. package/src/generated/schemas/kubernetesWorkloadStatus.json +0 -1
  239. package/src/generated/schemas/kv.json +0 -1
  240. package/src/generated/schemas/kvHeartbeatData.json +0 -1
  241. package/src/generated/schemas/kvHeartbeatStatus.json +0 -1
  242. package/src/generated/schemas/kvOutputs.json +0 -1
  243. package/src/generated/schemas/leaseInfo.json +0 -1
  244. package/src/generated/schemas/leaseRequest.json +0 -1
  245. package/src/generated/schemas/leaseResponse.json +0 -1
  246. package/src/generated/schemas/lifecycleRule.json +0 -1
  247. package/src/generated/schemas/loadBalancerEndpoint.json +0 -1
  248. package/src/generated/schemas/localArtifactRegistryHeartbeatData.json +0 -1
  249. package/src/generated/schemas/localComputeClusterHeartbeatData.json +0 -1
  250. package/src/generated/schemas/localContainerHeartbeatData.json +0 -1
  251. package/src/generated/schemas/localDaemonHeartbeatData.json +0 -1
  252. package/src/generated/schemas/localKvHeartbeatData.json +0 -1
  253. package/src/generated/schemas/localOperation.json +0 -1
  254. package/src/generated/schemas/localPostgresHeartbeatData.json +0 -1
  255. package/src/generated/schemas/localQueueHeartbeatData.json +0 -1
  256. package/src/generated/schemas/localRuntimeEventSnapshot.json +0 -1
  257. package/src/generated/schemas/localRuntimeEventSubject.json +0 -1
  258. package/src/generated/schemas/localRuntimeUnitKind.json +0 -1
  259. package/src/generated/schemas/localRuntimeUnitStatus.json +0 -1
  260. package/src/generated/schemas/localServiceAccountHeartbeatData.json +0 -1
  261. package/src/generated/schemas/localStorageHeartbeatData.json +0 -1
  262. package/src/generated/schemas/localVaultHeartbeatData.json +0 -1
  263. package/src/generated/schemas/localWorkerHeartbeatData.json +0 -1
  264. package/src/generated/schemas/machineProfile.json +0 -1
  265. package/src/generated/schemas/machinesComputeClusterHeartbeatData.json +0 -1
  266. package/src/generated/schemas/machinesComputeMachineStatus.json +0 -1
  267. package/src/generated/schemas/machinesDaemonHeartbeatData.json +0 -1
  268. package/src/generated/schemas/managedRuntimeEventInvolvedObject.json +0 -1
  269. package/src/generated/schemas/managedRuntimeEventSnapshot.json +0 -1
  270. package/src/generated/schemas/managedRuntimeEventSource.json +0 -1
  271. package/src/generated/schemas/managedRuntimeUnitStatus.json +0 -1
  272. package/src/generated/schemas/managementConfig.json +0 -1
  273. package/src/generated/schemas/managementPermissions.json +0 -1
  274. package/src/generated/schemas/messagePayload.json +0 -1
  275. package/src/generated/schemas/metricSample.json +0 -1
  276. package/src/generated/schemas/metricUnit.json +0 -1
  277. package/src/generated/schemas/monitoringConfig.json +0 -1
  278. package/src/generated/schemas/networkHeartbeatData.json +0 -1
  279. package/src/generated/schemas/networkHeartbeatStatus.json +0 -1
  280. package/src/generated/schemas/networkSettings.json +0 -1
  281. package/src/generated/schemas/observedCounts.json +0 -1
  282. package/src/generated/schemas/observedHealth.json +0 -1
  283. package/src/generated/schemas/observedInventoryBatch.json +0 -1
  284. package/src/generated/schemas/observedResourceSample.json +0 -1
  285. package/src/generated/schemas/permissionGrant.json +0 -1
  286. package/src/generated/schemas/permissionProfile.json +0 -1
  287. package/src/generated/schemas/permissionSet.json +0 -1
  288. package/src/generated/schemas/permissionSetReference.json +0 -1
  289. package/src/generated/schemas/permissionsConfig.json +0 -1
  290. package/src/generated/schemas/persistentStorage.json +0 -1
  291. package/src/generated/schemas/platform.json +0 -1
  292. package/src/generated/schemas/platformPermissions.json +0 -1
  293. package/src/generated/schemas/postgres.json +0 -1
  294. package/src/generated/schemas/postgresBackend.json +0 -1
  295. package/src/generated/schemas/postgresHeartbeatData.json +0 -1
  296. package/src/generated/schemas/postgresHeartbeatStatus.json +0 -1
  297. package/src/generated/schemas/postgresOutputs.json +0 -1
  298. package/src/generated/schemas/presignedOperation.json +0 -1
  299. package/src/generated/schemas/presignedRequest.json +0 -1
  300. package/src/generated/schemas/presignedRequestBackend.json +0 -1
  301. package/src/generated/schemas/providerFleetStatus.json +0 -1
  302. package/src/generated/schemas/providerLifecycleState.json +0 -1
  303. package/src/generated/schemas/publicEndpoint.json +0 -1
  304. package/src/generated/schemas/publicEndpointOutput.json +0 -1
  305. package/src/generated/schemas/publicEndpointTargetSettings.json +0 -1
  306. package/src/generated/schemas/pushProgress.json +0 -1
  307. package/src/generated/schemas/queue.json +0 -1
  308. package/src/generated/schemas/queueHeartbeatData.json +0 -1
  309. package/src/generated/schemas/queueHeartbeatStatus.json +0 -1
  310. package/src/generated/schemas/queueMessage.json +0 -1
  311. package/src/generated/schemas/queueOutputs.json +0 -1
  312. package/src/generated/schemas/rawHeartbeatSnippet.json +0 -1
  313. package/src/generated/schemas/rawHeartbeatSnippetFormat.json +0 -1
  314. package/src/generated/schemas/readinessProbe.json +0 -1
  315. package/src/generated/schemas/releaseRequest.json +0 -1
  316. package/src/generated/schemas/remoteStackManagement.json +0 -1
  317. package/src/generated/schemas/remoteStackManagementHeartbeatData.json +0 -1
  318. package/src/generated/schemas/remoteStackManagementHeartbeatStatus.json +0 -1
  319. package/src/generated/schemas/remoteStackManagementOutputs.json +0 -1
  320. package/src/generated/schemas/replicaStatus.json +0 -1
  321. package/src/generated/schemas/resourceEntry.json +0 -1
  322. package/src/generated/schemas/resourceHeartbeat.json +0 -1
  323. package/src/generated/schemas/resourceHeartbeatData.json +0 -1
  324. package/src/generated/schemas/resourceLifecycle.json +0 -1
  325. package/src/generated/schemas/resourceRef.json +0 -1
  326. package/src/generated/schemas/resourceSpec.json +0 -1
  327. package/src/generated/schemas/resourceStatus.json +0 -1
  328. package/src/generated/schemas/resourceType.json +0 -1
  329. package/src/generated/schemas/responseHandling.json +0 -1
  330. package/src/generated/schemas/scheduledEvent.json +0 -1
  331. package/src/generated/schemas/serviceAccount.json +0 -1
  332. package/src/generated/schemas/serviceAccountHeartbeatData.json +0 -1
  333. package/src/generated/schemas/serviceAccountHeartbeatStatus.json +0 -1
  334. package/src/generated/schemas/serviceAccountOutputs.json +0 -1
  335. package/src/generated/schemas/serviceActivationHeartbeatData.json +0 -1
  336. package/src/generated/schemas/serviceActivationHeartbeatStatus.json +0 -1
  337. package/src/generated/schemas/stack.json +0 -1
  338. package/src/generated/schemas/stackImportRequest.json +0 -1
  339. package/src/generated/schemas/stackImportResponse.json +0 -1
  340. package/src/generated/schemas/stackInputDefaultValue.json +0 -1
  341. package/src/generated/schemas/stackInputDefinition.json +0 -1
  342. package/src/generated/schemas/stackInputEnvironmentMapping.json +0 -1
  343. package/src/generated/schemas/stackInputEnvironmentVariableType.json +0 -1
  344. package/src/generated/schemas/stackInputKind.json +0 -1
  345. package/src/generated/schemas/stackInputProvider.json +0 -1
  346. package/src/generated/schemas/stackInputValidation.json +0 -1
  347. package/src/generated/schemas/stackRef.json +0 -1
  348. package/src/generated/schemas/stackResourceState.json +0 -1
  349. package/src/generated/schemas/stackSettings.json +0 -1
  350. package/src/generated/schemas/stackState.json +0 -1
  351. package/src/generated/schemas/stackStatus.json +0 -1
  352. package/src/generated/schemas/storage.json +0 -1
  353. package/src/generated/schemas/storageEvent.json +0 -1
  354. package/src/generated/schemas/storageEventType.json +0 -1
  355. package/src/generated/schemas/storageEvents.json +0 -1
  356. package/src/generated/schemas/storageHeartbeatData.json +0 -1
  357. package/src/generated/schemas/storageHeartbeatStatus.json +0 -1
  358. package/src/generated/schemas/storageOutputs.json +0 -1
  359. package/src/generated/schemas/storageUpload.json +0 -1
  360. package/src/generated/schemas/submitResponseRequest.json +0 -1
  361. package/src/generated/schemas/telemetryMode.json +0 -1
  362. package/src/generated/schemas/toolchainConfig.json +0 -1
  363. package/src/generated/schemas/updatesMode.json +0 -1
  364. package/src/generated/schemas/uploadCompleteRequest.json +0 -1
  365. package/src/generated/schemas/uploadCompleteResponse.json +0 -1
  366. package/src/generated/schemas/value.json +0 -1
  367. package/src/generated/schemas/vault.json +0 -1
  368. package/src/generated/schemas/vaultHeartbeatData.json +0 -1
  369. package/src/generated/schemas/vaultHeartbeatStatus.json +0 -1
  370. package/src/generated/schemas/vaultOutputs.json +0 -1
  371. package/src/generated/schemas/worker.json +0 -1
  372. package/src/generated/schemas/workerCode.json +0 -1
  373. package/src/generated/schemas/workerHeartbeatData.json +0 -1
  374. package/src/generated/schemas/workerOutputs.json +0 -1
  375. package/src/generated/schemas/workerPublicEndpoint.json +0 -1
  376. package/src/generated/schemas/workerTrigger.json +0 -1
  377. package/src/generated/schemas/workloadHeartbeatStatus.json +0 -1
  378. package/src/generated/schemas/workloadReplicaStatus.json +0 -1
  379. package/src/generated/zod/agent-status-schema.ts +0 -30
  380. package/src/generated/zod/alien-error-schema.ts +0 -22
  381. package/src/generated/zod/alien-event-schema.ts +0 -127
  382. package/src/generated/zod/architecture-schema.ts +0 -13
  383. package/src/generated/zod/artifact-registry-heartbeat-data-schema.ts +0 -22
  384. package/src/generated/zod/artifact-registry-heartbeat-status-schema.ts +0 -26
  385. package/src/generated/zod/artifact-registry-outputs-schema.ts +0 -18
  386. package/src/generated/zod/artifact-registry-schema.ts +0 -16
  387. package/src/generated/zod/aurora-postgres-heartbeat-data-schema.ts +0 -20
  388. package/src/generated/zod/aws-artifact-registry-import-data-schema.ts +0 -21
  389. package/src/generated/zod/aws-build-import-data-schema.ts +0 -19
  390. package/src/generated/zod/aws-code-build-heartbeat-data-schema.ts +0 -35
  391. package/src/generated/zod/aws-compute-cluster-heartbeat-data-schema.ts +0 -37
  392. package/src/generated/zod/aws-compute-cluster-import-data-schema.ts +0 -17
  393. package/src/generated/zod/aws-custom-certificate-config-schema.ts +0 -12
  394. package/src/generated/zod/aws-daemon-heartbeat-data-schema.ts +0 -35
  395. package/src/generated/zod/aws-dynamo-db-key-schema-element-schema.ts +0 -13
  396. package/src/generated/zod/aws-dynamo-db-kv-heartbeat-data-schema.ts +0 -38
  397. package/src/generated/zod/aws-ecr-artifact-registry-heartbeat-data-schema.ts +0 -27
  398. package/src/generated/zod/aws-ecr-repository-heartbeat-data-schema.ts +0 -20
  399. package/src/generated/zod/aws-iam-role-service-account-heartbeat-data-schema.ts +0 -34
  400. package/src/generated/zod/aws-kv-import-data-schema.ts +0 -16
  401. package/src/generated/zod/aws-lambda-worker-heartbeat-data-schema.ts +0 -34
  402. package/src/generated/zod/aws-management-config-schema.ts +0 -15
  403. package/src/generated/zod/aws-network-import-data-schema.ts +0 -26
  404. package/src/generated/zod/aws-parameter-store-vault-heartbeat-data-schema.ts +0 -27
  405. package/src/generated/zod/aws-permission-effect-schema.ts +0 -10
  406. package/src/generated/zod/aws-platform-permission-schema.ts +0 -28
  407. package/src/generated/zod/aws-postgres-import-data-schema.ts +0 -23
  408. package/src/generated/zod/aws-queue-import-data-schema.ts +0 -17
  409. package/src/generated/zod/aws-remote-stack-management-heartbeat-data-schema.ts +0 -18
  410. package/src/generated/zod/aws-remote-stack-management-import-data-schema.ts +0 -17
  411. package/src/generated/zod/aws-s3-storage-heartbeat-data-schema.ts +0 -31
  412. package/src/generated/zod/aws-service-account-import-data-schema.ts +0 -17
  413. package/src/generated/zod/aws-sqs-queue-heartbeat-data-schema.ts +0 -38
  414. package/src/generated/zod/aws-storage-import-data-schema.ts +0 -16
  415. package/src/generated/zod/aws-vault-import-data-schema.ts +0 -17
  416. package/src/generated/zod/aws-vpc-network-heartbeat-data-schema.ts +0 -26
  417. package/src/generated/zod/aws-worker-import-data-schema.ts +0 -25
  418. package/src/generated/zod/azure-artifact-registry-import-data-schema.ts +0 -20
  419. package/src/generated/zod/azure-blob-storage-heartbeat-data-schema.ts +0 -43
  420. package/src/generated/zod/azure-build-import-data-schema.ts +0 -21
  421. package/src/generated/zod/azure-compute-cluster-heartbeat-data-schema.ts +0 -37
  422. package/src/generated/zod/azure-compute-cluster-import-data-schema.ts +0 -17
  423. package/src/generated/zod/azure-container-apps-build-heartbeat-data-schema.ts +0 -20
  424. package/src/generated/zod/azure-container-apps-environment-heartbeat-data-schema.ts +0 -32
  425. package/src/generated/zod/azure-container-apps-environment-heartbeat-status-schema.ts +0 -26
  426. package/src/generated/zod/azure-container-apps-environment-import-data-schema.ts +0 -20
  427. package/src/generated/zod/azure-container-apps-environment-workload-profile-schema.ts +0 -15
  428. package/src/generated/zod/azure-container-apps-worker-heartbeat-data-schema.ts +0 -25
  429. package/src/generated/zod/azure-container-registry-heartbeat-data-schema.ts +0 -41
  430. package/src/generated/zod/azure-custom-certificate-config-schema.ts +0 -13
  431. package/src/generated/zod/azure-daemon-heartbeat-data-schema.ts +0 -35
  432. package/src/generated/zod/azure-flexible-server-postgres-heartbeat-data-schema.ts +0 -18
  433. package/src/generated/zod/azure-flexible-server-postgres-import-data-schema.ts +0 -25
  434. package/src/generated/zod/azure-key-vault-heartbeat-data-schema.ts +0 -31
  435. package/src/generated/zod/azure-kv-import-data-schema.ts +0 -19
  436. package/src/generated/zod/azure-managed-identity-service-account-heartbeat-data-schema.ts +0 -30
  437. package/src/generated/zod/azure-management-config-schema.ts +0 -17
  438. package/src/generated/zod/azure-network-import-data-schema.ts +0 -25
  439. package/src/generated/zod/azure-platform-permission-schema.ts +0 -24
  440. package/src/generated/zod/azure-queue-import-data-schema.ts +0 -18
  441. package/src/generated/zod/azure-remote-stack-management-heartbeat-data-schema.ts +0 -22
  442. package/src/generated/zod/azure-remote-stack-management-import-data-schema.ts +0 -21
  443. package/src/generated/zod/azure-resource-group-heartbeat-data-schema.ts +0 -22
  444. package/src/generated/zod/azure-resource-group-heartbeat-status-schema.ts +0 -26
  445. package/src/generated/zod/azure-resource-group-import-data-schema.ts +0 -17
  446. package/src/generated/zod/azure-resource-provider-activation-heartbeat-data-schema.ts +0 -21
  447. package/src/generated/zod/azure-service-account-import-data-schema.ts +0 -20
  448. package/src/generated/zod/azure-service-activation-import-data-schema.ts +0 -17
  449. package/src/generated/zod/azure-service-bus-namespace-heartbeat-data-schema.ts +0 -34
  450. package/src/generated/zod/azure-service-bus-namespace-import-data-schema.ts +0 -18
  451. package/src/generated/zod/azure-service-bus-queue-heartbeat-data-schema.ts +0 -46
  452. package/src/generated/zod/azure-storage-account-endpoints-schema.ts +0 -17
  453. package/src/generated/zod/azure-storage-account-heartbeat-data-schema.ts +0 -42
  454. package/src/generated/zod/azure-storage-account-import-data-schema.ts +0 -22
  455. package/src/generated/zod/azure-storage-import-data-schema.ts +0 -18
  456. package/src/generated/zod/azure-table-kv-heartbeat-data-schema.ts +0 -26
  457. package/src/generated/zod/azure-vault-import-data-schema.ts +0 -18
  458. package/src/generated/zod/azure-vnet-network-heartbeat-data-schema.ts +0 -29
  459. package/src/generated/zod/azure-worker-import-data-schema.ts +0 -18
  460. package/src/generated/zod/base-resource-outputs-schema.ts +0 -18
  461. package/src/generated/zod/base-resource-schema.ts +0 -19
  462. package/src/generated/zod/binding-configuration-aws-binding-spec-schema.ts +0 -30
  463. package/src/generated/zod/binding-configuration-azure-binding-spec-schema.ts +0 -20
  464. package/src/generated/zod/binding-configuration-gcp-binding-spec-schema.ts +0 -27
  465. package/src/generated/zod/body-spec-schema.ts +0 -24
  466. package/src/generated/zod/build-config-schema.ts +0 -28
  467. package/src/generated/zod/build-heartbeat-data-schema.ts +0 -22
  468. package/src/generated/zod/build-heartbeat-status-schema.ts +0 -26
  469. package/src/generated/zod/build-outputs-schema.ts +0 -15
  470. package/src/generated/zod/build-schema.ts +0 -27
  471. package/src/generated/zod/build-status-schema.ts +0 -13
  472. package/src/generated/zod/capacity-group-scale-policy-schema.ts +0 -27
  473. package/src/generated/zod/capacity-group-schema.ts +0 -27
  474. package/src/generated/zod/command-response-schema.ts +0 -24
  475. package/src/generated/zod/command-state-schema.ts +0 -13
  476. package/src/generated/zod/command-status-response-schema.ts +0 -24
  477. package/src/generated/zod/compute-capacity-blocker-category-schema.ts +0 -10
  478. package/src/generated/zod/compute-capacity-blocker-schema.ts +0 -19
  479. package/src/generated/zod/compute-capacity-group-status-schema.ts +0 -29
  480. package/src/generated/zod/compute-capacity-recommendation-schema.ts +0 -18
  481. package/src/generated/zod/compute-choice-range-schema.ts +0 -17
  482. package/src/generated/zod/compute-cluster-heartbeat-data-schema.ts +0 -25
  483. package/src/generated/zod/compute-cluster-heartbeat-status-schema.ts +0 -26
  484. package/src/generated/zod/compute-cluster-schema.ts +0 -20
  485. package/src/generated/zod/compute-drain-blocker-schema.ts +0 -16
  486. package/src/generated/zod/compute-drain-progress-schema.ts +0 -26
  487. package/src/generated/zod/compute-drain-progress-status-schema.ts +0 -10
  488. package/src/generated/zod/compute-pool-selection-schema.ts +0 -22
  489. package/src/generated/zod/compute-settings-schema.ts +0 -18
  490. package/src/generated/zod/compute-type-schema.ts +0 -13
  491. package/src/generated/zod/container-autoscaling-schema.ts +0 -21
  492. package/src/generated/zod/container-code-schema.ts +0 -23
  493. package/src/generated/zod/container-gpu-spec-schema.ts +0 -16
  494. package/src/generated/zod/container-heartbeat-data-schema.ts +0 -19
  495. package/src/generated/zod/container-outputs-schema.ts +0 -30
  496. package/src/generated/zod/container-port-schema.ts +0 -15
  497. package/src/generated/zod/container-schema.ts +0 -65
  498. package/src/generated/zod/container-status-schema.ts +0 -13
  499. package/src/generated/zod/create-command-request-schema.ts +0 -22
  500. package/src/generated/zod/create-command-response-schema.ts +0 -25
  501. package/src/generated/zod/custom-certificate-config-schema.ts +0 -30
  502. package/src/generated/zod/custom-domain-config-schema.ts +0 -19
  503. package/src/generated/zod/daemon-code-schema.ts +0 -20
  504. package/src/generated/zod/daemon-heartbeat-data-schema.ts +0 -28
  505. package/src/generated/zod/daemon-outputs-schema.ts +0 -17
  506. package/src/generated/zod/daemon-runtime-mount-schema.ts +0 -14
  507. package/src/generated/zod/daemon-runtime-schema.ts +0 -19
  508. package/src/generated/zod/daemon-schema.ts +0 -48
  509. package/src/generated/zod/deployment-model-schema.ts +0 -13
  510. package/src/generated/zod/deployment-status-schema.ts +0 -13
  511. package/src/generated/zod/dev-resource-info-schema.ts +0 -16
  512. package/src/generated/zod/dev-status-schema.ts +0 -33
  513. package/src/generated/zod/dev-status-state-schema.ts +0 -13
  514. package/src/generated/zod/domain-settings-schema.ts +0 -22
  515. package/src/generated/zod/envelope-schema.ts +0 -28
  516. package/src/generated/zod/event-change-schema.ts +0 -40
  517. package/src/generated/zod/event-state-schema.ts +0 -20
  518. package/src/generated/zod/expose-protocol-schema.ts +0 -13
  519. package/src/generated/zod/gcp-artifact-registry-heartbeat-data-schema.ts +0 -35
  520. package/src/generated/zod/gcp-artifact-registry-import-data-schema.ts +0 -21
  521. package/src/generated/zod/gcp-build-import-data-schema.ts +0 -22
  522. package/src/generated/zod/gcp-cloud-build-heartbeat-data-schema.ts +0 -20
  523. package/src/generated/zod/gcp-cloud-run-worker-heartbeat-data-schema.ts +0 -29
  524. package/src/generated/zod/gcp-cloud-sql-postgres-heartbeat-data-schema.ts +0 -18
  525. package/src/generated/zod/gcp-cloud-storage-heartbeat-data-schema.ts +0 -33
  526. package/src/generated/zod/gcp-compute-cluster-heartbeat-data-schema.ts +0 -37
  527. package/src/generated/zod/gcp-compute-cluster-import-data-schema.ts +0 -17
  528. package/src/generated/zod/gcp-condition-schema.ts +0 -16
  529. package/src/generated/zod/gcp-custom-certificate-config-schema.ts +0 -12
  530. package/src/generated/zod/gcp-daemon-heartbeat-data-schema.ts +0 -35
  531. package/src/generated/zod/gcp-firestore-kv-heartbeat-data-schema.ts +0 -32
  532. package/src/generated/zod/gcp-kv-import-data-schema.ts +0 -17
  533. package/src/generated/zod/gcp-management-config-schema.ts +0 -15
  534. package/src/generated/zod/gcp-network-import-data-schema.ts +0 -22
  535. package/src/generated/zod/gcp-platform-permission-schema.ts +0 -24
  536. package/src/generated/zod/gcp-postgres-import-data-schema.ts +0 -23
  537. package/src/generated/zod/gcp-pub-sub-queue-heartbeat-data-schema.ts +0 -54
  538. package/src/generated/zod/gcp-queue-import-data-schema.ts +0 -19
  539. package/src/generated/zod/gcp-remote-stack-management-heartbeat-data-schema.ts +0 -19
  540. package/src/generated/zod/gcp-remote-stack-management-import-data-schema.ts +0 -19
  541. package/src/generated/zod/gcp-secret-manager-vault-heartbeat-data-schema.ts +0 -19
  542. package/src/generated/zod/gcp-service-account-heartbeat-data-schema.ts +0 -28
  543. package/src/generated/zod/gcp-service-account-import-data-schema.ts +0 -18
  544. package/src/generated/zod/gcp-service-activation-import-data-schema.ts +0 -17
  545. package/src/generated/zod/gcp-service-usage-activation-heartbeat-data-schema.ts +0 -22
  546. package/src/generated/zod/gcp-storage-import-data-schema.ts +0 -18
  547. package/src/generated/zod/gcp-vault-import-data-schema.ts +0 -16
  548. package/src/generated/zod/gcp-vpc-network-heartbeat-data-schema.ts +0 -25
  549. package/src/generated/zod/gcp-worker-import-data-schema.ts +0 -23
  550. package/src/generated/zod/gpu-spec-schema.ts +0 -16
  551. package/src/generated/zod/health-check-schema.ts +0 -19
  552. package/src/generated/zod/heartbeat-backend-schema.ts +0 -10
  553. package/src/generated/zod/heartbeat-collection-issue-reason-schema.ts +0 -10
  554. package/src/generated/zod/heartbeat-collection-issue-schema.ts +0 -21
  555. package/src/generated/zod/heartbeat-issue-severity-schema.ts +0 -10
  556. package/src/generated/zod/heartbeats-mode-schema.ts +0 -13
  557. package/src/generated/zod/horizon-container-heartbeat-data-schema.ts +0 -41
  558. package/src/generated/zod/horizon-workload-scheduling-mode-schema.ts +0 -10
  559. package/src/generated/zod/http-method-schema.ts +0 -13
  560. package/src/generated/zod/import-source-kind-schema.ts +0 -13
  561. package/src/generated/zod/imported-resource-schema.ts +0 -22
  562. package/src/generated/zod/index.ts +0 -706
  563. package/src/generated/zod/kubernetes-build-heartbeat-data-schema.ts +0 -28
  564. package/src/generated/zod/kubernetes-certificate-mode-schema.ts +0 -30
  565. package/src/generated/zod/kubernetes-cloud-reference-schema.ts +0 -21
  566. package/src/generated/zod/kubernetes-cluster-heartbeat-data-schema.ts +0 -41
  567. package/src/generated/zod/kubernetes-cluster-node-status-schema.ts +0 -35
  568. package/src/generated/zod/kubernetes-cluster-ownership-schema.ts +0 -13
  569. package/src/generated/zod/kubernetes-cluster-settings-schema.ts +0 -23
  570. package/src/generated/zod/kubernetes-container-heartbeat-data-schema.ts +0 -45
  571. package/src/generated/zod/kubernetes-custom-certificate-config-schema.ts +0 -15
  572. package/src/generated/zod/kubernetes-daemon-heartbeat-data-schema.ts +0 -42
  573. package/src/generated/zod/kubernetes-event-involved-object-schema.ts +0 -18
  574. package/src/generated/zod/kubernetes-event-snapshot-schema.ts +0 -30
  575. package/src/generated/zod/kubernetes-event-source-schema.ts +0 -13
  576. package/src/generated/zod/kubernetes-exposure-settings-schema.ts +0 -34
  577. package/src/generated/zod/kubernetes-gateway-route-profile-schema.ts +0 -27
  578. package/src/generated/zod/kubernetes-ingress-route-profile-schema.ts +0 -26
  579. package/src/generated/zod/kubernetes-node-condition-status-schema.ts +0 -15
  580. package/src/generated/zod/kubernetes-node-resources-schema.ts +0 -19
  581. package/src/generated/zod/kubernetes-node-usage-schema.ts +0 -18
  582. package/src/generated/zod/kubernetes-owner-reference-schema.ts +0 -15
  583. package/src/generated/zod/kubernetes-pod-runtime-unit-status-schema.ts +0 -31
  584. package/src/generated/zod/kubernetes-route-profile-schema.ts +0 -19
  585. package/src/generated/zod/kubernetes-route-provider-options-schema.ts +0 -27
  586. package/src/generated/zod/kubernetes-secret-vault-heartbeat-data-schema.ts +0 -18
  587. package/src/generated/zod/kubernetes-settings-schema.ts +0 -22
  588. package/src/generated/zod/kubernetes-tls-secret-ref-schema.ts +0 -16
  589. package/src/generated/zod/kubernetes-worker-heartbeat-data-schema.ts +0 -46
  590. package/src/generated/zod/kubernetes-workload-condition-schema.ts +0 -16
  591. package/src/generated/zod/kubernetes-workload-kind-schema.ts +0 -10
  592. package/src/generated/zod/kubernetes-workload-status-schema.ts +0 -22
  593. package/src/generated/zod/kv-heartbeat-data-schema.ts +0 -22
  594. package/src/generated/zod/kv-heartbeat-status-schema.ts +0 -26
  595. package/src/generated/zod/kv-outputs-schema.ts +0 -17
  596. package/src/generated/zod/kv-schema.ts +0 -15
  597. package/src/generated/zod/lease-info-schema.ts +0 -22
  598. package/src/generated/zod/lease-request-schema.ts +0 -17
  599. package/src/generated/zod/lease-response-schema.ts +0 -18
  600. package/src/generated/zod/lifecycle-rule-schema.ts +0 -16
  601. package/src/generated/zod/load-balancer-endpoint-schema.ts +0 -16
  602. package/src/generated/zod/local-artifact-registry-heartbeat-data-schema.ts +0 -17
  603. package/src/generated/zod/local-compute-cluster-heartbeat-data-schema.ts +0 -30
  604. package/src/generated/zod/local-container-heartbeat-data-schema.ts +0 -39
  605. package/src/generated/zod/local-daemon-heartbeat-data-schema.ts +0 -30
  606. package/src/generated/zod/local-kv-heartbeat-data-schema.ts +0 -20
  607. package/src/generated/zod/local-operation-schema.ts +0 -13
  608. package/src/generated/zod/local-postgres-heartbeat-data-schema.ts +0 -19
  609. package/src/generated/zod/local-queue-heartbeat-data-schema.ts +0 -18
  610. package/src/generated/zod/local-runtime-event-snapshot-schema.ts +0 -26
  611. package/src/generated/zod/local-runtime-event-subject-schema.ts +0 -14
  612. package/src/generated/zod/local-runtime-unit-kind-schema.ts +0 -10
  613. package/src/generated/zod/local-runtime-unit-status-schema.ts +0 -28
  614. package/src/generated/zod/local-service-account-heartbeat-data-schema.ts +0 -17
  615. package/src/generated/zod/local-storage-heartbeat-data-schema.ts +0 -20
  616. package/src/generated/zod/local-vault-heartbeat-data-schema.ts +0 -21
  617. package/src/generated/zod/local-worker-heartbeat-data-schema.ts +0 -35
  618. package/src/generated/zod/machine-profile-schema.ts +0 -25
  619. package/src/generated/zod/machines-compute-cluster-heartbeat-data-schema.ts +0 -36
  620. package/src/generated/zod/machines-compute-machine-status-schema.ts +0 -30
  621. package/src/generated/zod/machines-daemon-heartbeat-data-schema.ts +0 -35
  622. package/src/generated/zod/managed-runtime-event-involved-object-schema.ts +0 -20
  623. package/src/generated/zod/managed-runtime-event-snapshot-schema.ts +0 -34
  624. package/src/generated/zod/managed-runtime-event-source-schema.ts +0 -13
  625. package/src/generated/zod/managed-runtime-unit-status-schema.ts +0 -34
  626. package/src/generated/zod/management-config-schema.ts +0 -24
  627. package/src/generated/zod/management-permissions-schema.ts +0 -22
  628. package/src/generated/zod/message-payload-schema.ts +0 -17
  629. package/src/generated/zod/metric-sample-schema.ts +0 -16
  630. package/src/generated/zod/metric-unit-schema.ts +0 -10
  631. package/src/generated/zod/monitoring-config-schema.ts +0 -21
  632. package/src/generated/zod/network-heartbeat-data-schema.ts +0 -19
  633. package/src/generated/zod/network-heartbeat-status-schema.ts +0 -26
  634. package/src/generated/zod/network-settings-schema.ts +0 -37
  635. package/src/generated/zod/observed-counts-schema.ts +0 -14
  636. package/src/generated/zod/observed-health-schema.ts +0 -10
  637. package/src/generated/zod/observed-inventory-batch-schema.ts +0 -27
  638. package/src/generated/zod/observed-resource-sample-schema.ts +0 -54
  639. package/src/generated/zod/permission-grant-schema.ts +0 -19
  640. package/src/generated/zod/permission-profile-schema.ts +0 -16
  641. package/src/generated/zod/permission-set-reference-schema.ts +0 -14
  642. package/src/generated/zod/permission-set-schema.ts +0 -20
  643. package/src/generated/zod/permissions-config-schema.ts +0 -22
  644. package/src/generated/zod/persistent-storage-schema.ts +0 -16
  645. package/src/generated/zod/platform-permissions-schema.ts +0 -26
  646. package/src/generated/zod/platform-schema.ts +0 -13
  647. package/src/generated/zod/postgres-backend-schema.ts +0 -15
  648. package/src/generated/zod/postgres-heartbeat-data-schema.ts +0 -22
  649. package/src/generated/zod/postgres-heartbeat-status-schema.ts +0 -26
  650. package/src/generated/zod/postgres-outputs-schema.ts +0 -17
  651. package/src/generated/zod/postgres-schema.ts +0 -24
  652. package/src/generated/zod/presigned-operation-schema.ts +0 -13
  653. package/src/generated/zod/presigned-request-backend-schema.ts +0 -27
  654. package/src/generated/zod/presigned-request-schema.ts +0 -24
  655. package/src/generated/zod/provider-fleet-status-schema.ts +0 -16
  656. package/src/generated/zod/provider-lifecycle-state-schema.ts +0 -10
  657. package/src/generated/zod/public-endpoint-output-schema.ts +0 -21
  658. package/src/generated/zod/public-endpoint-schema.ts +0 -22
  659. package/src/generated/zod/public-endpoint-target-settings-schema.ts +0 -18
  660. package/src/generated/zod/push-progress-schema.ts +0 -19
  661. package/src/generated/zod/queue-heartbeat-data-schema.ts +0 -22
  662. package/src/generated/zod/queue-heartbeat-status-schema.ts +0 -26
  663. package/src/generated/zod/queue-message-schema.ts +0 -26
  664. package/src/generated/zod/queue-outputs-schema.ts +0 -16
  665. package/src/generated/zod/queue-schema.ts +0 -15
  666. package/src/generated/zod/raw-heartbeat-snippet-format-schema.ts +0 -10
  667. package/src/generated/zod/raw-heartbeat-snippet-schema.ts +0 -19
  668. package/src/generated/zod/readiness-probe-schema.ts +0 -19
  669. package/src/generated/zod/release-request-schema.ts +0 -15
  670. package/src/generated/zod/remote-stack-management-heartbeat-data-schema.ts +0 -19
  671. package/src/generated/zod/remote-stack-management-heartbeat-status-schema.ts +0 -26
  672. package/src/generated/zod/remote-stack-management-outputs-schema.ts +0 -16
  673. package/src/generated/zod/remote-stack-management-schema.ts +0 -15
  674. package/src/generated/zod/replica-status-schema.ts +0 -19
  675. package/src/generated/zod/resource-entry-schema.ts +0 -24
  676. package/src/generated/zod/resource-heartbeat-data-schema.ts +0 -130
  677. package/src/generated/zod/resource-heartbeat-schema.ts +0 -34
  678. package/src/generated/zod/resource-lifecycle-schema.ts +0 -13
  679. package/src/generated/zod/resource-ref-schema.ts +0 -19
  680. package/src/generated/zod/resource-spec-schema.ts +0 -16
  681. package/src/generated/zod/resource-status-schema.ts +0 -13
  682. package/src/generated/zod/resource-type-schema.ts +0 -13
  683. package/src/generated/zod/response-handling-schema.ts +0 -20
  684. package/src/generated/zod/scheduled-event-schema.ts +0 -15
  685. package/src/generated/zod/service-account-heartbeat-data-schema.ts +0 -22
  686. package/src/generated/zod/service-account-heartbeat-status-schema.ts +0 -26
  687. package/src/generated/zod/service-account-outputs-schema.ts +0 -16
  688. package/src/generated/zod/service-account-schema.ts +0 -19
  689. package/src/generated/zod/service-activation-heartbeat-data-schema.ts +0 -16
  690. package/src/generated/zod/service-activation-heartbeat-status-schema.ts +0 -26
  691. package/src/generated/zod/stack-import-request-schema.ts +0 -50
  692. package/src/generated/zod/stack-import-response-schema.ts +0 -24
  693. package/src/generated/zod/stack-input-default-value-schema.ts +0 -25
  694. package/src/generated/zod/stack-input-definition-schema.ts +0 -43
  695. package/src/generated/zod/stack-input-environment-mapping-schema.ts +0 -20
  696. package/src/generated/zod/stack-input-environment-variable-type-schema.ts +0 -13
  697. package/src/generated/zod/stack-input-kind-schema.ts +0 -13
  698. package/src/generated/zod/stack-input-provider-schema.ts +0 -13
  699. package/src/generated/zod/stack-input-validation-schema.ts +0 -23
  700. package/src/generated/zod/stack-ref-schema.ts +0 -15
  701. package/src/generated/zod/stack-resource-state-schema.ts +0 -50
  702. package/src/generated/zod/stack-schema.ts +0 -31
  703. package/src/generated/zod/stack-settings-schema.ts +0 -49
  704. package/src/generated/zod/stack-state-schema.ts +0 -23
  705. package/src/generated/zod/stack-status-schema.ts +0 -13
  706. package/src/generated/zod/storage-event-schema.ts +0 -32
  707. package/src/generated/zod/storage-event-type-schema.ts +0 -13
  708. package/src/generated/zod/storage-events-schema.ts +0 -14
  709. package/src/generated/zod/storage-heartbeat-data-schema.ts +0 -22
  710. package/src/generated/zod/storage-heartbeat-status-schema.ts +0 -26
  711. package/src/generated/zod/storage-outputs-schema.ts +0 -15
  712. package/src/generated/zod/storage-schema.ts +0 -21
  713. package/src/generated/zod/storage-upload-schema.ts +0 -19
  714. package/src/generated/zod/submit-response-request-schema.ts +0 -14
  715. package/src/generated/zod/telemetry-mode-schema.ts +0 -13
  716. package/src/generated/zod/toolchain-config-schema.ts +0 -26
  717. package/src/generated/zod/updates-mode-schema.ts +0 -13
  718. package/src/generated/zod/upload-complete-request-schema.ts +0 -15
  719. package/src/generated/zod/upload-complete-response-schema.ts +0 -19
  720. package/src/generated/zod/value-schema.ts +0 -10
  721. package/src/generated/zod/vault-heartbeat-data-schema.ts +0 -25
  722. package/src/generated/zod/vault-heartbeat-status-schema.ts +0 -26
  723. package/src/generated/zod/vault-outputs-schema.ts +0 -15
  724. package/src/generated/zod/vault-schema.ts +0 -15
  725. package/src/generated/zod/worker-code-schema.ts +0 -23
  726. package/src/generated/zod/worker-heartbeat-data-schema.ts +0 -25
  727. package/src/generated/zod/worker-outputs-schema.ts +0 -21
  728. package/src/generated/zod/worker-public-endpoint-schema.ts +0 -17
  729. package/src/generated/zod/worker-schema.ts +0 -43
  730. package/src/generated/zod/worker-trigger-schema.ts +0 -28
  731. package/src/generated/zod/workload-heartbeat-status-schema.ts +0 -26
  732. package/src/generated/zod/workload-replica-status-schema.ts +0 -17
  733. package/src/get-resource-outputs.ts +0 -101
  734. package/src/index.ts +0 -437
  735. package/src/input.ts +0 -380
  736. package/src/kv.ts +0 -72
  737. package/src/postgres.ts +0 -107
  738. package/src/queue.ts +0 -44
  739. package/src/resource.ts +0 -25
  740. package/src/service-account.ts +0 -117
  741. package/src/stack.ts +0 -133
  742. package/src/storage.ts +0 -84
  743. package/src/tests/index.ts +0 -6
  744. package/src/vault.ts +0 -49
  745. package/src/worker.ts +0 -251
  746. package/tsconfig.json +0 -4
  747. package/tsdown.config.ts +0 -10
package/src/error.ts DELETED
@@ -1,665 +0,0 @@
1
- /**
2
- * This module provides a structured error handling system similar to Rust's error types,
3
- * with TypeScript type safety, error chaining, and context preservation.
4
- *
5
- * @example Basic Usage
6
- * ```typescript
7
- * import { AlienError, defineError } from '@alienplatform/core'
8
- * import { z } from 'zod'
9
- *
10
- * // Define a type-safe error
11
- * const DatabaseError = defineError({
12
- * code: "DATABASE_CONNECTION_FAILED",
13
- * context: z.object({
14
- * host: z.string(),
15
- * port: z.number(),
16
- * reason: z.string(),
17
- * }),
18
- * message: ({ host, port, reason }) => `Failed to connect to database '${host}:${port}': ${reason}`,
19
- * retryable: true,
20
- * internal: false,
21
- * httpStatusCode: 502,
22
- * })
23
- *
24
- * // Use it
25
- * throw new AlienError(DatabaseError.create({
26
- * host: "localhost",
27
- * port: 5432,
28
- * reason: "Connection timeout"
29
- * }))
30
- * ```
31
- *
32
- * @example Error Chaining
33
- * ```typescript
34
- * try {
35
- * // Some operation that fails
36
- * throw new Error("Connection refused")
37
- * } catch (error) {
38
- * throw (await AlienError.from(error)).withContext(
39
- * DatabaseError.create({
40
- * host: "localhost",
41
- * port: 5432,
42
- * reason: "Connection refused by server"
43
- * })
44
- * )
45
- * }
46
- * ```
47
- *
48
- * @example External API Sanitization
49
- * ```typescript
50
- * const internalError = new AlienError(InternalApiError.create({
51
- * service: "payment-processor",
52
- * details: "Database password expired",
53
- * traceId: "trace-12345"
54
- * }))
55
- *
56
- * // Safe for external APIs (sanitizes internal errors)
57
- * const safeResponse = internalError.toExternal()
58
- * ```
59
- */
60
-
61
- import { serializeError } from "serialize-error"
62
- import type { z } from "zod/v4"
63
- import {
64
- type AlienError as AlienErrorOptions,
65
- AlienErrorSchema as AlienErrorOptionsSchema,
66
- } from "./generated/index.js"
67
-
68
- // Re-export the schema for external use
69
- export { AlienErrorOptionsSchema }
70
- export type { AlienErrorOptions }
71
-
72
- /**
73
- * Base interface that all error type definitions must implement.
74
- *
75
- * This provides the structure for creating type-safe error definitions
76
- * with Zod validation and contextual information.
77
- *
78
- * @template TContext - Zod schema type for the error context
79
- */
80
- export interface AlienErrorMetadata<TContext extends z.ZodTypeAny> {
81
- /** Unique error code (e.g., "DATABASE_CONNECTION_FAILED") */
82
- code: string
83
- /** Zod schema for type-safe context validation */
84
- context: TContext
85
- /** Whether this error can be retried */
86
- retryable: boolean
87
- /** Whether this error contains sensitive information */
88
- internal: boolean
89
- /** HTTP status code for API responses */
90
- httpStatusCode?: number
91
- /** Worker to generate human-readable error message from context */
92
- message: (context: z.infer<TContext>) => string
93
- }
94
-
95
- /**
96
- * Helper function to create type-safe error definitions.
97
- *
98
- * This function provides a clean API for defining reusable error types
99
- * with full TypeScript type safety and Zod validation.
100
- *
101
- * @template TContext - Zod schema type for the error context
102
- * @param metadata - Error metadata including code, schema, and message generator
103
- * @returns Object with metadata and a create function for error instances
104
- *
105
- * @example
106
- * ```typescript
107
- * const UserNotFound = defineError({
108
- * code: "USER_NOT_FOUND",
109
- * context: z.object({
110
- * userId: z.string(),
111
- * searchMethod: z.string(),
112
- * }),
113
- * message: ({ userId, searchMethod }) =>
114
- * `User '${userId}' not found using method '${searchMethod}'`,
115
- * retryable: false,
116
- * internal: false,
117
- * httpStatusCode: 404,
118
- * })
119
- *
120
- * // Usage
121
- * const error = UserNotFound.create({
122
- * userId: "123",
123
- * searchMethod: "database_lookup"
124
- * })
125
- * ```
126
- */
127
- export function defineError<TContext extends z.ZodTypeAny>(metadata: AlienErrorMetadata<TContext>) {
128
- return {
129
- metadata,
130
- contextSchema: metadata.context,
131
- create: (context: z.infer<TContext>): AlienErrorDefinition<TContext> => ({
132
- metadata,
133
- contextSchema: metadata.context,
134
- context,
135
- toOptions: (): AlienErrorOptions => ({
136
- code: metadata.code,
137
- message: metadata.message(context),
138
- retryable: metadata.retryable,
139
- internal: metadata.internal,
140
- httpStatusCode: metadata.httpStatusCode,
141
- context,
142
- }),
143
- }),
144
- }
145
- }
146
-
147
- /**
148
- * Represents a specific error instance with its context.
149
- *
150
- * This is created by calling `.create()` on an error definition
151
- * and contains the actual context data for a specific error occurrence.
152
- *
153
- * @template TContext - Zod schema type for the error context
154
- */
155
- export interface AlienErrorDefinition<TContext extends z.ZodTypeAny> {
156
- metadata: AlienErrorMetadata<TContext>
157
- contextSchema: TContext
158
- context: z.infer<TContext>
159
-
160
- /**
161
- * Convert this error definition directly to AlienErrorOptions.
162
- *
163
- * This allows you to get the wire format representation
164
- * without creating an AlienError instance first.
165
- *
166
- * @returns AlienErrorOptions object representing this error
167
- */
168
- toOptions(): AlienErrorOptions
169
- }
170
-
171
- /**
172
- * Main AlienError class that provides structured error handling.
173
- *
174
- * This class extends the standard JavaScript Error with additional features:
175
- * - Type-safe context data
176
- * - Error chaining and source tracking
177
- * - Retryability and internal/external visibility flags
178
- * - HTTP status code mapping
179
- * - Sanitization for external APIs
180
- *
181
- * @template TContext - Zod schema type for the error context
182
- *
183
- * @example Basic Construction
184
- * ```typescript
185
- * const error = new AlienError(DatabaseError.create({
186
- * host: "localhost",
187
- * port: 5432,
188
- * reason: "Timeout"
189
- * }))
190
- * ```
191
- *
192
- * @example Converting JavaScript Errors
193
- * ```typescript
194
- * try {
195
- * JSON.parse("invalid json")
196
- * } catch (jsError) {
197
- * const alienError = AlienError.from(jsError)
198
- * console.log(alienError.code) // "GENERIC_ERROR"
199
- * }
200
- * ```
201
- *
202
- * @example Error Chaining
203
- * ```typescript
204
- * const contextualError = AlienError.from(new Error("Network timeout"))
205
- * .withContext(DatabaseError.create({
206
- * host: "localhost",
207
- * port: 5432,
208
- * reason: "Connection timeout"
209
- * }))
210
- *
211
- * // Check error chain
212
- * console.log(contextualError.hasErrorCode("DATABASE_CONNECTION_FAILED")) // true
213
- * console.log(contextualError.toString()) // Shows full error chain
214
- * ```
215
- */
216
- export class AlienError<TContext extends z.ZodTypeAny = z.ZodAny> extends Error {
217
- /** Unique error code identifying the error type */
218
- public readonly code: string
219
- /** Whether this error can be safely retried */
220
- public readonly retryable: boolean
221
- /** Whether this error contains sensitive internal information */
222
- public readonly internal: boolean
223
- /** HTTP status code for API responses */
224
- public readonly httpStatusCode: number
225
- /** Type-safe context data specific to this error */
226
- public readonly context?: z.infer<TContext>
227
- /** Optional human-facing remediation hint */
228
- public readonly hint?: string | null
229
- /** Source error that caused this error (for chaining) */
230
- public readonly source?: AlienError<any>
231
-
232
- constructor(input: AlienErrorDefinition<TContext> | (AlienErrorOptions & { context?: any })) {
233
- // Handle both error definitions and raw options
234
- let options: AlienErrorOptions & { context?: any }
235
-
236
- if ("metadata" in input && "context" in input) {
237
- // It's an AlienErrorDefinition
238
- const definition = input as AlienErrorDefinition<TContext>
239
- const { metadata, context: contextData } = definition
240
- const message = metadata.message(contextData)
241
-
242
- options = {
243
- code: metadata.code,
244
- message,
245
- retryable: metadata.retryable,
246
- internal: metadata.internal,
247
- httpStatusCode: metadata.httpStatusCode,
248
- context: contextData,
249
- }
250
- } else {
251
- // It's raw AlienErrorOptions
252
- options = input as AlienErrorOptions & { context?: any }
253
- }
254
-
255
- const message = options.message
256
- super(message, { cause: options.source })
257
-
258
- this.name = "AlienError"
259
- this.code = options.code
260
- this.retryable = options.retryable
261
- this.internal = options.internal
262
- this.httpStatusCode = options.httpStatusCode ?? 500
263
- this.context = options.context
264
- this.hint = options.hint
265
-
266
- // Handle source construction - check if it's a valid AlienErrorOptions object
267
- this.source = undefined
268
- if (options.source && typeof options.source === "object") {
269
- // Check if it has the required fields to be a valid AlienErrorOptions
270
- if (
271
- "code" in options.source &&
272
- "message" in options.source &&
273
- "retryable" in options.source &&
274
- "internal" in options.source
275
- ) {
276
- this.source = new AlienError(options.source as AlienErrorOptions)
277
- }
278
- }
279
- }
280
-
281
- /**
282
- * Create an AlienError from a type-safe error definition.
283
- *
284
- * @template TContext - Zod schema type for the error context
285
- * @param definition - Error definition with type-safe context
286
- * @returns New AlienError instance
287
- */
288
- static fromDefinition<TContext extends z.ZodTypeAny>(
289
- definition: AlienErrorDefinition<TContext>,
290
- ): AlienError<TContext> {
291
- return new AlienError(definition)
292
- }
293
-
294
- /**
295
- * Create an AlienError from raw options (for compatibility).
296
- *
297
- * @param options - Raw error options conforming to AlienErrorOptions schema
298
- * @returns New AlienError instance
299
- */
300
- static fromOptions(options: AlienErrorOptions): AlienError {
301
- return new AlienError(AlienErrorOptionsSchema.parse(options))
302
- }
303
-
304
- /**
305
- * Helper function to get a user-friendly type name for error context.
306
- *
307
- * @param error - Any value to get the type name for
308
- * @returns User-friendly type name
309
- */
310
- private static getErrorTypeName(error: any): string {
311
- // Handle null explicitly (typeof null === "object" is a JS quirk)
312
- if (error === null) {
313
- return "null"
314
- }
315
-
316
- // Handle undefined
317
- if (error === undefined) {
318
- return "undefined"
319
- }
320
-
321
- // Try to get constructor name first (for Arrays, Workers, custom classes, etc.)
322
- if (error?.constructor?.name) {
323
- return error.constructor.name
324
- }
325
-
326
- // Fall back to typeof, but capitalize for consistency
327
- const typeofResult = typeof error
328
- return typeofResult === "object"
329
- ? "Object"
330
- : typeofResult.charAt(0).toUpperCase() + typeofResult.slice(1)
331
- }
332
-
333
- /**
334
- * Convert a JavaScript Error or any object to a generic AlienError.
335
- *
336
- * This is equivalent to Rust's `.into_alien_error()` pattern and provides
337
- * a way to convert any JavaScript error into the structured AlienError format.
338
- *
339
- * @param error - Any JavaScript error or object to convert
340
- * @returns AlienError with GENERIC_ERROR code and preserved original error
341
- *
342
- * @example
343
- * ```typescript
344
- * try {
345
- * throw new TypeError("Invalid argument")
346
- * } catch (error) {
347
- * const alienError = AlienError.from(error)
348
- * console.log(alienError.code) // "GENERIC_ERROR"
349
- * console.log(alienError.context?.originalError) // Serialized TypeError
350
- * }
351
- * ```
352
- *
353
- * @example Chaining with context
354
- * ```typescript
355
- * try {
356
- * JSON.parse("invalid")
357
- * } catch (error) {
358
- * throw AlienError.from(error).withContext(
359
- * ValidationError.create({
360
- * input: "invalid",
361
- * expectedFormat: "JSON"
362
- * })
363
- * )
364
- * }
365
- * ```
366
- *
367
- * @example AxiosError conversion
368
- * ```typescript
369
- * try {
370
- * await axios.get('/api/resource')
371
- * } catch (error) {
372
- * // If error.response.data contains a valid AlienError structure, it will be parsed
373
- * const alienError = AlienError.from(error)
374
- * console.log(alienError.code) // Could be "REMOTE_RESOURCE_NOT_FOUND" if parsed from response
375
- * }
376
- * ```
377
- */
378
- static async from(error: any): Promise<AlienError> {
379
- if (error instanceof AlienError) {
380
- return error
381
- }
382
-
383
- // Try to parse as fetch Response with AlienError in body
384
- if (error instanceof Response) {
385
- let errorBody: any
386
- try {
387
- errorBody = await error.json()
388
- } catch {
389
- // If JSON parsing fails, create generic error
390
- return new AlienError({
391
- code: "GENERIC_ERROR",
392
- message: `HTTP request failed with status ${error.status}`,
393
- retryable: false,
394
- internal: true,
395
- httpStatusCode: error.status,
396
- context: {
397
- url: error.url,
398
- status: error.status,
399
- statusText: error.statusText,
400
- },
401
- })
402
- }
403
-
404
- // Try to parse as AlienError
405
- const parseResult = AlienErrorOptionsSchema.safeParse(errorBody)
406
- if (parseResult.success) {
407
- return new AlienError(parseResult.data)
408
- }
409
-
410
- // If not an AlienError, wrap it as generic error
411
- return new AlienError({
412
- code: "GENERIC_ERROR",
413
- message: errorBody?.message || `HTTP request failed with status ${error.status}`,
414
- retryable: false,
415
- internal: true,
416
- httpStatusCode: error.status,
417
- context: {
418
- url: error.url,
419
- status: error.status,
420
- statusText: error.statusText,
421
- responseBody: errorBody,
422
- },
423
- })
424
- }
425
-
426
- // Try to parse as AxiosError with AlienError in response.data
427
- if (error?.response?.data && typeof error.response.data === "object") {
428
- const parseResult = AlienErrorOptionsSchema.safeParse(error.response.data)
429
- if (parseResult.success) {
430
- return new AlienError(parseResult.data)
431
- }
432
- // If parsing fails, continue with generic error handling
433
- // This is expected for non-AlienError responses
434
- }
435
-
436
- // Serialize the error using serialize-error for consistent structure
437
- const serialized = serializeError(error)
438
- const message = serialized?.message || String(error)
439
-
440
- return new AlienError({
441
- code: "GENERIC_ERROR",
442
- message,
443
- retryable: false,
444
- internal: true,
445
- httpStatusCode: 500,
446
- context: {
447
- originalError: serialized,
448
- errorType: AlienError.getErrorTypeName(error),
449
- },
450
- })
451
- }
452
-
453
- /**
454
- * Add context to this error, creating a new error that wraps this one.
455
- *
456
- * This is equivalent to Rust's `.with_context()` pattern and allows
457
- * building error chains with increasing levels of context.
458
- *
459
- * @template TNewContext - Zod schema type for the new context
460
- * @param definition - Error definition to wrap this error with
461
- * @returns New AlienError with this error as the source
462
- *
463
- * @example
464
- * ```typescript
465
- * // Clean fluent API
466
- * const authError = (await AlienError.from(new Error("ECONNREFUSED")))
467
- * .withContext(DatabaseError.create({
468
- * host: "localhost",
469
- * port: 5432,
470
- * reason: "Connection refused"
471
- * }))
472
- * .withContext(AuthError.create({
473
- * username: "john",
474
- * reason: "Database unavailable"
475
- * }))
476
- *
477
- * // Error chain: AuthError -> DatabaseError -> GENERIC_ERROR
478
- * console.log(authError.toString())
479
- * ```
480
- */
481
- withContext<TNewContext extends z.ZodTypeAny>(
482
- definition: AlienErrorDefinition<TNewContext>,
483
- ): AlienError<TNewContext> {
484
- const { metadata, context: contextData } = definition
485
- const message = metadata.message(contextData)
486
-
487
- // Convert current error to source format
488
- const sourceOptions: AlienErrorOptions = {
489
- code: this.code,
490
- message: this.message,
491
- retryable: this.retryable,
492
- internal: this.internal,
493
- httpStatusCode: this.httpStatusCode,
494
- context: this.context,
495
- hint: this.hint,
496
- source: this.source?.toOptions(),
497
- }
498
-
499
- return new AlienError({
500
- code: metadata.code,
501
- message,
502
- retryable: metadata.retryable,
503
- internal: metadata.internal,
504
- httpStatusCode: metadata.httpStatusCode,
505
- context: contextData,
506
- source: sourceOptions,
507
- })
508
- }
509
-
510
- /**
511
- * Convert this AlienError to the wire format (AlienErrorOptions).
512
- *
513
- * This method serializes the error into the standard format used
514
- * for transmitting errors over the network or storing them.
515
- *
516
- * @returns AlienErrorOptions object representing this error
517
- */
518
- toOptions(): AlienErrorOptions {
519
- return {
520
- code: this.code,
521
- message: this.message,
522
- retryable: this.retryable,
523
- internal: this.internal,
524
- httpStatusCode: this.httpStatusCode,
525
- context: this.context,
526
- hint: this.hint,
527
- source: this.source?.toOptions(),
528
- }
529
- }
530
-
531
- /**
532
- * Get a sanitized version for external APIs (hides internal errors).
533
- *
534
- * This method is crucial for security - it prevents sensitive internal
535
- * error details from being exposed to external users while preserving
536
- * the error chain structure for non-sensitive errors.
537
- *
538
- * @returns Sanitized AlienErrorOptions safe for external consumption
539
- *
540
- * @example
541
- * ```typescript
542
- * const internalError = new AlienError(InternalApiError.create({
543
- * service: "payment-processor",
544
- * details: "Database password expired for user admin",
545
- * traceId: "trace-12345"
546
- * }))
547
- *
548
- * console.log(internalError.toOptions())
549
- * // Shows full details including sensitive information
550
- *
551
- * console.log(internalError.toExternal())
552
- * // { code: "GENERIC_ERROR", message: "Internal server error", ... }
553
- * ```
554
- */
555
- toExternal(): AlienErrorOptions {
556
- if (this.internal) {
557
- return {
558
- code: "GENERIC_ERROR",
559
- message: "Internal server error",
560
- retryable: false,
561
- internal: false,
562
- httpStatusCode: 500,
563
- }
564
- }
565
-
566
- return {
567
- code: this.code,
568
- message: this.message,
569
- retryable: this.retryable,
570
- internal: this.internal,
571
- httpStatusCode: this.httpStatusCode,
572
- context: this.context,
573
- hint: this.hint,
574
- source: this.source?.toExternal(),
575
- }
576
- }
577
-
578
- /**
579
- * Check if this error chain contains an error with a specific code.
580
- *
581
- * This method traverses the entire error chain (this error and all
582
- * source errors) to find if any error has the specified code.
583
- *
584
- * @param code - Error code to search for
585
- * @returns True if the code is found anywhere in the error chain
586
- *
587
- * @example
588
- * ```typescript
589
- * const chainedError = authError.withContext(dbError.withContext(networkError))
590
- *
591
- * console.log(chainedError.hasErrorCode("AUTH_FAILED")) // true
592
- * console.log(chainedError.hasErrorCode("DATABASE_CONNECTION_FAILED")) // true
593
- * console.log(chainedError.hasErrorCode("NETWORK_TIMEOUT")) // true
594
- * console.log(chainedError.hasErrorCode("NONEXISTENT_ERROR")) // false
595
- * ```
596
- */
597
- hasErrorCode(code: string): boolean {
598
- if (this.code === code) return true
599
- return this.source?.hasErrorCode(code) ?? false
600
- }
601
-
602
- /**
603
- * Find the first error in the chain with a specific code.
604
- *
605
- * This method traverses the error chain and returns the first error
606
- * instance that matches the specified code, allowing access to its
607
- * specific context and details.
608
- *
609
- * @param code - Error code to search for
610
- * @returns AlienError instance with the specified code, or undefined if not found
611
- *
612
- * @example
613
- * ```typescript
614
- * const chainedError = authError.withContext(dbError)
615
- *
616
- * const dbError = chainedError.findErrorByCode("DATABASE_CONNECTION_FAILED")
617
- * if (dbError) {
618
- * console.log("Database error context:", dbError.context)
619
- * console.log("Host:", dbError.context?.host)
620
- * }
621
- * ```
622
- */
623
- findErrorByCode(code: string): AlienError | undefined {
624
- if (this.code === code) return this
625
- return this.source?.findErrorByCode(code)
626
- }
627
-
628
- /**
629
- * Get a formatted string representation of the error chain.
630
- *
631
- * This method provides a human-readable representation of the entire
632
- * error chain, showing how errors are nested and providing context
633
- * for debugging and logging.
634
- *
635
- * @returns Formatted string showing the complete error chain
636
- *
637
- * @example
638
- * ```typescript
639
- * const chainedError = authError.withContext(dbError.withContext(networkError))
640
- * console.log(chainedError.toString())
641
- * // Output:
642
- * // AUTH_FAILED: User authentication failed for 'john'
643
- * // ├─▶ DATABASE_CONNECTION_FAILED: Failed to connect to database 'localhost:5432'
644
- * // ├─▶ GENERIC_ERROR: Connection timeout
645
- * ```
646
- */
647
- toString(): string {
648
- let result = `${this.code}: ${this.message}`
649
- let current = this.source
650
- let indent = ""
651
-
652
- while (current) {
653
- indent += " "
654
- result += `\n${indent}├─▶ ${current.code}: ${current.message}`
655
- current = current.source
656
- }
657
-
658
- return result
659
- }
660
- }
661
-
662
- // Utility type to extract context type from error definition
663
- export type ExtractContext<T> = T extends AlienErrorDefinition<infer TContext>
664
- ? z.infer<TContext>
665
- : never