@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,514 @@
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: "VaultService",
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 CreateObjectRequest {
104
+ /** A description of the object. */
105
+ description?: string | undefined;
106
+ /** The initial value to be stored, required. */
107
+ value?: string | Redacted.Redacted<string> | undefined;
108
+ /** If set to true, the secret value will be returned in future DescribeObject calls. This cannot be changed after creation. */
109
+ revealable?: boolean | undefined;
110
+ /** You can specify additional context to attach to an object. Labels are immutable and are shared across all versions. Objects can be listed based on label constraints. Label names are limited to 63 bytes and values to 255 bytes. The combined size of all label names and values cannot exceed 4 KiB. */
111
+ labels?: LabelList | undefined;
112
+ }
113
+ export interface CreateObjectResponse {
114
+ /** The unique identifier of this secret object. */
115
+ objectId: string;
116
+ /** A human-readable description of the object. */
117
+ description: string;
118
+ /** An opaque version identifier for this object. Changes with each update. Can be used with `if_version_matches` for optimistic concurrency control. */
119
+ version: string;
120
+ /** Timestamp of when this object was created (in UTC). */
121
+ createdAt?: string | undefined;
122
+ /** Timestamp of when this object was deleted (in UTC). Not set if the object is still active. */
123
+ deletedAt?: string | undefined;
124
+ /** Labels attached to this object. Labels are immutable and shared across all versions. */
125
+ labels: LabelList;
126
+ }
127
+ export interface DeleteObjectRequest {
128
+ /** The ID of the object to delete. */
129
+ objectId?: string | undefined;
130
+ /** If set, fail the request if the object does not currently match the specified version (as included in VaultObjectMetadata). */
131
+ ifVersionMatches?: string | undefined;
132
+ }
133
+ export interface DeleteObjectResponse {}
134
+ export interface DescribeObjectRequest {
135
+ /** Fetch the object version that matches the specified id. */
136
+ objectId?: string | undefined;
137
+ }
138
+ export interface VaultObjectMetadata {
139
+ /** The unique identifier of this secret object. */
140
+ objectId: string;
141
+ /** A human-readable description of the object. */
142
+ description: string;
143
+ /** An opaque version identifier for this object. Changes with each update. Can be used with `if_version_matches` for optimistic concurrency control. */
144
+ version: string;
145
+ /** Timestamp of when this object was created (in UTC). */
146
+ createdAt?: string | undefined;
147
+ /** Timestamp of when this object was deleted (in UTC). Not set if the object is still active. */
148
+ deletedAt?: string | undefined;
149
+ /** Labels attached to this object. Labels are immutable and shared across all versions. */
150
+ labels: LabelList;
151
+ }
152
+ export type VaultObjectMetadataList = Array<VaultObjectMetadata>;
153
+ export interface DescribeObjectResponse {
154
+ /** The metadata of the requested object. */
155
+ metadata?: VaultObjectMetadata | undefined;
156
+ /** The decrypted value of the secret. Only set if the object was created with `revealable` set to true. */
157
+ value: string | Redacted.Redacted<string>;
158
+ /** A few most recent previous versions of the object, for audit purposes. */
159
+ previous: VaultObjectMetadataList;
160
+ }
161
+ export type LabelFilterEntryLabelFilterOp = "UNKNOWN" | "EQUAL" | "NOT_EQUAL" | "EXIST";
162
+ export interface LabelFilterEntry {
163
+ name?: string | undefined;
164
+ value?: string | undefined;
165
+ op?: LabelFilterEntryLabelFilterOp | (string & {}) | undefined;
166
+ }
167
+ export type LabelFilterEntryList = Array<LabelFilterEntry>;
168
+ export interface ListObjectsRequest {
169
+ /** If not specified, returns all objects. */
170
+ labelFilter?: LabelFilterEntryList | undefined;
171
+ }
172
+ export interface ListObjectsResponse {
173
+ /** Returns the most recent version of each object that has not been deleted. */
174
+ objects: VaultObjectMetadataList;
175
+ }
176
+ export interface UpdateObjectRequest {
177
+ /** The ID of the object being updated. */
178
+ objectId?: string | undefined;
179
+ /** The value to be added to a new version. */
180
+ newValue?: string | Redacted.Redacted<string> | undefined;
181
+ /** If set, fail the request if the object does not currently match the specified version (as included in VaultObjectMetadata). */
182
+ ifVersionMatches?: string | undefined;
183
+ }
184
+ export interface UpdateObjectResponse {
185
+ /** The unique identifier of this secret object. */
186
+ objectId: string;
187
+ /** A human-readable description of the object. */
188
+ description: string;
189
+ /** An opaque version identifier for this object. Changes with each update. Can be used with `if_version_matches` for optimistic concurrency control. */
190
+ version: string;
191
+ /** Timestamp of when this object was created (in UTC). */
192
+ createdAt?: string | undefined;
193
+ /** Timestamp of when this object was deleted (in UTC). Not set if the object is still active. */
194
+ deletedAt?: string | undefined;
195
+ /** Labels attached to this object. Labels are immutable and shared across all versions. */
196
+ labels: LabelList;
197
+ }
198
+ export type CreateObjectError =
199
+ | InvalidArgument
200
+ | FailedPrecondition
201
+ | Unauthenticated
202
+ | PermissionDenied
203
+ | NotFound
204
+ | AlreadyExists
205
+ | ResourceExhausted
206
+ | NamespaceLabsOpError;
207
+ /** Creates a new secret object in the workspace vault. ### Errors - If one of the properties that are passed in is invalid, an `InvalidArgument` status is returned. */
208
+ export const createObject: API.OperationMethod<
209
+ CreateObjectRequest,
210
+ CreateObjectResponse,
211
+ CreateObjectError,
212
+ NamespaceLabsOpContext
213
+ > = /*@__PURE__*/ API.make(() => ({
214
+ input: __S(8, __c2, 0) as any as S.Schema<CreateObjectRequest>,
215
+ output: __S(14, __c3, 2) as any as S.Schema<CreateObjectResponse>,
216
+ errors: [
217
+ InvalidArgument,
218
+ FailedPrecondition,
219
+ Unauthenticated,
220
+ PermissionDenied,
221
+ NotFound,
222
+ AlreadyExists,
223
+ ResourceExhausted,
224
+ UnknownNamespaceLabsError,
225
+ ],
226
+ protocol: NamespaceLabsProtocol,
227
+ retry: Retry.Retry,
228
+ telemetry: TELEMETRY,
229
+ span: "CreateObject",
230
+ }));
231
+
232
+ export type DeleteObjectError =
233
+ | InvalidArgument
234
+ | FailedPrecondition
235
+ | Unauthenticated
236
+ | PermissionDenied
237
+ | NotFound
238
+ | AlreadyExists
239
+ | ResourceExhausted
240
+ | NamespaceLabsOpError;
241
+ /** Permanently deletes a secret object. ### Errors - If the object does not exist, a `NotFound` status is returned. - If `if_version_matches` is set and the current version does not match, a `FailedPrecondition` status is returned. */
242
+ export const deleteObject: API.OperationMethod<
243
+ DeleteObjectRequest,
244
+ DeleteObjectResponse,
245
+ DeleteObjectError,
246
+ NamespaceLabsOpContext
247
+ > = /*@__PURE__*/ API.make(() => ({
248
+ input: __S(16, __c4, 0) as any as S.Schema<DeleteObjectRequest>,
249
+ output: __S(17, __c4, 1) as any as S.Schema<DeleteObjectResponse>,
250
+ errors: [
251
+ InvalidArgument,
252
+ FailedPrecondition,
253
+ Unauthenticated,
254
+ PermissionDenied,
255
+ NotFound,
256
+ AlreadyExists,
257
+ ResourceExhausted,
258
+ UnknownNamespaceLabsError,
259
+ ],
260
+ protocol: NamespaceLabsProtocol,
261
+ retry: Retry.Retry,
262
+ telemetry: TELEMETRY,
263
+ span: "DeleteObject",
264
+ }));
265
+
266
+ export type DescribeObjectError =
267
+ | InvalidArgument
268
+ | FailedPrecondition
269
+ | Unauthenticated
270
+ | PermissionDenied
271
+ | NotFound
272
+ | AlreadyExists
273
+ | ResourceExhausted
274
+ | NamespaceLabsOpError;
275
+ /** Retrieves the metadata (and optionally the value) of a secret object. The value is only returned if the object was created with `revealable` set to true. ### Errors - If the object does not exist, a `NotFound` status is returned. */
276
+ export const describeObject: API.OperationMethod<
277
+ DescribeObjectRequest,
278
+ DescribeObjectResponse,
279
+ DescribeObjectError,
280
+ NamespaceLabsOpContext
281
+ > = /*@__PURE__*/ API.make(() => ({
282
+ input: __S(20, __c5, 0) as any as S.Schema<DescribeObjectRequest>,
283
+ output: __S(21, __c5, 1) as any as S.Schema<DescribeObjectResponse>,
284
+ errors: [
285
+ InvalidArgument,
286
+ FailedPrecondition,
287
+ Unauthenticated,
288
+ PermissionDenied,
289
+ NotFound,
290
+ AlreadyExists,
291
+ ResourceExhausted,
292
+ UnknownNamespaceLabsError,
293
+ ],
294
+ protocol: NamespaceLabsProtocol,
295
+ retry: Retry.Retry,
296
+ telemetry: TELEMETRY,
297
+ span: "DescribeObject",
298
+ }));
299
+
300
+ export type ListObjectsError =
301
+ | InvalidArgument
302
+ | FailedPrecondition
303
+ | Unauthenticated
304
+ | PermissionDenied
305
+ | NotFound
306
+ | AlreadyExists
307
+ | ResourceExhausted
308
+ | NamespaceLabsOpError;
309
+ /** Returns the most recent version of each non-deleted secret object in the workspace vault. */
310
+ export const listObjects: API.OperationMethod<
311
+ ListObjectsRequest,
312
+ ListObjectsResponse,
313
+ ListObjectsError,
314
+ NamespaceLabsOpContext
315
+ > = /*@__PURE__*/ API.make(() => ({
316
+ input: __S(2, __c0, 2) as any as S.Schema<ListObjectsRequest>,
317
+ output: __S(3, __c0, 3) as any as S.Schema<ListObjectsResponse>,
318
+ errors: [
319
+ InvalidArgument,
320
+ FailedPrecondition,
321
+ Unauthenticated,
322
+ PermissionDenied,
323
+ NotFound,
324
+ AlreadyExists,
325
+ ResourceExhausted,
326
+ UnknownNamespaceLabsError,
327
+ ],
328
+ protocol: NamespaceLabsProtocol,
329
+ retry: Retry.Retry,
330
+ telemetry: TELEMETRY,
331
+ span: "ListObjects",
332
+ }));
333
+
334
+ export type UpdateObjectError =
335
+ | InvalidArgument
336
+ | FailedPrecondition
337
+ | Unauthenticated
338
+ | PermissionDenied
339
+ | NotFound
340
+ | AlreadyExists
341
+ | ResourceExhausted
342
+ | NamespaceLabsOpError;
343
+ /** Adds a new version to an existing secret object. ### Errors - If the object does not exist, a `NotFound` status is returned. - If `if_version_matches` is set and the current version does not match, a `FailedPrecondition` status is returned. */
344
+ export const updateObject: API.OperationMethod<
345
+ UpdateObjectRequest,
346
+ UpdateObjectResponse,
347
+ UpdateObjectError,
348
+ NamespaceLabsOpContext
349
+ > = /*@__PURE__*/ API.make(() => ({
350
+ input: __S(4, __c1, 0) as any as S.Schema<UpdateObjectRequest>,
351
+ output: __S(14, __c3, 2) as any as S.Schema<UpdateObjectResponse>,
352
+ errors: [
353
+ InvalidArgument,
354
+ FailedPrecondition,
355
+ Unauthenticated,
356
+ PermissionDenied,
357
+ NotFound,
358
+ AlreadyExists,
359
+ ResourceExhausted,
360
+ UnknownNamespaceLabsError,
361
+ ],
362
+ protocol: NamespaceLabsProtocol,
363
+ retry: Retry.Retry,
364
+ telemetry: TELEMETRY,
365
+ span: "UpdateObject",
366
+ }));
367
+
368
+ // Schema builders: each runs one schema initializer, on that schema's first use.
369
+ function __c0(j: number): any {
370
+ switch (j) {
371
+ case 0:
372
+ return S.suspend(() =>
373
+ S.Struct({
374
+ name: S.optional(S.String),
375
+ value: S.optional(S.String),
376
+ op: S.optional(S.String),
377
+ }),
378
+ ).annotate({ identifier: "LabelFilterEntry" });
379
+ case 1:
380
+ return S.Array(__S(0, __c0, 0));
381
+ case 2:
382
+ return S.suspend(() =>
383
+ S.Struct({
384
+ labelFilter: S.optional(__S(1, __c0, 1)),
385
+ }).pipe(
386
+ T.Http({
387
+ method: "POST",
388
+ uri: "/namespace.cloud.vault.v1beta.VaultService/ListObjects",
389
+ code: 200,
390
+ }),
391
+ ),
392
+ ).annotate({ identifier: "ListObjectsRequest" });
393
+ case 3:
394
+ return S.suspend(() =>
395
+ S.Struct({
396
+ objects: __S(24, __c6, 0),
397
+ }),
398
+ ).annotate({ identifier: "ListObjectsResponse" });
399
+ }
400
+ }
401
+ function __c1(j: number): any {
402
+ switch (j) {
403
+ case 0:
404
+ return S.suspend(() =>
405
+ S.Struct({
406
+ objectId: S.optional(S.String),
407
+ newValue: S.optional(S.String.pipe(T.SensitiveValue({}))),
408
+ ifVersionMatches: S.optional(S.String),
409
+ }).pipe(
410
+ T.Http({
411
+ method: "POST",
412
+ uri: "/namespace.cloud.vault.v1beta.VaultService/UpdateObject",
413
+ code: 200,
414
+ }),
415
+ ),
416
+ ).annotate({ identifier: "UpdateObjectRequest" });
417
+ }
418
+ }
419
+ function __c2(j: number): any {
420
+ switch (j) {
421
+ case 0:
422
+ return S.suspend(() =>
423
+ S.Struct({
424
+ description: S.optional(S.String),
425
+ value: S.optional(S.String.pipe(T.SensitiveValue({}))),
426
+ revealable: S.optional(S.Boolean),
427
+ labels: S.optional(__S(13, __c3, 1)),
428
+ }).pipe(
429
+ T.Http({
430
+ method: "POST",
431
+ uri: "/namespace.cloud.vault.v1beta.VaultService/CreateObject",
432
+ code: 200,
433
+ }),
434
+ ),
435
+ ).annotate({ identifier: "CreateObjectRequest" });
436
+ }
437
+ }
438
+ function __c3(j: number): any {
439
+ switch (j) {
440
+ case 0:
441
+ return S.suspend(() =>
442
+ S.Struct({
443
+ name: S.optional(S.String),
444
+ value: S.optional(S.String),
445
+ }),
446
+ ).annotate({ identifier: "Label" });
447
+ case 1:
448
+ return S.Array(__S(12, __c3, 0));
449
+ case 2:
450
+ return S.suspend(() =>
451
+ S.Struct({
452
+ objectId: S.String,
453
+ description: S.String,
454
+ version: S.String,
455
+ createdAt: S.optional(S.String),
456
+ deletedAt: S.optional(S.String),
457
+ labels: __S(13, __c3, 1),
458
+ }),
459
+ ).annotate({ identifier: "CreateObjectResponse" });
460
+ }
461
+ }
462
+ function __c4(j: number): any {
463
+ switch (j) {
464
+ case 0:
465
+ return S.suspend(() =>
466
+ S.Struct({
467
+ objectId: S.optional(S.String),
468
+ ifVersionMatches: S.optional(S.String),
469
+ }).pipe(
470
+ T.Http({
471
+ method: "POST",
472
+ uri: "/namespace.cloud.vault.v1beta.VaultService/DeleteObject",
473
+ code: 200,
474
+ }),
475
+ ),
476
+ ).annotate({ identifier: "DeleteObjectRequest" });
477
+ case 1:
478
+ return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteObjectResponse" });
479
+ }
480
+ }
481
+ function __c5(j: number): any {
482
+ switch (j) {
483
+ case 0:
484
+ return S.suspend(() =>
485
+ S.Struct({
486
+ objectId: S.optional(S.String),
487
+ }).pipe(
488
+ T.Http({
489
+ method: "POST",
490
+ uri: "/namespace.cloud.vault.v1beta.VaultService/DescribeObject",
491
+ code: 200,
492
+ }),
493
+ ),
494
+ ).annotate({ identifier: "DescribeObjectRequest" });
495
+ case 1:
496
+ return S.suspend(() =>
497
+ S.Struct({
498
+ metadata: S.optional(__S(14, __c3, 2)),
499
+ value: S.String.pipe(T.SensitiveValue({})),
500
+ previous: __S(24, __c6, 0),
501
+ }),
502
+ ).annotate({ identifier: "DescribeObjectResponse" });
503
+ }
504
+ }
505
+ function __c6(j: number): any {
506
+ switch (j) {
507
+ case 0:
508
+ return S.Array(__S(14, __c3, 2));
509
+ }
510
+ }
511
+ // Schema table: entry i is schema j of builder f, made on first reach.
512
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
513
+ return (__s[i] ??= __L.at(f, j));
514
+ }
package/src/traits.ts ADDED
@@ -0,0 +1,36 @@
1
+ export {
2
+ Body,
3
+ Header,
4
+ Query,
5
+ Label,
6
+ Http,
7
+ ResponseCode,
8
+ HttpBody,
9
+ FormDataFile,
10
+ KeyDictionary,
11
+ UnionCases,
12
+ applyErrorMatchers,
13
+ getErrorMatchers,
14
+ type HttpTrait,
15
+ type ErrorMatcher,
16
+ bodySymbol,
17
+ headerSymbol,
18
+ querySymbol,
19
+ labelSymbol,
20
+ httpSymbol,
21
+ responseCodeSymbol,
22
+ httpBodySymbol,
23
+ formDataFileSymbol,
24
+ keyDictionarySymbol,
25
+ unionCasesSymbol,
26
+ errorMatchersSymbol,
27
+ } from "@distilled.cloud/core/trait";
28
+
29
+ export {
30
+ SensitiveValue,
31
+ RawResponse,
32
+ RawResponseRoot,
33
+ sensitiveValueSymbol,
34
+ rawResponseSymbol,
35
+ rawResponseRootSymbol,
36
+ } from "@distilled.cloud/core/protocol-rest";