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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +130 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +73 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +59 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +44 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +2 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +12 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/buildkite_jobs.d.ts +129 -0
  26. package/lib/services/buildkite_jobs.d.ts.map +1 -0
  27. package/lib/services/buildkite_jobs.js +2 -0
  28. package/lib/services/buildkite_jobs.js.map +1 -0
  29. package/lib/services/buildkite_queue.d.ts +186 -0
  30. package/lib/services/buildkite_queue.d.ts.map +1 -0
  31. package/lib/services/buildkite_queue.js +2 -0
  32. package/lib/services/buildkite_queue.js.map +1 -0
  33. package/lib/services/index.d.ts +3 -0
  34. package/lib/services/index.d.ts.map +1 -0
  35. package/lib/services/index.js +2 -0
  36. package/lib/services.lazy/buildkite_jobs.js +1 -0
  37. package/lib/services.lazy/buildkite_queue.js +1 -0
  38. package/lib/services.lazy/index.js +3 -0
  39. package/lib/traits.d.ts +3 -0
  40. package/lib/traits.d.ts.map +1 -0
  41. package/lib/traits.js +1 -0
  42. package/lib/unstable-services/artifacts.d.ts +268 -0
  43. package/lib/unstable-services/artifacts.d.ts.map +1 -0
  44. package/lib/unstable-services/artifacts.js +2 -0
  45. package/lib/unstable-services/artifacts.js.map +1 -0
  46. package/lib/unstable-services/audit.d.ts +157 -0
  47. package/lib/unstable-services/audit.d.ts.map +1 -0
  48. package/lib/unstable-services/audit.js +2 -0
  49. package/lib/unstable-services/audit.js.map +1 -0
  50. package/lib/unstable-services/bazel.d.ts +181 -0
  51. package/lib/unstable-services/bazel.d.ts.map +1 -0
  52. package/lib/unstable-services/bazel.js +2 -0
  53. package/lib/unstable-services/bazel.js.map +1 -0
  54. package/lib/unstable-services/bazel_cache.d.ts +126 -0
  55. package/lib/unstable-services/bazel_cache.d.ts.map +1 -0
  56. package/lib/unstable-services/bazel_cache.js +2 -0
  57. package/lib/unstable-services/bazel_cache.js.map +1 -0
  58. package/lib/unstable-services/builder.d.ts +242 -0
  59. package/lib/unstable-services/builder.d.ts.map +1 -0
  60. package/lib/unstable-services/builder.js +2 -0
  61. package/lib/unstable-services/builder.js.map +1 -0
  62. package/lib/unstable-services/compute.d.ts +1124 -0
  63. package/lib/unstable-services/compute.d.ts.map +1 -0
  64. package/lib/unstable-services/compute.js +47 -0
  65. package/lib/unstable-services/compute.js.map +1 -0
  66. package/lib/unstable-services/compute_command.d.ts +120 -0
  67. package/lib/unstable-services/compute_command.d.ts.map +1 -0
  68. package/lib/unstable-services/compute_command.js +2 -0
  69. package/lib/unstable-services/compute_command.js.map +1 -0
  70. package/lib/unstable-services/compute_observability.d.ts +165 -0
  71. package/lib/unstable-services/compute_observability.d.ts.map +1 -0
  72. package/lib/unstable-services/compute_observability.js +2 -0
  73. package/lib/unstable-services/compute_observability.js.map +1 -0
  74. package/lib/unstable-services/compute_storage.d.ts +379 -0
  75. package/lib/unstable-services/compute_storage.d.ts.map +1 -0
  76. package/lib/unstable-services/compute_storage.js +33 -0
  77. package/lib/unstable-services/compute_storage.js.map +1 -0
  78. package/lib/unstable-services/compute_usage.d.ts +283 -0
  79. package/lib/unstable-services/compute_usage.d.ts.map +1 -0
  80. package/lib/unstable-services/compute_usage.js +2 -0
  81. package/lib/unstable-services/compute_usage.js.map +1 -0
  82. package/lib/unstable-services/egress.d.ts +191 -0
  83. package/lib/unstable-services/egress.d.ts.map +1 -0
  84. package/lib/unstable-services/egress.js +2 -0
  85. package/lib/unstable-services/egress.js.map +1 -0
  86. package/lib/unstable-services/experimental_compute_reservation.d.ts +672 -0
  87. package/lib/unstable-services/experimental_compute_reservation.d.ts.map +1 -0
  88. package/lib/unstable-services/experimental_compute_reservation.js +23 -0
  89. package/lib/unstable-services/experimental_compute_reservation.js.map +1 -0
  90. package/lib/unstable-services/experimental_remote_results.d.ts +496 -0
  91. package/lib/unstable-services/experimental_remote_results.d.ts.map +1 -0
  92. package/lib/unstable-services/experimental_remote_results.js +2 -0
  93. package/lib/unstable-services/experimental_remote_results.js.map +1 -0
  94. package/lib/unstable-services/github_image.d.ts +162 -0
  95. package/lib/unstable-services/github_image.d.ts.map +1 -0
  96. package/lib/unstable-services/github_image.js +2 -0
  97. package/lib/unstable-services/github_image.js.map +1 -0
  98. package/lib/unstable-services/github_jobs.d.ts +183 -0
  99. package/lib/unstable-services/github_jobs.d.ts.map +1 -0
  100. package/lib/unstable-services/github_jobs.js +2 -0
  101. package/lib/unstable-services/github_jobs.js.map +1 -0
  102. package/lib/unstable-services/github_profile.d.ts +296 -0
  103. package/lib/unstable-services/github_profile.d.ts.map +1 -0
  104. package/lib/unstable-services/github_profile.js +2 -0
  105. package/lib/unstable-services/github_profile.js.map +1 -0
  106. package/lib/unstable-services/gradle_cache.d.ts +125 -0
  107. package/lib/unstable-services/gradle_cache.d.ts.map +1 -0
  108. package/lib/unstable-services/gradle_cache.js +2 -0
  109. package/lib/unstable-services/gradle_cache.js.map +1 -0
  110. package/lib/unstable-services/httpcache.d.ts +125 -0
  111. package/lib/unstable-services/httpcache.d.ts.map +1 -0
  112. package/lib/unstable-services/httpcache.js +2 -0
  113. package/lib/unstable-services/httpcache.js.map +1 -0
  114. package/lib/unstable-services/iam_tenant.d.ts +457 -0
  115. package/lib/unstable-services/iam_tenant.d.ts.map +1 -0
  116. package/lib/unstable-services/iam_tenant.js +45 -0
  117. package/lib/unstable-services/iam_tenant.js.map +1 -0
  118. package/lib/unstable-services/iam_tenant_membership.d.ts +114 -0
  119. package/lib/unstable-services/iam_tenant_membership.d.ts.map +1 -0
  120. package/lib/unstable-services/iam_tenant_membership.js +2 -0
  121. package/lib/unstable-services/iam_tenant_membership.js.map +1 -0
  122. package/lib/unstable-services/iam_token.d.ts +257 -0
  123. package/lib/unstable-services/iam_token.d.ts.map +1 -0
  124. package/lib/unstable-services/iam_token.js +2 -0
  125. package/lib/unstable-services/iam_token.js.map +1 -0
  126. package/lib/unstable-services/image.d.ts +222 -0
  127. package/lib/unstable-services/image.d.ts.map +1 -0
  128. package/lib/unstable-services/image.js +2 -0
  129. package/lib/unstable-services/image.js.map +1 -0
  130. package/lib/unstable-services/index.d.ts +28 -0
  131. package/lib/unstable-services/index.d.ts.map +1 -0
  132. package/lib/unstable-services/index.js +27 -0
  133. package/lib/unstable-services/private_devbox.d.ts +1180 -0
  134. package/lib/unstable-services/private_devbox.d.ts.map +1 -0
  135. package/lib/unstable-services/private_devbox.js +81 -0
  136. package/lib/unstable-services/private_devbox.js.map +1 -0
  137. package/lib/unstable-services/private_user_sessions.d.ts +145 -0
  138. package/lib/unstable-services/private_user_sessions.d.ts.map +1 -0
  139. package/lib/unstable-services/private_user_sessions.js +2 -0
  140. package/lib/unstable-services/private_user_sessions.js.map +1 -0
  141. package/lib/unstable-services/registry.d.ts +373 -0
  142. package/lib/unstable-services/registry.d.ts.map +1 -0
  143. package/lib/unstable-services/registry.js +34 -0
  144. package/lib/unstable-services/registry.js.map +1 -0
  145. package/lib/unstable-services/testing.d.ts +160 -0
  146. package/lib/unstable-services/testing.d.ts.map +1 -0
  147. package/lib/unstable-services/testing.js +2 -0
  148. package/lib/unstable-services/testing.js.map +1 -0
  149. package/lib/unstable-services/vault.d.ts +203 -0
  150. package/lib/unstable-services/vault.d.ts.map +1 -0
  151. package/lib/unstable-services/vault.js +2 -0
  152. package/lib/unstable-services/vault.js.map +1 -0
  153. package/lib/unstable-services.lazy/artifacts.js +1 -0
  154. package/lib/unstable-services.lazy/audit.js +1 -0
  155. package/lib/unstable-services.lazy/bazel.js +1 -0
  156. package/lib/unstable-services.lazy/bazel_cache.js +1 -0
  157. package/lib/unstable-services.lazy/builder.js +1 -0
  158. package/lib/unstable-services.lazy/compute.js +4 -0
  159. package/lib/unstable-services.lazy/compute_command.js +1 -0
  160. package/lib/unstable-services.lazy/compute_observability.js +1 -0
  161. package/lib/unstable-services.lazy/compute_storage.js +4 -0
  162. package/lib/unstable-services.lazy/compute_usage.js +1 -0
  163. package/lib/unstable-services.lazy/egress.js +1 -0
  164. package/lib/unstable-services.lazy/experimental_compute_reservation.js +4 -0
  165. package/lib/unstable-services.lazy/experimental_remote_results.js +1 -0
  166. package/lib/unstable-services.lazy/github_image.js +1 -0
  167. package/lib/unstable-services.lazy/github_jobs.js +1 -0
  168. package/lib/unstable-services.lazy/github_profile.js +1 -0
  169. package/lib/unstable-services.lazy/gradle_cache.js +1 -0
  170. package/lib/unstable-services.lazy/httpcache.js +1 -0
  171. package/lib/unstable-services.lazy/iam_tenant.js +4 -0
  172. package/lib/unstable-services.lazy/iam_tenant_membership.js +1 -0
  173. package/lib/unstable-services.lazy/iam_token.js +1 -0
  174. package/lib/unstable-services.lazy/image.js +1 -0
  175. package/lib/unstable-services.lazy/index.js +3 -0
  176. package/lib/unstable-services.lazy/private_devbox.js +4 -0
  177. package/lib/unstable-services.lazy/private_user_sessions.js +1 -0
  178. package/lib/unstable-services.lazy/registry.js +4 -0
  179. package/lib/unstable-services.lazy/testing.js +1 -0
  180. package/lib/unstable-services.lazy/vault.js +1 -0
  181. package/package.json +89 -2
  182. package/src/credentials.ts +208 -0
  183. package/src/errors.ts +71 -0
  184. package/src/index.ts +50 -0
  185. package/src/pagination.ts +1 -0
  186. package/src/protocol.ts +83 -0
  187. package/src/retry.ts +28 -0
  188. package/src/services/buildkite_jobs.ts +230 -0
  189. package/src/services/buildkite_queue.ts +453 -0
  190. package/src/services/index.ts +3 -0
  191. package/src/traits.ts +36 -0
  192. package/src/unstable-services/artifacts.ts +769 -0
  193. package/src/unstable-services/audit.ts +323 -0
  194. package/src/unstable-services/bazel.ts +423 -0
  195. package/src/unstable-services/bazel_cache.ts +219 -0
  196. package/src/unstable-services/builder.ts +576 -0
  197. package/src/unstable-services/compute.ts +2991 -0
  198. package/src/unstable-services/compute_command.ts +220 -0
  199. package/src/unstable-services/compute_observability.ts +436 -0
  200. package/src/unstable-services/compute_storage.ts +1167 -0
  201. package/src/unstable-services/compute_usage.ts +738 -0
  202. package/src/unstable-services/egress.ts +516 -0
  203. package/src/unstable-services/experimental_compute_reservation.ts +1499 -0
  204. package/src/unstable-services/experimental_remote_results.ts +1165 -0
  205. package/src/unstable-services/github_image.ts +301 -0
  206. package/src/unstable-services/github_jobs.ts +389 -0
  207. package/src/unstable-services/github_profile.ts +729 -0
  208. package/src/unstable-services/gradle_cache.ts +271 -0
  209. package/src/unstable-services/httpcache.ts +271 -0
  210. package/src/unstable-services/iam_tenant.ts +1720 -0
  211. package/src/unstable-services/iam_tenant_membership.ts +253 -0
  212. package/src/unstable-services/iam_token.ts +788 -0
  213. package/src/unstable-services/image.ts +602 -0
  214. package/src/unstable-services/index.ts +28 -0
  215. package/src/unstable-services/private_devbox.ts +4256 -0
  216. package/src/unstable-services/private_user_sessions.ts +410 -0
  217. package/src/unstable-services/registry.ts +1242 -0
  218. package/src/unstable-services/testing.ts +394 -0
  219. package/src/unstable-services/vault.ts +522 -0
