@distilled.cloud/vercel 1.0.0-rc.7 → 1.0.0-rc.9

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 (198) hide show
  1. package/LICENSE +201 -0
  2. package/lib/services/access_groups.d.ts +1 -1
  3. package/lib/services/access_groups.d.ts.map +1 -1
  4. package/lib/services/access_groups.js +1 -1
  5. package/lib/services/access_groups.js.map +1 -1
  6. package/lib/services/ai_gateway.js +1 -1
  7. package/lib/services/ai_gateway.js.map +1 -1
  8. package/lib/services/aliases.d.ts +3 -3
  9. package/lib/services/aliases.d.ts.map +1 -1
  10. package/lib/services/aliases.js +4 -4
  11. package/lib/services/aliases.js.map +1 -1
  12. package/lib/services/api_ai_gateway.d.ts +275 -0
  13. package/lib/services/api_ai_gateway.d.ts.map +1 -0
  14. package/lib/services/api_ai_gateway.js +229 -0
  15. package/lib/services/api_ai_gateway.js.map +1 -0
  16. package/lib/services/artifacts.d.ts +1 -1
  17. package/lib/services/artifacts.d.ts.map +1 -1
  18. package/lib/services/artifacts.js +12 -12
  19. package/lib/services/artifacts.js.map +1 -1
  20. package/lib/services/authentication.js +1 -1
  21. package/lib/services/authentication.js.map +1 -1
  22. package/lib/services/billing.d.ts +145 -7
  23. package/lib/services/billing.d.ts.map +1 -1
  24. package/lib/services/billing.js +121 -5
  25. package/lib/services/billing.js.map +1 -1
  26. package/lib/services/bulk_redirects.d.ts +4 -4
  27. package/lib/services/bulk_redirects.d.ts.map +1 -1
  28. package/lib/services/bulk_redirects.js +4 -4
  29. package/lib/services/bulk_redirects.js.map +1 -1
  30. package/lib/services/certs.d.ts +9 -9
  31. package/lib/services/certs.d.ts.map +1 -1
  32. package/lib/services/certs.js +10 -12
  33. package/lib/services/certs.js.map +1 -1
  34. package/lib/services/checks_v2.d.ts +5 -0
  35. package/lib/services/checks_v2.d.ts.map +1 -1
  36. package/lib/services/checks_v2.js +6 -1
  37. package/lib/services/checks_v2.js.map +1 -1
  38. package/lib/services/connect.d.ts +1721 -527
  39. package/lib/services/connect.d.ts.map +1 -1
  40. package/lib/services/connect.js +1034 -414
  41. package/lib/services/connect.js.map +1 -1
  42. package/lib/services/deployments.d.ts +338 -30
  43. package/lib/services/deployments.d.ts.map +1 -1
  44. package/lib/services/deployments.js +335 -11
  45. package/lib/services/deployments.js.map +1 -1
  46. package/lib/services/dns.d.ts +13 -13
  47. package/lib/services/dns.d.ts.map +1 -1
  48. package/lib/services/dns.js +13 -14
  49. package/lib/services/dns.js.map +1 -1
  50. package/lib/services/domains.d.ts +55 -27
  51. package/lib/services/domains.d.ts.map +1 -1
  52. package/lib/services/domains.js +38 -25
  53. package/lib/services/domains.js.map +1 -1
  54. package/lib/services/domains_registrar.d.ts.map +1 -1
  55. package/lib/services/domains_registrar.js +1 -1
  56. package/lib/services/domains_registrar.js.map +1 -1
  57. package/lib/services/drains.d.ts +8 -8
  58. package/lib/services/drains.d.ts.map +1 -1
  59. package/lib/services/drains.js +1 -1
  60. package/lib/services/drains.js.map +1 -1
  61. package/lib/services/edge_cache.js +1 -1
  62. package/lib/services/edge_cache.js.map +1 -1
  63. package/lib/services/environment.d.ts +39 -39
  64. package/lib/services/environment.d.ts.map +1 -1
  65. package/lib/services/environment.js +35 -37
  66. package/lib/services/environment.js.map +1 -1
  67. package/lib/services/feature_flags.d.ts +93 -309
  68. package/lib/services/feature_flags.d.ts.map +1 -1
  69. package/lib/services/feature_flags.js +93 -303
  70. package/lib/services/feature_flags.js.map +1 -1
  71. package/lib/services/global_config.d.ts +40 -40
  72. package/lib/services/global_config.d.ts.map +1 -1
  73. package/lib/services/global_config.js +16 -14
  74. package/lib/services/global_config.js.map +1 -1
  75. package/lib/services/index.d.ts +3 -0
  76. package/lib/services/index.d.ts.map +1 -1
  77. package/lib/services/index.js +3 -0
  78. package/lib/services/index.js.map +1 -1
  79. package/lib/services/integrations.d.ts +44 -17
  80. package/lib/services/integrations.d.ts.map +1 -1
  81. package/lib/services/integrations.js +32 -7
  82. package/lib/services/integrations.js.map +1 -1
  83. package/lib/services/kms.d.ts +1095 -0
  84. package/lib/services/kms.d.ts.map +1 -0
  85. package/lib/services/kms.js +982 -0
  86. package/lib/services/kms.js.map +1 -0
  87. package/lib/services/log_drains.d.ts +4 -4
  88. package/lib/services/log_drains.d.ts.map +1 -1
  89. package/lib/services/log_drains.js +1 -1
  90. package/lib/services/log_drains.js.map +1 -1
  91. package/lib/services/logs.js +1 -1
  92. package/lib/services/logs.js.map +1 -1
  93. package/lib/services/marketplace.d.ts +95 -33
  94. package/lib/services/marketplace.d.ts.map +1 -1
  95. package/lib/services/marketplace.js +123 -31
  96. package/lib/services/marketplace.js.map +1 -1
  97. package/lib/services/microfrontends.d.ts +290 -250
  98. package/lib/services/microfrontends.d.ts.map +1 -1
  99. package/lib/services/microfrontends.js +281 -244
  100. package/lib/services/microfrontends.js.map +1 -1
  101. package/lib/services/misc.d.ts +192 -0
  102. package/lib/services/misc.d.ts.map +1 -0
  103. package/lib/services/misc.js +125 -0
  104. package/lib/services/misc.js.map +1 -0
  105. package/lib/services/networking.d.ts +123 -2
  106. package/lib/services/networking.d.ts.map +1 -1
  107. package/lib/services/networking.js +132 -2
  108. package/lib/services/networking.js.map +1 -1
  109. package/lib/services/observability.js +1 -1
  110. package/lib/services/observability.js.map +1 -1
  111. package/lib/services/project_members.js +1 -1
  112. package/lib/services/project_members.js.map +1 -1
  113. package/lib/services/project_routes.d.ts.map +1 -1
  114. package/lib/services/project_routes.js +1 -1
  115. package/lib/services/project_routes.js.map +1 -1
  116. package/lib/services/projects.d.ts +356 -116
  117. package/lib/services/projects.d.ts.map +1 -1
  118. package/lib/services/projects.js +260 -64
  119. package/lib/services/projects.js.map +1 -1
  120. package/lib/services/rolling_release.d.ts +2 -2
  121. package/lib/services/rolling_release.d.ts.map +1 -1
  122. package/lib/services/rolling_release.js +1 -1
  123. package/lib/services/rolling_release.js.map +1 -1
  124. package/lib/services/sandboxes.d.ts +1007 -410
  125. package/lib/services/sandboxes.d.ts.map +1 -1
  126. package/lib/services/sandboxes.js +732 -293
  127. package/lib/services/sandboxes.js.map +1 -1
  128. package/lib/services/security.d.ts +590 -275
  129. package/lib/services/security.d.ts.map +1 -1
  130. package/lib/services/security.js +562 -208
  131. package/lib/services/security.js.map +1 -1
  132. package/lib/services/storage.d.ts +69 -69
  133. package/lib/services/storage.d.ts.map +1 -1
  134. package/lib/services/storage.js +59 -59
  135. package/lib/services/storage.js.map +1 -1
  136. package/lib/services/teams.d.ts +351 -328
  137. package/lib/services/teams.d.ts.map +1 -1
  138. package/lib/services/teams.js +299 -284
  139. package/lib/services/teams.js.map +1 -1
  140. package/lib/services/user.d.ts +4237 -3650
  141. package/lib/services/user.d.ts.map +1 -1
  142. package/lib/services/user.js +3426 -2935
  143. package/lib/services/user.js.map +1 -1
  144. package/lib/services/vcr.d.ts +80 -122
  145. package/lib/services/vcr.d.ts.map +1 -1
  146. package/lib/services/vcr.js +89 -144
  147. package/lib/services/vcr.js.map +1 -1
  148. package/lib/services/web_analytics.d.ts +42 -10
  149. package/lib/services/web_analytics.d.ts.map +1 -1
  150. package/lib/services/web_analytics.js +39 -9
  151. package/lib/services/web_analytics.js.map +1 -1
  152. package/lib/services/webhooks.d.ts +13 -1
  153. package/lib/services/webhooks.d.ts.map +1 -1
  154. package/lib/services/webhooks.js +11 -1
  155. package/lib/services/webhooks.js.map +1 -1
  156. package/package.json +6 -5
  157. package/src/services/access_groups.ts +5 -2
  158. package/src/services/ai_gateway.ts +1 -1
  159. package/src/services/aliases.ts +9 -8
  160. package/src/services/api_ai_gateway.ts +607 -0
  161. package/src/services/artifacts.ts +13 -13
  162. package/src/services/authentication.ts +1 -1
  163. package/src/services/billing.ts +358 -26
  164. package/src/services/bulk_redirects.ts +10 -10
  165. package/src/services/certs.ts +20 -26
  166. package/src/services/checks_v2.ts +11 -1
  167. package/src/services/connect.ts +3330 -1121
  168. package/src/services/deployments.ts +1513 -429
  169. package/src/services/dns.ts +26 -27
  170. package/src/services/domains.ts +119 -63
  171. package/src/services/domains_registrar.ts +37 -37
  172. package/src/services/drains.ts +35 -18
  173. package/src/services/edge_cache.ts +1 -1
  174. package/src/services/environment.ts +99 -95
  175. package/src/services/feature_flags.ts +332 -884
  176. package/src/services/global_config.ts +59 -57
  177. package/src/services/index.ts +3 -0
  178. package/src/services/integrations.ts +870 -668
  179. package/src/services/kms.ts +2631 -0
  180. package/src/services/log_drains.ts +73 -41
  181. package/src/services/logs.ts +1 -1
  182. package/src/services/marketplace.ts +324 -96
  183. package/src/services/microfrontends.ts +1582 -1306
  184. package/src/services/misc.ts +364 -0
  185. package/src/services/networking.ts +339 -4
  186. package/src/services/observability.ts +1 -1
  187. package/src/services/project_members.ts +1 -1
  188. package/src/services/project_routes.ts +25 -16
  189. package/src/services/projects.ts +1987 -691
  190. package/src/services/rolling_release.ts +100 -96
  191. package/src/services/sandboxes.ts +3013 -1268
  192. package/src/services/security.ts +3433 -1845
  193. package/src/services/storage.ts +145 -141
  194. package/src/services/teams.ts +1061 -986
  195. package/src/services/user.ts +8490 -6901
  196. package/src/services/vcr.ts +349 -443
  197. package/src/services/web_analytics.ts +83 -13
  198. package/src/services/webhooks.ts +32 -1
