@alienplatform/core 1.3.4 → 1.4.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 (479) hide show
  1. package/.turbo/turbo-build.log +15 -16
  2. package/AGENTS.md +3 -3
  3. package/dist/index.d.ts +22033 -2518
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +212 -66
  6. package/dist/index.js.map +1 -1
  7. package/dist/stack.js +4467 -706
  8. package/dist/stack.js.map +1 -1
  9. package/dist/tests/index.d.ts +1 -1
  10. package/dist/tests/index.js +1 -1
  11. package/dist/tests/index.js.map +1 -1
  12. package/package.json +1 -1
  13. package/src/__tests__/__snapshots__/stack.test.ts.snap +23 -15
  14. package/src/__tests__/error.test.ts +1 -1
  15. package/src/__tests__/stack.test.ts +42 -23
  16. package/src/container.ts +21 -8
  17. package/src/daemon.ts +170 -0
  18. package/src/error.ts +2 -2
  19. package/src/generated/index.ts +391 -9
  20. package/src/generated/schemas/agentStatus.json +1 -1
  21. package/src/generated/schemas/alienEvent.json +1 -1
  22. package/src/generated/schemas/artifactRegistryHeartbeatData.json +1 -0
  23. package/src/generated/schemas/artifactRegistryHeartbeatStatus.json +1 -0
  24. package/src/generated/schemas/awsArtifactRegistryImportData.json +1 -0
  25. package/src/generated/schemas/awsBuildImportData.json +1 -0
  26. package/src/generated/schemas/awsCodeBuildHeartbeatData.json +1 -0
  27. package/src/generated/schemas/awsComputeClusterHeartbeatData.json +1 -0
  28. package/src/generated/schemas/awsComputeClusterImportData.json +1 -0
  29. package/src/generated/schemas/awsDaemonHeartbeatData.json +1 -0
  30. package/src/generated/schemas/awsDynamoDbKeySchemaElement.json +1 -0
  31. package/src/generated/schemas/awsDynamoDbKvHeartbeatData.json +1 -0
  32. package/src/generated/schemas/awsEcrArtifactRegistryHeartbeatData.json +1 -0
  33. package/src/generated/schemas/awsEcrRepositoryHeartbeatData.json +1 -0
  34. package/src/generated/schemas/awsIamRoleServiceAccountHeartbeatData.json +1 -0
  35. package/src/generated/schemas/awsKvImportData.json +1 -0
  36. package/src/generated/schemas/awsLambdaWorkerHeartbeatData.json +1 -0
  37. package/src/generated/schemas/awsNetworkImportData.json +1 -0
  38. package/src/generated/schemas/awsParameterStoreVaultHeartbeatData.json +1 -0
  39. package/src/generated/schemas/awsPermissionEffect.json +1 -0
  40. package/src/generated/schemas/awsPlatformPermission.json +1 -1
  41. package/src/generated/schemas/awsQueueImportData.json +1 -0
  42. package/src/generated/schemas/awsRemoteStackManagementHeartbeatData.json +1 -0
  43. package/src/generated/schemas/awsRemoteStackManagementImportData.json +1 -0
  44. package/src/generated/schemas/awsS3StorageHeartbeatData.json +1 -0
  45. package/src/generated/schemas/awsServiceAccountImportData.json +1 -0
  46. package/src/generated/schemas/awsSqsQueueHeartbeatData.json +1 -0
  47. package/src/generated/schemas/awsStorageImportData.json +1 -0
  48. package/src/generated/schemas/awsVaultImportData.json +1 -0
  49. package/src/generated/schemas/awsVpcNetworkHeartbeatData.json +1 -0
  50. package/src/generated/schemas/awsWorkerImportData.json +1 -0
  51. package/src/generated/schemas/azureArtifactRegistryImportData.json +1 -0
  52. package/src/generated/schemas/azureBlobStorageHeartbeatData.json +1 -0
  53. package/src/generated/schemas/azureBuildImportData.json +1 -0
  54. package/src/generated/schemas/azureComputeClusterHeartbeatData.json +1 -0
  55. package/src/generated/schemas/azureComputeClusterImportData.json +1 -0
  56. package/src/generated/schemas/azureContainerAppsBuildHeartbeatData.json +1 -0
  57. package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatData.json +1 -0
  58. package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatStatus.json +1 -0
  59. package/src/generated/schemas/azureContainerAppsEnvironmentImportData.json +1 -0
  60. package/src/generated/schemas/azureContainerAppsEnvironmentWorkloadProfile.json +1 -0
  61. package/src/generated/schemas/azureContainerAppsWorkerHeartbeatData.json +1 -0
  62. package/src/generated/schemas/azureContainerRegistryHeartbeatData.json +1 -0
  63. package/src/generated/schemas/azureDaemonHeartbeatData.json +1 -0
  64. package/src/generated/schemas/azureKeyVaultHeartbeatData.json +1 -0
  65. package/src/generated/schemas/azureKvImportData.json +1 -0
  66. package/src/generated/schemas/azureManagedIdentityServiceAccountHeartbeatData.json +1 -0
  67. package/src/generated/schemas/azureManagementConfig.json +1 -1
  68. package/src/generated/schemas/azureNetworkImportData.json +1 -0
  69. package/src/generated/schemas/azurePlatformPermission.json +1 -1
  70. package/src/generated/schemas/azureQueueImportData.json +1 -0
  71. package/src/generated/schemas/azureRemoteStackManagementHeartbeatData.json +1 -0
  72. package/src/generated/schemas/azureRemoteStackManagementImportData.json +1 -0
  73. package/src/generated/schemas/azureResourceGroupHeartbeatData.json +1 -0
  74. package/src/generated/schemas/azureResourceGroupHeartbeatStatus.json +1 -0
  75. package/src/generated/schemas/azureResourceGroupImportData.json +1 -0
  76. package/src/generated/schemas/azureResourceProviderActivationHeartbeatData.json +1 -0
  77. package/src/generated/schemas/azureServiceAccountImportData.json +1 -0
  78. package/src/generated/schemas/azureServiceActivationImportData.json +1 -0
  79. package/src/generated/schemas/azureServiceBusNamespaceHeartbeatData.json +1 -0
  80. package/src/generated/schemas/azureServiceBusNamespaceImportData.json +1 -0
  81. package/src/generated/schemas/azureServiceBusQueueHeartbeatData.json +1 -0
  82. package/src/generated/schemas/azureStorageAccountEndpoints.json +1 -0
  83. package/src/generated/schemas/azureStorageAccountHeartbeatData.json +1 -0
  84. package/src/generated/schemas/azureStorageAccountImportData.json +1 -0
  85. package/src/generated/schemas/azureStorageImportData.json +1 -0
  86. package/src/generated/schemas/azureTableKvHeartbeatData.json +1 -0
  87. package/src/generated/schemas/azureVaultImportData.json +1 -0
  88. package/src/generated/schemas/azureVnetNetworkHeartbeatData.json +1 -0
  89. package/src/generated/schemas/azureWorkerImportData.json +1 -0
  90. package/src/generated/schemas/baseResource.json +1 -1
  91. package/src/generated/schemas/baseResourceOutputs.json +1 -1
  92. package/src/generated/schemas/build.json +1 -1
  93. package/src/generated/schemas/buildHeartbeatData.json +1 -0
  94. package/src/generated/schemas/buildHeartbeatStatus.json +1 -0
  95. package/src/generated/schemas/computeCapacityBlocker.json +1 -0
  96. package/src/generated/schemas/computeCapacityBlockerCategory.json +1 -0
  97. package/src/generated/schemas/computeCapacityGroupStatus.json +1 -0
  98. package/src/generated/schemas/computeCapacityRecommendation.json +1 -0
  99. package/src/generated/schemas/computeClusterHeartbeatData.json +1 -0
  100. package/src/generated/schemas/computeClusterHeartbeatStatus.json +1 -0
  101. package/src/generated/schemas/container.json +1 -1
  102. package/src/generated/schemas/containerHeartbeatData.json +1 -0
  103. package/src/generated/schemas/containerOutputs.json +1 -1
  104. package/src/generated/schemas/containerStatus.json +1 -1
  105. package/src/generated/schemas/customCertificateConfig.json +1 -1
  106. package/src/generated/schemas/customDomainConfig.json +1 -1
  107. package/src/generated/schemas/daemon.json +1 -0
  108. package/src/generated/schemas/daemonCode.json +1 -0
  109. package/src/generated/schemas/daemonHeartbeatData.json +1 -0
  110. package/src/generated/schemas/daemonOutputs.json +1 -0
  111. package/src/generated/schemas/devResourceInfo.json +1 -1
  112. package/src/generated/schemas/devStatus.json +1 -1
  113. package/src/generated/schemas/domainSettings.json +1 -1
  114. package/src/generated/schemas/eventChange.json +1 -1
  115. package/src/generated/schemas/gcpArtifactRegistryHeartbeatData.json +1 -0
  116. package/src/generated/schemas/gcpArtifactRegistryImportData.json +1 -0
  117. package/src/generated/schemas/gcpBuildImportData.json +1 -0
  118. package/src/generated/schemas/gcpCloudBuildHeartbeatData.json +1 -0
  119. package/src/generated/schemas/gcpCloudRunWorkerHeartbeatData.json +1 -0
  120. package/src/generated/schemas/gcpCloudStorageHeartbeatData.json +1 -0
  121. package/src/generated/schemas/gcpComputeClusterHeartbeatData.json +1 -0
  122. package/src/generated/schemas/gcpComputeClusterImportData.json +1 -0
  123. package/src/generated/schemas/gcpDaemonHeartbeatData.json +1 -0
  124. package/src/generated/schemas/gcpFirestoreKvHeartbeatData.json +1 -0
  125. package/src/generated/schemas/gcpKvImportData.json +1 -0
  126. package/src/generated/schemas/gcpNetworkImportData.json +1 -0
  127. package/src/generated/schemas/gcpPlatformPermission.json +1 -1
  128. package/src/generated/schemas/gcpPubSubQueueHeartbeatData.json +1 -0
  129. package/src/generated/schemas/gcpQueueImportData.json +1 -0
  130. package/src/generated/schemas/gcpRemoteStackManagementHeartbeatData.json +1 -0
  131. package/src/generated/schemas/gcpRemoteStackManagementImportData.json +1 -0
  132. package/src/generated/schemas/gcpSecretManagerVaultHeartbeatData.json +1 -0
  133. package/src/generated/schemas/gcpServiceAccountHeartbeatData.json +1 -0
  134. package/src/generated/schemas/gcpServiceAccountImportData.json +1 -0
  135. package/src/generated/schemas/gcpServiceActivationImportData.json +1 -0
  136. package/src/generated/schemas/gcpServiceUsageActivationHeartbeatData.json +1 -0
  137. package/src/generated/schemas/gcpStorageImportData.json +1 -0
  138. package/src/generated/schemas/gcpVaultImportData.json +1 -0
  139. package/src/generated/schemas/gcpVpcNetworkHeartbeatData.json +1 -0
  140. package/src/generated/schemas/gcpWorkerImportData.json +1 -0
  141. package/src/generated/schemas/heartbeatBackend.json +1 -0
  142. package/src/generated/schemas/heartbeatCollectionIssue.json +1 -0
  143. package/src/generated/schemas/heartbeatCollectionIssueReason.json +1 -0
  144. package/src/generated/schemas/heartbeatIssueSeverity.json +1 -0
  145. package/src/generated/schemas/horizonContainerHeartbeatData.json +1 -0
  146. package/src/generated/schemas/horizonWorkloadSchedulingMode.json +1 -0
  147. package/src/generated/schemas/importSourceKind.json +1 -0
  148. package/src/generated/schemas/importedResource.json +1 -0
  149. package/src/generated/schemas/ingress.json +1 -1
  150. package/src/generated/schemas/kubernetesBuildHeartbeatData.json +1 -0
  151. package/src/generated/schemas/kubernetesCertificateMode.json +1 -0
  152. package/src/generated/schemas/kubernetesCloudReference.json +1 -0
  153. package/src/generated/schemas/kubernetesClusterHeartbeatData.json +1 -0
  154. package/src/generated/schemas/kubernetesClusterNodeStatus.json +1 -0
  155. package/src/generated/schemas/kubernetesClusterOwnership.json +1 -0
  156. package/src/generated/schemas/kubernetesClusterSettings.json +1 -0
  157. package/src/generated/schemas/kubernetesContainerHeartbeatData.json +1 -0
  158. package/src/generated/schemas/kubernetesCustomCertificateConfig.json +1 -0
  159. package/src/generated/schemas/kubernetesDaemonHeartbeatData.json +1 -0
  160. package/src/generated/schemas/kubernetesEventInvolvedObject.json +1 -0
  161. package/src/generated/schemas/kubernetesEventSnapshot.json +1 -0
  162. package/src/generated/schemas/kubernetesEventSource.json +1 -0
  163. package/src/generated/schemas/kubernetesExposureSettings.json +1 -0
  164. package/src/generated/schemas/kubernetesGatewayRouteProfile.json +1 -0
  165. package/src/generated/schemas/kubernetesIngressRouteProfile.json +1 -0
  166. package/src/generated/schemas/kubernetesNodeConditionStatus.json +1 -0
  167. package/src/generated/schemas/kubernetesNodeResources.json +1 -0
  168. package/src/generated/schemas/kubernetesNodeUsage.json +1 -0
  169. package/src/generated/schemas/kubernetesOwnerReference.json +1 -0
  170. package/src/generated/schemas/kubernetesPodRuntimeUnitStatus.json +1 -0
  171. package/src/generated/schemas/kubernetesRouteProfile.json +1 -0
  172. package/src/generated/schemas/kubernetesRouteProviderOptions.json +1 -0
  173. package/src/generated/schemas/kubernetesSecretVaultHeartbeatData.json +1 -0
  174. package/src/generated/schemas/kubernetesSettings.json +1 -0
  175. package/src/generated/schemas/kubernetesTlsSecretRef.json +1 -0
  176. package/src/generated/schemas/kubernetesWorkerHeartbeatData.json +1 -0
  177. package/src/generated/schemas/kubernetesWorkloadCondition.json +1 -0
  178. package/src/generated/schemas/kubernetesWorkloadKind.json +1 -0
  179. package/src/generated/schemas/kubernetesWorkloadStatus.json +1 -0
  180. package/src/generated/schemas/kvHeartbeatData.json +1 -0
  181. package/src/generated/schemas/kvHeartbeatStatus.json +1 -0
  182. package/src/generated/schemas/localArtifactRegistryHeartbeatData.json +1 -0
  183. package/src/generated/schemas/localComputeClusterHeartbeatData.json +1 -0
  184. package/src/generated/schemas/localContainerHeartbeatData.json +1 -0
  185. package/src/generated/schemas/localDaemonHeartbeatData.json +1 -0
  186. package/src/generated/schemas/localKvHeartbeatData.json +1 -0
  187. package/src/generated/schemas/localQueueHeartbeatData.json +1 -0
  188. package/src/generated/schemas/localRuntimeEventSnapshot.json +1 -0
  189. package/src/generated/schemas/localRuntimeEventSubject.json +1 -0
  190. package/src/generated/schemas/localRuntimeUnitKind.json +1 -0
  191. package/src/generated/schemas/localRuntimeUnitStatus.json +1 -0
  192. package/src/generated/schemas/localServiceAccountHeartbeatData.json +1 -0
  193. package/src/generated/schemas/localStorageHeartbeatData.json +1 -0
  194. package/src/generated/schemas/localVaultHeartbeatData.json +1 -0
  195. package/src/generated/schemas/localWorkerHeartbeatData.json +1 -0
  196. package/src/generated/schemas/managedRuntimeEventInvolvedObject.json +1 -0
  197. package/src/generated/schemas/managedRuntimeEventSnapshot.json +1 -0
  198. package/src/generated/schemas/managedRuntimeEventSource.json +1 -0
  199. package/src/generated/schemas/managedRuntimeUnitStatus.json +1 -0
  200. package/src/generated/schemas/managementConfig.json +1 -1
  201. package/src/generated/schemas/managementPermissions.json +1 -1
  202. package/src/generated/schemas/metricSample.json +1 -0
  203. package/src/generated/schemas/metricUnit.json +1 -0
  204. package/src/generated/schemas/networkHeartbeatData.json +1 -0
  205. package/src/generated/schemas/networkHeartbeatStatus.json +1 -0
  206. package/src/generated/schemas/observedCounts.json +1 -0
  207. package/src/generated/schemas/observedHealth.json +1 -0
  208. package/src/generated/schemas/permissionGrant.json +1 -1
  209. package/src/generated/schemas/permissionProfile.json +1 -1
  210. package/src/generated/schemas/permissionSet.json +1 -1
  211. package/src/generated/schemas/permissionSetReference.json +1 -1
  212. package/src/generated/schemas/permissionsConfig.json +1 -1
  213. package/src/generated/schemas/persistentStorage.json +1 -1
  214. package/src/generated/schemas/platformPermissions.json +1 -1
  215. package/src/generated/schemas/providerFleetStatus.json +1 -0
  216. package/src/generated/schemas/providerLifecycleState.json +1 -0
  217. package/src/generated/schemas/queueHeartbeatData.json +1 -0
  218. package/src/generated/schemas/queueHeartbeatStatus.json +1 -0
  219. package/src/generated/schemas/rawHeartbeatSnippet.json +1 -0
  220. package/src/generated/schemas/rawHeartbeatSnippetFormat.json +1 -0
  221. package/src/generated/schemas/readinessProbe.json +1 -1
  222. package/src/generated/schemas/remoteStackManagementHeartbeatData.json +1 -0
  223. package/src/generated/schemas/remoteStackManagementHeartbeatStatus.json +1 -0
  224. package/src/generated/schemas/resourceEntry.json +1 -1
  225. package/src/generated/schemas/resourceHeartbeat.json +1 -0
  226. package/src/generated/schemas/resourceHeartbeatData.json +1 -0
  227. package/src/generated/schemas/resourceRef.json +1 -1
  228. package/src/generated/schemas/resourceType.json +1 -1
  229. package/src/generated/schemas/serviceAccount.json +1 -1
  230. package/src/generated/schemas/serviceAccountHeartbeatData.json +1 -0
  231. package/src/generated/schemas/serviceAccountHeartbeatStatus.json +1 -0
  232. package/src/generated/schemas/serviceActivationHeartbeatData.json +1 -0
  233. package/src/generated/schemas/serviceActivationHeartbeatStatus.json +1 -0
  234. package/src/generated/schemas/stack.json +1 -1
  235. package/src/generated/schemas/stackImportRequest.json +1 -0
  236. package/src/generated/schemas/stackImportResponse.json +1 -0
  237. package/src/generated/schemas/stackResourceState.json +1 -1
  238. package/src/generated/schemas/stackSettings.json +1 -1
  239. package/src/generated/schemas/stackState.json +1 -1
  240. package/src/generated/schemas/storageHeartbeatData.json +1 -0
  241. package/src/generated/schemas/storageHeartbeatStatus.json +1 -0
  242. package/src/generated/schemas/value.json +1 -0
  243. package/src/generated/schemas/vault.json +1 -1
  244. package/src/generated/schemas/vaultHeartbeatData.json +1 -0
  245. package/src/generated/schemas/vaultHeartbeatStatus.json +1 -0
  246. package/src/generated/schemas/worker.json +1 -0
  247. package/src/generated/schemas/workerCode.json +1 -0
  248. package/src/generated/schemas/workerHeartbeatData.json +1 -0
  249. package/src/generated/schemas/workerOutputs.json +1 -0
  250. package/src/generated/schemas/workerTrigger.json +1 -0
  251. package/src/generated/schemas/workloadHeartbeatStatus.json +1 -0
  252. package/src/generated/schemas/workloadReplicaStatus.json +1 -0
  253. package/src/generated/zod/agent-status-schema.ts +1 -1
  254. package/src/generated/zod/alien-event-schema.ts +5 -4
  255. package/src/generated/zod/artifact-registry-heartbeat-data-schema.ts +22 -0
  256. package/src/generated/zod/artifact-registry-heartbeat-status-schema.ts +26 -0
  257. package/src/generated/zod/aws-artifact-registry-import-data-schema.ts +21 -0
  258. package/src/generated/zod/aws-build-import-data-schema.ts +19 -0
  259. package/src/generated/zod/aws-code-build-heartbeat-data-schema.ts +35 -0
  260. package/src/generated/zod/aws-compute-cluster-heartbeat-data-schema.ts +37 -0
  261. package/src/generated/zod/aws-compute-cluster-import-data-schema.ts +17 -0
  262. package/src/generated/zod/aws-daemon-heartbeat-data-schema.ts +35 -0
  263. package/src/generated/zod/aws-dynamo-db-key-schema-element-schema.ts +13 -0
  264. package/src/generated/zod/aws-dynamo-db-kv-heartbeat-data-schema.ts +38 -0
  265. package/src/generated/zod/aws-ecr-artifact-registry-heartbeat-data-schema.ts +27 -0
  266. package/src/generated/zod/aws-ecr-repository-heartbeat-data-schema.ts +20 -0
  267. package/src/generated/zod/aws-iam-role-service-account-heartbeat-data-schema.ts +34 -0
  268. package/src/generated/zod/aws-kv-import-data-schema.ts +16 -0
  269. package/src/generated/zod/aws-lambda-worker-heartbeat-data-schema.ts +34 -0
  270. package/src/generated/zod/aws-network-import-data-schema.ts +26 -0
  271. package/src/generated/zod/aws-parameter-store-vault-heartbeat-data-schema.ts +27 -0
  272. package/src/generated/zod/aws-permission-effect-schema.ts +10 -0
  273. package/src/generated/zod/aws-platform-permission-schema.ts +7 -1
  274. package/src/generated/zod/aws-queue-import-data-schema.ts +17 -0
  275. package/src/generated/zod/aws-remote-stack-management-heartbeat-data-schema.ts +18 -0
  276. package/src/generated/zod/aws-remote-stack-management-import-data-schema.ts +17 -0
  277. package/src/generated/zod/aws-s3-storage-heartbeat-data-schema.ts +31 -0
  278. package/src/generated/zod/aws-service-account-import-data-schema.ts +17 -0
  279. package/src/generated/zod/aws-sqs-queue-heartbeat-data-schema.ts +38 -0
  280. package/src/generated/zod/aws-storage-import-data-schema.ts +16 -0
  281. package/src/generated/zod/aws-vault-import-data-schema.ts +17 -0
  282. package/src/generated/zod/aws-vpc-network-heartbeat-data-schema.ts +26 -0
  283. package/src/generated/zod/aws-worker-import-data-schema.ts +25 -0
  284. package/src/generated/zod/azure-artifact-registry-import-data-schema.ts +20 -0
  285. package/src/generated/zod/azure-blob-storage-heartbeat-data-schema.ts +43 -0
  286. package/src/generated/zod/azure-build-import-data-schema.ts +21 -0
  287. package/src/generated/zod/azure-compute-cluster-heartbeat-data-schema.ts +37 -0
  288. package/src/generated/zod/azure-compute-cluster-import-data-schema.ts +17 -0
  289. package/src/generated/zod/azure-container-apps-build-heartbeat-data-schema.ts +20 -0
  290. package/src/generated/zod/azure-container-apps-environment-heartbeat-data-schema.ts +32 -0
  291. package/src/generated/zod/azure-container-apps-environment-heartbeat-status-schema.ts +26 -0
  292. package/src/generated/zod/azure-container-apps-environment-import-data-schema.ts +20 -0
  293. package/src/generated/zod/azure-container-apps-environment-workload-profile-schema.ts +15 -0
  294. package/src/generated/zod/azure-container-apps-worker-heartbeat-data-schema.ts +25 -0
  295. package/src/generated/zod/azure-container-registry-heartbeat-data-schema.ts +41 -0
  296. package/src/generated/zod/azure-daemon-heartbeat-data-schema.ts +35 -0
  297. package/src/generated/zod/azure-key-vault-heartbeat-data-schema.ts +31 -0
  298. package/src/generated/zod/azure-kv-import-data-schema.ts +19 -0
  299. package/src/generated/zod/azure-managed-identity-service-account-heartbeat-data-schema.ts +30 -0
  300. package/src/generated/zod/azure-management-config-schema.ts +3 -4
  301. package/src/generated/zod/azure-network-import-data-schema.ts +22 -0
  302. package/src/generated/zod/azure-platform-permission-schema.ts +3 -1
  303. package/src/generated/zod/azure-queue-import-data-schema.ts +18 -0
  304. package/src/generated/zod/azure-remote-stack-management-heartbeat-data-schema.ts +22 -0
  305. package/src/generated/zod/azure-remote-stack-management-import-data-schema.ts +21 -0
  306. package/src/generated/zod/azure-resource-group-heartbeat-data-schema.ts +22 -0
  307. package/src/generated/zod/azure-resource-group-heartbeat-status-schema.ts +26 -0
  308. package/src/generated/zod/azure-resource-group-import-data-schema.ts +17 -0
  309. package/src/generated/zod/azure-resource-provider-activation-heartbeat-data-schema.ts +21 -0
  310. package/src/generated/zod/azure-service-account-import-data-schema.ts +20 -0
  311. package/src/generated/zod/azure-service-activation-import-data-schema.ts +17 -0
  312. package/src/generated/zod/azure-service-bus-namespace-heartbeat-data-schema.ts +34 -0
  313. package/src/generated/zod/azure-service-bus-namespace-import-data-schema.ts +18 -0
  314. package/src/generated/zod/azure-service-bus-queue-heartbeat-data-schema.ts +46 -0
  315. package/src/generated/zod/azure-storage-account-endpoints-schema.ts +17 -0
  316. package/src/generated/zod/azure-storage-account-heartbeat-data-schema.ts +42 -0
  317. package/src/generated/zod/azure-storage-account-import-data-schema.ts +22 -0
  318. package/src/generated/zod/azure-storage-import-data-schema.ts +18 -0
  319. package/src/generated/zod/azure-table-kv-heartbeat-data-schema.ts +26 -0
  320. package/src/generated/zod/azure-vault-import-data-schema.ts +18 -0
  321. package/src/generated/zod/azure-vnet-network-heartbeat-data-schema.ts +27 -0
  322. package/src/generated/zod/azure-worker-import-data-schema.ts +18 -0
  323. package/src/generated/zod/build-heartbeat-data-schema.ts +22 -0
  324. package/src/generated/zod/build-heartbeat-status-schema.ts +26 -0
  325. package/src/generated/zod/compute-capacity-blocker-category-schema.ts +10 -0
  326. package/src/generated/zod/compute-capacity-blocker-schema.ts +19 -0
  327. package/src/generated/zod/compute-capacity-group-status-schema.ts +25 -0
  328. package/src/generated/zod/compute-capacity-recommendation-schema.ts +18 -0
  329. package/src/generated/zod/compute-cluster-heartbeat-data-schema.ts +22 -0
  330. package/src/generated/zod/compute-cluster-heartbeat-status-schema.ts +26 -0
  331. package/src/generated/zod/container-heartbeat-data-schema.ts +19 -0
  332. package/src/generated/zod/container-outputs-schema.ts +2 -2
  333. package/src/generated/zod/container-schema.ts +3 -3
  334. package/src/generated/zod/container-status-schema.ts +2 -2
  335. package/src/generated/zod/custom-certificate-config-schema.ts +4 -0
  336. package/src/generated/zod/daemon-code-schema.ts +20 -0
  337. package/src/generated/zod/daemon-heartbeat-data-schema.ts +25 -0
  338. package/src/generated/zod/daemon-outputs-schema.ts +13 -0
  339. package/src/generated/zod/daemon-schema.ts +35 -0
  340. package/src/generated/zod/dev-resource-info-schema.ts +1 -1
  341. package/src/generated/zod/gcp-artifact-registry-heartbeat-data-schema.ts +35 -0
  342. package/src/generated/zod/gcp-artifact-registry-import-data-schema.ts +21 -0
  343. package/src/generated/zod/gcp-build-import-data-schema.ts +22 -0
  344. package/src/generated/zod/gcp-cloud-build-heartbeat-data-schema.ts +20 -0
  345. package/src/generated/zod/gcp-cloud-run-worker-heartbeat-data-schema.ts +29 -0
  346. package/src/generated/zod/gcp-cloud-storage-heartbeat-data-schema.ts +33 -0
  347. package/src/generated/zod/gcp-compute-cluster-heartbeat-data-schema.ts +37 -0
  348. package/src/generated/zod/gcp-compute-cluster-import-data-schema.ts +17 -0
  349. package/src/generated/zod/gcp-daemon-heartbeat-data-schema.ts +35 -0
  350. package/src/generated/zod/gcp-firestore-kv-heartbeat-data-schema.ts +32 -0
  351. package/src/generated/zod/gcp-kv-import-data-schema.ts +17 -0
  352. package/src/generated/zod/gcp-network-import-data-schema.ts +22 -0
  353. package/src/generated/zod/gcp-platform-permission-schema.ts +3 -1
  354. package/src/generated/zod/gcp-pub-sub-queue-heartbeat-data-schema.ts +54 -0
  355. package/src/generated/zod/gcp-queue-import-data-schema.ts +19 -0
  356. package/src/generated/zod/gcp-remote-stack-management-heartbeat-data-schema.ts +19 -0
  357. package/src/generated/zod/gcp-remote-stack-management-import-data-schema.ts +19 -0
  358. package/src/generated/zod/gcp-secret-manager-vault-heartbeat-data-schema.ts +19 -0
  359. package/src/generated/zod/gcp-service-account-heartbeat-data-schema.ts +28 -0
  360. package/src/generated/zod/gcp-service-account-import-data-schema.ts +18 -0
  361. package/src/generated/zod/gcp-service-activation-import-data-schema.ts +17 -0
  362. package/src/generated/zod/gcp-service-usage-activation-heartbeat-data-schema.ts +22 -0
  363. package/src/generated/zod/gcp-storage-import-data-schema.ts +18 -0
  364. package/src/generated/zod/gcp-vault-import-data-schema.ts +16 -0
  365. package/src/generated/zod/gcp-vpc-network-heartbeat-data-schema.ts +25 -0
  366. package/src/generated/zod/gcp-worker-import-data-schema.ts +23 -0
  367. package/src/generated/zod/heartbeat-backend-schema.ts +10 -0
  368. package/src/generated/zod/heartbeat-collection-issue-reason-schema.ts +10 -0
  369. package/src/generated/zod/heartbeat-collection-issue-schema.ts +21 -0
  370. package/src/generated/zod/heartbeat-issue-severity-schema.ts +10 -0
  371. package/src/generated/zod/horizon-container-heartbeat-data-schema.ts +41 -0
  372. package/src/generated/zod/horizon-workload-scheduling-mode-schema.ts +10 -0
  373. package/src/generated/zod/import-source-kind-schema.ts +13 -0
  374. package/src/generated/zod/imported-resource-schema.ts +22 -0
  375. package/src/generated/zod/index.ts +391 -9
  376. package/src/generated/zod/ingress-schema.ts +2 -2
  377. package/src/generated/zod/kubernetes-build-heartbeat-data-schema.ts +28 -0
  378. package/src/generated/zod/kubernetes-certificate-mode-schema.ts +30 -0
  379. package/src/generated/zod/kubernetes-cloud-reference-schema.ts +21 -0
  380. package/src/generated/zod/kubernetes-cluster-heartbeat-data-schema.ts +41 -0
  381. package/src/generated/zod/kubernetes-cluster-node-status-schema.ts +35 -0
  382. package/src/generated/zod/kubernetes-cluster-ownership-schema.ts +13 -0
  383. package/src/generated/zod/kubernetes-cluster-settings-schema.ts +23 -0
  384. package/src/generated/zod/kubernetes-container-heartbeat-data-schema.ts +45 -0
  385. package/src/generated/zod/kubernetes-custom-certificate-config-schema.ts +15 -0
  386. package/src/generated/zod/kubernetes-daemon-heartbeat-data-schema.ts +42 -0
  387. package/src/generated/zod/kubernetes-event-involved-object-schema.ts +18 -0
  388. package/src/generated/zod/kubernetes-event-snapshot-schema.ts +30 -0
  389. package/src/generated/zod/kubernetes-event-source-schema.ts +13 -0
  390. package/src/generated/zod/kubernetes-exposure-settings-schema.ts +34 -0
  391. package/src/generated/zod/kubernetes-gateway-route-profile-schema.ts +27 -0
  392. package/src/generated/zod/kubernetes-ingress-route-profile-schema.ts +26 -0
  393. package/src/generated/zod/kubernetes-node-condition-status-schema.ts +15 -0
  394. package/src/generated/zod/kubernetes-node-resources-schema.ts +19 -0
  395. package/src/generated/zod/kubernetes-node-usage-schema.ts +18 -0
  396. package/src/generated/zod/kubernetes-owner-reference-schema.ts +15 -0
  397. package/src/generated/zod/kubernetes-pod-runtime-unit-status-schema.ts +31 -0
  398. package/src/generated/zod/kubernetes-route-profile-schema.ts +19 -0
  399. package/src/generated/zod/kubernetes-route-provider-options-schema.ts +27 -0
  400. package/src/generated/zod/kubernetes-secret-vault-heartbeat-data-schema.ts +18 -0
  401. package/src/generated/zod/kubernetes-settings-schema.ts +22 -0
  402. package/src/generated/zod/kubernetes-tls-secret-ref-schema.ts +16 -0
  403. package/src/generated/zod/kubernetes-worker-heartbeat-data-schema.ts +46 -0
  404. package/src/generated/zod/kubernetes-workload-condition-schema.ts +16 -0
  405. package/src/generated/zod/kubernetes-workload-kind-schema.ts +10 -0
  406. package/src/generated/zod/kubernetes-workload-status-schema.ts +22 -0
  407. package/src/generated/zod/kv-heartbeat-data-schema.ts +22 -0
  408. package/src/generated/zod/kv-heartbeat-status-schema.ts +26 -0
  409. package/src/generated/zod/local-artifact-registry-heartbeat-data-schema.ts +17 -0
  410. package/src/generated/zod/local-compute-cluster-heartbeat-data-schema.ts +30 -0
  411. package/src/generated/zod/local-container-heartbeat-data-schema.ts +39 -0
  412. package/src/generated/zod/local-daemon-heartbeat-data-schema.ts +30 -0
  413. package/src/generated/zod/local-kv-heartbeat-data-schema.ts +20 -0
  414. package/src/generated/zod/local-queue-heartbeat-data-schema.ts +18 -0
  415. package/src/generated/zod/local-runtime-event-snapshot-schema.ts +26 -0
  416. package/src/generated/zod/local-runtime-event-subject-schema.ts +14 -0
  417. package/src/generated/zod/local-runtime-unit-kind-schema.ts +10 -0
  418. package/src/generated/zod/local-runtime-unit-status-schema.ts +28 -0
  419. package/src/generated/zod/local-service-account-heartbeat-data-schema.ts +17 -0
  420. package/src/generated/zod/local-storage-heartbeat-data-schema.ts +20 -0
  421. package/src/generated/zod/local-vault-heartbeat-data-schema.ts +21 -0
  422. package/src/generated/zod/local-worker-heartbeat-data-schema.ts +35 -0
  423. package/src/generated/zod/managed-runtime-event-involved-object-schema.ts +20 -0
  424. package/src/generated/zod/managed-runtime-event-snapshot-schema.ts +34 -0
  425. package/src/generated/zod/managed-runtime-event-source-schema.ts +13 -0
  426. package/src/generated/zod/managed-runtime-unit-status-schema.ts +34 -0
  427. package/src/generated/zod/metric-sample-schema.ts +16 -0
  428. package/src/generated/zod/metric-unit-schema.ts +10 -0
  429. package/src/generated/zod/network-heartbeat-data-schema.ts +19 -0
  430. package/src/generated/zod/network-heartbeat-status-schema.ts +26 -0
  431. package/src/generated/zod/observed-counts-schema.ts +14 -0
  432. package/src/generated/zod/observed-health-schema.ts +10 -0
  433. package/src/generated/zod/permission-grant-schema.ts +3 -1
  434. package/src/generated/zod/persistent-storage-schema.ts +2 -5
  435. package/src/generated/zod/provider-fleet-status-schema.ts +16 -0
  436. package/src/generated/zod/provider-lifecycle-state-schema.ts +10 -0
  437. package/src/generated/zod/queue-heartbeat-data-schema.ts +22 -0
  438. package/src/generated/zod/queue-heartbeat-status-schema.ts +26 -0
  439. package/src/generated/zod/raw-heartbeat-snippet-format-schema.ts +10 -0
  440. package/src/generated/zod/raw-heartbeat-snippet-schema.ts +19 -0
  441. package/src/generated/zod/readiness-probe-schema.ts +2 -2
  442. package/src/generated/zod/remote-stack-management-heartbeat-data-schema.ts +19 -0
  443. package/src/generated/zod/remote-stack-management-heartbeat-status-schema.ts +26 -0
  444. package/src/generated/zod/resource-heartbeat-data-schema.ts +124 -0
  445. package/src/generated/zod/resource-heartbeat-schema.ts +34 -0
  446. package/src/generated/zod/service-account-heartbeat-data-schema.ts +22 -0
  447. package/src/generated/zod/service-account-heartbeat-status-schema.ts +26 -0
  448. package/src/generated/zod/service-activation-heartbeat-data-schema.ts +16 -0
  449. package/src/generated/zod/service-activation-heartbeat-status-schema.ts +26 -0
  450. package/src/generated/zod/stack-import-request-schema.ts +46 -0
  451. package/src/generated/zod/stack-import-response-schema.ts +24 -0
  452. package/src/generated/zod/stack-resource-state-schema.ts +5 -2
  453. package/src/generated/zod/stack-schema.ts +5 -1
  454. package/src/generated/zod/stack-settings-schema.ts +4 -0
  455. package/src/generated/zod/storage-heartbeat-data-schema.ts +22 -0
  456. package/src/generated/zod/storage-heartbeat-status-schema.ts +26 -0
  457. package/src/generated/zod/value-schema.ts +10 -0
  458. package/src/generated/zod/vault-heartbeat-data-schema.ts +25 -0
  459. package/src/generated/zod/vault-heartbeat-status-schema.ts +26 -0
  460. package/src/generated/zod/vault-schema.ts +2 -2
  461. package/src/generated/zod/{function-code-schema.ts → worker-code-schema.ts} +4 -4
  462. package/src/generated/zod/worker-heartbeat-data-schema.ts +25 -0
  463. package/src/generated/zod/{function-outputs-schema.ts → worker-outputs-schema.ts} +6 -6
  464. package/src/generated/zod/worker-schema.ts +43 -0
  465. package/src/generated/zod/{function-trigger-schema.ts → worker-trigger-schema.ts} +4 -4
  466. package/src/generated/zod/workload-heartbeat-status-schema.ts +26 -0
  467. package/src/generated/zod/workload-replica-status-schema.ts +17 -0
  468. package/src/get-resource-outputs.ts +4 -4
  469. package/src/index.ts +310 -1
  470. package/src/resource.ts +1 -1
  471. package/src/service-account.ts +2 -2
  472. package/src/stack.ts +11 -1
  473. package/src/vault.ts +1 -1
  474. package/src/{function.ts → worker.ts} +63 -64
  475. package/src/generated/schemas/function.json +0 -1
  476. package/src/generated/schemas/functionCode.json +0 -1
  477. package/src/generated/schemas/functionOutputs.json +0 -1
  478. package/src/generated/schemas/functionTrigger.json +0 -1
  479. package/src/generated/zod/function-schema.ts +0 -43
