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