@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.
Files changed (216) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +125 -2
  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 +55 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +33 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +42 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +7 -0
  16. package/lib/index.lazy.js +7 -0
  17. package/lib/index.lazy.js.map +1 -0
  18. package/lib/pagination.d.ts +2 -0
  19. package/lib/pagination.d.ts.map +1 -0
  20. package/lib/pagination.js +1 -0
  21. package/lib/protocol.d.ts +15 -0
  22. package/lib/protocol.d.ts.map +1 -0
  23. package/lib/protocol.js +1 -0
  24. package/lib/retry.d.ts +12 -0
  25. package/lib/retry.d.ts.map +1 -0
  26. package/lib/retry.js +1 -0
  27. package/lib/services/artifacts.d.ts +260 -0
  28. package/lib/services/artifacts.d.ts.map +1 -0
  29. package/lib/services/artifacts.js +2 -0
  30. package/lib/services/artifacts.js.map +1 -0
  31. package/lib/services/audit.d.ts +149 -0
  32. package/lib/services/audit.d.ts.map +1 -0
  33. package/lib/services/audit.js +2 -0
  34. package/lib/services/audit.js.map +1 -0
  35. package/lib/services/bazel.d.ts +173 -0
  36. package/lib/services/bazel.d.ts.map +1 -0
  37. package/lib/services/bazel.js +2 -0
  38. package/lib/services/bazel.js.map +1 -0
  39. package/lib/services/bazel_cache.d.ts +118 -0
  40. package/lib/services/bazel_cache.d.ts.map +1 -0
  41. package/lib/services/bazel_cache.js +2 -0
  42. package/lib/services/bazel_cache.js.map +1 -0
  43. package/lib/services/builder.d.ts +234 -0
  44. package/lib/services/builder.d.ts.map +1 -0
  45. package/lib/services/builder.js +2 -0
  46. package/lib/services/builder.js.map +1 -0
  47. package/lib/services/buildkite_jobs.d.ts +121 -0
  48. package/lib/services/buildkite_jobs.d.ts.map +1 -0
  49. package/lib/services/buildkite_jobs.js +2 -0
  50. package/lib/services/buildkite_jobs.js.map +1 -0
  51. package/lib/services/buildkite_queue.d.ts +178 -0
  52. package/lib/services/buildkite_queue.d.ts.map +1 -0
  53. package/lib/services/buildkite_queue.js +2 -0
  54. package/lib/services/buildkite_queue.js.map +1 -0
  55. package/lib/services/compute.d.ts +1057 -0
  56. package/lib/services/compute.d.ts.map +1 -0
  57. package/lib/services/compute.js +43 -0
  58. package/lib/services/compute.js.map +1 -0
  59. package/lib/services/compute_command.d.ts +112 -0
  60. package/lib/services/compute_command.d.ts.map +1 -0
  61. package/lib/services/compute_command.js +2 -0
  62. package/lib/services/compute_command.js.map +1 -0
  63. package/lib/services/compute_observability.d.ts +157 -0
  64. package/lib/services/compute_observability.d.ts.map +1 -0
  65. package/lib/services/compute_observability.js +2 -0
  66. package/lib/services/compute_observability.js.map +1 -0
  67. package/lib/services/compute_storage.d.ts +371 -0
  68. package/lib/services/compute_storage.d.ts.map +1 -0
  69. package/lib/services/compute_storage.js +33 -0
  70. package/lib/services/compute_storage.js.map +1 -0
  71. package/lib/services/compute_usage.d.ts +275 -0
  72. package/lib/services/compute_usage.d.ts.map +1 -0
  73. package/lib/services/compute_usage.js +2 -0
  74. package/lib/services/compute_usage.js.map +1 -0
  75. package/lib/services/egress.d.ts +183 -0
  76. package/lib/services/egress.d.ts.map +1 -0
  77. package/lib/services/egress.js +2 -0
  78. package/lib/services/egress.js.map +1 -0
  79. package/lib/services/experimental_compute_reservation.d.ts +662 -0
  80. package/lib/services/experimental_compute_reservation.d.ts.map +1 -0
  81. package/lib/services/experimental_compute_reservation.js +23 -0
  82. package/lib/services/experimental_compute_reservation.js.map +1 -0
  83. package/lib/services/experimental_remote_results.d.ts +488 -0
  84. package/lib/services/experimental_remote_results.d.ts.map +1 -0
  85. package/lib/services/experimental_remote_results.js +2 -0
  86. package/lib/services/experimental_remote_results.js.map +1 -0
  87. package/lib/services/github_image.d.ts +154 -0
  88. package/lib/services/github_image.d.ts.map +1 -0
  89. package/lib/services/github_image.js +2 -0
  90. package/lib/services/github_image.js.map +1 -0
  91. package/lib/services/github_jobs.d.ts +175 -0
  92. package/lib/services/github_jobs.d.ts.map +1 -0
  93. package/lib/services/github_jobs.js +2 -0
  94. package/lib/services/github_jobs.js.map +1 -0
  95. package/lib/services/github_profile.d.ts +288 -0
  96. package/lib/services/github_profile.d.ts.map +1 -0
  97. package/lib/services/github_profile.js +2 -0
  98. package/lib/services/github_profile.js.map +1 -0
  99. package/lib/services/gradle_cache.d.ts +117 -0
  100. package/lib/services/gradle_cache.d.ts.map +1 -0
  101. package/lib/services/gradle_cache.js +2 -0
  102. package/lib/services/gradle_cache.js.map +1 -0
  103. package/lib/services/httpcache.d.ts +117 -0
  104. package/lib/services/httpcache.d.ts.map +1 -0
  105. package/lib/services/httpcache.js +2 -0
  106. package/lib/services/httpcache.js.map +1 -0
  107. package/lib/services/iam_tenant.d.ts +373 -0
  108. package/lib/services/iam_tenant.d.ts.map +1 -0
  109. package/lib/services/iam_tenant.js +39 -0
  110. package/lib/services/iam_tenant.js.map +1 -0
  111. package/lib/services/iam_tenant_membership.d.ts +106 -0
  112. package/lib/services/iam_tenant_membership.d.ts.map +1 -0
  113. package/lib/services/iam_tenant_membership.js +2 -0
  114. package/lib/services/iam_tenant_membership.js.map +1 -0
  115. package/lib/services/iam_token.d.ts +249 -0
  116. package/lib/services/iam_token.d.ts.map +1 -0
  117. package/lib/services/iam_token.js +2 -0
  118. package/lib/services/iam_token.js.map +1 -0
  119. package/lib/services/image.d.ts +214 -0
  120. package/lib/services/image.d.ts.map +1 -0
  121. package/lib/services/image.js +2 -0
  122. package/lib/services/image.js.map +1 -0
  123. package/lib/services/index.d.ts +30 -0
  124. package/lib/services/index.d.ts.map +1 -0
  125. package/lib/services/index.js +29 -0
  126. package/lib/services/private_devbox.d.ts +1156 -0
  127. package/lib/services/private_devbox.d.ts.map +1 -0
  128. package/lib/services/private_devbox.js +81 -0
  129. package/lib/services/private_devbox.js.map +1 -0
  130. package/lib/services/private_user_sessions.d.ts +137 -0
  131. package/lib/services/private_user_sessions.d.ts.map +1 -0
  132. package/lib/services/private_user_sessions.js +2 -0
  133. package/lib/services/private_user_sessions.js.map +1 -0
  134. package/lib/services/registry.d.ts +365 -0
  135. package/lib/services/registry.d.ts.map +1 -0
  136. package/lib/services/registry.js +34 -0
  137. package/lib/services/registry.js.map +1 -0
  138. package/lib/services/testing.d.ts +152 -0
  139. package/lib/services/testing.d.ts.map +1 -0
  140. package/lib/services/testing.js +2 -0
  141. package/lib/services/testing.js.map +1 -0
  142. package/lib/services/vault.d.ts +195 -0
  143. package/lib/services/vault.d.ts.map +1 -0
  144. package/lib/services/vault.js +2 -0
  145. package/lib/services/vault.js.map +1 -0
  146. package/lib/services.lazy/artifacts.js +1 -0
  147. package/lib/services.lazy/audit.js +1 -0
  148. package/lib/services.lazy/bazel.js +1 -0
  149. package/lib/services.lazy/bazel_cache.js +1 -0
  150. package/lib/services.lazy/builder.js +1 -0
  151. package/lib/services.lazy/buildkite_jobs.js +1 -0
  152. package/lib/services.lazy/buildkite_queue.js +1 -0
  153. package/lib/services.lazy/compute.js +4 -0
  154. package/lib/services.lazy/compute_command.js +1 -0
  155. package/lib/services.lazy/compute_observability.js +1 -0
  156. package/lib/services.lazy/compute_storage.js +4 -0
  157. package/lib/services.lazy/compute_usage.js +1 -0
  158. package/lib/services.lazy/egress.js +1 -0
  159. package/lib/services.lazy/experimental_compute_reservation.js +4 -0
  160. package/lib/services.lazy/experimental_remote_results.js +1 -0
  161. package/lib/services.lazy/github_image.js +1 -0
  162. package/lib/services.lazy/github_jobs.js +1 -0
  163. package/lib/services.lazy/github_profile.js +1 -0
  164. package/lib/services.lazy/gradle_cache.js +1 -0
  165. package/lib/services.lazy/httpcache.js +1 -0
  166. package/lib/services.lazy/iam_tenant.js +4 -0
  167. package/lib/services.lazy/iam_tenant_membership.js +1 -0
  168. package/lib/services.lazy/iam_token.js +1 -0
  169. package/lib/services.lazy/image.js +1 -0
  170. package/lib/services.lazy/index.js +3 -0
  171. package/lib/services.lazy/private_devbox.js +4 -0
  172. package/lib/services.lazy/private_user_sessions.js +1 -0
  173. package/lib/services.lazy/registry.js +4 -0
  174. package/lib/services.lazy/testing.js +1 -0
  175. package/lib/services.lazy/vault.js +1 -0
  176. package/lib/traits.d.ts +3 -0
  177. package/lib/traits.d.ts.map +1 -0
  178. package/lib/traits.js +1 -0
  179. package/package.json +87 -3
  180. package/src/credentials.ts +164 -0
  181. package/src/errors.ts +47 -0
  182. package/src/index.ts +48 -0
  183. package/src/pagination.ts +1 -0
  184. package/src/protocol.ts +82 -0
  185. package/src/retry.ts +28 -0
  186. package/src/services/artifacts.ts +761 -0
  187. package/src/services/audit.ts +315 -0
  188. package/src/services/bazel.ts +415 -0
  189. package/src/services/bazel_cache.ts +211 -0
  190. package/src/services/builder.ts +568 -0
  191. package/src/services/buildkite_jobs.ts +222 -0
  192. package/src/services/buildkite_queue.ts +445 -0
  193. package/src/services/compute.ts +2794 -0
  194. package/src/services/compute_command.ts +212 -0
  195. package/src/services/compute_observability.ts +428 -0
  196. package/src/services/compute_storage.ts +1159 -0
  197. package/src/services/compute_usage.ts +730 -0
  198. package/src/services/egress.ts +508 -0
  199. package/src/services/experimental_compute_reservation.ts +1488 -0
  200. package/src/services/experimental_remote_results.ts +1157 -0
  201. package/src/services/github_image.ts +293 -0
  202. package/src/services/github_jobs.ts +381 -0
  203. package/src/services/github_profile.ts +721 -0
  204. package/src/services/gradle_cache.ts +263 -0
  205. package/src/services/httpcache.ts +263 -0
  206. package/src/services/iam_tenant.ts +1355 -0
  207. package/src/services/iam_tenant_membership.ts +245 -0
  208. package/src/services/iam_token.ts +780 -0
  209. package/src/services/image.ts +594 -0
  210. package/src/services/index.ts +30 -0
  211. package/src/services/private_devbox.ts +4217 -0
  212. package/src/services/private_user_sessions.ts +402 -0
  213. package/src/services/registry.ts +1234 -0
  214. package/src/services/testing.ts +386 -0
  215. package/src/services/vault.ts +514 -0
  216. package/src/traits.ts +36 -0
