@distilled.cloud/namespacelabs 0.0.0 → 1.0.0-rc.21

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 (219) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +130 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +73 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +59 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +44 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +2 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +12 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/buildkite_jobs.d.ts +129 -0
  26. package/lib/services/buildkite_jobs.d.ts.map +1 -0
  27. package/lib/services/buildkite_jobs.js +2 -0
  28. package/lib/services/buildkite_jobs.js.map +1 -0
  29. package/lib/services/buildkite_queue.d.ts +186 -0
  30. package/lib/services/buildkite_queue.d.ts.map +1 -0
  31. package/lib/services/buildkite_queue.js +2 -0
  32. package/lib/services/buildkite_queue.js.map +1 -0
  33. package/lib/services/index.d.ts +3 -0
  34. package/lib/services/index.d.ts.map +1 -0
  35. package/lib/services/index.js +2 -0
  36. package/lib/services.lazy/buildkite_jobs.js +1 -0
  37. package/lib/services.lazy/buildkite_queue.js +1 -0
  38. package/lib/services.lazy/index.js +3 -0
  39. package/lib/traits.d.ts +3 -0
  40. package/lib/traits.d.ts.map +1 -0
  41. package/lib/traits.js +1 -0
  42. package/lib/unstable-services/artifacts.d.ts +268 -0
  43. package/lib/unstable-services/artifacts.d.ts.map +1 -0
  44. package/lib/unstable-services/artifacts.js +2 -0
  45. package/lib/unstable-services/artifacts.js.map +1 -0
  46. package/lib/unstable-services/audit.d.ts +157 -0
  47. package/lib/unstable-services/audit.d.ts.map +1 -0
  48. package/lib/unstable-services/audit.js +2 -0
  49. package/lib/unstable-services/audit.js.map +1 -0
  50. package/lib/unstable-services/bazel.d.ts +181 -0
  51. package/lib/unstable-services/bazel.d.ts.map +1 -0
  52. package/lib/unstable-services/bazel.js +2 -0
  53. package/lib/unstable-services/bazel.js.map +1 -0
  54. package/lib/unstable-services/bazel_cache.d.ts +126 -0
  55. package/lib/unstable-services/bazel_cache.d.ts.map +1 -0
  56. package/lib/unstable-services/bazel_cache.js +2 -0
  57. package/lib/unstable-services/bazel_cache.js.map +1 -0
  58. package/lib/unstable-services/builder.d.ts +242 -0
  59. package/lib/unstable-services/builder.d.ts.map +1 -0
  60. package/lib/unstable-services/builder.js +2 -0
  61. package/lib/unstable-services/builder.js.map +1 -0
  62. package/lib/unstable-services/compute.d.ts +1124 -0
  63. package/lib/unstable-services/compute.d.ts.map +1 -0
  64. package/lib/unstable-services/compute.js +47 -0
  65. package/lib/unstable-services/compute.js.map +1 -0
  66. package/lib/unstable-services/compute_command.d.ts +120 -0
  67. package/lib/unstable-services/compute_command.d.ts.map +1 -0
  68. package/lib/unstable-services/compute_command.js +2 -0
  69. package/lib/unstable-services/compute_command.js.map +1 -0
  70. package/lib/unstable-services/compute_observability.d.ts +165 -0
  71. package/lib/unstable-services/compute_observability.d.ts.map +1 -0
  72. package/lib/unstable-services/compute_observability.js +2 -0
  73. package/lib/unstable-services/compute_observability.js.map +1 -0
  74. package/lib/unstable-services/compute_storage.d.ts +379 -0
  75. package/lib/unstable-services/compute_storage.d.ts.map +1 -0
  76. package/lib/unstable-services/compute_storage.js +33 -0
  77. package/lib/unstable-services/compute_storage.js.map +1 -0
  78. package/lib/unstable-services/compute_usage.d.ts +283 -0
  79. package/lib/unstable-services/compute_usage.d.ts.map +1 -0
  80. package/lib/unstable-services/compute_usage.js +2 -0
  81. package/lib/unstable-services/compute_usage.js.map +1 -0
  82. package/lib/unstable-services/egress.d.ts +191 -0
  83. package/lib/unstable-services/egress.d.ts.map +1 -0
  84. package/lib/unstable-services/egress.js +2 -0
  85. package/lib/unstable-services/egress.js.map +1 -0
  86. package/lib/unstable-services/experimental_compute_reservation.d.ts +672 -0
  87. package/lib/unstable-services/experimental_compute_reservation.d.ts.map +1 -0
  88. package/lib/unstable-services/experimental_compute_reservation.js +23 -0
  89. package/lib/unstable-services/experimental_compute_reservation.js.map +1 -0
  90. package/lib/unstable-services/experimental_remote_results.d.ts +496 -0
  91. package/lib/unstable-services/experimental_remote_results.d.ts.map +1 -0
  92. package/lib/unstable-services/experimental_remote_results.js +2 -0
  93. package/lib/unstable-services/experimental_remote_results.js.map +1 -0
  94. package/lib/unstable-services/github_image.d.ts +162 -0
  95. package/lib/unstable-services/github_image.d.ts.map +1 -0
  96. package/lib/unstable-services/github_image.js +2 -0
  97. package/lib/unstable-services/github_image.js.map +1 -0
  98. package/lib/unstable-services/github_jobs.d.ts +183 -0
  99. package/lib/unstable-services/github_jobs.d.ts.map +1 -0
  100. package/lib/unstable-services/github_jobs.js +2 -0
  101. package/lib/unstable-services/github_jobs.js.map +1 -0
  102. package/lib/unstable-services/github_profile.d.ts +296 -0
  103. package/lib/unstable-services/github_profile.d.ts.map +1 -0
  104. package/lib/unstable-services/github_profile.js +2 -0
  105. package/lib/unstable-services/github_profile.js.map +1 -0
  106. package/lib/unstable-services/gradle_cache.d.ts +125 -0
  107. package/lib/unstable-services/gradle_cache.d.ts.map +1 -0
  108. package/lib/unstable-services/gradle_cache.js +2 -0
  109. package/lib/unstable-services/gradle_cache.js.map +1 -0
  110. package/lib/unstable-services/httpcache.d.ts +125 -0
  111. package/lib/unstable-services/httpcache.d.ts.map +1 -0
  112. package/lib/unstable-services/httpcache.js +2 -0
  113. package/lib/unstable-services/httpcache.js.map +1 -0
  114. package/lib/unstable-services/iam_tenant.d.ts +457 -0
  115. package/lib/unstable-services/iam_tenant.d.ts.map +1 -0
  116. package/lib/unstable-services/iam_tenant.js +45 -0
  117. package/lib/unstable-services/iam_tenant.js.map +1 -0
  118. package/lib/unstable-services/iam_tenant_membership.d.ts +114 -0
  119. package/lib/unstable-services/iam_tenant_membership.d.ts.map +1 -0
  120. package/lib/unstable-services/iam_tenant_membership.js +2 -0
  121. package/lib/unstable-services/iam_tenant_membership.js.map +1 -0
  122. package/lib/unstable-services/iam_token.d.ts +257 -0
  123. package/lib/unstable-services/iam_token.d.ts.map +1 -0
  124. package/lib/unstable-services/iam_token.js +2 -0
  125. package/lib/unstable-services/iam_token.js.map +1 -0
  126. package/lib/unstable-services/image.d.ts +222 -0
  127. package/lib/unstable-services/image.d.ts.map +1 -0
  128. package/lib/unstable-services/image.js +2 -0
  129. package/lib/unstable-services/image.js.map +1 -0
  130. package/lib/unstable-services/index.d.ts +28 -0
  131. package/lib/unstable-services/index.d.ts.map +1 -0
  132. package/lib/unstable-services/index.js +27 -0
  133. package/lib/unstable-services/private_devbox.d.ts +1180 -0
  134. package/lib/unstable-services/private_devbox.d.ts.map +1 -0
  135. package/lib/unstable-services/private_devbox.js +81 -0
  136. package/lib/unstable-services/private_devbox.js.map +1 -0
  137. package/lib/unstable-services/private_user_sessions.d.ts +145 -0
  138. package/lib/unstable-services/private_user_sessions.d.ts.map +1 -0
  139. package/lib/unstable-services/private_user_sessions.js +2 -0
  140. package/lib/unstable-services/private_user_sessions.js.map +1 -0
  141. package/lib/unstable-services/registry.d.ts +373 -0
  142. package/lib/unstable-services/registry.d.ts.map +1 -0
  143. package/lib/unstable-services/registry.js +34 -0
  144. package/lib/unstable-services/registry.js.map +1 -0
  145. package/lib/unstable-services/testing.d.ts +160 -0
  146. package/lib/unstable-services/testing.d.ts.map +1 -0
  147. package/lib/unstable-services/testing.js +2 -0
  148. package/lib/unstable-services/testing.js.map +1 -0
  149. package/lib/unstable-services/vault.d.ts +203 -0
  150. package/lib/unstable-services/vault.d.ts.map +1 -0
  151. package/lib/unstable-services/vault.js +2 -0
  152. package/lib/unstable-services/vault.js.map +1 -0
  153. package/lib/unstable-services.lazy/artifacts.js +1 -0
  154. package/lib/unstable-services.lazy/audit.js +1 -0
  155. package/lib/unstable-services.lazy/bazel.js +1 -0
  156. package/lib/unstable-services.lazy/bazel_cache.js +1 -0
  157. package/lib/unstable-services.lazy/builder.js +1 -0
  158. package/lib/unstable-services.lazy/compute.js +4 -0
  159. package/lib/unstable-services.lazy/compute_command.js +1 -0
  160. package/lib/unstable-services.lazy/compute_observability.js +1 -0
  161. package/lib/unstable-services.lazy/compute_storage.js +4 -0
  162. package/lib/unstable-services.lazy/compute_usage.js +1 -0
  163. package/lib/unstable-services.lazy/egress.js +1 -0
  164. package/lib/unstable-services.lazy/experimental_compute_reservation.js +4 -0
  165. package/lib/unstable-services.lazy/experimental_remote_results.js +1 -0
  166. package/lib/unstable-services.lazy/github_image.js +1 -0
  167. package/lib/unstable-services.lazy/github_jobs.js +1 -0
  168. package/lib/unstable-services.lazy/github_profile.js +1 -0
  169. package/lib/unstable-services.lazy/gradle_cache.js +1 -0
  170. package/lib/unstable-services.lazy/httpcache.js +1 -0
  171. package/lib/unstable-services.lazy/iam_tenant.js +4 -0
  172. package/lib/unstable-services.lazy/iam_tenant_membership.js +1 -0
  173. package/lib/unstable-services.lazy/iam_token.js +1 -0
  174. package/lib/unstable-services.lazy/image.js +1 -0
  175. package/lib/unstable-services.lazy/index.js +3 -0
  176. package/lib/unstable-services.lazy/private_devbox.js +4 -0
  177. package/lib/unstable-services.lazy/private_user_sessions.js +1 -0
  178. package/lib/unstable-services.lazy/registry.js +4 -0
  179. package/lib/unstable-services.lazy/testing.js +1 -0
  180. package/lib/unstable-services.lazy/vault.js +1 -0
  181. package/package.json +89 -2
  182. package/src/credentials.ts +208 -0
  183. package/src/errors.ts +71 -0
  184. package/src/index.ts +50 -0
  185. package/src/pagination.ts +1 -0
  186. package/src/protocol.ts +83 -0
  187. package/src/retry.ts +28 -0
  188. package/src/services/buildkite_jobs.ts +230 -0
  189. package/src/services/buildkite_queue.ts +453 -0
  190. package/src/services/index.ts +3 -0
  191. package/src/traits.ts +36 -0
  192. package/src/unstable-services/artifacts.ts +769 -0
  193. package/src/unstable-services/audit.ts +323 -0
  194. package/src/unstable-services/bazel.ts +423 -0
  195. package/src/unstable-services/bazel_cache.ts +219 -0
  196. package/src/unstable-services/builder.ts +576 -0
  197. package/src/unstable-services/compute.ts +2991 -0
  198. package/src/unstable-services/compute_command.ts +220 -0
  199. package/src/unstable-services/compute_observability.ts +436 -0
  200. package/src/unstable-services/compute_storage.ts +1167 -0
  201. package/src/unstable-services/compute_usage.ts +738 -0
  202. package/src/unstable-services/egress.ts +516 -0
  203. package/src/unstable-services/experimental_compute_reservation.ts +1499 -0
  204. package/src/unstable-services/experimental_remote_results.ts +1165 -0
  205. package/src/unstable-services/github_image.ts +301 -0
  206. package/src/unstable-services/github_jobs.ts +389 -0
  207. package/src/unstable-services/github_profile.ts +729 -0
  208. package/src/unstable-services/gradle_cache.ts +271 -0
  209. package/src/unstable-services/httpcache.ts +271 -0
  210. package/src/unstable-services/iam_tenant.ts +1720 -0
  211. package/src/unstable-services/iam_tenant_membership.ts +253 -0
  212. package/src/unstable-services/iam_token.ts +788 -0
  213. package/src/unstable-services/image.ts +602 -0
  214. package/src/unstable-services/index.ts +28 -0
  215. package/src/unstable-services/private_devbox.ts +4256 -0
  216. package/src/unstable-services/private_user_sessions.ts +410 -0
  217. package/src/unstable-services/registry.ts +1242 -0
  218. package/src/unstable-services/testing.ts +394 -0
  219. package/src/unstable-services/vault.ts +522 -0