@@ -0,0 +1,2631 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-vercel/specs/openapi.json). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as API from "@distilled.cloud/core/api";
4
+ import * as C from "@distilled.cloud/core/category";
5
+ import * as T from "../traits.ts";
6
+ import {
7
+ VercelProtocol,
8
+ type VercelOpError,
9
+ type VercelOpContext,
10
+ } from "../protocol.ts";
11
+ import * as Retry from "../retry.ts";
12
+
13
+ export type { VercelOpError, VercelOpContext };
14
+
15
+ export class BadRequest
16
+ extends /*@__PURE__*/ T.applyErrorMatchers(
17
+ /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
18
+ code: S.Number,
19
+ message: S.String,
20
+ }).pipe(C.withBadRequestError),
21
+ [{ status: 400 }],
22
+ ) {}
23
+
24
+ export class Conflict
25
+ extends /*@__PURE__*/ T.applyErrorMatchers(
26
+ /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
27
+ code: S.Number,
28
+ message: S.String,
29
+ }).pipe(C.withConflictError),
30
+ [{ status: 409 }],
31
+ ) {}
32
+
33
+ export class Forbidden
34
+ extends /*@__PURE__*/ T.applyErrorMatchers(
35
+ /*@__PURE__*/ S.TaggedError<Forbidden>()("Forbidden", {
36
+ code: S.Number,
37
+ message: S.String,
38
+ }).pipe(C.withAuthError),
39
+ [{ status: 403 }],
40
+ ) {}
41
+
42
+ export class NotFound
43
+ extends /*@__PURE__*/ T.applyErrorMatchers(
44
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
45
+ code: S.Number,
46
+ message: S.String,
47
+ }).pipe(C.withBadRequestError),
48
+ [{ status: 404 }],
49
+ ) {}
50
+
51
+ export interface ActivateKmsSigningKeyRequest {
52
+ /** The ID of the issuer. */
53
+ issuerId: string;
54
+ /** The ID of the pending signing key to activate. */
55
+ keyId: string;
56
+ /** The Team identifier to perform the request on behalf of. */
57
+ teamId?: string;
58
+ /** The Team slug to perform the request on behalf of. */
59
+ slug?: string;
60
+ /** How many hours after activation the previously-active key should stop being used. Defaults to a 1 hour grace period so already-issued tokens keep verifying. */
61
+ revokePreviousAfterHours?: number;
62
+ }
63
+ export const ActivateKmsSigningKeyRequest = /*@__PURE__*/ S.suspend(() =>
64
+ S.Struct({
65
+ issuerId: S.String.pipe(T.Label()),
66
+ keyId: S.String.pipe(T.Label()),
67
+ teamId: S.optional(S.String.pipe(T.Query())),
68
+ slug: S.optional(S.String.pipe(T.Query())),
69
+ revokePreviousAfterHours: S.optional(S.Number),
70
+ }).pipe(
71
+ T.Http({
72
+ method: "POST",
73
+ uri: "/v1/kms/issuers/{issuerId}/keys/{keyId}/activate",
74
+ code: 200,
75
+ }),
76
+ ),
77
+ ).annotate({
78
+ identifier: "ActivateKmsSigningKeyRequest",
79
+ }) as any as S.Schema<ActivateKmsSigningKeyRequest>;
80
+
81
+ export type ActivateKmsSigningKeyResponseStatus =
82
+ | "active"
83
+ | "pending"
84
+ | "revoking";
85
+ export const ActivateKmsSigningKeyResponseStatus = /*@__PURE__*/ S.String;
86
+
87
+ export type ActivateKmsSigningKeyResponsePublicKeyKeyOpsList = Array<string>;
88
+ export const ActivateKmsSigningKeyResponsePublicKeyKeyOpsList =
89
+ /*@__PURE__*/ S.Array(
90
+ S.String,
91
+ ) as any as S.Schema<ActivateKmsSigningKeyResponsePublicKeyKeyOpsList>;
92
+
93
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
94
+ export type ActivateKmsSigningKeyResponsePublicKeyX5cList = Array<string>;
95
+ export const ActivateKmsSigningKeyResponsePublicKeyX5cList =
96
+ /*@__PURE__*/ S.Array(
97
+ S.String,
98
+ ) as any as S.Schema<ActivateKmsSigningKeyResponsePublicKeyX5cList>;
99
+
100
+ export interface ActivateKmsSigningKeyResponsePublicKey {
101
+ kty?: string;
102
+ kid?: string;
103
+ alg?: string;
104
+ use?: string;
105
+ key_ops?: ActivateKmsSigningKeyResponsePublicKeyKeyOpsList;
106
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
107
+ x5c?: ActivateKmsSigningKeyResponsePublicKeyX5cList;
108
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
109
+ x5t_S256?: string;
110
+ }
111
+ export const ActivateKmsSigningKeyResponsePublicKey = /*@__PURE__*/ S.suspend(
112
+ () =>
113
+ S.Struct({
114
+ kty: S.optional(S.String),
115
+ kid: S.optional(S.String),
116
+ alg: S.optional(S.String),
117
+ use: S.optional(S.String),
118
+ key_ops: S.optional(ActivateKmsSigningKeyResponsePublicKeyKeyOpsList),
119
+ x5c: S.optional(ActivateKmsSigningKeyResponsePublicKeyX5cList),
120
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
121
+ }),
122
+ ).annotate({
123
+ identifier: "ActivateKmsSigningKeyResponsePublicKey",
124
+ }) as any as S.Schema<ActivateKmsSigningKeyResponsePublicKey>;
125
+
126
+ export interface ActivateKmsSigningKeyResponse {
127
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
128
+ keyId: string;
129
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
130
+ importKeyId?: string;
131
+ issuerId: string;
132
+ algorithm: string;
133
+ status: ActivateKmsSigningKeyResponseStatus;
134
+ publicKey?: ActivateKmsSigningKeyResponsePublicKey;
135
+ publicKeyFingerprint?: string;
136
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
137
+ publicKeyPem?: string;
138
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
139
+ certificatePem?: string;
140
+ createdAt: string;
141
+ updatedAt: string;
142
+ revokeAt?: string;
143
+ activateAt?: string;
144
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
145
+ activatedAt?: string;
146
+ }
147
+ export const ActivateKmsSigningKeyResponse = /*@__PURE__*/ S.suspend(() =>
148
+ S.Struct({
149
+ keyId: S.String,
150
+ importKeyId: S.optional(S.String),
151
+ issuerId: S.String,
152
+ algorithm: S.String,
153
+ status: ActivateKmsSigningKeyResponseStatus,
154
+ publicKey: S.optional(ActivateKmsSigningKeyResponsePublicKey),
155
+ publicKeyFingerprint: S.optional(S.String),
156
+ publicKeyPem: S.optional(S.String),
157
+ certificatePem: S.optional(S.String),
158
+ createdAt: S.String,
159
+ updatedAt: S.String,
160
+ revokeAt: S.optional(S.String),
161
+ activateAt: S.optional(S.String),
162
+ activatedAt: S.optional(S.String),
163
+ }),
164
+ ).annotate({
165
+ identifier: "ActivateKmsSigningKeyResponse",
166
+ }) as any as S.Schema<ActivateKmsSigningKeyResponse>;
167
+
168
+ /** The signing algorithm to use for the issuer. */
169
+ export type CreateKmsIssuerRequestAlgorithm =
170
+ | "RS256"
171
+ | "RS384"
172
+ | "RS512"
173
+ | "PS256"
174
+ | "PS384"
175
+ | "PS512"
176
+ | "ES256"
177
+ | "ES384"
178
+ | "ES512"
179
+ | "EdDSA";
180
+ export const CreateKmsIssuerRequestAlgorithm = /*@__PURE__*/ S.String;
181
+
182
+ /** A JSON Schema used to validate the resolved token claims when signing tokens for this issuer. */
183
+ export type CreateKmsIssuerRequestClaimsSchemaMap = {
184
+ [key: string]: unknown | undefined;
185
+ };
186
+ export const CreateKmsIssuerRequestClaimsSchemaMap = /*@__PURE__*/ S.Record(
187
+ S.String,
188
+ S.Unknown,
189
+ ) as any as S.Schema<CreateKmsIssuerRequestClaimsSchemaMap>;
190
+
191
+ export type CreateKmsIssuerRequestPolicyCase0Kind = "project-grant";
192
+ export const CreateKmsIssuerRequestPolicyCase0Kind = /*@__PURE__*/ S.String;
193
+
194
+ /** The environments for the project grant policy. Each entry is a system environment (production, preview, development) or a custom environment ID (env_...). */
195
+ export type CreateKmsIssuerRequestPolicyCase0EnvironmentsList = Array<string>;
196
+ export const CreateKmsIssuerRequestPolicyCase0EnvironmentsList =
197
+ /*@__PURE__*/ S.Array(
198
+ S.String,
199
+ ) as any as S.Schema<CreateKmsIssuerRequestPolicyCase0EnvironmentsList>;
200
+
201
+ /** The claims that KMS should include in signed JWTs for this policy. */
202
+ export type CreateKmsIssuerRequestPolicyCase0TokenClaimsMap = {
203
+ [key: string]: unknown | undefined;
204
+ };
205
+ export const CreateKmsIssuerRequestPolicyCase0TokenClaimsMap =
206
+ /*@__PURE__*/ S.Record(
207
+ S.String,
208
+ S.Unknown,
209
+ ) as any as S.Schema<CreateKmsIssuerRequestPolicyCase0TokenClaimsMap>;
210
+
211
+ export interface CreateKmsIssuerRequestPolicyCase0 {
212
+ kind: CreateKmsIssuerRequestPolicyCase0Kind;
213
+ /** The team ID for the project grant policy. */
214
+ teamId: string;
215
+ /** The project ID for the project grant policy. */
216
+ projectId: string;
217
+ /** The environments for the project grant policy. Each entry is a system environment (production, preview, development) or a custom environment ID (env_...). */
218
+ environments: CreateKmsIssuerRequestPolicyCase0EnvironmentsList;
219
+ /** The claims that KMS should include in signed JWTs for this policy. */
220
+ tokenClaims?: CreateKmsIssuerRequestPolicyCase0TokenClaimsMap;
221
+ }
222
+ export const CreateKmsIssuerRequestPolicyCase0 = /*@__PURE__*/ S.suspend(() =>
223
+ S.Struct({
224
+ kind: CreateKmsIssuerRequestPolicyCase0Kind,
225
+ teamId: S.String,
226
+ projectId: S.String,
227
+ environments: CreateKmsIssuerRequestPolicyCase0EnvironmentsList,
228
+ tokenClaims: S.optional(CreateKmsIssuerRequestPolicyCase0TokenClaimsMap),
229
+ }),
230
+ ).annotate({
231
+ identifier: "CreateKmsIssuerRequestPolicyCase0",
232
+ }) as any as S.Schema<CreateKmsIssuerRequestPolicyCase0>;
233
+
234
+ export type CreateKmsIssuerRequestPolicyCase1Kind = "connex-grant";
235
+ export const CreateKmsIssuerRequestPolicyCase1Kind = /*@__PURE__*/ S.String;
236
+
237
+ /** The claims that KMS should include in signed JWTs for this policy. */
238
+ export type CreateKmsIssuerRequestPolicyCase1TokenClaimsMap = {
239
+ [key: string]: unknown | undefined;
240
+ };
241
+ export const CreateKmsIssuerRequestPolicyCase1TokenClaimsMap =
242
+ /*@__PURE__*/ S.Record(
243
+ S.String,
244
+ S.Unknown,
245
+ ) as any as S.Schema<CreateKmsIssuerRequestPolicyCase1TokenClaimsMap>;
246
+
247
+ export interface CreateKmsIssuerRequestPolicyCase1 {
248
+ kind: CreateKmsIssuerRequestPolicyCase1Kind;
249
+ /** The Connex client ID for the Connex grant policy. */
250
+ clientId: string;
251
+ /** The claims that KMS should include in signed JWTs for this policy. */
252
+ tokenClaims?: CreateKmsIssuerRequestPolicyCase1TokenClaimsMap;
253
+ }
254
+ export const CreateKmsIssuerRequestPolicyCase1 = /*@__PURE__*/ S.suspend(() =>
255
+ S.Struct({
256
+ kind: CreateKmsIssuerRequestPolicyCase1Kind,
257
+ clientId: S.String,
258
+ tokenClaims: S.optional(CreateKmsIssuerRequestPolicyCase1TokenClaimsMap),
259
+ }),
260
+ ).annotate({
261
+ identifier: "CreateKmsIssuerRequestPolicyCase1",
262
+ }) as any as S.Schema<CreateKmsIssuerRequestPolicyCase1>;
263
+
264
+ export type CreateKmsIssuerRequestPolicy =
265
+ | CreateKmsIssuerRequestPolicyCase0
266
+ | CreateKmsIssuerRequestPolicyCase1;
267
+ export const CreateKmsIssuerRequestPolicy =
268
+ /*@__PURE__*/ S.Unknown as any as S.Schema<CreateKmsIssuerRequestPolicy>;
269
+
270
+ export interface CreateKmsIssuerRequest {
271
+ /** The Team identifier to perform the request on behalf of. */
272
+ teamId?: string;
273
+ /** The Team slug to perform the request on behalf of. */
274
+ slug?: string;
275
+ /** The name of the issuer. */
276
+ name: string;
277
+ /** The signing algorithm to use for the issuer. */
278
+ algorithm?: CreateKmsIssuerRequestAlgorithm | (string & {});
279
+ /** A JSON Schema used to validate the resolved token claims when signing tokens for this issuer. */
280
+ claimsSchema?: CreateKmsIssuerRequestClaimsSchemaMap;
281
+ policy?: CreateKmsIssuerRequestPolicy;
282
+ /** The PEM-encoded private key to use for the issuer. */
283
+ importKey?: string;
284
+ /** The key id to use as the imported key's JWT/JWKS `kid`. Only allowed when `importKey` is provided. Not required to be unique; the addressable key id is the server-minted `keyId` returned in the response. */
285
+ importKeyId?: string;
286
+ }
287
+ export const CreateKmsIssuerRequest = /*@__PURE__*/ S.suspend(() =>
288
+ S.Struct({
289
+ teamId: S.optional(S.String.pipe(T.Query())),
290
+ slug: S.optional(S.String.pipe(T.Query())),
291
+ name: S.String,
292
+ algorithm: S.optional(CreateKmsIssuerRequestAlgorithm),
293
+ claimsSchema: S.optional(CreateKmsIssuerRequestClaimsSchemaMap),
294
+ policy: S.optional(CreateKmsIssuerRequestPolicy),
295
+ importKey: S.optional(S.String),
296
+ importKeyId: S.optional(S.String),
297
+ }).pipe(T.Http({ method: "POST", uri: "/v1/kms/issuers", code: 200 })),
298
+ ).annotate({
299
+ identifier: "CreateKmsIssuerRequest",
300
+ }) as any as S.Schema<CreateKmsIssuerRequest>;
301
+
302
+ export type CreateKmsIssuerResponseAlgorithm =
303
+ | "ES256"
304
+ | "ES384"
305
+ | "ES512"
306
+ | "EdDSA"
307
+ | "PS256"
308
+ | "PS384"
309
+ | "PS512"
310
+ | "RS256"
311
+ | "RS384"
312
+ | "RS512";
313
+ export const CreateKmsIssuerResponseAlgorithm = /*@__PURE__*/ S.String;
314
+
315
+ export type CreateKmsIssuerResponseOrigin = "external" | "vercel";
316
+ export const CreateKmsIssuerResponseOrigin = /*@__PURE__*/ S.String;
317
+
318
+ export type CreateKmsIssuerResponseClaimsSchemaMap = {
319
+ [key: string]: unknown | undefined;
320
+ };
321
+ export const CreateKmsIssuerResponseClaimsSchemaMap = /*@__PURE__*/ S.Record(
322
+ S.String,
323
+ S.Unknown,
324
+ ) as any as S.Schema<CreateKmsIssuerResponseClaimsSchemaMap>;
325
+
326
+ export type CreateKmsIssuerResponseSigningKeysItemStatus =
327
+ | "active"
328
+ | "pending"
329
+ | "revoking";
330
+ export const CreateKmsIssuerResponseSigningKeysItemStatus =
331
+ /*@__PURE__*/ S.String;
332
+
333
+ export type CreateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList =
334
+ Array<string>;
335
+ export const CreateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList =
336
+ /*@__PURE__*/ S.Array(
337
+ S.String,
338
+ ) as any as S.Schema<CreateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList>;
339
+
340
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
341
+ export type CreateKmsIssuerResponseSigningKeysItemPublicKeyX5cList =
342
+ Array<string>;
343
+ export const CreateKmsIssuerResponseSigningKeysItemPublicKeyX5cList =
344
+ /*@__PURE__*/ S.Array(
345
+ S.String,
346
+ ) as any as S.Schema<CreateKmsIssuerResponseSigningKeysItemPublicKeyX5cList>;
347
+
348
+ export interface CreateKmsIssuerResponseSigningKeysItemPublicKey {
349
+ kty?: string;
350
+ kid?: string;
351
+ alg?: string;
352
+ use?: string;
353
+ key_ops?: CreateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList;
354
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
355
+ x5c?: CreateKmsIssuerResponseSigningKeysItemPublicKeyX5cList;
356
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
357
+ x5t_S256?: string;
358
+ }
359
+ export const CreateKmsIssuerResponseSigningKeysItemPublicKey =
360
+ /*@__PURE__*/ S.suspend(() =>
361
+ S.Struct({
362
+ kty: S.optional(S.String),
363
+ kid: S.optional(S.String),
364
+ alg: S.optional(S.String),
365
+ use: S.optional(S.String),
366
+ key_ops: S.optional(
367
+ CreateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList,
368
+ ),
369
+ x5c: S.optional(CreateKmsIssuerResponseSigningKeysItemPublicKeyX5cList),
370
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
371
+ }),
372
+ ).annotate({
373
+ identifier: "CreateKmsIssuerResponseSigningKeysItemPublicKey",
374
+ }) as any as S.Schema<CreateKmsIssuerResponseSigningKeysItemPublicKey>;
375
+
376
+ export interface CreateKmsIssuerResponseSigningKeysItem {
377
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
378
+ keyId: string;
379
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
380
+ importKeyId?: string;
381
+ issuerId: string;
382
+ algorithm: string;
383
+ status: CreateKmsIssuerResponseSigningKeysItemStatus;
384
+ publicKey?: CreateKmsIssuerResponseSigningKeysItemPublicKey;
385
+ publicKeyFingerprint?: string;
386
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
387
+ publicKeyPem?: string;
388
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
389
+ certificatePem?: string;
390
+ createdAt: string;
391
+ updatedAt: string;
392
+ revokeAt?: string;
393
+ activateAt?: string;
394
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
395
+ activatedAt?: string;
396
+ }
397
+ export const CreateKmsIssuerResponseSigningKeysItem = /*@__PURE__*/ S.suspend(
398
+ () =>
399
+ S.Struct({
400
+ keyId: S.String,
401
+ importKeyId: S.optional(S.String),
402
+ issuerId: S.String,
403
+ algorithm: S.String,
404
+ status: CreateKmsIssuerResponseSigningKeysItemStatus,
405
+ publicKey: S.optional(CreateKmsIssuerResponseSigningKeysItemPublicKey),
406
+ publicKeyFingerprint: S.optional(S.String),
407
+ publicKeyPem: S.optional(S.String),
408
+ certificatePem: S.optional(S.String),
409
+ createdAt: S.String,
410
+ updatedAt: S.String,
411
+ revokeAt: S.optional(S.String),
412
+ activateAt: S.optional(S.String),
413
+ activatedAt: S.optional(S.String),
414
+ }),
415
+ ).annotate({
416
+ identifier: "CreateKmsIssuerResponseSigningKeysItem",
417
+ }) as any as S.Schema<CreateKmsIssuerResponseSigningKeysItem>;
418
+
419
+ export type CreateKmsIssuerResponseSigningKeysList =
420
+ Array<CreateKmsIssuerResponseSigningKeysItem>;
421
+ export const CreateKmsIssuerResponseSigningKeysList = /*@__PURE__*/ S.Array(
422
+ CreateKmsIssuerResponseSigningKeysItem,
423
+ ) as any as S.Schema<CreateKmsIssuerResponseSigningKeysList>;
424
+
425
+ export type CreateKmsIssuerResponsePoliciesItemCase0Kind = "project-grant";
426
+ export const CreateKmsIssuerResponsePoliciesItemCase0Kind =
427
+ /*@__PURE__*/ S.String;
428
+
429
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
430
+ export type CreateKmsIssuerResponsePoliciesItemCase0EnvironmentsList =
431
+ Array<string>;
432
+ export const CreateKmsIssuerResponsePoliciesItemCase0EnvironmentsList =
433
+ /*@__PURE__*/ S.Array(
434
+ S.String,
435
+ ) as any as S.Schema<CreateKmsIssuerResponsePoliciesItemCase0EnvironmentsList>;
436
+
437
+ export type CreateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap = {
438
+ [key: string]: unknown | undefined;
439
+ };
440
+ export const CreateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap =
441
+ /*@__PURE__*/ S.Record(
442
+ S.String,
443
+ S.Unknown,
444
+ ) as any as S.Schema<CreateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap>;
445
+
446
+ export interface CreateKmsIssuerResponsePoliciesItemCase0 {
447
+ kind: CreateKmsIssuerResponsePoliciesItemCase0Kind;
448
+ teamId: string;
449
+ projectId: string;
450
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
451
+ environments: CreateKmsIssuerResponsePoliciesItemCase0EnvironmentsList;
452
+ tokenClaims?: CreateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap;
453
+ createdAt: string;
454
+ updatedAt: string;
455
+ }
456
+ export const CreateKmsIssuerResponsePoliciesItemCase0 = /*@__PURE__*/ S.suspend(
457
+ () =>
458
+ S.Struct({
459
+ kind: CreateKmsIssuerResponsePoliciesItemCase0Kind,
460
+ teamId: S.String,
461
+ projectId: S.String,
462
+ environments: CreateKmsIssuerResponsePoliciesItemCase0EnvironmentsList,
463
+ tokenClaims: S.optional(
464
+ CreateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap,
465
+ ),
466
+ createdAt: S.String,
467
+ updatedAt: S.String,
468
+ }),
469
+ ).annotate({
470
+ identifier: "CreateKmsIssuerResponsePoliciesItemCase0",
471
+ }) as any as S.Schema<CreateKmsIssuerResponsePoliciesItemCase0>;
472
+
473
+ export type CreateKmsIssuerResponsePoliciesItemCase1Kind = "connex-grant";
474
+ export const CreateKmsIssuerResponsePoliciesItemCase1Kind =
475
+ /*@__PURE__*/ S.String;
476
+
477
+ export type CreateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap = {
478
+ [key: string]: unknown | undefined;
479
+ };
480
+ export const CreateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap =
481
+ /*@__PURE__*/ S.Record(
482
+ S.String,
483
+ S.Unknown,
484
+ ) as any as S.Schema<CreateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap>;
485
+
486
+ export interface CreateKmsIssuerResponsePoliciesItemCase1 {
487
+ kind: CreateKmsIssuerResponsePoliciesItemCase1Kind;
488
+ clientId: string;
489
+ tokenClaims?: CreateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap;
490
+ createdAt: string;
491
+ updatedAt: string;
492
+ }
493
+ export const CreateKmsIssuerResponsePoliciesItemCase1 = /*@__PURE__*/ S.suspend(
494
+ () =>
495
+ S.Struct({
496
+ kind: CreateKmsIssuerResponsePoliciesItemCase1Kind,
497
+ clientId: S.String,
498
+ tokenClaims: S.optional(
499
+ CreateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap,
500
+ ),
501
+ createdAt: S.String,
502
+ updatedAt: S.String,
503
+ }),
504
+ ).annotate({
505
+ identifier: "CreateKmsIssuerResponsePoliciesItemCase1",
506
+ }) as any as S.Schema<CreateKmsIssuerResponsePoliciesItemCase1>;
507
+
508
+ export type CreateKmsIssuerResponsePoliciesItem =
509
+ | CreateKmsIssuerResponsePoliciesItemCase0
510
+ | CreateKmsIssuerResponsePoliciesItemCase1;
511
+ export const CreateKmsIssuerResponsePoliciesItem =
512
+ /*@__PURE__*/ S.Unknown as any as S.Schema<CreateKmsIssuerResponsePoliciesItem>;
513
+
514
+ export type CreateKmsIssuerResponsePoliciesList =
515
+ Array<CreateKmsIssuerResponsePoliciesItem>;
516
+ export const CreateKmsIssuerResponsePoliciesList = /*@__PURE__*/ S.Array(
517
+ CreateKmsIssuerResponsePoliciesItem,
518
+ ) as any as S.Schema<CreateKmsIssuerResponsePoliciesList>;
519
+
520
+ export interface CreateKmsIssuerResponse {
521
+ id: string;
522
+ ownerId: string;
523
+ name: string;
524
+ algorithm: CreateKmsIssuerResponseAlgorithm;
525
+ origin: CreateKmsIssuerResponseOrigin;
526
+ managedBy?: string;
527
+ claimsSchema?: CreateKmsIssuerResponseClaimsSchemaMap;
528
+ createdAt: string;
529
+ updatedAt: string;
530
+ signingKeys: CreateKmsIssuerResponseSigningKeysList;
531
+ policies: CreateKmsIssuerResponsePoliciesList;
532
+ }
533
+ export const CreateKmsIssuerResponse = /*@__PURE__*/ S.suspend(() =>
534
+ S.Struct({
535
+ id: S.String,
536
+ ownerId: S.String,
537
+ name: S.String,
538
+ algorithm: CreateKmsIssuerResponseAlgorithm,
539
+ origin: CreateKmsIssuerResponseOrigin,
540
+ managedBy: S.optional(S.String),
541
+ claimsSchema: S.optional(CreateKmsIssuerResponseClaimsSchemaMap),
542
+ createdAt: S.String,
543
+ updatedAt: S.String,
544
+ signingKeys: CreateKmsIssuerResponseSigningKeysList,
545
+ policies: CreateKmsIssuerResponsePoliciesList,
546
+ }),
547
+ ).annotate({
548
+ identifier: "CreateKmsIssuerResponse",
549
+ }) as any as S.Schema<CreateKmsIssuerResponse>;
550
+
551
+ export type CreateKmsIssuerPolicyRequestKind = "project-grant";
552
+ export const CreateKmsIssuerPolicyRequestKind = /*@__PURE__*/ S.String;
553
+
554
+ /** The environments for the project grant policy. Each entry is a system environment (production, preview, development) or a custom environment ID (env_...). */
555
+ export type CreateKmsIssuerPolicyRequestEnvironmentsList = Array<string>;
556
+ export const CreateKmsIssuerPolicyRequestEnvironmentsList =
557
+ /*@__PURE__*/ S.Array(
558
+ S.String,
559
+ ) as any as S.Schema<CreateKmsIssuerPolicyRequestEnvironmentsList>;
560
+
561
+ /** The claims that KMS should include in signed JWTs for this policy. */
562
+ export type CreateKmsIssuerPolicyRequestTokenClaimsMap = {
563
+ [key: string]: unknown | undefined;
564
+ };
565
+ export const CreateKmsIssuerPolicyRequestTokenClaimsMap =
566
+ /*@__PURE__*/ S.Record(
567
+ S.String,
568
+ S.Unknown,
569
+ ) as any as S.Schema<CreateKmsIssuerPolicyRequestTokenClaimsMap>;
570
+
571
+ export interface CreateKmsIssuerPolicyRequest {
572
+ /** The ID of the issuer. */
573
+ issuerId: string;
574
+ /** The Team identifier to perform the request on behalf of. */
575
+ teamId?: string;
576
+ /** The Team slug to perform the request on behalf of. */
577
+ slug?: string;
578
+ kind: CreateKmsIssuerPolicyRequestKind | (string & {});
579
+ /** The project ID for the project grant policy. */
580
+ projectId: string;
581
+ /** The environments for the project grant policy. Each entry is a system environment (production, preview, development) or a custom environment ID (env_...). */
582
+ environments: CreateKmsIssuerPolicyRequestEnvironmentsList;
583
+ /** The claims that KMS should include in signed JWTs for this policy. */
584
+ tokenClaims?: CreateKmsIssuerPolicyRequestTokenClaimsMap;
585
+ }
586
+ export const CreateKmsIssuerPolicyRequest = /*@__PURE__*/ S.suspend(() =>
587
+ S.Struct({
588
+ issuerId: S.String.pipe(T.Label()),
589
+ teamId: S.optional(S.String.pipe(T.Query())),
590
+ slug: S.optional(S.String.pipe(T.Query())),
591
+ kind: CreateKmsIssuerPolicyRequestKind,
592
+ projectId: S.String,
593
+ environments: CreateKmsIssuerPolicyRequestEnvironmentsList,
594
+ tokenClaims: S.optional(CreateKmsIssuerPolicyRequestTokenClaimsMap),
595
+ }).pipe(
596
+ T.Http({
597
+ method: "POST",
598
+ uri: "/v1/kms/issuers/{issuerId}/policies",
599
+ code: 200,
600
+ }),
601
+ ),
602
+ ).annotate({
603
+ identifier: "CreateKmsIssuerPolicyRequest",
604
+ }) as any as S.Schema<CreateKmsIssuerPolicyRequest>;
605
+
606
+ export type CreateKmsIssuerPolicyResponseBodyCase0Kind = "project-grant";
607
+ export const CreateKmsIssuerPolicyResponseBodyCase0Kind =
608
+ /*@__PURE__*/ S.String;
609
+
610
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
611
+ export type CreateKmsIssuerPolicyResponseBodyCase0EnvironmentsList =
612
+ Array<string>;
613
+ export const CreateKmsIssuerPolicyResponseBodyCase0EnvironmentsList =
614
+ /*@__PURE__*/ S.Array(
615
+ S.String,
616
+ ) as any as S.Schema<CreateKmsIssuerPolicyResponseBodyCase0EnvironmentsList>;
617
+
618
+ export type CreateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap = {
619
+ [key: string]: unknown | undefined;
620
+ };
621
+ export const CreateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap =
622
+ /*@__PURE__*/ S.Record(
623
+ S.String,
624
+ S.Unknown,
625
+ ) as any as S.Schema<CreateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap>;
626
+
627
+ export interface CreateKmsIssuerPolicyResponseBodyCase0 {
628
+ kind: CreateKmsIssuerPolicyResponseBodyCase0Kind;
629
+ teamId: string;
630
+ projectId: string;
631
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
632
+ environments: CreateKmsIssuerPolicyResponseBodyCase0EnvironmentsList;
633
+ tokenClaims?: CreateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap;
634
+ createdAt: string;
635
+ updatedAt: string;
636
+ }
637
+ export const CreateKmsIssuerPolicyResponseBodyCase0 = /*@__PURE__*/ S.suspend(
638
+ () =>
639
+ S.Struct({
640
+ kind: CreateKmsIssuerPolicyResponseBodyCase0Kind,
641
+ teamId: S.String,
642
+ projectId: S.String,
643
+ environments: CreateKmsIssuerPolicyResponseBodyCase0EnvironmentsList,
644
+ tokenClaims: S.optional(
645
+ CreateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap,
646
+ ),
647
+ createdAt: S.String,
648
+ updatedAt: S.String,
649
+ }),
650
+ ).annotate({
651
+ identifier: "CreateKmsIssuerPolicyResponseBodyCase0",
652
+ }) as any as S.Schema<CreateKmsIssuerPolicyResponseBodyCase0>;
653
+
654
+ export type CreateKmsIssuerPolicyResponseBodyCase1Kind = "connex-grant";
655
+ export const CreateKmsIssuerPolicyResponseBodyCase1Kind =
656
+ /*@__PURE__*/ S.String;
657
+
658
+ export type CreateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap = {
659
+ [key: string]: unknown | undefined;
660
+ };
661
+ export const CreateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap =
662
+ /*@__PURE__*/ S.Record(
663
+ S.String,
664
+ S.Unknown,
665
+ ) as any as S.Schema<CreateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap>;
666
+
667
+ export interface CreateKmsIssuerPolicyResponseBodyCase1 {
668
+ kind: CreateKmsIssuerPolicyResponseBodyCase1Kind;
669
+ clientId: string;
670
+ tokenClaims?: CreateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap;
671
+ createdAt: string;
672
+ updatedAt: string;
673
+ }
674
+ export const CreateKmsIssuerPolicyResponseBodyCase1 = /*@__PURE__*/ S.suspend(
675
+ () =>
676
+ S.Struct({
677
+ kind: CreateKmsIssuerPolicyResponseBodyCase1Kind,
678
+ clientId: S.String,
679
+ tokenClaims: S.optional(
680
+ CreateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap,
681
+ ),
682
+ createdAt: S.String,
683
+ updatedAt: S.String,
684
+ }),
685
+ ).annotate({
686
+ identifier: "CreateKmsIssuerPolicyResponseBodyCase1",
687
+ }) as any as S.Schema<CreateKmsIssuerPolicyResponseBodyCase1>;
688
+
689
+ export type CreateKmsIssuerPolicyResponseBody =
690
+ | CreateKmsIssuerPolicyResponseBodyCase0
691
+ | CreateKmsIssuerPolicyResponseBodyCase1;
692
+ export const CreateKmsIssuerPolicyResponseBody =
693
+ /*@__PURE__*/ S.Unknown as any as S.Schema<CreateKmsIssuerPolicyResponseBody>;
694
+
695
+ export type CreateKmsIssuerPolicyResponse = CreateKmsIssuerPolicyResponseBody;
696
+ export const CreateKmsIssuerPolicyResponse = /*@__PURE__*/ S.suspend(() =>
697
+ CreateKmsIssuerPolicyResponseBody.pipe(T.RawResponseRoot()),
698
+ ).annotate({
699
+ identifier: "CreateKmsIssuerPolicyResponse",
700
+ }) as any as S.Schema<CreateKmsIssuerPolicyResponse>;
701
+
702
+ /** Whether the new key is activated automatically after its public key has propagated, or manually via the activate endpoint. Defaults to `automatic`. */
703
+ export type CreateKmsSigningKeyRequestActivation = "automatic" | "manual";
704
+ export const CreateKmsSigningKeyRequestActivation = /*@__PURE__*/ S.String;
705
+
706
+ /** Deprecated. The ISO date string or timestamp when the previous signing key should stop being used. Converted to a relative grace and applied at activation, not creation. Prefer revokePreviousAfterHours. */
707
+ export type CreateKmsSigningKeyRequestRevokePreviousAt = string | number;
708
+ export const CreateKmsSigningKeyRequestRevokePreviousAt =
709
+ /*@__PURE__*/ S.Unknown as any as S.Schema<CreateKmsSigningKeyRequestRevokePreviousAt>;
710
+
711
+ export interface CreateKmsSigningKeyRequest {
712
+ /** The ID of the issuer. */
713
+ issuerId: string;
714
+ /** The Team identifier to perform the request on behalf of. */
715
+ teamId?: string;
716
+ /** The Team slug to perform the request on behalf of. */
717
+ slug?: string;
718
+ /** Whether the new key is activated automatically after its public key has propagated, or manually via the activate endpoint. Defaults to `automatic`. */
719
+ activation?: CreateKmsSigningKeyRequestActivation | (string & {});
720
+ /** For automatic activation, how many hours after activation the previous signing key should stop being used. Defaults to a 1 hour grace period so already-issued tokens keep verifying. */
721
+ revokePreviousAfterHours?: number;
722
+ /** Deprecated. The ISO date string or timestamp when the previous signing key should stop being used. Converted to a relative grace and applied at activation, not creation. Prefer revokePreviousAfterHours. */
723
+ revokePreviousAt?: CreateKmsSigningKeyRequestRevokePreviousAt;
724
+ /** The PEM-encoded private key to use for the issuer. */
725
+ importKey?: string;
726
+ /** The key id to use as the imported key's JWT/JWKS `kid`. Only allowed when `importKey` is provided. Not required to be unique; the addressable key id is the server-minted `keyId` returned in the response. */
727
+ importKeyId?: string;
728
+ }
729
+ export const CreateKmsSigningKeyRequest = /*@__PURE__*/ S.suspend(() =>
730
+ S.Struct({
731
+ issuerId: S.String.pipe(T.Label()),
732
+ teamId: S.optional(S.String.pipe(T.Query())),
733
+ slug: S.optional(S.String.pipe(T.Query())),
734
+ activation: S.optional(CreateKmsSigningKeyRequestActivation),
735
+ revokePreviousAfterHours: S.optional(S.Number),
736
+ revokePreviousAt: S.optional(CreateKmsSigningKeyRequestRevokePreviousAt),
737
+ importKey: S.optional(S.String),
738
+ importKeyId: S.optional(S.String),
739
+ }).pipe(
740
+ T.Http({
741
+ method: "POST",
742
+ uri: "/v1/kms/issuers/{issuerId}/keys",
743
+ code: 200,
744
+ }),
745
+ ),
746
+ ).annotate({
747
+ identifier: "CreateKmsSigningKeyRequest",
748
+ }) as any as S.Schema<CreateKmsSigningKeyRequest>;
749
+
750
+ export type CreateKmsSigningKeyResponseStatus =
751
+ | "active"
752
+ | "pending"
753
+ | "revoking";
754
+ export const CreateKmsSigningKeyResponseStatus = /*@__PURE__*/ S.String;
755
+
756
+ export type CreateKmsSigningKeyResponsePublicKeyKeyOpsList = Array<string>;
757
+ export const CreateKmsSigningKeyResponsePublicKeyKeyOpsList =
758
+ /*@__PURE__*/ S.Array(
759
+ S.String,
760
+ ) as any as S.Schema<CreateKmsSigningKeyResponsePublicKeyKeyOpsList>;
761
+
762
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
763
+ export type CreateKmsSigningKeyResponsePublicKeyX5cList = Array<string>;
764
+ export const CreateKmsSigningKeyResponsePublicKeyX5cList =
765
+ /*@__PURE__*/ S.Array(
766
+ S.String,
767
+ ) as any as S.Schema<CreateKmsSigningKeyResponsePublicKeyX5cList>;
768
+
769
+ export interface CreateKmsSigningKeyResponsePublicKey {
770
+ kty?: string;
771
+ kid?: string;
772
+ alg?: string;
773
+ use?: string;
774
+ key_ops?: CreateKmsSigningKeyResponsePublicKeyKeyOpsList;
775
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
776
+ x5c?: CreateKmsSigningKeyResponsePublicKeyX5cList;
777
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
778
+ x5t_S256?: string;
779
+ }
780
+ export const CreateKmsSigningKeyResponsePublicKey = /*@__PURE__*/ S.suspend(
781
+ () =>
782
+ S.Struct({
783
+ kty: S.optional(S.String),
784
+ kid: S.optional(S.String),
785
+ alg: S.optional(S.String),
786
+ use: S.optional(S.String),
787
+ key_ops: S.optional(CreateKmsSigningKeyResponsePublicKeyKeyOpsList),
788
+ x5c: S.optional(CreateKmsSigningKeyResponsePublicKeyX5cList),
789
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
790
+ }),
791
+ ).annotate({
792
+ identifier: "CreateKmsSigningKeyResponsePublicKey",
793
+ }) as any as S.Schema<CreateKmsSigningKeyResponsePublicKey>;
794
+
795
+ export interface CreateKmsSigningKeyResponse {
796
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
797
+ keyId: string;
798
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
799
+ importKeyId?: string;
800
+ issuerId: string;
801
+ algorithm: string;
802
+ status: CreateKmsSigningKeyResponseStatus;
803
+ publicKey?: CreateKmsSigningKeyResponsePublicKey;
804
+ publicKeyFingerprint?: string;
805
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
806
+ publicKeyPem?: string;
807
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
808
+ certificatePem?: string;
809
+ createdAt: string;
810
+ updatedAt: string;
811
+ revokeAt?: string;
812
+ activateAt?: string;
813
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
814
+ activatedAt?: string;
815
+ }
816
+ export const CreateKmsSigningKeyResponse = /*@__PURE__*/ S.suspend(() =>
817
+ S.Struct({
818
+ keyId: S.String,
819
+ importKeyId: S.optional(S.String),
820
+ issuerId: S.String,
821
+ algorithm: S.String,
822
+ status: CreateKmsSigningKeyResponseStatus,
823
+ publicKey: S.optional(CreateKmsSigningKeyResponsePublicKey),
824
+ publicKeyFingerprint: S.optional(S.String),
825
+ publicKeyPem: S.optional(S.String),
826
+ certificatePem: S.optional(S.String),
827
+ createdAt: S.String,
828
+ updatedAt: S.String,
829
+ revokeAt: S.optional(S.String),
830
+ activateAt: S.optional(S.String),
831
+ activatedAt: S.optional(S.String),
832
+ }),
833
+ ).annotate({
834
+ identifier: "CreateKmsSigningKeyResponse",
835
+ }) as any as S.Schema<CreateKmsSigningKeyResponse>;
836
+
837
+ export interface DeleteKmsIssuerRequest {
838
+ /** The ID of the issuer. */
839
+ issuerId: string;
840
+ /** The Team identifier to perform the request on behalf of. */
841
+ teamId?: string;
842
+ /** The Team slug to perform the request on behalf of. */
843
+ slug?: string;
844
+ }
845
+ export const DeleteKmsIssuerRequest = /*@__PURE__*/ S.suspend(() =>
846
+ S.Struct({
847
+ issuerId: S.String.pipe(T.Label()),
848
+ teamId: S.optional(S.String.pipe(T.Query())),
849
+ slug: S.optional(S.String.pipe(T.Query())),
850
+ }).pipe(
851
+ T.Http({ method: "DELETE", uri: "/v1/kms/issuers/{issuerId}", code: 200 }),
852
+ ),
853
+ ).annotate({
854
+ identifier: "DeleteKmsIssuerRequest",
855
+ }) as any as S.Schema<DeleteKmsIssuerRequest>;
856
+
857
+ export interface DeleteKmsIssuerResponse {}
858
+ export const DeleteKmsIssuerResponse = /*@__PURE__*/ S.suspend(() =>
859
+ S.Struct({}),
860
+ ).annotate({
861
+ identifier: "DeleteKmsIssuerResponse",
862
+ }) as any as S.Schema<DeleteKmsIssuerResponse>;
863
+
864
+ /** The issuer policy kind. */
865
+ export type DeleteKmsIssuerPolicyRequestKind = "project-grant" | "connex-grant";
866
+ export const DeleteKmsIssuerPolicyRequestKind = /*@__PURE__*/ S.String;
867
+
868
+ export interface DeleteKmsIssuerPolicyRequest {
869
+ /** The ID of the issuer. */
870
+ issuerId: string;
871
+ /** The issuer policy kind. */
872
+ kind: DeleteKmsIssuerPolicyRequestKind | (string & {});
873
+ /** The policy identifier. */
874
+ policyKey: string;
875
+ /** The Team identifier to perform the request on behalf of. */
876
+ teamId?: string;
877
+ /** The Team slug to perform the request on behalf of. */
878
+ slug?: string;
879
+ }
880
+ export const DeleteKmsIssuerPolicyRequest = /*@__PURE__*/ S.suspend(() =>
881
+ S.Struct({
882
+ issuerId: S.String.pipe(T.Label()),
883
+ kind: DeleteKmsIssuerPolicyRequestKind.pipe(T.Label()),
884
+ policyKey: S.String.pipe(T.Label()),
885
+ teamId: S.optional(S.String.pipe(T.Query())),
886
+ slug: S.optional(S.String.pipe(T.Query())),
887
+ }).pipe(
888
+ T.Http({
889
+ method: "DELETE",
890
+ uri: "/v1/kms/issuers/{issuerId}/policies/{kind}/{policyKey}",
891
+ code: 200,
892
+ }),
893
+ ),
894
+ ).annotate({
895
+ identifier: "DeleteKmsIssuerPolicyRequest",
896
+ }) as any as S.Schema<DeleteKmsIssuerPolicyRequest>;
897
+
898
+ export interface DeleteKmsIssuerPolicyResponse {}
899
+ export const DeleteKmsIssuerPolicyResponse = /*@__PURE__*/ S.suspend(() =>
900
+ S.Struct({}),
901
+ ).annotate({
902
+ identifier: "DeleteKmsIssuerPolicyResponse",
903
+ }) as any as S.Schema<DeleteKmsIssuerPolicyResponse>;
904
+
905
+ export interface GetKmsIssuerRequest {
906
+ /** The ID of the issuer. */
907
+ issuerId: string;
908
+ /** The Team identifier to perform the request on behalf of. */
909
+ teamId?: string;
910
+ /** The Team slug to perform the request on behalf of. */
911
+ slug?: string;
912
+ }
913
+ export const GetKmsIssuerRequest = /*@__PURE__*/ S.suspend(() =>
914
+ S.Struct({
915
+ issuerId: S.String.pipe(T.Label()),
916
+ teamId: S.optional(S.String.pipe(T.Query())),
917
+ slug: S.optional(S.String.pipe(T.Query())),
918
+ }).pipe(
919
+ T.Http({ method: "GET", uri: "/v1/kms/issuers/{issuerId}", code: 200 }),
920
+ ),
921
+ ).annotate({
922
+ identifier: "GetKmsIssuerRequest",
923
+ }) as any as S.Schema<GetKmsIssuerRequest>;
924
+
925
+ export type GetKmsIssuerResponseAlgorithm =
926
+ | "ES256"
927
+ | "ES384"
928
+ | "ES512"
929
+ | "EdDSA"
930
+ | "PS256"
931
+ | "PS384"
932
+ | "PS512"
933
+ | "RS256"
934
+ | "RS384"
935
+ | "RS512";
936
+ export const GetKmsIssuerResponseAlgorithm = /*@__PURE__*/ S.String;
937
+
938
+ export type GetKmsIssuerResponseOrigin = "external" | "vercel";
939
+ export const GetKmsIssuerResponseOrigin = /*@__PURE__*/ S.String;
940
+
941
+ export type GetKmsIssuerResponseClaimsSchemaMap = {
942
+ [key: string]: unknown | undefined;
943
+ };
944
+ export const GetKmsIssuerResponseClaimsSchemaMap = /*@__PURE__*/ S.Record(
945
+ S.String,
946
+ S.Unknown,
947
+ ) as any as S.Schema<GetKmsIssuerResponseClaimsSchemaMap>;
948
+
949
+ export type GetKmsIssuerResponseSigningKeysItemStatus =
950
+ | "active"
951
+ | "pending"
952
+ | "revoking";
953
+ export const GetKmsIssuerResponseSigningKeysItemStatus = /*@__PURE__*/ S.String;
954
+
955
+ export type GetKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList =
956
+ Array<string>;
957
+ export const GetKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList =
958
+ /*@__PURE__*/ S.Array(
959
+ S.String,
960
+ ) as any as S.Schema<GetKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList>;
961
+
962
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
963
+ export type GetKmsIssuerResponseSigningKeysItemPublicKeyX5cList = Array<string>;
964
+ export const GetKmsIssuerResponseSigningKeysItemPublicKeyX5cList =
965
+ /*@__PURE__*/ S.Array(
966
+ S.String,
967
+ ) as any as S.Schema<GetKmsIssuerResponseSigningKeysItemPublicKeyX5cList>;
968
+
969
+ export interface GetKmsIssuerResponseSigningKeysItemPublicKey {
970
+ kty?: string;
971
+ kid?: string;
972
+ alg?: string;
973
+ use?: string;
974
+ key_ops?: GetKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList;
975
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
976
+ x5c?: GetKmsIssuerResponseSigningKeysItemPublicKeyX5cList;
977
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
978
+ x5t_S256?: string;
979
+ }
980
+ export const GetKmsIssuerResponseSigningKeysItemPublicKey =
981
+ /*@__PURE__*/ S.suspend(() =>
982
+ S.Struct({
983
+ kty: S.optional(S.String),
984
+ kid: S.optional(S.String),
985
+ alg: S.optional(S.String),
986
+ use: S.optional(S.String),
987
+ key_ops: S.optional(
988
+ GetKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList,
989
+ ),
990
+ x5c: S.optional(GetKmsIssuerResponseSigningKeysItemPublicKeyX5cList),
991
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
992
+ }),
993
+ ).annotate({
994
+ identifier: "GetKmsIssuerResponseSigningKeysItemPublicKey",
995
+ }) as any as S.Schema<GetKmsIssuerResponseSigningKeysItemPublicKey>;
996
+
997
+ export interface GetKmsIssuerResponseSigningKeysItem {
998
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
999
+ keyId: string;
1000
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
1001
+ importKeyId?: string;
1002
+ issuerId: string;
1003
+ algorithm: string;
1004
+ status: GetKmsIssuerResponseSigningKeysItemStatus;
1005
+ publicKey?: GetKmsIssuerResponseSigningKeysItemPublicKey;
1006
+ publicKeyFingerprint?: string;
1007
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
1008
+ publicKeyPem?: string;
1009
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
1010
+ certificatePem?: string;
1011
+ createdAt: string;
1012
+ updatedAt: string;
1013
+ revokeAt?: string;
1014
+ activateAt?: string;
1015
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
1016
+ activatedAt?: string;
1017
+ }
1018
+ export const GetKmsIssuerResponseSigningKeysItem = /*@__PURE__*/ S.suspend(() =>
1019
+ S.Struct({
1020
+ keyId: S.String,
1021
+ importKeyId: S.optional(S.String),
1022
+ issuerId: S.String,
1023
+ algorithm: S.String,
1024
+ status: GetKmsIssuerResponseSigningKeysItemStatus,
1025
+ publicKey: S.optional(GetKmsIssuerResponseSigningKeysItemPublicKey),
1026
+ publicKeyFingerprint: S.optional(S.String),
1027
+ publicKeyPem: S.optional(S.String),
1028
+ certificatePem: S.optional(S.String),
1029
+ createdAt: S.String,
1030
+ updatedAt: S.String,
1031
+ revokeAt: S.optional(S.String),
1032
+ activateAt: S.optional(S.String),
1033
+ activatedAt: S.optional(S.String),
1034
+ }),
1035
+ ).annotate({
1036
+ identifier: "GetKmsIssuerResponseSigningKeysItem",
1037
+ }) as any as S.Schema<GetKmsIssuerResponseSigningKeysItem>;
1038
+
1039
+ export type GetKmsIssuerResponseSigningKeysList =
1040
+ Array<GetKmsIssuerResponseSigningKeysItem>;
1041
+ export const GetKmsIssuerResponseSigningKeysList = /*@__PURE__*/ S.Array(
1042
+ GetKmsIssuerResponseSigningKeysItem,
1043
+ ) as any as S.Schema<GetKmsIssuerResponseSigningKeysList>;
1044
+
1045
+ export type GetKmsIssuerResponsePoliciesItemCase0Kind = "project-grant";
1046
+ export const GetKmsIssuerResponsePoliciesItemCase0Kind = /*@__PURE__*/ S.String;
1047
+
1048
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
1049
+ export type GetKmsIssuerResponsePoliciesItemCase0EnvironmentsList =
1050
+ Array<string>;
1051
+ export const GetKmsIssuerResponsePoliciesItemCase0EnvironmentsList =
1052
+ /*@__PURE__*/ S.Array(
1053
+ S.String,
1054
+ ) as any as S.Schema<GetKmsIssuerResponsePoliciesItemCase0EnvironmentsList>;
1055
+
1056
+ export type GetKmsIssuerResponsePoliciesItemCase0TokenClaimsMap = {
1057
+ [key: string]: unknown | undefined;
1058
+ };
1059
+ export const GetKmsIssuerResponsePoliciesItemCase0TokenClaimsMap =
1060
+ /*@__PURE__*/ S.Record(
1061
+ S.String,
1062
+ S.Unknown,
1063
+ ) as any as S.Schema<GetKmsIssuerResponsePoliciesItemCase0TokenClaimsMap>;
1064
+
1065
+ export interface GetKmsIssuerResponsePoliciesItemCase0 {
1066
+ kind: GetKmsIssuerResponsePoliciesItemCase0Kind;
1067
+ teamId: string;
1068
+ projectId: string;
1069
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
1070
+ environments: GetKmsIssuerResponsePoliciesItemCase0EnvironmentsList;
1071
+ tokenClaims?: GetKmsIssuerResponsePoliciesItemCase0TokenClaimsMap;
1072
+ createdAt: string;
1073
+ updatedAt: string;
1074
+ }
1075
+ export const GetKmsIssuerResponsePoliciesItemCase0 = /*@__PURE__*/ S.suspend(
1076
+ () =>
1077
+ S.Struct({
1078
+ kind: GetKmsIssuerResponsePoliciesItemCase0Kind,
1079
+ teamId: S.String,
1080
+ projectId: S.String,
1081
+ environments: GetKmsIssuerResponsePoliciesItemCase0EnvironmentsList,
1082
+ tokenClaims: S.optional(
1083
+ GetKmsIssuerResponsePoliciesItemCase0TokenClaimsMap,
1084
+ ),
1085
+ createdAt: S.String,
1086
+ updatedAt: S.String,
1087
+ }),
1088
+ ).annotate({
1089
+ identifier: "GetKmsIssuerResponsePoliciesItemCase0",
1090
+ }) as any as S.Schema<GetKmsIssuerResponsePoliciesItemCase0>;
1091
+
1092
+ export type GetKmsIssuerResponsePoliciesItemCase1Kind = "connex-grant";
1093
+ export const GetKmsIssuerResponsePoliciesItemCase1Kind = /*@__PURE__*/ S.String;
1094
+
1095
+ export type GetKmsIssuerResponsePoliciesItemCase1TokenClaimsMap = {
1096
+ [key: string]: unknown | undefined;
1097
+ };
1098
+ export const GetKmsIssuerResponsePoliciesItemCase1TokenClaimsMap =
1099
+ /*@__PURE__*/ S.Record(
1100
+ S.String,
1101
+ S.Unknown,
1102
+ ) as any as S.Schema<GetKmsIssuerResponsePoliciesItemCase1TokenClaimsMap>;
1103
+
1104
+ export interface GetKmsIssuerResponsePoliciesItemCase1 {
1105
+ kind: GetKmsIssuerResponsePoliciesItemCase1Kind;
1106
+ clientId: string;
1107
+ tokenClaims?: GetKmsIssuerResponsePoliciesItemCase1TokenClaimsMap;
1108
+ createdAt: string;
1109
+ updatedAt: string;
1110
+ }
1111
+ export const GetKmsIssuerResponsePoliciesItemCase1 = /*@__PURE__*/ S.suspend(
1112
+ () =>
1113
+ S.Struct({
1114
+ kind: GetKmsIssuerResponsePoliciesItemCase1Kind,
1115
+ clientId: S.String,
1116
+ tokenClaims: S.optional(
1117
+ GetKmsIssuerResponsePoliciesItemCase1TokenClaimsMap,
1118
+ ),
1119
+ createdAt: S.String,
1120
+ updatedAt: S.String,
1121
+ }),
1122
+ ).annotate({
1123
+ identifier: "GetKmsIssuerResponsePoliciesItemCase1",
1124
+ }) as any as S.Schema<GetKmsIssuerResponsePoliciesItemCase1>;
1125
+
1126
+ export type GetKmsIssuerResponsePoliciesItem =
1127
+ | GetKmsIssuerResponsePoliciesItemCase0
1128
+ | GetKmsIssuerResponsePoliciesItemCase1;
1129
+ export const GetKmsIssuerResponsePoliciesItem =
1130
+ /*@__PURE__*/ S.Unknown as any as S.Schema<GetKmsIssuerResponsePoliciesItem>;
1131
+
1132
+ export type GetKmsIssuerResponsePoliciesList =
1133
+ Array<GetKmsIssuerResponsePoliciesItem>;
1134
+ export const GetKmsIssuerResponsePoliciesList = /*@__PURE__*/ S.Array(
1135
+ GetKmsIssuerResponsePoliciesItem,
1136
+ ) as any as S.Schema<GetKmsIssuerResponsePoliciesList>;
1137
+
1138
+ export interface GetKmsIssuerResponse {
1139
+ id: string;
1140
+ ownerId: string;
1141
+ name: string;
1142
+ algorithm: GetKmsIssuerResponseAlgorithm;
1143
+ origin: GetKmsIssuerResponseOrigin;
1144
+ managedBy?: string;
1145
+ claimsSchema?: GetKmsIssuerResponseClaimsSchemaMap;
1146
+ createdAt: string;
1147
+ updatedAt: string;
1148
+ signingKeys: GetKmsIssuerResponseSigningKeysList;
1149
+ policies: GetKmsIssuerResponsePoliciesList;
1150
+ }
1151
+ export const GetKmsIssuerResponse = /*@__PURE__*/ S.suspend(() =>
1152
+ S.Struct({
1153
+ id: S.String,
1154
+ ownerId: S.String,
1155
+ name: S.String,
1156
+ algorithm: GetKmsIssuerResponseAlgorithm,
1157
+ origin: GetKmsIssuerResponseOrigin,
1158
+ managedBy: S.optional(S.String),
1159
+ claimsSchema: S.optional(GetKmsIssuerResponseClaimsSchemaMap),
1160
+ createdAt: S.String,
1161
+ updatedAt: S.String,
1162
+ signingKeys: GetKmsIssuerResponseSigningKeysList,
1163
+ policies: GetKmsIssuerResponsePoliciesList,
1164
+ }),
1165
+ ).annotate({
1166
+ identifier: "GetKmsIssuerResponse",
1167
+ }) as any as S.Schema<GetKmsIssuerResponse>;
1168
+
1169
+ export interface ListKmsIssuersRequest {
1170
+ /** Maximum number of issuers to return. */
1171
+ limit?: number;
1172
+ /** Continuation cursor to retrieve the next page of results. */
1173
+ next?: string;
1174
+ /** The Team identifier to perform the request on behalf of. */
1175
+ teamId?: string;
1176
+ /** The Team slug to perform the request on behalf of. */
1177
+ slug?: string;
1178
+ }
1179
+ export const ListKmsIssuersRequest = /*@__PURE__*/ S.suspend(() =>
1180
+ S.Struct({
1181
+ limit: S.optional(S.Number.pipe(T.Query())),
1182
+ next: S.optional(S.String.pipe(T.Query())),
1183
+ teamId: S.optional(S.String.pipe(T.Query())),
1184
+ slug: S.optional(S.String.pipe(T.Query())),
1185
+ }).pipe(T.Http({ method: "GET", uri: "/v1/kms/issuers", code: 200 })),
1186
+ ).annotate({
1187
+ identifier: "ListKmsIssuersRequest",
1188
+ }) as any as S.Schema<ListKmsIssuersRequest>;
1189
+
1190
+ export type ListKmsIssuersResponseIssuersItemAlgorithm =
1191
+ | "ES256"
1192
+ | "ES384"
1193
+ | "ES512"
1194
+ | "EdDSA"
1195
+ | "PS256"
1196
+ | "PS384"
1197
+ | "PS512"
1198
+ | "RS256"
1199
+ | "RS384"
1200
+ | "RS512";
1201
+ export const ListKmsIssuersResponseIssuersItemAlgorithm =
1202
+ /*@__PURE__*/ S.String;
1203
+
1204
+ export type ListKmsIssuersResponseIssuersItemOrigin = "external" | "vercel";
1205
+ export const ListKmsIssuersResponseIssuersItemOrigin = /*@__PURE__*/ S.String;
1206
+
1207
+ export type ListKmsIssuersResponseIssuersItemClaimsSchemaMap = {
1208
+ [key: string]: unknown | undefined;
1209
+ };
1210
+ export const ListKmsIssuersResponseIssuersItemClaimsSchemaMap =
1211
+ /*@__PURE__*/ S.Record(
1212
+ S.String,
1213
+ S.Unknown,
1214
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemClaimsSchemaMap>;
1215
+
1216
+ export type ListKmsIssuersResponseIssuersItemSigningKeysItemStatus =
1217
+ | "active"
1218
+ | "pending"
1219
+ | "revoking";
1220
+ export const ListKmsIssuersResponseIssuersItemSigningKeysItemStatus =
1221
+ /*@__PURE__*/ S.String;
1222
+
1223
+ export type ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyKeyOpsList =
1224
+ Array<string>;
1225
+ export const ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyKeyOpsList =
1226
+ /*@__PURE__*/ S.Array(
1227
+ S.String,
1228
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyKeyOpsList>;
1229
+
1230
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
1231
+ export type ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyX5cList =
1232
+ Array<string>;
1233
+ export const ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyX5cList =
1234
+ /*@__PURE__*/ S.Array(
1235
+ S.String,
1236
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyX5cList>;
1237
+
1238
+ export interface ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKey {
1239
+ kty?: string;
1240
+ kid?: string;
1241
+ alg?: string;
1242
+ use?: string;
1243
+ key_ops?: ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyKeyOpsList;
1244
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
1245
+ x5c?: ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyX5cList;
1246
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
1247
+ x5t_S256?: string;
1248
+ }
1249
+ export const ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKey =
1250
+ /*@__PURE__*/ S.suspend(() =>
1251
+ S.Struct({
1252
+ kty: S.optional(S.String),
1253
+ kid: S.optional(S.String),
1254
+ alg: S.optional(S.String),
1255
+ use: S.optional(S.String),
1256
+ key_ops: S.optional(
1257
+ ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyKeyOpsList,
1258
+ ),
1259
+ x5c: S.optional(
1260
+ ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKeyX5cList,
1261
+ ),
1262
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
1263
+ }),
1264
+ ).annotate({
1265
+ identifier: "ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKey",
1266
+ }) as any as S.Schema<ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKey>;
1267
+
1268
+ export interface ListKmsIssuersResponseIssuersItemSigningKeysItem {
1269
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
1270
+ keyId: string;
1271
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
1272
+ importKeyId?: string;
1273
+ issuerId: string;
1274
+ algorithm: string;
1275
+ status: ListKmsIssuersResponseIssuersItemSigningKeysItemStatus;
1276
+ publicKey?: ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKey;
1277
+ publicKeyFingerprint?: string;
1278
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
1279
+ publicKeyPem?: string;
1280
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
1281
+ certificatePem?: string;
1282
+ createdAt: string;
1283
+ updatedAt: string;
1284
+ revokeAt?: string;
1285
+ activateAt?: string;
1286
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
1287
+ activatedAt?: string;
1288
+ }
1289
+ export const ListKmsIssuersResponseIssuersItemSigningKeysItem =
1290
+ /*@__PURE__*/ S.suspend(() =>
1291
+ S.Struct({
1292
+ keyId: S.String,
1293
+ importKeyId: S.optional(S.String),
1294
+ issuerId: S.String,
1295
+ algorithm: S.String,
1296
+ status: ListKmsIssuersResponseIssuersItemSigningKeysItemStatus,
1297
+ publicKey: S.optional(
1298
+ ListKmsIssuersResponseIssuersItemSigningKeysItemPublicKey,
1299
+ ),
1300
+ publicKeyFingerprint: S.optional(S.String),
1301
+ publicKeyPem: S.optional(S.String),
1302
+ certificatePem: S.optional(S.String),
1303
+ createdAt: S.String,
1304
+ updatedAt: S.String,
1305
+ revokeAt: S.optional(S.String),
1306
+ activateAt: S.optional(S.String),
1307
+ activatedAt: S.optional(S.String),
1308
+ }),
1309
+ ).annotate({
1310
+ identifier: "ListKmsIssuersResponseIssuersItemSigningKeysItem",
1311
+ }) as any as S.Schema<ListKmsIssuersResponseIssuersItemSigningKeysItem>;
1312
+
1313
+ export type ListKmsIssuersResponseIssuersItemSigningKeysList =
1314
+ Array<ListKmsIssuersResponseIssuersItemSigningKeysItem>;
1315
+ export const ListKmsIssuersResponseIssuersItemSigningKeysList =
1316
+ /*@__PURE__*/ S.Array(
1317
+ ListKmsIssuersResponseIssuersItemSigningKeysItem,
1318
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemSigningKeysList>;
1319
+
1320
+ export type ListKmsIssuersResponseIssuersItemPoliciesItemCase0Kind =
1321
+ "project-grant";
1322
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase0Kind =
1323
+ /*@__PURE__*/ S.String;
1324
+
1325
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
1326
+ export type ListKmsIssuersResponseIssuersItemPoliciesItemCase0EnvironmentsList =
1327
+ Array<string>;
1328
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase0EnvironmentsList =
1329
+ /*@__PURE__*/ S.Array(
1330
+ S.String,
1331
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesItemCase0EnvironmentsList>;
1332
+
1333
+ export type ListKmsIssuersResponseIssuersItemPoliciesItemCase0TokenClaimsMap = {
1334
+ [key: string]: unknown | undefined;
1335
+ };
1336
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase0TokenClaimsMap =
1337
+ /*@__PURE__*/ S.Record(
1338
+ S.String,
1339
+ S.Unknown,
1340
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesItemCase0TokenClaimsMap>;
1341
+
1342
+ export interface ListKmsIssuersResponseIssuersItemPoliciesItemCase0 {
1343
+ kind: ListKmsIssuersResponseIssuersItemPoliciesItemCase0Kind;
1344
+ teamId: string;
1345
+ projectId: string;
1346
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
1347
+ environments: ListKmsIssuersResponseIssuersItemPoliciesItemCase0EnvironmentsList;
1348
+ tokenClaims?: ListKmsIssuersResponseIssuersItemPoliciesItemCase0TokenClaimsMap;
1349
+ createdAt: string;
1350
+ updatedAt: string;
1351
+ }
1352
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase0 =
1353
+ /*@__PURE__*/ S.suspend(() =>
1354
+ S.Struct({
1355
+ kind: ListKmsIssuersResponseIssuersItemPoliciesItemCase0Kind,
1356
+ teamId: S.String,
1357
+ projectId: S.String,
1358
+ environments:
1359
+ ListKmsIssuersResponseIssuersItemPoliciesItemCase0EnvironmentsList,
1360
+ tokenClaims: S.optional(
1361
+ ListKmsIssuersResponseIssuersItemPoliciesItemCase0TokenClaimsMap,
1362
+ ),
1363
+ createdAt: S.String,
1364
+ updatedAt: S.String,
1365
+ }),
1366
+ ).annotate({
1367
+ identifier: "ListKmsIssuersResponseIssuersItemPoliciesItemCase0",
1368
+ }) as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesItemCase0>;
1369
+
1370
+ export type ListKmsIssuersResponseIssuersItemPoliciesItemCase1Kind =
1371
+ "connex-grant";
1372
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase1Kind =
1373
+ /*@__PURE__*/ S.String;
1374
+
1375
+ export type ListKmsIssuersResponseIssuersItemPoliciesItemCase1TokenClaimsMap = {
1376
+ [key: string]: unknown | undefined;
1377
+ };
1378
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase1TokenClaimsMap =
1379
+ /*@__PURE__*/ S.Record(
1380
+ S.String,
1381
+ S.Unknown,
1382
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesItemCase1TokenClaimsMap>;
1383
+
1384
+ export interface ListKmsIssuersResponseIssuersItemPoliciesItemCase1 {
1385
+ kind: ListKmsIssuersResponseIssuersItemPoliciesItemCase1Kind;
1386
+ clientId: string;
1387
+ tokenClaims?: ListKmsIssuersResponseIssuersItemPoliciesItemCase1TokenClaimsMap;
1388
+ createdAt: string;
1389
+ updatedAt: string;
1390
+ }
1391
+ export const ListKmsIssuersResponseIssuersItemPoliciesItemCase1 =
1392
+ /*@__PURE__*/ S.suspend(() =>
1393
+ S.Struct({
1394
+ kind: ListKmsIssuersResponseIssuersItemPoliciesItemCase1Kind,
1395
+ clientId: S.String,
1396
+ tokenClaims: S.optional(
1397
+ ListKmsIssuersResponseIssuersItemPoliciesItemCase1TokenClaimsMap,
1398
+ ),
1399
+ createdAt: S.String,
1400
+ updatedAt: S.String,
1401
+ }),
1402
+ ).annotate({
1403
+ identifier: "ListKmsIssuersResponseIssuersItemPoliciesItemCase1",
1404
+ }) as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesItemCase1>;
1405
+
1406
+ export type ListKmsIssuersResponseIssuersItemPoliciesItem =
1407
+ | ListKmsIssuersResponseIssuersItemPoliciesItemCase0
1408
+ | ListKmsIssuersResponseIssuersItemPoliciesItemCase1;
1409
+ export const ListKmsIssuersResponseIssuersItemPoliciesItem =
1410
+ /*@__PURE__*/ S.Unknown as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesItem>;
1411
+
1412
+ export type ListKmsIssuersResponseIssuersItemPoliciesList =
1413
+ Array<ListKmsIssuersResponseIssuersItemPoliciesItem>;
1414
+ export const ListKmsIssuersResponseIssuersItemPoliciesList =
1415
+ /*@__PURE__*/ S.Array(
1416
+ ListKmsIssuersResponseIssuersItemPoliciesItem,
1417
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersItemPoliciesList>;
1418
+
1419
+ export interface ListKmsIssuersResponseIssuersItem {
1420
+ id: string;
1421
+ ownerId: string;
1422
+ name: string;
1423
+ algorithm: ListKmsIssuersResponseIssuersItemAlgorithm;
1424
+ origin: ListKmsIssuersResponseIssuersItemOrigin;
1425
+ managedBy?: string;
1426
+ claimsSchema?: ListKmsIssuersResponseIssuersItemClaimsSchemaMap;
1427
+ createdAt: string;
1428
+ updatedAt: string;
1429
+ signingKeys: ListKmsIssuersResponseIssuersItemSigningKeysList;
1430
+ policies: ListKmsIssuersResponseIssuersItemPoliciesList;
1431
+ }
1432
+ export const ListKmsIssuersResponseIssuersItem = /*@__PURE__*/ S.suspend(() =>
1433
+ S.Struct({
1434
+ id: S.String,
1435
+ ownerId: S.String,
1436
+ name: S.String,
1437
+ algorithm: ListKmsIssuersResponseIssuersItemAlgorithm,
1438
+ origin: ListKmsIssuersResponseIssuersItemOrigin,
1439
+ managedBy: S.optional(S.String),
1440
+ claimsSchema: S.optional(ListKmsIssuersResponseIssuersItemClaimsSchemaMap),
1441
+ createdAt: S.String,
1442
+ updatedAt: S.String,
1443
+ signingKeys: ListKmsIssuersResponseIssuersItemSigningKeysList,
1444
+ policies: ListKmsIssuersResponseIssuersItemPoliciesList,
1445
+ }),
1446
+ ).annotate({
1447
+ identifier: "ListKmsIssuersResponseIssuersItem",
1448
+ }) as any as S.Schema<ListKmsIssuersResponseIssuersItem>;
1449
+
1450
+ export type ListKmsIssuersResponseIssuersList =
1451
+ Array<ListKmsIssuersResponseIssuersItem>;
1452
+ export const ListKmsIssuersResponseIssuersList = /*@__PURE__*/ S.Array(
1453
+ ListKmsIssuersResponseIssuersItem,
1454
+ ) as any as S.Schema<ListKmsIssuersResponseIssuersList>;
1455
+
1456
+ export interface ListKmsIssuersResponsePagination {
1457
+ count: number;
1458
+ next: string | null;
1459
+ }
1460
+ export const ListKmsIssuersResponsePagination = /*@__PURE__*/ S.suspend(() =>
1461
+ S.Struct({
1462
+ count: S.Number,
1463
+ next: S.NullOr(S.String),
1464
+ }),
1465
+ ).annotate({
1466
+ identifier: "ListKmsIssuersResponsePagination",
1467
+ }) as any as S.Schema<ListKmsIssuersResponsePagination>;
1468
+
1469
+ export interface ListKmsIssuersResponse {
1470
+ issuers: ListKmsIssuersResponseIssuersList;
1471
+ pagination: ListKmsIssuersResponsePagination;
1472
+ }
1473
+ export const ListKmsIssuersResponse = /*@__PURE__*/ S.suspend(() =>
1474
+ S.Struct({
1475
+ issuers: ListKmsIssuersResponseIssuersList,
1476
+ pagination: ListKmsIssuersResponsePagination,
1477
+ }),
1478
+ ).annotate({
1479
+ identifier: "ListKmsIssuersResponse",
1480
+ }) as any as S.Schema<ListKmsIssuersResponse>;
1481
+
1482
+ export interface RevokeKmsSigningKeyRequest {
1483
+ /** The ID of the issuer. */
1484
+ issuerId: string;
1485
+ /** The ID of the signing key to revoke immediately. The key must already be scheduled for revocation. */
1486
+ keyId: string;
1487
+ /** The Team identifier to perform the request on behalf of. */
1488
+ teamId?: string;
1489
+ /** The Team slug to perform the request on behalf of. */
1490
+ slug?: string;
1491
+ }
1492
+ export const RevokeKmsSigningKeyRequest = /*@__PURE__*/ S.suspend(() =>
1493
+ S.Struct({
1494
+ issuerId: S.String.pipe(T.Label()),
1495
+ keyId: S.String.pipe(T.Label()),
1496
+ teamId: S.optional(S.String.pipe(T.Query())),
1497
+ slug: S.optional(S.String.pipe(T.Query())),
1498
+ }).pipe(
1499
+ T.Http({
1500
+ method: "POST",
1501
+ uri: "/v1/kms/issuers/{issuerId}/keys/{keyId}/revoke",
1502
+ code: 200,
1503
+ }),
1504
+ ),
1505
+ ).annotate({
1506
+ identifier: "RevokeKmsSigningKeyRequest",
1507
+ }) as any as S.Schema<RevokeKmsSigningKeyRequest>;
1508
+
1509
+ export type RevokeKmsSigningKeyResponseAlgorithm =
1510
+ | "ES256"
1511
+ | "ES384"
1512
+ | "ES512"
1513
+ | "EdDSA"
1514
+ | "PS256"
1515
+ | "PS384"
1516
+ | "PS512"
1517
+ | "RS256"
1518
+ | "RS384"
1519
+ | "RS512";
1520
+ export const RevokeKmsSigningKeyResponseAlgorithm = /*@__PURE__*/ S.String;
1521
+
1522
+ export type RevokeKmsSigningKeyResponseOrigin = "external" | "vercel";
1523
+ export const RevokeKmsSigningKeyResponseOrigin = /*@__PURE__*/ S.String;
1524
+
1525
+ export type RevokeKmsSigningKeyResponseClaimsSchemaMap = {
1526
+ [key: string]: unknown | undefined;
1527
+ };
1528
+ export const RevokeKmsSigningKeyResponseClaimsSchemaMap =
1529
+ /*@__PURE__*/ S.Record(
1530
+ S.String,
1531
+ S.Unknown,
1532
+ ) as any as S.Schema<RevokeKmsSigningKeyResponseClaimsSchemaMap>;
1533
+
1534
+ export type RevokeKmsSigningKeyResponseSigningKeysItemStatus =
1535
+ | "active"
1536
+ | "pending"
1537
+ | "revoking";
1538
+ export const RevokeKmsSigningKeyResponseSigningKeysItemStatus =
1539
+ /*@__PURE__*/ S.String;
1540
+
1541
+ export type RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyKeyOpsList =
1542
+ Array<string>;
1543
+ export const RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyKeyOpsList =
1544
+ /*@__PURE__*/ S.Array(
1545
+ S.String,
1546
+ ) as any as S.Schema<RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyKeyOpsList>;
1547
+
1548
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
1549
+ export type RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyX5cList =
1550
+ Array<string>;
1551
+ export const RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyX5cList =
1552
+ /*@__PURE__*/ S.Array(
1553
+ S.String,
1554
+ ) as any as S.Schema<RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyX5cList>;
1555
+
1556
+ export interface RevokeKmsSigningKeyResponseSigningKeysItemPublicKey {
1557
+ kty?: string;
1558
+ kid?: string;
1559
+ alg?: string;
1560
+ use?: string;
1561
+ key_ops?: RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyKeyOpsList;
1562
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
1563
+ x5c?: RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyX5cList;
1564
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
1565
+ x5t_S256?: string;
1566
+ }
1567
+ export const RevokeKmsSigningKeyResponseSigningKeysItemPublicKey =
1568
+ /*@__PURE__*/ S.suspend(() =>
1569
+ S.Struct({
1570
+ kty: S.optional(S.String),
1571
+ kid: S.optional(S.String),
1572
+ alg: S.optional(S.String),
1573
+ use: S.optional(S.String),
1574
+ key_ops: S.optional(
1575
+ RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyKeyOpsList,
1576
+ ),
1577
+ x5c: S.optional(
1578
+ RevokeKmsSigningKeyResponseSigningKeysItemPublicKeyX5cList,
1579
+ ),
1580
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
1581
+ }),
1582
+ ).annotate({
1583
+ identifier: "RevokeKmsSigningKeyResponseSigningKeysItemPublicKey",
1584
+ }) as any as S.Schema<RevokeKmsSigningKeyResponseSigningKeysItemPublicKey>;
1585
+
1586
+ export interface RevokeKmsSigningKeyResponseSigningKeysItem {
1587
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
1588
+ keyId: string;
1589
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
1590
+ importKeyId?: string;
1591
+ issuerId: string;
1592
+ algorithm: string;
1593
+ status: RevokeKmsSigningKeyResponseSigningKeysItemStatus;
1594
+ publicKey?: RevokeKmsSigningKeyResponseSigningKeysItemPublicKey;
1595
+ publicKeyFingerprint?: string;
1596
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
1597
+ publicKeyPem?: string;
1598
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
1599
+ certificatePem?: string;
1600
+ createdAt: string;
1601
+ updatedAt: string;
1602
+ revokeAt?: string;
1603
+ activateAt?: string;
1604
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
1605
+ activatedAt?: string;
1606
+ }
1607
+ export const RevokeKmsSigningKeyResponseSigningKeysItem =
1608
+ /*@__PURE__*/ S.suspend(() =>
1609
+ S.Struct({
1610
+ keyId: S.String,
1611
+ importKeyId: S.optional(S.String),
1612
+ issuerId: S.String,
1613
+ algorithm: S.String,
1614
+ status: RevokeKmsSigningKeyResponseSigningKeysItemStatus,
1615
+ publicKey: S.optional(
1616
+ RevokeKmsSigningKeyResponseSigningKeysItemPublicKey,
1617
+ ),
1618
+ publicKeyFingerprint: S.optional(S.String),
1619
+ publicKeyPem: S.optional(S.String),
1620
+ certificatePem: S.optional(S.String),
1621
+ createdAt: S.String,
1622
+ updatedAt: S.String,
1623
+ revokeAt: S.optional(S.String),
1624
+ activateAt: S.optional(S.String),
1625
+ activatedAt: S.optional(S.String),
1626
+ }),
1627
+ ).annotate({
1628
+ identifier: "RevokeKmsSigningKeyResponseSigningKeysItem",
1629
+ }) as any as S.Schema<RevokeKmsSigningKeyResponseSigningKeysItem>;
1630
+
1631
+ export type RevokeKmsSigningKeyResponseSigningKeysList =
1632
+ Array<RevokeKmsSigningKeyResponseSigningKeysItem>;
1633
+ export const RevokeKmsSigningKeyResponseSigningKeysList = /*@__PURE__*/ S.Array(
1634
+ RevokeKmsSigningKeyResponseSigningKeysItem,
1635
+ ) as any as S.Schema<RevokeKmsSigningKeyResponseSigningKeysList>;
1636
+
1637
+ export type RevokeKmsSigningKeyResponsePoliciesItemCase0Kind = "project-grant";
1638
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase0Kind =
1639
+ /*@__PURE__*/ S.String;
1640
+
1641
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
1642
+ export type RevokeKmsSigningKeyResponsePoliciesItemCase0EnvironmentsList =
1643
+ Array<string>;
1644
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase0EnvironmentsList =
1645
+ /*@__PURE__*/ S.Array(
1646
+ S.String,
1647
+ ) as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesItemCase0EnvironmentsList>;
1648
+
1649
+ export type RevokeKmsSigningKeyResponsePoliciesItemCase0TokenClaimsMap = {
1650
+ [key: string]: unknown | undefined;
1651
+ };
1652
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase0TokenClaimsMap =
1653
+ /*@__PURE__*/ S.Record(
1654
+ S.String,
1655
+ S.Unknown,
1656
+ ) as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesItemCase0TokenClaimsMap>;
1657
+
1658
+ export interface RevokeKmsSigningKeyResponsePoliciesItemCase0 {
1659
+ kind: RevokeKmsSigningKeyResponsePoliciesItemCase0Kind;
1660
+ teamId: string;
1661
+ projectId: string;
1662
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
1663
+ environments: RevokeKmsSigningKeyResponsePoliciesItemCase0EnvironmentsList;
1664
+ tokenClaims?: RevokeKmsSigningKeyResponsePoliciesItemCase0TokenClaimsMap;
1665
+ createdAt: string;
1666
+ updatedAt: string;
1667
+ }
1668
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase0 =
1669
+ /*@__PURE__*/ S.suspend(() =>
1670
+ S.Struct({
1671
+ kind: RevokeKmsSigningKeyResponsePoliciesItemCase0Kind,
1672
+ teamId: S.String,
1673
+ projectId: S.String,
1674
+ environments:
1675
+ RevokeKmsSigningKeyResponsePoliciesItemCase0EnvironmentsList,
1676
+ tokenClaims: S.optional(
1677
+ RevokeKmsSigningKeyResponsePoliciesItemCase0TokenClaimsMap,
1678
+ ),
1679
+ createdAt: S.String,
1680
+ updatedAt: S.String,
1681
+ }),
1682
+ ).annotate({
1683
+ identifier: "RevokeKmsSigningKeyResponsePoliciesItemCase0",
1684
+ }) as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesItemCase0>;
1685
+
1686
+ export type RevokeKmsSigningKeyResponsePoliciesItemCase1Kind = "connex-grant";
1687
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase1Kind =
1688
+ /*@__PURE__*/ S.String;
1689
+
1690
+ export type RevokeKmsSigningKeyResponsePoliciesItemCase1TokenClaimsMap = {
1691
+ [key: string]: unknown | undefined;
1692
+ };
1693
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase1TokenClaimsMap =
1694
+ /*@__PURE__*/ S.Record(
1695
+ S.String,
1696
+ S.Unknown,
1697
+ ) as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesItemCase1TokenClaimsMap>;
1698
+
1699
+ export interface RevokeKmsSigningKeyResponsePoliciesItemCase1 {
1700
+ kind: RevokeKmsSigningKeyResponsePoliciesItemCase1Kind;
1701
+ clientId: string;
1702
+ tokenClaims?: RevokeKmsSigningKeyResponsePoliciesItemCase1TokenClaimsMap;
1703
+ createdAt: string;
1704
+ updatedAt: string;
1705
+ }
1706
+ export const RevokeKmsSigningKeyResponsePoliciesItemCase1 =
1707
+ /*@__PURE__*/ S.suspend(() =>
1708
+ S.Struct({
1709
+ kind: RevokeKmsSigningKeyResponsePoliciesItemCase1Kind,
1710
+ clientId: S.String,
1711
+ tokenClaims: S.optional(
1712
+ RevokeKmsSigningKeyResponsePoliciesItemCase1TokenClaimsMap,
1713
+ ),
1714
+ createdAt: S.String,
1715
+ updatedAt: S.String,
1716
+ }),
1717
+ ).annotate({
1718
+ identifier: "RevokeKmsSigningKeyResponsePoliciesItemCase1",
1719
+ }) as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesItemCase1>;
1720
+
1721
+ export type RevokeKmsSigningKeyResponsePoliciesItem =
1722
+ | RevokeKmsSigningKeyResponsePoliciesItemCase0
1723
+ | RevokeKmsSigningKeyResponsePoliciesItemCase1;
1724
+ export const RevokeKmsSigningKeyResponsePoliciesItem =
1725
+ /*@__PURE__*/ S.Unknown as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesItem>;
1726
+
1727
+ export type RevokeKmsSigningKeyResponsePoliciesList =
1728
+ Array<RevokeKmsSigningKeyResponsePoliciesItem>;
1729
+ export const RevokeKmsSigningKeyResponsePoliciesList = /*@__PURE__*/ S.Array(
1730
+ RevokeKmsSigningKeyResponsePoliciesItem,
1731
+ ) as any as S.Schema<RevokeKmsSigningKeyResponsePoliciesList>;
1732
+
1733
+ export interface RevokeKmsSigningKeyResponse {
1734
+ id: string;
1735
+ ownerId: string;
1736
+ name: string;
1737
+ algorithm: RevokeKmsSigningKeyResponseAlgorithm;
1738
+ origin: RevokeKmsSigningKeyResponseOrigin;
1739
+ managedBy?: string;
1740
+ claimsSchema?: RevokeKmsSigningKeyResponseClaimsSchemaMap;
1741
+ createdAt: string;
1742
+ updatedAt: string;
1743
+ signingKeys: RevokeKmsSigningKeyResponseSigningKeysList;
1744
+ policies: RevokeKmsSigningKeyResponsePoliciesList;
1745
+ }
1746
+ export const RevokeKmsSigningKeyResponse = /*@__PURE__*/ S.suspend(() =>
1747
+ S.Struct({
1748
+ id: S.String,
1749
+ ownerId: S.String,
1750
+ name: S.String,
1751
+ algorithm: RevokeKmsSigningKeyResponseAlgorithm,
1752
+ origin: RevokeKmsSigningKeyResponseOrigin,
1753
+ managedBy: S.optional(S.String),
1754
+ claimsSchema: S.optional(RevokeKmsSigningKeyResponseClaimsSchemaMap),
1755
+ createdAt: S.String,
1756
+ updatedAt: S.String,
1757
+ signingKeys: RevokeKmsSigningKeyResponseSigningKeysList,
1758
+ policies: RevokeKmsSigningKeyResponsePoliciesList,
1759
+ }),
1760
+ ).annotate({
1761
+ identifier: "RevokeKmsSigningKeyResponse",
1762
+ }) as any as S.Schema<RevokeKmsSigningKeyResponse>;
1763
+
1764
+ export interface SignKmsMessageRequest {
1765
+ /** The ID of the issuer. */
1766
+ issuerId: string;
1767
+ /** Base64-encoded message to be signed. */
1768
+ message: string;
1769
+ }
1770
+ export const SignKmsMessageRequest = /*@__PURE__*/ S.suspend(() =>
1771
+ S.Struct({
1772
+ issuerId: S.String.pipe(T.Label()),
1773
+ message: S.String,
1774
+ }).pipe(
1775
+ T.Http({
1776
+ method: "POST",
1777
+ uri: "/v1/kms/issuers/{issuerId}/sign/message",
1778
+ code: 200,
1779
+ }),
1780
+ ),
1781
+ ).annotate({
1782
+ identifier: "SignKmsMessageRequest",
1783
+ }) as any as S.Schema<SignKmsMessageRequest>;
1784
+
1785
+ /** JWS "crit" (Critical) Header Parameter */
1786
+ export type SignKmsMessageResponseSignatureHeaderCritList = Array<string>;
1787
+ export const SignKmsMessageResponseSignatureHeaderCritList =
1788
+ /*@__PURE__*/ S.Array(
1789
+ S.String,
1790
+ ) as any as S.Schema<SignKmsMessageResponseSignatureHeaderCritList>;
1791
+
1792
+ /** "x5c" (X.509 Certificate Chain) Header Parameter */
1793
+ export type SignKmsMessageResponseSignatureHeaderX5cList = Array<string>;
1794
+ export const SignKmsMessageResponseSignatureHeaderX5cList =
1795
+ /*@__PURE__*/ S.Array(
1796
+ S.String,
1797
+ ) as any as S.Schema<SignKmsMessageResponseSignatureHeaderX5cList>;
1798
+
1799
+ /** "jwk" (JSON Web Key) Header Parameter */
1800
+ export interface SignKmsMessageResponseSignatureHeaderJwk {
1801
+ /** RSA JWK "n" (Modulus) Parameter */
1802
+ n?: string;
1803
+ /** RSA JWK "e" (Exponent) Parameter */
1804
+ e?: string;
1805
+ /** JWK "kty" (Key Type) Parameter */
1806
+ kty?: string;
1807
+ /** - EC JWK "crv" (Curve) Parameter - OKP JWK "crv" (The Subtype of Key Pair) Parameter */
1808
+ crv?: string;
1809
+ /** - EC JWK "x" (X Coordinate) Parameter - OKP JWK "x" (The public key) Parameter */
1810
+ x?: string;
1811
+ /** EC JWK "y" (Y Coordinate) Parameter */
1812
+ y?: string;
1813
+ /** JWK "alg" (Algorithm) Parameter */
1814
+ alg?: string;
1815
+ /** AKP JWK "pub" (Public Key) Parameter */
1816
+ pub?: string;
1817
+ }
1818
+ export const SignKmsMessageResponseSignatureHeaderJwk = /*@__PURE__*/ S.suspend(
1819
+ () =>
1820
+ S.Struct({
1821
+ n: S.optional(S.String),
1822
+ e: S.optional(S.String),
1823
+ kty: S.optional(S.String),
1824
+ crv: S.optional(S.String),
1825
+ x: S.optional(S.String),
1826
+ y: S.optional(S.String),
1827
+ alg: S.optional(S.String),
1828
+ pub: S.optional(S.String),
1829
+ }),
1830
+ ).annotate({
1831
+ identifier: "SignKmsMessageResponseSignatureHeaderJwk",
1832
+ }) as any as S.Schema<SignKmsMessageResponseSignatureHeaderJwk>;
1833
+
1834
+ /** The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS Unprotected Header value is non- empty; otherwise, it MUST be absent. This value is represented as an unencoded JSON object, rather than as a string. These Header Parameter values are not integrity protected. */
1835
+ export interface SignKmsMessageResponseSignatureHeader {
1836
+ /** JWS "alg" (Algorithm) Header Parameter */
1837
+ alg?: string;
1838
+ /** This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}. */
1839
+ b64?: boolean;
1840
+ /** JWS "crit" (Critical) Header Parameter */
1841
+ crit?: SignKmsMessageResponseSignatureHeaderCritList;
1842
+ /** "kid" (Key ID) Header Parameter */
1843
+ kid?: string;
1844
+ /** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
1845
+ x5t?: string;
1846
+ /** "x5c" (X.509 Certificate Chain) Header Parameter */
1847
+ x5c?: SignKmsMessageResponseSignatureHeaderX5cList;
1848
+ /** "x5u" (X.509 URL) Header Parameter */
1849
+ x5u?: string;
1850
+ /** "jku" (JWK Set URL) Header Parameter */
1851
+ jku?: string;
1852
+ /** "jwk" (JSON Web Key) Header Parameter */
1853
+ jwk?: SignKmsMessageResponseSignatureHeaderJwk;
1854
+ /** "typ" (Type) Header Parameter */
1855
+ typ?: string;
1856
+ /** "cty" (Content Type) Header Parameter */
1857
+ cty?: string;
1858
+ }
1859
+ export const SignKmsMessageResponseSignatureHeader = /*@__PURE__*/ S.suspend(
1860
+ () =>
1861
+ S.Struct({
1862
+ alg: S.optional(S.String),
1863
+ b64: S.optional(S.Boolean),
1864
+ crit: S.optional(SignKmsMessageResponseSignatureHeaderCritList),
1865
+ kid: S.optional(S.String),
1866
+ x5t: S.optional(S.String),
1867
+ x5c: S.optional(SignKmsMessageResponseSignatureHeaderX5cList),
1868
+ x5u: S.optional(S.String),
1869
+ jku: S.optional(S.String),
1870
+ jwk: S.optional(SignKmsMessageResponseSignatureHeaderJwk),
1871
+ typ: S.optional(S.String),
1872
+ cty: S.optional(S.String),
1873
+ }),
1874
+ ).annotate({
1875
+ identifier: "SignKmsMessageResponseSignatureHeader",
1876
+ }) as any as S.Schema<SignKmsMessageResponseSignatureHeader>;
1877
+
1878
+ /** Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used. */
1879
+ export interface SignKmsMessageResponseSignature {
1880
+ payload: string;
1881
+ signature: string;
1882
+ /** The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS Unprotected Header value is non- empty; otherwise, it MUST be absent. This value is represented as an unencoded JSON object, rather than as a string. These Header Parameter values are not integrity protected. */
1883
+ header?: SignKmsMessageResponseSignatureHeader;
1884
+ /** The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWS Protected Header)) when the JWS Protected Header value is non-empty; otherwise, it MUST be absent. These Header Parameter values are integrity protected. */
1885
+ protected?: string;
1886
+ }
1887
+ export const SignKmsMessageResponseSignature = /*@__PURE__*/ S.suspend(() =>
1888
+ S.Struct({
1889
+ payload: S.String,
1890
+ signature: S.String,
1891
+ header: S.optional(SignKmsMessageResponseSignatureHeader),
1892
+ protected: S.optional(S.String),
1893
+ }),
1894
+ ).annotate({
1895
+ identifier: "SignKmsMessageResponseSignature",
1896
+ }) as any as S.Schema<SignKmsMessageResponseSignature>;
1897
+
1898
+ export interface SignKmsMessageResponse {
1899
+ /** Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used. */
1900
+ signature: SignKmsMessageResponseSignature;
1901
+ }
1902
+ export const SignKmsMessageResponse = /*@__PURE__*/ S.suspend(() =>
1903
+ S.Struct({
1904
+ signature: SignKmsMessageResponseSignature,
1905
+ }),
1906
+ ).annotate({
1907
+ identifier: "SignKmsMessageResponse",
1908
+ }) as any as S.Schema<SignKmsMessageResponse>;
1909
+
1910
+ export interface SignKmsTokenRequest {
1911
+ /** The ID of the issuer. */
1912
+ issuerId: string;
1913
+ /** The claims to include in the token. */
1914
+ claims?: unknown;
1915
+ /** Additional headers to include in the token. */
1916
+ headers?: unknown;
1917
+ /** The time-to-live for the token, in seconds. */
1918
+ ttl?: number | null;
1919
+ }
1920
+ export const SignKmsTokenRequest = /*@__PURE__*/ S.suspend(() =>
1921
+ S.Struct({
1922
+ issuerId: S.String.pipe(T.Label()),
1923
+ claims: S.optional(S.Unknown),
1924
+ headers: S.optional(S.Unknown),
1925
+ ttl: S.optional(S.NullOr(S.Number)),
1926
+ }).pipe(
1927
+ T.Http({
1928
+ method: "POST",
1929
+ uri: "/v1/kms/issuers/{issuerId}/sign/token",
1930
+ code: 200,
1931
+ }),
1932
+ ),
1933
+ ).annotate({
1934
+ identifier: "SignKmsTokenRequest",
1935
+ }) as any as S.Schema<SignKmsTokenRequest>;
1936
+
1937
+ export interface SignKmsTokenResponse {
1938
+ token: string;
1939
+ }
1940
+ export const SignKmsTokenResponse = /*@__PURE__*/ S.suspend(() =>
1941
+ S.Struct({
1942
+ token: S.String,
1943
+ }),
1944
+ ).annotate({
1945
+ identifier: "SignKmsTokenResponse",
1946
+ }) as any as S.Schema<SignKmsTokenResponse>;
1947
+
1948
+ /** A JSON Schema used to validate the resolved token claims when signing tokens for this issuer. Pass null to remove it. */
1949
+ export type UpdateKmsIssuerRequestClaimsSchemaMap = {
1950
+ [key: string]: unknown | undefined;
1951
+ };
1952
+ export const UpdateKmsIssuerRequestClaimsSchemaMap = /*@__PURE__*/ S.Record(
1953
+ S.String,
1954
+ S.Unknown,
1955
+ ) as any as S.Schema<UpdateKmsIssuerRequestClaimsSchemaMap>;
1956
+
1957
+ export interface UpdateKmsIssuerRequest {
1958
+ /** The ID of the issuer. */
1959
+ issuerId: string;
1960
+ /** The Team identifier to perform the request on behalf of. */
1961
+ teamId?: string;
1962
+ /** The Team slug to perform the request on behalf of. */
1963
+ slug?: string;
1964
+ /** The name of the issuer. */
1965
+ name?: string;
1966
+ /** A JSON Schema used to validate the resolved token claims when signing tokens for this issuer. Pass null to remove it. */
1967
+ claimsSchema?: UpdateKmsIssuerRequestClaimsSchemaMap | null;
1968
+ }
1969
+ export const UpdateKmsIssuerRequest = /*@__PURE__*/ S.suspend(() =>
1970
+ S.Struct({
1971
+ issuerId: S.String.pipe(T.Label()),
1972
+ teamId: S.optional(S.String.pipe(T.Query())),
1973
+ slug: S.optional(S.String.pipe(T.Query())),
1974
+ name: S.optional(S.String),
1975
+ claimsSchema: S.optional(S.NullOr(UpdateKmsIssuerRequestClaimsSchemaMap)),
1976
+ }).pipe(
1977
+ T.Http({ method: "PATCH", uri: "/v1/kms/issuers/{issuerId}", code: 200 }),
1978
+ ),
1979
+ ).annotate({
1980
+ identifier: "UpdateKmsIssuerRequest",
1981
+ }) as any as S.Schema<UpdateKmsIssuerRequest>;
1982
+
1983
+ export type UpdateKmsIssuerResponseAlgorithm =
1984
+ | "ES256"
1985
+ | "ES384"
1986
+ | "ES512"
1987
+ | "EdDSA"
1988
+ | "PS256"
1989
+ | "PS384"
1990
+ | "PS512"
1991
+ | "RS256"
1992
+ | "RS384"
1993
+ | "RS512";
1994
+ export const UpdateKmsIssuerResponseAlgorithm = /*@__PURE__*/ S.String;
1995
+
1996
+ export type UpdateKmsIssuerResponseOrigin = "external" | "vercel";
1997
+ export const UpdateKmsIssuerResponseOrigin = /*@__PURE__*/ S.String;
1998
+
1999
+ export type UpdateKmsIssuerResponseClaimsSchemaMap = {
2000
+ [key: string]: unknown | undefined;
2001
+ };
2002
+ export const UpdateKmsIssuerResponseClaimsSchemaMap = /*@__PURE__*/ S.Record(
2003
+ S.String,
2004
+ S.Unknown,
2005
+ ) as any as S.Schema<UpdateKmsIssuerResponseClaimsSchemaMap>;
2006
+
2007
+ export type UpdateKmsIssuerResponseSigningKeysItemStatus =
2008
+ | "active"
2009
+ | "pending"
2010
+ | "revoking";
2011
+ export const UpdateKmsIssuerResponseSigningKeysItemStatus =
2012
+ /*@__PURE__*/ S.String;
2013
+
2014
+ export type UpdateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList =
2015
+ Array<string>;
2016
+ export const UpdateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList =
2017
+ /*@__PURE__*/ S.Array(
2018
+ S.String,
2019
+ ) as any as S.Schema<UpdateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList>;
2020
+
2021
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
2022
+ export type UpdateKmsIssuerResponseSigningKeysItemPublicKeyX5cList =
2023
+ Array<string>;
2024
+ export const UpdateKmsIssuerResponseSigningKeysItemPublicKeyX5cList =
2025
+ /*@__PURE__*/ S.Array(
2026
+ S.String,
2027
+ ) as any as S.Schema<UpdateKmsIssuerResponseSigningKeysItemPublicKeyX5cList>;
2028
+
2029
+ export interface UpdateKmsIssuerResponseSigningKeysItemPublicKey {
2030
+ kty?: string;
2031
+ kid?: string;
2032
+ alg?: string;
2033
+ use?: string;
2034
+ key_ops?: UpdateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList;
2035
+ /** The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`. */
2036
+ x5c?: UpdateKmsIssuerResponseSigningKeysItemPublicKeyX5cList;
2037
+ /** The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9). */
2038
+ x5t_S256?: string;
2039
+ }
2040
+ export const UpdateKmsIssuerResponseSigningKeysItemPublicKey =
2041
+ /*@__PURE__*/ S.suspend(() =>
2042
+ S.Struct({
2043
+ kty: S.optional(S.String),
2044
+ kid: S.optional(S.String),
2045
+ alg: S.optional(S.String),
2046
+ use: S.optional(S.String),
2047
+ key_ops: S.optional(
2048
+ UpdateKmsIssuerResponseSigningKeysItemPublicKeyKeyOpsList,
2049
+ ),
2050
+ x5c: S.optional(UpdateKmsIssuerResponseSigningKeysItemPublicKeyX5cList),
2051
+ x5t_S256: S.optional(S.String.pipe(T.Body("x5t#S256"))),
2052
+ }),
2053
+ ).annotate({
2054
+ identifier: "UpdateKmsIssuerResponseSigningKeysItemPublicKey",
2055
+ }) as any as S.Schema<UpdateKmsIssuerResponseSigningKeysItemPublicKey>;
2056
+
2057
+ export interface UpdateKmsIssuerResponseSigningKeysItem {
2058
+ /** The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints. */
2059
+ keyId: string;
2060
+ /** The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys. */
2061
+ importKeyId?: string;
2062
+ issuerId: string;
2063
+ algorithm: string;
2064
+ status: UpdateKmsIssuerResponseSigningKeysItemStatus;
2065
+ publicKey?: UpdateKmsIssuerResponseSigningKeysItemPublicKey;
2066
+ publicKeyFingerprint?: string;
2067
+ /** The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it. */
2068
+ publicKeyPem?: string;
2069
+ /** The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored. */
2070
+ certificatePem?: string;
2071
+ createdAt: string;
2072
+ updatedAt: string;
2073
+ revokeAt?: string;
2074
+ activateAt?: string;
2075
+ /** When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field). */
2076
+ activatedAt?: string;
2077
+ }
2078
+ export const UpdateKmsIssuerResponseSigningKeysItem = /*@__PURE__*/ S.suspend(
2079
+ () =>
2080
+ S.Struct({
2081
+ keyId: S.String,
2082
+ importKeyId: S.optional(S.String),
2083
+ issuerId: S.String,
2084
+ algorithm: S.String,
2085
+ status: UpdateKmsIssuerResponseSigningKeysItemStatus,
2086
+ publicKey: S.optional(UpdateKmsIssuerResponseSigningKeysItemPublicKey),
2087
+ publicKeyFingerprint: S.optional(S.String),
2088
+ publicKeyPem: S.optional(S.String),
2089
+ certificatePem: S.optional(S.String),
2090
+ createdAt: S.String,
2091
+ updatedAt: S.String,
2092
+ revokeAt: S.optional(S.String),
2093
+ activateAt: S.optional(S.String),
2094
+ activatedAt: S.optional(S.String),
2095
+ }),
2096
+ ).annotate({
2097
+ identifier: "UpdateKmsIssuerResponseSigningKeysItem",
2098
+ }) as any as S.Schema<UpdateKmsIssuerResponseSigningKeysItem>;
2099
+
2100
+ export type UpdateKmsIssuerResponseSigningKeysList =
2101
+ Array<UpdateKmsIssuerResponseSigningKeysItem>;
2102
+ export const UpdateKmsIssuerResponseSigningKeysList = /*@__PURE__*/ S.Array(
2103
+ UpdateKmsIssuerResponseSigningKeysItem,
2104
+ ) as any as S.Schema<UpdateKmsIssuerResponseSigningKeysList>;
2105
+
2106
+ export type UpdateKmsIssuerResponsePoliciesItemCase0Kind = "project-grant";
2107
+ export const UpdateKmsIssuerResponsePoliciesItemCase0Kind =
2108
+ /*@__PURE__*/ S.String;
2109
+
2110
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
2111
+ export type UpdateKmsIssuerResponsePoliciesItemCase0EnvironmentsList =
2112
+ Array<string>;
2113
+ export const UpdateKmsIssuerResponsePoliciesItemCase0EnvironmentsList =
2114
+ /*@__PURE__*/ S.Array(
2115
+ S.String,
2116
+ ) as any as S.Schema<UpdateKmsIssuerResponsePoliciesItemCase0EnvironmentsList>;
2117
+
2118
+ export type UpdateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap = {
2119
+ [key: string]: unknown | undefined;
2120
+ };
2121
+ export const UpdateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap =
2122
+ /*@__PURE__*/ S.Record(
2123
+ S.String,
2124
+ S.Unknown,
2125
+ ) as any as S.Schema<UpdateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap>;
2126
+
2127
+ export interface UpdateKmsIssuerResponsePoliciesItemCase0 {
2128
+ kind: UpdateKmsIssuerResponsePoliciesItemCase0Kind;
2129
+ teamId: string;
2130
+ projectId: string;
2131
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
2132
+ environments: UpdateKmsIssuerResponsePoliciesItemCase0EnvironmentsList;
2133
+ tokenClaims?: UpdateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap;
2134
+ createdAt: string;
2135
+ updatedAt: string;
2136
+ }
2137
+ export const UpdateKmsIssuerResponsePoliciesItemCase0 = /*@__PURE__*/ S.suspend(
2138
+ () =>
2139
+ S.Struct({
2140
+ kind: UpdateKmsIssuerResponsePoliciesItemCase0Kind,
2141
+ teamId: S.String,
2142
+ projectId: S.String,
2143
+ environments: UpdateKmsIssuerResponsePoliciesItemCase0EnvironmentsList,
2144
+ tokenClaims: S.optional(
2145
+ UpdateKmsIssuerResponsePoliciesItemCase0TokenClaimsMap,
2146
+ ),
2147
+ createdAt: S.String,
2148
+ updatedAt: S.String,
2149
+ }),
2150
+ ).annotate({
2151
+ identifier: "UpdateKmsIssuerResponsePoliciesItemCase0",
2152
+ }) as any as S.Schema<UpdateKmsIssuerResponsePoliciesItemCase0>;
2153
+
2154
+ export type UpdateKmsIssuerResponsePoliciesItemCase1Kind = "connex-grant";
2155
+ export const UpdateKmsIssuerResponsePoliciesItemCase1Kind =
2156
+ /*@__PURE__*/ S.String;
2157
+
2158
+ export type UpdateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap = {
2159
+ [key: string]: unknown | undefined;
2160
+ };
2161
+ export const UpdateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap =
2162
+ /*@__PURE__*/ S.Record(
2163
+ S.String,
2164
+ S.Unknown,
2165
+ ) as any as S.Schema<UpdateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap>;
2166
+
2167
+ export interface UpdateKmsIssuerResponsePoliciesItemCase1 {
2168
+ kind: UpdateKmsIssuerResponsePoliciesItemCase1Kind;
2169
+ clientId: string;
2170
+ tokenClaims?: UpdateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap;
2171
+ createdAt: string;
2172
+ updatedAt: string;
2173
+ }
2174
+ export const UpdateKmsIssuerResponsePoliciesItemCase1 = /*@__PURE__*/ S.suspend(
2175
+ () =>
2176
+ S.Struct({
2177
+ kind: UpdateKmsIssuerResponsePoliciesItemCase1Kind,
2178
+ clientId: S.String,
2179
+ tokenClaims: S.optional(
2180
+ UpdateKmsIssuerResponsePoliciesItemCase1TokenClaimsMap,
2181
+ ),
2182
+ createdAt: S.String,
2183
+ updatedAt: S.String,
2184
+ }),
2185
+ ).annotate({
2186
+ identifier: "UpdateKmsIssuerResponsePoliciesItemCase1",
2187
+ }) as any as S.Schema<UpdateKmsIssuerResponsePoliciesItemCase1>;
2188
+
2189
+ export type UpdateKmsIssuerResponsePoliciesItem =
2190
+ | UpdateKmsIssuerResponsePoliciesItemCase0
2191
+ | UpdateKmsIssuerResponsePoliciesItemCase1;
2192
+ export const UpdateKmsIssuerResponsePoliciesItem =
2193
+ /*@__PURE__*/ S.Unknown as any as S.Schema<UpdateKmsIssuerResponsePoliciesItem>;
2194
+
2195
+ export type UpdateKmsIssuerResponsePoliciesList =
2196
+ Array<UpdateKmsIssuerResponsePoliciesItem>;
2197
+ export const UpdateKmsIssuerResponsePoliciesList = /*@__PURE__*/ S.Array(
2198
+ UpdateKmsIssuerResponsePoliciesItem,
2199
+ ) as any as S.Schema<UpdateKmsIssuerResponsePoliciesList>;
2200
+
2201
+ export interface UpdateKmsIssuerResponse {
2202
+ id: string;
2203
+ ownerId: string;
2204
+ name: string;
2205
+ algorithm: UpdateKmsIssuerResponseAlgorithm;
2206
+ origin: UpdateKmsIssuerResponseOrigin;
2207
+ managedBy?: string;
2208
+ claimsSchema?: UpdateKmsIssuerResponseClaimsSchemaMap;
2209
+ createdAt: string;
2210
+ updatedAt: string;
2211
+ signingKeys: UpdateKmsIssuerResponseSigningKeysList;
2212
+ policies: UpdateKmsIssuerResponsePoliciesList;
2213
+ }
2214
+ export const UpdateKmsIssuerResponse = /*@__PURE__*/ S.suspend(() =>
2215
+ S.Struct({
2216
+ id: S.String,
2217
+ ownerId: S.String,
2218
+ name: S.String,
2219
+ algorithm: UpdateKmsIssuerResponseAlgorithm,
2220
+ origin: UpdateKmsIssuerResponseOrigin,
2221
+ managedBy: S.optional(S.String),
2222
+ claimsSchema: S.optional(UpdateKmsIssuerResponseClaimsSchemaMap),
2223
+ createdAt: S.String,
2224
+ updatedAt: S.String,
2225
+ signingKeys: UpdateKmsIssuerResponseSigningKeysList,
2226
+ policies: UpdateKmsIssuerResponsePoliciesList,
2227
+ }),
2228
+ ).annotate({
2229
+ identifier: "UpdateKmsIssuerResponse",
2230
+ }) as any as S.Schema<UpdateKmsIssuerResponse>;
2231
+
2232
+ /** The issuer policy kind. */
2233
+ export type UpdateKmsIssuerPolicyRequestKind = "project-grant";
2234
+ export const UpdateKmsIssuerPolicyRequestKind = /*@__PURE__*/ S.String;
2235
+
2236
+ /** The environments for the project grant policy. Each entry is a system environment (production, preview, development) or a custom environment ID (env_...). */
2237
+ export type UpdateKmsIssuerPolicyRequestEnvironmentsList = Array<string>;
2238
+ export const UpdateKmsIssuerPolicyRequestEnvironmentsList =
2239
+ /*@__PURE__*/ S.Array(
2240
+ S.String,
2241
+ ) as any as S.Schema<UpdateKmsIssuerPolicyRequestEnvironmentsList>;
2242
+
2243
+ /** The claims that KMS should include in signed JWTs for this policy. Pass null to remove them. */
2244
+ export type UpdateKmsIssuerPolicyRequestTokenClaimsMap = {
2245
+ [key: string]: unknown | undefined;
2246
+ };
2247
+ export const UpdateKmsIssuerPolicyRequestTokenClaimsMap =
2248
+ /*@__PURE__*/ S.Record(
2249
+ S.String,
2250
+ S.Unknown,
2251
+ ) as any as S.Schema<UpdateKmsIssuerPolicyRequestTokenClaimsMap>;
2252
+
2253
+ export interface UpdateKmsIssuerPolicyRequest {
2254
+ /** The ID of the issuer. */
2255
+ issuerId: string;
2256
+ /** The issuer policy kind. */
2257
+ kind: UpdateKmsIssuerPolicyRequestKind | (string & {});
2258
+ /** The policy identifier. */
2259
+ policyKey: string;
2260
+ /** The Team identifier to perform the request on behalf of. */
2261
+ teamId?: string;
2262
+ /** The Team slug to perform the request on behalf of. */
2263
+ slug?: string;
2264
+ /** The environments for the project grant policy. Each entry is a system environment (production, preview, development) or a custom environment ID (env_...). */
2265
+ environments?: UpdateKmsIssuerPolicyRequestEnvironmentsList;
2266
+ /** The claims that KMS should include in signed JWTs for this policy. Pass null to remove them. */
2267
+ tokenClaims?: UpdateKmsIssuerPolicyRequestTokenClaimsMap | null;
2268
+ }
2269
+ export const UpdateKmsIssuerPolicyRequest = /*@__PURE__*/ S.suspend(() =>
2270
+ S.Struct({
2271
+ issuerId: S.String.pipe(T.Label()),
2272
+ kind: UpdateKmsIssuerPolicyRequestKind.pipe(T.Label()),
2273
+ policyKey: S.String.pipe(T.Label()),
2274
+ teamId: S.optional(S.String.pipe(T.Query())),
2275
+ slug: S.optional(S.String.pipe(T.Query())),
2276
+ environments: S.optional(UpdateKmsIssuerPolicyRequestEnvironmentsList),
2277
+ tokenClaims: S.optional(
2278
+ S.NullOr(UpdateKmsIssuerPolicyRequestTokenClaimsMap),
2279
+ ),
2280
+ }).pipe(
2281
+ T.Http({
2282
+ method: "PATCH",
2283
+ uri: "/v1/kms/issuers/{issuerId}/policies/{kind}/{policyKey}",
2284
+ code: 200,
2285
+ }),
2286
+ ),
2287
+ ).annotate({
2288
+ identifier: "UpdateKmsIssuerPolicyRequest",
2289
+ }) as any as S.Schema<UpdateKmsIssuerPolicyRequest>;
2290
+
2291
+ export type UpdateKmsIssuerPolicyResponseBodyCase0Kind = "project-grant";
2292
+ export const UpdateKmsIssuerPolicyResponseBodyCase0Kind =
2293
+ /*@__PURE__*/ S.String;
2294
+
2295
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
2296
+ export type UpdateKmsIssuerPolicyResponseBodyCase0EnvironmentsList =
2297
+ Array<string>;
2298
+ export const UpdateKmsIssuerPolicyResponseBodyCase0EnvironmentsList =
2299
+ /*@__PURE__*/ S.Array(
2300
+ S.String,
2301
+ ) as any as S.Schema<UpdateKmsIssuerPolicyResponseBodyCase0EnvironmentsList>;
2302
+
2303
+ export type UpdateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap = {
2304
+ [key: string]: unknown | undefined;
2305
+ };
2306
+ export const UpdateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap =
2307
+ /*@__PURE__*/ S.Record(
2308
+ S.String,
2309
+ S.Unknown,
2310
+ ) as any as S.Schema<UpdateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap>;
2311
+
2312
+ export interface UpdateKmsIssuerPolicyResponseBodyCase0 {
2313
+ kind: UpdateKmsIssuerPolicyResponseBodyCase0Kind;
2314
+ teamId: string;
2315
+ projectId: string;
2316
+ /** Environments whose OIDC tokens this grant authorizes. Each entry is either a system environment slug (`production`, `preview`, `development`) or a custom environment ID (prefixed `env_`). Custom environments are matched against the token's `custom_environment_id` claim (the stable ID); system environments against its `environment` claim. */
2317
+ environments: UpdateKmsIssuerPolicyResponseBodyCase0EnvironmentsList;
2318
+ tokenClaims?: UpdateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap;
2319
+ createdAt: string;
2320
+ updatedAt: string;
2321
+ }
2322
+ export const UpdateKmsIssuerPolicyResponseBodyCase0 = /*@__PURE__*/ S.suspend(
2323
+ () =>
2324
+ S.Struct({
2325
+ kind: UpdateKmsIssuerPolicyResponseBodyCase0Kind,
2326
+ teamId: S.String,
2327
+ projectId: S.String,
2328
+ environments: UpdateKmsIssuerPolicyResponseBodyCase0EnvironmentsList,
2329
+ tokenClaims: S.optional(
2330
+ UpdateKmsIssuerPolicyResponseBodyCase0TokenClaimsMap,
2331
+ ),
2332
+ createdAt: S.String,
2333
+ updatedAt: S.String,
2334
+ }),
2335
+ ).annotate({
2336
+ identifier: "UpdateKmsIssuerPolicyResponseBodyCase0",
2337
+ }) as any as S.Schema<UpdateKmsIssuerPolicyResponseBodyCase0>;
2338
+
2339
+ export type UpdateKmsIssuerPolicyResponseBodyCase1Kind = "connex-grant";
2340
+ export const UpdateKmsIssuerPolicyResponseBodyCase1Kind =
2341
+ /*@__PURE__*/ S.String;
2342
+
2343
+ export type UpdateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap = {
2344
+ [key: string]: unknown | undefined;
2345
+ };
2346
+ export const UpdateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap =
2347
+ /*@__PURE__*/ S.Record(
2348
+ S.String,
2349
+ S.Unknown,
2350
+ ) as any as S.Schema<UpdateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap>;
2351
+
2352
+ export interface UpdateKmsIssuerPolicyResponseBodyCase1 {
2353
+ kind: UpdateKmsIssuerPolicyResponseBodyCase1Kind;
2354
+ clientId: string;
2355
+ tokenClaims?: UpdateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap;
2356
+ createdAt: string;
2357
+ updatedAt: string;
2358
+ }
2359
+ export const UpdateKmsIssuerPolicyResponseBodyCase1 = /*@__PURE__*/ S.suspend(
2360
+ () =>
2361
+ S.Struct({
2362
+ kind: UpdateKmsIssuerPolicyResponseBodyCase1Kind,
2363
+ clientId: S.String,
2364
+ tokenClaims: S.optional(
2365
+ UpdateKmsIssuerPolicyResponseBodyCase1TokenClaimsMap,
2366
+ ),
2367
+ createdAt: S.String,
2368
+ updatedAt: S.String,
2369
+ }),
2370
+ ).annotate({
2371
+ identifier: "UpdateKmsIssuerPolicyResponseBodyCase1",
2372
+ }) as any as S.Schema<UpdateKmsIssuerPolicyResponseBodyCase1>;
2373
+
2374
+ export type UpdateKmsIssuerPolicyResponseBody =
2375
+ | UpdateKmsIssuerPolicyResponseBodyCase0
2376
+ | UpdateKmsIssuerPolicyResponseBodyCase1;
2377
+ export const UpdateKmsIssuerPolicyResponseBody =
2378
+ /*@__PURE__*/ S.Unknown as any as S.Schema<UpdateKmsIssuerPolicyResponseBody>;
2379
+
2380
+ export type UpdateKmsIssuerPolicyResponse = UpdateKmsIssuerPolicyResponseBody;
2381
+ export const UpdateKmsIssuerPolicyResponse = /*@__PURE__*/ S.suspend(() =>
2382
+ UpdateKmsIssuerPolicyResponseBody.pipe(T.RawResponseRoot()),
2383
+ ).annotate({
2384
+ identifier: "UpdateKmsIssuerPolicyResponse",
2385
+ }) as any as S.Schema<UpdateKmsIssuerPolicyResponse>;
2386
+
2387
+ export type ActivateKmsSigningKeyError =
2388
+ | BadRequest
2389
+ | Forbidden
2390
+ | NotFound
2391
+ | Conflict
2392
+ | VercelOpError;
2393
+ /** Activate a signing key Activate a pending signing key so the issuer starts signing with it. */
2394
+ export const activateKmsSigningKey: API.OperationMethod<
2395
+ ActivateKmsSigningKeyRequest,
2396
+ ActivateKmsSigningKeyResponse,
2397
+ ActivateKmsSigningKeyError,
2398
+ VercelOpContext
2399
+ > = /*@__PURE__*/ API.make(() => ({
2400
+ input: ActivateKmsSigningKeyRequest,
2401
+ output: ActivateKmsSigningKeyResponse,
2402
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2403
+ protocol: VercelProtocol,
2404
+ retry: Retry.Retry,
2405
+ }));
2406
+
2407
+ export type CreateKmsIssuerError =
2408
+ | BadRequest
2409
+ | Forbidden
2410
+ | NotFound
2411
+ | VercelOpError;
2412
+ /** Create an issuer Create a new KMS issuer for the authenticated team. An issuer owns the asymmetric signing keys that are used to sign tokens and messages. */
2413
+ export const createKmsIssuer: API.OperationMethod<
2414
+ CreateKmsIssuerRequest,
2415
+ CreateKmsIssuerResponse,
2416
+ CreateKmsIssuerError,
2417
+ VercelOpContext
2418
+ > = /*@__PURE__*/ API.make(() => ({
2419
+ input: CreateKmsIssuerRequest,
2420
+ output: CreateKmsIssuerResponse,
2421
+ errors: [BadRequest, Forbidden, NotFound],
2422
+ protocol: VercelProtocol,
2423
+ retry: Retry.Retry,
2424
+ }));
2425
+
2426
+ export type CreateKmsIssuerPolicyError =
2427
+ | BadRequest
2428
+ | Forbidden
2429
+ | NotFound
2430
+ | VercelOpError;
2431
+ /** Create an issuer policy Attach a policy to a KMS issuer that grants a project's deployments permission to sign with it. */
2432
+ export const createKmsIssuerPolicy: API.OperationMethod<
2433
+ CreateKmsIssuerPolicyRequest,
2434
+ CreateKmsIssuerPolicyResponse,
2435
+ CreateKmsIssuerPolicyError,
2436
+ VercelOpContext
2437
+ > = /*@__PURE__*/ API.make(() => ({
2438
+ input: CreateKmsIssuerPolicyRequest,
2439
+ output: CreateKmsIssuerPolicyResponse,
2440
+ errors: [BadRequest, Forbidden, NotFound],
2441
+ protocol: VercelProtocol,
2442
+ retry: Retry.Retry,
2443
+ }));
2444
+
2445
+ export type CreateKmsSigningKeyError =
2446
+ | BadRequest
2447
+ | Forbidden
2448
+ | NotFound
2449
+ | Conflict
2450
+ | VercelOpError;
2451
+ /** Create a signing key Create a new signing key for a KMS issuer. Depending on the activation mode, the key is activated automatically once its public key has propagated, or manually via the activate endpoint. */
2452
+ export const createKmsSigningKey: API.OperationMethod<
2453
+ CreateKmsSigningKeyRequest,
2454
+ CreateKmsSigningKeyResponse,
2455
+ CreateKmsSigningKeyError,
2456
+ VercelOpContext
2457
+ > = /*@__PURE__*/ API.make(() => ({
2458
+ input: CreateKmsSigningKeyRequest,
2459
+ output: CreateKmsSigningKeyResponse,
2460
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2461
+ protocol: VercelProtocol,
2462
+ retry: Retry.Retry,
2463
+ }));
2464
+
2465
+ export type DeleteKmsIssuerError =
2466
+ | BadRequest
2467
+ | Forbidden
2468
+ | NotFound
2469
+ | VercelOpError;
2470
+ /** Delete an issuer Delete a KMS issuer and its signing keys. */
2471
+ export const deleteKmsIssuer: API.OperationMethod<
2472
+ DeleteKmsIssuerRequest,
2473
+ DeleteKmsIssuerResponse,
2474
+ DeleteKmsIssuerError,
2475
+ VercelOpContext
2476
+ > = /*@__PURE__*/ API.make(() => ({
2477
+ input: DeleteKmsIssuerRequest,
2478
+ output: DeleteKmsIssuerResponse,
2479
+ errors: [BadRequest, Forbidden, NotFound],
2480
+ protocol: VercelProtocol,
2481
+ retry: Retry.Retry,
2482
+ }));
2483
+
2484
+ export type DeleteKmsIssuerPolicyError =
2485
+ | BadRequest
2486
+ | Forbidden
2487
+ | NotFound
2488
+ | VercelOpError;
2489
+ /** Delete an issuer policy Remove a policy from a KMS issuer. */
2490
+ export const deleteKmsIssuerPolicy: API.OperationMethod<
2491
+ DeleteKmsIssuerPolicyRequest,
2492
+ DeleteKmsIssuerPolicyResponse,
2493
+ DeleteKmsIssuerPolicyError,
2494
+ VercelOpContext
2495
+ > = /*@__PURE__*/ API.make(() => ({
2496
+ input: DeleteKmsIssuerPolicyRequest,
2497
+ output: DeleteKmsIssuerPolicyResponse,
2498
+ errors: [BadRequest, Forbidden, NotFound],
2499
+ protocol: VercelProtocol,
2500
+ retry: Retry.Retry,
2501
+ }));
2502
+
2503
+ export type GetKmsIssuerError =
2504
+ | BadRequest
2505
+ | Forbidden
2506
+ | NotFound
2507
+ | VercelOpError;
2508
+ /** Get an issuer Retrieve a single KMS issuer by its ID. Accepts either a team bearer token (existing path) or an OIDC token authorized by one of the issuer's policies (e.g. a connex-grant token). The OIDC path returns the issuer without policies, since a policy token only proves signing access, not management access. */
2509
+ export const getKmsIssuer: API.OperationMethod<
2510
+ GetKmsIssuerRequest,
2511
+ GetKmsIssuerResponse,
2512
+ GetKmsIssuerError,
2513
+ VercelOpContext
2514
+ > = /*@__PURE__*/ API.make(() => ({
2515
+ input: GetKmsIssuerRequest,
2516
+ output: GetKmsIssuerResponse,
2517
+ errors: [BadRequest, Forbidden, NotFound],
2518
+ protocol: VercelProtocol,
2519
+ retry: Retry.Retry,
2520
+ }));
2521
+
2522
+ export type ListKmsIssuersError = BadRequest | Forbidden | VercelOpError;
2523
+ /** List issuers Retrieve the list of KMS issuers that belong to the authenticated team. The results are paginated. */
2524
+ export const listKmsIssuers: API.OperationMethod<
2525
+ ListKmsIssuersRequest,
2526
+ ListKmsIssuersResponse,
2527
+ ListKmsIssuersError,
2528
+ VercelOpContext
2529
+ > = /*@__PURE__*/ API.make(() => ({
2530
+ input: ListKmsIssuersRequest,
2531
+ output: ListKmsIssuersResponse,
2532
+ errors: [BadRequest, Forbidden],
2533
+ protocol: VercelProtocol,
2534
+ retry: Retry.Retry,
2535
+ }));
2536
+
2537
+ export type RevokeKmsSigningKeyError =
2538
+ | BadRequest
2539
+ | Forbidden
2540
+ | NotFound
2541
+ | Conflict
2542
+ | VercelOpError;
2543
+ /** Revoke a signing key Immediately revoke a signing key that is already scheduled for revocation. */
2544
+ export const revokeKmsSigningKey: API.OperationMethod<
2545
+ RevokeKmsSigningKeyRequest,
2546
+ RevokeKmsSigningKeyResponse,
2547
+ RevokeKmsSigningKeyError,
2548
+ VercelOpContext
2549
+ > = /*@__PURE__*/ API.make(() => ({
2550
+ input: RevokeKmsSigningKeyRequest,
2551
+ output: RevokeKmsSigningKeyResponse,
2552
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2553
+ protocol: VercelProtocol,
2554
+ retry: Retry.Retry,
2555
+ }));
2556
+
2557
+ export type SignKmsMessageError =
2558
+ | BadRequest
2559
+ | Forbidden
2560
+ | NotFound
2561
+ | VercelOpError;
2562
+ /** Sign a message Sign a raw message with a KMS issuer's active signing key. Authenticate the request with a Vercel OIDC token in the `Authorization: Bearer` header; the issuer's policies decide which workloads are allowed to sign. */
2563
+ export const signKmsMessage: API.OperationMethod<
2564
+ SignKmsMessageRequest,
2565
+ SignKmsMessageResponse,
2566
+ SignKmsMessageError,
2567
+ VercelOpContext
2568
+ > = /*@__PURE__*/ API.make(() => ({
2569
+ input: SignKmsMessageRequest,
2570
+ output: SignKmsMessageResponse,
2571
+ errors: [BadRequest, Forbidden, NotFound],
2572
+ protocol: VercelProtocol,
2573
+ retry: Retry.Retry,
2574
+ }));
2575
+
2576
+ export type SignKmsTokenError =
2577
+ | BadRequest
2578
+ | Forbidden
2579
+ | NotFound
2580
+ | VercelOpError;
2581
+ /** Sign a token Sign a JWT with a KMS issuer's active signing key. Authenticate the request with a Vercel OIDC token in the `Authorization: Bearer` header; the issuer's policies decide which workloads are allowed to sign. */
2582
+ export const signKmsToken: API.OperationMethod<
2583
+ SignKmsTokenRequest,
2584
+ SignKmsTokenResponse,
2585
+ SignKmsTokenError,
2586
+ VercelOpContext
2587
+ > = /*@__PURE__*/ API.make(() => ({
2588
+ input: SignKmsTokenRequest,
2589
+ output: SignKmsTokenResponse,
2590
+ errors: [BadRequest, Forbidden, NotFound],
2591
+ protocol: VercelProtocol,
2592
+ retry: Retry.Retry,
2593
+ }));
2594
+
2595
+ export type UpdateKmsIssuerError =
2596
+ | BadRequest
2597
+ | Forbidden
2598
+ | NotFound
2599
+ | VercelOpError;
2600
+ /** Update an issuer Update a KMS issuer's name or claims schema. */
2601
+ export const updateKmsIssuer: API.OperationMethod<
2602
+ UpdateKmsIssuerRequest,
2603
+ UpdateKmsIssuerResponse,
2604
+ UpdateKmsIssuerError,
2605
+ VercelOpContext
2606
+ > = /*@__PURE__*/ API.make(() => ({
2607
+ input: UpdateKmsIssuerRequest,
2608
+ output: UpdateKmsIssuerResponse,
2609
+ errors: [BadRequest, Forbidden, NotFound],
2610
+ protocol: VercelProtocol,
2611
+ retry: Retry.Retry,
2612
+ }));
2613
+
2614
+ export type UpdateKmsIssuerPolicyError =
2615
+ | BadRequest
2616
+ | Forbidden
2617
+ | NotFound
2618
+ | VercelOpError;
2619
+ /** Update an issuer policy Update an existing KMS issuer policy's environments or token claims. */
2620
+ export const updateKmsIssuerPolicy: API.OperationMethod<
2621
+ UpdateKmsIssuerPolicyRequest,
2622
+ UpdateKmsIssuerPolicyResponse,
2623
+ UpdateKmsIssuerPolicyError,
2624
+ VercelOpContext
2625
+ > = /*@__PURE__*/ API.make(() => ({
2626
+ input: UpdateKmsIssuerPolicyRequest,
2627
+ output: UpdateKmsIssuerPolicyResponse,
2628
+ errors: [BadRequest, Forbidden, NotFound],
2629
+ protocol: VercelProtocol,
2630
+ retry: Retry.Retry,
2631
+ }));