@@ -0,0 +1,761 @@
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 { UnknownNamespaceLabsError } from "../errors.ts";
7
+ import { paginateCursor } from "../pagination.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: "ArtifactsService",
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
+ export interface CreateArtifactRequestIfExists {
104
+ /** Create a new version instead of returning AlreadyExists. */
105
+ createNewVersion?: boolean | undefined;
106
+ /** After successful finalization, retain at most this many live versions, including the new version. The new version is retained first; remaining slots are filled by creation time, newest first, with artifact ID as a deterministic tie-breaker. Older versions are expired; their metadata remains and their data is garbage-collected asynchronously. Existing expiration dates still apply. Zero means no count limit. Negative values are invalid. A positive value requires create_new_version and artifact:expire access. Applies only to this upload, not to subsequent uploads that omit it. */
107
+ keepMaxVersions?: number | undefined;
108
+ }
109
+ export interface CreateArtifactRequest {
110
+ /** The file path for the artifact to be stored. */
111
+ path?: string | undefined;
112
+ /** The namespace that the artifact belongs to. Currently, artifact creation outside of the `main` namespace is not permitted. */
113
+ namespace?: string | undefined;
114
+ /** Set a custom expiration date for the artifact. If not provided the artifact never expires. */
115
+ expiresAt?: string | undefined;
116
+ /** A set of labels that are attached to the new artifact. */
117
+ labels?: LabelList | undefined;
118
+ /** Deprecated: please enable versioning using `if_exists.create_new_version`. Whether overwriting an existing artifact with the same path within the same namespace is allowed or not. */
119
+ overwrite?: boolean | undefined;
120
+ /** Deprecated: use `if_exists.create_new_version` instead. If a version of the artifact already exists, create a new version rather than failing creation. */
121
+ createNewVersionIfExists?: boolean | undefined;
122
+ /** Controls creation when the same tenant, namespace, and path already exist. Cannot be combined with overwrite or create_new_version_if_exists set to true. */
123
+ ifExists?: CreateArtifactRequestIfExists | undefined;
124
+ }
125
+ export interface CreateArtifactResponse {
126
+ /** A pre-signed URL to upload the artifact data to. Use HTTP PUT to upload. The URL is valid for a limited time. */
127
+ signedUploadUrl: string;
128
+ /** The identifier for this upload. Pass this to FinalizeArtifact after the upload is complete. */
129
+ uploadId: string;
130
+ /** The date at which the artifact expires. */
131
+ expiresAt?: string | undefined;
132
+ }
133
+ export interface ExpireArtifactRequest {
134
+ /** The file path for the stored artifact. */
135
+ path?: string | undefined;
136
+ /** The namespace that the artifact belongs to. */
137
+ namespace?: string | undefined;
138
+ }
139
+ export interface ExpireArtifactResponse {}
140
+ export interface ExtendArtifactRequest {
141
+ /** The file path for the stored artifact. */
142
+ path?: string | undefined;
143
+ /** The namespace that the artifact belongs to. */
144
+ namespace?: string | undefined;
145
+ /** At least one of `extend_by` or `ensure_minimum` must be set. When both are set, `extend_by` is applied first and `ensure_minimum` then acts as a lower bound on the result. Extend the current expiration by this duration, relative to the artifact's current expiration. Note: In JSON format, the Duration type is encoded as a string ending in the suffix "s" (seconds), e.g. "3600s". */
146
+ extendBy?: string | undefined;
147
+ /** Ensure the artifact expires no sooner than this duration from now. This is a lower bound, relative to the current time, and can be combined with `extend_by`. Note: In JSON format, the Duration type is encoded as a string ending in the suffix "s" (seconds), e.g. "3600s". */
148
+ ensureMinimum?: string | undefined;
149
+ }
150
+ export interface ExtendArtifactResponse {
151
+ /** The effective expiration of the artifact after this call. Unset if the artifact never expires. */
152
+ expiresAt?: string | undefined;
153
+ }
154
+ export interface FinalizeArtifactRequest {
155
+ /** The upload ID returned by CreateArtifact. Required. */
156
+ uploadId?: string | undefined;
157
+ /** Labels to append to the artifact record. */
158
+ addLabels?: LabelList | undefined;
159
+ /** Unused, upload_id is sufficient. */
160
+ path?: string | undefined;
161
+ /** Unused, upload_id is sufficient. */
162
+ namespace?: string | undefined;
163
+ }
164
+ export type ArtifactStatus = "STATE_UNKNOWN" | "LIVE" | "EXPIRED";
165
+ export interface Artifact {
166
+ /** The unique identifier of this artifact. */
167
+ id: string;
168
+ /** The file path for the stored artifact. */
169
+ path: string;
170
+ /** The namespace that the artifact belongs to. */
171
+ namespace: string;
172
+ /** The date at which the artifact was created. */
173
+ createdAt?: string | undefined;
174
+ /** The date at which the artifact expires. */
175
+ expiresAt?: string | undefined;
176
+ labels: LabelList;
177
+ /** The size of the uploaded data in bytes. */
178
+ size: string;
179
+ /** URL to the dashboard for this artifact. */
180
+ webUrl: string;
181
+ /** In which state this artifact is. */
182
+ status: ArtifactStatus;
183
+ }
184
+ export interface FinalizeArtifactResponse {
185
+ description?: Artifact | undefined;
186
+ }
187
+ export type StringList = Array<string>;
188
+ export type LabelFilterEntryLabelFilterOp = "UNKNOWN" | "EQUAL" | "NOT_EQUAL" | "EXIST";
189
+ export interface LabelFilterEntry {
190
+ name?: string | undefined;
191
+ value?: string | undefined;
192
+ op?: LabelFilterEntryLabelFilterOp | (string & {}) | undefined;
193
+ }
194
+ export type LabelFilterEntryList = Array<LabelFilterEntry>;
195
+ export type ListArtifactsRequestOrderBy = "ORDER_BY_UNKNOWN" | "CreatedAt_Desc";
196
+ export interface Int64Range {
197
+ /** Inclusive. */
198
+ low?: string | undefined;
199
+ /** Inclusive. */
200
+ high?: string | undefined;
201
+ }
202
+ export type StringMatcherOperator = "OPERATOR_UNKNOWN" | "IS_ANY_OF" | "IS_NOT";
203
+ export interface StringMatcher {
204
+ values?: StringList | undefined;
205
+ op?: StringMatcherOperator | (string & {}) | undefined;
206
+ }
207
+ export interface ListArtifactsRequest {
208
+ /** If set, only return artifacts that belong to any of these namespaces. */
209
+ namespaces?: StringList | undefined;
210
+ /** Only return artifacts that match the specified filter. */
211
+ labelFilter?: LabelFilterEntryList | undefined;
212
+ /** Request a maximum N entries. */
213
+ maxEntries?: number | undefined;
214
+ /** Don't return expired entries. */
215
+ skipExpired?: boolean | undefined;
216
+ /** If provided, produces additional entries based on a previous list. In this case, `namespaces` and `label_filter` are ignored. */
217
+ paginationCursor?: string | undefined;
218
+ orderBy?: ListArtifactsRequestOrderBy | (string & {}) | undefined;
219
+ /** Filter artifacts by size in bytes. */
220
+ sizeRange?: Int64Range | undefined;
221
+ /** Filter artifacts by path regular expressions. IS_ANY_OF matches any regex; IS_NOT excludes paths matching any regex. */
222
+ matchPathRegex?: StringMatcher | undefined;
223
+ }
224
+ export type ArtifactList = Array<Artifact>;
225
+ export interface ListArtifactsResponse {
226
+ artifacts: ArtifactList;
227
+ /** Pass this to a subsequent ListRequest to obtain additional pages of data. */
228
+ paginationCursor: string;
229
+ }
230
+ export interface ListNamespacesRequest {}
231
+ export interface Namespace {
232
+ name: string;
233
+ kind: string;
234
+ }
235
+ export type NamespaceList = Array<Namespace>;
236
+ export interface ListNamespacesResponse {
237
+ namespaces: NamespaceList;
238
+ }
239
+ export interface ResolveArtifactRequest {
240
+ /** The file path for the stored artifact. */
241
+ path?: string | undefined;
242
+ /** The namespace that the artifact belongs to. */
243
+ namespace?: string | undefined;
244
+ /** Don't produce a download URL; merely query the metadata. */
245
+ metadataOnly?: boolean | undefined;
246
+ /** If an expired artifact should be returned or not. If set to false an error is returned. */
247
+ includeExpired?: boolean | undefined;
248
+ }
249
+ export interface ResolveArtifactResponse {
250
+ /** Metadata about the requested artifact. */
251
+ description?: Artifact | undefined;
252
+ /** Direct URL to download the artifact without authentication. Valid within 30 minutes from the time of the request. */
253
+ signedDownloadUrl: string;
254
+ /** The date at which the artifact expires. */
255
+ expiresAt?: string | undefined;
256
+ }
257
+ export type CreateArtifactError =
258
+ | InvalidArgument
259
+ | FailedPrecondition
260
+ | Unauthenticated
261
+ | PermissionDenied
262
+ | NotFound
263
+ | AlreadyExists
264
+ | ResourceExhausted
265
+ | NamespaceLabsOpError;
266
+ /** Creates a new artifact and returns a signed upload URL. Artifact creation follows a two-phase commit model: 1. Call CreateArtifact to obtain a `signed_upload_url` and `upload_id`. 2. Upload the artifact data to the signed URL using an HTTP PUT request. 3. Call FinalizeArtifact with the `upload_id` to commit the artifact. The artifact is not accessible for download until finalized. */
267
+ export const createArtifact: API.OperationMethod<
268
+ CreateArtifactRequest,
269
+ CreateArtifactResponse,
270
+ CreateArtifactError,
271
+ NamespaceLabsOpContext
272
+ > = /*@__PURE__*/ API.make(() => ({
273
+ input: __S(41, __c5, 1) as any as S.Schema<CreateArtifactRequest>,
274
+ output: __S(42, __c5, 2) as any as S.Schema<CreateArtifactResponse>,
275
+ errors: [
276
+ InvalidArgument,
277
+ FailedPrecondition,
278
+ Unauthenticated,
279
+ PermissionDenied,
280
+ NotFound,
281
+ AlreadyExists,
282
+ ResourceExhausted,
283
+ UnknownNamespaceLabsError,
284
+ ],
285
+ protocol: NamespaceLabsProtocol,
286
+ retry: Retry.Retry,
287
+ telemetry: TELEMETRY,
288
+ span: "CreateArtifact",
289
+ }));
290
+
291
+ export type ExpireArtifactError =
292
+ | InvalidArgument
293
+ | FailedPrecondition
294
+ | Unauthenticated
295
+ | PermissionDenied
296
+ | NotFound
297
+ | AlreadyExists
298
+ | ResourceExhausted
299
+ | NamespaceLabsOpError;
300
+ /** Mark an artifact as eligible for garbage-collection. */
301
+ export const expireArtifact: API.OperationMethod<
302
+ ExpireArtifactRequest,
303
+ ExpireArtifactResponse,
304
+ ExpireArtifactError,
305
+ NamespaceLabsOpContext
306
+ > = /*@__PURE__*/ API.make(() => ({
307
+ input: __S(56, __c7, 0) as any as S.Schema<ExpireArtifactRequest>,
308
+ output: __S(57, __c7, 1) as any as S.Schema<ExpireArtifactResponse>,
309
+ errors: [
310
+ InvalidArgument,
311
+ FailedPrecondition,
312
+ Unauthenticated,
313
+ PermissionDenied,
314
+ NotFound,
315
+ AlreadyExists,
316
+ ResourceExhausted,
317
+ UnknownNamespaceLabsError,
318
+ ],
319
+ protocol: NamespaceLabsProtocol,
320
+ retry: Retry.Retry,
321
+ telemetry: TELEMETRY,
322
+ span: "ExpireArtifact",
323
+ }));
324
+
325
+ export type ExtendArtifactError =
326
+ | InvalidArgument
327
+ | FailedPrecondition
328
+ | Unauthenticated
329
+ | PermissionDenied
330
+ | NotFound
331
+ | AlreadyExists
332
+ | ResourceExhausted
333
+ | NamespaceLabsOpError;
334
+ /** Extend the expiration of a finalized artifact. This enables dynamic, access-based retention: create artifacts with a short expiration and push it out whenever they are accessed. ### Errors - If the artifact does not exist or has already expired, a `NotFound` status is returned. */
335
+ export const extendArtifact: API.OperationMethod<
336
+ ExtendArtifactRequest,
337
+ ExtendArtifactResponse,
338
+ ExtendArtifactError,
339
+ NamespaceLabsOpContext
340
+ > = /*@__PURE__*/ API.make(() => ({
341
+ input: __S(64, __c8, 0) as any as S.Schema<ExtendArtifactRequest>,
342
+ output: __S(65, __c8, 1) as any as S.Schema<ExtendArtifactResponse>,
343
+ errors: [
344
+ InvalidArgument,
345
+ FailedPrecondition,
346
+ Unauthenticated,
347
+ PermissionDenied,
348
+ NotFound,
349
+ AlreadyExists,
350
+ ResourceExhausted,
351
+ UnknownNamespaceLabsError,
352
+ ],
353
+ protocol: NamespaceLabsProtocol,
354
+ retry: Retry.Retry,
355
+ telemetry: TELEMETRY,
356
+ span: "ExtendArtifact",
357
+ }));
358
+
359
+ export type FinalizeArtifactError =
360
+ | InvalidArgument
361
+ | FailedPrecondition
362
+ | Unauthenticated
363
+ | PermissionDenied
364
+ | NotFound
365
+ | AlreadyExists
366
+ | ResourceExhausted
367
+ | NamespaceLabsOpError;
368
+ /** Finalize a fully uploaded artifact (making it available for download). */
369
+ export const finalizeArtifact: API.OperationMethod<
370
+ FinalizeArtifactRequest,
371
+ FinalizeArtifactResponse,
372
+ FinalizeArtifactError,
373
+ NamespaceLabsOpContext
374
+ > = /*@__PURE__*/ API.make(() => ({
375
+ input: __S(0, __c0, 0) as any as S.Schema<FinalizeArtifactRequest>,
376
+ output: __S(1, __c0, 1) as any as S.Schema<FinalizeArtifactResponse>,
377
+ errors: [
378
+ InvalidArgument,
379
+ FailedPrecondition,
380
+ Unauthenticated,
381
+ PermissionDenied,
382
+ NotFound,
383
+ AlreadyExists,
384
+ ResourceExhausted,
385
+ UnknownNamespaceLabsError,
386
+ ],
387
+ protocol: NamespaceLabsProtocol,
388
+ retry: Retry.Retry,
389
+ telemetry: TELEMETRY,
390
+ span: "FinalizeArtifact",
391
+ }));
392
+
393
+ export type ListArtifactsError =
394
+ | InvalidArgument
395
+ | FailedPrecondition
396
+ | Unauthenticated
397
+ | PermissionDenied
398
+ | NotFound
399
+ | AlreadyExists
400
+ | ResourceExhausted
401
+ | NamespaceLabsOpError;
402
+ /** List finalized artifacts. */
403
+ export const listArtifacts: API.PaginatedOperationMethod<
404
+ ListArtifactsRequest,
405
+ ListArtifactsResponse,
406
+ ListArtifactsError,
407
+ NamespaceLabsOpContext,
408
+ Artifact
409
+ > = /*@__PURE__*/ API.makePaginated(
410
+ () => ({
411
+ input: __S(21, __c2, 5) as any as S.Schema<ListArtifactsRequest>,
412
+ output: __S(23, __c2, 7) as any as S.Schema<ListArtifactsResponse>,
413
+ errors: [
414
+ InvalidArgument,
415
+ FailedPrecondition,
416
+ Unauthenticated,
417
+ PermissionDenied,
418
+ NotFound,
419
+ AlreadyExists,
420
+ ResourceExhausted,
421
+ UnknownNamespaceLabsError,
422
+ ],
423
+ protocol: NamespaceLabsProtocol,
424
+ retry: Retry.Retry,
425
+ telemetry: TELEMETRY,
426
+ span: "ListArtifacts",
427
+ pagination: {
428
+ mode: "cursor",
429
+ inputToken: "paginationCursor",
430
+ outputToken: "paginationCursor",
431
+ items: "artifacts",
432
+ pageSize: "maxEntries",
433
+ } as const,
434
+ }),
435
+ paginateCursor,
436
+ ) as any;
437
+
438
+ export type ListNamespacesError =
439
+ | InvalidArgument
440
+ | FailedPrecondition
441
+ | Unauthenticated
442
+ | PermissionDenied
443
+ | NotFound
444
+ | AlreadyExists
445
+ | ResourceExhausted
446
+ | NamespaceLabsOpError;
447
+ /** List namespaces with finalized artifacts. */
448
+ export const listNamespaces: API.OperationMethod<
449
+ ListNamespacesRequest,
450
+ ListNamespacesResponse,
451
+ ListNamespacesError,
452
+ NamespaceLabsOpContext
453
+ > = /*@__PURE__*/ API.make(() => ({
454
+ input: __S(24, __c3, 0) as any as S.Schema<ListNamespacesRequest>,
455
+ output: __S(27, __c3, 3) as any as S.Schema<ListNamespacesResponse>,
456
+ errors: [
457
+ InvalidArgument,
458
+ FailedPrecondition,
459
+ Unauthenticated,
460
+ PermissionDenied,
461
+ NotFound,
462
+ AlreadyExists,
463
+ ResourceExhausted,
464
+ UnknownNamespaceLabsError,
465
+ ],
466
+ protocol: NamespaceLabsProtocol,
467
+ retry: Retry.Retry,
468
+ telemetry: TELEMETRY,
469
+ span: "ListNamespaces",
470
+ }));
471
+
472
+ export type ResolveArtifactError =
473
+ | InvalidArgument
474
+ | FailedPrecondition
475
+ | Unauthenticated
476
+ | PermissionDenied
477
+ | NotFound
478
+ | AlreadyExists
479
+ | ResourceExhausted
480
+ | NamespaceLabsOpError;
481
+ /** Resolves a finalized artifact and generates a download URL. */
482
+ export const resolveArtifact: API.OperationMethod<
483
+ ResolveArtifactRequest,
484
+ ResolveArtifactResponse,
485
+ ResolveArtifactError,
486
+ NamespaceLabsOpContext
487
+ > = /*@__PURE__*/ API.make(() => ({
488
+ input: __S(32, __c4, 0) as any as S.Schema<ResolveArtifactRequest>,
489
+ output: __S(33, __c4, 1) as any as S.Schema<ResolveArtifactResponse>,
490
+ errors: [
491
+ InvalidArgument,
492
+ FailedPrecondition,
493
+ Unauthenticated,
494
+ PermissionDenied,
495
+ NotFound,
496
+ AlreadyExists,
497
+ ResourceExhausted,
498
+ UnknownNamespaceLabsError,
499
+ ],
500
+ protocol: NamespaceLabsProtocol,
501
+ retry: Retry.Retry,
502
+ telemetry: TELEMETRY,
503
+ span: "ResolveArtifact",
504
+ }));
505
+
506
+ // Schema builders: each runs one schema initializer, on that schema's first use.
507
+ function __c0(j: number): any {
508
+ switch (j) {
509
+ case 0:
510
+ return S.suspend(() =>
511
+ S.Struct({
512
+ uploadId: S.optional(S.String),
513
+ addLabels: S.optional(__S(49, __c6, 1)),
514
+ path: S.optional(S.String),
515
+ namespace: S.optional(S.String),
516
+ }).pipe(
517
+ T.Http({
518
+ method: "POST",
519
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/FinalizeArtifact",
520
+ code: 200,
521
+ }),
522
+ ),
523
+ ).annotate({ identifier: "FinalizeArtifactRequest" });
524
+ case 1:
525
+ return S.suspend(() =>
526
+ S.Struct({
527
+ description: S.optional(__S(8, __c1, 0)),
528
+ }),
529
+ ).annotate({ identifier: "FinalizeArtifactResponse" });
530
+ }
531
+ }
532
+ function __c1(j: number): any {
533
+ switch (j) {
534
+ case 0:
535
+ return S.suspend(() =>
536
+ S.Struct({
537
+ id: S.String,
538
+ path: S.String,
539
+ namespace: S.String,
540
+ createdAt: S.optional(S.String),
541
+ expiresAt: S.optional(S.String),
542
+ labels: __S(49, __c6, 1),
543
+ size: S.String,
544
+ webUrl: S.String,
545
+ status: S.String,
546
+ }),
547
+ ).annotate({ identifier: "Artifact" });
548
+ }
549
+ }
550
+ function __c2(j: number): any {
551
+ switch (j) {
552
+ case 0:
553
+ return S.Array(S.String);
554
+ case 1:
555
+ return S.suspend(() =>
556
+ S.Struct({
557
+ name: S.optional(S.String),
558
+ value: S.optional(S.String),
559
+ op: S.optional(S.String),
560
+ }),
561
+ ).annotate({ identifier: "LabelFilterEntry" });
562
+ case 2:
563
+ return S.Array(__S(17, __c2, 1));
564
+ case 3:
565
+ return S.suspend(() =>
566
+ S.Struct({
567
+ low: S.optional(S.String),
568
+ high: S.optional(S.String),
569
+ }),
570
+ ).annotate({ identifier: "Int64Range" });
571
+ case 4:
572
+ return S.suspend(() =>
573
+ S.Struct({
574
+ values: S.optional(__S(16, __c2, 0)),
575
+ op: S.optional(S.String),
576
+ }),
577
+ ).annotate({ identifier: "StringMatcher" });
578
+ case 5:
579
+ return S.suspend(() =>
580
+ S.Struct({
581
+ namespaces: S.optional(__S(16, __c2, 0)),
582
+ labelFilter: S.optional(__S(18, __c2, 2)),
583
+ maxEntries: S.optional(S.Number),
584
+ skipExpired: S.optional(S.Boolean),
585
+ paginationCursor: S.optional(S.String),
586
+ orderBy: S.optional(S.String),
587
+ sizeRange: S.optional(__S(19, __c2, 3)),
588
+ matchPathRegex: S.optional(__S(20, __c2, 4)),
589
+ }).pipe(
590
+ T.Http({
591
+ method: "POST",
592
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/ListArtifacts",
593
+ code: 200,
594
+ }),
595
+ ),
596
+ ).annotate({ identifier: "ListArtifactsRequest" });
597
+ case 6:
598
+ return S.Array(__S(8, __c1, 0));
599
+ case 7:
600
+ return S.suspend(() =>
601
+ S.Struct({
602
+ artifacts: __S(22, __c2, 6),
603
+ paginationCursor: S.String,
604
+ }),
605
+ ).annotate({ identifier: "ListArtifactsResponse" });
606
+ }
607
+ }
608
+ function __c3(j: number): any {
609
+ switch (j) {
610
+ case 0:
611
+ return S.suspend(() =>
612
+ S.Struct({}).pipe(
613
+ T.Http({
614
+ method: "POST",
615
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/ListNamespaces",
616
+ code: 200,
617
+ }),
618
+ ),
619
+ ).annotate({ identifier: "ListNamespacesRequest" });
620
+ case 1:
621
+ return S.suspend(() =>
622
+ S.Struct({
623
+ name: S.String,
624
+ kind: S.String,
625
+ }),
626
+ ).annotate({ identifier: "Namespace" });
627
+ case 2:
628
+ return S.Array(__S(25, __c3, 1));
629
+ case 3:
630
+ return S.suspend(() =>
631
+ S.Struct({
632
+ namespaces: __S(26, __c3, 2),
633
+ }),
634
+ ).annotate({ identifier: "ListNamespacesResponse" });
635
+ }
636
+ }
637
+ function __c4(j: number): any {
638
+ switch (j) {
639
+ case 0:
640
+ return S.suspend(() =>
641
+ S.Struct({
642
+ path: S.optional(S.String),
643
+ namespace: S.optional(S.String),
644
+ metadataOnly: S.optional(S.Boolean),
645
+ includeExpired: S.optional(S.Boolean),
646
+ }).pipe(
647
+ T.Http({
648
+ method: "POST",
649
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/ResolveArtifact",
650
+ code: 200,
651
+ }),
652
+ ),
653
+ ).annotate({ identifier: "ResolveArtifactRequest" });
654
+ case 1:
655
+ return S.suspend(() =>
656
+ S.Struct({
657
+ description: S.optional(__S(8, __c1, 0)),
658
+ signedDownloadUrl: S.String,
659
+ expiresAt: S.optional(S.String),
660
+ }),
661
+ ).annotate({ identifier: "ResolveArtifactResponse" });
662
+ }
663
+ }
664
+ function __c5(j: number): any {
665
+ switch (j) {
666
+ case 0:
667
+ return S.suspend(() =>
668
+ S.Struct({
669
+ createNewVersion: S.optional(S.Boolean),
670
+ keepMaxVersions: S.optional(S.Number),
671
+ }),
672
+ ).annotate({ identifier: "CreateArtifactRequestIfExists" });
673
+ case 1:
674
+ return S.suspend(() =>
675
+ S.Struct({
676
+ path: S.optional(S.String),
677
+ namespace: S.optional(S.String),
678
+ expiresAt: S.optional(S.String),
679
+ labels: S.optional(__S(49, __c6, 1)),
680
+ overwrite: S.optional(S.Boolean),
681
+ createNewVersionIfExists: S.optional(S.Boolean),
682
+ ifExists: S.optional(__S(40, __c5, 0)),
683
+ }).pipe(
684
+ T.Http({
685
+ method: "POST",
686
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/CreateArtifact",
687
+ code: 200,
688
+ }),
689
+ ),
690
+ ).annotate({ identifier: "CreateArtifactRequest" });
691
+ case 2:
692
+ return S.suspend(() =>
693
+ S.Struct({
694
+ signedUploadUrl: S.String,
695
+ uploadId: S.String,
696
+ expiresAt: S.optional(S.String),
697
+ }),
698
+ ).annotate({ identifier: "CreateArtifactResponse" });
699
+ }
700
+ }
701
+ function __c6(j: number): any {
702
+ switch (j) {
703
+ case 0:
704
+ return S.suspend(() =>
705
+ S.Struct({
706
+ name: S.optional(S.String),
707
+ value: S.optional(S.String),
708
+ }),
709
+ ).annotate({ identifier: "Label" });
710
+ case 1:
711
+ return S.Array(__S(48, __c6, 0));
712
+ }
713
+ }
714
+ function __c7(j: number): any {
715
+ switch (j) {
716
+ case 0:
717
+ return S.suspend(() =>
718
+ S.Struct({
719
+ path: S.optional(S.String),
720
+ namespace: S.optional(S.String),
721
+ }).pipe(
722
+ T.Http({
723
+ method: "POST",
724
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/ExpireArtifact",
725
+ code: 200,
726
+ }),
727
+ ),
728
+ ).annotate({ identifier: "ExpireArtifactRequest" });
729
+ case 1:
730
+ return S.suspend(() => S.Struct({})).annotate({ identifier: "ExpireArtifactResponse" });
731
+ }
732
+ }
733
+ function __c8(j: number): any {
734
+ switch (j) {
735
+ case 0:
736
+ return S.suspend(() =>
737
+ S.Struct({
738
+ path: S.optional(S.String),
739
+ namespace: S.optional(S.String),
740
+ extendBy: S.optional(S.String),
741
+ ensureMinimum: S.optional(S.String),
742
+ }).pipe(
743
+ T.Http({
744
+ method: "POST",
745
+ uri: "/namespace.cloud.storage.v1beta.ArtifactsService/ExtendArtifact",
746
+ code: 200,
747
+ }),
748
+ ),
749
+ ).annotate({ identifier: "ExtendArtifactRequest" });
750
+ case 1:
751
+ return S.suspend(() =>
752
+ S.Struct({
753
+ expiresAt: S.optional(S.String),
754
+ }),
755
+ ).annotate({ identifier: "ExtendArtifactResponse" });
756
+ }
757
+ }
758
+ // Schema table: entry i is schema j of builder f, made on first reach.
759
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
760
+ return (__s[i] ??= __L.at(f, j));
761
+ }