vercel-api-js 0.7.2 → 0.8.1

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.
package/dist/index.mjs CHANGED
@@ -1,1058 +1,719 @@
1
- /******************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- /* global Reflect, Promise, SuppressedError, Symbol */
16
-
17
-
18
- function __classPrivateFieldGet(receiver, state, kind, f) {
19
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
20
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
21
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
22
- }
23
-
24
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
25
- if (kind === "m") throw new TypeError("Private method is not writable");
26
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
27
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
28
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
29
- }
30
-
31
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
32
- var e = new Error(message);
33
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1
+ var __accessCheck = (obj, member, msg) => {
2
+ if (!member.has(obj))
3
+ throw TypeError("Cannot " + msg);
4
+ };
5
+ var __privateGet = (obj, member, getter) => {
6
+ __accessCheck(obj, member, "read from private field");
7
+ return getter ? getter.call(obj) : member.get(obj);
8
+ };
9
+ var __privateAdd = (obj, member, value) => {
10
+ if (member.has(obj))
11
+ throw TypeError("Cannot add the same private member more than once");
12
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
13
+ };
14
+ var __privateSet = (obj, member, value, setter) => {
15
+ __accessCheck(obj, member, "write to private field");
16
+ setter ? setter.call(obj, value) : member.set(obj, value);
17
+ return value;
34
18
  };
35
19
 
20
+ // src/utils/lang.ts
36
21
  function notEmpty(value) {
37
- return value !== null && value !== undefined;
22
+ return value !== null && value !== void 0;
38
23
  }
39
24
  function compactObject(obj) {
40
- return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
25
+ return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
41
26
  }
42
27
 
