@distilled.cloud/namespacelabs 0.0.0 → 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 +121 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +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 +82 -2
  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,508 @@
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 {
8
+ NamespaceLabsProtocol,
9
+ type NamespaceLabsOpError,
10
+ type NamespaceLabsOpContext,
11
+ } from "../protocol.ts";
12
+ import * as Retry from "../retry.ts";
13
+ import * as T from "../traits.ts";
14
+ // Schema table, filled on first reach (see __S at the end).
15
+ const __s: any[] = [];
16
+
17
+ export type { NamespaceLabsOpError, NamespaceLabsOpContext };
18
+
19
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
20
+ const TELEMETRY = {
21
+ system: "namespacelabs-api",
22
+ responseHeaders: [
23
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
24
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
25
+ ],
26
+ prefix: "Namespacelabs",
27
+ service: "EgressPolicyService",
28
+ propagate: "w3c",
29
+ } as const;
30
+
31
+ export class AlreadyExists
32
+ extends /*@__PURE__*/ T.applyErrorMatchers(
33
+ /*@__PURE__*/ S.TaggedError<AlreadyExists>()("AlreadyExists", {
34
+ message: S.String,
35
+ body: S.Unknown,
36
+ }).pipe(C.withConflictError),
37
+ [{ status: 409, body: { "/code": "already_exists" } }],
38
+ ) {}
39
+
40
+ export class FailedPrecondition
41
+ extends /*@__PURE__*/ T.applyErrorMatchers(
42
+ /*@__PURE__*/ S.TaggedError<FailedPrecondition>()("FailedPrecondition", {
43
+ message: S.String,
44
+ body: S.Unknown,
45
+ }).pipe(C.withBadRequestError),
46
+ [{ status: 400, body: { "/code": "failed_precondition" } }],
47
+ ) {}
48
+
49
+ export class InvalidArgument
50
+ extends /*@__PURE__*/ T.applyErrorMatchers(
51
+ /*@__PURE__*/ S.TaggedError<InvalidArgument>()("InvalidArgument", {
52
+ message: S.String,
53
+ body: S.Unknown,
54
+ }).pipe(C.withBadRequestError),
55
+ [{ status: 400, body: { "/code": "invalid_argument" } }],
56
+ ) {}
57
+
58
+ export class NotFound
59
+ extends /*@__PURE__*/ T.applyErrorMatchers(
60
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
61
+ message: S.String,
62
+ body: S.Unknown,
63
+ }).pipe(C.withBadRequestError),
64
+ [{ status: 404 }],
65
+ ) {}
66
+
67
+ export class PermissionDenied
68
+ extends /*@__PURE__*/ T.applyErrorMatchers(
69
+ /*@__PURE__*/ S.TaggedError<PermissionDenied>()("PermissionDenied", {
70
+ message: S.String,
71
+ body: S.Unknown,
72
+ }).pipe(C.withAuthError),
73
+ [{ status: 403 }],
74
+ ) {}
75
+
76
+ export class ResourceExhausted
77
+ extends /*@__PURE__*/ T.applyErrorMatchers(
78
+ /*@__PURE__*/ S.TaggedError<ResourceExhausted>()("ResourceExhausted", {
79
+ message: S.String,
80
+ body: S.Unknown,
81
+ }).pipe(C.withThrottlingError),
82
+ [{ status: 429 }],
83
+ ) {}
84
+
85
+ export class Unauthenticated
86
+ extends /*@__PURE__*/ T.applyErrorMatchers(
87
+ /*@__PURE__*/ S.TaggedError<Unauthenticated>()("Unauthenticated", {
88
+ message: S.String,
89
+ body: S.Unknown,
90
+ }).pipe(C.withAuthError),
91
+ [{ status: 401 }],
92
+ ) {}
93
+
94
+ export type EgressPolicySpecMode = "MODE_UNKNOWN" | "DISABLED" | "ALLOW_ALL" | "ADVISORY" | "BLOCK";
95
+ export type EgressPolicySpecRuleRuleOp = "RULE_OP_UNKNOWN" | "ALLOW" | "PROXY" | "INJECT";
96
+ export type StringList = Array<string>;
97
+ export interface EgressPolicySpecMatcher {
98
+ matchDomains?: StringList | undefined;
99
+ }
100
+ export interface EgressPolicySpecAllowOpts {}
101
+ export interface EgressPolicySpecProxyOpts {
102
+ viaDomain?: string | undefined;
103
+ }
104
+ export interface ResolvableValue {
105
+ static?: string | undefined;
106
+ fromSecretId?: string | undefined;
107
+ }
108
+ export interface HttpHeader {
109
+ name?: string | undefined;
110
+ value?: string | undefined;
111
+ valueFrom?: ResolvableValue | undefined;
112
+ }
113
+ export type HttpHeaderList = Array<HttpHeader>;
114
+ export interface EgressPolicySpecInjectOptsFromEndpoint {
115
+ url?: string | undefined;
116
+ headers?: HttpHeaderList | undefined;
117
+ }
118
+ export type EgressPolicySpecInjectOptsResolutionPolicy =
119
+ | "RESOLUTION_POLICY_UNKNOWN"
120
+ | "RESOLUTION_POLICY_ONCE"
121
+ | "RESOLUTION_POLICY_WHEN_STALE";
122
+ export interface EgressPolicySpecInjectOpts {
123
+ headerName?: string | undefined;
124
+ /** Exactly one value source must be set. */
125
+ fromSecretId?: string | undefined;
126
+ /** Plaintext value. */
127
+ value?: string | undefined;
128
+ /** Fetches the value to inject from an HTTP endpoint using GET. */
129
+ fromEndpoint?: EgressPolicySpecInjectOptsFromEndpoint | undefined;
130
+ resolutionPolicy?: EgressPolicySpecInjectOptsResolutionPolicy | (string & {}) | undefined;
131
+ }
132
+ export interface EgressPolicySpecRule {
133
+ op?: EgressPolicySpecRuleRuleOp | (string & {}) | undefined;
134
+ matcher?: EgressPolicySpecMatcher | undefined;
135
+ allow?: EgressPolicySpecAllowOpts | undefined;
136
+ proxy?: EgressPolicySpecProxyOpts | undefined;
137
+ inject?: EgressPolicySpecInjectOpts | undefined;
138
+ }
139
+ export type EgressPolicySpecRuleList = Array<EgressPolicySpecRule>;
140
+ export interface EgressPolicySpec {
141
+ mode?: EgressPolicySpecMode | (string & {}) | undefined;
142
+ /** Enables HTTP and HTTPS interception for PROXY and INJECT rules. */
143
+ deepPacketInspection?: boolean | undefined;
144
+ /** Rules applied in order to outbound connections. */
145
+ rules?: EgressPolicySpecRuleList | undefined;
146
+ /** Tags of Namespace-managed egress rulesets appended to rules. */
147
+ additionalRulesets?: StringList | undefined;
148
+ /** Deprecated. Only supported in inline egress policies during instance creation. Use `ALLOW` rules instead. */
149
+ allowedEgressDomains?: StringList | undefined;
150
+ }
151
+ export interface EgressPolicy {
152
+ /** Workspace-unique tag used to reference this policy from workloads. */
153
+ tag?: string | undefined;
154
+ description?: string | undefined;
155
+ spec?: EgressPolicySpec | undefined;
156
+ }
157
+ export interface CreateEgressPolicyRequest {
158
+ policy?: EgressPolicy | undefined;
159
+ }
160
+ export interface CreateEgressPolicyResponse {
161
+ /** The revision of the created policy. */
162
+ revision: string;
163
+ }
164
+ export interface GetEgressPolicyRequest {
165
+ tag?: string | undefined;
166
+ }
167
+ export interface GetEgressPolicyResponse {
168
+ policy?: EgressPolicy | undefined;
169
+ /** The current revision of the policy. */
170
+ revision: string;
171
+ }
172
+ export interface ListEgressPoliciesRequest {}
173
+ export interface ListEgressPoliciesResponseEgressPolicyEntry {
174
+ policy?: EgressPolicy | undefined;
175
+ /** The current revision of the policy. */
176
+ revision: string;
177
+ }
178
+ export type ListEgressPoliciesResponseEgressPolicyEntryList =
179
+ Array<ListEgressPoliciesResponseEgressPolicyEntry>;
180
+ export interface ListEgressPoliciesResponse {
181
+ policies: ListEgressPoliciesResponseEgressPolicyEntryList;
182
+ }
183
+ export interface UpdateEgressPolicyRequest {
184
+ policy?: EgressPolicy | undefined;
185
+ /** Only update if the policy revision matches. Obtain the current value from GetEgressPolicy. */
186
+ matchRevision?: string | undefined;
187
+ }
188
+ export interface UpdateEgressPolicyResponse {
189
+ /** The revision of the updated policy. */
190
+ revision: string;
191
+ }
192
+ export type CreateEgressPolicyError =
193
+ | InvalidArgument
194
+ | FailedPrecondition
195
+ | Unauthenticated
196
+ | PermissionDenied
197
+ | NotFound
198
+ | AlreadyExists
199
+ | ResourceExhausted
200
+ | NamespaceLabsOpError;
201
+ /** Creates a new egress policy. The policy tag must be unique within the workspace. */
202
+ export const createEgressPolicy: API.OperationMethod<
203
+ CreateEgressPolicyRequest,
204
+ CreateEgressPolicyResponse,
205
+ CreateEgressPolicyError,
206
+ NamespaceLabsOpContext
207
+ > = /*@__PURE__*/ API.make(() => ({
208
+ input: __S(16, __c1, 0) as any as S.Schema<CreateEgressPolicyRequest>,
209
+ output: __S(32, __c2, 0) as any as S.Schema<CreateEgressPolicyResponse>,
210
+ errors: [
211
+ InvalidArgument,
212
+ FailedPrecondition,
213
+ Unauthenticated,
214
+ PermissionDenied,
215
+ NotFound,
216
+ AlreadyExists,
217
+ ResourceExhausted,
218
+ UnknownNamespaceLabsError,
219
+ ],
220
+ protocol: NamespaceLabsProtocol,
221
+ retry: Retry.Retry,
222
+ telemetry: TELEMETRY,
223
+ span: "CreateEgressPolicy",
224
+ }));
225
+
226
+ export type GetEgressPolicyError =
227
+ | InvalidArgument
228
+ | FailedPrecondition
229
+ | Unauthenticated
230
+ | PermissionDenied
231
+ | NotFound
232
+ | AlreadyExists
233
+ | ResourceExhausted
234
+ | NamespaceLabsOpError;
235
+ /** Returns an egress policy by tag. */
236
+ export const getEgressPolicy: API.OperationMethod<
237
+ GetEgressPolicyRequest,
238
+ GetEgressPolicyResponse,
239
+ GetEgressPolicyError,
240
+ NamespaceLabsOpContext
241
+ > = /*@__PURE__*/ API.make(() => ({
242
+ input: __S(64, __c4, 0) as any as S.Schema<GetEgressPolicyRequest>,
243
+ output: __S(80, __c5, 0) as any as S.Schema<GetEgressPolicyResponse>,
244
+ errors: [
245
+ InvalidArgument,
246
+ FailedPrecondition,
247
+ Unauthenticated,
248
+ PermissionDenied,
249
+ NotFound,
250
+ AlreadyExists,
251
+ ResourceExhausted,
252
+ UnknownNamespaceLabsError,
253
+ ],
254
+ protocol: NamespaceLabsProtocol,
255
+ retry: Retry.Retry,
256
+ telemetry: TELEMETRY,
257
+ span: "GetEgressPolicy",
258
+ }));
259
+
260
+ export type ListEgressPoliciesError =
261
+ | InvalidArgument
262
+ | FailedPrecondition
263
+ | Unauthenticated
264
+ | PermissionDenied
265
+ | NotFound
266
+ | AlreadyExists
267
+ | ResourceExhausted
268
+ | NamespaceLabsOpError;
269
+ /** Lists all egress policies in the workspace. */
270
+ export const listEgressPolicies: API.OperationMethod<
271
+ ListEgressPoliciesRequest,
272
+ ListEgressPoliciesResponse,
273
+ ListEgressPoliciesError,
274
+ NamespaceLabsOpContext
275
+ > = /*@__PURE__*/ API.make(() => ({
276
+ input: __S(96, __c6, 0) as any as S.Schema<ListEgressPoliciesRequest>,
277
+ output: __S(98, __c6, 2) as any as S.Schema<ListEgressPoliciesResponse>,
278
+ errors: [
279
+ InvalidArgument,
280
+ FailedPrecondition,
281
+ Unauthenticated,
282
+ PermissionDenied,
283
+ NotFound,
284
+ AlreadyExists,
285
+ ResourceExhausted,
286
+ UnknownNamespaceLabsError,
287
+ ],
288
+ protocol: NamespaceLabsProtocol,
289
+ retry: Retry.Retry,
290
+ telemetry: TELEMETRY,
291
+ span: "ListEgressPolicies",
292
+ }));
293
+
294
+ export type UpdateEgressPolicyError =
295
+ | InvalidArgument
296
+ | FailedPrecondition
297
+ | Unauthenticated
298
+ | PermissionDenied
299
+ | NotFound
300
+ | AlreadyExists
301
+ | ResourceExhausted
302
+ | NamespaceLabsOpError;
303
+ /** Replaces an existing egress policy. */
304
+ export const updateEgressPolicy: API.OperationMethod<
305
+ UpdateEgressPolicyRequest,
306
+ UpdateEgressPolicyResponse,
307
+ UpdateEgressPolicyError,
308
+ NamespaceLabsOpContext
309
+ > = /*@__PURE__*/ API.make(() => ({
310
+ input: __S(0, __c0, 0) as any as S.Schema<UpdateEgressPolicyRequest>,
311
+ output: __S(32, __c2, 0) as any as S.Schema<UpdateEgressPolicyResponse>,
312
+ errors: [
313
+ InvalidArgument,
314
+ FailedPrecondition,
315
+ Unauthenticated,
316
+ PermissionDenied,
317
+ NotFound,
318
+ AlreadyExists,
319
+ ResourceExhausted,
320
+ UnknownNamespaceLabsError,
321
+ ],
322
+ protocol: NamespaceLabsProtocol,
323
+ retry: Retry.Retry,
324
+ telemetry: TELEMETRY,
325
+ span: "UpdateEgressPolicy",
326
+ }));
327
+
328
+ // Schema builders: each runs one schema initializer, on that schema's first use.
329
+ function __c0(j: number): any {
330
+ switch (j) {
331
+ case 0:
332
+ return S.suspend(() =>
333
+ S.Struct({
334
+ policy: S.optional(__S(60, __c3, 12)),
335
+ matchRevision: S.optional(S.String),
336
+ }).pipe(
337
+ T.Http({
338
+ method: "POST",
339
+ uri: "/namespace.cloud.network.v1beta.EgressPolicyService/UpdateEgressPolicy",
340
+ code: 200,
341
+ }),
342
+ ),
343
+ ).annotate({ identifier: "UpdateEgressPolicyRequest" });
344
+ }
345
+ }
346
+ function __c1(j: number): any {
347
+ switch (j) {
348
+ case 0:
349
+ return S.suspend(() =>
350
+ S.Struct({
351
+ policy: S.optional(__S(60, __c3, 12)),
352
+ }).pipe(
353
+ T.Http({
354
+ method: "POST",
355
+ uri: "/namespace.cloud.network.v1beta.EgressPolicyService/CreateEgressPolicy",
356
+ code: 200,
357
+ }),
358
+ ),
359
+ ).annotate({ identifier: "CreateEgressPolicyRequest" });
360
+ }
361
+ }
362
+ function __c2(j: number): any {
363
+ switch (j) {
364
+ case 0:
365
+ return S.suspend(() =>
366
+ S.Struct({
367
+ revision: S.String,
368
+ }),
369
+ ).annotate({ identifier: "CreateEgressPolicyResponse" });
370
+ }
371
+ }
372
+ function __c3(j: number): any {
373
+ switch (j) {
374
+ case 0:
375
+ return S.Array(S.String);
376
+ case 1:
377
+ return S.suspend(() =>
378
+ S.Struct({
379
+ matchDomains: S.optional(__S(48, __c3, 0)),
380
+ }),
381
+ ).annotate({ identifier: "EgressPolicySpecMatcher" });
382
+ case 2:
383
+ return S.suspend(() => S.Struct({})).annotate({ identifier: "EgressPolicySpecAllowOpts" });
384
+ case 3:
385
+ return S.suspend(() =>
386
+ S.Struct({
387
+ viaDomain: S.optional(S.String),
388
+ }),
389
+ ).annotate({ identifier: "EgressPolicySpecProxyOpts" });
390
+ case 4:
391
+ return S.suspend(() =>
392
+ S.Struct({
393
+ static: S.optional(S.String),
394
+ fromSecretId: S.optional(S.String),
395
+ }),
396
+ ).annotate({ identifier: "ResolvableValue" });
397
+ case 5:
398
+ return S.suspend(() =>
399
+ S.Struct({
400
+ name: S.optional(S.String),
401
+ value: S.optional(S.String),
402
+ valueFrom: S.optional(__S(52, __c3, 4)),
403
+ }),
404
+ ).annotate({ identifier: "HttpHeader" });
405
+ case 6:
406
+ return S.Array(__S(53, __c3, 5));
407
+ case 7:
408
+ return S.suspend(() =>
409
+ S.Struct({
410
+ url: S.optional(S.String),
411
+ headers: S.optional(__S(54, __c3, 6)),
412
+ }),
413
+ ).annotate({ identifier: "EgressPolicySpecInjectOptsFromEndpoint" });
414
+ case 8:
415
+ return S.suspend(() =>
416
+ S.Struct({
417
+ headerName: S.optional(S.String),
418
+ fromSecretId: S.optional(S.String),
419
+ value: S.optional(S.String),
420
+ fromEndpoint: S.optional(__S(55, __c3, 7)),
421
+ resolutionPolicy: S.optional(S.String),
422
+ }),
423
+ ).annotate({ identifier: "EgressPolicySpecInjectOpts" });
424
+ case 9:
425
+ return S.suspend(() =>
426
+ S.Struct({
427
+ op: S.optional(S.String),
428
+ matcher: S.optional(__S(49, __c3, 1)),
429
+ allow: S.optional(__S(50, __c3, 2)),
430
+ proxy: S.optional(__S(51, __c3, 3)),
431
+ inject: S.optional(__S(56, __c3, 8)),
432
+ }),
433
+ ).annotate({ identifier: "EgressPolicySpecRule" });
434
+ case 10:
435
+ return S.Array(__S(57, __c3, 9));
436
+ case 11:
437
+ return S.suspend(() =>
438
+ S.Struct({
439
+ mode: S.optional(S.String),
440
+ deepPacketInspection: S.optional(S.Boolean),
441
+ rules: S.optional(__S(58, __c3, 10)),
442
+ additionalRulesets: S.optional(__S(48, __c3, 0)),
443
+ allowedEgressDomains: S.optional(__S(48, __c3, 0)),
444
+ }),
445
+ ).annotate({ identifier: "EgressPolicySpec" });
446
+ case 12:
447
+ return S.suspend(() =>
448
+ S.Struct({
449
+ tag: S.optional(S.String),
450
+ description: S.optional(S.String),
451
+ spec: S.optional(__S(59, __c3, 11)),
452
+ }),
453
+ ).annotate({ identifier: "EgressPolicy" });
454
+ }
455
+ }
456
+ function __c4(j: number): any {
457
+ switch (j) {
458
+ case 0:
459
+ return S.suspend(() =>
460
+ S.Struct({
461
+ tag: S.optional(S.String),
462
+ }).pipe(
463
+ T.Http({
464
+ method: "POST",
465
+ uri: "/namespace.cloud.network.v1beta.EgressPolicyService/GetEgressPolicy",
466
+ code: 200,
467
+ }),
468
+ ),
469
+ ).annotate({ identifier: "GetEgressPolicyRequest" });
470
+ }
471
+ }
472
+ function __c5(j: number): any {
473
+ switch (j) {
474
+ case 0:
475
+ return S.suspend(() =>
476
+ S.Struct({
477
+ policy: S.optional(__S(60, __c3, 12)),
478
+ revision: S.String,
479
+ }),
480
+ ).annotate({ identifier: "GetEgressPolicyResponse" });
481
+ }
482
+ }
483
+ function __c6(j: number): any {
484
+ switch (j) {
485
+ case 0:
486
+ return S.suspend(() =>
487
+ S.Struct({}).pipe(
488
+ T.Http({
489
+ method: "POST",
490
+ uri: "/namespace.cloud.network.v1beta.EgressPolicyService/ListEgressPolicies",
491
+ code: 200,
492
+ }),
493
+ ),
494
+ ).annotate({ identifier: "ListEgressPoliciesRequest" });
495
+ case 1:
496
+ return S.Array(__S(80, __c5, 0));
497
+ case 2:
498
+ return S.suspend(() =>
499
+ S.Struct({
500
+ policies: __S(97, __c6, 1),
501
+ }),
502
+ ).annotate({ identifier: "ListEgressPoliciesResponse" });
503
+ }
504
+ }
505
+ // Schema table: entry i is schema j of builder f, made on first reach.
506
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
507
+ return (__s[i] ??= __L.at(f, j));
508
+ }