@@ -0,0 +1,788 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import * as C from "@distilled.cloud/core/category";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (buf.build/namespace/cloud -> smithy). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import type * as Redacted from "effect/Redacted";
7
+ import { NamespaceLabsServiceErrors } from "../errors.ts";
8
+ import { paginateCursor } from "../pagination.ts";
9
+ import {
10
+ NamespaceLabsProtocol,
11
+ type NamespaceLabsOpError,
12
+ type NamespaceLabsOpContext,
13
+ } from "../protocol.ts";
14
+ import * as Retry from "../retry.ts";
15
+ import * as T from "../traits.ts";
16
+ // Schema table, filled on first reach (see __S at the end).
17
+ const __s: any[] = [];
18
+
19
+ export type { NamespaceLabsOpError, NamespaceLabsOpContext };
20
+
21
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
22
+ const TELEMETRY = {
23
+ system: "namespacelabs-api",
24
+ responseHeaders: [
25
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
26
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
27
+ ],
28
+ prefix: "Namespacelabs",
29
+ service: "TokenService",
30
+ propagate: "w3c",
31
+ } as const;
32
+
33
+ export class AlreadyExists
34
+ extends /*@__PURE__*/ T.applyErrorMatchers(
35
+ /*@__PURE__*/ S.TaggedError<AlreadyExists>()("AlreadyExists", {
36
+ message: S.String,
37
+ body: S.Unknown,
38
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
39
+ }).pipe(C.withConflictError),
40
+ [{ status: 409, body: { "/code": "already_exists" } }],
41
+ ) {}
42
+
43
+ export class FailedPrecondition
44
+ extends /*@__PURE__*/ T.applyErrorMatchers(
45
+ /*@__PURE__*/ S.TaggedError<FailedPrecondition>()("FailedPrecondition", {
46
+ message: S.String,
47
+ body: S.Unknown,
48
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
49
+ }).pipe(C.withBadRequestError),
50
+ [{ status: 400, body: { "/code": "failed_precondition" } }],
51
+ ) {}
52
+
53
+ export class InvalidArgument
54
+ extends /*@__PURE__*/ T.applyErrorMatchers(
55
+ /*@__PURE__*/ S.TaggedError<InvalidArgument>()("InvalidArgument", {
56
+ message: S.String,
57
+ body: S.Unknown,
58
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
59
+ }).pipe(C.withBadRequestError),
60
+ [{ status: 400, body: { "/code": "invalid_argument" } }],
61
+ ) {}
62
+
63
+ export class NotFound
64
+ extends /*@__PURE__*/ T.applyErrorMatchers(
65
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
66
+ message: S.String,
67
+ body: S.Unknown,
68
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
69
+ }).pipe(C.withBadRequestError),
70
+ [{ status: 404 }],
71
+ ) {}
72
+
73
+ export class PermissionDenied
74
+ extends /*@__PURE__*/ T.applyErrorMatchers(
75
+ /*@__PURE__*/ S.TaggedError<PermissionDenied>()("PermissionDenied", {
76
+ message: S.String,
77
+ body: S.Unknown,
78
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
79
+ }).pipe(C.withAuthError),
80
+ [{ status: 403 }],
81
+ ) {}
82
+
83
+ export class ResourceExhausted
84
+ extends /*@__PURE__*/ T.applyErrorMatchers(
85
+ /*@__PURE__*/ S.TaggedError<ResourceExhausted>()("ResourceExhausted", {
86
+ message: S.String,
87
+ body: S.Unknown,
88
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
89
+ retryAfter: /*@__PURE__*/ S.optional(S.Duration),
90
+ }).pipe(C.withThrottlingError),
91
+ [{ status: 429 }],
92
+ ) {}
93
+
94
+ export class Unauthenticated
95
+ extends /*@__PURE__*/ T.applyErrorMatchers(
96
+ /*@__PURE__*/ S.TaggedError<Unauthenticated>()("Unauthenticated", {
97
+ message: S.String,
98
+ body: S.Unknown,
99
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
100
+ }).pipe(C.withAuthError),
101
+ [{ status: 401 }],
102
+ ) {}
103
+
104
+ export type RevokableTokenScope = "SCOPE_UNKNOWN" | "TENANT_SCOPE" | "TENANT_MEMBERSHIP_SCOPE";
105
+ export interface BatchRevokeRevokableTokenRequest {
106
+ /** Revoke tokens created before this timestamp. If not set, no time-based filtering is applied. */
107
+ before?: string | undefined;
108
+ /** Revoke tokens created by this actor_id (only applies to user actors). If not set, no actor-based filtering is applied. */
109
+ createdByActorId?: string | undefined;
110
+ /** Revoke tokens with the selected scope only. If not set, no scope-based filtering is applied. */
111
+ scope?: RevokableTokenScope | (string & {}) | undefined;
112
+ }
113
+ export type StringList = Array<string>;
114
+ export interface BatchRevokeRevokableTokenResponse {
115
+ /** The IDs of the tokens that were revoked (prefixed with "tok_"). */
116
+ revokedTokenIds: StringList;
117
+ }
118
+ export interface TenantTokenPolicy {
119
+ /** The policy type being set. Consult with the Namespace team on which controls can be applied per tenant token. */
120
+ policyType?: string | undefined;
121
+ /** The policy-specific value. It may be a string, number, or serialized message (e.g. JSON). */
122
+ value?: string | undefined;
123
+ }
124
+ export type TenantTokenPolicyList = Array<TenantTokenPolicy>;
125
+ /** Defines a permission grant on a resource. Permissions are used to restrict what a token is allowed to do. See https://namespace.so/docs/security/permissions for a list of available resource types and actions. */
126
+ export interface Permission {
127
+ /** The type of resource this permission applies to, e.g. "instance", "vault/object", "token/revokable". */
128
+ resourceType?: string | undefined;
129
+ /** The specific resource ID, or empty for all resources of this type. */
130
+ resourceId?: string | undefined;
131
+ /** The set of actions allowed on the resource, e.g. "create", "list", "describe". */
132
+ actions?: StringList | undefined;
133
+ }
134
+ export type PermissionList = Array<Permission>;
135
+ export interface AccessPolicy {
136
+ /** Grant a restricted set of permissions to this token. See https://namespace.so/docs/security/permissions for available permissions. */
137
+ grants?: PermissionList | undefined;
138
+ }
139
+ export interface CreateRevokableTokenRequest {
140
+ /** A unique name for the token within the tenant. Required. */
141
+ name?: string | undefined;
142
+ /** A human-readable description of the token's purpose. */
143
+ description?: string | undefined;
144
+ /** When the token should expire. Maximum expiration is 1 year from creation. May be omitted for membership-scoped tokens to create a token with unlimited duration. */
145
+ expiresAt?: string | undefined;
146
+ /** A set of policies that apply to this token. */
147
+ policies?: TenantTokenPolicyList | undefined;
148
+ /** Configure the access permissions available with this token. */
149
+ access?: AccessPolicy | undefined;
150
+ /** Allows restricting the scope of the issued token. */
151
+ scope?: RevokableTokenScope | (string & {}) | undefined;
152
+ }
153
+ export type RevokableTokenState = "STATE_UNKNOWN" | "ACTIVE" | "REVOKED" | "EXPIRED";
154
+ export interface RevokableToken {
155
+ /** The unique identifier for this token, prefixed with "tok_". This is used for revocation. */
156
+ tokenId: string;
157
+ /** The tenant this token belongs to. */
158
+ tenantId: string;
159
+ /** A unique name for the token within the tenant. */
160
+ name: string;
161
+ /** A human-readable description of the token's purpose. */
162
+ description: string;
163
+ /** When the token was created. */
164
+ createdAt?: string | undefined;
165
+ /** When the token expires. Tokens are implicitly invalid after this time. If omitted, the membership-scoped token has unlimited duration. */
166
+ expiresAt?: string | undefined;
167
+ /** If set, when the token was explicitly revoked. */
168
+ revokedAt?: string | undefined;
169
+ /** If set, the actor who revoked the token. */
170
+ revokedByActorId: string;
171
+ /** The actor who created this token. */
172
+ creatorActorId: string;
173
+ /** Indicates whether the token is bound to a particular membership, or tenant-wide. */
174
+ scope: RevokableTokenScope;
175
+ /** The permissions granted to this token. */
176
+ permissions: PermissionList;
177
+ /** The current state of the token. */
178
+ state: RevokableTokenState;
179
+ }
180
+ export interface CreateRevokableTokenResponse {
181
+ /** The bearer token that can be used for authentication. This value is only returned once at creation time and cannot be retrieved later. */
182
+ bearerToken: string | Redacted.Redacted<string>;
183
+ /** The token metadata, including the token_id (prefixed with "tok_") which can be used to revoke or list the token. */
184
+ token?: RevokableToken | undefined;
185
+ }
186
+ export interface IssueIdTokenRequest {
187
+ /** Target audience for the generated identity token. */
188
+ audience?: string | undefined;
189
+ }
190
+ export interface IssueIdTokenResponse {
191
+ /** The signed OIDC ID token. Use this token to authenticate with external services that trust the Namespace federation issuer (`https://federation.namespaceapis.com`). */
192
+ idToken: string | Redacted.Redacted<string>;
193
+ }
194
+ export interface IssueTenantTokenRequest {
195
+ /** Which tenant credentials should be produced for. */
196
+ tenantId?: string | undefined;
197
+ /** A integration-specified identifier that represents the user that is requesting these credentials. The actor identity is embedded into the verifiable claims of the resulting JWT. */
198
+ actorId?: string | undefined;
199
+ /** For how long should the resulting credentials be valid for. If not specified, a short-lived default is used (e.g 15mins). */
200
+ durationSecs?: string | undefined;
201
+ /** A set of policies that apply to this tenant token. */
202
+ policies?: TenantTokenPolicyList | undefined;
203
+ /** Configure the access permissions available with this token. */
204
+ access?: AccessPolicy | undefined;
205
+ }
206
+ export interface IssueTenantTokenResponse {
207
+ /** The tenant Bearer token. Pass this in the `Authorization: Bearer {token}` header when calling Namespace APIs. */
208
+ bearerToken: string | Redacted.Redacted<string>;
209
+ }
210
+ export interface IssueTenantTokenWithOIDCRequest {
211
+ /** Which tenant credentials should be produced for. */
212
+ tenantId?: string | undefined;
213
+ /** The OIDC token from a trusted external issuer. */
214
+ oidcToken?: string | Redacted.Redacted<string> | undefined;
215
+ /** For how long the resulting credentials should be valid. */
216
+ duration?: string | undefined;
217
+ }
218
+ export interface IssueTenantTokenWithOIDCResponse {
219
+ /** The tenant Bearer token. Pass this in the `Authorization: Bearer {token}` header when calling Namespace APIs. */
220
+ bearerToken: string | Redacted.Redacted<string>;
221
+ }
222
+ export interface ListRevokableTokensRequest {
223
+ /** If a previous response returned a `pagination_cursor`, it can be specified to continue reading results with the same arguments as the original call. */
224
+ paginationCursor?: string | undefined;
225
+ /** The maximum number of entries to return as part of this ListRevokableTokens request. A maximum number of entries may also be specified when `pagination_cursor` is set. We won't return more than `max_entries`, but may return fewer. */
226
+ maxEntries?: string | undefined;
227
+ /** If true, include revoked tokens in the results. */
228
+ includeRevoked?: boolean | undefined;
229
+ }
230
+ export type RevokableTokenList = Array<RevokableToken>;
231
+ export interface ListRevokableTokensResponse {
232
+ /** The list of revokable tokens. */
233
+ tokens: RevokableTokenList;
234
+ /** If set, there are additional results. Pass the same cursor to a subsequent ListRevokableTokens call to continue fetching results. */
235
+ paginationCursor: string;
236
+ }
237
+ export interface RefreshRevokableTokenRequest {
238
+ /** The unique identifier of the token to refresh, prefixed with "tok_". */
239
+ tokenId?: string | undefined;
240
+ /** Ensure the token remains valid for at least this much longer. Maximum duration is 1 year. */
241
+ minimumDuration?: string | undefined;
242
+ }
243
+ export interface RefreshRevokableTokenResponse {
244
+ /** The refreshed token metadata. */
245
+ token?: RevokableToken | undefined;
246
+ }
247
+ export interface RevokeRevokableTokenRequest {
248
+ /** The unique identifier of the token to revoke, prefixed with "tok_". */
249
+ tokenId?: string | undefined;
250
+ }
251
+ export interface RevokeRevokableTokenResponse {}
252
+ export type BatchRevokeRevokableTokenError =
253
+ | InvalidArgument
254
+ | FailedPrecondition
255
+ | Unauthenticated
256
+ | PermissionDenied
257
+ | NotFound
258
+ | AlreadyExists
259
+ | ResourceExhausted
260
+ | NamespaceLabsOpError;
261
+ /** Batch revokes multiple revokable tokens based on filter criteria. At least one filter must be provided. ### Authentication Requires a tenant token with the {"token/revokable", "revoke"} action permission. ### Errors - If no filters are provided, an `InvalidArgument` status is returned. */
262
+ export const batchRevokeRevokableToken: API.OperationMethod<
263
+ BatchRevokeRevokableTokenRequest,
264
+ BatchRevokeRevokableTokenResponse,
265
+ BatchRevokeRevokableTokenError,
266
+ NamespaceLabsOpContext
267
+ > = /*@__PURE__*/ API.make(() => ({
268
+ input: __S(24, __c6, 0) as any as S.Schema<BatchRevokeRevokableTokenRequest>,
269
+ output: __S(25, __c6, 1) as any as S.Schema<BatchRevokeRevokableTokenResponse>,
270
+ errors: [
271
+ InvalidArgument,
272
+ FailedPrecondition,
273
+ Unauthenticated,
274
+ PermissionDenied,
275
+ NotFound,
276
+ AlreadyExists,
277
+ ResourceExhausted,
278
+ ],
279
+ serviceErrors: NamespaceLabsServiceErrors,
280
+ protocol: NamespaceLabsProtocol,
281
+ retry: Retry.Retry,
282
+ telemetry: TELEMETRY,
283
+ span: "BatchRevokeRevokableToken",
284
+ }));
285
+
286
+ export type CreateRevokableTokenError =
287
+ | InvalidArgument
288
+ | FailedPrecondition
289
+ | Unauthenticated
290
+ | PermissionDenied
291
+ | NotFound
292
+ | AlreadyExists
293
+ | ResourceExhausted
294
+ | NamespaceLabsOpError;
295
+ /** Creates a revokable token that returns a bearer token (prefixed with "nsrt_") and metadata (with token_id prefixed with "tok_"). Revokable tokens can be explicitly revoked and have a maximum expiration of 1 year when an expiration is set. Membership-scoped tokens may have no expiration and remain valid until revoked or the user loses tenant membership. ### Authentication Requires a tenant token with the {"token/revokable", "create"} action permission. ### Errors - If expiry is not provided for a tenant-scoped token or exceeds 1 year, an `InvalidArgument` status is returned. - If no policies are defined, an `InvalidArgument` status is returned. */
296
+ export const createRevokableToken: API.OperationMethod<
297
+ CreateRevokableTokenRequest,
298
+ CreateRevokableTokenResponse,
299
+ CreateRevokableTokenError,
300
+ NamespaceLabsOpContext
301
+ > = /*@__PURE__*/ API.make(() => ({
302
+ input: __S(32, __c8, 0) as any as S.Schema<CreateRevokableTokenRequest>,
303
+ output: __S(33, __c8, 1) as any as S.Schema<CreateRevokableTokenResponse>,
304
+ errors: [
305
+ InvalidArgument,
306
+ FailedPrecondition,
307
+ Unauthenticated,
308
+ PermissionDenied,
309
+ NotFound,
310
+ AlreadyExists,
311
+ ResourceExhausted,
312
+ ],
313
+ serviceErrors: NamespaceLabsServiceErrors,
314
+ protocol: NamespaceLabsProtocol,
315
+ retry: Retry.Retry,
316
+ telemetry: TELEMETRY,
317
+ span: "CreateRevokableToken",
318
+ }));
319
+
320
+ export type IssueIdTokenError =
321
+ | InvalidArgument
322
+ | FailedPrecondition
323
+ | Unauthenticated
324
+ | PermissionDenied
325
+ | NotFound
326
+ | AlreadyExists
327
+ | ResourceExhausted
328
+ | NamespaceLabsOpError;
329
+ /** Exchange a Namespace tenant token for an OIDC token for identity federation. The generated token identifies Namespace tenants with the provided target audience. ### Authentication Requires a tenant token with the {"federation", "issue_federation"} action permission. ### Errors - If no audience is provided, a `InvalidArgument` status is returned. */
330
+ export const issueIdToken: API.OperationMethod<
331
+ IssueIdTokenRequest,
332
+ IssueIdTokenResponse,
333
+ IssueIdTokenError,
334
+ NamespaceLabsOpContext
335
+ > = /*@__PURE__*/ API.make(() => ({
336
+ input: __S(48, __c12, 0) as any as S.Schema<IssueIdTokenRequest>,
337
+ output: __S(49, __c12, 1) as any as S.Schema<IssueIdTokenResponse>,
338
+ errors: [
339
+ InvalidArgument,
340
+ FailedPrecondition,
341
+ Unauthenticated,
342
+ PermissionDenied,
343
+ NotFound,
344
+ AlreadyExists,
345
+ ResourceExhausted,
346
+ ],
347
+ serviceErrors: NamespaceLabsServiceErrors,
348
+ protocol: NamespaceLabsProtocol,
349
+ retry: Retry.Retry,
350
+ telemetry: TELEMETRY,
351
+ span: "IssueIdToken",
352
+ }));
353
+
354
+ export type IssueTenantTokenError =
355
+ | InvalidArgument
356
+ | FailedPrecondition
357
+ | Unauthenticated
358
+ | PermissionDenied
359
+ | NotFound
360
+ | AlreadyExists
361
+ | ResourceExhausted
362
+ | NamespaceLabsOpError;
363
+ /** Produces credentials in the form of a Bearer token that grant access to the specified Tenant. The credentials provided to the `IssueTenantToken` call are validated to verify they are capable of requesting credentials. ### Authentication Requires a "partner token". */
364
+ export const issueTenantToken: API.OperationMethod<
365
+ IssueTenantTokenRequest,
366
+ IssueTenantTokenResponse,
367
+ IssueTenantTokenError,
368
+ NamespaceLabsOpContext
369
+ > = /*@__PURE__*/ API.make(() => ({
370
+ input: __S(0, __c0, 0) as any as S.Schema<IssueTenantTokenRequest>,
371
+ output: __S(4, __c1, 0) as any as S.Schema<IssueTenantTokenResponse>,
372
+ errors: [
373
+ InvalidArgument,
374
+ FailedPrecondition,
375
+ Unauthenticated,
376
+ PermissionDenied,
377
+ NotFound,
378
+ AlreadyExists,
379
+ ResourceExhausted,
380
+ ],
381
+ serviceErrors: NamespaceLabsServiceErrors,
382
+ protocol: NamespaceLabsProtocol,
383
+ retry: Retry.Retry,
384
+ telemetry: TELEMETRY,
385
+ span: "IssueTenantToken",
386
+ }));
387
+
388
+ export type IssueTenantTokenWithOIDCError =
389
+ | InvalidArgument
390
+ | FailedPrecondition
391
+ | Unauthenticated
392
+ | PermissionDenied
393
+ | NotFound
394
+ | AlreadyExists
395
+ | ResourceExhausted
396
+ | NamespaceLabsOpError;
397
+ /** Produces credentials in the form of a Bearer token that grant access to the specified Tenant using an OIDC token from a trusted issuer. ### Authentication This call authenticates using the `oidc_token` provided in the request. */
398
+ export const issueTenantTokenWithOIDC: API.OperationMethod<
399
+ IssueTenantTokenWithOIDCRequest,
400
+ IssueTenantTokenWithOIDCResponse,
401
+ IssueTenantTokenWithOIDCError,
402
+ NamespaceLabsOpContext
403
+ > = /*@__PURE__*/ API.make(() => ({
404
+ input: __S(8, __c2, 0) as any as S.Schema<IssueTenantTokenWithOIDCRequest>,
405
+ output: __S(4, __c1, 0) as any as S.Schema<IssueTenantTokenWithOIDCResponse>,
406
+ errors: [
407
+ InvalidArgument,
408
+ FailedPrecondition,
409
+ Unauthenticated,
410
+ PermissionDenied,
411
+ NotFound,
412
+ AlreadyExists,
413
+ ResourceExhausted,
414
+ ],
415
+ serviceErrors: NamespaceLabsServiceErrors,
416
+ protocol: NamespaceLabsProtocol,
417
+ retry: Retry.Retry,
418
+ telemetry: TELEMETRY,
419
+ span: "IssueTenantTokenWithOIDC",
420
+ }));
421
+
422
+ export type ListRevokableTokensError =
423
+ | InvalidArgument
424
+ | FailedPrecondition
425
+ | Unauthenticated
426
+ | PermissionDenied
427
+ | NotFound
428
+ | AlreadyExists
429
+ | ResourceExhausted
430
+ | NamespaceLabsOpError;
431
+ /** Lists all revokable tokens for the authenticated tenant. ### Authentication Requires a tenant token with the {"token/revokable", "list"} action permission. */
432
+ export const listRevokableTokens: API.PaginatedOperationMethod<
433
+ ListRevokableTokensRequest,
434
+ ListRevokableTokensResponse,
435
+ ListRevokableTokensError,
436
+ NamespaceLabsOpContext,
437
+ RevokableToken
438
+ > = /*@__PURE__*/ API.makePaginated(
439
+ () => ({
440
+ input: __S(12, __c3, 0) as any as S.Schema<ListRevokableTokensRequest>,
441
+ output: __S(14, __c3, 2) as any as S.Schema<ListRevokableTokensResponse>,
442
+ errors: [
443
+ InvalidArgument,
444
+ FailedPrecondition,
445
+ Unauthenticated,
446
+ PermissionDenied,
447
+ NotFound,
448
+ AlreadyExists,
449
+ ResourceExhausted,
450
+ ],
451
+ serviceErrors: NamespaceLabsServiceErrors,
452
+ protocol: NamespaceLabsProtocol,
453
+ retry: Retry.Retry,
454
+ telemetry: TELEMETRY,
455
+ span: "ListRevokableTokens",
456
+ pagination: {
457
+ mode: "cursor",
458
+ inputToken: "paginationCursor",
459
+ outputToken: "paginationCursor",
460
+ items: "tokens",
461
+ } as const,
462
+ }),
463
+ paginateCursor,
464
+ ) as any;
465
+
466
+ export type RefreshRevokableTokenError =
467
+ | InvalidArgument
468
+ | FailedPrecondition
469
+ | Unauthenticated
470
+ | PermissionDenied
471
+ | NotFound
472
+ | AlreadyExists
473
+ | ResourceExhausted
474
+ | NamespaceLabsOpError;
475
+ /** Ensures a revokable token has at least the requested remaining lifetime. Refreshing does not return a new bearer token; it updates the existing token's expiry in place. ### Authentication Requires a tenant token with the {"token/revokable", "refresh"} action permission. ### Errors - If `minimum_duration` is missing, non-positive, or exceeds 1 year, an `InvalidArgument` status is returned. - If the token_id is not found or already revoked, a `NotFound` status is returned. - If the token has already expired, a `FailedPrecondition` status is returned. */
476
+ export const refreshRevokableToken: API.OperationMethod<
477
+ RefreshRevokableTokenRequest,
478
+ RefreshRevokableTokenResponse,
479
+ RefreshRevokableTokenError,
480
+ NamespaceLabsOpContext
481
+ > = /*@__PURE__*/ API.make(() => ({
482
+ input: __S(16, __c4, 0) as any as S.Schema<RefreshRevokableTokenRequest>,
483
+ output: __S(17, __c4, 1) as any as S.Schema<RefreshRevokableTokenResponse>,
484
+ errors: [
485
+ InvalidArgument,
486
+ FailedPrecondition,
487
+ Unauthenticated,
488
+ PermissionDenied,
489
+ NotFound,
490
+ AlreadyExists,
491
+ ResourceExhausted,
492
+ ],
493
+ serviceErrors: NamespaceLabsServiceErrors,
494
+ protocol: NamespaceLabsProtocol,
495
+ retry: Retry.Retry,
496
+ telemetry: TELEMETRY,
497
+ span: "RefreshRevokableToken",
498
+ }));
499
+
500
+ export type RevokeRevokableTokenError =
501
+ | InvalidArgument
502
+ | FailedPrecondition
503
+ | Unauthenticated
504
+ | PermissionDenied
505
+ | NotFound
506
+ | AlreadyExists
507
+ | ResourceExhausted
508
+ | NamespaceLabsOpError;
509
+ /** Revokes a revokable token by its token_id (prefixed with "tok_"), preventing the associated bearer token from being used for authentication. Records who revoked the token and when. ### Authentication Requires a tenant token with the {"token/revokable", "revoke"} action permission. ### Errors - If the token_id is not found or already revoked, a `NotFound` status is returned. */
510
+ export const revokeRevokableToken: API.OperationMethod<
511
+ RevokeRevokableTokenRequest,
512
+ RevokeRevokableTokenResponse,
513
+ RevokeRevokableTokenError,
514
+ NamespaceLabsOpContext
515
+ > = /*@__PURE__*/ API.make(() => ({
516
+ input: __S(20, __c5, 0) as any as S.Schema<RevokeRevokableTokenRequest>,
517
+ output: __S(21, __c5, 1) as any as S.Schema<RevokeRevokableTokenResponse>,
518
+ errors: [
519
+ InvalidArgument,
520
+ FailedPrecondition,
521
+ Unauthenticated,
522
+ PermissionDenied,
523
+ NotFound,
524
+ AlreadyExists,
525
+ ResourceExhausted,
526
+ ],
527
+ serviceErrors: NamespaceLabsServiceErrors,
528
+ protocol: NamespaceLabsProtocol,
529
+ retry: Retry.Retry,
530
+ telemetry: TELEMETRY,
531
+ span: "RevokeRevokableToken",
532
+ }));
533
+
534
+ // Schema builders: each runs one schema initializer, on that schema's first use.
535
+ function __c0(j: number): any {
536
+ switch (j) {
537
+ case 0:
538
+ return S.suspend(() =>
539
+ S.Struct({
540
+ tenantId: S.optional(S.String),
541
+ actorId: S.optional(S.String),
542
+ durationSecs: S.optional(S.String),
543
+ policies: S.optional(__S(37, __c9, 1)),
544
+ access: S.optional(__S(38, __c9, 2)),
545
+ }).pipe(
546
+ T.Http({
547
+ method: "POST",
548
+ uri: "/namespace.cloud.iam.v1beta.TokenService/IssueTenantToken",
549
+ code: 200,
550
+ }),
551
+ ),
552
+ ).annotate({ identifier: "IssueTenantTokenRequest" });
553
+ }
554
+ }
555
+ function __c1(j: number): any {
556
+ switch (j) {
557
+ case 0:
558
+ return S.suspend(() =>
559
+ S.Struct({
560
+ bearerToken: S.String.pipe(T.SensitiveValue({})),
561
+ }),
562
+ ).annotate({ identifier: "IssueTenantTokenResponse" });
563
+ }
564
+ }
565
+ function __c2(j: number): any {
566
+ switch (j) {
567
+ case 0:
568
+ return S.suspend(() =>
569
+ S.Struct({
570
+ tenantId: S.optional(S.String),
571
+ oidcToken: S.optional(S.String.pipe(T.SensitiveValue({}))),
572
+ duration: S.optional(S.String),
573
+ }).pipe(
574
+ T.Http({
575
+ method: "POST",
576
+ uri: "/namespace.cloud.iam.v1beta.TokenService/IssueTenantTokenWithOIDC",
577
+ code: 200,
578
+ }),
579
+ ),
580
+ ).annotate({ identifier: "IssueTenantTokenWithOIDCRequest" });
581
+ }
582
+ }
583
+ function __c3(j: number): any {
584
+ switch (j) {
585
+ case 0:
586
+ return S.suspend(() =>
587
+ S.Struct({
588
+ paginationCursor: S.optional(S.String),
589
+ maxEntries: S.optional(S.String),
590
+ includeRevoked: S.optional(S.Boolean),
591
+ }).pipe(
592
+ T.Http({
593
+ method: "POST",
594
+ uri: "/namespace.cloud.iam.v1beta.TokenService/ListRevokableTokens",
595
+ code: 200,
596
+ }),
597
+ ),
598
+ ).annotate({ identifier: "ListRevokableTokensRequest" });
599
+ case 1:
600
+ return S.Array(__S(44, __c11, 0));
601
+ case 2:
602
+ return S.suspend(() =>
603
+ S.Struct({
604
+ tokens: __S(13, __c3, 1),
605
+ paginationCursor: S.String,
606
+ }),
607
+ ).annotate({ identifier: "ListRevokableTokensResponse" });
608
+ }
609
+ }
610
+ function __c4(j: number): any {
611
+ switch (j) {
612
+ case 0:
613
+ return S.suspend(() =>
614
+ S.Struct({
615
+ tokenId: S.optional(S.String),
616
+ minimumDuration: S.optional(S.String),
617
+ }).pipe(
618
+ T.Http({
619
+ method: "POST",
620
+ uri: "/namespace.cloud.iam.v1beta.TokenService/RefreshRevokableToken",
621
+ code: 200,
622
+ }),
623
+ ),
624
+ ).annotate({ identifier: "RefreshRevokableTokenRequest" });
625
+ case 1:
626
+ return S.suspend(() =>
627
+ S.Struct({
628
+ token: S.optional(__S(44, __c11, 0)),
629
+ }),
630
+ ).annotate({ identifier: "RefreshRevokableTokenResponse" });
631
+ }
632
+ }
633
+ function __c5(j: number): any {
634
+ switch (j) {
635
+ case 0:
636
+ return S.suspend(() =>
637
+ S.Struct({
638
+ tokenId: S.optional(S.String),
639
+ }).pipe(
640
+ T.Http({
641
+ method: "POST",
642
+ uri: "/namespace.cloud.iam.v1beta.TokenService/RevokeRevokableToken",
643
+ code: 200,
644
+ }),
645
+ ),
646
+ ).annotate({ identifier: "RevokeRevokableTokenRequest" });
647
+ case 1:
648
+ return S.suspend(() => S.Struct({})).annotate({ identifier: "RevokeRevokableTokenResponse" });
649
+ }
650
+ }
651
+ function __c6(j: number): any {
652
+ switch (j) {
653
+ case 0:
654
+ return S.suspend(() =>
655
+ S.Struct({
656
+ before: S.optional(S.String),
657
+ createdByActorId: S.optional(S.String),
658
+ scope: S.optional(S.String),
659
+ }).pipe(
660
+ T.Http({
661
+ method: "POST",
662
+ uri: "/namespace.cloud.iam.v1beta.TokenService/BatchRevokeRevokableToken",
663
+ code: 200,
664
+ }),
665
+ ),
666
+ ).annotate({ identifier: "BatchRevokeRevokableTokenRequest" });
667
+ case 1:
668
+ return S.suspend(() =>
669
+ S.Struct({
670
+ revokedTokenIds: __S(28, __c7, 0),
671
+ }),
672
+ ).annotate({ identifier: "BatchRevokeRevokableTokenResponse" });
673
+ }
674
+ }
675
+ function __c7(j: number): any {
676
+ switch (j) {
677
+ case 0:
678
+ return S.Array(S.String);
679
+ }
680
+ }
681
+ function __c8(j: number): any {
682
+ switch (j) {
683
+ case 0:
684
+ return S.suspend(() =>
685
+ S.Struct({
686
+ name: S.optional(S.String),
687
+ description: S.optional(S.String),
688
+ expiresAt: S.optional(S.String),
689
+ policies: S.optional(__S(37, __c9, 1)),
690
+ access: S.optional(__S(38, __c9, 2)),
691
+ scope: S.optional(S.String),
692
+ }).pipe(
693
+ T.Http({
694
+ method: "POST",
695
+ uri: "/namespace.cloud.iam.v1beta.TokenService/CreateRevokableToken",
696
+ code: 200,
697
+ }),
698
+ ),
699
+ ).annotate({ identifier: "CreateRevokableTokenRequest" });
700
+ case 1:
701
+ return S.suspend(() =>
702
+ S.Struct({
703
+ bearerToken: S.String.pipe(T.SensitiveValue({})),
704
+ token: S.optional(__S(44, __c11, 0)),
705
+ }),
706
+ ).annotate({ identifier: "CreateRevokableTokenResponse" });
707
+ }
708
+ }
709
+ function __c9(j: number): any {
710
+ switch (j) {
711
+ case 0:
712
+ return S.suspend(() =>
713
+ S.Struct({
714
+ policyType: S.optional(S.String),
715
+ value: S.optional(S.String),
716
+ }),
717
+ ).annotate({ identifier: "TenantTokenPolicy" });
718
+ case 1:
719
+ return S.Array(__S(36, __c9, 0));
720
+ case 2:
721
+ return S.suspend(() =>
722
+ S.Struct({
723
+ grants: S.optional(__S(41, __c10, 1)),
724
+ }),
725
+ ).annotate({ identifier: "AccessPolicy" });
726
+ }
727
+ }
728
+ function __c10(j: number): any {
729
+ switch (j) {
730
+ case 0:
731
+ return S.suspend(() =>
732
+ S.Struct({
733
+ resourceType: S.optional(S.String),
734
+ resourceId: S.optional(S.String),
735
+ actions: S.optional(__S(28, __c7, 0)),
736
+ }),
737
+ ).annotate({ identifier: "Permission" });
738
+ case 1:
739
+ return S.Array(__S(40, __c10, 0));
740
+ }
741
+ }
742
+ function __c11(j: number): any {
743
+ switch (j) {
744
+ case 0:
745
+ return S.suspend(() =>
746
+ S.Struct({
747
+ tokenId: S.String,
748
+ tenantId: S.String,
749
+ name: S.String,
750
+ description: S.String,
751
+ createdAt: S.optional(S.String),
752
+ expiresAt: S.optional(S.String),
753
+ revokedAt: S.optional(S.String),
754
+ revokedByActorId: S.String,
755
+ creatorActorId: S.String,
756
+ scope: S.String,
757
+ permissions: __S(41, __c10, 1),
758
+ state: S.String,
759
+ }),
760
+ ).annotate({ identifier: "RevokableToken" });
761
+ }
762
+ }
763
+ function __c12(j: number): any {
764
+ switch (j) {
765
+ case 0:
766
+ return S.suspend(() =>
767
+ S.Struct({
768
+ audience: S.optional(S.String),
769
+ }).pipe(
770
+ T.Http({
771
+ method: "POST",
772
+ uri: "/namespace.cloud.iam.v1beta.TokenService/IssueIdToken",
773
+ code: 200,
774
+ }),
775
+ ),
776
+ ).annotate({ identifier: "IssueIdTokenRequest" });
777
+ case 1:
778
+ return S.suspend(() =>
779
+ S.Struct({
780
+ idToken: S.String.pipe(T.SensitiveValue({})),
781
+ }),
782
+ ).annotate({ identifier: "IssueIdTokenResponse" });
783
+ }
784
+ }
785
+ // Schema table: entry i is schema j of builder f, made on first reach.
786
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
787
+ return (__s[i] ??= __L.at(f, j));
788
+ }