43
- const baseUrl = 'https://api.vercel.com';
44
- async function fetch$1({ url, method, body, headers, pathParams, queryParams, signal, token, fetchImpl }) {
45
- try {
46
- const requestHeaders = compactObject({
47
- 'Content-Type': 'application/json',
48
- Authorization: token ? `Bearer ${token}` : undefined,
49
- ...headers
50
- });
51
- /**
52
- * As the fetch API is being used, when multipart/form-data is specified
53
- * the Content-Type header must be deleted so that the browser can set
54
- * the correct boundary.
55
- * https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects#sending_files_using_a_formdata_object
56
- */
57
- if (requestHeaders['Content-Type']?.toLowerCase().includes('multipart/form-data')) {
58
- delete requestHeaders['Content-Type'];
59
- }
60
- const payload = body instanceof FormData
61
- ? body
62
- : requestHeaders['Content-Type'] === 'application/json'
63
- ? JSON.stringify(body)
64
- : body;
65
- const response = await fetchImpl(`${baseUrl}${resolveUrl(url, queryParams, pathParams)}`, {
66
- signal,
67
- method: method.toUpperCase(),
68
- body: payload,
69
- headers: requestHeaders
70
- });
71
- if (!response.ok) {
72
- let error;
73
- try {
74
- error = await response.json();
75
- }
76
- catch (e) {
77
- error = {
78
- status: 'unknown',
79
- payload: e instanceof Error ? `Unexpected error (${e.message})` : 'Unexpected error'
80
- };
81
- }
82
- throw error;
83
- }
84
- if (response.headers?.get('content-type')?.includes('json')) {
85
- return await response.json();
86
- }
87
- else {
88
- // if it is not a json response, assume it is a blob and cast it to TData
89
- return (await response.text());
90
- }
28
+ // src/api/fetcher.ts
29
+ var baseUrl = "https://api.vercel.com";
30
+ async function fetch2({
31
+ url,
32
+ method,
33
+ body,
34
+ headers,
35
+ pathParams,
36
+ queryParams,
37
+ signal,
38
+ token,
39
+ fetchImpl
40
+ }) {
41
+ try {
42
+ const requestHeaders = compactObject({
43
+ "Content-Type": "application/json",
44
+ Authorization: token ? `Bearer ${token}` : void 0,
45
+ ...headers
46
+ });
47
+ if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
48
+ delete requestHeaders["Content-Type"];
91
49
  }
92
- catch (e) {
93
- let errorObject = {
94
- name: 'unknown',
95
- message: e instanceof Error ? `Network error (${e.message})` : 'Network error',
96
- stack: e
50
+ const payload = body instanceof FormData ? body : requestHeaders["Content-Type"] === "application/json" ? JSON.stringify(body) : body;
51
+ const response = await fetchImpl(`${baseUrl}${resolveUrl(url, queryParams, pathParams)}`, {
52
+ signal,
53
+ method: method.toUpperCase(),
54
+ body: payload,
55
+ headers: requestHeaders
56
+ });
57
+ if (!response.ok) {
58
+ let error;
59
+ try {
60
+ error = await response.json();
61
+ } catch (e) {
62
+ error = {
63
+ status: "unknown",
64
+ payload: e instanceof Error ? `Unexpected error (${e.message})` : "Unexpected error"
97
65
  };
98
- throw errorObject;
66
+ }
67
+ throw error;
68
+ }
69
+ if (response.headers?.get("content-type")?.includes("json")) {
70
+ return await response.json();
71
+ } else {
72
+ return await response.text();
99
73
  }
74
+ } catch (e) {
75
+ let errorObject = {
76
+ name: "unknown",
77
+ message: e instanceof Error ? `Network error (${e.message})` : "Network error",
78
+ stack: e
79
+ };
80
+ throw errorObject;
81
+ }
100
82
  }
101
- const resolveUrl = (url, queryParams = {}, pathParams = {}) => {
102
- let query = new URLSearchParams(queryParams).toString();
103
- if (query)
104
- query = `?${query}`;
105
- return url.replace(/\{\w*\}/g, (key) => pathParams[key.slice(1, -1)] ?? '') + query;
83
+ var resolveUrl = (url, queryParams = {}, pathParams = {}) => {
84
+ let query = new URLSearchParams(queryParams).toString();
85
+ if (query)
86
+ query = `?${query}`;
87
+ return url.replace(/\{\w*\}/g, (key) => pathParams[key.slice(1, -1)] ?? "") + query;
106
88
  };
107
89
 
108
- /**
109
- * Records an artifacts cache usage event. The body of this request is an array of cache usage events. The supported event types are `HIT` and `MISS`. The source is either `LOCAL` the cache event was on the users filesystem cache or `REMOTE` if the cache event is for a remote cache. When the event is a `HIT` the request also accepts a number `duration` which is the time taken to generate the artifact in the cache.
110
- */
111
- const recordEvents = (variables, signal) => fetch$1({
112
- url: '/v8/artifacts/events',
113
- method: 'post',
114
- ...variables,
115
- signal
116
- });
117
- /**
118
- * Check the status of Remote Caching for this principal. Returns a JSON-encoded status indicating if Remote Caching is enabled, disabled, or disabled due to usage limits.
119
- */
120
- const status = (variables, signal) => fetch$1({
121
- url: '/v8/artifacts/status',
122
- method: 'get',
123
- ...variables,
124
- signal
125
- });
126
- /**
127
- * Uploads a cache artifact identified by the `hash` specified on the path. The cache artifact can then be downloaded with the provided `hash`.
128
- */
129
- const uploadArtifact = (variables, signal) => fetch$1({ url: '/v8/artifacts/{hash}', method: 'put', ...variables, signal });
130
- /**
131
- * Downloads a cache artifact indentified by its `hash` specified on the request path. The artifact is downloaded as an octet-stream. The client should verify the content-length header and response body.
132
- */
133
- const downloadArtifact = (variables, signal) => fetch$1({ url: '/v8/artifacts/{hash}', method: 'get', ...variables, signal });
134
- /**
135
- * Query information about an array of artifacts.
136
- */
137
- const artifactQuery = (variables, signal) => fetch$1({
138
- url: '/v8/artifacts',
139
- method: 'post',
140
- ...variables,
141
- signal
142
- });
143
- /**
144
- * Creates a new check. This endpoint must be called with an OAuth2 or it will produce a 400 error.
145
- */
146
- const createCheck = (variables, signal) => fetch$1({ url: '/v1/deployments/{deploymentId}/checks', method: 'post', ...variables, signal });
147
- /**
148
- * List all of the checks created for a deployment.
149
- */
150
- const getAllChecks = (variables, signal) => fetch$1({
151
- url: '/v1/deployments/{deploymentId}/checks',
152
- method: 'get',
153
- ...variables,
154
- signal
155
- });
156
- /**
157
- * Return a detailed response for a single check.
158
- */
159
- const getCheck = (variables, signal) => fetch$1({
160
- url: '/v1/deployments/{deploymentId}/checks/{checkId}',
161
- method: 'get',
162
- ...variables,
163
- signal
164
- });
165
- /**
166
- * Update an existing check. This endpoint must be called with an OAuth2 or it will produce a 400 error.
167
- */
168
- const updateCheck = (variables, signal) => fetch$1({ url: '/v1/deployments/{deploymentId}/checks/{checkId}', method: 'patch', ...variables, signal });
169
- /**
170
- * Rerequest a selected check that has failed.
171
- */
172
- const rerequestCheck = (variables, signal) => fetch$1({
173
- url: '/v1/deployments/{deploymentId}/checks/{checkId}/rerequest',
174
- method: 'post',
175
- ...variables,
176
- signal
177
- });
178
- /**
179
- * Update the data cache feature on a project.
180
- */
181
- const updateProjectDataCache = (variables, signal) => fetch$1({ url: '/v1/data-cache/projects/{projectId}', method: 'patch', ...variables, signal });
182
- /**
183
- * Get the build logs of a deployment by deployment ID and build ID. It can work as an infinite stream of logs or as a JSON endpoint depending on the input parameters.
184
- */
185
- const getDeploymentEvents = (variables, signal) => fetch$1({ url: '/v3/deployments/{idOrUrl}/events', method: 'get', ...variables, signal });
186
- /**
187
- * Retrieves information for a deployment either by supplying its ID (`id` property) or Hostname (`url` property). Additional details will be included when the authenticated user or team is an owner of the deployment.
188
- */
189
- const getDeployment = (variables, signal) => fetch$1({ url: '/v13/deployments/{idOrUrl}', method: 'get', ...variables, signal });
190
- /**
191
- * Create a new deployment with all the required and intended data. If the deployment is not a git deployment, all files must be provided with the request, either referenced or inlined. Additionally, a deployment id can be specified to redeploy a previous deployment.
192
- */
193
- const createDeployment = (variables, signal) => fetch$1({ url: '/v13/deployments', method: 'post', ...variables, signal });
194
- /**
195
- * This endpoint allows you to cancel a deployment which is currently building, by supplying its `id` in the URL.
196
- */
197
- const cancelDeployment = (variables, signal) => fetch$1({ url: '/v12/deployments/{id}/cancel', method: 'patch', ...variables, signal });
198
- /**
199
- * Allows to purchase the specified domain.
200
- */
201
- const buyDomain = (variables, signal) => fetch$1({
202
- url: '/v4/domains/buy',
203
- method: 'post',
204
- ...variables,
205
- signal
206
- });
207
- /**
208
- * Check the price to purchase a domain and how long a single purchase period is.
209
- */
210
- const checkDomainPrice = (variables, signal) => fetch$1({
211
- url: '/v4/domains/price',
212
- method: 'get',
213
- ...variables,
214
- signal
215
- });
216
- /**
217
- * Retrieves a list of DNS records created for a domain name. By default it returns 20 records if no limit is provided. The rest can be retrieved using the pagination options.
218
- */
219
- const getRecords = (variables, signal) => fetch$1({ url: '/v4/domains/{domain}/records', method: 'get', ...variables, signal });
220
- /**
221
- * Creates a DNS record for a domain.
222
- */
223
- const createRecord = (variables, signal) => fetch$1({ url: '/v2/domains/{domain}/records', method: 'post', ...variables, signal });
224
- /**
225
- * Updates an existing DNS record for a domain name.
226
- */
227
- const updateRecord = (variables, signal) => fetch$1({ url: '/v1/domains/records/{recordId}', method: 'patch', ...variables, signal });
228
- /**
229
- * Removes an existing DNS record from a domain name.
230
- */
231
- const removeRecord = (variables, signal) => fetch$1({
232
- url: '/v2/domains/{domain}/records/{recordId}',
233
- method: 'delete',
234
- ...variables,
235
- signal
236
- });
237
- /**
238
- * Check if a domain name is available for purchase.
239
- */
240
- const checkDomainStatus = (variables, signal) => fetch$1({
241
- url: '/v4/domains/status',
242
- method: 'get',
243
- ...variables,
244
- signal
245
- });
246
- /**
247
- * Fetch domain transfer availability or transfer status if a transfer is in progress.
248
- */
249
- const getDomainTransfer = (variables, signal) => fetch$1({
250
- url: '/v1/domains/{domain}/registry',
251
- method: 'get',
252
- ...variables,
253
- signal
254
- });
255
- /**
256
- * Get a Domain's configuration.
257
- */
258
- const getDomainConfig = (variables, signal) => fetch$1({ url: '/v6/domains/{domain}/config', method: 'get', ...variables, signal });
259
- /**
260
- * Get information for a single domain in an account or team.
261
- */
262
- const getDomain = (variables, signal) => fetch$1({
263
- url: '/v5/domains/{domain}',
264
- method: 'get',
265
- ...variables,
266
- signal
267
- });
268
- /**
269
- * Retrieves a list of domains registered for the authenticated user or team. By default it returns the last 20 domains if no limit is provided.
270
- */
271
- const getDomains = (variables, signal) => fetch$1({
272
- url: '/v5/domains',
273
- method: 'get',
274
- ...variables,
275
- signal
276
- });
277
- /**
278
- * This endpoint is used for adding a new apex domain name with Vercel for the authenticating user. Can also be used for initiating a domain transfer request from an external Registrar to Vercel.
279
- */
280
- const createOrTransferDomain = (variables, signal) => fetch$1({ url: '/v5/domains', method: 'post', ...variables, signal });
281
- /**
282
- * Update or move apex domain.
283
- */
284
- const patchDomain = (variables, signal) => fetch$1({ url: '/v3/domains/{domain}', method: 'patch', ...variables, signal });
285
- /**
286
- * Delete a previously registered domain name from Vercel. Deleting a domain will automatically remove any associated aliases.
287
- */
288
- const deleteDomain = (variables, signal) => fetch$1({
289
- url: '/v6/domains/{domain}',
290
- method: 'delete',
291
- ...variables,
292
- signal
293
- });
294
- /**
295
- * Returns all Edge Configs.
296
- */
297
- const getEdgeConfigs = (variables, signal) => fetch$1({
298
- url: '/v1/edge-config',
299
- method: 'get',
300
- ...variables,
301
- signal
302
- });
303
- /**
304
- * Creates an Edge Config.
305
- */
306
- const createEdgeConfig = (variables, signal) => fetch$1({ url: '/v1/edge-config', method: 'post', ...variables, signal });
307
- /**
308
- * Returns an Edge Config.
309
- */
310
- const getEdgeConfig = (variables, signal) => fetch$1({
311
- url: '/v1/edge-config/{edgeConfigId}',
312
- method: 'get',
313
- ...variables,
314
- signal
315
- });
316
- /**
317
- * Updates an Edge Config.
318
- */
319
- const updateEdgeConfig = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}', method: 'put', ...variables, signal });
320
- /**
321
- * Delete an Edge Config by id.
322
- */
323
- const deleteEdgeConfig = (variables, signal) => fetch$1({
324
- url: '/v1/edge-config/{edgeConfigId}',
325
- method: 'delete',
326
- ...variables,
327
- signal
328
- });
329
- /**
330
- * Returns all items of an Edge Config.
331
- */
332
- const getEdgeConfigItems = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/items', method: 'get', ...variables, signal });
333
- /**
334
- * Update multiple Edge Config Items in batch.
335
- */
336
- const patchEdgeConfigItems = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/items', method: 'patch', ...variables, signal });
337
- /**
338
- * Returns the schema of an Edge Config.
339
- */
340
- const getEdgeConfigSchema = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/schema', method: 'get', ...variables, signal });
341
- /**
342
- * Update an Edge Config's schema.
343
- */
344
- const patchEdgeConfigSchema = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/schema', method: 'post', ...variables, signal });
345
- /**
346
- * Deletes the schema of existing Edge Config.
347
- */
348
- const deleteEdgeConfigSchema = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/schema', method: 'delete', ...variables, signal });
349
- /**
350
- * Returns a specific Edge Config Item.
351
- */
352
- const getEdgeConfigItem = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/item/{edgeConfigItemKey}', method: 'get', ...variables, signal });
353
- /**
354
- * Returns all tokens of an Edge Config.
355
- */
356
- const getEdgeConfigTokens = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/tokens', method: 'get', ...variables, signal });
357
- /**
358
- * Deletes one or more tokens of an existing Edge Config.
359
- */
360
- const deleteEdgeConfigTokens = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/tokens', method: 'delete', ...variables, signal });
361
- /**
362
- * Return meta data about an Edge Config token.
363
- */
364
- const getEdgeConfigToken = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/token/{token}', method: 'get', ...variables, signal });
365
- /**
366
- * Adds a token to an existing Edge Config.
367
- */
368
- const createEdgeConfigToken = (variables, signal) => fetch$1({ url: '/v1/edge-config/{edgeConfigId}/token', method: 'post', ...variables, signal });
369
- /**
370
- * Retrieves a list of "events" generated by the User on Vercel. Events are generated when the User performs a particular action, such as logging in, creating a deployment, and joining a Team (just to name a few). When the `teamId` parameter is supplied, then the events that are returned will be in relation to the Team that was specified.
371
- */
372
- const listUserEvents = (variables, signal) => fetch$1({
373
- url: '/v3/events',
374
- method: 'get',
375
- ...variables,
376
- signal
377
- });
378
- /**
379
- * Allows to retrieve all configurations for an authenticated integration. When the `project` view is used, configurations generated for the authorization flow will be filtered out of the results.
380
- */
381
- const getConfigurations = (variables, signal) => fetch$1({ url: '/v1/integrations/configurations', method: 'get', ...variables, signal });
382
- /**
383
- * Allows to retrieve a the configuration with the provided id in case it exists. The authenticated user or team must be the owner of the config in order to access it.
384
- */
385
- const getConfiguration = (variables, signal) => fetch$1({ url: '/v1/integrations/configuration/{id}', method: 'get', ...variables, signal });
386
- /**
387
- * Allows to remove the configuration with the `id` provided in the parameters. The configuration and all of its resources will be removed. This includes Webhooks, LogDrains and Project Env variables.
388
- */
389
- const deleteConfiguration = (variables, signal) => fetch$1({ url: '/v1/integrations/configuration/{id}', method: 'delete', ...variables, signal });
390
- /**
391
- * Retrieves a list of all Integration log drains that are defined for the authenticated user or team. When using an OAuth2 token, the list is limited to log drains created by the authenticated integration.
392
- */
393
- const getIntegrationLogDrains = (variables, signal) => fetch$1({ url: '/v2/integrations/log-drains', method: 'get', ...variables, signal });
394
- /**
395
- * Creates an Integration log drain. This endpoint must be called with an OAuth2 client (integration), since log drains are tied to integrations. If it is called with a different token type it will produce a 400 error.
396
- */
397
- const createLogDrain = (variables, signal) => fetch$1({
398
- url: '/v2/integrations/log-drains',
399
- method: 'post',
400
- ...variables,
401
- signal
402
- });
403
- /**
404
- * Deletes the Integration log drain with the provided `id`. When using an OAuth2 Token, the log drain can be deleted only if the integration owns it.
405
- */
406
- const deleteIntegrationLogDrain = (variables, signal) => fetch$1({ url: '/v1/integrations/log-drains/{id}', method: 'delete', ...variables, signal });
407
- /**
408
- * Lists git namespaces for a supported provider. Supported providers are `github`, `gitlab` and `bitbucket`. If the provider is not provided, it will try to obtain it from the user that authenticated the request.
409
- */
410
- const gitNamespaces = (variables, signal) => fetch$1({
411
- url: '/v1/integrations/git-namespaces',
412
- method: 'get',
413
- ...variables,
414
- signal
415
- });
416
- /**
417
- * Lists git repositories linked to a namespace `id` for a supported provider. A specific namespace `id` can be obtained via the `git-namespaces` endpoint. Supported providers are `github`, `gitlab` and `bitbucket`. If the provider or namespace is not provided, it will try to obtain it from the user that authenticated the request.
418
- */
419
- const searchRepo = (variables, signal) => fetch$1({
420
- url: '/v1/integrations/search-repo',
421
- method: 'get',
422
- ...variables,
423
- signal
424
- });
425
- /**
426
- * Retrieves a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be accessed.
427
- */
428
- const getConfigurableLogDrain = (variables, signal) => fetch$1({ url: '/v1/log-drains/{id}', method: 'get', ...variables, signal });
429
- /**
430
- * Deletes a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be deleted.
431
- */
432
- const deleteConfigurableLogDrain = (variables, signal) => fetch$1({ url: '/v1/log-drains/{id}', method: 'delete', ...variables, signal });
433
- /**
434
- * Retrieves a list of all the Log Drains owned by the account. This endpoint must be called with an account AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated account can be accessed.
435
- */
436
- const getAllLogDrains = (variables, signal) => fetch$1({
437
- url: '/v1/log-drains',
438
- method: 'get',
439
- ...variables,
440
- signal
441
- });
442
- /**
443
- * Creates a configurable log drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed)
444
- */
445
- const createConfigurableLogDrain = (variables, signal) => fetch$1({ url: '/v1/log-drains', method: 'post', ...variables, signal });
446
- /**
447
- * Lists all members of a project.
448
- */
449
- const getProjectMembers = (variables, signal) => fetch$1({ url: '/v1/projects/{idOrName}/members', method: 'get', ...variables, signal });
450
- /**
451
- * Adds a new member to the project.
452
- */
453
- const addProjectMember = (variables, signal) => fetch$1({ url: '/v1/projects/{idOrName}/members', method: 'post', ...variables, signal });
454
- /**
455
- * Remove a member from a specific project
456
- */
457
- const removeProjectMember = (variables, signal) => fetch$1({ url: '/v1/projects/{idOrName}/members/{uid}', method: 'delete', ...variables, signal });
458
- /**
459
- * Allows to retrieve the list of projects of the authenticated user or team. The list will be paginated and the provided query parameters allow filtering the returned projects.
460
- */
461
- const getProjects = (variables, signal) => fetch$1({
462
- url: '/v9/projects',
463
- method: 'get',
464
- ...variables,
465
- signal
466
- });
467
- /**
468
- * Allows to create a new project with the provided configuration. It only requires the project `name` but more configuration can be provided to override the defaults.
469
- */
470
- const createProject = (variables, signal) => fetch$1({
471
- url: '/v10/projects',
472
- method: 'post',
473
- ...variables,
474
- signal
475
- });
476
- /**
477
- * Get the information for a specific project by passing either the project `id` or `name` in the URL.
478
- */
479
- const getProject = (variables, signal) => fetch$1({
480
- url: '/v9/projects/{idOrName}',
481
- method: 'get',
482
- ...variables,
483
- signal
484
- });
485
- /**
486
- * Update the fields of a project using either its `name` or `id`.
487
- */
488
- const updateProject = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}', method: 'patch', ...variables, signal });
489
- /**
490
- * Delete a specific project by passing either the project `id` or `name` in the URL.
491
- */
492
- const deleteProject = (variables, signal) => fetch$1({
493
- url: '/v9/projects/{idOrName}',
494
- method: 'delete',
495
- ...variables,
496
- signal
497
- });
498
- /**
499
- * Retrieve the domains associated with a given project by passing either the project `id` or `name` in the URL.
500
- */
501
- const getProjectDomains = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/domains', method: 'get', ...variables, signal });
502
- /**
503
- * Get project domain by project id/name and domain name.
504
- */
505
- const getProjectDomain = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/domains/{domain}', method: 'get', ...variables, signal });
506
- /**
507
- * Update a project domain's configuration, including the name, git branch and redirect of the domain.
508
- */
509
- const updateProjectDomain = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/domains/{domain}', method: 'patch', ...variables, signal });
510
- /**
511
- * Remove a domain from a project by passing the domain name and by specifying the project by either passing the project `id` or `name` in the URL.
512
- */
513
- const removeProjectDomain = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/domains/{domain}', method: 'delete', ...variables, signal });
514
- /**
515
- * Add a domain to the project by passing its domain name and by specifying the project by either passing the project `id` or `name` in the URL. If the domain is not yet verified to be used on this project, the request will return `verified = false`, and the domain will need to be verified according to the `verification` challenge via `POST /projects/:idOrName/domains/:domain/verify`. If the domain already exists on the project, the request will fail with a `400` status code.
516
- */
517
- const addProjectDomain = (variables, signal) => fetch$1({ url: '/v10/projects/{idOrName}/domains', method: 'post', ...variables, signal });
518
- /**
519
- * Attempts to verify a project domain with `verified = false` by checking the correctness of the project domain's `verification` challenge.
520
- */
521
- const verifyProjectDomain = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/domains/{domain}/verify', method: 'post', ...variables, signal });
522
- /**
523
- * Retrieve the environment variables for a given project by passing either the project `id` or `name` in the URL.
524
- */
525
- const filterProjectEnvs = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/env', method: 'get', ...variables, signal });
526
- /**
527
- * Retrieve the environment variable for a given project.
528
- */
529
- const getProjectEnv = (variables, signal) => fetch$1({ url: '/v1/projects/{idOrName}/env/{id}', method: 'get', ...variables, signal });
530
- /**
531
- * Create one ore more environment variables for a project by passing its `key`, `value`, `type` and `target` and by specifying the project by either passing the project `id` or `name` in the URL.
532
- */
533
- const createProjectEnv = (variables, signal) => fetch$1({ url: '/v10/projects/{idOrName}/env', method: 'post', ...variables, signal });
534
- /**
535
- * Delete a specific environment variable for a given project by passing the environment variable identifier and either passing the project `id` or `name` in the URL.
536
- */
537
- const removeProjectEnv = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/env/{id}', method: 'delete', ...variables, signal });
538
- /**
539
- * Edit a specific environment variable for a given project by passing the environment variable identifier and either passing the project `id` or `name` in the URL.
540
- */
541
- const editProjectEnv = (variables, signal) => fetch$1({ url: '/v9/projects/{idOrName}/env/{id}', method: 'patch', ...variables, signal });
542
- /**
543
- * Pause a project by passing its project `id` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project disables auto assigning custom production domains and blocks the active Production Deployment then the request will return with 200 status code.
544
- */
545
- const pauseProject = (variables, signal) => fetch$1({
546
- url: '/v1/projects/{projectId}/pause',
547
- method: 'post',
548
- ...variables,
549
- signal
550
- });
551
- /**
552
- * Unpause a project by passing its project `id` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project enables auto assigning custom production domains and unblocks the active Production Deployment then the request will return with 200 status code.
553
- */
554
- const unpauseProject = (variables, signal) => fetch$1({
555
- url: '/v1/projects/{projectId}/unpause',
556
- method: 'post',
557
- ...variables,
558
- signal
559
- });
560
- /**
561
- * Get a paginated list of team members for the provided team.
562
- */
563
- const getTeamMembers = (variables, signal) => fetch$1({
564
- url: '/v2/teams/{teamId}/members',
565
- method: 'get',
566
- ...variables,
567
- signal
568
- });
569
- /**
570
- * Invite a user to join the team specified in the URL. The authenticated user needs to be an `OWNER` in order to successfully invoke this endpoint. The user can be specified with an email or an ID. If both email and ID are provided, ID will take priority.
571
- */
572
- const inviteUserToTeam = (variables, signal) => fetch$1({ url: '/v1/teams/{teamId}/members', method: 'post', ...variables, signal });
573
- /**
574
- * Request access to a team as a member. An owner has to approve the request. Only 10 users can request access to a team at the same time.
575
- */
576
- const requestAccessToTeam = (variables, signal) => fetch$1({
577
- url: '/v1/teams/{teamId}/request',
578
- method: 'post',
579
- ...variables,
580
- signal
581
- });
582
- /**
583
- * Check the status of a join request. It'll respond with a 404 if the request has been declined. If no `userId` path segment was provided, this endpoint will instead return the status of the authenticated user.
584
- */
585
- const getTeamAccessRequest = (variables, signal) => fetch$1({
586
- url: '/v1/teams/{teamId}/request/{userId}',
587
- method: 'get',
588
- ...variables,
589
- signal
590
- });
591
- /**
592
- * Join a team with a provided invite code or team ID.
593
- */
594
- const joinTeam = (variables, signal) => fetch$1({
595
- url: '/v1/teams/{teamId}/members/teams/join',
596
- method: 'post',
597
- ...variables,
598
- signal
599
- });
600
- /**
601
- * Update the membership of a Team Member on the Team specified by `teamId`, such as changing the _role_ of the member, or confirming a request to join the Team for an unconfirmed member. The authenticated user must be an `OWNER` of the Team.
602
- */
603
- const updateTeamMember = (variables, signal) => fetch$1({ url: '/v1/teams/{teamId}/members/{uid}', method: 'patch', ...variables, signal });
604
- /**
605
- * Remove a Team Member from the Team, or dismiss a user that requested access, or leave a team.
606
- */
607
- const removeTeamMember = (variables, signal) => fetch$1({ url: '/v1/teams/{teamId}/members/{uid}', method: 'delete', ...variables, signal });
608
- /**
609
- * Get information for the Team specified by the `teamId` parameter.
610
- */
611
- const getTeam = (variables, signal) => fetch$1({
612
- url: '/v2/teams/{teamId}',
613
- method: 'get',
614
- ...variables,
615
- signal
616
- });
617
- /**
618
- * Update the information of a Team specified by the `teamId` parameter. The request body should contain the information that will be updated on the Team.
619
- */
620
- const patchTeam = (variables, signal) => fetch$1({
621
- url: '/v2/teams/{teamId}',
622
- method: 'patch',
623
- ...variables,
624
- signal
625
- });
626
- /**
627
- * Get a paginated list of all the Teams the authenticated User is a member of.
628
- */
629
- const getTeams = (variables, signal) => fetch$1({
630
- url: '/v2/teams',
631
- method: 'get',
632
- ...variables,
633
- signal
634
- });
635
- /**
636
- * Create a new Team under your account. You need to send a POST request with the desired Team slug, and optionally the Team name.
637
- */
638
- const createTeam = (variables, signal) => fetch$1({
639
- url: '/v1/teams',
640
- method: 'post',
641
- ...variables,
642
- signal
643
- });
644
- /**
645
- * Delete a team under your account. You need to send a `DELETE` request with the desired team `id`. An optional array of reasons for deletion may also be sent.
646
- */
647
- const deleteTeam = (variables, signal) => fetch$1({
648
- url: '/v1/teams/{teamId}',
649
- method: 'delete',
650
- ...variables,
651
- signal
652
- });
653
- /**
654
- * Delete an active Team invite code.
655
- */
656
- const deleteTeamInviteCode = (variables, signal) => fetch$1({
657
- url: '/v1/teams/{teamId}/invites/{inviteId}',
658
- method: 'delete',
659
- ...variables,
660
- signal
661
- });
662
- /**
663
- * Before you create a deployment you need to upload the required files for that deployment. To do it, you need to first upload each file to this endpoint. Once that's completed, you can create a new deployment with the uploaded files. The file content must be placed inside the body of the request. In the case of a successful response you'll receive a status code 200 with an empty body.
664
- */
665
- const uploadFile = (variables, signal) => fetch$1({ url: '/v2/files', method: 'post', ...variables, signal });
666
- /**
667
- * Retrieves information related to the currently authenticated User.
668
- */
669
- const getAuthUser = (variables, signal) => fetch$1({
670
- url: '/v2/user',
671
- method: 'get',
672
- ...variables,
673
- signal
674
- });
675
- /**
676
- * Initiates the deletion process for the currently authenticated User, by sending a deletion confirmation email. The email contains a link that the user needs to visit in order to proceed with the deletion process.
677
- */
678
- const requestDelete = (variables, signal) => fetch$1({
679
- url: '/v1/user',
680
- method: 'delete',
681
- ...variables,
682
- signal
683
- });
684
- /**
685
- * Retrieve a list of the current User's authentication tokens.
686
- */
687
- const listAuthTokens = (variables, signal) => fetch$1({
688
- url: '/v5/user/tokens',
689
- method: 'get',
690
- ...variables,
691
- signal
692
- });
693
- /**
694
- * 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.
695
- */
696
- const createAuthToken = (variables, signal) => fetch$1({ url: '/v3/user/tokens', method: 'post', ...variables, signal });
697
- /**
698
- * Retrieve metadata about an authentication token belonging to the currently authenticated User.
699
- */
700
- const getAuthToken = (variables, signal) => fetch$1({
701
- url: '/v5/user/tokens/{tokenId}',
702
- method: 'get',
703
- ...variables,
704
- signal
705
- });
706
- /**
707
- * Invalidate an authentication token, such that it will no longer be valid for future HTTP requests.
708
- */
709
- const deleteAuthToken = (variables, signal) => fetch$1({
710
- url: '/v3/user/tokens/{tokenId}',
711
- method: 'delete',
712
- ...variables,
713
- signal
714
- });
715
- /**
716
- * Creates a webhook
717
- */
718
- const createWebhook = (variables, signal) => fetch$1({
719
- url: '/v1/webhooks',
720
- method: 'post',
721
- ...variables,
722
- signal
723
- });
724
- /**
725
- * Get a list of webhooks
726
- */
727
- const getWebhooks = (variables, signal) => fetch$1({ url: '/v1/webhooks', method: 'get', ...variables, signal });
728
- /**
729
- * Get a webhook
730
- */
731
- const getWebhook = (variables, signal) => fetch$1({
732
- url: '/v1/webhooks/{id}',
733
- method: 'get',
734
- ...variables,
735
- signal
736
- });
737
- /**
738
- * Deletes a webhook
739
- */
740
- const deleteWebhook = (variables, signal) => fetch$1({
741
- url: '/v1/webhooks/{id}',
742
- method: 'delete',
743
- ...variables,
744
- signal
745
- });
746
- /**
747
- * Retrieves a list of aliases for the authenticated User or Team. When `domain` is provided, only aliases for that domain will be returned. When `projectId` is provided, it will only return the given project aliases.
748
- */
749
- const listAliases = (variables, signal) => fetch$1({
750
- url: '/v4/aliases',
751
- method: 'get',
752
- ...variables,
753
- signal
754
- });
755
- /**
756
- * Retrieves an Alias for the given host name or alias ID.
757
- */
758
- const getAlias = (variables, signal) => fetch$1({
759
- url: '/v4/aliases/{idOrAlias}',
760
- method: 'get',
761
- ...variables,
762
- signal
763
- });
764
- /**
765
- * Delete an Alias with the specified ID.
766
- */
767
- const deleteAlias = (variables, signal) => fetch$1({
768
- url: '/v2/aliases/{aliasId}',
769
- method: 'delete',
770
- ...variables,
771
- signal
772
- });
773
- /**
774
- * Retrieves all Aliases for the Deployment with the given ID. The authenticated user or team must own the deployment.
775
- */
776
- const listDeploymentAliases = (variables, signal) => fetch$1({ url: '/v2/deployments/{id}/aliases', method: 'get', ...variables, signal });
777
- /**
778
- * Creates a new alias for the deployment with the given deployment ID. The authenticated user or team must own this deployment. If the desired alias is already assigned to another deployment, then it will be removed from the old deployment and assigned to the new one.
779
- */
780
- const assignAlias = (variables, signal) => fetch$1({ url: '/v2/deployments/{id}/aliases', method: 'post', ...variables, signal });
781
- /**
782
- * Get cert by id
783
- */
784
- const getCertById = (variables, signal) => fetch$1({
785
- url: '/v7/certs/{id}',
786
- method: 'get',
787
- ...variables,
788
- signal
789
- });
790
- /**
791
- * Remove cert
792
- */
793
- const removeCert = (variables, signal) => fetch$1({
794
- url: '/v7/certs/{id}',
795
- method: 'delete',
796
- ...variables,
797
- signal
798
- });
799
- /**
800
- * Issue a new cert
801
- */
802
- const issueCert = (variables, signal) => fetch$1({
803
- url: '/v7/certs',
804
- method: 'post',
805
- ...variables,
806
- signal
807
- });
808
- /**
809
- * Upload a cert
810
- */
811
- const uploadCert = (variables, signal) => fetch$1({
812
- url: '/v7/certs',
813
- method: 'put',
814
- ...variables,
815
- signal
816
- });
817
- /**
818
- * Allows to retrieve the file structure of a deployment by supplying the deployment unique identifier.
819
- */
820
- const listDeploymentFiles = (variables, signal) => fetch$1({ url: '/v6/deployments/{id}/files', method: 'get', ...variables, signal });
821
- /**
822
- * Allows to retrieve the content of a file by supplying the file identifier and the deployment unique identifier. The response body will contain a JSON response containing the contents of the file encoded as base64.
823
- */
824
- const getDeploymentFileContents = (variables, signal) => fetch$1({ url: '/v7/deployments/{id}/files/{fileId}', method: 'get', ...variables, signal });
825
- /**
826
- * List deployments under the authenticated user or team. If a deployment hasn't finished uploading (is incomplete), the `url` property will have a value of `null`.
827
- */
828
- const getDeployments = (variables, signal) => fetch$1({
829
- url: '/v6/deployments',
830
- method: 'get',
831
- ...variables,
832
- signal
833
- });
834
- /**
835
- * Verify the user accepted the login request and get a authentication token. The user email address and the token received after requesting the login must be added to the URL as a query string with the names `email` and `token`.
836
- */
837
- const verifyToken = (variables, signal) => fetch$1({
838
- url: '/registration/verify',
839
- method: 'get',
840
- ...variables,
841
- signal
842
- });
843
- /**
844
- * Request a new login for a user to get a token. This will respond with a verification token and send an email to confirm the request. Once confirmed you can use the verification token to get an authentication token.
845
- */
846
- const emailLogin = (variables, signal) => fetch$1({ url: '/registration', method: 'post', ...variables, signal });
847
- /**
848
- * This API allows you to delete a deployment, either by supplying its `id` in the URL or the `url` of the deployment as a query parameter. You can obtain the ID, for example, by listing all deployments.
849
- */
850
- const deleteDeployment = (variables, signal) => fetch$1({ url: '/v13/deployments/{id}', method: 'delete', ...variables, signal });
851
- /**
852
- * Retrieves the active Vercel secrets for the authenticated user or team. By default it returns 20 secrets. The rest can be retrieved using the pagination options. The body will contain an entry for each secret.
853
- */
854
- const getSecrets = (variables, signal) => fetch$1({
855
- url: '/v3/secrets',
856
- method: 'get',
857
- ...variables,
858
- signal
859
- });
860
- /**
861
- * Allows to create a new secret.
862
- */
863
- const createSecret = (variables, signal) => fetch$1({
864
- url: '/v2/secrets/{name}',
865
- method: 'post',
866
- ...variables,
867
- signal
868
- });
869
- /**
870
- * Enables to edit the name of a secret. The name has to be unique to the user or team’s secrets.
871
- */
872
- const renameSecret = (variables, signal) => fetch$1({ url: '/v2/secrets/{name}', method: 'patch', ...variables, signal });
873
- /**
874
- * Retrieves the information for a specific secret by passing either the secret id or name in the URL.
875
- */
876
- const getSecret = (variables, signal) => fetch$1({
877
- url: '/v3/secrets/{idOrName}',
878
- method: 'get',
879
- ...variables,
880
- signal
881
- });
882
- /**
883
- * This deletes the user or team’s secret defined in the URL.
884
- */
885
- const deleteSecret = (variables, signal) => fetch$1({
886
- url: '/v2/secrets/{idOrName}',
887
- method: 'delete',
888
- ...variables,
889
- signal
890
- });
891
- const operationsByTag = {
892
- artifacts: { recordEvents, status, uploadArtifact, downloadArtifact, artifactQuery },
893
- checks: { createCheck, getAllChecks, getCheck, updateCheck, rerequestCheck },
894
- projects: {
895
- updateProjectDataCache,
896
- getProjects,
897
- createProject,
898
- getProject,
899
- updateProject,
900
- deleteProject,
901
- getProjectDomains,
902
- getProjectDomain,
903
- updateProjectDomain,
904
- removeProjectDomain,
905
- addProjectDomain,
906
- verifyProjectDomain,
907
- filterProjectEnvs,
908
- getProjectEnv,
909
- createProjectEnv,
910
- removeProjectEnv,
911
- editProjectEnv,
912
- pauseProject,
913
- unpauseProject
914
- },
915
- deployments: {
916
- getDeploymentEvents,
917
- getDeployment,
918
- createDeployment,
919
- cancelDeployment,
920
- uploadFile,
921
- listDeploymentFiles,
922
- getDeploymentFileContents,
923
- getDeployments,
924
- deleteDeployment
925
- },
926
- domains: {
927
- buyDomain,
928
- checkDomainPrice,
929
- checkDomainStatus,
930
- getDomainTransfer,
931
- getDomainConfig,
932
- getDomain,
933
- getDomains,
934
- createOrTransferDomain,
935
- patchDomain,
936
- deleteDomain
937
- },
938
- dns: { getRecords, createRecord, updateRecord, removeRecord },
939
- edgeConfig: {
940
- getEdgeConfigs,
941
- createEdgeConfig,
942
- getEdgeConfig,
943
- updateEdgeConfig,
944
- deleteEdgeConfig,
945
- getEdgeConfigItems,
946
- patchEdgeConfigItems,
947
- getEdgeConfigSchema,
948
- patchEdgeConfigSchema,
949
- deleteEdgeConfigSchema,
950
- getEdgeConfigItem,
951
- getEdgeConfigTokens,
952
- deleteEdgeConfigTokens,
953
- getEdgeConfigToken,
954
- createEdgeConfigToken
955
- },
956
- user: { listUserEvents, getAuthUser, requestDelete },
957
- integrations: { getConfigurations, getConfiguration, deleteConfiguration, gitNamespaces, searchRepo },
958
- logDrains: {
959
- getIntegrationLogDrains,
960
- createLogDrain,
961
- deleteIntegrationLogDrain,
962
- getConfigurableLogDrain,
963
- deleteConfigurableLogDrain,
964
- getAllLogDrains,
965
- createConfigurableLogDrain
966
- },
967
- projectMembers: { getProjectMembers, addProjectMember, removeProjectMember },
968
- teams: {
969
- getTeamMembers,
970
- inviteUserToTeam,
971
- requestAccessToTeam,
972
- getTeamAccessRequest,
973
- joinTeam,
974
- updateTeamMember,
975
- removeTeamMember,
976
- getTeam,
977
- patchTeam,
978
- getTeams,
979
- createTeam,
980
- deleteTeam,
981
- deleteTeamInviteCode
982
- },
983
- authentication: { listAuthTokens, createAuthToken, getAuthToken, deleteAuthToken, verifyToken, emailLogin },
984
- webhooks: { createWebhook, getWebhooks, getWebhook, deleteWebhook },
985
- aliases: { listAliases, getAlias, deleteAlias, listDeploymentAliases, assignAlias },
986
- certs: { getCertById, removeCert, issueCert, uploadCert },
987
- secrets: { getSecrets, createSecret, renameSecret, getSecret, deleteSecret }
90
+ // src/api/components.ts
91
+ var readAccessGroup = (variables, signal) => fetch2({ url: "/v1/access-groups/{idOrName}", method: "get", ...variables, signal });
92
+ var updateAccessGroup = (variables, signal) => fetch2({ url: "/v1/access-groups/{idOrName}", method: "post", ...variables, signal });
93
+ var deleteAccessGroup = (variables, signal) => fetch2({
94
+ url: "/v1/access-groups/{idOrName}",
95
+ method: "delete",
96
+ ...variables,
97
+ signal
98
+ });
99
+ var listAccessGroupMembers = (variables, signal) => fetch2({ url: "/v1/access-groups/{idOrName}/members", method: "get", ...variables, signal });
100
+ var listAccessGroups = (variables, signal) => fetch2({ url: "/v1/access-groups", method: "get", ...variables, signal });
101
+ var createAccessGroup = (variables, signal) => fetch2({ url: "/v1/access-groups", method: "post", ...variables, signal });
102
+ var listAccessGroupProjects = (variables, signal) => fetch2({ url: "/v1/access-groups/{idOrName}/projects", method: "get", ...variables, signal });
103
+ var recordEvents = (variables, signal) => fetch2({
104
+ url: "/v8/artifacts/events",
105
+ method: "post",
106
+ ...variables,
107
+ signal
108
+ });
109
+ var status = (variables, signal) => fetch2({
110
+ url: "/v8/artifacts/status",
111
+ method: "get",
112
+ ...variables,
113
+ signal
114
+ });
115
+ var uploadArtifact = (variables, signal) => fetch2({ url: "/v8/artifacts/{hash}", method: "put", ...variables, signal });
116
+ var downloadArtifact = (variables, signal) => fetch2({ url: "/v8/artifacts/{hash}", method: "get", ...variables, signal });
117
+ var artifactQuery = (variables, signal) => fetch2({
118
+ url: "/v8/artifacts",
119
+ method: "post",
120
+ ...variables,
121
+ signal
122
+ });
123
+ var createCheck = (variables, signal) => fetch2({ url: "/v1/deployments/{deploymentId}/checks", method: "post", ...variables, signal });
124
+ var getAllChecks = (variables, signal) => fetch2({
125
+ url: "/v1/deployments/{deploymentId}/checks",
126
+ method: "get",
127
+ ...variables,
128
+ signal
129
+ });
130
+ var getCheck = (variables, signal) => fetch2({
131
+ url: "/v1/deployments/{deploymentId}/checks/{checkId}",
132
+ method: "get",
133
+ ...variables,
134
+ signal
135
+ });
136
+ var updateCheck = (variables, signal) => fetch2({ url: "/v1/deployments/{deploymentId}/checks/{checkId}", method: "patch", ...variables, signal });
137
+ var rerequestCheck = (variables, signal) => fetch2({
138
+ url: "/v1/deployments/{deploymentId}/checks/{checkId}/rerequest",
139
+ method: "post",
140
+ ...variables,
141
+ signal
142
+ });
143
+ var updateProjectDataCache = (variables, signal) => fetch2({ url: "/v1/data-cache/projects/{projectId}", method: "patch", ...variables, signal });
144
+ var getDeploymentEvents = (variables, signal) => fetch2({ url: "/v2/deployments/{idOrUrl}/events", method: "get", ...variables, signal });
145
+ var getDeployment = (variables, signal) => fetch2({ url: "/v13/deployments/{idOrUrl}", method: "get", ...variables, signal });
146
+ var createDeployment = (variables, signal) => fetch2({ url: "/v13/deployments", method: "post", ...variables, signal });
147
+ var cancelDeployment = (variables, signal) => fetch2({ url: "/v12/deployments/{id}/cancel", method: "patch", ...variables, signal });
148
+ var buyDomain = (variables, signal) => fetch2({
149
+ url: "/v4/domains/buy",
150
+ method: "post",
151
+ ...variables,
152
+ signal
153
+ });
154
+ var checkDomainPrice = (variables, signal) => fetch2({
155
+ url: "/v4/domains/price",
156
+ method: "get",
157
+ ...variables,
158
+ signal
159
+ });
160
+ var getRecords = (variables, signal) => fetch2({ url: "/v4/domains/{domain}/records", method: "get", ...variables, signal });
161
+ var createRecord = (variables, signal) => fetch2({ url: "/v2/domains/{domain}/records", method: "post", ...variables, signal });
162
+ var updateRecord = (variables, signal) => fetch2({ url: "/v1/domains/records/{recordId}", method: "patch", ...variables, signal });
163
+ var removeRecord = (variables, signal) => fetch2({
164
+ url: "/v2/domains/{domain}/records/{recordId}",
165
+ method: "delete",
166
+ ...variables,
167
+ signal
168
+ });
169
+ var checkDomainStatus = (variables, signal) => fetch2({
170
+ url: "/v4/domains/status",
171
+ method: "get",
172
+ ...variables,
173
+ signal
174
+ });
175
+ var getDomainTransfer = (variables, signal) => fetch2({
176
+ url: "/v1/domains/{domain}/registry",
177
+ method: "get",
178
+ ...variables,
179
+ signal
180
+ });
181
+ var getDomainConfig = (variables, signal) => fetch2({ url: "/v6/domains/{domain}/config", method: "get", ...variables, signal });
182
+ var getDomain = (variables, signal) => fetch2({
183
+ url: "/v5/domains/{domain}",
184
+ method: "get",
185
+ ...variables,
186
+ signal
187
+ });
188
+ var getDomains = (variables, signal) => fetch2({
189
+ url: "/v5/domains",
190
+ method: "get",
191
+ ...variables,
192
+ signal
193
+ });
194
+ var createOrTransferDomain = (variables, signal) => fetch2({ url: "/v5/domains", method: "post", ...variables, signal });
195
+ var patchDomain = (variables, signal) => fetch2({ url: "/v3/domains/{domain}", method: "patch", ...variables, signal });
196
+ var deleteDomain = (variables, signal) => fetch2({
197
+ url: "/v6/domains/{domain}",
198
+ method: "delete",
199
+ ...variables,
200
+ signal
201
+ });
202
+ var getEdgeConfigs = (variables, signal) => fetch2({
203
+ url: "/v1/edge-config",
204
+ method: "get",
205
+ ...variables,
206
+ signal
207
+ });
208
+ var createEdgeConfig = (variables, signal) => fetch2({ url: "/v1/edge-config", method: "post", ...variables, signal });
209
+ var getEdgeConfig = (variables, signal) => fetch2({
210
+ url: "/v1/edge-config/{edgeConfigId}",
211
+ method: "get",
212
+ ...variables,
213
+ signal
214
+ });
215
+ var updateEdgeConfig = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}", method: "put", ...variables, signal });
216
+ var deleteEdgeConfig = (variables, signal) => fetch2({
217
+ url: "/v1/edge-config/{edgeConfigId}",
218
+ method: "delete",
219
+ ...variables,
220
+ signal
221
+ });
222
+ var getEdgeConfigItems = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/items", method: "get", ...variables, signal });
223
+ var patchEdgeConfigItems = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/items", method: "patch", ...variables, signal });
224
+ var getEdgeConfigSchema = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/schema", method: "get", ...variables, signal });
225
+ var patchEdgeConfigSchema = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/schema", method: "post", ...variables, signal });
226
+ var deleteEdgeConfigSchema = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/schema", method: "delete", ...variables, signal });
227
+ var getEdgeConfigItem = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/item/{edgeConfigItemKey}", method: "get", ...variables, signal });
228
+ var getEdgeConfigTokens = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/tokens", method: "get", ...variables, signal });
229
+ var deleteEdgeConfigTokens = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/tokens", method: "delete", ...variables, signal });
230
+ var getEdgeConfigToken = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/token/{token}", method: "get", ...variables, signal });
231
+ var createEdgeConfigToken = (variables, signal) => fetch2({ url: "/v1/edge-config/{edgeConfigId}/token", method: "post", ...variables, signal });
232
+ var listUserEvents = (variables, signal) => fetch2({
233
+ url: "/v3/events",
234
+ method: "get",
235
+ ...variables,
236
+ signal
237
+ });
238
+ var getConfigurations = (variables, signal) => fetch2({ url: "/v1/integrations/configurations", method: "get", ...variables, signal });
239
+ var getConfiguration = (variables, signal) => fetch2({ url: "/v1/integrations/configuration/{id}", method: "get", ...variables, signal });
240
+ var deleteConfiguration = (variables, signal) => fetch2({ url: "/v1/integrations/configuration/{id}", method: "delete", ...variables, signal });
241
+ var getIntegrationLogDrains = (variables, signal) => fetch2({ url: "/v2/integrations/log-drains", method: "get", ...variables, signal });
242
+ var createLogDrain = (variables, signal) => fetch2({
243
+ url: "/v2/integrations/log-drains",
244
+ method: "post",
245
+ ...variables,
246
+ signal
247
+ });
248
+ var deleteIntegrationLogDrain = (variables, signal) => fetch2({ url: "/v1/integrations/log-drains/{id}", method: "delete", ...variables, signal });
249
+ var gitNamespaces = (variables, signal) => fetch2({
250
+ url: "/v1/integrations/git-namespaces",
251
+ method: "get",
252
+ ...variables,
253
+ signal
254
+ });
255
+ var searchRepo = (variables, signal) => fetch2({
256
+ url: "/v1/integrations/search-repo",
257
+ method: "get",
258
+ ...variables,
259
+ signal
260
+ });
261
+ var getConfigurableLogDrain = (variables, signal) => fetch2({ url: "/v1/log-drains/{id}", method: "get", ...variables, signal });
262
+ var deleteConfigurableLogDrain = (variables, signal) => fetch2({ url: "/v1/log-drains/{id}", method: "delete", ...variables, signal });
263
+ var getAllLogDrains = (variables, signal) => fetch2({
264
+ url: "/v1/log-drains",
265
+ method: "get",
266
+ ...variables,
267
+ signal
268
+ });
269
+ var createConfigurableLogDrain = (variables, signal) => fetch2({ url: "/v1/log-drains", method: "post", ...variables, signal });
270
+ var getProjectMembers = (variables, signal) => fetch2({ url: "/v1/projects/{idOrName}/members", method: "get", ...variables, signal });
271
+ var addProjectMember = (variables, signal) => fetch2({ url: "/v1/projects/{idOrName}/members", method: "post", ...variables, signal });
272
+ var removeProjectMember = (variables, signal) => fetch2({ url: "/v1/projects/{idOrName}/members/{uid}", method: "delete", ...variables, signal });
273
+ var getProjects = (variables, signal) => fetch2({
274
+ url: "/v9/projects",
275
+ method: "get",
276
+ ...variables,
277
+ signal
278
+ });
279
+ var createProject = (variables, signal) => fetch2({
280
+ url: "/v10/projects",
281
+ method: "post",
282
+ ...variables,
283
+ signal
284
+ });
285
+ var getProject = (variables, signal) => fetch2({
286
+ url: "/v9/projects/{idOrName}",
287
+ method: "get",
288
+ ...variables,
289
+ signal
290
+ });
291
+ var updateProject = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}", method: "patch", ...variables, signal });
292
+ var deleteProject = (variables, signal) => fetch2({
293
+ url: "/v9/projects/{idOrName}",
294
+ method: "delete",
295
+ ...variables,
296
+ signal
297
+ });
298
+ var getProjectDomains = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/domains", method: "get", ...variables, signal });
299
+ var getProjectDomain = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/domains/{domain}", method: "get", ...variables, signal });
300
+ var updateProjectDomain = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/domains/{domain}", method: "patch", ...variables, signal });
301
+ var removeProjectDomain = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/domains/{domain}", method: "delete", ...variables, signal });
302
+ var addProjectDomain = (variables, signal) => fetch2({ url: "/v10/projects/{idOrName}/domains", method: "post", ...variables, signal });
303
+ var verifyProjectDomain = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/domains/{domain}/verify", method: "post", ...variables, signal });
304
+ var filterProjectEnvs = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/env", method: "get", ...variables, signal });
305
+ var getProjectEnv = (variables, signal) => fetch2({ url: "/v1/projects/{idOrName}/env/{id}", method: "get", ...variables, signal });
306
+ var createProjectEnv = (variables, signal) => fetch2({ url: "/v10/projects/{idOrName}/env", method: "post", ...variables, signal });
307
+ var removeProjectEnv = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/env/{id}", method: "delete", ...variables, signal });
308
+ var editProjectEnv = (variables, signal) => fetch2({ url: "/v9/projects/{idOrName}/env/{id}", method: "patch", ...variables, signal });
309
+ var requestPromote = (variables, signal) => fetch2({
310
+ url: "/v10/projects/{projectId}/promote/{deploymentId}",
311
+ method: "post",
312
+ ...variables,
313
+ signal
314
+ });
315
+ var listPromoteAliases = (variables, signal) => fetch2({ url: "/v1/projects/{projectId}/promote/aliases", method: "get", ...variables, signal });
316
+ var pauseProject = (variables, signal) => fetch2({
317
+ url: "/v1/projects/{projectId}/pause",
318
+ method: "post",
319
+ ...variables,
320
+ signal
321
+ });
322
+ var unpauseProject = (variables, signal) => fetch2({
323
+ url: "/v1/projects/{projectId}/unpause",
324
+ method: "post",
325
+ ...variables,
326
+ signal
327
+ });
328
+ var getTeamMembers = (variables, signal) => fetch2({
329
+ url: "/v2/teams/{teamId}/members",
330
+ method: "get",
331
+ ...variables,
332
+ signal
333
+ });
334
+ var inviteUserToTeam = (variables, signal) => fetch2({ url: "/v1/teams/{teamId}/members", method: "post", ...variables, signal });
335
+ var requestAccessToTeam = (variables, signal) => fetch2({
336
+ url: "/v1/teams/{teamId}/request",
337
+ method: "post",
338
+ ...variables,
339
+ signal
340
+ });
341
+ var getTeamAccessRequest = (variables, signal) => fetch2({
342
+ url: "/v1/teams/{teamId}/request/{userId}",
343
+ method: "get",
344
+ ...variables,
345
+ signal
346
+ });
347
+ var joinTeam = (variables, signal) => fetch2({
348
+ url: "/v1/teams/{teamId}/members/teams/join",
349
+ method: "post",
350
+ ...variables,
351
+ signal
352
+ });
353
+ var updateTeamMember = (variables, signal) => fetch2({ url: "/v1/teams/{teamId}/members/{uid}", method: "patch", ...variables, signal });
354
+ var removeTeamMember = (variables, signal) => fetch2({ url: "/v1/teams/{teamId}/members/{uid}", method: "delete", ...variables, signal });
355
+ var getTeam = (variables, signal) => fetch2({
356
+ url: "/v2/teams/{teamId}",
357
+ method: "get",
358
+ ...variables,
359
+ signal
360
+ });
361
+ var patchTeam = (variables, signal) => fetch2({
362
+ url: "/v2/teams/{teamId}",
363
+ method: "patch",
364
+ ...variables,
365
+ signal
366
+ });
367
+ var getTeams = (variables, signal) => fetch2({
368
+ url: "/v2/teams",
369
+ method: "get",
370
+ ...variables,
371
+ signal
372
+ });
373
+ var createTeam = (variables, signal) => fetch2({
374
+ url: "/v1/teams",
375
+ method: "post",
376
+ ...variables,
377
+ signal
378
+ });
379
+ var deleteTeam = (variables, signal) => fetch2({
380
+ url: "/v1/teams/{teamId}",
381
+ method: "delete",
382
+ ...variables,
383
+ signal
384
+ });
385
+ var deleteTeamInviteCode = (variables, signal) => fetch2({
386
+ url: "/v1/teams/{teamId}/invites/{inviteId}",
387
+ method: "delete",
388
+ ...variables,
389
+ signal
390
+ });
391
+ var uploadFile = (variables, signal) => fetch2({ url: "/v2/files", method: "post", ...variables, signal });
392
+ var getAuthUser = (variables, signal) => fetch2({
393
+ url: "/v2/user",
394
+ method: "get",
395
+ ...variables,
396
+ signal
397
+ });
398
+ var requestDelete = (variables, signal) => fetch2({
399
+ url: "/v1/user",
400
+ method: "delete",
401
+ ...variables,
402
+ signal
403
+ });
404
+ var listAuthTokens = (variables, signal) => fetch2({
405
+ url: "/v5/user/tokens",
406
+ method: "get",
407
+ ...variables,
408
+ signal
409
+ });
410
+ var createAuthToken = (variables, signal) => fetch2({ url: "/v3/user/tokens", method: "post", ...variables, signal });
411
+ var getAuthToken = (variables, signal) => fetch2({
412
+ url: "/v5/user/tokens/{tokenId}",
413
+ method: "get",
414
+ ...variables,
415
+ signal
416
+ });
417
+ var deleteAuthToken = (variables, signal) => fetch2({
418
+ url: "/v3/user/tokens/{tokenId}",
419
+ method: "delete",
420
+ ...variables,
421
+ signal
422
+ });
423
+ var createWebhook = (variables, signal) => fetch2({
424
+ url: "/v1/webhooks",
425
+ method: "post",
426
+ ...variables,
427
+ signal
428
+ });
429
+ var getWebhooks = (variables, signal) => fetch2({ url: "/v1/webhooks", method: "get", ...variables, signal });
430
+ var getWebhook = (variables, signal) => fetch2({
431
+ url: "/v1/webhooks/{id}",
432
+ method: "get",
433
+ ...variables,
434
+ signal
435
+ });
436
+ var deleteWebhook = (variables, signal) => fetch2({
437
+ url: "/v1/webhooks/{id}",
438
+ method: "delete",
439
+ ...variables,
440
+ signal
441
+ });
442
+ var listAliases = (variables, signal) => fetch2({
443
+ url: "/v4/aliases",
444
+ method: "get",
445
+ ...variables,
446
+ signal
447
+ });
448
+ var getAlias = (variables, signal) => fetch2({
449
+ url: "/v4/aliases/{idOrAlias}",
450
+ method: "get",
451
+ ...variables,
452
+ signal
453
+ });
454
+ var deleteAlias = (variables, signal) => fetch2({
455
+ url: "/v2/aliases/{aliasId}",
456
+ method: "delete",
457
+ ...variables,
458
+ signal
459
+ });
460
+ var listDeploymentAliases = (variables, signal) => fetch2({ url: "/v2/deployments/{id}/aliases", method: "get", ...variables, signal });
461
+ var assignAlias = (variables, signal) => fetch2({ url: "/v2/deployments/{id}/aliases", method: "post", ...variables, signal });
462
+ var getCertById = (variables, signal) => fetch2({
463
+ url: "/v7/certs/{id}",
464
+ method: "get",
465
+ ...variables,
466
+ signal
467
+ });
468
+ var removeCert = (variables, signal) => fetch2({
469
+ url: "/v7/certs/{id}",
470
+ method: "delete",
471
+ ...variables,
472
+ signal
473
+ });
474
+ var issueCert = (variables, signal) => fetch2({
475
+ url: "/v7/certs",
476
+ method: "post",
477
+ ...variables,
478
+ signal
479
+ });
480
+ var uploadCert = (variables, signal) => fetch2({
481
+ url: "/v7/certs",
482
+ method: "put",
483
+ ...variables,
484
+ signal
485
+ });
486
+ var listDeploymentFiles = (variables, signal) => fetch2({ url: "/v6/deployments/{id}/files", method: "get", ...variables, signal });
487
+ var getDeploymentFileContents = (variables, signal) => fetch2({ url: "/v7/deployments/{id}/files/{fileId}", method: "get", ...variables, signal });
488
+ var getDeployments = (variables, signal) => fetch2({
489
+ url: "/v6/deployments",
490
+ method: "get",
491
+ ...variables,
492
+ signal
493
+ });
494
+ var verifyToken = (variables, signal) => fetch2({
495
+ url: "/registration/verify",
496
+ method: "get",
497
+ ...variables,
498
+ signal
499
+ });
500
+ var emailLogin = (variables, signal) => fetch2({ url: "/registration", method: "post", ...variables, signal });
501
+ var deleteDeployment = (variables, signal) => fetch2({ url: "/v13/deployments/{id}", method: "delete", ...variables, signal });
502
+ var getSecrets = (variables, signal) => fetch2({
503
+ url: "/v3/secrets",
504
+ method: "get",
505
+ ...variables,
506
+ signal
507
+ });
508
+ var createSecret = (variables, signal) => fetch2({
509
+ url: "/v2/secrets/{name}",
510
+ method: "post",
511
+ ...variables,
512
+ signal
513
+ });
514
+ var renameSecret = (variables, signal) => fetch2({ url: "/v2/secrets/{name}", method: "patch", ...variables, signal });
515
+ var getSecret = (variables, signal) => fetch2({
516
+ url: "/v3/secrets/{idOrName}",
517
+ method: "get",
518
+ ...variables,
519
+ signal
520
+ });
521
+ var deleteSecret = (variables, signal) => fetch2({
522
+ url: "/v2/secrets/{idOrName}",
523
+ method: "delete",
524
+ ...variables,
525
+ signal
526
+ });
527
+ var operationsByTag = {
528
+ accessGroups: {
529
+ readAccessGroup,
530
+ updateAccessGroup,
531
+ deleteAccessGroup,
532
+ listAccessGroupMembers,
533
+ listAccessGroups,
534
+ createAccessGroup,
535
+ listAccessGroupProjects
536
+ },
537
+ artifacts: { recordEvents, status, uploadArtifact, downloadArtifact, artifactQuery },
538
+ checks: { createCheck, getAllChecks, getCheck, updateCheck, rerequestCheck },
539
+ projects: {
540
+ updateProjectDataCache,
541
+ getProjects,
542
+ createProject,
543
+ getProject,
544
+ updateProject,
545
+ deleteProject,
546
+ getProjectDomains,
547
+ getProjectDomain,
548
+ updateProjectDomain,
549
+ removeProjectDomain,
550
+ addProjectDomain,
551
+ verifyProjectDomain,
552
+ filterProjectEnvs,
553
+ getProjectEnv,
554
+ createProjectEnv,
555
+ removeProjectEnv,
556
+ editProjectEnv,
557
+ requestPromote,
558
+ listPromoteAliases,
559
+ pauseProject,
560
+ unpauseProject
561
+ },
562
+ deployments: {
563
+ getDeploymentEvents,
564
+ getDeployment,
565
+ createDeployment,
566
+ cancelDeployment,
567
+ uploadFile,
568
+ listDeploymentFiles,
569
+ getDeploymentFileContents,
570
+ getDeployments,
571
+ deleteDeployment
572
+ },
573
+ domains: {
574
+ buyDomain,
575
+ checkDomainPrice,
576
+ checkDomainStatus,
577
+ getDomainTransfer,
578
+ getDomainConfig,
579
+ getDomain,
580
+ getDomains,
581
+ createOrTransferDomain,
582
+ patchDomain,
583
+ deleteDomain
584
+ },
585
+ dns: { getRecords, createRecord, updateRecord, removeRecord },
586
+ edgeConfig: {
587
+ getEdgeConfigs,
588
+ createEdgeConfig,
589
+ getEdgeConfig,
590
+ updateEdgeConfig,
591
+ deleteEdgeConfig,
592
+ getEdgeConfigItems,
593
+ patchEdgeConfigItems,
594
+ getEdgeConfigSchema,
595
+ patchEdgeConfigSchema,
596
+ deleteEdgeConfigSchema,
597
+ getEdgeConfigItem,
598
+ getEdgeConfigTokens,
599
+ deleteEdgeConfigTokens,
600
+ getEdgeConfigToken,
601
+ createEdgeConfigToken
602
+ },
603
+ user: { listUserEvents, getAuthUser, requestDelete },
604
+ integrations: { getConfigurations, getConfiguration, deleteConfiguration, gitNamespaces, searchRepo },
605
+ logDrains: {
606
+ getIntegrationLogDrains,
607
+ createLogDrain,
608
+ deleteIntegrationLogDrain,
609
+ getConfigurableLogDrain,
610
+ deleteConfigurableLogDrain,
611
+ getAllLogDrains,
612
+ createConfigurableLogDrain
613
+ },
614
+ projectMembers: { getProjectMembers, addProjectMember, removeProjectMember },
615
+ teams: {
616
+ getTeamMembers,
617
+ inviteUserToTeam,
618
+ requestAccessToTeam,
619
+ getTeamAccessRequest,
620
+ joinTeam,
621
+ updateTeamMember,
622
+ removeTeamMember,
623
+ getTeam,
624
+ patchTeam,
625
+ getTeams,
626
+ createTeam,
627
+ deleteTeam,
628
+ deleteTeamInviteCode
629
+ },
630
+ authentication: { listAuthTokens, createAuthToken, getAuthToken, deleteAuthToken, verifyToken, emailLogin },
631
+ webhooks: { createWebhook, getWebhooks, getWebhook, deleteWebhook },
632
+ aliases: { listAliases, getAlias, deleteAlias, listDeploymentAliases, assignAlias },
633
+ certs: { getCertById, removeCert, issueCert, uploadCert },
634
+ secrets: { getSecrets, createSecret, renameSecret, getSecret, deleteSecret }
988
635
  };
989
636
 
637
+ // src/utils/fetch.ts
990
638
  function formEncoded(data) {
991
- return Object.entries(data)
992
- .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
993
- .join('&');
639
+ return Object.entries(data).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&");
994
640
  }
995
641
 
996
- var _VercelApi_token, _VercelApi_fetch;
997
- class VercelApi {
998
- constructor(options) {
999
- _VercelApi_token.set(this, void 0);
1000
- _VercelApi_fetch.set(this, void 0);
1001
- __classPrivateFieldSet(this, _VercelApi_token, options.token, "f");
1002
- __classPrivateFieldSet(this, _VercelApi_fetch, options.fetch || fetch, "f");
1003
- if (!__classPrivateFieldGet(this, _VercelApi_fetch, "f"))
1004
- throw new Error('Fetch is required');
1005
- }
1006
- get api() {
1007
- const token = __classPrivateFieldGet(this, _VercelApi_token, "f");
1008
- const fetchImpl = __classPrivateFieldGet(this, _VercelApi_fetch, "f");
1009
- return new Proxy({}, {
1010
- get: (_target, namespace) => {
1011
- if (operationsByTag[namespace] === undefined) {
1012
- return undefined;
642
+ // src/client.ts
643
+ var _token, _fetch;
644
+ var VercelApi = class {
645
+ constructor(options) {
646
+ __privateAdd(this, _token, void 0);
647
+ __privateAdd(this, _fetch, void 0);
648
+ __privateSet(this, _token, options.token);
649
+ __privateSet(this, _fetch, options.fetch || fetch);
650
+ if (!__privateGet(this, _fetch))
651
+ throw new Error("Fetch is required");
652
+ }
653
+ get api() {
654
+ const token = __privateGet(this, _token);
655
+ const fetchImpl = __privateGet(this, _fetch);
656
+ return new Proxy(
657
+ {},
658
+ {
659
+ get: (_target, namespace) => {
660
+ if (operationsByTag[namespace] === void 0) {
661
+ return void 0;
662
+ }
663
+ return new Proxy(
664
+ {},
665
+ {
666
+ get: (_target2, operation) => {
667
+ if (operationsByTag[namespace][operation] === void 0) {
668
+ return void 0;
1013
669
  }
1014
- return new Proxy({}, {
1015
- get: (_target, operation) => {
1016
- if (operationsByTag[namespace][operation] === undefined) {
1017
- return undefined;
1018
- }
1019
- const method = operationsByTag[namespace][operation];
1020
- return async (params) => {
1021
- return await method({ ...params, token, fetchImpl });
1022
- };
1023
- }
1024
- });
670
+ const method = operationsByTag[namespace][operation];
671
+ return async (params) => {
672
+ return await method({ ...params, token, fetchImpl });
673
+ };
674
+ }
1025
675
  }
676
+ );
677
+ }
678
+ }
679
+ );
680
+ }
681
+ get auth() {
682
+ return {
683
+ accessToken: async ({
684
+ code,
685
+ redirectUri,
686
+ clientId,
687
+ clientSecret
688
+ }) => {
689
+ const result = await fetch2({
690
+ method: "POST",
691
+ url: `/v2/oauth/access_token`,
692
+ token: null,
693
+ fetchImpl: __privateGet(this, _fetch),
694
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
695
+ body: formEncoded({ code, redirect_uri: redirectUri, client_id: clientId, client_secret: clientSecret })
1026
696
  });
1027
- }
1028
- get auth() {
1029
697
  return {
1030
- accessToken: async ({ code, redirectUri, clientId, clientSecret }) => {
1031
- const result = await fetch$1({
1032
- method: 'POST',
1033
- url: `/v2/oauth/access_token`,
1034
- token: null,
1035
- fetchImpl: __classPrivateFieldGet(this, _VercelApi_fetch, "f"),
1036
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
1037
- body: formEncoded({ code, redirect_uri: redirectUri, client_id: clientId, client_secret: clientSecret })
1038
- });
1039
- return {
1040
- accessToken: result.access_token,
1041
- tokenType: result.token_type,
1042
- installationId: result.installation_id,
1043
- userId: result.user_id,
1044
- teamId: result.team_id
1045
- };
1046
- }
698
+ accessToken: result.access_token,
699
+ tokenType: result.token_type,
700
+ installationId: result.installation_id,
701
+ userId: result.user_id,
702
+ teamId: result.team_id
1047
703
  };
1048
- }
1049
- async request(endpoint, params) {
1050
- const [method = '', url = ''] = endpoint.split(' ');
1051
- const extraParams = (params || {});
1052
- const result = await fetch$1({ ...extraParams, method, url, token: __classPrivateFieldGet(this, _VercelApi_token, "f"), fetchImpl: __classPrivateFieldGet(this, _VercelApi_fetch, "f") });
1053
- return result;
1054
- }
1055
- }
1056
- _VercelApi_token = new WeakMap(), _VercelApi_fetch = new WeakMap();
1057
-
1058
- export { VercelApi };
704
+ }
705
+ };
706
+ }
707
+ async request(endpoint, params) {
708
+ const [method = "", url = ""] = endpoint.split(" ");
709
+ const extraParams = params || {};
710
+ const result = await fetch2({ ...extraParams, method, url, token: __privateGet(this, _token), fetchImpl: __privateGet(this, _fetch) });
711
+ return result;
712
+ }
713
+ };
714
+ _token = new WeakMap();
715
+ _fetch = new WeakMap();
716
+ export {
717
+ VercelApi
718
+ };
719
+ //# sourceMappingURL=index.mjs.map