@distilled.cloud/vercel 0.0.0 → 1.0.0-rc.10

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 (246) hide show
  1. package/LICENSE +201 -0
  2. package/lib/credentials.d.ts +21 -0
  3. package/lib/credentials.d.ts.map +1 -0
  4. package/lib/credentials.js +40 -0
  5. package/lib/credentials.js.map +1 -0
  6. package/lib/errors.d.ts +80 -0
  7. package/lib/errors.d.ts.map +1 -0
  8. package/lib/errors.js +50 -0
  9. package/lib/errors.js.map +1 -0
  10. package/lib/index.d.ts +15 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +15 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/protocol.d.ts +18 -0
  15. package/lib/protocol.d.ts.map +1 -0
  16. package/lib/protocol.js +69 -0
  17. package/lib/protocol.js.map +1 -0
  18. package/lib/retry.d.ts +54 -0
  19. package/lib/retry.d.ts.map +1 -0
  20. package/lib/retry.js +47 -0
  21. package/lib/retry.js.map +1 -0
  22. package/lib/services/access_groups.d.ts +459 -0
  23. package/lib/services/access_groups.d.ts.map +1 -0
  24. package/lib/services/access_groups.js +449 -0
  25. package/lib/services/access_groups.js.map +1 -0
  26. package/lib/services/ai_gateway.d.ts +122 -0
  27. package/lib/services/ai_gateway.d.ts.map +1 -0
  28. package/lib/services/ai_gateway.js +125 -0
  29. package/lib/services/ai_gateway.js.map +1 -0
  30. package/lib/services/aliases.d.ts +591 -0
  31. package/lib/services/aliases.d.ts.map +1 -0
  32. package/lib/services/aliases.js +482 -0
  33. package/lib/services/aliases.js.map +1 -0
  34. package/lib/services/api_ai_gateway.d.ts +275 -0
  35. package/lib/services/api_ai_gateway.d.ts.map +1 -0
  36. package/lib/services/api_ai_gateway.js +227 -0
  37. package/lib/services/api_ai_gateway.js.map +1 -0
  38. package/lib/services/artifacts.d.ts +228 -0
  39. package/lib/services/artifacts.d.ts.map +1 -0
  40. package/lib/services/artifacts.js +214 -0
  41. package/lib/services/artifacts.js.map +1 -0
  42. package/lib/services/authentication.d.ts +373 -0
  43. package/lib/services/authentication.d.ts.map +1 -0
  44. package/lib/services/authentication.js +304 -0
  45. package/lib/services/authentication.js.map +1 -0
  46. package/lib/services/billing.d.ts +930 -0
  47. package/lib/services/billing.d.ts.map +1 -0
  48. package/lib/services/billing.js +695 -0
  49. package/lib/services/billing.js.map +1 -0
  50. package/lib/services/bulk_redirects.d.ts +308 -0
  51. package/lib/services/bulk_redirects.d.ts.map +1 -0
  52. package/lib/services/bulk_redirects.js +302 -0
  53. package/lib/services/bulk_redirects.js.map +1 -0
  54. package/lib/services/certs.d.ts +171 -0
  55. package/lib/services/certs.d.ts.map +1 -0
  56. package/lib/services/certs.js +163 -0
  57. package/lib/services/certs.js.map +1 -0
  58. package/lib/services/checks_v2.d.ts +1167 -0
  59. package/lib/services/checks_v2.d.ts.map +1 -0
  60. package/lib/services/checks_v2.js +1141 -0
  61. package/lib/services/checks_v2.js.map +1 -0
  62. package/lib/services/connect.d.ts +2228 -0
  63. package/lib/services/connect.d.ts.map +1 -0
  64. package/lib/services/connect.js +1575 -0
  65. package/lib/services/connect.js.map +1 -0
  66. package/lib/services/deployments.d.ts +9419 -0
  67. package/lib/services/deployments.d.ts.map +1 -0
  68. package/lib/services/deployments.js +8248 -0
  69. package/lib/services/deployments.js.map +1 -0
  70. package/lib/services/dns.d.ts +279 -0
  71. package/lib/services/dns.d.ts.map +1 -0
  72. package/lib/services/dns.js +277 -0
  73. package/lib/services/dns.js.map +1 -0
  74. package/lib/services/domains.d.ts +564 -0
  75. package/lib/services/domains.d.ts.map +1 -0
  76. package/lib/services/domains.js +469 -0
  77. package/lib/services/domains.js.map +1 -0
  78. package/lib/services/domains_registrar.d.ts +798 -0
  79. package/lib/services/domains_registrar.d.ts.map +1 -0
  80. package/lib/services/domains_registrar.js +916 -0
  81. package/lib/services/domains_registrar.js.map +1 -0
  82. package/lib/services/drains.d.ts +2263 -0
  83. package/lib/services/drains.d.ts.map +1 -0
  84. package/lib/services/drains.js +2121 -0
  85. package/lib/services/drains.js.map +1 -0
  86. package/lib/services/edge_cache.d.ts +125 -0
  87. package/lib/services/edge_cache.d.ts.map +1 -0
  88. package/lib/services/edge_cache.js +138 -0
  89. package/lib/services/edge_cache.js.map +1 -0
  90. package/lib/services/environment.d.ts +1020 -0
  91. package/lib/services/environment.d.ts.map +1 -0
  92. package/lib/services/environment.js +805 -0
  93. package/lib/services/environment.js.map +1 -0
  94. package/lib/services/feature_flags.d.ts +2893 -0
  95. package/lib/services/feature_flags.d.ts.map +1 -0
  96. package/lib/services/feature_flags.js +2707 -0
  97. package/lib/services/feature_flags.js.map +1 -0
  98. package/lib/services/global_config.d.ts +618 -0
  99. package/lib/services/global_config.d.ts.map +1 -0
  100. package/lib/services/global_config.js +709 -0
  101. package/lib/services/global_config.js.map +1 -0
  102. package/lib/services/index.d.ts +42 -0
  103. package/lib/services/index.d.ts.map +1 -0
  104. package/lib/services/index.js +43 -0
  105. package/lib/services/index.js.map +1 -0
  106. package/lib/services/integrations.d.ts +3014 -0
  107. package/lib/services/integrations.d.ts.map +1 -0
  108. package/lib/services/integrations.js +2544 -0
  109. package/lib/services/integrations.js.map +1 -0
  110. package/lib/services/kms.d.ts +1095 -0
  111. package/lib/services/kms.d.ts.map +1 -0
  112. package/lib/services/kms.js +956 -0
  113. package/lib/services/kms.js.map +1 -0
  114. package/lib/services/log_drains.d.ts +848 -0
  115. package/lib/services/log_drains.d.ts.map +1 -0
  116. package/lib/services/log_drains.js +782 -0
  117. package/lib/services/log_drains.js.map +1 -0
  118. package/lib/services/logs.d.ts +40 -0
  119. package/lib/services/logs.d.ts.map +1 -0
  120. package/lib/services/logs.js +43 -0
  121. package/lib/services/logs.js.map +1 -0
  122. package/lib/services/marketplace.d.ts +1053 -0
  123. package/lib/services/marketplace.d.ts.map +1 -0
  124. package/lib/services/marketplace.js +1116 -0
  125. package/lib/services/marketplace.js.map +1 -0
  126. package/lib/services/microfrontends.d.ts +3250 -0
  127. package/lib/services/microfrontends.d.ts.map +1 -0
  128. package/lib/services/microfrontends.js +3154 -0
  129. package/lib/services/microfrontends.js.map +1 -0
  130. package/lib/services/misc.d.ts +192 -0
  131. package/lib/services/misc.d.ts.map +1 -0
  132. package/lib/services/misc.js +124 -0
  133. package/lib/services/misc.js.map +1 -0
  134. package/lib/services/networking.d.ts +360 -0
  135. package/lib/services/networking.d.ts.map +1 -0
  136. package/lib/services/networking.js +353 -0
  137. package/lib/services/networking.js.map +1 -0
  138. package/lib/services/observability.d.ts +168 -0
  139. package/lib/services/observability.d.ts.map +1 -0
  140. package/lib/services/observability.js +190 -0
  141. package/lib/services/observability.js.map +1 -0
  142. package/lib/services/project_members.d.ts +142 -0
  143. package/lib/services/project_members.d.ts.map +1 -0
  144. package/lib/services/project_members.js +135 -0
  145. package/lib/services/project_members.js.map +1 -0
  146. package/lib/services/project_routes.d.ts +1990 -0
  147. package/lib/services/project_routes.d.ts.map +1 -0
  148. package/lib/services/project_routes.js +1883 -0
  149. package/lib/services/project_routes.js.map +1 -0
  150. package/lib/services/projects.d.ts +23677 -0
  151. package/lib/services/projects.d.ts.map +1 -0
  152. package/lib/services/projects.js +22223 -0
  153. package/lib/services/projects.js.map +1 -0
  154. package/lib/services/rolling_release.d.ts +764 -0
  155. package/lib/services/rolling_release.d.ts.map +1 -0
  156. package/lib/services/rolling_release.js +583 -0
  157. package/lib/services/rolling_release.js.map +1 -0
  158. package/lib/services/sandboxes.d.ts +2777 -0
  159. package/lib/services/sandboxes.d.ts.map +1 -0
  160. package/lib/services/sandboxes.js +2142 -0
  161. package/lib/services/sandboxes.js.map +1 -0
  162. package/lib/services/security.d.ts +4247 -0
  163. package/lib/services/security.d.ts.map +1 -0
  164. package/lib/services/security.js +4377 -0
  165. package/lib/services/security.js.map +1 -0
  166. package/lib/services/storage.d.ts +251 -0
  167. package/lib/services/storage.d.ts.map +1 -0
  168. package/lib/services/storage.js +257 -0
  169. package/lib/services/storage.js.map +1 -0
  170. package/lib/services/teams.d.ts +1600 -0
  171. package/lib/services/teams.d.ts.map +1 -0
  172. package/lib/services/teams.js +1314 -0
  173. package/lib/services/teams.js.map +1 -0
  174. package/lib/services/user.d.ts +8559 -0
  175. package/lib/services/user.d.ts.map +1 -0
  176. package/lib/services/user.js +7407 -0
  177. package/lib/services/user.js.map +1 -0
  178. package/lib/services/vcr.d.ts +751 -0
  179. package/lib/services/vcr.d.ts.map +1 -0
  180. package/lib/services/vcr.js +826 -0
  181. package/lib/services/vcr.js.map +1 -0
  182. package/lib/services/web_analytics.d.ts +726 -0
  183. package/lib/services/web_analytics.d.ts.map +1 -0
  184. package/lib/services/web_analytics.js +707 -0
  185. package/lib/services/web_analytics.js.map +1 -0
  186. package/lib/services/webhooks.d.ts +219 -0
  187. package/lib/services/webhooks.d.ts.map +1 -0
  188. package/lib/services/webhooks.js +177 -0
  189. package/lib/services/webhooks.js.map +1 -0
  190. package/lib/traits.d.ts +10 -0
  191. package/lib/traits.d.ts.map +1 -0
  192. package/lib/traits.js +11 -0
  193. package/lib/traits.js.map +1 -0
  194. package/package.json +78 -7
  195. package/src/credentials.ts +70 -0
  196. package/src/errors.ts +93 -0
  197. package/src/index.ts +18 -0
  198. package/src/protocol.ts +98 -0
  199. package/src/retry.ts +78 -0
  200. package/src/services/access_groups.ts +1165 -0
  201. package/src/services/ai_gateway.ts +267 -0
  202. package/src/services/aliases.ts +1315 -0
  203. package/src/services/api_ai_gateway.ts +607 -0
  204. package/src/services/artifacts.ts +542 -0
  205. package/src/services/authentication.ts +827 -0
  206. package/src/services/billing.ts +2104 -0
  207. package/src/services/bulk_redirects.ts +748 -0
  208. package/src/services/certs.ts +371 -0
  209. package/src/services/checks_v2.ts +3084 -0
  210. package/src/services/connect.ts +4805 -0
  211. package/src/services/deployments.ts +24576 -0
  212. package/src/services/dns.ts +715 -0
  213. package/src/services/domains.ts +1257 -0
  214. package/src/services/domains_registrar.ts +2257 -0
  215. package/src/services/drains.ts +5828 -0
  216. package/src/services/edge_cache.ts +303 -0
  217. package/src/services/environment.ts +2379 -0
  218. package/src/services/feature_flags.ts +7722 -0
  219. package/src/services/global_config.ts +1668 -0
  220. package/src/services/index.ts +42 -0
  221. package/src/services/integrations.ts +9022 -0
  222. package/src/services/kms.ts +2614 -0
  223. package/src/services/log_drains.ts +2434 -0
  224. package/src/services/logs.ts +78 -0
  225. package/src/services/marketplace.ts +2849 -0
  226. package/src/services/microfrontends.ts +9921 -0
  227. package/src/services/misc.ts +364 -0
  228. package/src/services/networking.ts +865 -0
  229. package/src/services/observability.ts +435 -0
  230. package/src/services/project_members.ts +326 -0
  231. package/src/services/project_routes.ts +5229 -0
  232. package/src/services/projects.ts +68139 -0
  233. package/src/services/rolling_release.ts +1860 -0
  234. package/src/services/sandboxes.ts +6988 -0
  235. package/src/services/security.ts +13931 -0
  236. package/src/services/storage.ts +850 -0
  237. package/src/services/teams.ts +4055 -0
  238. package/src/services/user.ts +23195 -0
  239. package/src/services/vcr.ts +2070 -0
  240. package/src/services/web_analytics.ts +1638 -0
  241. package/src/services/webhooks.ts +1102 -0
  242. package/src/traits.ts +46 -0
  243. package/README.md +0 -15
  244. package/bun.lock +0 -26
  245. package/index.ts +0 -1
  246. package/tsconfig.json +0 -29