@@ -0,0 +1,576 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import * as C from "@distilled.cloud/core/category";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (buf.build/namespace/cloud -> smithy). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import type * as Redacted from "effect/Redacted";
7
+ import { NamespaceLabsServiceErrors } from "../errors.ts";
8
+ import {
9
+ NamespaceLabsProtocol,
10
+ type NamespaceLabsOpError,
11
+ type NamespaceLabsOpContext,
12
+ } from "../protocol.ts";
13
+ import * as Retry from "../retry.ts";
14
+ import * as T from "../traits.ts";
15
+ // Schema table, filled on first reach (see __S at the end).
16
+ const __s: any[] = [];
17
+
18
+ export type { NamespaceLabsOpError, NamespaceLabsOpContext };
19
+
20
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
21
+ const TELEMETRY = {
22
+ system: "namespacelabs-api",
23
+ responseHeaders: [
24
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
25
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
26
+ ],
27
+ prefix: "Namespacelabs",
28
+ service: "BuilderService",
29
+ propagate: "w3c",
30
+ } as const;
31
+
32
+ export class AlreadyExists
33
+ extends /*@__PURE__*/ T.applyErrorMatchers(
34
+ /*@__PURE__*/ S.TaggedError<AlreadyExists>()("AlreadyExists", {
35
+ message: S.String,
36
+ body: S.Unknown,
37
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
38
+ }).pipe(C.withConflictError),
39
+ [{ status: 409, body: { "/code": "already_exists" } }],
40
+ ) {}
41
+
42
+ export class FailedPrecondition
43
+ extends /*@__PURE__*/ T.applyErrorMatchers(
44
+ /*@__PURE__*/ S.TaggedError<FailedPrecondition>()("FailedPrecondition", {
45
+ message: S.String,
46
+ body: S.Unknown,
47
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
48
+ }).pipe(C.withBadRequestError),
49
+ [{ status: 400, body: { "/code": "failed_precondition" } }],
50
+ ) {}
51
+
52
+ export class InvalidArgument
53
+ extends /*@__PURE__*/ T.applyErrorMatchers(
54
+ /*@__PURE__*/ S.TaggedError<InvalidArgument>()("InvalidArgument", {
55
+ message: S.String,
56
+ body: S.Unknown,
57
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
58
+ }).pipe(C.withBadRequestError),
59
+ [{ status: 400, body: { "/code": "invalid_argument" } }],
60
+ ) {}
61
+
62
+ export class NotFound
63
+ extends /*@__PURE__*/ T.applyErrorMatchers(
64
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
65
+ message: S.String,
66
+ body: S.Unknown,
67
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
68
+ }).pipe(C.withBadRequestError),
69
+ [{ status: 404 }],
70
+ ) {}
71
+
72
+ export class PermissionDenied
73
+ extends /*@__PURE__*/ T.applyErrorMatchers(
74
+ /*@__PURE__*/ S.TaggedError<PermissionDenied>()("PermissionDenied", {
75
+ message: S.String,
76
+ body: S.Unknown,
77
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
78
+ }).pipe(C.withAuthError),
79
+ [{ status: 403 }],
80
+ ) {}
81
+
82
+ export class ResourceExhausted
83
+ extends /*@__PURE__*/ T.applyErrorMatchers(
84
+ /*@__PURE__*/ S.TaggedError<ResourceExhausted>()("ResourceExhausted", {
85
+ message: S.String,
86
+ body: S.Unknown,
87
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
88
+ retryAfter: /*@__PURE__*/ S.optional(S.Duration),
89
+ }).pipe(C.withThrottlingError),
90
+ [{ status: 429 }],
91
+ ) {}
92
+
93
+ export class Unauthenticated
94
+ extends /*@__PURE__*/ T.applyErrorMatchers(
95
+ /*@__PURE__*/ S.TaggedError<Unauthenticated>()("Unauthenticated", {
96
+ message: S.String,
97
+ body: S.Unknown,
98
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
99
+ }).pipe(C.withAuthError),
100
+ [{ status: 401 }],
101
+ ) {}
102
+
103
+ /** Labels are key/value pairs attached to entities such as tenants. */
104
+ export interface Label {
105
+ /** A name is an string up to 63 bytes that matches the regular expression `^[a-z]([a-z0-9-.]*[a-z0-9])?$`. */
106
+ name?: string | undefined;
107
+ /** Label values are arbitrary values up to 255 bytes. */
108
+ value?: string | undefined;
109
+ }
110
+ export type LabelList = Array<Label>;
111
+ /** Defines an instance shape: the combination of CPU, RAM and Disk that the instance should use. The size of the ephemeral disk automatically scales with the selected CPU/RAM allocation. See also https://namespace.so/docs/architecture/compute/machine-shapes#storage-allocation Usable values are constrained by policy, and are typically only settable in values as powers of two. */
112
+ export interface InstanceShape {
113
+ /** Number of virtual CPUs. Typically a power of two (e.g. 2, 4, 8, 16). */
114
+ virtualCpu?: number | undefined;
115
+ /** Memory in megabytes. Typically scales with CPU (e.g. 2048 per vCPU). */
116
+ memoryMegabytes?: number | undefined;
117
+ /** Architecture of the instance, e.g. "amd64" or "arm64". */
118
+ machineArch?: string | undefined;
119
+ /** Operating system of the instance, e.g. "linux" or "macos". */
120
+ os?: string | undefined;
121
+ /** Provide additional constraints to instance selection. Available selectors: https://namespace.so/docs/architecture/compute/macos#available-selectors */
122
+ selectors?: LabelList | undefined;
123
+ }
124
+ export interface EnsureBuildInstanceRequestExperimentalFeatures {
125
+ shape?: InstanceShape | undefined;
126
+ cacheSizeMb?: string | undefined;
127
+ builderName?: string | undefined;
128
+ sku?: string | undefined;
129
+ /** Allows specifying a custom cache tag to allow sharing caches between differently named builders. */
130
+ cacheIdentity?: string | undefined;
131
+ }
132
+ export interface EnsureBuildInstanceRequest {
133
+ /** The target platform for the builder, e.g. "linux/amd64" or "linux/arm64". */
134
+ platform?: string | undefined;
135
+ /** Experimental - please talk to the Namespace team before using. */
136
+ experimentalConsistencyKey?: string | undefined;
137
+ experimental?: EnsureBuildInstanceRequestExperimentalFeatures | undefined;
138
+ }
139
+ /** Describes how the connection to a builder endpoint is encapsulated. */
140
+ export type Encapsulation = "ENCAPSULATION_UNKNOWN" | "NONE" | "WEBSOCKET_TCPPROXY";
141
+ /** Describes which authentication method a builder endpoint requires. */
142
+ export type Authentication = "AUTHENTICATION_UNKNOWN" | "BEARER_TOKEN" | "MTLS";
143
+ export interface EnsureBuildInstanceResponse {
144
+ /** The compute instance ID backing the builder. */
145
+ instanceId: string;
146
+ /** The BuildKit endpoint to connect to. */
147
+ endpoint: string;
148
+ /** How the connection to the builder endpoint is encapsulated. */
149
+ encapsulation: Encapsulation;
150
+ /** Which authentication method the builder endpoint requires. */
151
+ authentication: Authentication;
152
+ /** The deadline of the compute instance backing the builder. */
153
+ deadline?: string | undefined;
154
+ }
155
+ export interface GetBuilderConfigurationRequest {
156
+ /** E.g. linux/amd64, linux/arm64. */
157
+ platform?: string | undefined;
158
+ /** Skip pre-spawning builder instances. */
159
+ skipBuilderPreSpawn?: boolean | undefined;
160
+ /** If true, returns new mTLS credentials to access the builder instance. */
161
+ returnNewCredentials?: boolean | undefined;
162
+ /** Targets a specific remote builder. The name must be max 32 characters long and match the regular expression `^[a-z][a-z0-9_-]*$`. Optional. */
163
+ builderName?: string | undefined;
164
+ /** Shape of the remote builder instance. Optional - overrides the default if given. */
165
+ builderShape?: InstanceShape | undefined;
166
+ /** If given, overrides the default cache volume size of the remote builder. Usable values are constrained by policy. */
167
+ cacheSizeMb?: string | undefined;
168
+ /** JSON serialized set of experimental values. Reach out to the Namespace team for more details. */
169
+ experimental?: string | undefined;
170
+ }
171
+ export interface BuilderCredentials {
172
+ /** The PEM-encoded client certificate that has been issued. The PEM container will contain one or more PEM "CERTIFICATE" blocks. If multiple certificates are returned, they can be used to build a certificate chain to a server-requested Certification Authority. */
173
+ clientCertificatePem: string;
174
+ /** This field will be a PEM container with exactly one "PRIVATE KEY" block. */
175
+ privateKeyPem: string | Redacted.Redacted<string>;
176
+ /** Timestamp at which these credentials expire (in UTC). */
177
+ expiresAt?: string | undefined;
178
+ }
179
+ export interface GetBuilderConfigurationResponse {
180
+ /** The instance shape (CPU, memory) of the builder. */
181
+ shape?: InstanceShape | undefined;
182
+ /** The size of the builder's cache volume in megabytes. */
183
+ cacheSizeMb: string;
184
+ /** The endpoint to connect to (e.g. for the buildx remote driver). */
185
+ buildkitEndpoint: string;
186
+ /** The endpoint to connect to (e.g. for the buildx remote driver). Including protocol prefix (e.g. tcp:// ) and port (e.g. :443) */
187
+ fullBuildkitEndpoint: string;
188
+ /** The PEM-encoded CA certificate(s) that should be used to verify server certificates of Namespace services that accept the issued client certificate. The PEM container will contain one or more PEM "CERTIFICATE" blocks. */
189
+ serverCaPem: string;
190
+ /** Only set if `return_new_credentials` was true. */
191
+ credentials?: BuilderCredentials | undefined;
192
+ }
193
+ export interface Date {
194
+ /** 2023 */
195
+ year?: number | undefined;
196
+ /** 1-12 */
197
+ month?: number | undefined;
198
+ /** 1-31 */
199
+ day?: number | undefined;
200
+ }
201
+ export interface GetBuilderUsageRequest {
202
+ /** Required */
203
+ periodStart?: Date | undefined;
204
+ /** Optional; if not set, defaults to now. */
205
+ periodEnd?: Date | undefined;
206
+ }
207
+ export interface GetBuilderUsageResponseUsage {
208
+ buildCount: string;
209
+ buildWallMinutes: string;
210
+ buildUnitMinutes: string;
211
+ }
212
+ export interface GetBuilderUsageResponsePerDay {
213
+ date?: Date | undefined;
214
+ usage?: GetBuilderUsageResponseUsage | undefined;
215
+ /** Usage which the system is aware of, but which has not been finalized yet. When finalized, parts of this usage or all of this usage can still move to other days. */
216
+ pendingUsage?: GetBuilderUsageResponseUsage | undefined;
217
+ }
218
+ export type GetBuilderUsageResponsePerDayList = Array<GetBuilderUsageResponsePerDay>;
219
+ export interface GetBuilderUsageResponse {
220
+ perDay: GetBuilderUsageResponsePerDayList;
221
+ total?: GetBuilderUsageResponseUsage | undefined;
222
+ /** Usage which the system is aware of, but which has not been finalized yet. */
223
+ pendingTotal?: GetBuilderUsageResponseUsage | undefined;
224
+ }
225
+ export interface GetBuildRecordRequest {
226
+ buildRef?: string | undefined;
227
+ }
228
+ export type BuildRecordStatus = "STATUS_UNKNOWN" | "SUCCEEDED" | "FAILED";
229
+ export interface BuildMachine {
230
+ /** The compute instance ID that hosted this build. */
231
+ instanceId: string;
232
+ /** The instance shape (CPU, memory) used for this build. */
233
+ shape?: InstanceShape | undefined;
234
+ /** If true, the build was executed locally and did not use remote builders. */
235
+ local: boolean;
236
+ }
237
+ export interface GetBuildRecordResponse {
238
+ /** An opaque identifier for this build. */
239
+ buildRef: string;
240
+ /** Timestamp of when the build started (in UTC). */
241
+ startedAt?: string | undefined;
242
+ /** Timestamp of when the build completed (in UTC). Not set if the build is still in progress. */
243
+ completedAt?: string | undefined;
244
+ /** The outcome of the build. */
245
+ status: BuildRecordStatus;
246
+ /** Details about the machine that executed this build. */
247
+ buildMachine?: BuildMachine | undefined;
248
+ }
249
+ export type EnsureBuildInstanceError =
250
+ | InvalidArgument
251
+ | FailedPrecondition
252
+ | Unauthenticated
253
+ | PermissionDenied
254
+ | NotFound
255
+ | AlreadyExists
256
+ | ResourceExhausted
257
+ | NamespaceLabsOpError;
258
+ /** Creates a builder for the specified platform for the specified tenant, or returns an existing one if one is already running. */
259
+ export const ensureBuildInstance: API.OperationMethod<
260
+ EnsureBuildInstanceRequest,
261
+ EnsureBuildInstanceResponse,
262
+ EnsureBuildInstanceError,
263
+ NamespaceLabsOpContext
264
+ > = /*@__PURE__*/ API.make(() => ({
265
+ input: __S(9, __c1, 1) as any as S.Schema<EnsureBuildInstanceRequest>,
266
+ output: __S(10, __c1, 2) as any as S.Schema<EnsureBuildInstanceResponse>,
267
+ errors: [
268
+ InvalidArgument,
269
+ FailedPrecondition,
270
+ Unauthenticated,
271
+ PermissionDenied,
272
+ NotFound,
273
+ AlreadyExists,
274
+ ResourceExhausted,
275
+ ],
276
+ serviceErrors: NamespaceLabsServiceErrors,
277
+ protocol: NamespaceLabsProtocol,
278
+ retry: Retry.Retry,
279
+ telemetry: TELEMETRY,
280
+ span: "EnsureBuildInstance",
281
+ }));
282
+
283
+ export type GetBuilderConfigurationError =
284
+ | InvalidArgument
285
+ | FailedPrecondition
286
+ | Unauthenticated
287
+ | PermissionDenied
288
+ | NotFound
289
+ | AlreadyExists
290
+ | ResourceExhausted
291
+ | NamespaceLabsOpError;
292
+ /** Returns the configuration of a builder. */
293
+ export const getBuilderConfiguration: API.OperationMethod<
294
+ GetBuilderConfigurationRequest,
295
+ GetBuilderConfigurationResponse,
296
+ GetBuilderConfigurationError,
297
+ NamespaceLabsOpContext
298
+ > = /*@__PURE__*/ API.make(() => ({
299
+ input: __S(24, __c3, 0) as any as S.Schema<GetBuilderConfigurationRequest>,
300
+ output: __S(26, __c3, 2) as any as S.Schema<GetBuilderConfigurationResponse>,
301
+ errors: [
302
+ InvalidArgument,
303
+ FailedPrecondition,
304
+ Unauthenticated,
305
+ PermissionDenied,
306
+ NotFound,
307
+ AlreadyExists,
308
+ ResourceExhausted,
309
+ ],
310
+ serviceErrors: NamespaceLabsServiceErrors,
311
+ protocol: NamespaceLabsProtocol,
312
+ retry: Retry.Retry,
313
+ telemetry: TELEMETRY,
314
+ span: "GetBuilderConfiguration",
315
+ }));
316
+
317
+ export type GetBuilderUsageError =
318
+ | InvalidArgument
319
+ | FailedPrecondition
320
+ | Unauthenticated
321
+ | PermissionDenied
322
+ | NotFound
323
+ | AlreadyExists
324
+ | ResourceExhausted
325
+ | NamespaceLabsOpError;
326
+ /** Returns build usage for a specified period. */
327
+ export const getBuilderUsage: API.OperationMethod<
328
+ GetBuilderUsageRequest,
329
+ GetBuilderUsageResponse,
330
+ GetBuilderUsageError,
331
+ NamespaceLabsOpContext
332
+ > = /*@__PURE__*/ API.make(() => ({
333
+ input: __S(33, __c4, 1) as any as S.Schema<GetBuilderUsageRequest>,
334
+ output: __S(37, __c4, 5) as any as S.Schema<GetBuilderUsageResponse>,
335
+ errors: [
336
+ InvalidArgument,
337
+ FailedPrecondition,
338
+ Unauthenticated,
339
+ PermissionDenied,
340
+ NotFound,
341
+ AlreadyExists,
342
+ ResourceExhausted,
343
+ ],
344
+ serviceErrors: NamespaceLabsServiceErrors,
345
+ protocol: NamespaceLabsProtocol,
346
+ retry: Retry.Retry,
347
+ telemetry: TELEMETRY,
348
+ span: "GetBuilderUsage",
349
+ }));
350
+
351
+ export type GetBuildRecordError =
352
+ | InvalidArgument
353
+ | FailedPrecondition
354
+ | Unauthenticated
355
+ | PermissionDenied
356
+ | NotFound
357
+ | AlreadyExists
358
+ | ResourceExhausted
359
+ | NamespaceLabsOpError;
360
+ /** Get the build record for a single build reference. */
361
+ export const getBuildRecord: API.OperationMethod<
362
+ GetBuildRecordRequest,
363
+ GetBuildRecordResponse,
364
+ GetBuildRecordError,
365
+ NamespaceLabsOpContext
366
+ > = /*@__PURE__*/ API.make(() => ({
367
+ input: __S(0, __c0, 0) as any as S.Schema<GetBuildRecordRequest>,
368
+ output: __S(2, __c0, 2) as any as S.Schema<GetBuildRecordResponse>,
369
+ errors: [
370
+ InvalidArgument,
371
+ FailedPrecondition,
372
+ Unauthenticated,
373
+ PermissionDenied,
374
+ NotFound,
375
+ AlreadyExists,
376
+ ResourceExhausted,
377
+ ],
378
+ serviceErrors: NamespaceLabsServiceErrors,
379
+ protocol: NamespaceLabsProtocol,
380
+ retry: Retry.Retry,
381
+ telemetry: TELEMETRY,
382
+ span: "GetBuildRecord",
383
+ }));
384
+
385
+ // Schema builders: each runs one schema initializer, on that schema's first use.
386
+ function __c0(j: number): any {
387
+ switch (j) {
388
+ case 0:
389
+ return S.suspend(() =>
390
+ S.Struct({
391
+ buildRef: S.optional(S.String),
392
+ }).pipe(
393
+ T.Http({
394
+ method: "POST",
395
+ uri: "/namespace.cloud.builder.v1beta.BuilderService/GetBuildRecord",
396
+ code: 200,
397
+ }),
398
+ ),
399
+ ).annotate({ identifier: "GetBuildRecordRequest" });
400
+ case 1:
401
+ return S.suspend(() =>
402
+ S.Struct({
403
+ instanceId: S.String,
404
+ shape: S.optional(__S(18, __c2, 2)),
405
+ local: S.Boolean,
406
+ }),
407
+ ).annotate({ identifier: "BuildMachine" });
408
+ case 2:
409
+ return S.suspend(() =>
410
+ S.Struct({
411
+ buildRef: S.String,
412
+ startedAt: S.optional(S.String),
413
+ completedAt: S.optional(S.String),
414
+ status: S.String,
415
+ buildMachine: S.optional(__S(1, __c0, 1)),
416
+ }),
417
+ ).annotate({ identifier: "GetBuildRecordResponse" });
418
+ }
419
+ }
420
+ function __c1(j: number): any {
421
+ switch (j) {
422
+ case 0:
423
+ return S.suspend(() =>
424
+ S.Struct({
425
+ shape: S.optional(__S(18, __c2, 2)),
426
+ cacheSizeMb: S.optional(S.String),
427
+ builderName: S.optional(S.String),
428
+ sku: S.optional(S.String),
429
+ cacheIdentity: S.optional(S.String),
430
+ }),
431
+ ).annotate({ identifier: "EnsureBuildInstanceRequestExperimentalFeatures" });
432
+ case 1:
433
+ return S.suspend(() =>
434
+ S.Struct({
435
+ platform: S.optional(S.String),
436
+ experimentalConsistencyKey: S.optional(S.String),
437
+ experimental: S.optional(__S(8, __c1, 0)),
438
+ }).pipe(
439
+ T.Http({
440
+ method: "POST",
441
+ uri: "/namespace.cloud.builder.v1beta.BuilderService/EnsureBuildInstance",
442
+ code: 200,
443
+ }),
444
+ ),
445
+ ).annotate({ identifier: "EnsureBuildInstanceRequest" });
446
+ case 2:
447
+ return S.suspend(() =>
448
+ S.Struct({
449
+ instanceId: S.String,
450
+ endpoint: S.String,
451
+ encapsulation: S.String,
452
+ authentication: S.String,
453
+ deadline: S.optional(S.String),
454
+ }),
455
+ ).annotate({ identifier: "EnsureBuildInstanceResponse" });
456
+ }
457
+ }
458
+ function __c2(j: number): any {
459
+ switch (j) {
460
+ case 0:
461
+ return S.suspend(() =>
462
+ S.Struct({
463
+ name: S.optional(S.String),
464
+ value: S.optional(S.String),
465
+ }),
466
+ ).annotate({ identifier: "Label" });
467
+ case 1:
468
+ return S.Array(__S(16, __c2, 0));
469
+ case 2:
470
+ return S.suspend(() =>
471
+ S.Struct({
472
+ virtualCpu: S.optional(S.Number),
473
+ memoryMegabytes: S.optional(S.Number),
474
+ machineArch: S.optional(S.String),
475
+ os: S.optional(S.String),
476
+ selectors: S.optional(__S(17, __c2, 1)),
477
+ }),
478
+ ).annotate({ identifier: "InstanceShape" });
479
+ }
480
+ }
481
+ function __c3(j: number): any {
482
+ switch (j) {
483
+ case 0:
484
+ return S.suspend(() =>
485
+ S.Struct({
486
+ platform: S.optional(S.String),
487
+ skipBuilderPreSpawn: S.optional(S.Boolean),
488
+ returnNewCredentials: S.optional(S.Boolean),
489
+ builderName: S.optional(S.String),
490
+ builderShape: S.optional(__S(18, __c2, 2)),
491
+ cacheSizeMb: S.optional(S.String),
492
+ experimental: S.optional(S.String),
493
+ }).pipe(
494
+ T.Http({
495
+ method: "POST",
496
+ uri: "/namespace.cloud.builder.v1beta.BuilderService/GetBuilderConfiguration",
497
+ code: 200,
498
+ }),
499
+ ),
500
+ ).annotate({ identifier: "GetBuilderConfigurationRequest" });
501
+ case 1:
502
+ return S.suspend(() =>
503
+ S.Struct({
504
+ clientCertificatePem: S.String,
505
+ privateKeyPem: S.String.pipe(T.SensitiveValue({})),
506
+ expiresAt: S.optional(S.String),
507
+ }),
508
+ ).annotate({ identifier: "BuilderCredentials" });
509
+ case 2:
510
+ return S.suspend(() =>
511
+ S.Struct({
512
+ shape: S.optional(__S(18, __c2, 2)),
513
+ cacheSizeMb: S.String,
514
+ buildkitEndpoint: S.String,
515
+ fullBuildkitEndpoint: S.String,
516
+ serverCaPem: S.String,
517
+ credentials: S.optional(__S(25, __c3, 1)),
518
+ }),
519
+ ).annotate({ identifier: "GetBuilderConfigurationResponse" });
520
+ }
521
+ }
522
+ function __c4(j: number): any {
523
+ switch (j) {
524
+ case 0:
525
+ return S.suspend(() =>
526
+ S.Struct({
527
+ year: S.optional(S.Number),
528
+ month: S.optional(S.Number),
529
+ day: S.optional(S.Number),
530
+ }),
531
+ ).annotate({ identifier: "Date" });
532
+ case 1:
533
+ return S.suspend(() =>
534
+ S.Struct({
535
+ periodStart: S.optional(__S(32, __c4, 0)),
536
+ periodEnd: S.optional(__S(32, __c4, 0)),
537
+ }).pipe(
538
+ T.Http({
539
+ method: "POST",
540
+ uri: "/namespace.cloud.builder.v1beta.BuilderService/GetBuilderUsage",
541
+ code: 200,
542
+ }),
543
+ ),
544
+ ).annotate({ identifier: "GetBuilderUsageRequest" });
545
+ case 2:
546
+ return S.suspend(() =>
547
+ S.Struct({
548
+ buildCount: S.String,
549
+ buildWallMinutes: S.String,
550
+ buildUnitMinutes: S.String,
551
+ }),
552
+ ).annotate({ identifier: "GetBuilderUsageResponseUsage" });
553
+ case 3:
554
+ return S.suspend(() =>
555
+ S.Struct({
556
+ date: S.optional(__S(32, __c4, 0)),
557
+ usage: S.optional(__S(34, __c4, 2)),
558
+ pendingUsage: S.optional(__S(34, __c4, 2)),
559
+ }),
560
+ ).annotate({ identifier: "GetBuilderUsageResponsePerDay" });
561
+ case 4:
562
+ return S.Array(__S(35, __c4, 3));
563
+ case 5:
564
+ return S.suspend(() =>
565
+ S.Struct({
566
+ perDay: __S(36, __c4, 4),
567
+ total: S.optional(__S(34, __c4, 2)),
568
+ pendingTotal: S.optional(__S(34, __c4, 2)),
569
+ }),
570
+ ).annotate({ identifier: "GetBuilderUsageResponse" });
571
+ }
572
+ }
573
+ // Schema table: entry i is schema j of builder f, made on first reach.
574
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
575
+ return (__s[i] ??= __L.at(f, j));
576
+ }