@@ -1,76 +1,75 @@
1
1
  import {
2
- type FunctionCode,
3
- type Function as FunctionConfig,
4
- FunctionSchema,
5
- type FunctionTrigger,
6
2
  type Ingress,
7
3
  type ReadinessProbe,
8
4
  type ResourceType,
5
+ type WorkerCode,
6
+ type Worker as WorkerConfig,
7
+ WorkerSchema,
8
+ type WorkerTrigger,
9
9
  } from "./generated/index.js"
10
10
  import { Resource } from "./resource.js"
11
11
 
12
12
  export type {
13
13
  Ingress,
14
- Function as FunctionConfig,
15
- FunctionOutputs,
16
- FunctionTrigger,
14
+ Worker as WorkerConfig,
15
+ WorkerOutputs,
16
+ WorkerTrigger,
17
17
  ReadinessProbe,
18
18
  HttpMethod,
19
19
  } from "./generated/index.js"
20
20
  export {
21
21
  IngressSchema,
22
- FunctionSchema as FunctionConfigSchema,
23
- FunctionOutputsSchema,
24
- FunctionTriggerSchema,
22
+ WorkerSchema as WorkerConfigSchema,
23
+ WorkerOutputsSchema,
24
+ WorkerTriggerSchema,
25
25
  ReadinessProbeSchema,
26
26
  HttpMethodSchema,
27
27
  } from "./generated/index.js"