@@ -0,0 +1,827 @@
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 Redacted from "effect/Redacted";
4
+ import * as API from "@distilled.cloud/core/api";
5
+ import * as C from "@distilled.cloud/core/category";
6
+ import * as T from "../traits.ts";
7
+ import {
8
+ VercelProtocol,
9
+ type VercelOpError,
10
+ type VercelOpContext,
11
+ } from "../protocol.ts";
12
+ import * as Retry from "../retry.ts";
13
+
14
+ export type { VercelOpError, VercelOpContext };
15
+
16
+ export class BadRequest
17
+ extends /*@__PURE__*/ T.applyErrorMatchers(
18
+ /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
19
+ code: S.Number,
20
+ message: S.String,
21
+ }).pipe(C.withBadRequestError),
22
+ [{ status: 400 }],
23
+ ) {}
24
+
25
+ export class Conflict
26
+ extends /*@__PURE__*/ T.applyErrorMatchers(
27
+ /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
28
+ code: S.Number,
29
+ message: S.String,
30
+ }).pipe(C.withConflictError),
31
+ [{ status: 409 }],
32
+ ) {}
33
+
34
+ export class Forbidden
35
+ extends /*@__PURE__*/ T.applyErrorMatchers(
36
+ /*@__PURE__*/ S.TaggedError<Forbidden>()("Forbidden", {
37
+ code: S.Number,
38
+ message: S.String,
39
+ }).pipe(C.withAuthError),
40
+ [{ status: 403 }],
41
+ ) {}
42
+
43
+ export class NotFound
44
+ extends /*@__PURE__*/ T.applyErrorMatchers(
45
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
46
+ code: S.Number,
47
+ message: S.String,
48
+ }).pipe(C.withBadRequestError),
49
+ [{ status: 404 }],
50
+ ) {}
51
+
52
+ /** How often the quota refreshes. */
53
+ export type CreateApiKeysRequestAiGatewayQuotaRefreshPeriod =
54
+ | "daily"
55
+ | "weekly"
56
+ | "monthly"
57
+ | "none";
58
+ export const CreateApiKeysRequestAiGatewayQuotaRefreshPeriod = S.String;
59
+
60
+ export type CreateApiKeysRequestAiGatewayQuotaAlertThresholdsItem =
61
+ | 50
62
+ | 75
63
+ | 100;
64
+ export const CreateApiKeysRequestAiGatewayQuotaAlertThresholdsItem = S.Number;
65
+
66
+ /** Spend percentages (a subset of [50, 75, 100]) at which to send a spend alert. */
67
+ export type CreateApiKeysRequestAiGatewayQuotaAlertThresholdsList = Array<
68
+ CreateApiKeysRequestAiGatewayQuotaAlertThresholdsItem | (number & {})
69
+ >;
70
+ export const CreateApiKeysRequestAiGatewayQuotaAlertThresholdsList =
71
+ /*@__PURE__*/ S.Array(
72
+ CreateApiKeysRequestAiGatewayQuotaAlertThresholdsItem,
73
+ ) as any as S.Schema<CreateApiKeysRequestAiGatewayQuotaAlertThresholdsList>;
74
+
75
+ /** Optional AI Gateway quota configuration for the API key. */
76
+ export interface CreateApiKeysRequestAiGatewayQuota {
77
+ /** The quota limit amount. */
78
+ limitAmount: number;
79
+ /** Whether to include BYOK (Bring Your Own Key) usage in the quota. */
80
+ includeByokInQuota?: boolean;
81
+ /** How often the quota refreshes. */
82
+ refreshPeriod?:
83
+ | CreateApiKeysRequestAiGatewayQuotaRefreshPeriod
84
+ | (string & {});
85
+ /** Spend percentages (a subset of [50, 75, 100]) at which to send a spend alert. */
86
+ alertThresholds?: CreateApiKeysRequestAiGatewayQuotaAlertThresholdsList;
87
+ }
88
+ export const CreateApiKeysRequestAiGatewayQuota = /*@__PURE__*/ S.suspend(() =>
89
+ S.Struct({
90
+ limitAmount: S.Number,
91
+ includeByokInQuota: S.optional(S.Boolean),
92
+ refreshPeriod: S.optional(CreateApiKeysRequestAiGatewayQuotaRefreshPeriod),
93
+ alertThresholds: S.optional(
94
+ CreateApiKeysRequestAiGatewayQuotaAlertThresholdsList,
95
+ ),
96
+ }),
97
+ ).annotate({
98
+ identifier: "CreateApiKeysRequestAiGatewayQuota",
99
+ }) as any as S.Schema<CreateApiKeysRequestAiGatewayQuota>;
100
+
101
+ /** Optional generic metadata for the API key. The accepted shape depends on the key's `purpose` and is validated on creation; for `ai-gateway` keys this accepts `environment`. */
102
+ export type CreateApiKeysRequestMetadataMap = {
103
+ [key: string]: unknown | undefined;
104
+ };
105
+ export const CreateApiKeysRequestMetadataMap = /*@__PURE__*/ S.Record(
106
+ S.String,
107
+ S.Unknown,
108
+ ) as any as S.Schema<CreateApiKeysRequestMetadataMap>;
109
+
110
+ export interface CreateApiKeysRequest {
111
+ /** The API key's purpose, which restricts how it can be used. */
112
+ purpose: string;
113
+ /** An optional project to restrict the API key to. */
114
+ projectId?: string;
115
+ /** An optional name for the API key. */
116
+ name?: string;
117
+ /** The API key's expiration, expressed as a UNIX timestamp in milliseconds. */
118
+ expiresAt?: number;
119
+ /** Optional AI Gateway quota configuration for the API key. */
120
+ aiGatewayQuota?: CreateApiKeysRequestAiGatewayQuota;
121
+ /** Optional generic metadata for the API key. The accepted shape depends on the key's `purpose` and is validated on creation; for `ai-gateway` keys this accepts `environment`. */
122
+ metadata?: CreateApiKeysRequestMetadataMap;
123
+ }
124
+ export const CreateApiKeysRequest = /*@__PURE__*/ S.suspend(() =>
125
+ S.Struct({
126
+ purpose: S.String,
127
+ projectId: S.optional(S.String),
128
+ name: S.optional(S.String),
129
+ expiresAt: S.optional(S.Number),
130
+ aiGatewayQuota: S.optional(CreateApiKeysRequestAiGatewayQuota),
131
+ metadata: S.optional(CreateApiKeysRequestMetadataMap),
132
+ }).pipe(T.Http({ method: "POST", uri: "/api-keys", code: 200 })),
133
+ ).annotate({
134
+ identifier: "CreateApiKeysRequest",
135
+ }) as any as S.Schema<CreateApiKeysRequest>;
136
+
137
+ /** Spend percentages (a subset of [50, 75, 100]) at which to send a spend alert. Empty or undefined disables alerts. */
138
+ export type APIKeyQuotaAlertThresholdsList = Array<number>;
139
+ export const APIKeyQuotaAlertThresholdsList = /*@__PURE__*/ S.Array(
140
+ S.Number,
141
+ ) as any as S.Schema<APIKeyQuotaAlertThresholdsList>;
142
+
143
+ /** AI Gateway quota associated with an API key. */
144
+ export interface APIKeyQuota {
145
+ /** The unique identifier for the quota. */
146
+ quotaEntityId: string;
147
+ /** The quota limit amount. */
148
+ limitAmount: number;
149
+ /** The current amount spent against the quota. */
150
+ currentSpend: number;
151
+ /** The current BYOK spend (tracked separately). */
152
+ currentByokSpend: number;
153
+ /** Whether BYOK (Bring Your Own Key) spend counts against the quota. */
154
+ includeByokInQuota: boolean;
155
+ /** How often the quota refreshes. */
156
+ refreshPeriod: string;
157
+ /** Whether the quota is currently active. */
158
+ active: boolean;
159
+ /** Whether the quota has been archived. */
160
+ archived: boolean;
161
+ /** Spend percentages (a subset of [50, 75, 100]) at which to send a spend alert. Empty or undefined disables alerts. */
162
+ alertThresholds?: APIKeyQuotaAlertThresholdsList;
163
+ /** Timestamp (in milliseconds) of when the quota was created. */
164
+ createdAt: number;
165
+ /** Timestamp (in milliseconds) of when the quota was last updated. */
166
+ updatedAt: number;
167
+ }
168
+ export const APIKeyQuota = /*@__PURE__*/ S.suspend(() =>
169
+ S.Struct({
170
+ quotaEntityId: S.String,
171
+ limitAmount: S.Number,
172
+ currentSpend: S.Number,
173
+ currentByokSpend: S.Number,
174
+ includeByokInQuota: S.Boolean,
175
+ refreshPeriod: S.String,
176
+ active: S.Boolean,
177
+ archived: S.Boolean,
178
+ alertThresholds: S.optional(APIKeyQuotaAlertThresholdsList),
179
+ createdAt: S.Number,
180
+ updatedAt: S.Number,
181
+ }),
182
+ ).annotate({ identifier: "APIKeyQuota" }) as any as S.Schema<APIKeyQuota>;
183
+
184
+ /** Information about the newly created API key. */
185
+ export interface APIKey {
186
+ /** The unique identifier of the API key. */
187
+ id: string;
188
+ /** The human-readable name of the API key. */
189
+ name: string;
190
+ /** The last few characters of the API key string, for helping identify the API key. */
191
+ partialKey: string;
192
+ /** The ID of the team that the API key grants access to. */
193
+ teamId: string;
194
+ /** The API key's purpose, i.e. what resources it can be used with. */
195
+ purpose: string;
196
+ /** The ID of the project that this API key grants access to. When this is unset, the API key grants access to all projects in the team. */
197
+ projectId: string | null;
198
+ /** Timestamp (in milliseconds) of when the API key expires. */
199
+ expiresAt: number | null;
200
+ /** Timestamp (in milliseconds) of when the API key was most recently used. */
201
+ activeAt: number;
202
+ /** Timestamp (in milliseconds) of when the API key was created. */
203
+ createdAt: number;
204
+ /** The ID of the user who created the API key. */
205
+ createdBy: string;
206
+ /** Timestamp (in milliseconds) of when the API key was marked as leaked. */
207
+ leakedAt: number | null;
208
+ /** URL where the API key was discovered as leaked. */
209
+ leakedUrl: string | null;
210
+ /** The ID of the app that created the API key, if any */
211
+ createdByAppId: string | null;
212
+ quota?: APIKeyQuota;
213
+ /** Generic metadata attached to the API key. The accepted shape depends on the key's `purpose` and is validated when the key is created. For `ai-gateway` keys this carries `environment` and `spendAttribution`. */
214
+ metadata?: unknown;
215
+ }
216
+ export const APIKey = /*@__PURE__*/ S.suspend(() =>
217
+ S.Struct({
218
+ id: S.String,
219
+ name: S.String,
220
+ partialKey: S.String,
221
+ teamId: S.String,
222
+ purpose: S.String,
223
+ projectId: S.NullOr(S.String),
224
+ expiresAt: S.NullOr(S.Number),
225
+ activeAt: S.Number,
226
+ createdAt: S.Number,
227
+ createdBy: S.String,
228
+ leakedAt: S.NullOr(S.Number),
229
+ leakedUrl: S.NullOr(S.String),
230
+ createdByAppId: S.NullOr(S.String),
231
+ quota: S.optional(APIKeyQuota),
232
+ metadata: S.optional(S.Unknown),
233
+ }),
234
+ ).annotate({ identifier: "APIKey" }) as any as S.Schema<APIKey>;
235
+
236
+ export interface CreateApiKeysResponse {
237
+ /** The API key's actual value. This value is only provided in this response, and can never be retrieved again in the future. Be sure to save it somewhere safe! */
238
+ apiKeyString: string;
239
+ apiKey: APIKey;
240
+ }
241
+ export const CreateApiKeysResponse = /*@__PURE__*/ S.suspend(() =>
242
+ S.Struct({
243
+ apiKeyString: S.String,
244
+ apiKey: APIKey,
245
+ }),
246
+ ).annotate({
247
+ identifier: "CreateApiKeysResponse",
248
+ }) as any as S.Schema<CreateApiKeysResponse>;
249
+
250
+ export interface CreateAuthTokenRequest {
251
+ /** The Team identifier to perform the request on behalf of. */
252
+ teamId?: string;
253
+ /** The Team slug to perform the request on behalf of. */
254
+ slug?: string;
255
+ name: string;
256
+ expiresAt?: number;
257
+ /** The ID of the project to scope this token to */
258
+ projectId?: string;
259
+ }
260
+ export const CreateAuthTokenRequest = /*@__PURE__*/ S.suspend(() =>
261
+ S.Struct({
262
+ teamId: S.optional(S.String.pipe(T.Query())),
263
+ slug: S.optional(S.String.pipe(T.Query())),
264
+ name: S.String,
265
+ expiresAt: S.optional(S.Number),
266
+ projectId: S.optional(S.String),
267
+ }).pipe(T.Http({ method: "POST", uri: "/v3/user/tokens", code: 200 })),
268
+ ).annotate({
269
+ identifier: "CreateAuthTokenRequest",
270
+ }) as any as S.Schema<CreateAuthTokenRequest>;
271
+
272
+ export type AuthTokenScopesItemCase0Type = "user";
273
+ export const AuthTokenScopesItemCase0Type = S.String;
274
+
275
+ /** Possible step-up auth origins */
276
+ export type AuthTokenScopesItemCase0SudoOrigin =
277
+ | "email-otp"
278
+ | "otp"
279
+ | "recovery-code"
280
+ | "totp"
281
+ | "webauthn";
282
+ export const AuthTokenScopesItemCase0SudoOrigin = S.String;
283
+
284
+ export interface AuthTokenScopesItemCase0Sudo {
285
+ /** Possible step-up auth origins */
286
+ origin: AuthTokenScopesItemCase0SudoOrigin;
287
+ verifiedAt?: number;
288
+ expiresAt: number;
289
+ }
290
+ export const AuthTokenScopesItemCase0Sudo = /*@__PURE__*/ S.suspend(() =>
291
+ S.Struct({
292
+ origin: AuthTokenScopesItemCase0SudoOrigin,
293
+ verifiedAt: S.optional(S.Number),
294
+ expiresAt: S.Number,
295
+ }),
296
+ ).annotate({
297
+ identifier: "AuthTokenScopesItemCase0Sudo",
298
+ }) as any as S.Schema<AuthTokenScopesItemCase0Sudo>;
299
+
300
+ export type AuthTokenScopesItemCase0Origin =
301
+ | "app"
302
+ | "apple"
303
+ | "bitbucket"
304
+ | "chatgpt"
305
+ | "email"
306
+ | "emu"
307
+ | "github"
308
+ | "github-webhook"
309
+ | "gitlab"
310
+ | "google"
311
+ | "invite"
312
+ | "manual"
313
+ | "otp"
314
+ | "passkey"
315
+ | "saml"
316
+ | "sms"
317
+ | "token-exchange-oidc";
318
+ export const AuthTokenScopesItemCase0Origin = S.String;
319
+
320
+ /** The access scopes granted to the token. */
321
+ export interface AuthTokenScopesItemCase0 {
322
+ type: AuthTokenScopesItemCase0Type;
323
+ sudo?: AuthTokenScopesItemCase0Sudo;
324
+ origin?: AuthTokenScopesItemCase0Origin;
325
+ createdAt: number;
326
+ expiresAt?: number;
327
+ }
328
+ export const AuthTokenScopesItemCase0 = /*@__PURE__*/ S.suspend(() =>
329
+ S.Struct({
330
+ type: AuthTokenScopesItemCase0Type,
331
+ sudo: S.optional(AuthTokenScopesItemCase0Sudo),
332
+ origin: S.optional(AuthTokenScopesItemCase0Origin),
333
+ createdAt: S.Number,
334
+ expiresAt: S.optional(S.Number),
335
+ }),
336
+ ).annotate({
337
+ identifier: "AuthTokenScopesItemCase0",
338
+ }) as any as S.Schema<AuthTokenScopesItemCase0>;
339
+
340
+ export type AuthTokenScopesItemCase1Type = "team";
341
+ export const AuthTokenScopesItemCase1Type = S.String;
342
+
343
+ export type AuthTokenScopesItemCase1Origin =
344
+ | "app"
345
+ | "apple"
346
+ | "bitbucket"
347
+ | "chatgpt"
348
+ | "email"
349
+ | "emu"
350
+ | "github"
351
+ | "github-webhook"
352
+ | "gitlab"
353
+ | "google"
354
+ | "invite"
355
+ | "manual"
356
+ | "otp"
357
+ | "passkey"
358
+ | "saml"
359
+ | "sms"
360
+ | "token-exchange-oidc";
361
+ export const AuthTokenScopesItemCase1Origin = S.String;
362
+
363
+ /** The access scopes granted to the token. */
364
+ export interface AuthTokenScopesItemCase1 {
365
+ type: AuthTokenScopesItemCase1Type;
366
+ teamId: string;
367
+ origin?: AuthTokenScopesItemCase1Origin;
368
+ createdAt: number;
369
+ expiresAt?: number;
370
+ }
371
+ export const AuthTokenScopesItemCase1 = /*@__PURE__*/ S.suspend(() =>
372
+ S.Struct({
373
+ type: AuthTokenScopesItemCase1Type,
374
+ teamId: S.String,
375
+ origin: S.optional(AuthTokenScopesItemCase1Origin),
376
+ createdAt: S.Number,
377
+ expiresAt: S.optional(S.Number),
378
+ }),
379
+ ).annotate({
380
+ identifier: "AuthTokenScopesItemCase1",
381
+ }) as any as S.Schema<AuthTokenScopesItemCase1>;
382
+
383
+ export type AuthTokenScopesItem =
384
+ | AuthTokenScopesItemCase0
385
+ | AuthTokenScopesItemCase1;
386
+ export const AuthTokenScopesItem =
387
+ S.Unknown as any as S.Schema<AuthTokenScopesItem>;
388
+
389
+ /** The access scopes granted to the token. */
390
+ export type AuthTokenScopesList = Array<AuthTokenScopesItem>;
391
+ export const AuthTokenScopesList = /*@__PURE__*/ S.Array(
392
+ AuthTokenScopesItem,
393
+ ) as any as S.Schema<AuthTokenScopesList>;
394
+
395
+ /** Authentication token metadata. */
396
+ export interface AuthToken {
397
+ /** The unique identifier of the token. */
398
+ id: string;
399
+ /** The human-readable name of the token. */
400
+ name: string;
401
+ /** The type of the token. */
402
+ type: string;
403
+ /** The token's prefix, for identification purposes. */
404
+ prefix?: string;
405
+ /** The last few characters of the token, for identification purposes. */
406
+ suffix?: string;
407
+ /** The origin of how the token was created. */
408
+ origin?: string;
409
+ /** The access scopes granted to the token. */
410
+ scopes?: AuthTokenScopesList;
411
+ /** Timestamp (in milliseconds) of when the token was created. */
412
+ createdAt: number;
413
+ /** Timestamp (in milliseconds) of when the token was most recently used. */
414
+ activeAt: number;
415
+ /** Timestamp (in milliseconds) of when the token expires. */
416
+ expiresAt?: number;
417
+ /** Timestamp (in milliseconds) of when the token was revoked. */
418
+ revokedAt?: number;
419
+ /** Timestamp (in milliseconds) of when the token was marked as leaked. */
420
+ leakedAt?: number;
421
+ /** URL where the token was discovered as leaked. */
422
+ leakedUrl?: string;
423
+ }
424
+ export const AuthToken = /*@__PURE__*/ S.suspend(() =>
425
+ S.Struct({
426
+ id: S.String,
427
+ name: S.String,
428
+ type: S.String,
429
+ prefix: S.optional(S.String),
430
+ suffix: S.optional(S.String),
431
+ origin: S.optional(S.String),
432
+ scopes: S.optional(AuthTokenScopesList),
433
+ createdAt: S.Number,
434
+ activeAt: S.Number,
435
+ expiresAt: S.optional(S.Number),
436
+ revokedAt: S.optional(S.Number),
437
+ leakedAt: S.optional(S.Number),
438
+ leakedUrl: S.optional(S.String),
439
+ }),
440
+ ).annotate({ identifier: "AuthToken" }) as any as S.Schema<AuthToken>;
441
+
442
+ export interface CreateAuthTokenResponse {
443
+ token: AuthToken;
444
+ /** The authentication token's actual value. This token is only provided in this response, and can never be retrieved again in the future. Be sure to save it somewhere safe! */
445
+ bearerToken: string;
446
+ }
447
+ export const CreateAuthTokenResponse = /*@__PURE__*/ S.suspend(() =>
448
+ S.Struct({
449
+ token: AuthToken,
450
+ bearerToken: S.String,
451
+ }),
452
+ ).annotate({
453
+ identifier: "CreateAuthTokenResponse",
454
+ }) as any as S.Schema<CreateAuthTokenResponse>;
455
+
456
+ export interface DeleteAuthTokenRequest {
457
+ /** The identifier of the token to invalidate. The special value "current" may be supplied, which invalidates the token that the HTTP request was authenticated with. */
458
+ tokenId: string;
459
+ }
460
+ export const DeleteAuthTokenRequest = /*@__PURE__*/ S.suspend(() =>
461
+ S.Struct({
462
+ tokenId: S.String.pipe(T.Label()),
463
+ }).pipe(
464
+ T.Http({ method: "DELETE", uri: "/v3/user/tokens/{tokenId}", code: 200 }),
465
+ ),
466
+ ).annotate({
467
+ identifier: "DeleteAuthTokenRequest",
468
+ }) as any as S.Schema<DeleteAuthTokenRequest>;
469
+
470
+ export interface DeleteAuthTokenResponse {
471
+ /** The unique identifier of the token that was deleted. */
472
+ tokenId: string;
473
+ }
474
+ export const DeleteAuthTokenResponse = /*@__PURE__*/ S.suspend(() =>
475
+ S.Struct({
476
+ tokenId: S.String,
477
+ }),
478
+ ).annotate({
479
+ identifier: "DeleteAuthTokenResponse",
480
+ }) as any as S.Schema<DeleteAuthTokenResponse>;
481
+
482
+ /** The grant type, when using x-www-form-urlencoded content type */
483
+ export type ExchangeSsoTokenRequestBodyCase0GrantType = "authorization_code";
484
+ export const ExchangeSsoTokenRequestBodyCase0GrantType = S.String;
485
+
486
+ export interface ExchangeSsoTokenRequestBodyCase0 {
487
+ /** The sensitive code received from Vercel */
488
+ code: string;
489
+ /** The state received from the initialization request */
490
+ state?: string;
491
+ /** The integration client id */
492
+ client_id: string;
493
+ /** The integration client secret */
494
+ client_secret: string | Redacted.Redacted<string>;
495
+ /** The integration redirect URI */
496
+ redirect_uri?: string;
497
+ /** The grant type, when using x-www-form-urlencoded content type */
498
+ grant_type: ExchangeSsoTokenRequestBodyCase0GrantType;
499
+ }
500
+ export const ExchangeSsoTokenRequestBodyCase0 = /*@__PURE__*/ S.suspend(() =>
501
+ S.Struct({
502
+ code: S.String,
503
+ state: S.optional(S.String),
504
+ client_id: S.String,
505
+ client_secret: S.String.pipe(T.SensitiveValue({})),
506
+ redirect_uri: S.optional(S.String),
507
+ grant_type: ExchangeSsoTokenRequestBodyCase0GrantType,
508
+ }),
509
+ ).annotate({
510
+ identifier: "ExchangeSsoTokenRequestBodyCase0",
511
+ }) as any as S.Schema<ExchangeSsoTokenRequestBodyCase0>;
512
+
513
+ /** The grant type, when using x-www-form-urlencoded content type */
514
+ export type ExchangeSsoTokenRequestBodyCase1GrantType = "refresh_token";
515
+ export const ExchangeSsoTokenRequestBodyCase1GrantType = S.String;
516
+
517
+ export interface ExchangeSsoTokenRequestBodyCase1 {
518
+ /** The refresh token received from previous token exchange */
519
+ refresh_token: string | Redacted.Redacted<string>;
520
+ /** The integration client id */
521
+ client_id: string;
522
+ /** The integration client secret */
523
+ client_secret: string | Redacted.Redacted<string>;
524
+ /** The grant type, when using x-www-form-urlencoded content type */
525
+ grant_type: ExchangeSsoTokenRequestBodyCase1GrantType;
526
+ }
527
+ export const ExchangeSsoTokenRequestBodyCase1 = /*@__PURE__*/ S.suspend(() =>
528
+ S.Struct({
529
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
530
+ client_id: S.String,
531
+ client_secret: S.String.pipe(T.SensitiveValue({})),
532
+ grant_type: ExchangeSsoTokenRequestBodyCase1GrantType,
533
+ }),
534
+ ).annotate({
535
+ identifier: "ExchangeSsoTokenRequestBodyCase1",
536
+ }) as any as S.Schema<ExchangeSsoTokenRequestBodyCase1>;
537
+
538
+ export type ExchangeSsoTokenRequestBody =
539
+ | ExchangeSsoTokenRequestBodyCase0
540
+ | ExchangeSsoTokenRequestBodyCase1;
541
+ export const ExchangeSsoTokenRequestBody =
542
+ S.Unknown as any as S.Schema<ExchangeSsoTokenRequestBody>;
543
+
544
+ export interface ExchangeSsoTokenRequest {
545
+ body: ExchangeSsoTokenRequestBody;
546
+ }
547
+ export const ExchangeSsoTokenRequest = /*@__PURE__*/ S.suspend(() =>
548
+ S.Struct({
549
+ body: ExchangeSsoTokenRequestBody.pipe(T.HttpBody()),
550
+ }).pipe(
551
+ T.Http({ method: "POST", uri: "/v1/integrations/sso/token", code: 200 }),
552
+ ),
553
+ ).annotate({
554
+ identifier: "ExchangeSsoTokenRequest",
555
+ }) as any as S.Schema<ExchangeSsoTokenRequest>;
556
+
557
+ export interface ExchangeSsoTokenResponseBodyCase0 {
558
+ id_token: string;
559
+ token_type: string | null;
560
+ expires_in?: number;
561
+ access_token: string | Redacted.Redacted<string> | null;
562
+ refresh_token?: string | Redacted.Redacted<string>;
563
+ }
564
+ export const ExchangeSsoTokenResponseBodyCase0 = /*@__PURE__*/ S.suspend(() =>
565
+ S.Struct({
566
+ id_token: S.String,
567
+ token_type: S.NullOr(S.String),
568
+ expires_in: S.optional(S.Number),
569
+ access_token: S.NullOr(S.String).pipe(T.SensitiveValue({})),
570
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
571
+ }),
572
+ ).annotate({
573
+ identifier: "ExchangeSsoTokenResponseBodyCase0",
574
+ }) as any as S.Schema<ExchangeSsoTokenResponseBodyCase0>;
575
+
576
+ export interface ExchangeSsoTokenResponseBodyCase1 {
577
+ id_token: string;
578
+ token_type: string;
579
+ access_token: string | Redacted.Redacted<string>;
580
+ refresh_token: string | Redacted.Redacted<string>;
581
+ expires_in: number;
582
+ }
583
+ export const ExchangeSsoTokenResponseBodyCase1 = /*@__PURE__*/ S.suspend(() =>
584
+ S.Struct({
585
+ id_token: S.String,
586
+ token_type: S.String,
587
+ access_token: S.String.pipe(T.SensitiveValue({})),
588
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
589
+ expires_in: S.Number,
590
+ }),
591
+ ).annotate({
592
+ identifier: "ExchangeSsoTokenResponseBodyCase1",
593
+ }) as any as S.Schema<ExchangeSsoTokenResponseBodyCase1>;
594
+
595
+ export type ExchangeSsoTokenResponseBody =
596
+ | ExchangeSsoTokenResponseBodyCase0
597
+ | ExchangeSsoTokenResponseBodyCase1;
598
+ export const ExchangeSsoTokenResponseBody =
599
+ S.Unknown as any as S.Schema<ExchangeSsoTokenResponseBody>;
600
+
601
+ export type ExchangeSsoTokenResponse = ExchangeSsoTokenResponseBody;
602
+ export const ExchangeSsoTokenResponse = /*@__PURE__*/ S.suspend(() =>
603
+ ExchangeSsoTokenResponseBody.pipe(T.RawResponseRoot()),
604
+ ).annotate({
605
+ identifier: "ExchangeSsoTokenResponse",
606
+ }) as any as S.Schema<ExchangeSsoTokenResponse>;
607
+
608
+ export interface GetAuthTokenRequest {
609
+ /** The identifier of the token to retrieve. The special value "current" may be supplied, which returns the metadata for the token that the current HTTP request is authenticated with. */
610
+ tokenId: string;
611
+ }
612
+ export const GetAuthTokenRequest = /*@__PURE__*/ S.suspend(() =>
613
+ S.Struct({
614
+ tokenId: S.String.pipe(T.Label()),
615
+ }).pipe(
616
+ T.Http({ method: "GET", uri: "/v5/user/tokens/{tokenId}", code: 200 }),
617
+ ),
618
+ ).annotate({
619
+ identifier: "GetAuthTokenRequest",
620
+ }) as any as S.Schema<GetAuthTokenRequest>;
621
+
622
+ export interface GetAuthTokenResponse {
623
+ token: AuthToken;
624
+ }
625
+ export const GetAuthTokenResponse = /*@__PURE__*/ S.suspend(() =>
626
+ S.Struct({
627
+ token: AuthToken,
628
+ }),
629
+ ).annotate({
630
+ identifier: "GetAuthTokenResponse",
631
+ }) as any as S.Schema<GetAuthTokenResponse>;
632
+
633
+ export interface ListAuthTokensRequest {}
634
+ export const ListAuthTokensRequest = /*@__PURE__*/ S.suspend(() =>
635
+ S.Struct({}).pipe(
636
+ T.Http({ method: "GET", uri: "/v6/user/tokens", code: 200 }),
637
+ ),
638
+ ).annotate({
639
+ identifier: "ListAuthTokensRequest",
640
+ }) as any as S.Schema<ListAuthTokensRequest>;
641
+
642
+ export type ListAuthTokensResponseBodyCase0TokensList = Array<AuthToken>;
643
+ export const ListAuthTokensResponseBodyCase0TokensList = /*@__PURE__*/ S.Array(
644
+ AuthToken,
645
+ ) as any as S.Schema<ListAuthTokensResponseBodyCase0TokensList>;
646
+
647
+ export interface ListAuthTokensResponseBodyCase0Pagination {
648
+ count: number;
649
+ next: string | null;
650
+ prev: string | null;
651
+ }
652
+ export const ListAuthTokensResponseBodyCase0Pagination =
653
+ /*@__PURE__*/ S.suspend(() =>
654
+ S.Struct({
655
+ count: S.Number,
656
+ next: S.NullOr(S.String),
657
+ prev: S.NullOr(S.String),
658
+ }),
659
+ ).annotate({
660
+ identifier: "ListAuthTokensResponseBodyCase0Pagination",
661
+ }) as any as S.Schema<ListAuthTokensResponseBodyCase0Pagination>;
662
+
663
+ export interface ListAuthTokensResponseBodyCase0 {
664
+ tokens: ListAuthTokensResponseBodyCase0TokensList;
665
+ pagination: ListAuthTokensResponseBodyCase0Pagination;
666
+ }
667
+ export const ListAuthTokensResponseBodyCase0 = /*@__PURE__*/ S.suspend(() =>
668
+ S.Struct({
669
+ tokens: ListAuthTokensResponseBodyCase0TokensList,
670
+ pagination: ListAuthTokensResponseBodyCase0Pagination,
671
+ }),
672
+ ).annotate({
673
+ identifier: "ListAuthTokensResponseBodyCase0",
674
+ }) as any as S.Schema<ListAuthTokensResponseBodyCase0>;
675
+
676
+ export type ListAuthTokensResponseBodyCase1TokensList = Array<AuthToken>;
677
+ export const ListAuthTokensResponseBodyCase1TokensList = /*@__PURE__*/ S.Array(
678
+ AuthToken,
679
+ ) as any as S.Schema<ListAuthTokensResponseBodyCase1TokensList>;
680
+
681
+ /** This object contains information related to the pagination of the current request, including the necessary parameters to get the next or previous page of data. */
682
+ export interface Pagination {
683
+ /** Amount of items in the current page. */
684
+ count: number;
685
+ /** Timestamp that must be used to request the next page. */
686
+ next: number | null;
687
+ /** Timestamp that must be used to request the previous page. */
688
+ prev: number | null;
689
+ }
690
+ export const Pagination = /*@__PURE__*/ S.suspend(() =>
691
+ S.Struct({
692
+ count: S.Number,
693
+ next: S.NullOr(S.Number),
694
+ prev: S.NullOr(S.Number),
695
+ }),
696
+ ).annotate({ identifier: "Pagination" }) as any as S.Schema<Pagination>;
697
+
698
+ export interface ListAuthTokensResponseBodyCase1 {
699
+ tokens: ListAuthTokensResponseBodyCase1TokensList;
700
+ pagination: Pagination;
701
+ }
702
+ export const ListAuthTokensResponseBodyCase1 = /*@__PURE__*/ S.suspend(() =>
703
+ S.Struct({
704
+ tokens: ListAuthTokensResponseBodyCase1TokensList,
705
+ pagination: Pagination,
706
+ }),
707
+ ).annotate({
708
+ identifier: "ListAuthTokensResponseBodyCase1",
709
+ }) as any as S.Schema<ListAuthTokensResponseBodyCase1>;
710
+
711
+ export type ListAuthTokensResponseBody =
712
+ | ListAuthTokensResponseBodyCase0
713
+ | ListAuthTokensResponseBodyCase1;
714
+ export const ListAuthTokensResponseBody =
715
+ S.Unknown as any as S.Schema<ListAuthTokensResponseBody>;
716
+
717
+ export type ListAuthTokensResponse = ListAuthTokensResponseBody;
718
+ export const ListAuthTokensResponse = /*@__PURE__*/ S.suspend(() =>
719
+ ListAuthTokensResponseBody.pipe(T.RawResponseRoot()),
720
+ ).annotate({
721
+ identifier: "ListAuthTokensResponse",
722
+ }) as any as S.Schema<ListAuthTokensResponse>;
723
+
724
+ export type CreateApiKeysError =
725
+ | BadRequest
726
+ | Forbidden
727
+ | Conflict
728
+ | VercelOpError;
729
+ export const createApiKeys: API.OperationMethod<
730
+ CreateApiKeysRequest,
731
+ CreateApiKeysResponse,
732
+ CreateApiKeysError,
733
+ VercelOpContext
734
+ > = /*@__PURE__*/ API.make(() => ({
735
+ input: CreateApiKeysRequest,
736
+ output: CreateApiKeysResponse,
737
+ errors: [BadRequest, Forbidden, Conflict],
738
+ protocol: VercelProtocol,
739
+ retry: Retry.Retry,
740
+ }));
741
+
742
+ export type CreateAuthTokenError =
743
+ | BadRequest
744
+ | Forbidden
745
+ | NotFound
746
+ | VercelOpError;
747
+ /** Create an Auth Token Creates and returns a new authentication token for the currently authenticated User. The `bearerToken` property is only provided once, in the response body, so be sure to save it on the client for use with API requests. */
748
+ export const createAuthToken: API.OperationMethod<
749
+ CreateAuthTokenRequest,
750
+ CreateAuthTokenResponse,
751
+ CreateAuthTokenError,
752
+ VercelOpContext
753
+ > = /*@__PURE__*/ API.make(() => ({
754
+ input: CreateAuthTokenRequest,
755
+ output: CreateAuthTokenResponse,
756
+ errors: [BadRequest, Forbidden, NotFound],
757
+ protocol: VercelProtocol,
758
+ retry: Retry.Retry,
759
+ }));
760
+
761
+ export type DeleteAuthTokenError =
762
+ | BadRequest
763
+ | Forbidden
764
+ | NotFound
765
+ | VercelOpError;
766
+ /** Delete an authentication token Invalidate an authentication token, such that it will no longer be valid for future HTTP requests. */
767
+ export const deleteAuthToken: API.OperationMethod<
768
+ DeleteAuthTokenRequest,
769
+ DeleteAuthTokenResponse,
770
+ DeleteAuthTokenError,
771
+ VercelOpContext
772
+ > = /*@__PURE__*/ API.make(() => ({
773
+ input: DeleteAuthTokenRequest,
774
+ output: DeleteAuthTokenResponse,
775
+ errors: [BadRequest, Forbidden, NotFound],
776
+ protocol: VercelProtocol,
777
+ retry: Retry.Retry,
778
+ }));
779
+
780
+ export type ExchangeSsoTokenError = BadRequest | Forbidden | VercelOpError;
781
+ /** SSO Token Exchange During the autorization process, Vercel sends the user to the provider [redirectLoginUrl](https://vercel.com/docs/integrations/create-integration/submit-integration#redirect-login-url), that includes the OAuth authorization `code` parameter. The provider then calls the SSO Token Exchange endpoint with the sent code and receives the OIDC token. They log the user in based on this token and redirects the user back to the Vercel account using deep-link parameters included the redirectLoginUrl. Providers should not persist the returned `id_token` in a database since the token will expire. See [**Authentication with SSO**](https://vercel.com/docs/integrations/create-integration/marketplace-api#authentication-with-sso) for more details. */
782
+ export const exchangeSsoToken: API.OperationMethod<
783
+ ExchangeSsoTokenRequest,
784
+ ExchangeSsoTokenResponse,
785
+ ExchangeSsoTokenError,
786
+ VercelOpContext
787
+ > = /*@__PURE__*/ API.make(() => ({
788
+ input: ExchangeSsoTokenRequest,
789
+ output: ExchangeSsoTokenResponse,
790
+ errors: [BadRequest, Forbidden],
791
+ protocol: VercelProtocol,
792
+ retry: Retry.Retry,
793
+ }));
794
+
795
+ export type GetAuthTokenError =
796
+ | BadRequest
797
+ | Forbidden
798
+ | NotFound
799
+ | VercelOpError;
800
+ /** Get Auth Token Metadata Retrieve metadata about an authentication token belonging to the currently authenticated User. */
801
+ export const getAuthToken: API.OperationMethod<
802
+ GetAuthTokenRequest,
803
+ GetAuthTokenResponse,
804
+ GetAuthTokenError,
805
+ VercelOpContext
806
+ > = /*@__PURE__*/ API.make(() => ({
807
+ input: GetAuthTokenRequest,
808
+ output: GetAuthTokenResponse,
809
+ errors: [BadRequest, Forbidden, NotFound],
810
+ protocol: VercelProtocol,
811
+ retry: Retry.Retry,
812
+ }));
813
+
814
+ export type ListAuthTokensError = BadRequest | Forbidden | VercelOpError;
815
+ /** List Auth Tokens Retrieve a list of the current User's authentication tokens. */
816
+ export const listAuthTokens: API.OperationMethod<
817
+ ListAuthTokensRequest,
818
+ ListAuthTokensResponse,
819
+ ListAuthTokensError,
820
+ VercelOpContext
821
+ > = /*@__PURE__*/ API.make(() => ({
822
+ input: ListAuthTokensRequest,
823
+ output: ListAuthTokensResponse,
824
+ errors: [BadRequest, Forbidden],
825
+ protocol: VercelProtocol,
826
+ retry: Retry.Retry,
827
+ }));