28
28
 
29
29
  /**
30
- * Represents a serverless function that executes code in response to triggers or direct invocations.
31
- * Functions are the primary compute resource in serverless applications, designed to be stateless and ephemeral.
30
+ * Represents a serverless worker that executes code in response to triggers or direct invocations.
31
+ * Workers are the primary compute resource in serverless applications, designed to be stateless and ephemeral.
32
32
  */
33
- // biome-ignore lint/suspicious/noShadowRestrictedNames: intentionally shadows built-in `Function`
34
- export class Function {
35
- private _config: Partial<FunctionConfig> = {
33
+ export class Worker {
34
+ private _config: Partial<WorkerConfig> = {
36
35
  links: [],
37
36
  triggers: [],
38
37
  environment: {},
39
38
  }
40
39
 
41
40
  /**
42
- * Creates a new Function builder.
43
- * @param id Identifier for the function. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters.
41
+ * Creates a new Worker builder.
42
+ * @param id Identifier for the worker. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters.
44
43
  */
45
44
  constructor(id: string) {
46
45
  this._config.id = id
47
46
  }
48
47
 
49
48
  /**
50
- * Returns a ResourceType representing any function resource.
51
- * Used for creating permission targets that apply to all function resources.
52
- * @returns The "function" resource type.
49
+ * Returns a ResourceType representing any worker resource.
50
+ * Used for creating permission targets that apply to all worker resources.
51
+ * @returns The "worker" resource type.
53
52
  */
54
53
  public static any(): ResourceType {
55
- return "function"
54
+ return "worker"
56
55
  }
57
56
 
58
57
  /**
59
- * Sets the code for the function, either a pre-built image or source code to be built.
60
- * @param code The function code configuration.
61
- * @returns The Function builder instance.
58
+ * Sets the code for the worker, either a pre-built image or source code to be built.
59
+ * @param code The worker code configuration.
60
+ * @returns The Worker builder instance.
62
61
  */
63
- public code(code: FunctionCode): this {
62
+ public code(code: WorkerCode): this {
64
63
  this._config.code = code
65
64
  return this
66
65
  }
67
66
 
68
67
  /**
69
- * Sets the memory allocated to the function in megabytes (MB).
68
+ * Sets the memory allocated to the worker in megabytes (MB).
70
69
  * Constraints: 128‑32768 MB (platform-specific limits may apply).
71
70
  * Default: 256 MB.
72
71
  * @param mb The memory in MB.
73
- * @returns The Function builder instance.
72
+ * @returns The Worker builder instance.
74
73
  */
75
74
  public memoryMb(mb: number): this {
76
75
  this._config.memoryMb = mb
@@ -78,11 +77,11 @@ export class Function {
78
77
  }
79
78
 
80
79
  /**
81
- * Sets the maximum execution time for the function in seconds.
80
+ * Sets the maximum execution time for the worker in seconds.
82
81
  * Constraints: 1‑3600 seconds (platform-specific limits may apply).
83
82
  * Default: 30 seconds.
84
83
  * @param sec The timeout in seconds.
85
- * @returns The Function builder instance.
84
+ * @returns The Worker builder instance.
86
85
  */
87
86
  public timeoutSeconds(sec: number): this {
88
87
  this._config.timeoutSeconds = sec
@@ -90,10 +89,10 @@ export class Function {
90
89
  }
91
90
 
92
91
  /**
93
- * Sets the maximum number of concurrent executions allowed for the function.
92
+ * Sets the maximum number of concurrent executions allowed for the worker.
94
93
  * `null` means platform default applies.
95
94
  * @param limit The concurrency limit, or `null` for platform default.
96
- * @returns The Function builder instance.
95
+ * @returns The Worker builder instance.
97
96
  */
98
97
  public concurrencyLimit(limit: number | undefined): this {
99
98
  this._config.concurrencyLimit = limit
@@ -101,13 +100,13 @@ export class Function {
101
100
  }
102
101
 
103
102
  /**
104
- * Controls network accessibility of the function.
105
- * - `public`: Function accessible from the internet.
106
- * - `private`: Function accessible only via cloud API calls / triggers.
107
- * - `vpc`: Function deployed within a VPC with specific network controls.
103
+ * Controls network accessibility of the worker.
104
+ * - `public`: Worker accessible from the internet.
105
+ * - `private`: Worker accessible only via cloud API calls / triggers.
106
+ * - `vpc`: Worker deployed within a VPC with specific network controls.
108
107
  * Default: `private`.
109
108
  * @param value The ingress type.
110
- * @returns The Function builder instance.
109
+ * @returns The Worker builder instance.
111
110
  */
112
111
  public ingress(value: Ingress): this {
113
112
  this._config.ingress = value
@@ -115,9 +114,9 @@ export class Function {
115
114
  }
116
115
 
117
116
  /**
118
- * Sets key-value pairs as environment variables for the function.
117
+ * Sets key-value pairs as environment variables for the worker.
119
118
  * @param env A map of environment variable names to their values.
120
- * @returns The Function builder instance.
119
+ * @returns The Worker builder instance.
121
120
  */
122
121
  public environment(env: Record<string, string>): this {
123
122
  this._config.environment = env
@@ -125,11 +124,11 @@ export class Function {
125
124
  }
126
125
 
127
126
  /**
128
- * Links another resource (e.g., Storage, KV, Queue) to this function.
129
- * This makes the linked resource accessible to the function, often by injecting
127
+ * Links another resource (e.g., Storage, KV, Queue) to this worker.
128
+ * This makes the linked resource accessible to the worker, often by injecting
130
129
  * environment variables or granting permissions.
131
130
  * @param resource The resource to link.
132
- * @returns The Function builder instance.
131
+ * @returns The Worker builder instance.
133
132
  */
134
133
  public link(resource: Resource): this {
135
134
  if (!this._config.links) {
@@ -140,11 +139,11 @@ export class Function {
140
139
  }
141
140
 
142
141
  /**
143
- * Assigns a permission profile to this function.
144
- * The profile defines the permissions granted to this function when interacting
142
+ * Assigns a permission profile to this worker.
143
+ * The profile defines the permissions granted to this worker when interacting
145
144
  * with other cloud resources.
146
145
  * @param permissions The permission profile name.
147
- * @returns The Function builder instance.
146
+ * @returns The Worker builder instance.
148
147
  */
149
148
  public permissions(permissions: string): this {
150
149
  this._config.permissions = permissions
@@ -152,9 +151,9 @@ export class Function {
152
151
  }
153
152
 
154
153
  /**
155
- * Configures a readiness probe for the function.
156
- * The probe will be executed after provisioning/update to verify the function is ready.
157
- * Only works with functions that have Public ingress.
154
+ * Configures a readiness probe for the worker.
155
+ * The probe will be executed after provisioning/update to verify the worker is ready.
156
+ * Only works with workers that have Public ingress.
158
157
  *
159
158
  * @example
160
159
  * ```typescript
@@ -163,7 +162,7 @@ export class Function {
163
162
  * path: "/health"
164
163
  * };
165
164
  *
166
- * const func = new Function("my-api")
165
+ * const func = new Worker("my-api")
167
166
  * .code({ type: "image", image: "my-api:latest" })
168
167
  * .ingress("public")
169
168
  * .readinessProbe(probe)
@@ -171,7 +170,7 @@ export class Function {
171
170
  * ```
172
171
  *
173
172
  * @param probe The readiness probe configuration.
174
- * @returns The Function builder instance.
173
+ * @returns The Worker builder instance.
175
174
  */
176
175
  public readinessProbe(probe: ReadinessProbe): this {
177
176
  this._config.readinessProbe = probe
@@ -179,11 +178,11 @@ export class Function {
179
178
  }
180
179
 
181
180
  /**
182
- * Enables or disables the Commands protocol for the function.
181
+ * Enables or disables the Commands protocol for the worker.
183
182
  * When enabled, the runtime polls the manager for pending commands and executes registered handlers.
184
183
  * Default: false.
185
- * @param enabled Whether to enable commands for this function.
186
- * @returns The Function builder instance.
184
+ * @param enabled Whether to enable commands for this worker.
185
+ * @returns The Worker builder instance.
187
186
  */
188
187
  public commandsEnabled(enabled: boolean): this {
189
188
  this._config.commandsEnabled = enabled
@@ -191,24 +190,24 @@ export class Function {
191
190
  }
192
191
 
193
192
  /**
194
- * Adds a trigger to the function. Functions can have multiple triggers.
195
- * Each trigger will independently invoke the function when its conditions are met.
193
+ * Adds a trigger to the worker. Workers can have multiple triggers.
194
+ * Each trigger will independently invoke the worker when its conditions are met.
196
195
  *
197
196
  * @example
198
197
  * ```typescript
199
198
  * // Queue trigger
200
- * const queueTrigger: FunctionTrigger = {
199
+ * const queueTrigger: WorkerTrigger = {
201
200
  * type: "queue",
202
201
  * queue: myQueue.ref()
203
202
  * };
204
203
  *
205
204
  * // Schedule trigger
206
- * const scheduleTrigg: FunctionTrigger = {
205
+ * const scheduleTrigg: WorkerTrigger = {
207
206
  * type: "schedule",
208
207
  * cron: "0 * * * *"
209
208
  * };
210
209
  *
211
- * const func = new Function("my-func")
210
+ * const func = new Worker("my-func")
212
211
  * .code({ type: "image", image: "my-image:latest" })
213
212
  * .trigger(queueTrigger)
214
213
  * .trigger(scheduleTrigger)
@@ -216,9 +215,9 @@ export class Function {
216
215
  * ```
217
216
  *
218
217
  * @param trigger The trigger configuration.
219
- * @returns The Function builder instance.
218
+ * @returns The Worker builder instance.
220
219
  */
221
- public trigger(trigger: FunctionTrigger): this {
220
+ public trigger(trigger: WorkerTrigger): this {
222
221
  if (!this._config.triggers) {
223
222
  this._config.triggers = []
224
223
  }
@@ -227,15 +226,15 @@ export class Function {
227
226
  }
228
227
 
229
228
  /**
230
- * Builds and validates the function configuration.
231
- * @returns An immutable Resource representing the configured function.
232
- * @throws Error if the function configuration is invalid (e.g., missing code).
229
+ * Builds and validates the worker configuration.
230
+ * @returns An immutable Resource representing the configured worker.
231
+ * @throws Error if the worker configuration is invalid (e.g., missing code).
233
232
  */
234
233
  public build(): Resource {
235
- const config = FunctionSchema.parse(this._config)
234
+ const config = WorkerSchema.parse(this._config)
236
235
 
237
236
  return new Resource({
238
- type: "function",
237
+ type: "worker",
239
238
  ...config,
240
239
  })
241
240
  }
@@ -1 +0,0 @@
1
- {"type":"object","description":"Represents a serverless function that executes code in response to triggers or direct invocations.\nFunctions are the primary compute resource in serverless applications, designed to be stateless and ephemeral.","required":["id","links","triggers","permissions","code"],"properties":{"code":{"description":"Code for the function, either a pre-built image or source code to be built.","oneOf":[{"type":"object","description":"Container image.","required":["image","type"],"properties":{"image":{"type":"string","description":"Container image (e.g., `ghcr.io/myorg/myimage:latest`)."},"type":{"type":"string","enum":["image"]}}},{"type":"object","description":"Source code to be built.","required":["src","toolchain","type"],"properties":{"src":{"type":"string","description":"The source directory to build from"},"toolchain":{"description":"Toolchain configuration with type-safe options","oneOf":[{"type":"object","description":"Rust with Cargo build system","required":["binaryName","type"],"properties":{"binaryName":{"type":"string","description":"Name of the binary to build and run"},"type":{"type":"string","enum":["rust"]}}},{"type":"object","description":"TypeScript/JavaScript compiled to single executable with Bun","required":["type"],"properties":{"binaryName":{"type":["string","null"],"description":"Name of the compiled binary (defaults to package.json name if not specified)"},"type":{"type":"string","enum":["typescript"]}}},{"type":"object","description":"Docker build from Dockerfile","required":["type"],"properties":{"buildArgs":{"type":["object","null"],"description":"Build arguments for docker build","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"dockerfile":{"type":["string","null"],"description":"Dockerfile path relative to src (default: \"Dockerfile\")"},"target":{"type":["string","null"],"description":"Multi-stage build target"},"type":{"type":"string","enum":["docker"]}}}],"x-readme-ref-name":"ToolchainConfig"},"type":{"type":"string","enum":["source"]}}}],"x-readme-ref-name":"FunctionCode"},"commandsEnabled":{"type":"boolean","description":"Whether the function can receive remote commands via the Commands protocol.\nWhen enabled, the runtime polls the manager for pending commands and executes registered handlers.","default":false},"concurrencyLimit":{"type":["integer","null"],"format":"int32","description":"Maximum number of concurrent executions allowed for the function.\nNone means platform default applies.","minimum":0},"environment":{"type":"object","description":"Key-value pairs to set as environment variables for the function.","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"id":{"type":"string","description":"Identifier for the function. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]).\nMaximum 64 characters."},"ingress":{"oneOf":[{"description":"Controls network accessibility of the function.","type":"string","enum":["public","private"],"x-readme-ref-name":"Ingress"}],"default":"private"},"links":{"type":"array","items":{"type":"object","description":"New ResourceRef that works with any resource type.\nThis can eventually replace the enum-based ResourceRef for full extensibility.","required":["type","id"],"properties":{"id":{"type":"string"},"type":{"type":"string","description":"Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior.","examples":["function","storage","queue","redis","postgres"],"x-readme-ref-name":"ResourceType"}},"x-readme-ref-name":"ResourceRef"},"description":"List of resource references this function depends on."},"memoryMb":{"type":"integer","format":"int32","description":"Memory allocated to the function in megabytes (MB).\nConstraints: 128‑32768 MB (platform-specific limits may apply)\nDefault: 256","default":256,"minimum":0},"permissions":{"type":"string","description":"Permission profile name that defines the permissions granted to this function.\nThis references a profile defined in the stack's permission definitions."},"readinessProbe":{"oneOf":[{"type":"null"},{"description":"Optional readiness probe configuration.\nOnly applicable for functions with Public ingress.\nWhen configured, the probe will be executed after provisioning/update to verify the function is ready.","type":"object","properties":{"method":{"description":"HTTP method to use for the probe request.\nDefault: GET","type":"string","enum":["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],"x-readme-ref-name":"HttpMethod"},"path":{"type":"string","description":"Path to request for the probe (e.g., \"/health\", \"/ready\").\nDefault: \"/\""}},"x-readme-ref-name":"ReadinessProbe"}]},"timeoutSeconds":{"type":"integer","format":"int32","description":"Maximum execution time for the function in seconds.\nConstraints: 1‑3600 seconds (platform-specific limits may apply)\nDefault: 30","default":180,"minimum":0},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","description":"Function triggered by queue messages (always 1 message per invocation)","required":["queue","type"],"properties":{"queue":{"type":"object","description":"Reference to the queue resource","required":["type","id"],"properties":{"id":{"type":"string"},"type":{"type":"string","description":"Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior.","examples":["function","storage","queue","redis","postgres"],"x-readme-ref-name":"ResourceType"}},"x-readme-ref-name":"ResourceRef"},"type":{"type":"string","enum":["queue"]}}},{"type":"object","description":"Function triggered by storage events (object created, deleted, etc.)","required":["storage","events","type"],"properties":{"events":{"type":"array","items":{"type":"string"},"description":"Events to trigger on (e.g., [\"created\", \"deleted\"])"},"storage":{"type":"object","description":"Reference to the storage resource","required":["type","id"],"properties":{"id":{"type":"string"},"type":{"type":"string","description":"Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior.","examples":["function","storage","queue","redis","postgres"],"x-readme-ref-name":"ResourceType"}},"x-readme-ref-name":"ResourceRef"},"type":{"type":"string","enum":["storage"]}}},{"type":"object","description":"Function triggered on a schedule (cron expression)","required":["cron","type"],"properties":{"cron":{"type":"string","description":"Cron expression for scheduling (standard 5-field unix cron)"},"type":{"type":"string","enum":["schedule"]}}}],"description":"Defines what triggers a function execution","x-readme-ref-name":"FunctionTrigger"},"description":"List of triggers that define what events automatically invoke this function.\nIf empty, the function is only invokable directly via HTTP calls or platform-specific invocation APIs.\nWhen configured, the function will be automatically invoked when any of the specified trigger conditions are met."}},"additionalProperties":false,"x-readme-ref-name":"Function"}
@@ -1 +0,0 @@
1
- {"oneOf":[{"type":"object","description":"Container image.","required":["image","type"],"properties":{"image":{"type":"string","description":"Container image (e.g., `ghcr.io/myorg/myimage:latest`)."},"type":{"type":"string","enum":["image"]}}},{"type":"object","description":"Source code to be built.","required":["src","toolchain","type"],"properties":{"src":{"type":"string","description":"The source directory to build from"},"toolchain":{"description":"Toolchain configuration with type-safe options","oneOf":[{"type":"object","description":"Rust with Cargo build system","required":["binaryName","type"],"properties":{"binaryName":{"type":"string","description":"Name of the binary to build and run"},"type":{"type":"string","enum":["rust"]}}},{"type":"object","description":"TypeScript/JavaScript compiled to single executable with Bun","required":["type"],"properties":{"binaryName":{"type":["string","null"],"description":"Name of the compiled binary (defaults to package.json name if not specified)"},"type":{"type":"string","enum":["typescript"]}}},{"type":"object","description":"Docker build from Dockerfile","required":["type"],"properties":{"buildArgs":{"type":["object","null"],"description":"Build arguments for docker build","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"dockerfile":{"type":["string","null"],"description":"Dockerfile path relative to src (default: \"Dockerfile\")"},"target":{"type":["string","null"],"description":"Multi-stage build target"},"type":{"type":"string","enum":["docker"]}}}],"x-readme-ref-name":"ToolchainConfig"},"type":{"type":"string","enum":["source"]}}}],"description":"Specifies the source of the function's executable code.\nThis can be a pre-built container image or source code that the system will build.","x-readme-ref-name":"FunctionCode"}
@@ -1 +0,0 @@
1
- {"type":"object","description":"Outputs generated by a successfully provisioned Function.","required":["functionName"],"properties":{"commandsPushTarget":{"type":["string","null"],"description":"Push target for commands delivery. Platform-specific:\n- AWS: Lambda function name or ARN\n- GCP: Full Pub/Sub topic path (projects/{project}/topics/{topic})\n- Azure: Service Bus \"{namespace}/{queue}\""},"functionName":{"type":"string","description":"The name of the function."},"identifier":{"type":["string","null"],"description":"The ARN or platform-specific identifier."},"loadBalancerEndpoint":{"oneOf":[{"type":"null"},{"description":"Load balancer endpoint information for DNS management (optional).\nUsed by the DNS controller to create custom domain mappings.","type":"object","required":["dnsName"],"properties":{"dnsName":{"type":"string","description":"The DNS name of the load balancer endpoint (e.g., ALB DNS, API Gateway domain)."},"hostedZoneId":{"type":["string","null"],"description":"AWS Route53 hosted zone ID (for ALIAS records). Only set on AWS."}},"x-readme-ref-name":"LoadBalancerEndpoint"}]},"url":{"type":["string","null"],"description":"The invocation URL (if applicable, e.g., for public ingress or specific platforms)."}},"x-readme-ref-name":"FunctionOutputs"}
@@ -1 +0,0 @@
1
- {"oneOf":[{"type":"object","description":"Function triggered by queue messages (always 1 message per invocation)","required":["queue","type"],"properties":{"queue":{"type":"object","description":"Reference to the queue resource","required":["type","id"],"properties":{"id":{"type":"string"},"type":{"type":"string","description":"Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior.","examples":["function","storage","queue","redis","postgres"],"x-readme-ref-name":"ResourceType"}},"x-readme-ref-name":"ResourceRef"},"type":{"type":"string","enum":["queue"]}}},{"type":"object","description":"Function triggered by storage events (object created, deleted, etc.)","required":["storage","events","type"],"properties":{"events":{"type":"array","items":{"type":"string"},"description":"Events to trigger on (e.g., [\"created\", \"deleted\"])"},"storage":{"type":"object","description":"Reference to the storage resource","required":["type","id"],"properties":{"id":{"type":"string"},"type":{"type":"string","description":"Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior.","examples":["function","storage","queue","redis","postgres"],"x-readme-ref-name":"ResourceType"}},"x-readme-ref-name":"ResourceRef"},"type":{"type":"string","enum":["storage"]}}},{"type":"object","description":"Function triggered on a schedule (cron expression)","required":["cron","type"],"properties":{"cron":{"type":"string","description":"Cron expression for scheduling (standard 5-field unix cron)"},"type":{"type":"string","enum":["schedule"]}}}],"description":"Defines what triggers a function execution","x-readme-ref-name":"FunctionTrigger"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
-
6
- import * as z from "zod";
7
- import { FunctionCodeSchema } from "./function-code-schema.js";
8
- import { FunctionTriggerSchema } from "./function-trigger-schema.js";
9
- import { IngressSchema } from "./ingress-schema.js";
10
- import { ReadinessProbeSchema } from "./readiness-probe-schema.js";
11
- import { ResourceRefSchema } from "./resource-ref-schema.js";
12
-
13
- /**
14
- * @description Represents a serverless function that executes code in response to triggers or direct invocations.\nFunctions are the primary compute resource in serverless applications, designed to be stateless and ephemeral.
15
- */
16
- export const FunctionSchema = z.object({
17
- get "code"(){
18
- return FunctionCodeSchema.describe("Specifies the source of the function's executable code.\nThis can be a pre-built container image or source code that the system will build.")
19
- },
20
- "commandsEnabled": z.optional(z.boolean().default(false).describe("Whether the function can receive remote commands via the Commands protocol.\nWhen enabled, the runtime polls the manager for pending commands and executes registered handlers.")),
21
- "concurrencyLimit": z.int().min(0).describe("Maximum number of concurrent executions allowed for the function.\nNone means platform default applies.").nullish(),
22
- "environment": z.optional(z.object({
23
-
24
- }).catchall(z.string()).describe("Key-value pairs to set as environment variables for the function.")),
25
- "id": z.string().describe("Identifier for the function. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]).\nMaximum 64 characters."),
26
- get "ingress"(){
27
- return IngressSchema.default("private").optional()
28
- },
29
- get "links"(){
30
- return z.array(ResourceRefSchema.describe("New ResourceRef that works with any resource type.\nThis can eventually replace the enum-based ResourceRef for full extensibility.")).describe("List of resource references this function depends on.")
31
- },
32
- "memoryMb": z.optional(z.int().min(0).default(256).describe("Memory allocated to the function in megabytes (MB).\nConstraints: 128‑32768 MB (platform-specific limits may apply)\nDefault: 256")),
33
- "permissions": z.string().describe("Permission profile name that defines the permissions granted to this function.\nThis references a profile defined in the stack's permission definitions."),
34
- get "readinessProbe"(){
35
- return z.union([ReadinessProbeSchema, z.null()]).optional()
36
- },
37
- "timeoutSeconds": z.optional(z.int().min(0).default(180).describe("Maximum execution time for the function in seconds.\nConstraints: 1‑3600 seconds (platform-specific limits may apply)\nDefault: 30")),
38
- get "triggers"(){
39
- return z.array(FunctionTriggerSchema.describe("Defines what triggers a function execution")).describe("List of triggers that define what events automatically invoke this function.\nIf empty, the function is only invokable directly via HTTP calls or platform-specific invocation APIs.\nWhen configured, the function will be automatically invoked when any of the specified trigger conditions are met.")
40
- }
41
- }).describe("Represents a serverless function that executes code in response to triggers or direct invocations.\nFunctions are the primary compute resource in serverless applications, designed to be stateless and ephemeral.")
42
-
43
- export type Function = z.infer<typeof FunctionSchema>