netlify-api 1.2.0 → 1.3.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/effect.mjs CHANGED
@@ -1,3850 +1,6 @@
1
1
  import { createEffectApi, createEffectByPath } from '@sferadev/openapi-utils/effect';
2
2
  export { ApiConfig, ApiError, NetworkError, ValidationError, makeApiLayer } from '@sferadev/openapi-utils/effect';
3
-
4
- function notEmpty(value) {
5
- return value !== null && value !== undefined;
6
- }
7
- function compactObject(obj) {
8
- return Object.fromEntries(Object.entries(obj).filter(([, value])=>notEmpty(value)));
9
- }
10
-
11
- const baseUrl = "https://api.netlify.com";
12
- async function client({ url, method, body, headers, pathParams, queryParams, signal, token = null, basePath = "/api/v1", fetchImpl = fetch }) {
13
- try {
14
- const requestHeaders = compactObject({
15
- "Content-Type": "application/json",
16
- Authorization: token ? `Bearer ${token}` : undefined,
17
- ...headers
18
- });
19
- if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
20
- delete requestHeaders["Content-Type"];
21
- }
22
- const payload = body instanceof FormData ? body : requestHeaders["Content-Type"] === "application/json" ? JSON.stringify(body) : body;
23
- const fullUrl = `${baseUrl}${basePath}${resolveUrl(url, queryParams, pathParams)}`;
24
- const response = await fetchImpl(fullUrl, {
25
- signal,
26
- method: method.toUpperCase(),
27
- body: payload,
28
- headers: requestHeaders
29
- });
30
- if (!response.ok) {
31
- let error;
32
- try {
33
- error = await response.json();
34
- } catch (e) {
35
- error = {
36
- status: "unknown",
37
- payload: e instanceof Error ? `Unexpected error (${e.message})` : "Unexpected error"
38
- };
39
- }
40
- throw error;
41
- }
42
- if (response.headers?.get("content-type")?.includes("json")) {
43
- return await response.json();
44
- } else {
45
- return await response.text();
46
- }
47
- } catch (e) {
48
- const errorObject = {
49
- name: "unknown",
50
- message: e instanceof Error ? `Network error (${e.message})` : "Network error",
51
- stack: e
52
- };
53
- throw errorObject;
54
- }
55
- }
56
- const resolveUrl = (url, queryParams = {}, pathParams = {})=>{
57
- let query = new URLSearchParams(queryParams).toString();
58
- if (query) query = `?${query}`;
59
- return url.replace(/\{\w*\}/g, (key)=>pathParams[key.slice(1, -1)] ?? "") + query;
60
- };
61
-
62
- /**
63
- * @description **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
64
- * @link /sites
65
- */ async function listSites({ queryParams, config } = {}) {
66
- const { client: request = client, ...requestConfig } = config ?? {};
67
- const data = await request({
68
- method: "GET",
69
- url: `/sites`,
70
- queryParams,
71
- ...requestConfig,
72
- headers: {
73
- ...requestConfig.headers
74
- }
75
- });
76
- return data;
77
- }
78
- /**
79
- * @description **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site.
80
- * @link /sites
81
- */ async function createSite({ body, queryParams, config } = {}) {
82
- const { client: request = client, ...requestConfig } = config ?? {};
83
- const data = await request({
84
- method: "POST",
85
- url: `/sites`,
86
- queryParams,
87
- body: body,
88
- ...requestConfig,
89
- headers: {
90
- ...requestConfig.headers
91
- }
92
- });
93
- return data;
94
- }
95
- /**
96
- * @description **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
97
- * @link /sites/{site_id}
98
- */ async function getSite({ pathParams, queryParams, config } = {}) {
99
- const { client: request = client, ...requestConfig } = config ?? {};
100
- if (!pathParams.site_id) {
101
- throw new Error(`Missing required path parameter: site_id`);
102
- }
103
- const data = await request({
104
- method: "GET",
105
- url: `/sites/${pathParams.site_id}`,
106
- queryParams,
107
- ...requestConfig,
108
- headers: {
109
- ...requestConfig.headers
110
- }
111
- });
112
- return data;
113
- }
114
- /**
115
- * @description **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [updateEnvVar](#tag/environmentVariables/operation/updateEnvVar) to update a site's environment variables.
116
- * @link /sites/{site_id}
117
- */ async function updateSite({ pathParams, body, config } = {}) {
118
- const { client: request = client, ...requestConfig } = config ?? {};
119
- if (!pathParams.site_id) {
120
- throw new Error(`Missing required path parameter: site_id`);
121
- }
122
- const data = await request({
123
- method: "PATCH",
124
- url: `/sites/${pathParams.site_id}`,
125
- body: body,
126
- ...requestConfig,
127
- headers: {
128
- ...requestConfig.headers
129
- }
130
- });
131
- return data;
132
- }
133
- /**
134
- * @link /sites/{site_id}
135
- */ async function deleteSite({ pathParams, config } = {}) {
136
- const { client: request = client, ...requestConfig } = config ?? {};
137
- if (!pathParams.site_id) {
138
- throw new Error(`Missing required path parameter: site_id`);
139
- }
140
- const data = await request({
141
- method: "DELETE",
142
- url: `/sites/${pathParams.site_id}`,
143
- ...requestConfig,
144
- headers: {
145
- ...requestConfig.headers
146
- }
147
- });
148
- return data;
149
- }
150
- /**
151
- * @description Provisions or updates a TLS certificate for the site.
152
- * **Creating a certificate (site has no certificate):**
153
- * - Omit certificate params to initiate Let's Encrypt provisioning
154
- * - Provide certificate, key, and ca_certificates to upload a custom certificate
155
- * **Updating a certificate (site already has a certificate):**
156
- * - REQUIRES certificate, key, and ca_certificates to replace with a new custom certificate
157
- * - Use POST /api/v1/sites/{site_id}/ssl/renew to renew an existing Let's Encrypt certificate
158
- * @link /sites/{site_id}/ssl
159
- */ async function provisionSiteTLSCertificate({ pathParams, queryParams, config } = {}) {
160
- const { client: request = client, ...requestConfig } = config ?? {};
161
- if (!pathParams.site_id) {
162
- throw new Error(`Missing required path parameter: site_id`);
163
- }
164
- const data = await request({
165
- method: "POST",
166
- url: `/sites/${pathParams.site_id}/ssl`,
167
- queryParams,
168
- ...requestConfig,
169
- headers: {
170
- ...requestConfig.headers
171
- }
172
- });
173
- return data;
174
- }
175
- /**
176
- * @link /sites/{site_id}/ssl
177
- */ async function showSiteTLSCertificate({ pathParams, config } = {}) {
178
- const { client: request = client, ...requestConfig } = config ?? {};
179
- if (!pathParams.site_id) {
180
- throw new Error(`Missing required path parameter: site_id`);
181
- }
182
- const data = await request({
183
- method: "GET",
184
- url: `/sites/${pathParams.site_id}/ssl`,
185
- ...requestConfig,
186
- headers: {
187
- ...requestConfig.headers
188
- }
189
- });
190
- return data;
191
- }
192
- /**
193
- * @link /sites/{site_id}/ssl/certificates
194
- */ async function getAllCertificates({ pathParams, queryParams, config } = {}) {
195
- const { client: request = client, ...requestConfig } = config ?? {};
196
- if (!pathParams.site_id) {
197
- throw new Error(`Missing required path parameter: site_id`);
198
- }
199
- const data = await request({
200
- method: "GET",
201
- url: `/sites/${pathParams.site_id}/ssl/certificates`,
202
- queryParams,
203
- ...requestConfig,
204
- headers: {
205
- ...requestConfig.headers
206
- }
207
- });
208
- return data;
209
- }
210
- /**
211
- * @description Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI.
212
- * @link /accounts/{account_id}/env
213
- */ async function getEnvVars({ pathParams, queryParams, config } = {}) {
214
- const { client: request = client, ...requestConfig } = config ?? {};
215
- if (!pathParams.account_id) {
216
- throw new Error(`Missing required path parameter: account_id`);
217
- }
218
- const data = await request({
219
- method: "GET",
220
- url: `/accounts/${pathParams.account_id}/env`,
221
- queryParams,
222
- ...requestConfig,
223
- headers: {
224
- ...requestConfig.headers
225
- }
226
- });
227
- return data;
228
- }
229
- /**
230
- * @description Creates new environment variables. Granular scopes are available on Pro plans and above.
231
- * @link /accounts/{account_id}/env
232
- */ async function createEnvVars({ pathParams, body, queryParams, config } = {}) {
233
- const { client: request = client, ...requestConfig } = config ?? {};
234
- if (!pathParams.account_id) {
235
- throw new Error(`Missing required path parameter: account_id`);
236
- }
237
- const data = await request({
238
- method: "POST",
239
- url: `/accounts/${pathParams.account_id}/env`,
240
- queryParams,
241
- body: body,
242
- ...requestConfig,
243
- headers: {
244
- ...requestConfig.headers
245
- }
246
- });
247
- return data;
248
- }
249
- /**
250
- * @description Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn't require an `account_id` as input.
251
- * @link /api/v1/sites/{site_id}/env
252
- */ async function getSiteEnvVars({ pathParams, queryParams, config } = {}) {
253
- const { client: request = client, ...requestConfig } = config ?? {};
254
- if (!pathParams.site_id) {
255
- throw new Error(`Missing required path parameter: site_id`);
256
- }
257
- const data = await request({
258
- method: "GET",
259
- url: `/api/v1/sites/${pathParams.site_id}/env`,
260
- queryParams,
261
- ...requestConfig,
262
- headers: {
263
- ...requestConfig.headers
264
- }
265
- });
266
- return data;
267
- }
268
- /**
269
- * @description Returns an individual environment variable.
270
- * @link /accounts/{account_id}/env/{key}
271
- */ async function getEnvVar({ pathParams, queryParams, config } = {}) {
272
- const { client: request = client, ...requestConfig } = config ?? {};
273
- if (!pathParams.account_id) {
274
- throw new Error(`Missing required path parameter: account_id`);
275
- }
276
- if (!pathParams.key) {
277
- throw new Error(`Missing required path parameter: key`);
278
- }
279
- const data = await request({
280
- method: "GET",
281
- url: `/accounts/${pathParams.account_id}/env/${pathParams.key}`,
282
- queryParams,
283
- ...requestConfig,
284
- headers: {
285
- ...requestConfig.headers
286
- }
287
- });
288
- return data;
289
- }
290
- /**
291
- * @description Updates an existing environment variable and all of its values. Existing values will be replaced by values provided.
292
- * @link /accounts/{account_id}/env/{key}
293
- */ async function updateEnvVar({ pathParams, body, queryParams, config } = {}) {
294
- const { client: request = client, ...requestConfig } = config ?? {};
295
- if (!pathParams.account_id) {
296
- throw new Error(`Missing required path parameter: account_id`);
297
- }
298
- if (!pathParams.key) {
299
- throw new Error(`Missing required path parameter: key`);
300
- }
301
- const data = await request({
302
- method: "PUT",
303
- url: `/accounts/${pathParams.account_id}/env/${pathParams.key}`,
304
- queryParams,
305
- body: body,
306
- ...requestConfig,
307
- headers: {
308
- ...requestConfig.headers
309
- }
310
- });
311
- return data;
312
- }
313
- /**
314
- * @description Updates or creates a new value for an existing environment variable.
315
- * @link /accounts/{account_id}/env/{key}
316
- */ async function setEnvVarValue({ pathParams, body, queryParams, config } = {}) {
317
- const { client: request = client, ...requestConfig } = config ?? {};
318
- if (!pathParams.account_id) {
319
- throw new Error(`Missing required path parameter: account_id`);
320
- }
321
- if (!pathParams.key) {
322
- throw new Error(`Missing required path parameter: key`);
323
- }
324
- const data = await request({
325
- method: "PATCH",
326
- url: `/accounts/${pathParams.account_id}/env/${pathParams.key}`,
327
- queryParams,
328
- body: body,
329
- ...requestConfig,
330
- headers: {
331
- ...requestConfig.headers
332
- }
333
- });
334
- return data;
335
- }
336
- /**
337
- * @description Deletes an environment variable
338
- * @link /accounts/{account_id}/env/{key}
339
- */ async function deleteEnvVar({ pathParams, queryParams, config } = {}) {
340
- const { client: request = client, ...requestConfig } = config ?? {};
341
- if (!pathParams.account_id) {
342
- throw new Error(`Missing required path parameter: account_id`);
343
- }
344
- if (!pathParams.key) {
345
- throw new Error(`Missing required path parameter: key`);
346
- }
347
- const data = await request({
348
- method: "DELETE",
349
- url: `/accounts/${pathParams.account_id}/env/${pathParams.key}`,
350
- queryParams,
351
- ...requestConfig,
352
- headers: {
353
- ...requestConfig.headers
354
- }
355
- });
356
- return data;
357
- }
358
- /**
359
- * @description Deletes a specific environment variable value.
360
- * @link /accounts/{account_id}/env/{key}/value/{id}
361
- */ async function deleteEnvVarValue({ pathParams, queryParams, config } = {}) {
362
- const { client: request = client, ...requestConfig } = config ?? {};
363
- if (!pathParams.account_id) {
364
- throw new Error(`Missing required path parameter: account_id`);
365
- }
366
- if (!pathParams.id) {
367
- throw new Error(`Missing required path parameter: id`);
368
- }
369
- if (!pathParams.key) {
370
- throw new Error(`Missing required path parameter: key`);
371
- }
372
- const data = await request({
373
- method: "DELETE",
374
- url: `/accounts/${pathParams.account_id}/env/${pathParams.key}/value/${pathParams.id}`,
375
- queryParams,
376
- ...requestConfig,
377
- headers: {
378
- ...requestConfig.headers
379
- }
380
- });
381
- return data;
382
- }
383
- /**
384
- * @link /sites/{site_id}/functions
385
- */ async function searchSiteFunctions({ pathParams, queryParams, config } = {}) {
386
- const { client: request = client, ...requestConfig } = config ?? {};
387
- if (!pathParams.site_id) {
388
- throw new Error(`Missing required path parameter: site_id`);
389
- }
390
- const data = await request({
391
- method: "GET",
392
- url: `/sites/${pathParams.site_id}/functions`,
393
- queryParams,
394
- ...requestConfig,
395
- headers: {
396
- ...requestConfig.headers
397
- }
398
- });
399
- return data;
400
- }
401
- /**
402
- * @link /sites/{site_id}/forms
403
- */ async function listSiteForms({ pathParams, config } = {}) {
404
- const { client: request = client, ...requestConfig } = config ?? {};
405
- if (!pathParams.site_id) {
406
- throw new Error(`Missing required path parameter: site_id`);
407
- }
408
- const data = await request({
409
- method: "GET",
410
- url: `/sites/${pathParams.site_id}/forms`,
411
- ...requestConfig,
412
- headers: {
413
- ...requestConfig.headers
414
- }
415
- });
416
- return data;
417
- }
418
- /**
419
- * @link /sites/{site_id}/forms/{form_id}
420
- */ async function deleteSiteForm({ pathParams, config } = {}) {
421
- const { client: request = client, ...requestConfig } = config ?? {};
422
- if (!pathParams.site_id) {
423
- throw new Error(`Missing required path parameter: site_id`);
424
- }
425
- if (!pathParams.form_id) {
426
- throw new Error(`Missing required path parameter: form_id`);
427
- }
428
- const data = await request({
429
- method: "DELETE",
430
- url: `/sites/${pathParams.site_id}/forms/${pathParams.form_id}`,
431
- ...requestConfig,
432
- headers: {
433
- ...requestConfig.headers
434
- }
435
- });
436
- return data;
437
- }
438
- /**
439
- * @link /sites/{site_id}/submissions
440
- */ async function listSiteSubmissions({ pathParams, queryParams, config } = {}) {
441
- const { client: request = client, ...requestConfig } = config ?? {};
442
- if (!pathParams.site_id) {
443
- throw new Error(`Missing required path parameter: site_id`);
444
- }
445
- const data = await request({
446
- method: "GET",
447
- url: `/sites/${pathParams.site_id}/submissions`,
448
- queryParams,
449
- ...requestConfig,
450
- headers: {
451
- ...requestConfig.headers
452
- }
453
- });
454
- return data;
455
- }
456
- /**
457
- * @link /sites/{site_id}/files
458
- */ async function listSiteFiles({ pathParams, config } = {}) {
459
- const { client: request = client, ...requestConfig } = config ?? {};
460
- if (!pathParams.site_id) {
461
- throw new Error(`Missing required path parameter: site_id`);
462
- }
463
- const data = await request({
464
- method: "GET",
465
- url: `/sites/${pathParams.site_id}/files`,
466
- ...requestConfig,
467
- headers: {
468
- ...requestConfig.headers
469
- }
470
- });
471
- return data;
472
- }
473
- /**
474
- * @link /sites/{site_id}/assets
475
- */ async function listSiteAssets({ pathParams, config } = {}) {
476
- const { client: request = client, ...requestConfig } = config ?? {};
477
- if (!pathParams.site_id) {
478
- throw new Error(`Missing required path parameter: site_id`);
479
- }
480
- const data = await request({
481
- method: "GET",
482
- url: `/sites/${pathParams.site_id}/assets`,
483
- ...requestConfig,
484
- headers: {
485
- ...requestConfig.headers
486
- }
487
- });
488
- return data;
489
- }
490
- /**
491
- * @link /sites/{site_id}/assets
492
- */ async function createSiteAsset({ pathParams, queryParams, config } = {}) {
493
- const { client: request = client, ...requestConfig } = config ?? {};
494
- if (!pathParams.site_id) {
495
- throw new Error(`Missing required path parameter: site_id`);
496
- }
497
- const data = await request({
498
- method: "POST",
499
- url: `/sites/${pathParams.site_id}/assets`,
500
- queryParams,
501
- ...requestConfig,
502
- headers: {
503
- ...requestConfig.headers
504
- }
505
- });
506
- return data;
507
- }
508
- /**
509
- * @link /sites/{site_id}/assets/{asset_id}
510
- */ async function getSiteAssetInfo({ pathParams, config } = {}) {
511
- const { client: request = client, ...requestConfig } = config ?? {};
512
- if (!pathParams.site_id) {
513
- throw new Error(`Missing required path parameter: site_id`);
514
- }
515
- if (!pathParams.asset_id) {
516
- throw new Error(`Missing required path parameter: asset_id`);
517
- }
518
- const data = await request({
519
- method: "GET",
520
- url: `/sites/${pathParams.site_id}/assets/${pathParams.asset_id}`,
521
- ...requestConfig,
522
- headers: {
523
- ...requestConfig.headers
524
- }
525
- });
526
- return data;
527
- }
528
- /**
529
- * @link /sites/{site_id}/assets/{asset_id}
530
- */ async function updateSiteAsset({ pathParams, queryParams, config } = {}) {
531
- const { client: request = client, ...requestConfig } = config ?? {};
532
- if (!pathParams.site_id) {
533
- throw new Error(`Missing required path parameter: site_id`);
534
- }
535
- if (!pathParams.asset_id) {
536
- throw new Error(`Missing required path parameter: asset_id`);
537
- }
538
- const data = await request({
539
- method: "PUT",
540
- url: `/sites/${pathParams.site_id}/assets/${pathParams.asset_id}`,
541
- queryParams,
542
- ...requestConfig,
543
- headers: {
544
- ...requestConfig.headers
545
- }
546
- });
547
- return data;
548
- }
549
- /**
550
- * @link /sites/{site_id}/assets/{asset_id}
551
- */ async function deleteSiteAsset({ pathParams, config } = {}) {
552
- const { client: request = client, ...requestConfig } = config ?? {};
553
- if (!pathParams.site_id) {
554
- throw new Error(`Missing required path parameter: site_id`);
555
- }
556
- if (!pathParams.asset_id) {
557
- throw new Error(`Missing required path parameter: asset_id`);
558
- }
559
- const data = await request({
560
- method: "DELETE",
561
- url: `/sites/${pathParams.site_id}/assets/${pathParams.asset_id}`,
562
- ...requestConfig,
563
- headers: {
564
- ...requestConfig.headers
565
- }
566
- });
567
- return data;
568
- }
569
- /**
570
- * @link /sites/{site_id}/assets/{asset_id}/public_signature
571
- */ async function getSiteAssetPublicSignature({ pathParams, config } = {}) {
572
- const { client: request = client, ...requestConfig } = config ?? {};
573
- if (!pathParams.site_id) {
574
- throw new Error(`Missing required path parameter: site_id`);
575
- }
576
- if (!pathParams.asset_id) {
577
- throw new Error(`Missing required path parameter: asset_id`);
578
- }
579
- const data = await request({
580
- method: "GET",
581
- url: `/sites/${pathParams.site_id}/assets/${pathParams.asset_id}/public_signature`,
582
- ...requestConfig,
583
- headers: {
584
- ...requestConfig.headers
585
- }
586
- });
587
- return data;
588
- }
589
- /**
590
- * @link /sites/{site_id}/files/{file_path}
591
- */ async function getSiteFileByPathName({ pathParams, config } = {}) {
592
- const { client: request = client, ...requestConfig } = config ?? {};
593
- if (!pathParams.site_id) {
594
- throw new Error(`Missing required path parameter: site_id`);
595
- }
596
- if (!pathParams.file_path) {
597
- throw new Error(`Missing required path parameter: file_path`);
598
- }
599
- const data = await request({
600
- method: "GET",
601
- url: `/sites/${pathParams.site_id}/files/${pathParams.file_path}`,
602
- ...requestConfig,
603
- headers: {
604
- ...requestConfig.headers
605
- }
606
- });
607
- return data;
608
- }
609
- /**
610
- * @description Purges cached content from Netlify's CDN. Supports purging by Cache-Tag.
611
- * @link /purge
612
- */ async function purgeCache({ body, config } = {}) {
613
- const { client: request = client, ...requestConfig } = config ?? {};
614
- const data = await request({
615
- method: "POST",
616
- url: `/purge`,
617
- body: body,
618
- ...requestConfig,
619
- headers: {
620
- ...requestConfig.headers
621
- }
622
- });
623
- return data;
624
- }
625
- /**
626
- * @link /sites/{site_id}/snippets
627
- */ async function listSiteSnippets({ pathParams, config } = {}) {
628
- const { client: request = client, ...requestConfig } = config ?? {};
629
- if (!pathParams.site_id) {
630
- throw new Error(`Missing required path parameter: site_id`);
631
- }
632
- const data = await request({
633
- method: "GET",
634
- url: `/sites/${pathParams.site_id}/snippets`,
635
- ...requestConfig,
636
- headers: {
637
- ...requestConfig.headers
638
- }
639
- });
640
- return data;
641
- }
642
- /**
643
- * @link /sites/{site_id}/snippets
644
- */ async function createSiteSnippet({ pathParams, body, config } = {}) {
645
- const { client: request = client, ...requestConfig } = config ?? {};
646
- if (!pathParams.site_id) {
647
- throw new Error(`Missing required path parameter: site_id`);
648
- }
649
- const data = await request({
650
- method: "POST",
651
- url: `/sites/${pathParams.site_id}/snippets`,
652
- body: body,
653
- ...requestConfig,
654
- headers: {
655
- ...requestConfig.headers
656
- }
657
- });
658
- return data;
659
- }
660
- /**
661
- * @link /sites/{site_id}/snippets/{snippet_id}
662
- */ async function getSiteSnippet({ pathParams, config } = {}) {
663
- const { client: request = client, ...requestConfig } = config ?? {};
664
- if (!pathParams.site_id) {
665
- throw new Error(`Missing required path parameter: site_id`);
666
- }
667
- if (!pathParams.snippet_id) {
668
- throw new Error(`Missing required path parameter: snippet_id`);
669
- }
670
- const data = await request({
671
- method: "GET",
672
- url: `/sites/${pathParams.site_id}/snippets/${pathParams.snippet_id}`,
673
- ...requestConfig,
674
- headers: {
675
- ...requestConfig.headers
676
- }
677
- });
678
- return data;
679
- }
680
- /**
681
- * @link /sites/{site_id}/snippets/{snippet_id}
682
- */ async function updateSiteSnippet({ pathParams, body, config } = {}) {
683
- const { client: request = client, ...requestConfig } = config ?? {};
684
- if (!pathParams.site_id) {
685
- throw new Error(`Missing required path parameter: site_id`);
686
- }
687
- if (!pathParams.snippet_id) {
688
- throw new Error(`Missing required path parameter: snippet_id`);
689
- }
690
- const data = await request({
691
- method: "PUT",
692
- url: `/sites/${pathParams.site_id}/snippets/${pathParams.snippet_id}`,
693
- body: body,
694
- ...requestConfig,
695
- headers: {
696
- ...requestConfig.headers
697
- }
698
- });
699
- return data;
700
- }
701
- /**
702
- * @link /sites/{site_id}/snippets/{snippet_id}
703
- */ async function deleteSiteSnippet({ pathParams, config } = {}) {
704
- const { client: request = client, ...requestConfig } = config ?? {};
705
- if (!pathParams.site_id) {
706
- throw new Error(`Missing required path parameter: site_id`);
707
- }
708
- if (!pathParams.snippet_id) {
709
- throw new Error(`Missing required path parameter: snippet_id`);
710
- }
711
- const data = await request({
712
- method: "DELETE",
713
- url: `/sites/${pathParams.site_id}/snippets/${pathParams.snippet_id}`,
714
- ...requestConfig,
715
- headers: {
716
- ...requestConfig.headers
717
- }
718
- });
719
- return data;
720
- }
721
- /**
722
- * @link /sites/{site_id}/metadata
723
- */ async function getSiteMetadata({ pathParams, config } = {}) {
724
- const { client: request = client, ...requestConfig } = config ?? {};
725
- if (!pathParams.site_id) {
726
- throw new Error(`Missing required path parameter: site_id`);
727
- }
728
- const data = await request({
729
- method: "GET",
730
- url: `/sites/${pathParams.site_id}/metadata`,
731
- ...requestConfig,
732
- headers: {
733
- ...requestConfig.headers
734
- }
735
- });
736
- return data;
737
- }
738
- /**
739
- * @link /sites/{site_id}/metadata
740
- */ async function updateSiteMetadata({ pathParams, body, config } = {}) {
741
- const { client: request = client, ...requestConfig } = config ?? {};
742
- if (!pathParams.site_id) {
743
- throw new Error(`Missing required path parameter: site_id`);
744
- }
745
- const data = await request({
746
- method: "PUT",
747
- url: `/sites/${pathParams.site_id}/metadata`,
748
- body: body,
749
- ...requestConfig,
750
- headers: {
751
- ...requestConfig.headers
752
- }
753
- });
754
- return data;
755
- }
756
- /**
757
- * @link /sites/{site_id}/build_hooks
758
- */ async function listSiteBuildHooks({ pathParams, config } = {}) {
759
- const { client: request = client, ...requestConfig } = config ?? {};
760
- if (!pathParams.site_id) {
761
- throw new Error(`Missing required path parameter: site_id`);
762
- }
763
- const data = await request({
764
- method: "GET",
765
- url: `/sites/${pathParams.site_id}/build_hooks`,
766
- ...requestConfig,
767
- headers: {
768
- ...requestConfig.headers
769
- }
770
- });
771
- return data;
772
- }
773
- /**
774
- * @link /sites/{site_id}/build_hooks
775
- */ async function createSiteBuildHook({ pathParams, body, config } = {}) {
776
- const { client: request = client, ...requestConfig } = config ?? {};
777
- if (!pathParams.site_id) {
778
- throw new Error(`Missing required path parameter: site_id`);
779
- }
780
- const data = await request({
781
- method: "POST",
782
- url: `/sites/${pathParams.site_id}/build_hooks`,
783
- body: body,
784
- ...requestConfig,
785
- headers: {
786
- ...requestConfig.headers
787
- }
788
- });
789
- return data;
790
- }
791
- /**
792
- * @link /sites/{site_id}/build_hooks/{id}
793
- */ async function getSiteBuildHook({ pathParams, config } = {}) {
794
- const { client: request = client, ...requestConfig } = config ?? {};
795
- if (!pathParams.site_id) {
796
- throw new Error(`Missing required path parameter: site_id`);
797
- }
798
- if (!pathParams.id) {
799
- throw new Error(`Missing required path parameter: id`);
800
- }
801
- const data = await request({
802
- method: "GET",
803
- url: `/sites/${pathParams.site_id}/build_hooks/${pathParams.id}`,
804
- ...requestConfig,
805
- headers: {
806
- ...requestConfig.headers
807
- }
808
- });
809
- return data;
810
- }
811
- /**
812
- * @link /sites/{site_id}/build_hooks/{id}
813
- */ async function updateSiteBuildHook({ pathParams, body, config } = {}) {
814
- const { client: request = client, ...requestConfig } = config ?? {};
815
- if (!pathParams.site_id) {
816
- throw new Error(`Missing required path parameter: site_id`);
817
- }
818
- if (!pathParams.id) {
819
- throw new Error(`Missing required path parameter: id`);
820
- }
821
- const data = await request({
822
- method: "PUT",
823
- url: `/sites/${pathParams.site_id}/build_hooks/${pathParams.id}`,
824
- body: body,
825
- ...requestConfig,
826
- headers: {
827
- ...requestConfig.headers
828
- }
829
- });
830
- return data;
831
- }
832
- /**
833
- * @link /sites/{site_id}/build_hooks/{id}
834
- */ async function deleteSiteBuildHook({ pathParams, config } = {}) {
835
- const { client: request = client, ...requestConfig } = config ?? {};
836
- if (!pathParams.site_id) {
837
- throw new Error(`Missing required path parameter: site_id`);
838
- }
839
- if (!pathParams.id) {
840
- throw new Error(`Missing required path parameter: id`);
841
- }
842
- const data = await request({
843
- method: "DELETE",
844
- url: `/sites/${pathParams.site_id}/build_hooks/${pathParams.id}`,
845
- ...requestConfig,
846
- headers: {
847
- ...requestConfig.headers
848
- }
849
- });
850
- return data;
851
- }
852
- /**
853
- * @link /sites/{site_id}/deploys
854
- */ async function listSiteDeploys({ pathParams, queryParams, config } = {}) {
855
- const { client: request = client, ...requestConfig } = config ?? {};
856
- if (!pathParams.site_id) {
857
- throw new Error(`Missing required path parameter: site_id`);
858
- }
859
- const data = await request({
860
- method: "GET",
861
- url: `/sites/${pathParams.site_id}/deploys`,
862
- queryParams,
863
- ...requestConfig,
864
- headers: {
865
- ...requestConfig.headers
866
- }
867
- });
868
- return data;
869
- }
870
- /**
871
- * @link /sites/{site_id}/deploys
872
- */ async function createSiteDeploy({ pathParams, body, queryParams, config } = {}) {
873
- const { client: request = client, ...requestConfig } = config ?? {};
874
- if (!pathParams.site_id) {
875
- throw new Error(`Missing required path parameter: site_id`);
876
- }
877
- const data = await request({
878
- method: "POST",
879
- url: `/sites/${pathParams.site_id}/deploys`,
880
- queryParams,
881
- body: body,
882
- ...requestConfig,
883
- headers: {
884
- ...requestConfig.headers
885
- }
886
- });
887
- return data;
888
- }
889
- /**
890
- * @link /sites/{site_id}/deploys/{deploy_id}
891
- */ async function getSiteDeploy({ pathParams, config } = {}) {
892
- const { client: request = client, ...requestConfig } = config ?? {};
893
- if (!pathParams.site_id) {
894
- throw new Error(`Missing required path parameter: site_id`);
895
- }
896
- if (!pathParams.deploy_id) {
897
- throw new Error(`Missing required path parameter: deploy_id`);
898
- }
899
- const data = await request({
900
- method: "GET",
901
- url: `/sites/${pathParams.site_id}/deploys/${pathParams.deploy_id}`,
902
- ...requestConfig,
903
- headers: {
904
- ...requestConfig.headers
905
- }
906
- });
907
- return data;
908
- }
909
- /**
910
- * @link /sites/{site_id}/deploys/{deploy_id}
911
- */ async function updateSiteDeploy({ pathParams, body, queryParams, config } = {}) {
912
- const { client: request = client, ...requestConfig } = config ?? {};
913
- if (!pathParams.site_id) {
914
- throw new Error(`Missing required path parameter: site_id`);
915
- }
916
- if (!pathParams.deploy_id) {
917
- throw new Error(`Missing required path parameter: deploy_id`);
918
- }
919
- const data = await request({
920
- method: "PUT",
921
- url: `/sites/${pathParams.site_id}/deploys/${pathParams.deploy_id}`,
922
- queryParams,
923
- body: body,
924
- ...requestConfig,
925
- headers: {
926
- ...requestConfig.headers
927
- }
928
- });
929
- return data;
930
- }
931
- /**
932
- * @link /sites/{site_id}/deploys/{deploy_id}
933
- */ async function deleteSiteDeploy({ pathParams, config } = {}) {
934
- const { client: request = client, ...requestConfig } = config ?? {};
935
- if (!pathParams.deploy_id) {
936
- throw new Error(`Missing required path parameter: deploy_id`);
937
- }
938
- if (!pathParams.site_id) {
939
- throw new Error(`Missing required path parameter: site_id`);
940
- }
941
- const data = await request({
942
- method: "DELETE",
943
- url: `/sites/${pathParams.site_id}/deploys/${pathParams.deploy_id}`,
944
- ...requestConfig,
945
- headers: {
946
- ...requestConfig.headers
947
- }
948
- });
949
- return data;
950
- }
951
- /**
952
- * @link /deploys/{deploy_id}/cancel
953
- */ async function cancelSiteDeploy({ pathParams, config } = {}) {
954
- const { client: request = client, ...requestConfig } = config ?? {};
955
- if (!pathParams.deploy_id) {
956
- throw new Error(`Missing required path parameter: deploy_id`);
957
- }
958
- const data = await request({
959
- method: "POST",
960
- url: `/deploys/${pathParams.deploy_id}/cancel`,
961
- ...requestConfig,
962
- headers: {
963
- ...requestConfig.headers
964
- }
965
- });
966
- return data;
967
- }
968
- /**
969
- * @link /sites/{site_id}/deploys/{deploy_id}/restore
970
- */ async function restoreSiteDeploy({ pathParams, config } = {}) {
971
- const { client: request = client, ...requestConfig } = config ?? {};
972
- if (!pathParams.site_id) {
973
- throw new Error(`Missing required path parameter: site_id`);
974
- }
975
- if (!pathParams.deploy_id) {
976
- throw new Error(`Missing required path parameter: deploy_id`);
977
- }
978
- const data = await request({
979
- method: "POST",
980
- url: `/sites/${pathParams.site_id}/deploys/${pathParams.deploy_id}/restore`,
981
- ...requestConfig,
982
- headers: {
983
- ...requestConfig.headers
984
- }
985
- });
986
- return data;
987
- }
988
- /**
989
- * @link /sites/{site_id}/builds
990
- */ async function listSiteBuilds({ pathParams, queryParams, config } = {}) {
991
- const { client: request = client, ...requestConfig } = config ?? {};
992
- if (!pathParams.site_id) {
993
- throw new Error(`Missing required path parameter: site_id`);
994
- }
995
- const data = await request({
996
- method: "GET",
997
- url: `/sites/${pathParams.site_id}/builds`,
998
- queryParams,
999
- ...requestConfig,
1000
- headers: {
1001
- ...requestConfig.headers
1002
- }
1003
- });
1004
- return data;
1005
- }
1006
- /**
1007
- * @description Runs a build for a site. The build will be scheduled to run at the first opportunity, but it might not start immediately if insufficient account build capacity is available.
1008
- * Files for build can be uploaded as a zipped site using one of these methods:
1009
- * 1. Set Content-Type to 'application/zip' and send the zip file as the raw request body
1010
- * 2. Set Content-Type to 'multipart/form-data' and include the zip file in the 'zip' field
1011
- * @link /sites/{site_id}/builds
1012
- */ async function createSiteBuild({ pathParams, queryParams, config } = {}) {
1013
- const { client: request = client, ...requestConfig } = config ?? {};
1014
- if (!pathParams.site_id) {
1015
- throw new Error(`Missing required path parameter: site_id`);
1016
- }
1017
- const data = await request({
1018
- method: "POST",
1019
- url: `/sites/${pathParams.site_id}/builds`,
1020
- queryParams,
1021
- ...requestConfig,
1022
- headers: {
1023
- ...requestConfig.headers
1024
- }
1025
- });
1026
- return data;
1027
- }
1028
- /**
1029
- * @link /sites/{site_id}/deployed-branches
1030
- */ async function listSiteDeployedBranches({ pathParams, config } = {}) {
1031
- const { client: request = client, ...requestConfig } = config ?? {};
1032
- if (!pathParams.site_id) {
1033
- throw new Error(`Missing required path parameter: site_id`);
1034
- }
1035
- const data = await request({
1036
- method: "GET",
1037
- url: `/sites/${pathParams.site_id}/deployed-branches`,
1038
- ...requestConfig,
1039
- headers: {
1040
- ...requestConfig.headers
1041
- }
1042
- });
1043
- return data;
1044
- }
1045
- /**
1046
- * @description [Beta] Unlinks the repo from the site.
1047
- * This action will also:
1048
- * - Delete associated deploy keys
1049
- * - Delete outgoing webhooks for the repo
1050
- * - Delete the site's build hooks
1051
- * @link /sites/{site_id}/unlink_repo
1052
- */ async function unlinkSiteRepo({ pathParams, config } = {}) {
1053
- const { client: request = client, ...requestConfig } = config ?? {};
1054
- if (!pathParams.site_id) {
1055
- throw new Error(`Missing required path parameter: site_id`);
1056
- }
1057
- const data = await request({
1058
- method: "PUT",
1059
- url: `/sites/${pathParams.site_id}/unlink_repo`,
1060
- ...requestConfig,
1061
- headers: {
1062
- ...requestConfig.headers
1063
- }
1064
- });
1065
- return data;
1066
- }
1067
- /**
1068
- * @description Re-enables a site that was previously disabled by the user. Sites that were disabled for usage exceeded or marked as spam cannot be re-enabled via this endpoint.
1069
- * @link /sites/{site_id}/enable
1070
- */ async function enableSite({ pathParams, config } = {}) {
1071
- const { client: request = client, ...requestConfig } = config ?? {};
1072
- if (!pathParams.site_id) {
1073
- throw new Error(`Missing required path parameter: site_id`);
1074
- }
1075
- const data = await request({
1076
- method: "PUT",
1077
- url: `/sites/${pathParams.site_id}/enable`,
1078
- ...requestConfig,
1079
- headers: {
1080
- ...requestConfig.headers
1081
- }
1082
- });
1083
- return data;
1084
- }
1085
- /**
1086
- * @description Disables a site, preventing it from serving content. The site can be re-enabled later using the enable endpoint.
1087
- * @link /sites/{site_id}/disable
1088
- */ async function disableSite({ pathParams, queryParams, config } = {}) {
1089
- const { client: request = client, ...requestConfig } = config ?? {};
1090
- if (!pathParams.site_id) {
1091
- throw new Error(`Missing required path parameter: site_id`);
1092
- }
1093
- const data = await request({
1094
- method: "PUT",
1095
- url: `/sites/${pathParams.site_id}/disable`,
1096
- queryParams,
1097
- ...requestConfig,
1098
- headers: {
1099
- ...requestConfig.headers
1100
- }
1101
- });
1102
- return data;
1103
- }
1104
- /**
1105
- * @link /builds/{build_id}
1106
- */ async function getSiteBuild({ pathParams, config } = {}) {
1107
- const { client: request = client, ...requestConfig } = config ?? {};
1108
- if (!pathParams.build_id) {
1109
- throw new Error(`Missing required path parameter: build_id`);
1110
- }
1111
- const data = await request({
1112
- method: "GET",
1113
- url: `/builds/${pathParams.build_id}`,
1114
- ...requestConfig,
1115
- headers: {
1116
- ...requestConfig.headers
1117
- }
1118
- });
1119
- return data;
1120
- }
1121
- /**
1122
- * @link /builds/{build_id}/log
1123
- */ async function updateSiteBuildLog({ pathParams, config } = {}) {
1124
- const { client: request = client, ...requestConfig } = config ?? {};
1125
- if (!pathParams.build_id) {
1126
- throw new Error(`Missing required path parameter: build_id`);
1127
- }
1128
- const data = await request({
1129
- method: "POST",
1130
- url: `/builds/${pathParams.build_id}/log`,
1131
- ...requestConfig,
1132
- headers: {
1133
- ...requestConfig.headers
1134
- }
1135
- });
1136
- return data;
1137
- }
1138
- /**
1139
- * @link /builds/{build_id}/start
1140
- */ async function notifyBuildStart({ pathParams, queryParams, config } = {}) {
1141
- const { client: request = client, ...requestConfig } = config ?? {};
1142
- if (!pathParams.build_id) {
1143
- throw new Error(`Missing required path parameter: build_id`);
1144
- }
1145
- const data = await request({
1146
- method: "POST",
1147
- url: `/builds/${pathParams.build_id}/start`,
1148
- queryParams,
1149
- ...requestConfig,
1150
- headers: {
1151
- ...requestConfig.headers
1152
- }
1153
- });
1154
- return data;
1155
- }
1156
- /**
1157
- * @link /{account_id}/builds/status
1158
- */ async function getAccountBuildStatus({ pathParams, config } = {}) {
1159
- const { client: request = client, ...requestConfig } = config ?? {};
1160
- if (!pathParams.account_id) {
1161
- throw new Error(`Missing required path parameter: account_id`);
1162
- }
1163
- const data = await request({
1164
- method: "GET",
1165
- url: `/${pathParams.account_id}/builds/status`,
1166
- ...requestConfig,
1167
- headers: {
1168
- ...requestConfig.headers
1169
- }
1170
- });
1171
- return data;
1172
- }
1173
- /**
1174
- * @link /sites/{site_id}/dns
1175
- */ async function getDNSForSite({ pathParams, config } = {}) {
1176
- const { client: request = client, ...requestConfig } = config ?? {};
1177
- if (!pathParams.site_id) {
1178
- throw new Error(`Missing required path parameter: site_id`);
1179
- }
1180
- const data = await request({
1181
- method: "GET",
1182
- url: `/sites/${pathParams.site_id}/dns`,
1183
- ...requestConfig,
1184
- headers: {
1185
- ...requestConfig.headers
1186
- }
1187
- });
1188
- return data;
1189
- }
1190
- /**
1191
- * @link /sites/{site_id}/dns
1192
- */ async function configureDNSForSite({ pathParams, config } = {}) {
1193
- const { client: request = client, ...requestConfig } = config ?? {};
1194
- if (!pathParams.site_id) {
1195
- throw new Error(`Missing required path parameter: site_id`);
1196
- }
1197
- const data = await request({
1198
- method: "PUT",
1199
- url: `/sites/${pathParams.site_id}/dns`,
1200
- ...requestConfig,
1201
- headers: {
1202
- ...requestConfig.headers
1203
- }
1204
- });
1205
- return data;
1206
- }
1207
- /**
1208
- * @link /sites/{site_id}/rollback
1209
- */ async function rollbackSiteDeploy({ pathParams, config } = {}) {
1210
- const { client: request = client, ...requestConfig } = config ?? {};
1211
- if (!pathParams.site_id) {
1212
- throw new Error(`Missing required path parameter: site_id`);
1213
- }
1214
- const data = await request({
1215
- method: "PUT",
1216
- url: `/sites/${pathParams.site_id}/rollback`,
1217
- ...requestConfig,
1218
- headers: {
1219
- ...requestConfig.headers
1220
- }
1221
- });
1222
- return data;
1223
- }
1224
- /**
1225
- * @link /deploys/{deploy_id}
1226
- */ async function getDeploy({ pathParams, config } = {}) {
1227
- const { client: request = client, ...requestConfig } = config ?? {};
1228
- if (!pathParams.deploy_id) {
1229
- throw new Error(`Missing required path parameter: deploy_id`);
1230
- }
1231
- const data = await request({
1232
- method: "GET",
1233
- url: `/deploys/${pathParams.deploy_id}`,
1234
- ...requestConfig,
1235
- headers: {
1236
- ...requestConfig.headers
1237
- }
1238
- });
1239
- return data;
1240
- }
1241
- /**
1242
- * @link /deploys/{deploy_id}
1243
- */ async function deleteDeploy({ pathParams, config } = {}) {
1244
- const { client: request = client, ...requestConfig } = config ?? {};
1245
- if (!pathParams.deploy_id) {
1246
- throw new Error(`Missing required path parameter: deploy_id`);
1247
- }
1248
- const data = await request({
1249
- method: "DELETE",
1250
- url: `/deploys/${pathParams.deploy_id}`,
1251
- ...requestConfig,
1252
- headers: {
1253
- ...requestConfig.headers
1254
- }
1255
- });
1256
- return data;
1257
- }
1258
- /**
1259
- * @description Updates the deploy validations report for a deploy.
1260
- * @link /deploys/{deploy_id}/validations_report
1261
- */ async function updateDeployValidations({ pathParams, body, config } = {}) {
1262
- const { client: request = client, ...requestConfig } = config ?? {};
1263
- if (!pathParams.deploy_id) {
1264
- throw new Error(`Missing required path parameter: deploy_id`);
1265
- }
1266
- const data = await request({
1267
- method: "PATCH",
1268
- url: `/deploys/${pathParams.deploy_id}/validations_report`,
1269
- body: body,
1270
- ...requestConfig,
1271
- headers: {
1272
- ...requestConfig.headers
1273
- }
1274
- });
1275
- return data;
1276
- }
1277
- /**
1278
- * @link /deploys/{deploy_id}/lock
1279
- */ async function lockDeploy({ pathParams, config } = {}) {
1280
- const { client: request = client, ...requestConfig } = config ?? {};
1281
- if (!pathParams.deploy_id) {
1282
- throw new Error(`Missing required path parameter: deploy_id`);
1283
- }
1284
- const data = await request({
1285
- method: "POST",
1286
- url: `/deploys/${pathParams.deploy_id}/lock`,
1287
- ...requestConfig,
1288
- headers: {
1289
- ...requestConfig.headers
1290
- }
1291
- });
1292
- return data;
1293
- }
1294
- /**
1295
- * @link /deploys/{deploy_id}/unlock
1296
- */ async function unlockDeploy({ pathParams, config } = {}) {
1297
- const { client: request = client, ...requestConfig } = config ?? {};
1298
- if (!pathParams.deploy_id) {
1299
- throw new Error(`Missing required path parameter: deploy_id`);
1300
- }
1301
- const data = await request({
1302
- method: "POST",
1303
- url: `/deploys/${pathParams.deploy_id}/unlock`,
1304
- ...requestConfig,
1305
- headers: {
1306
- ...requestConfig.headers
1307
- }
1308
- });
1309
- return data;
1310
- }
1311
- /**
1312
- * @link /deploys/{deploy_id}/files/{path}
1313
- */ async function uploadDeployFile({ pathParams, queryParams, config } = {}) {
1314
- const { client: request = client, ...requestConfig } = config ?? {};
1315
- if (!pathParams.deploy_id) {
1316
- throw new Error(`Missing required path parameter: deploy_id`);
1317
- }
1318
- if (!pathParams.path) {
1319
- throw new Error(`Missing required path parameter: path`);
1320
- }
1321
- const data = await request({
1322
- method: "PUT",
1323
- url: `/deploys/${pathParams.deploy_id}/files/${pathParams.path}`,
1324
- queryParams,
1325
- ...requestConfig,
1326
- headers: {
1327
- ...requestConfig.headers
1328
- }
1329
- });
1330
- return data;
1331
- }
1332
- /**
1333
- * @link /deploys/{deploy_id}/functions/{name}
1334
- */ async function uploadDeployFunction({ pathParams, queryParams, headers, config } = {}) {
1335
- const { client: request = client, ...requestConfig } = config ?? {};
1336
- if (!pathParams.deploy_id) {
1337
- throw new Error(`Missing required path parameter: deploy_id`);
1338
- }
1339
- if (!pathParams.name) {
1340
- throw new Error(`Missing required path parameter: name`);
1341
- }
1342
- const data = await request({
1343
- method: "PUT",
1344
- url: `/deploys/${pathParams.deploy_id}/functions/${pathParams.name}`,
1345
- queryParams,
1346
- ...requestConfig,
1347
- headers: {
1348
- ...headers,
1349
- ...requestConfig.headers
1350
- }
1351
- });
1352
- return data;
1353
- }
1354
- /**
1355
- * @link /deploys/{deploy_id}/edge_functions/{code_sha}
1356
- */ async function uploadDeployEdgeFunction({ pathParams, headers, config } = {}) {
1357
- const { client: request = client, ...requestConfig } = config ?? {};
1358
- if (!pathParams.deploy_id) {
1359
- throw new Error(`Missing required path parameter: deploy_id`);
1360
- }
1361
- if (!pathParams.code_sha) {
1362
- throw new Error(`Missing required path parameter: code_sha`);
1363
- }
1364
- const data = await request({
1365
- method: "PUT",
1366
- url: `/deploys/${pathParams.deploy_id}/edge_functions/${pathParams.code_sha}`,
1367
- ...requestConfig,
1368
- headers: {
1369
- ...headers,
1370
- ...requestConfig.headers
1371
- }
1372
- });
1373
- return data;
1374
- }
1375
- /**
1376
- * @description This is an internal-only endpoint.
1377
- * @link /sites/{site_id}/plugin_runs/latest
1378
- */ async function getLatestPluginRuns({ pathParams, queryParams, config } = {}) {
1379
- const { client: request = client, ...requestConfig } = config ?? {};
1380
- if (!pathParams.site_id) {
1381
- throw new Error(`Missing required path parameter: site_id`);
1382
- }
1383
- const data = await request({
1384
- method: "GET",
1385
- url: `/sites/${pathParams.site_id}/plugin_runs/latest`,
1386
- queryParams,
1387
- ...requestConfig,
1388
- headers: {
1389
- ...requestConfig.headers
1390
- }
1391
- });
1392
- return data;
1393
- }
1394
- /**
1395
- * @description This is an internal-only endpoint.
1396
- * @link /deploys/{deploy_id}/plugin_runs
1397
- */ async function createPluginRun({ pathParams, body, config } = {}) {
1398
- const { client: request = client, ...requestConfig } = config ?? {};
1399
- if (!pathParams.deploy_id) {
1400
- throw new Error(`Missing required path parameter: deploy_id`);
1401
- }
1402
- const data = await request({
1403
- method: "POST",
1404
- url: `/deploys/${pathParams.deploy_id}/plugin_runs`,
1405
- body: body,
1406
- ...requestConfig,
1407
- headers: {
1408
- ...requestConfig.headers
1409
- }
1410
- });
1411
- return data;
1412
- }
1413
- /**
1414
- * @link /forms/{form_id}/submissions
1415
- */ async function listFormSubmissions({ pathParams, queryParams, config } = {}) {
1416
- const { client: request = client, ...requestConfig } = config ?? {};
1417
- if (!pathParams.form_id) {
1418
- throw new Error(`Missing required path parameter: form_id`);
1419
- }
1420
- const data = await request({
1421
- method: "GET",
1422
- url: `/forms/${pathParams.form_id}/submissions`,
1423
- queryParams,
1424
- ...requestConfig,
1425
- headers: {
1426
- ...requestConfig.headers
1427
- }
1428
- });
1429
- return data;
1430
- }
1431
- /**
1432
- * @link /hooks
1433
- */ async function listHooksBySiteId({ queryParams, config } = {}) {
1434
- const { client: request = client, ...requestConfig } = config ?? {};
1435
- const data = await request({
1436
- method: "GET",
1437
- url: `/hooks`,
1438
- queryParams,
1439
- ...requestConfig,
1440
- headers: {
1441
- ...requestConfig.headers
1442
- }
1443
- });
1444
- return data;
1445
- }
1446
- /**
1447
- * @link /hooks
1448
- */ async function createHookBySiteId({ body, queryParams, config } = {}) {
1449
- const { client: request = client, ...requestConfig } = config ?? {};
1450
- const data = await request({
1451
- method: "POST",
1452
- url: `/hooks`,
1453
- queryParams,
1454
- body: body,
1455
- ...requestConfig,
1456
- headers: {
1457
- ...requestConfig.headers
1458
- }
1459
- });
1460
- return data;
1461
- }
1462
- /**
1463
- * @link /hooks/{hook_id}
1464
- */ async function getHook({ pathParams, config } = {}) {
1465
- const { client: request = client, ...requestConfig } = config ?? {};
1466
- if (!pathParams.hook_id) {
1467
- throw new Error(`Missing required path parameter: hook_id`);
1468
- }
1469
- const data = await request({
1470
- method: "GET",
1471
- url: `/hooks/${pathParams.hook_id}`,
1472
- ...requestConfig,
1473
- headers: {
1474
- ...requestConfig.headers
1475
- }
1476
- });
1477
- return data;
1478
- }
1479
- /**
1480
- * @link /hooks/{hook_id}
1481
- */ async function updateHook({ pathParams, body, config } = {}) {
1482
- const { client: request = client, ...requestConfig } = config ?? {};
1483
- if (!pathParams.hook_id) {
1484
- throw new Error(`Missing required path parameter: hook_id`);
1485
- }
1486
- const data = await request({
1487
- method: "PUT",
1488
- url: `/hooks/${pathParams.hook_id}`,
1489
- body: body,
1490
- ...requestConfig,
1491
- headers: {
1492
- ...requestConfig.headers
1493
- }
1494
- });
1495
- return data;
1496
- }
1497
- /**
1498
- * @link /hooks/{hook_id}
1499
- */ async function deleteHook({ pathParams, config } = {}) {
1500
- const { client: request = client, ...requestConfig } = config ?? {};
1501
- if (!pathParams.hook_id) {
1502
- throw new Error(`Missing required path parameter: hook_id`);
1503
- }
1504
- const data = await request({
1505
- method: "DELETE",
1506
- url: `/hooks/${pathParams.hook_id}`,
1507
- ...requestConfig,
1508
- headers: {
1509
- ...requestConfig.headers
1510
- }
1511
- });
1512
- return data;
1513
- }
1514
- /**
1515
- * @link /hooks/{hook_id}/enable
1516
- */ async function enableHook({ pathParams, config } = {}) {
1517
- const { client: request = client, ...requestConfig } = config ?? {};
1518
- if (!pathParams.hook_id) {
1519
- throw new Error(`Missing required path parameter: hook_id`);
1520
- }
1521
- const data = await request({
1522
- method: "POST",
1523
- url: `/hooks/${pathParams.hook_id}/enable`,
1524
- ...requestConfig,
1525
- headers: {
1526
- ...requestConfig.headers
1527
- }
1528
- });
1529
- return data;
1530
- }
1531
- /**
1532
- * @link /hooks/types
1533
- */ async function listHookTypes({ config } = {}) {
1534
- const { client: request = client, ...requestConfig } = config ?? {};
1535
- const data = await request({
1536
- method: "GET",
1537
- url: `/hooks/types`,
1538
- ...requestConfig,
1539
- headers: {
1540
- ...requestConfig.headers
1541
- }
1542
- });
1543
- return data;
1544
- }
1545
- /**
1546
- * @link /oauth/tickets
1547
- */ async function createTicket({ body, queryParams, config } = {}) {
1548
- const { client: request = client, ...requestConfig } = config ?? {};
1549
- const data = await request({
1550
- method: "POST",
1551
- url: `/oauth/tickets`,
1552
- queryParams,
1553
- body: body,
1554
- ...requestConfig,
1555
- headers: {
1556
- ...requestConfig.headers
1557
- }
1558
- });
1559
- return data;
1560
- }
1561
- /**
1562
- * @link /oauth/tickets/{ticket_id}
1563
- */ async function showTicket({ pathParams, config } = {}) {
1564
- const { client: request = client, ...requestConfig } = config ?? {};
1565
- if (!pathParams.ticket_id) {
1566
- throw new Error(`Missing required path parameter: ticket_id`);
1567
- }
1568
- const data = await request({
1569
- method: "GET",
1570
- url: `/oauth/tickets/${pathParams.ticket_id}`,
1571
- ...requestConfig,
1572
- headers: {
1573
- ...requestConfig.headers
1574
- }
1575
- });
1576
- return data;
1577
- }
1578
- /**
1579
- * @link /oauth/tickets/{ticket_id}/exchange
1580
- */ async function exchangeTicket({ pathParams, config } = {}) {
1581
- const { client: request = client, ...requestConfig } = config ?? {};
1582
- if (!pathParams.ticket_id) {
1583
- throw new Error(`Missing required path parameter: ticket_id`);
1584
- }
1585
- const data = await request({
1586
- method: "POST",
1587
- url: `/oauth/tickets/${pathParams.ticket_id}/exchange`,
1588
- ...requestConfig,
1589
- headers: {
1590
- ...requestConfig.headers
1591
- }
1592
- });
1593
- return data;
1594
- }
1595
- /**
1596
- * @link /deploy_keys
1597
- */ async function listDeployKeys({ config } = {}) {
1598
- const { client: request = client, ...requestConfig } = config ?? {};
1599
- const data = await request({
1600
- method: "GET",
1601
- url: `/deploy_keys`,
1602
- ...requestConfig,
1603
- headers: {
1604
- ...requestConfig.headers
1605
- }
1606
- });
1607
- return data;
1608
- }
1609
- /**
1610
- * @link /deploy_keys
1611
- */ async function createDeployKey({ config } = {}) {
1612
- const { client: request = client, ...requestConfig } = config ?? {};
1613
- const data = await request({
1614
- method: "POST",
1615
- url: `/deploy_keys`,
1616
- ...requestConfig,
1617
- headers: {
1618
- ...requestConfig.headers
1619
- }
1620
- });
1621
- return data;
1622
- }
1623
- /**
1624
- * @link /deploy_keys/{key_id}
1625
- */ async function getDeployKey({ pathParams, config } = {}) {
1626
- const { client: request = client, ...requestConfig } = config ?? {};
1627
- if (!pathParams.key_id) {
1628
- throw new Error(`Missing required path parameter: key_id`);
1629
- }
1630
- const data = await request({
1631
- method: "GET",
1632
- url: `/deploy_keys/${pathParams.key_id}`,
1633
- ...requestConfig,
1634
- headers: {
1635
- ...requestConfig.headers
1636
- }
1637
- });
1638
- return data;
1639
- }
1640
- /**
1641
- * @link /deploy_keys/{key_id}
1642
- */ async function deleteDeployKey({ pathParams, config } = {}) {
1643
- const { client: request = client, ...requestConfig } = config ?? {};
1644
- if (!pathParams.key_id) {
1645
- throw new Error(`Missing required path parameter: key_id`);
1646
- }
1647
- const data = await request({
1648
- method: "DELETE",
1649
- url: `/deploy_keys/${pathParams.key_id}`,
1650
- ...requestConfig,
1651
- headers: {
1652
- ...requestConfig.headers
1653
- }
1654
- });
1655
- return data;
1656
- }
1657
- /**
1658
- * @description **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site.
1659
- * @link /{account_slug}/sites
1660
- */ async function createSiteInTeam({ pathParams, body, queryParams, config } = {}) {
1661
- const { client: request = client, ...requestConfig } = config ?? {};
1662
- if (!pathParams.account_slug) {
1663
- throw new Error(`Missing required path parameter: account_slug`);
1664
- }
1665
- const data = await request({
1666
- method: "POST",
1667
- url: `/${pathParams.account_slug}/sites`,
1668
- queryParams,
1669
- body: body,
1670
- ...requestConfig,
1671
- headers: {
1672
- ...requestConfig.headers
1673
- }
1674
- });
1675
- return data;
1676
- }
1677
- /**
1678
- * @description **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
1679
- * @link /{account_slug}/sites
1680
- */ async function listSitesForAccount({ pathParams, queryParams, config } = {}) {
1681
- const { client: request = client, ...requestConfig } = config ?? {};
1682
- if (!pathParams.account_slug) {
1683
- throw new Error(`Missing required path parameter: account_slug`);
1684
- }
1685
- const data = await request({
1686
- method: "GET",
1687
- url: `/${pathParams.account_slug}/sites`,
1688
- queryParams,
1689
- ...requestConfig,
1690
- headers: {
1691
- ...requestConfig.headers
1692
- }
1693
- });
1694
- return data;
1695
- }
1696
- /**
1697
- * @link /{account_slug}/members
1698
- */ async function listMembersForAccount({ pathParams, config } = {}) {
1699
- const { client: request = client, ...requestConfig } = config ?? {};
1700
- if (!pathParams.account_slug) {
1701
- throw new Error(`Missing required path parameter: account_slug`);
1702
- }
1703
- const data = await request({
1704
- method: "GET",
1705
- url: `/${pathParams.account_slug}/members`,
1706
- ...requestConfig,
1707
- headers: {
1708
- ...requestConfig.headers
1709
- }
1710
- });
1711
- return data;
1712
- }
1713
- /**
1714
- * @link /{account_slug}/members
1715
- */ async function addMemberToAccount({ pathParams, body, config } = {}) {
1716
- const { client: request = client, ...requestConfig } = config ?? {};
1717
- if (!pathParams.account_slug) {
1718
- throw new Error(`Missing required path parameter: account_slug`);
1719
- }
1720
- const data = await request({
1721
- method: "POST",
1722
- url: `/${pathParams.account_slug}/members`,
1723
- body: body,
1724
- ...requestConfig,
1725
- headers: {
1726
- ...requestConfig.headers
1727
- }
1728
- });
1729
- return data;
1730
- }
1731
- /**
1732
- * @link /{account_slug}/members/{member_id}
1733
- */ async function getAccountMember({ pathParams, config } = {}) {
1734
- const { client: request = client, ...requestConfig } = config ?? {};
1735
- if (!pathParams.account_slug) {
1736
- throw new Error(`Missing required path parameter: account_slug`);
1737
- }
1738
- if (!pathParams.member_id) {
1739
- throw new Error(`Missing required path parameter: member_id`);
1740
- }
1741
- const data = await request({
1742
- method: "GET",
1743
- url: `/${pathParams.account_slug}/members/${pathParams.member_id}`,
1744
- ...requestConfig,
1745
- headers: {
1746
- ...requestConfig.headers
1747
- }
1748
- });
1749
- return data;
1750
- }
1751
- /**
1752
- * @link /{account_slug}/members/{member_id}
1753
- */ async function updateAccountMember({ pathParams, body, config } = {}) {
1754
- const { client: request = client, ...requestConfig } = config ?? {};
1755
- if (!pathParams.account_slug) {
1756
- throw new Error(`Missing required path parameter: account_slug`);
1757
- }
1758
- if (!pathParams.member_id) {
1759
- throw new Error(`Missing required path parameter: member_id`);
1760
- }
1761
- const data = await request({
1762
- method: "PUT",
1763
- url: `/${pathParams.account_slug}/members/${pathParams.member_id}`,
1764
- body: body,
1765
- ...requestConfig,
1766
- headers: {
1767
- ...requestConfig.headers
1768
- }
1769
- });
1770
- return data;
1771
- }
1772
- /**
1773
- * @link /{account_slug}/members/{member_id}
1774
- */ async function removeAccountMember({ pathParams, config } = {}) {
1775
- const { client: request = client, ...requestConfig } = config ?? {};
1776
- if (!pathParams.account_slug) {
1777
- throw new Error(`Missing required path parameter: account_slug`);
1778
- }
1779
- if (!pathParams.member_id) {
1780
- throw new Error(`Missing required path parameter: member_id`);
1781
- }
1782
- const data = await request({
1783
- method: "DELETE",
1784
- url: `/${pathParams.account_slug}/members/${pathParams.member_id}`,
1785
- ...requestConfig,
1786
- headers: {
1787
- ...requestConfig.headers
1788
- }
1789
- });
1790
- return data;
1791
- }
1792
- /**
1793
- * @link /billing/payment_methods
1794
- */ async function listPaymentMethodsForUser({ config } = {}) {
1795
- const { client: request = client, ...requestConfig } = config ?? {};
1796
- const data = await request({
1797
- method: "GET",
1798
- url: `/billing/payment_methods`,
1799
- ...requestConfig,
1800
- headers: {
1801
- ...requestConfig.headers
1802
- }
1803
- });
1804
- return data;
1805
- }
1806
- /**
1807
- * @link /accounts/types
1808
- */ async function listAccountTypesForUser({ config } = {}) {
1809
- const { client: request = client, ...requestConfig } = config ?? {};
1810
- const data = await request({
1811
- method: "GET",
1812
- url: `/accounts/types`,
1813
- ...requestConfig,
1814
- headers: {
1815
- ...requestConfig.headers
1816
- }
1817
- });
1818
- return data;
1819
- }
1820
- /**
1821
- * @link /accounts
1822
- */ async function listAccountsForUser({ queryParams, config } = {}) {
1823
- const { client: request = client, ...requestConfig } = config ?? {};
1824
- const data = await request({
1825
- method: "GET",
1826
- url: `/accounts`,
1827
- queryParams,
1828
- ...requestConfig,
1829
- headers: {
1830
- ...requestConfig.headers
1831
- }
1832
- });
1833
- return data;
1834
- }
1835
- /**
1836
- * @link /accounts
1837
- */ async function createAccount({ body, config } = {}) {
1838
- const { client: request = client, ...requestConfig } = config ?? {};
1839
- const data = await request({
1840
- method: "POST",
1841
- url: `/accounts`,
1842
- body: body,
1843
- ...requestConfig,
1844
- headers: {
1845
- ...requestConfig.headers
1846
- }
1847
- });
1848
- return data;
1849
- }
1850
- /**
1851
- * @link /accounts/{account_id}
1852
- */ async function getAccount({ pathParams, config } = {}) {
1853
- const { client: request = client, ...requestConfig } = config ?? {};
1854
- if (!pathParams.account_id) {
1855
- throw new Error(`Missing required path parameter: account_id`);
1856
- }
1857
- const data = await request({
1858
- method: "GET",
1859
- url: `/accounts/${pathParams.account_id}`,
1860
- ...requestConfig,
1861
- headers: {
1862
- ...requestConfig.headers
1863
- }
1864
- });
1865
- return data;
1866
- }
1867
- /**
1868
- * @link /accounts/{account_id}
1869
- */ async function updateAccount({ pathParams, body, config } = {}) {
1870
- const { client: request = client, ...requestConfig } = config ?? {};
1871
- if (!pathParams.account_id) {
1872
- throw new Error(`Missing required path parameter: account_id`);
1873
- }
1874
- const data = await request({
1875
- method: "PUT",
1876
- url: `/accounts/${pathParams.account_id}`,
1877
- body: body,
1878
- ...requestConfig,
1879
- headers: {
1880
- ...requestConfig.headers
1881
- }
1882
- });
1883
- return data;
1884
- }
1885
- /**
1886
- * @link /accounts/{account_id}
1887
- */ async function cancelAccount({ pathParams, config } = {}) {
1888
- const { client: request = client, ...requestConfig } = config ?? {};
1889
- if (!pathParams.account_id) {
1890
- throw new Error(`Missing required path parameter: account_id`);
1891
- }
1892
- const data = await request({
1893
- method: "DELETE",
1894
- url: `/accounts/${pathParams.account_id}`,
1895
- ...requestConfig,
1896
- headers: {
1897
- ...requestConfig.headers
1898
- }
1899
- });
1900
- return data;
1901
- }
1902
- /**
1903
- * @link /accounts/{account_id}/audit
1904
- */ async function listAccountAuditEvents({ pathParams, queryParams, config } = {}) {
1905
- const { client: request = client, ...requestConfig } = config ?? {};
1906
- if (!pathParams.account_id) {
1907
- throw new Error(`Missing required path parameter: account_id`);
1908
- }
1909
- const data = await request({
1910
- method: "GET",
1911
- url: `/accounts/${pathParams.account_id}/audit`,
1912
- queryParams,
1913
- ...requestConfig,
1914
- headers: {
1915
- ...requestConfig.headers
1916
- }
1917
- });
1918
- return data;
1919
- }
1920
- /**
1921
- * @link /agent_runners
1922
- */ async function listAgentRunners({ queryParams, config } = {}) {
1923
- const { client: request = client, ...requestConfig } = config ?? {};
1924
- const data = await request({
1925
- method: "GET",
1926
- url: `/agent_runners`,
1927
- queryParams,
1928
- ...requestConfig,
1929
- headers: {
1930
- ...requestConfig.headers
1931
- }
1932
- });
1933
- return data;
1934
- }
1935
- /**
1936
- * @link /agent_runners
1937
- */ async function createAgentRunner({ queryParams, config } = {}) {
1938
- const { client: request = client, ...requestConfig } = config ?? {};
1939
- const data = await request({
1940
- method: "POST",
1941
- url: `/agent_runners`,
1942
- queryParams,
1943
- ...requestConfig,
1944
- headers: {
1945
- ...requestConfig.headers
1946
- }
1947
- });
1948
- return data;
1949
- }
1950
- /**
1951
- * @link /agent_runners/upload_url
1952
- */ async function createAgentRunnerUploadUrl({ queryParams, config } = {}) {
1953
- const { client: request = client, ...requestConfig } = config ?? {};
1954
- const data = await request({
1955
- method: "POST",
1956
- url: `/agent_runners/upload_url`,
1957
- queryParams,
1958
- ...requestConfig,
1959
- headers: {
1960
- ...requestConfig.headers
1961
- }
1962
- });
1963
- return data;
1964
- }
1965
- /**
1966
- * @link /agent_runners/{agent_runner_id}
1967
- */ async function getAgentRunner({ pathParams, config } = {}) {
1968
- const { client: request = client, ...requestConfig } = config ?? {};
1969
- if (!pathParams.agent_runner_id) {
1970
- throw new Error(`Missing required path parameter: agent_runner_id`);
1971
- }
1972
- const data = await request({
1973
- method: "GET",
1974
- url: `/agent_runners/${pathParams.agent_runner_id}`,
1975
- ...requestConfig,
1976
- headers: {
1977
- ...requestConfig.headers
1978
- }
1979
- });
1980
- return data;
1981
- }
1982
- /**
1983
- * @link /agent_runners/{agent_runner_id}
1984
- */ async function updateAgentRunner({ pathParams, config } = {}) {
1985
- const { client: request = client, ...requestConfig } = config ?? {};
1986
- if (!pathParams.agent_runner_id) {
1987
- throw new Error(`Missing required path parameter: agent_runner_id`);
1988
- }
1989
- const data = await request({
1990
- method: "PATCH",
1991
- url: `/agent_runners/${pathParams.agent_runner_id}`,
1992
- ...requestConfig,
1993
- headers: {
1994
- ...requestConfig.headers
1995
- }
1996
- });
1997
- return data;
1998
- }
1999
- /**
2000
- * @link /agent_runners/{agent_runner_id}
2001
- */ async function deleteAgentRunner({ pathParams, config } = {}) {
2002
- const { client: request = client, ...requestConfig } = config ?? {};
2003
- if (!pathParams.agent_runner_id) {
2004
- throw new Error(`Missing required path parameter: agent_runner_id`);
2005
- }
2006
- const data = await request({
2007
- method: "DELETE",
2008
- url: `/agent_runners/${pathParams.agent_runner_id}`,
2009
- ...requestConfig,
2010
- headers: {
2011
- ...requestConfig.headers
2012
- }
2013
- });
2014
- return data;
2015
- }
2016
- /**
2017
- * @link /agent_runners/{agent_runner_id}/archive
2018
- */ async function archiveAgentRunner({ pathParams, config } = {}) {
2019
- const { client: request = client, ...requestConfig } = config ?? {};
2020
- if (!pathParams.agent_runner_id) {
2021
- throw new Error(`Missing required path parameter: agent_runner_id`);
2022
- }
2023
- const data = await request({
2024
- method: "POST",
2025
- url: `/agent_runners/${pathParams.agent_runner_id}/archive`,
2026
- ...requestConfig,
2027
- headers: {
2028
- ...requestConfig.headers
2029
- }
2030
- });
2031
- return data;
2032
- }
2033
- /**
2034
- * @link /agent_runners/{agent_runner_id}/pull_request
2035
- */ async function agentRunnerPullRequest({ pathParams, config } = {}) {
2036
- const { client: request = client, ...requestConfig } = config ?? {};
2037
- if (!pathParams.agent_runner_id) {
2038
- throw new Error(`Missing required path parameter: agent_runner_id`);
2039
- }
2040
- const data = await request({
2041
- method: "POST",
2042
- url: `/agent_runners/${pathParams.agent_runner_id}/pull_request`,
2043
- ...requestConfig,
2044
- headers: {
2045
- ...requestConfig.headers
2046
- }
2047
- });
2048
- return data;
2049
- }
2050
- /**
2051
- * @link /agent_runners/{agent_runner_id}/commit
2052
- */ async function agentRunnerCommitToBranch({ pathParams, queryParams, config } = {}) {
2053
- const { client: request = client, ...requestConfig } = config ?? {};
2054
- if (!pathParams.agent_runner_id) {
2055
- throw new Error(`Missing required path parameter: agent_runner_id`);
2056
- }
2057
- const data = await request({
2058
- method: "POST",
2059
- url: `/agent_runners/${pathParams.agent_runner_id}/commit`,
2060
- queryParams,
2061
- ...requestConfig,
2062
- headers: {
2063
- ...requestConfig.headers
2064
- }
2065
- });
2066
- return data;
2067
- }
2068
- /**
2069
- * @link /agent_runners/{agent_runner_id}/sessions
2070
- */ async function listAgentRunnerSessions({ pathParams, queryParams, config } = {}) {
2071
- const { client: request = client, ...requestConfig } = config ?? {};
2072
- if (!pathParams.agent_runner_id) {
2073
- throw new Error(`Missing required path parameter: agent_runner_id`);
2074
- }
2075
- const data = await request({
2076
- method: "GET",
2077
- url: `/agent_runners/${pathParams.agent_runner_id}/sessions`,
2078
- queryParams,
2079
- ...requestConfig,
2080
- headers: {
2081
- ...requestConfig.headers
2082
- }
2083
- });
2084
- return data;
2085
- }
2086
- /**
2087
- * @link /agent_runners/{agent_runner_id}/sessions
2088
- */ async function createAgentRunnerSession({ pathParams, queryParams, config } = {}) {
2089
- const { client: request = client, ...requestConfig } = config ?? {};
2090
- if (!pathParams.agent_runner_id) {
2091
- throw new Error(`Missing required path parameter: agent_runner_id`);
2092
- }
2093
- const data = await request({
2094
- method: "POST",
2095
- url: `/agent_runners/${pathParams.agent_runner_id}/sessions`,
2096
- queryParams,
2097
- ...requestConfig,
2098
- headers: {
2099
- ...requestConfig.headers
2100
- }
2101
- });
2102
- return data;
2103
- }
2104
- /**
2105
- * @link /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}
2106
- */ async function getAgentRunnerSession({ pathParams, config } = {}) {
2107
- const { client: request = client, ...requestConfig } = config ?? {};
2108
- if (!pathParams.agent_runner_id) {
2109
- throw new Error(`Missing required path parameter: agent_runner_id`);
2110
- }
2111
- if (!pathParams.agent_runner_session_id) {
2112
- throw new Error(`Missing required path parameter: agent_runner_session_id`);
2113
- }
2114
- const data = await request({
2115
- method: "GET",
2116
- url: `/agent_runners/${pathParams.agent_runner_id}/sessions/${pathParams.agent_runner_session_id}`,
2117
- ...requestConfig,
2118
- headers: {
2119
- ...requestConfig.headers
2120
- }
2121
- });
2122
- return data;
2123
- }
2124
- /**
2125
- * @link /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}
2126
- */ async function updateAgentRunnerSession({ pathParams, queryParams, config } = {}) {
2127
- const { client: request = client, ...requestConfig } = config ?? {};
2128
- if (!pathParams.agent_runner_id) {
2129
- throw new Error(`Missing required path parameter: agent_runner_id`);
2130
- }
2131
- if (!pathParams.agent_runner_session_id) {
2132
- throw new Error(`Missing required path parameter: agent_runner_session_id`);
2133
- }
2134
- const data = await request({
2135
- method: "PATCH",
2136
- url: `/agent_runners/${pathParams.agent_runner_id}/sessions/${pathParams.agent_runner_session_id}`,
2137
- queryParams,
2138
- ...requestConfig,
2139
- headers: {
2140
- ...requestConfig.headers
2141
- }
2142
- });
2143
- return data;
2144
- }
2145
- /**
2146
- * @link /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}
2147
- */ async function deleteAgentRunnerSession({ pathParams, config } = {}) {
2148
- const { client: request = client, ...requestConfig } = config ?? {};
2149
- if (!pathParams.agent_runner_id) {
2150
- throw new Error(`Missing required path parameter: agent_runner_id`);
2151
- }
2152
- if (!pathParams.agent_runner_session_id) {
2153
- throw new Error(`Missing required path parameter: agent_runner_session_id`);
2154
- }
2155
- const data = await request({
2156
- method: "DELETE",
2157
- url: `/agent_runners/${pathParams.agent_runner_id}/sessions/${pathParams.agent_runner_session_id}`,
2158
- ...requestConfig,
2159
- headers: {
2160
- ...requestConfig.headers
2161
- }
2162
- });
2163
- return data;
2164
- }
2165
- /**
2166
- * @link /submissions/{submission_id}
2167
- */ async function listFormSubmission({ pathParams, queryParams, config } = {}) {
2168
- const { client: request = client, ...requestConfig } = config ?? {};
2169
- if (!pathParams.submission_id) {
2170
- throw new Error(`Missing required path parameter: submission_id`);
2171
- }
2172
- const data = await request({
2173
- method: "GET",
2174
- url: `/submissions/${pathParams.submission_id}`,
2175
- queryParams,
2176
- ...requestConfig,
2177
- headers: {
2178
- ...requestConfig.headers
2179
- }
2180
- });
2181
- return data;
2182
- }
2183
- /**
2184
- * @link /submissions/{submission_id}
2185
- */ async function deleteSubmission({ pathParams, config } = {}) {
2186
- const { client: request = client, ...requestConfig } = config ?? {};
2187
- if (!pathParams.submission_id) {
2188
- throw new Error(`Missing required path parameter: submission_id`);
2189
- }
2190
- const data = await request({
2191
- method: "DELETE",
2192
- url: `/submissions/${pathParams.submission_id}`,
2193
- ...requestConfig,
2194
- headers: {
2195
- ...requestConfig.headers
2196
- }
2197
- });
2198
- return data;
2199
- }
2200
- /**
2201
- * @link /sites/{site_id}/service-instances
2202
- */ async function listServiceInstancesForSite({ pathParams, config } = {}) {
2203
- const { client: request = client, ...requestConfig } = config ?? {};
2204
- if (!pathParams.site_id) {
2205
- throw new Error(`Missing required path parameter: site_id`);
2206
- }
2207
- const data = await request({
2208
- method: "GET",
2209
- url: `/sites/${pathParams.site_id}/service-instances`,
2210
- ...requestConfig,
2211
- headers: {
2212
- ...requestConfig.headers
2213
- }
2214
- });
2215
- return data;
2216
- }
2217
- /**
2218
- * @link /sites/{site_id}/services/{addon}/instances
2219
- */ async function createServiceInstance({ pathParams, body, config } = {}) {
2220
- const { client: request = client, ...requestConfig } = config ?? {};
2221
- if (!pathParams.site_id) {
2222
- throw new Error(`Missing required path parameter: site_id`);
2223
- }
2224
- if (!pathParams.addon) {
2225
- throw new Error(`Missing required path parameter: addon`);
2226
- }
2227
- const data = await request({
2228
- method: "POST",
2229
- url: `/sites/${pathParams.site_id}/services/${pathParams.addon}/instances`,
2230
- body: body,
2231
- ...requestConfig,
2232
- headers: {
2233
- ...requestConfig.headers
2234
- }
2235
- });
2236
- return data;
2237
- }
2238
- /**
2239
- * @link /sites/{site_id}/services/{addon}/instances/{instance_id}
2240
- */ async function showServiceInstance({ pathParams, config } = {}) {
2241
- const { client: request = client, ...requestConfig } = config ?? {};
2242
- if (!pathParams.site_id) {
2243
- throw new Error(`Missing required path parameter: site_id`);
2244
- }
2245
- if (!pathParams.addon) {
2246
- throw new Error(`Missing required path parameter: addon`);
2247
- }
2248
- if (!pathParams.instance_id) {
2249
- throw new Error(`Missing required path parameter: instance_id`);
2250
- }
2251
- const data = await request({
2252
- method: "GET",
2253
- url: `/sites/${pathParams.site_id}/services/${pathParams.addon}/instances/${pathParams.instance_id}`,
2254
- ...requestConfig,
2255
- headers: {
2256
- ...requestConfig.headers
2257
- }
2258
- });
2259
- return data;
2260
- }
2261
- /**
2262
- * @link /sites/{site_id}/services/{addon}/instances/{instance_id}
2263
- */ async function updateServiceInstance({ pathParams, body, config } = {}) {
2264
- const { client: request = client, ...requestConfig } = config ?? {};
2265
- if (!pathParams.site_id) {
2266
- throw new Error(`Missing required path parameter: site_id`);
2267
- }
2268
- if (!pathParams.addon) {
2269
- throw new Error(`Missing required path parameter: addon`);
2270
- }
2271
- if (!pathParams.instance_id) {
2272
- throw new Error(`Missing required path parameter: instance_id`);
2273
- }
2274
- const data = await request({
2275
- method: "PUT",
2276
- url: `/sites/${pathParams.site_id}/services/${pathParams.addon}/instances/${pathParams.instance_id}`,
2277
- body: body,
2278
- ...requestConfig,
2279
- headers: {
2280
- ...requestConfig.headers
2281
- }
2282
- });
2283
- return data;
2284
- }
2285
- /**
2286
- * @link /sites/{site_id}/services/{addon}/instances/{instance_id}
2287
- */ async function deleteServiceInstance({ pathParams, config } = {}) {
2288
- const { client: request = client, ...requestConfig } = config ?? {};
2289
- if (!pathParams.site_id) {
2290
- throw new Error(`Missing required path parameter: site_id`);
2291
- }
2292
- if (!pathParams.addon) {
2293
- throw new Error(`Missing required path parameter: addon`);
2294
- }
2295
- if (!pathParams.instance_id) {
2296
- throw new Error(`Missing required path parameter: instance_id`);
2297
- }
2298
- const data = await request({
2299
- method: "DELETE",
2300
- url: `/sites/${pathParams.site_id}/services/${pathParams.addon}/instances/${pathParams.instance_id}`,
2301
- ...requestConfig,
2302
- headers: {
2303
- ...requestConfig.headers
2304
- }
2305
- });
2306
- return data;
2307
- }
2308
- /**
2309
- * @link /services/
2310
- */ async function getServices({ queryParams, config } = {}) {
2311
- const { client: request = client, ...requestConfig } = config ?? {};
2312
- const data = await request({
2313
- method: "GET",
2314
- url: `/services/`,
2315
- queryParams,
2316
- ...requestConfig,
2317
- headers: {
2318
- ...requestConfig.headers
2319
- }
2320
- });
2321
- return data;
2322
- }
2323
- /**
2324
- * @link /services/{addonName}
2325
- */ async function showService({ pathParams, config } = {}) {
2326
- const { client: request = client, ...requestConfig } = config ?? {};
2327
- if (!pathParams.addonName) {
2328
- throw new Error(`Missing required path parameter: addonName`);
2329
- }
2330
- const data = await request({
2331
- method: "GET",
2332
- url: `/services/${pathParams.addonName}`,
2333
- ...requestConfig,
2334
- headers: {
2335
- ...requestConfig.headers
2336
- }
2337
- });
2338
- return data;
2339
- }
2340
- /**
2341
- * @link /services/{addonName}/manifest
2342
- */ async function showServiceManifest({ pathParams, config } = {}) {
2343
- const { client: request = client, ...requestConfig } = config ?? {};
2344
- if (!pathParams.addonName) {
2345
- throw new Error(`Missing required path parameter: addonName`);
2346
- }
2347
- const data = await request({
2348
- method: "GET",
2349
- url: `/services/${pathParams.addonName}/manifest`,
2350
- ...requestConfig,
2351
- headers: {
2352
- ...requestConfig.headers
2353
- }
2354
- });
2355
- return data;
2356
- }
2357
- /**
2358
- * @link /user
2359
- */ async function getCurrentUser({ config } = {}) {
2360
- const { client: request = client, ...requestConfig } = config ?? {};
2361
- const data = await request({
2362
- method: "GET",
2363
- url: `/user`,
2364
- ...requestConfig,
2365
- headers: {
2366
- ...requestConfig.headers
2367
- }
2368
- });
2369
- return data;
2370
- }
2371
- /**
2372
- * @link /sites/{site_id}/traffic_splits
2373
- */ async function createSplitTest({ pathParams, body, config } = {}) {
2374
- const { client: request = client, ...requestConfig } = config ?? {};
2375
- if (!pathParams.site_id) {
2376
- throw new Error(`Missing required path parameter: site_id`);
2377
- }
2378
- const data = await request({
2379
- method: "POST",
2380
- url: `/sites/${pathParams.site_id}/traffic_splits`,
2381
- body: body,
2382
- ...requestConfig,
2383
- headers: {
2384
- ...requestConfig.headers
2385
- }
2386
- });
2387
- return data;
2388
- }
2389
- /**
2390
- * @link /sites/{site_id}/traffic_splits
2391
- */ async function getSplitTests({ pathParams, config } = {}) {
2392
- const { client: request = client, ...requestConfig } = config ?? {};
2393
- if (!pathParams.site_id) {
2394
- throw new Error(`Missing required path parameter: site_id`);
2395
- }
2396
- const data = await request({
2397
- method: "GET",
2398
- url: `/sites/${pathParams.site_id}/traffic_splits`,
2399
- ...requestConfig,
2400
- headers: {
2401
- ...requestConfig.headers
2402
- }
2403
- });
2404
- return data;
2405
- }
2406
- /**
2407
- * @link /sites/{site_id}/traffic_splits/{split_test_id}
2408
- */ async function updateSplitTest({ pathParams, body, config } = {}) {
2409
- const { client: request = client, ...requestConfig } = config ?? {};
2410
- if (!pathParams.site_id) {
2411
- throw new Error(`Missing required path parameter: site_id`);
2412
- }
2413
- if (!pathParams.split_test_id) {
2414
- throw new Error(`Missing required path parameter: split_test_id`);
2415
- }
2416
- const data = await request({
2417
- method: "PUT",
2418
- url: `/sites/${pathParams.site_id}/traffic_splits/${pathParams.split_test_id}`,
2419
- body: body,
2420
- ...requestConfig,
2421
- headers: {
2422
- ...requestConfig.headers
2423
- }
2424
- });
2425
- return data;
2426
- }
2427
- /**
2428
- * @link /sites/{site_id}/traffic_splits/{split_test_id}
2429
- */ async function getSplitTest({ pathParams, config } = {}) {
2430
- const { client: request = client, ...requestConfig } = config ?? {};
2431
- if (!pathParams.site_id) {
2432
- throw new Error(`Missing required path parameter: site_id`);
2433
- }
2434
- if (!pathParams.split_test_id) {
2435
- throw new Error(`Missing required path parameter: split_test_id`);
2436
- }
2437
- const data = await request({
2438
- method: "GET",
2439
- url: `/sites/${pathParams.site_id}/traffic_splits/${pathParams.split_test_id}`,
2440
- ...requestConfig,
2441
- headers: {
2442
- ...requestConfig.headers
2443
- }
2444
- });
2445
- return data;
2446
- }
2447
- /**
2448
- * @link /sites/{site_id}/traffic_splits/{split_test_id}/publish
2449
- */ async function enableSplitTest({ pathParams, config } = {}) {
2450
- const { client: request = client, ...requestConfig } = config ?? {};
2451
- if (!pathParams.site_id) {
2452
- throw new Error(`Missing required path parameter: site_id`);
2453
- }
2454
- if (!pathParams.split_test_id) {
2455
- throw new Error(`Missing required path parameter: split_test_id`);
2456
- }
2457
- const data = await request({
2458
- method: "POST",
2459
- url: `/sites/${pathParams.site_id}/traffic_splits/${pathParams.split_test_id}/publish`,
2460
- ...requestConfig,
2461
- headers: {
2462
- ...requestConfig.headers
2463
- }
2464
- });
2465
- return data;
2466
- }
2467
- /**
2468
- * @link /sites/{site_id}/traffic_splits/{split_test_id}/unpublish
2469
- */ async function disableSplitTest({ pathParams, config } = {}) {
2470
- const { client: request = client, ...requestConfig } = config ?? {};
2471
- if (!pathParams.site_id) {
2472
- throw new Error(`Missing required path parameter: site_id`);
2473
- }
2474
- if (!pathParams.split_test_id) {
2475
- throw new Error(`Missing required path parameter: split_test_id`);
2476
- }
2477
- const data = await request({
2478
- method: "POST",
2479
- url: `/sites/${pathParams.site_id}/traffic_splits/${pathParams.split_test_id}/unpublish`,
2480
- ...requestConfig,
2481
- headers: {
2482
- ...requestConfig.headers
2483
- }
2484
- });
2485
- return data;
2486
- }
2487
- /**
2488
- * @link /dns_zones
2489
- */ async function createDnsZone({ body, config } = {}) {
2490
- const { client: request = client, ...requestConfig } = config ?? {};
2491
- const data = await request({
2492
- method: "POST",
2493
- url: `/dns_zones`,
2494
- body: body,
2495
- ...requestConfig,
2496
- headers: {
2497
- ...requestConfig.headers
2498
- }
2499
- });
2500
- return data;
2501
- }
2502
- /**
2503
- * @link /dns_zones
2504
- */ async function getDnsZones({ queryParams, config } = {}) {
2505
- const { client: request = client, ...requestConfig } = config ?? {};
2506
- const data = await request({
2507
- method: "GET",
2508
- url: `/dns_zones`,
2509
- queryParams,
2510
- ...requestConfig,
2511
- headers: {
2512
- ...requestConfig.headers
2513
- }
2514
- });
2515
- return data;
2516
- }
2517
- /**
2518
- * @link /dns_zones/{zone_id}
2519
- */ async function getDnsZone({ pathParams, config } = {}) {
2520
- const { client: request = client, ...requestConfig } = config ?? {};
2521
- if (!pathParams.zone_id) {
2522
- throw new Error(`Missing required path parameter: zone_id`);
2523
- }
2524
- const data = await request({
2525
- method: "GET",
2526
- url: `/dns_zones/${pathParams.zone_id}`,
2527
- ...requestConfig,
2528
- headers: {
2529
- ...requestConfig.headers
2530
- }
2531
- });
2532
- return data;
2533
- }
2534
- /**
2535
- * @link /dns_zones/{zone_id}
2536
- */ async function deleteDnsZone({ pathParams, config } = {}) {
2537
- const { client: request = client, ...requestConfig } = config ?? {};
2538
- if (!pathParams.zone_id) {
2539
- throw new Error(`Missing required path parameter: zone_id`);
2540
- }
2541
- const data = await request({
2542
- method: "DELETE",
2543
- url: `/dns_zones/${pathParams.zone_id}`,
2544
- ...requestConfig,
2545
- headers: {
2546
- ...requestConfig.headers
2547
- }
2548
- });
2549
- return data;
2550
- }
2551
- /**
2552
- * @link /dns_zones/{zone_id}/transfer
2553
- */ async function transferDnsZone({ pathParams, queryParams, config } = {}) {
2554
- const { client: request = client, ...requestConfig } = config ?? {};
2555
- if (!pathParams.zone_id) {
2556
- throw new Error(`Missing required path parameter: zone_id`);
2557
- }
2558
- const data = await request({
2559
- method: "PUT",
2560
- url: `/dns_zones/${pathParams.zone_id}/transfer`,
2561
- queryParams,
2562
- ...requestConfig,
2563
- headers: {
2564
- ...requestConfig.headers
2565
- }
2566
- });
2567
- return data;
2568
- }
2569
- /**
2570
- * @link /dns_zones/{zone_id}/dns_records
2571
- */ async function getDnsRecords({ pathParams, config } = {}) {
2572
- const { client: request = client, ...requestConfig } = config ?? {};
2573
- if (!pathParams.zone_id) {
2574
- throw new Error(`Missing required path parameter: zone_id`);
2575
- }
2576
- const data = await request({
2577
- method: "GET",
2578
- url: `/dns_zones/${pathParams.zone_id}/dns_records`,
2579
- ...requestConfig,
2580
- headers: {
2581
- ...requestConfig.headers
2582
- }
2583
- });
2584
- return data;
2585
- }
2586
- /**
2587
- * @link /dns_zones/{zone_id}/dns_records
2588
- */ async function createDnsRecord({ pathParams, body, config } = {}) {
2589
- const { client: request = client, ...requestConfig } = config ?? {};
2590
- if (!pathParams.zone_id) {
2591
- throw new Error(`Missing required path parameter: zone_id`);
2592
- }
2593
- const data = await request({
2594
- method: "POST",
2595
- url: `/dns_zones/${pathParams.zone_id}/dns_records`,
2596
- body: body,
2597
- ...requestConfig,
2598
- headers: {
2599
- ...requestConfig.headers
2600
- }
2601
- });
2602
- return data;
2603
- }
2604
- /**
2605
- * @link /dns_zones/{zone_id}/dns_records/{dns_record_id}
2606
- */ async function getIndividualDnsRecord({ pathParams, config } = {}) {
2607
- const { client: request = client, ...requestConfig } = config ?? {};
2608
- if (!pathParams.zone_id) {
2609
- throw new Error(`Missing required path parameter: zone_id`);
2610
- }
2611
- if (!pathParams.dns_record_id) {
2612
- throw new Error(`Missing required path parameter: dns_record_id`);
2613
- }
2614
- const data = await request({
2615
- method: "GET",
2616
- url: `/dns_zones/${pathParams.zone_id}/dns_records/${pathParams.dns_record_id}`,
2617
- ...requestConfig,
2618
- headers: {
2619
- ...requestConfig.headers
2620
- }
2621
- });
2622
- return data;
2623
- }
2624
- /**
2625
- * @link /dns_zones/{zone_id}/dns_records/{dns_record_id}
2626
- */ async function deleteDnsRecord({ pathParams, config } = {}) {
2627
- const { client: request = client, ...requestConfig } = config ?? {};
2628
- if (!pathParams.zone_id) {
2629
- throw new Error(`Missing required path parameter: zone_id`);
2630
- }
2631
- if (!pathParams.dns_record_id) {
2632
- throw new Error(`Missing required path parameter: dns_record_id`);
2633
- }
2634
- const data = await request({
2635
- method: "DELETE",
2636
- url: `/dns_zones/${pathParams.zone_id}/dns_records/${pathParams.dns_record_id}`,
2637
- ...requestConfig,
2638
- headers: {
2639
- ...requestConfig.headers
2640
- }
2641
- });
2642
- return data;
2643
- }
2644
- /**
2645
- * @link /sites/{site_id}/dev_servers
2646
- */ async function listSiteDevServers({ pathParams, queryParams, config } = {}) {
2647
- const { client: request = client, ...requestConfig } = config ?? {};
2648
- if (!pathParams.site_id) {
2649
- throw new Error(`Missing required path parameter: site_id`);
2650
- }
2651
- const data = await request({
2652
- method: "GET",
2653
- url: `/sites/${pathParams.site_id}/dev_servers`,
2654
- queryParams,
2655
- ...requestConfig,
2656
- headers: {
2657
- ...requestConfig.headers
2658
- }
2659
- });
2660
- return data;
2661
- }
2662
- /**
2663
- * @link /sites/{site_id}/dev_servers
2664
- */ async function createSiteDevServer({ pathParams, queryParams, config } = {}) {
2665
- const { client: request = client, ...requestConfig } = config ?? {};
2666
- if (!pathParams.site_id) {
2667
- throw new Error(`Missing required path parameter: site_id`);
2668
- }
2669
- const data = await request({
2670
- method: "POST",
2671
- url: `/sites/${pathParams.site_id}/dev_servers`,
2672
- queryParams,
2673
- ...requestConfig,
2674
- headers: {
2675
- ...requestConfig.headers
2676
- }
2677
- });
2678
- return data;
2679
- }
2680
- /**
2681
- * @link /sites/{site_id}/dev_servers
2682
- */ async function deleteSiteDevServers({ pathParams, queryParams, config } = {}) {
2683
- const { client: request = client, ...requestConfig } = config ?? {};
2684
- if (!pathParams.site_id) {
2685
- throw new Error(`Missing required path parameter: site_id`);
2686
- }
2687
- const data = await request({
2688
- method: "DELETE",
2689
- url: `/sites/${pathParams.site_id}/dev_servers`,
2690
- queryParams,
2691
- ...requestConfig,
2692
- headers: {
2693
- ...requestConfig.headers
2694
- }
2695
- });
2696
- return data;
2697
- }
2698
- /**
2699
- * @link /sites/{site_id}/dev_servers/{dev_server_id}
2700
- */ async function getSiteDevServer({ pathParams, config } = {}) {
2701
- const { client: request = client, ...requestConfig } = config ?? {};
2702
- if (!pathParams.site_id) {
2703
- throw new Error(`Missing required path parameter: site_id`);
2704
- }
2705
- if (!pathParams.dev_server_id) {
2706
- throw new Error(`Missing required path parameter: dev_server_id`);
2707
- }
2708
- const data = await request({
2709
- method: "GET",
2710
- url: `/sites/${pathParams.site_id}/dev_servers/${pathParams.dev_server_id}`,
2711
- ...requestConfig,
2712
- headers: {
2713
- ...requestConfig.headers
2714
- }
2715
- });
2716
- return data;
2717
- }
2718
- /**
2719
- * @link /sites/{site_id}/dev_servers/{dev_server_id}/activity
2720
- */ async function markDevServerActivity({ pathParams, config } = {}) {
2721
- const { client: request = client, ...requestConfig } = config ?? {};
2722
- if (!pathParams.site_id) {
2723
- throw new Error(`Missing required path parameter: site_id`);
2724
- }
2725
- if (!pathParams.dev_server_id) {
2726
- throw new Error(`Missing required path parameter: dev_server_id`);
2727
- }
2728
- const data = await request({
2729
- method: "POST",
2730
- url: `/sites/${pathParams.site_id}/dev_servers/${pathParams.dev_server_id}/activity`,
2731
- ...requestConfig,
2732
- headers: {
2733
- ...requestConfig.headers
2734
- }
2735
- });
2736
- return data;
2737
- }
2738
- /**
2739
- * @link /sites/{site_id}/dev_servers/{dev_server_id}/state
2740
- */ async function updateDevServerState({ pathParams, body, config } = {}) {
2741
- const { client: request = client, ...requestConfig } = config ?? {};
2742
- if (!pathParams.site_id) {
2743
- throw new Error(`Missing required path parameter: site_id`);
2744
- }
2745
- if (!pathParams.dev_server_id) {
2746
- throw new Error(`Missing required path parameter: dev_server_id`);
2747
- }
2748
- const data = await request({
2749
- method: "POST",
2750
- url: `/sites/${pathParams.site_id}/dev_servers/${pathParams.dev_server_id}/state`,
2751
- body: body,
2752
- ...requestConfig,
2753
- headers: {
2754
- ...requestConfig.headers
2755
- }
2756
- });
2757
- return data;
2758
- }
2759
- /**
2760
- * @link /sites/{site_id}/dev_server_hooks
2761
- */ async function listSiteDevServerHooks({ pathParams, config } = {}) {
2762
- const { client: request = client, ...requestConfig } = config ?? {};
2763
- if (!pathParams.site_id) {
2764
- throw new Error(`Missing required path parameter: site_id`);
2765
- }
2766
- const data = await request({
2767
- method: "GET",
2768
- url: `/sites/${pathParams.site_id}/dev_server_hooks`,
2769
- ...requestConfig,
2770
- headers: {
2771
- ...requestConfig.headers
2772
- }
2773
- });
2774
- return data;
2775
- }
2776
- /**
2777
- * @link /sites/{site_id}/dev_server_hooks
2778
- */ async function createSiteDevServerHook({ pathParams, body, config } = {}) {
2779
- const { client: request = client, ...requestConfig } = config ?? {};
2780
- if (!pathParams.site_id) {
2781
- throw new Error(`Missing required path parameter: site_id`);
2782
- }
2783
- const data = await request({
2784
- method: "POST",
2785
- url: `/sites/${pathParams.site_id}/dev_server_hooks`,
2786
- body: body,
2787
- ...requestConfig,
2788
- headers: {
2789
- ...requestConfig.headers
2790
- }
2791
- });
2792
- return data;
2793
- }
2794
- /**
2795
- * @link /sites/{site_id}/dev_server_hooks/{id}
2796
- */ async function getSiteDevServerHook({ pathParams, config } = {}) {
2797
- const { client: request = client, ...requestConfig } = config ?? {};
2798
- if (!pathParams.site_id) {
2799
- throw new Error(`Missing required path parameter: site_id`);
2800
- }
2801
- if (!pathParams.id) {
2802
- throw new Error(`Missing required path parameter: id`);
2803
- }
2804
- const data = await request({
2805
- method: "GET",
2806
- url: `/sites/${pathParams.site_id}/dev_server_hooks/${pathParams.id}`,
2807
- ...requestConfig,
2808
- headers: {
2809
- ...requestConfig.headers
2810
- }
2811
- });
2812
- return data;
2813
- }
2814
- /**
2815
- * @link /sites/{site_id}/dev_server_hooks/{id}
2816
- */ async function updateSiteDevServerHook({ pathParams, body, config } = {}) {
2817
- const { client: request = client, ...requestConfig } = config ?? {};
2818
- if (!pathParams.site_id) {
2819
- throw new Error(`Missing required path parameter: site_id`);
2820
- }
2821
- if (!pathParams.id) {
2822
- throw new Error(`Missing required path parameter: id`);
2823
- }
2824
- const data = await request({
2825
- method: "PUT",
2826
- url: `/sites/${pathParams.site_id}/dev_server_hooks/${pathParams.id}`,
2827
- body: body,
2828
- ...requestConfig,
2829
- headers: {
2830
- ...requestConfig.headers
2831
- }
2832
- });
2833
- return data;
2834
- }
2835
- /**
2836
- * @link /sites/{site_id}/dev_server_hooks/{id}
2837
- */ async function deleteSiteDevServerHook({ pathParams, config } = {}) {
2838
- const { client: request = client, ...requestConfig } = config ?? {};
2839
- if (!pathParams.site_id) {
2840
- throw new Error(`Missing required path parameter: site_id`);
2841
- }
2842
- if (!pathParams.id) {
2843
- throw new Error(`Missing required path parameter: id`);
2844
- }
2845
- const data = await request({
2846
- method: "DELETE",
2847
- url: `/sites/${pathParams.site_id}/dev_server_hooks/${pathParams.id}`,
2848
- ...requestConfig,
2849
- headers: {
2850
- ...requestConfig.headers
2851
- }
2852
- });
2853
- return data;
2854
- }
2855
- /**
2856
- * @link /sites/{site_id}/agent_runner_hooks
2857
- */ async function listSiteAgentRunnerHooks({ pathParams, config } = {}) {
2858
- const { client: request = client, ...requestConfig } = config ?? {};
2859
- if (!pathParams.site_id) {
2860
- throw new Error(`Missing required path parameter: site_id`);
2861
- }
2862
- const data = await request({
2863
- method: "GET",
2864
- url: `/sites/${pathParams.site_id}/agent_runner_hooks`,
2865
- ...requestConfig,
2866
- headers: {
2867
- ...requestConfig.headers
2868
- }
2869
- });
2870
- return data;
2871
- }
2872
- /**
2873
- * @link /sites/{site_id}/agent_runner_hooks
2874
- */ async function createSiteAgentRunnerHook({ pathParams, body, config } = {}) {
2875
- const { client: request = client, ...requestConfig } = config ?? {};
2876
- if (!pathParams.site_id) {
2877
- throw new Error(`Missing required path parameter: site_id`);
2878
- }
2879
- const data = await request({
2880
- method: "POST",
2881
- url: `/sites/${pathParams.site_id}/agent_runner_hooks`,
2882
- body: body,
2883
- ...requestConfig,
2884
- headers: {
2885
- ...requestConfig.headers
2886
- }
2887
- });
2888
- return data;
2889
- }
2890
- /**
2891
- * @link /sites/{site_id}/agent_runner_hooks/{id}
2892
- */ async function getSiteAgentRunnerHook({ pathParams, config } = {}) {
2893
- const { client: request = client, ...requestConfig } = config ?? {};
2894
- if (!pathParams.site_id) {
2895
- throw new Error(`Missing required path parameter: site_id`);
2896
- }
2897
- if (!pathParams.id) {
2898
- throw new Error(`Missing required path parameter: id`);
2899
- }
2900
- const data = await request({
2901
- method: "GET",
2902
- url: `/sites/${pathParams.site_id}/agent_runner_hooks/${pathParams.id}`,
2903
- ...requestConfig,
2904
- headers: {
2905
- ...requestConfig.headers
2906
- }
2907
- });
2908
- return data;
2909
- }
2910
- /**
2911
- * @link /sites/{site_id}/agent_runner_hooks/{id}
2912
- */ async function updateSiteAgentRunnerHook({ pathParams, body, config } = {}) {
2913
- const { client: request = client, ...requestConfig } = config ?? {};
2914
- if (!pathParams.site_id) {
2915
- throw new Error(`Missing required path parameter: site_id`);
2916
- }
2917
- if (!pathParams.id) {
2918
- throw new Error(`Missing required path parameter: id`);
2919
- }
2920
- const data = await request({
2921
- method: "PUT",
2922
- url: `/sites/${pathParams.site_id}/agent_runner_hooks/${pathParams.id}`,
2923
- body: body,
2924
- ...requestConfig,
2925
- headers: {
2926
- ...requestConfig.headers
2927
- }
2928
- });
2929
- return data;
2930
- }
2931
- /**
2932
- * @link /sites/{site_id}/agent_runner_hooks/{id}
2933
- */ async function deleteSiteAgentRunnerHook({ pathParams, config } = {}) {
2934
- const { client: request = client, ...requestConfig } = config ?? {};
2935
- if (!pathParams.site_id) {
2936
- throw new Error(`Missing required path parameter: site_id`);
2937
- }
2938
- if (!pathParams.id) {
2939
- throw new Error(`Missing required path parameter: id`);
2940
- }
2941
- const data = await request({
2942
- method: "DELETE",
2943
- url: `/sites/${pathParams.site_id}/agent_runner_hooks/${pathParams.id}`,
2944
- ...requestConfig,
2945
- headers: {
2946
- ...requestConfig.headers
2947
- }
2948
- });
2949
- return data;
2950
- }
2951
- /**
2952
- * @link /ai-gateway/providers
2953
- */ async function getAIGatewayProviders({ config } = {}) {
2954
- const { client: request = client, ...requestConfig } = config ?? {};
2955
- const data = await request({
2956
- method: "GET",
2957
- url: `/ai-gateway/providers`,
2958
- ...requestConfig,
2959
- headers: {
2960
- ...requestConfig.headers
2961
- }
2962
- });
2963
- return data;
2964
- }
2965
- /**
2966
- * @description Returns an AI Gateway token for a specific site
2967
- * @link /sites/{site_id}/ai-gateway/token
2968
- */ async function getAIGatewayToken({ pathParams, config } = {}) {
2969
- const { client: request = client, ...requestConfig } = config ?? {};
2970
- if (!pathParams.site_id) {
2971
- throw new Error(`Missing required path parameter: site_id`);
2972
- }
2973
- const data = await request({
2974
- method: "GET",
2975
- url: `/sites/${pathParams.site_id}/ai-gateway/token`,
2976
- ...requestConfig,
2977
- headers: {
2978
- ...requestConfig.headers
2979
- }
2980
- });
2981
- return data;
2982
- }
2983
- /**
2984
- * @description Returns an AI Gateway token scoped to an account
2985
- * @link /accounts/{account_id}/ai-gateway/token
2986
- */ async function getAccountAIGatewayToken({ pathParams, config } = {}) {
2987
- const { client: request = client, ...requestConfig } = config ?? {};
2988
- if (!pathParams.account_id) {
2989
- throw new Error(`Missing required path parameter: account_id`);
2990
- }
2991
- const data = await request({
2992
- method: "GET",
2993
- url: `/accounts/${pathParams.account_id}/ai-gateway/token`,
2994
- ...requestConfig,
2995
- headers: {
2996
- ...requestConfig.headers
2997
- }
2998
- });
2999
- return data;
3000
- }
3001
- /**
3002
- * @description Creates a new database for the specified site. If a database already exists, returns the existing connection string. The database region defaults to the site's functions region if not specified.
3003
- * @link /sites/{site_id}/database
3004
- */ async function createSiteDatabase({ pathParams, body, config } = {}) {
3005
- const { client: request = client, ...requestConfig } = config ?? {};
3006
- if (!pathParams.site_id) {
3007
- throw new Error(`Missing required path parameter: site_id`);
3008
- }
3009
- const data = await request({
3010
- method: "POST",
3011
- url: `/sites/${pathParams.site_id}/database`,
3012
- body: body,
3013
- ...requestConfig,
3014
- headers: {
3015
- ...requestConfig.headers
3016
- }
3017
- });
3018
- return data;
3019
- }
3020
- /**
3021
- * @description Returns the database connection string for the specified site.
3022
- * @link /sites/{site_id}/database
3023
- */ async function getSiteDatabase({ pathParams, queryParams, config } = {}) {
3024
- const { client: request = client, ...requestConfig } = config ?? {};
3025
- if (!pathParams.site_id) {
3026
- throw new Error(`Missing required path parameter: site_id`);
3027
- }
3028
- const data = await request({
3029
- method: "GET",
3030
- url: `/sites/${pathParams.site_id}/database`,
3031
- queryParams,
3032
- ...requestConfig,
3033
- headers: {
3034
- ...requestConfig.headers
3035
- }
3036
- });
3037
- return data;
3038
- }
3039
- /**
3040
- * @description Deletes the database and all associated branches and snapshots for the specified site.
3041
- * @link /sites/{site_id}/database
3042
- */ async function deleteSiteDatabase({ pathParams, config } = {}) {
3043
- const { client: request = client, ...requestConfig } = config ?? {};
3044
- if (!pathParams.site_id) {
3045
- throw new Error(`Missing required path parameter: site_id`);
3046
- }
3047
- const data = await request({
3048
- method: "DELETE",
3049
- url: `/sites/${pathParams.site_id}/database`,
3050
- ...requestConfig,
3051
- headers: {
3052
- ...requestConfig.headers
3053
- }
3054
- });
3055
- return data;
3056
- }
3057
- /**
3058
- * @description Creates a new database branch. If a branch already exists for the specified branch ID, returns the existing connection string.
3059
- * @link /sites/{site_id}/database/branch
3060
- */ async function createSiteDatabaseBranch({ pathParams, body, config } = {}) {
3061
- const { client: request = client, ...requestConfig } = config ?? {};
3062
- if (!pathParams.site_id) {
3063
- throw new Error(`Missing required path parameter: site_id`);
3064
- }
3065
- const data = await request({
3066
- method: "POST",
3067
- url: `/sites/${pathParams.site_id}/database/branch`,
3068
- body: body,
3069
- ...requestConfig,
3070
- headers: {
3071
- ...requestConfig.headers
3072
- }
3073
- });
3074
- return data;
3075
- }
3076
- /**
3077
- * @description Returns all branches for the site's database with compute status and metadata.
3078
- * @link /sites/{site_id}/database/branches
3079
- */ async function listSiteDatabaseBranches({ pathParams, config } = {}) {
3080
- const { client: request = client, ...requestConfig } = config ?? {};
3081
- if (!pathParams.site_id) {
3082
- throw new Error(`Missing required path parameter: site_id`);
3083
- }
3084
- const data = await request({
3085
- method: "GET",
3086
- url: `/sites/${pathParams.site_id}/database/branches`,
3087
- ...requestConfig,
3088
- headers: {
3089
- ...requestConfig.headers
3090
- }
3091
- });
3092
- return data;
3093
- }
3094
- /**
3095
- * @description Returns the database branch connection string for a specific branch.
3096
- * @link /sites/{site_id}/database/branch/{branch_id}
3097
- */ async function getSiteDatabaseBranch({ pathParams, queryParams, config } = {}) {
3098
- const { client: request = client, ...requestConfig } = config ?? {};
3099
- if (!pathParams.site_id) {
3100
- throw new Error(`Missing required path parameter: site_id`);
3101
- }
3102
- if (!pathParams.branch_id) {
3103
- throw new Error(`Missing required path parameter: branch_id`);
3104
- }
3105
- const data = await request({
3106
- method: "GET",
3107
- url: `/sites/${pathParams.site_id}/database/branch/${pathParams.branch_id}`,
3108
- queryParams,
3109
- ...requestConfig,
3110
- headers: {
3111
- ...requestConfig.headers
3112
- }
3113
- });
3114
- return data;
3115
- }
3116
- /**
3117
- * @description Deletes a database branch.
3118
- * @link /sites/{site_id}/database/branch/{branch_id}
3119
- */ async function deleteSiteDatabaseBranch({ pathParams, config } = {}) {
3120
- const { client: request = client, ...requestConfig } = config ?? {};
3121
- if (!pathParams.site_id) {
3122
- throw new Error(`Missing required path parameter: site_id`);
3123
- }
3124
- if (!pathParams.branch_id) {
3125
- throw new Error(`Missing required path parameter: branch_id`);
3126
- }
3127
- const data = await request({
3128
- method: "DELETE",
3129
- url: `/sites/${pathParams.site_id}/database/branch/${pathParams.branch_id}`,
3130
- ...requestConfig,
3131
- headers: {
3132
- ...requestConfig.headers
3133
- }
3134
- });
3135
- return data;
3136
- }
3137
- /**
3138
- * @description Resets a non-production database branch by re-forking it from a source branch (defaults to the production branch). If the target branch is already in sync with the source, returns the existing connection string without performing a reset, unless `force=true` is passed. The production branch cannot be reset.
3139
- * @link /sites/{site_id}/database/branch/{branch_id}/reset
3140
- */ async function resetSiteDatabaseBranch({ pathParams, body, queryParams, config } = {}) {
3141
- const { client: request = client, ...requestConfig } = config ?? {};
3142
- if (!pathParams.site_id) {
3143
- throw new Error(`Missing required path parameter: site_id`);
3144
- }
3145
- if (!pathParams.branch_id) {
3146
- throw new Error(`Missing required path parameter: branch_id`);
3147
- }
3148
- const data = await request({
3149
- method: "POST",
3150
- url: `/sites/${pathParams.site_id}/database/branch/${pathParams.branch_id}/reset`,
3151
- queryParams,
3152
- body: body,
3153
- ...requestConfig,
3154
- headers: {
3155
- ...requestConfig.headers
3156
- }
3157
- });
3158
- return data;
3159
- }
3160
- /**
3161
- * @description Sets compute settings for a specific database branch, overriding project-level settings. Requires a Pro or higher plan.
3162
- * @link /sites/{site_id}/database/branch/{branch_id}/compute/settings
3163
- */ async function setSiteDatabaseBranchComputeSettings({ pathParams, body, config } = {}) {
3164
- const { client: request = client, ...requestConfig } = config ?? {};
3165
- if (!pathParams.site_id) {
3166
- throw new Error(`Missing required path parameter: site_id`);
3167
- }
3168
- if (!pathParams.branch_id) {
3169
- throw new Error(`Missing required path parameter: branch_id`);
3170
- }
3171
- const data = await request({
3172
- method: "PUT",
3173
- url: `/sites/${pathParams.site_id}/database/branch/${pathParams.branch_id}/compute/settings`,
3174
- body: body,
3175
- ...requestConfig,
3176
- headers: {
3177
- ...requestConfig.headers
3178
- }
3179
- });
3180
- return data;
3181
- }
3182
- /**
3183
- * @description Sets project-level compute settings for the database. Applied to new branches. Can be overridden per-branch. Requires a Pro or higher plan.
3184
- * @link /sites/{site_id}/database/compute/settings
3185
- */ async function setSiteDatabaseComputeSettings({ pathParams, body, config } = {}) {
3186
- const { client: request = client, ...requestConfig } = config ?? {};
3187
- if (!pathParams.site_id) {
3188
- throw new Error(`Missing required path parameter: site_id`);
3189
- }
3190
- const data = await request({
3191
- method: "PUT",
3192
- url: `/sites/${pathParams.site_id}/database/compute/settings`,
3193
- body: body,
3194
- ...requestConfig,
3195
- headers: {
3196
- ...requestConfig.headers
3197
- }
3198
- });
3199
- return data;
3200
- }
3201
- /**
3202
- * @description Returns the project-level compute settings for the database. Returns effective settings (custom or tier defaults). Requires a Pro or higher plan.
3203
- * @link /sites/{site_id}/database/compute/settings
3204
- */ async function getSiteDatabaseComputeSettings({ pathParams, config } = {}) {
3205
- const { client: request = client, ...requestConfig } = config ?? {};
3206
- if (!pathParams.site_id) {
3207
- throw new Error(`Missing required path parameter: site_id`);
3208
- }
3209
- const data = await request({
3210
- method: "GET",
3211
- url: `/sites/${pathParams.site_id}/database/compute/settings`,
3212
- ...requestConfig,
3213
- headers: {
3214
- ...requestConfig.headers
3215
- }
3216
- });
3217
- return data;
3218
- }
3219
- /**
3220
- * @description Resets project-level compute settings to tier defaults. Requires a Pro or higher plan.
3221
- * @link /sites/{site_id}/database/compute/settings
3222
- */ async function clearSiteDatabaseComputeSettings({ pathParams, config } = {}) {
3223
- const { client: request = client, ...requestConfig } = config ?? {};
3224
- if (!pathParams.site_id) {
3225
- throw new Error(`Missing required path parameter: site_id`);
3226
- }
3227
- const data = await request({
3228
- method: "DELETE",
3229
- url: `/sites/${pathParams.site_id}/database/compute/settings`,
3230
- ...requestConfig,
3231
- headers: {
3232
- ...requestConfig.headers
3233
- }
3234
- });
3235
- return data;
3236
- }
3237
- /**
3238
- * @description Returns the list of migrations available for the specified branch, indicating which ones have been applied to the database.
3239
- * @link /sites/{site_id}/database/migrations
3240
- */ async function listSiteDatabaseMigrations({ pathParams, queryParams, config } = {}) {
3241
- const { client: request = client, ...requestConfig } = config ?? {};
3242
- if (!pathParams.site_id) {
3243
- throw new Error(`Missing required path parameter: site_id`);
3244
- }
3245
- const data = await request({
3246
- method: "GET",
3247
- url: `/sites/${pathParams.site_id}/database/migrations`,
3248
- queryParams,
3249
- ...requestConfig,
3250
- headers: {
3251
- ...requestConfig.headers
3252
- }
3253
- });
3254
- return data;
3255
- }
3256
- /**
3257
- * @description Returns the contents of a named migration for the specified branch.
3258
- * @link /sites/{site_id}/database/migrations/{name}
3259
- */ async function getSiteDatabaseMigration({ pathParams, queryParams, config } = {}) {
3260
- const { client: request = client, ...requestConfig } = config ?? {};
3261
- if (!pathParams.site_id) {
3262
- throw new Error(`Missing required path parameter: site_id`);
3263
- }
3264
- if (!pathParams.name) {
3265
- throw new Error(`Missing required path parameter: name`);
3266
- }
3267
- const data = await request({
3268
- method: "GET",
3269
- url: `/sites/${pathParams.site_id}/database/migrations/${pathParams.name}`,
3270
- queryParams,
3271
- ...requestConfig,
3272
- headers: {
3273
- ...requestConfig.headers
3274
- }
3275
- });
3276
- return data;
3277
- }
3278
- /**
3279
- * @description Runs database migrations for the specified deploy. Finds the deploy and determines the appropriate branch.
3280
- * @link /sites/{site_id}/database/migrations/{deploy_id}
3281
- */ async function runSiteDatabaseMigrations({ pathParams, body, config } = {}) {
3282
- const { client: request = client, ...requestConfig } = config ?? {};
3283
- if (!pathParams.site_id) {
3284
- throw new Error(`Missing required path parameter: site_id`);
3285
- }
3286
- if (!pathParams.deploy_id) {
3287
- throw new Error(`Missing required path parameter: deploy_id`);
3288
- }
3289
- const data = await request({
3290
- method: "POST",
3291
- url: `/sites/${pathParams.site_id}/database/migrations/${pathParams.deploy_id}`,
3292
- body: body,
3293
- ...requestConfig,
3294
- headers: {
3295
- ...requestConfig.headers
3296
- }
3297
- });
3298
- return data;
3299
- }
3300
- /**
3301
- * @description Creates a point-in-time snapshot of a database branch. Defaults to the production branch if no branch name is specified.
3302
- * @link /sites/{site_id}/database/snapshot
3303
- */ async function createSiteDatabaseSnapshot({ pathParams, body, config } = {}) {
3304
- const { client: request = client, ...requestConfig } = config ?? {};
3305
- if (!pathParams.site_id) {
3306
- throw new Error(`Missing required path parameter: site_id`);
3307
- }
3308
- const data = await request({
3309
- method: "POST",
3310
- url: `/sites/${pathParams.site_id}/database/snapshot`,
3311
- body: body,
3312
- ...requestConfig,
3313
- headers: {
3314
- ...requestConfig.headers
3315
- }
3316
- });
3317
- return data;
3318
- }
3319
- /**
3320
- * @description Returns all snapshots for the site's database.
3321
- * @link /sites/{site_id}/database/snapshots
3322
- */ async function listSiteDatabaseSnapshots({ pathParams, config } = {}) {
3323
- const { client: request = client, ...requestConfig } = config ?? {};
3324
- if (!pathParams.site_id) {
3325
- throw new Error(`Missing required path parameter: site_id`);
3326
- }
3327
- const data = await request({
3328
- method: "GET",
3329
- url: `/sites/${pathParams.site_id}/database/snapshots`,
3330
- ...requestConfig,
3331
- headers: {
3332
- ...requestConfig.headers
3333
- }
3334
- });
3335
- return data;
3336
- }
3337
- /**
3338
- * @description Deletes a database snapshot.
3339
- * @link /sites/{site_id}/database/snapshot/{snapshot_id}
3340
- */ async function deleteSiteDatabaseSnapshot({ pathParams, config } = {}) {
3341
- const { client: request = client, ...requestConfig } = config ?? {};
3342
- if (!pathParams.site_id) {
3343
- throw new Error(`Missing required path parameter: site_id`);
3344
- }
3345
- if (!pathParams.snapshot_id) {
3346
- throw new Error(`Missing required path parameter: snapshot_id`);
3347
- }
3348
- const data = await request({
3349
- method: "DELETE",
3350
- url: `/sites/${pathParams.site_id}/database/snapshot/${pathParams.snapshot_id}`,
3351
- ...requestConfig,
3352
- headers: {
3353
- ...requestConfig.headers
3354
- }
3355
- });
3356
- return data;
3357
- }
3358
- /**
3359
- * @description Restores a snapshot to a database branch. Defaults to the production branch if no branch_name is specified.
3360
- * @link /sites/{site_id}/database/snapshot/{snapshot_id}/restore
3361
- */ async function restoreSiteDatabaseSnapshot({ pathParams, body, config } = {}) {
3362
- const { client: request = client, ...requestConfig } = config ?? {};
3363
- if (!pathParams.site_id) {
3364
- throw new Error(`Missing required path parameter: site_id`);
3365
- }
3366
- if (!pathParams.snapshot_id) {
3367
- throw new Error(`Missing required path parameter: snapshot_id`);
3368
- }
3369
- const data = await request({
3370
- method: "POST",
3371
- url: `/sites/${pathParams.site_id}/database/snapshot/${pathParams.snapshot_id}/restore`,
3372
- body: body,
3373
- ...requestConfig,
3374
- headers: {
3375
- ...requestConfig.headers
3376
- }
3377
- });
3378
- return data;
3379
- }
3380
- /**
3381
- * @description This is an internal-only endpoint.
3382
- * @link /sites/{site_id}/plugins/{_package}
3383
- */ async function updatePlugin({ pathParams, body, config } = {}) {
3384
- const { client: request = client, ...requestConfig } = config ?? {};
3385
- if (!pathParams.site_id) {
3386
- throw new Error(`Missing required path parameter: site_id`);
3387
- }
3388
- if (!pathParams._package) {
3389
- throw new Error(`Missing required path parameter: _package`);
3390
- }
3391
- const data = await request({
3392
- method: "PUT",
3393
- url: `/sites/${pathParams.site_id}/plugins/${pathParams._package}`,
3394
- body: body,
3395
- ...requestConfig,
3396
- headers: {
3397
- ...requestConfig.headers
3398
- }
3399
- });
3400
- return data;
3401
- }
3402
- const operationsByPath = {
3403
- "GET /sites": listSites,
3404
- "POST /sites": createSite,
3405
- "GET /sites/{site_id}": getSite,
3406
- "PATCH /sites/{site_id}": updateSite,
3407
- "DELETE /sites/{site_id}": deleteSite,
3408
- "POST /sites/{site_id}/ssl": provisionSiteTLSCertificate,
3409
- "GET /sites/{site_id}/ssl": showSiteTLSCertificate,
3410
- "GET /sites/{site_id}/ssl/certificates": getAllCertificates,
3411
- "GET /accounts/{account_id}/env": getEnvVars,
3412
- "POST /accounts/{account_id}/env": createEnvVars,
3413
- "GET /api/v1/sites/{site_id}/env": getSiteEnvVars,
3414
- "GET /accounts/{account_id}/env/{key}": getEnvVar,
3415
- "PUT /accounts/{account_id}/env/{key}": updateEnvVar,
3416
- "PATCH /accounts/{account_id}/env/{key}": setEnvVarValue,
3417
- "DELETE /accounts/{account_id}/env/{key}": deleteEnvVar,
3418
- "DELETE /accounts/{account_id}/env/{key}/value/{id}": deleteEnvVarValue,
3419
- "GET /sites/{site_id}/functions": searchSiteFunctions,
3420
- "GET /sites/{site_id}/forms": listSiteForms,
3421
- "DELETE /sites/{site_id}/forms/{form_id}": deleteSiteForm,
3422
- "GET /sites/{site_id}/submissions": listSiteSubmissions,
3423
- "GET /sites/{site_id}/files": listSiteFiles,
3424
- "GET /sites/{site_id}/assets": listSiteAssets,
3425
- "POST /sites/{site_id}/assets": createSiteAsset,
3426
- "GET /sites/{site_id}/assets/{asset_id}": getSiteAssetInfo,
3427
- "PUT /sites/{site_id}/assets/{asset_id}": updateSiteAsset,
3428
- "DELETE /sites/{site_id}/assets/{asset_id}": deleteSiteAsset,
3429
- "GET /sites/{site_id}/assets/{asset_id}/public_signature": getSiteAssetPublicSignature,
3430
- "GET /sites/{site_id}/files/{file_path}": getSiteFileByPathName,
3431
- "POST /purge": purgeCache,
3432
- "GET /sites/{site_id}/snippets": listSiteSnippets,
3433
- "POST /sites/{site_id}/snippets": createSiteSnippet,
3434
- "GET /sites/{site_id}/snippets/{snippet_id}": getSiteSnippet,
3435
- "PUT /sites/{site_id}/snippets/{snippet_id}": updateSiteSnippet,
3436
- "DELETE /sites/{site_id}/snippets/{snippet_id}": deleteSiteSnippet,
3437
- "GET /sites/{site_id}/metadata": getSiteMetadata,
3438
- "PUT /sites/{site_id}/metadata": updateSiteMetadata,
3439
- "GET /sites/{site_id}/build_hooks": listSiteBuildHooks,
3440
- "POST /sites/{site_id}/build_hooks": createSiteBuildHook,
3441
- "GET /sites/{site_id}/build_hooks/{id}": getSiteBuildHook,
3442
- "PUT /sites/{site_id}/build_hooks/{id}": updateSiteBuildHook,
3443
- "DELETE /sites/{site_id}/build_hooks/{id}": deleteSiteBuildHook,
3444
- "GET /sites/{site_id}/deploys": listSiteDeploys,
3445
- "POST /sites/{site_id}/deploys": createSiteDeploy,
3446
- "GET /sites/{site_id}/deploys/{deploy_id}": getSiteDeploy,
3447
- "PUT /sites/{site_id}/deploys/{deploy_id}": updateSiteDeploy,
3448
- "DELETE /sites/{site_id}/deploys/{deploy_id}": deleteSiteDeploy,
3449
- "POST /deploys/{deploy_id}/cancel": cancelSiteDeploy,
3450
- "POST /sites/{site_id}/deploys/{deploy_id}/restore": restoreSiteDeploy,
3451
- "GET /sites/{site_id}/builds": listSiteBuilds,
3452
- "POST /sites/{site_id}/builds": createSiteBuild,
3453
- "GET /sites/{site_id}/deployed-branches": listSiteDeployedBranches,
3454
- "PUT /sites/{site_id}/unlink_repo": unlinkSiteRepo,
3455
- "PUT /sites/{site_id}/enable": enableSite,
3456
- "PUT /sites/{site_id}/disable": disableSite,
3457
- "GET /builds/{build_id}": getSiteBuild,
3458
- "POST /builds/{build_id}/log": updateSiteBuildLog,
3459
- "POST /builds/{build_id}/start": notifyBuildStart,
3460
- "GET /{account_id}/builds/status": getAccountBuildStatus,
3461
- "GET /sites/{site_id}/dns": getDNSForSite,
3462
- "PUT /sites/{site_id}/dns": configureDNSForSite,
3463
- "PUT /sites/{site_id}/rollback": rollbackSiteDeploy,
3464
- "GET /deploys/{deploy_id}": getDeploy,
3465
- "DELETE /deploys/{deploy_id}": deleteDeploy,
3466
- "PATCH /deploys/{deploy_id}/validations_report": updateDeployValidations,
3467
- "POST /deploys/{deploy_id}/lock": lockDeploy,
3468
- "POST /deploys/{deploy_id}/unlock": unlockDeploy,
3469
- "PUT /deploys/{deploy_id}/files/{path}": uploadDeployFile,
3470
- "PUT /deploys/{deploy_id}/functions/{name}": uploadDeployFunction,
3471
- "PUT /deploys/{deploy_id}/edge_functions/{code_sha}": uploadDeployEdgeFunction,
3472
- "GET /sites/{site_id}/plugin_runs/latest": getLatestPluginRuns,
3473
- "POST /deploys/{deploy_id}/plugin_runs": createPluginRun,
3474
- "GET /forms/{form_id}/submissions": listFormSubmissions,
3475
- "GET /hooks": listHooksBySiteId,
3476
- "POST /hooks": createHookBySiteId,
3477
- "GET /hooks/{hook_id}": getHook,
3478
- "PUT /hooks/{hook_id}": updateHook,
3479
- "DELETE /hooks/{hook_id}": deleteHook,
3480
- "POST /hooks/{hook_id}/enable": enableHook,
3481
- "GET /hooks/types": listHookTypes,
3482
- "POST /oauth/tickets": createTicket,
3483
- "GET /oauth/tickets/{ticket_id}": showTicket,
3484
- "POST /oauth/tickets/{ticket_id}/exchange": exchangeTicket,
3485
- "GET /deploy_keys": listDeployKeys,
3486
- "POST /deploy_keys": createDeployKey,
3487
- "GET /deploy_keys/{key_id}": getDeployKey,
3488
- "DELETE /deploy_keys/{key_id}": deleteDeployKey,
3489
- "POST /{account_slug}/sites": createSiteInTeam,
3490
- "GET /{account_slug}/sites": listSitesForAccount,
3491
- "GET /{account_slug}/members": listMembersForAccount,
3492
- "POST /{account_slug}/members": addMemberToAccount,
3493
- "GET /{account_slug}/members/{member_id}": getAccountMember,
3494
- "PUT /{account_slug}/members/{member_id}": updateAccountMember,
3495
- "DELETE /{account_slug}/members/{member_id}": removeAccountMember,
3496
- "GET /billing/payment_methods": listPaymentMethodsForUser,
3497
- "GET /accounts/types": listAccountTypesForUser,
3498
- "GET /accounts": listAccountsForUser,
3499
- "POST /accounts": createAccount,
3500
- "GET /accounts/{account_id}": getAccount,
3501
- "PUT /accounts/{account_id}": updateAccount,
3502
- "DELETE /accounts/{account_id}": cancelAccount,
3503
- "GET /accounts/{account_id}/audit": listAccountAuditEvents,
3504
- "GET /agent_runners": listAgentRunners,
3505
- "POST /agent_runners": createAgentRunner,
3506
- "POST /agent_runners/upload_url": createAgentRunnerUploadUrl,
3507
- "GET /agent_runners/{agent_runner_id}": getAgentRunner,
3508
- "PATCH /agent_runners/{agent_runner_id}": updateAgentRunner,
3509
- "DELETE /agent_runners/{agent_runner_id}": deleteAgentRunner,
3510
- "POST /agent_runners/{agent_runner_id}/archive": archiveAgentRunner,
3511
- "POST /agent_runners/{agent_runner_id}/pull_request": agentRunnerPullRequest,
3512
- "POST /agent_runners/{agent_runner_id}/commit": agentRunnerCommitToBranch,
3513
- "GET /agent_runners/{agent_runner_id}/sessions": listAgentRunnerSessions,
3514
- "POST /agent_runners/{agent_runner_id}/sessions": createAgentRunnerSession,
3515
- "GET /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": getAgentRunnerSession,
3516
- "PATCH /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": updateAgentRunnerSession,
3517
- "DELETE /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": deleteAgentRunnerSession,
3518
- "GET /submissions/{submission_id}": listFormSubmission,
3519
- "DELETE /submissions/{submission_id}": deleteSubmission,
3520
- "GET /sites/{site_id}/service-instances": listServiceInstancesForSite,
3521
- "POST /sites/{site_id}/services/{addon}/instances": createServiceInstance,
3522
- "GET /sites/{site_id}/services/{addon}/instances/{instance_id}": showServiceInstance,
3523
- "PUT /sites/{site_id}/services/{addon}/instances/{instance_id}": updateServiceInstance,
3524
- "DELETE /sites/{site_id}/services/{addon}/instances/{instance_id}": deleteServiceInstance,
3525
- "GET /services/": getServices,
3526
- "GET /services/{addonName}": showService,
3527
- "GET /services/{addonName}/manifest": showServiceManifest,
3528
- "GET /user": getCurrentUser,
3529
- "POST /sites/{site_id}/traffic_splits": createSplitTest,
3530
- "GET /sites/{site_id}/traffic_splits": getSplitTests,
3531
- "PUT /sites/{site_id}/traffic_splits/{split_test_id}": updateSplitTest,
3532
- "GET /sites/{site_id}/traffic_splits/{split_test_id}": getSplitTest,
3533
- "POST /sites/{site_id}/traffic_splits/{split_test_id}/publish": enableSplitTest,
3534
- "POST /sites/{site_id}/traffic_splits/{split_test_id}/unpublish": disableSplitTest,
3535
- "POST /dns_zones": createDnsZone,
3536
- "GET /dns_zones": getDnsZones,
3537
- "GET /dns_zones/{zone_id}": getDnsZone,
3538
- "DELETE /dns_zones/{zone_id}": deleteDnsZone,
3539
- "PUT /dns_zones/{zone_id}/transfer": transferDnsZone,
3540
- "GET /dns_zones/{zone_id}/dns_records": getDnsRecords,
3541
- "POST /dns_zones/{zone_id}/dns_records": createDnsRecord,
3542
- "GET /dns_zones/{zone_id}/dns_records/{dns_record_id}": getIndividualDnsRecord,
3543
- "DELETE /dns_zones/{zone_id}/dns_records/{dns_record_id}": deleteDnsRecord,
3544
- "GET /sites/{site_id}/dev_servers": listSiteDevServers,
3545
- "POST /sites/{site_id}/dev_servers": createSiteDevServer,
3546
- "DELETE /sites/{site_id}/dev_servers": deleteSiteDevServers,
3547
- "GET /sites/{site_id}/dev_servers/{dev_server_id}": getSiteDevServer,
3548
- "POST /sites/{site_id}/dev_servers/{dev_server_id}/activity": markDevServerActivity,
3549
- "POST /sites/{site_id}/dev_servers/{dev_server_id}/state": updateDevServerState,
3550
- "GET /sites/{site_id}/dev_server_hooks": listSiteDevServerHooks,
3551
- "POST /sites/{site_id}/dev_server_hooks": createSiteDevServerHook,
3552
- "GET /sites/{site_id}/dev_server_hooks/{id}": getSiteDevServerHook,
3553
- "PUT /sites/{site_id}/dev_server_hooks/{id}": updateSiteDevServerHook,
3554
- "DELETE /sites/{site_id}/dev_server_hooks/{id}": deleteSiteDevServerHook,
3555
- "GET /sites/{site_id}/agent_runner_hooks": listSiteAgentRunnerHooks,
3556
- "POST /sites/{site_id}/agent_runner_hooks": createSiteAgentRunnerHook,
3557
- "GET /sites/{site_id}/agent_runner_hooks/{id}": getSiteAgentRunnerHook,
3558
- "PUT /sites/{site_id}/agent_runner_hooks/{id}": updateSiteAgentRunnerHook,
3559
- "DELETE /sites/{site_id}/agent_runner_hooks/{id}": deleteSiteAgentRunnerHook,
3560
- "GET /ai-gateway/providers": getAIGatewayProviders,
3561
- "GET /sites/{site_id}/ai-gateway/token": getAIGatewayToken,
3562
- "GET /accounts/{account_id}/ai-gateway/token": getAccountAIGatewayToken,
3563
- "POST /sites/{site_id}/database": createSiteDatabase,
3564
- "GET /sites/{site_id}/database": getSiteDatabase,
3565
- "DELETE /sites/{site_id}/database": deleteSiteDatabase,
3566
- "POST /sites/{site_id}/database/branch": createSiteDatabaseBranch,
3567
- "GET /sites/{site_id}/database/branches": listSiteDatabaseBranches,
3568
- "GET /sites/{site_id}/database/branch/{branch_id}": getSiteDatabaseBranch,
3569
- "DELETE /sites/{site_id}/database/branch/{branch_id}": deleteSiteDatabaseBranch,
3570
- "POST /sites/{site_id}/database/branch/{branch_id}/reset": resetSiteDatabaseBranch,
3571
- "PUT /sites/{site_id}/database/branch/{branch_id}/compute/settings": setSiteDatabaseBranchComputeSettings,
3572
- "PUT /sites/{site_id}/database/compute/settings": setSiteDatabaseComputeSettings,
3573
- "GET /sites/{site_id}/database/compute/settings": getSiteDatabaseComputeSettings,
3574
- "DELETE /sites/{site_id}/database/compute/settings": clearSiteDatabaseComputeSettings,
3575
- "GET /sites/{site_id}/database/migrations": listSiteDatabaseMigrations,
3576
- "GET /sites/{site_id}/database/migrations/{name}": getSiteDatabaseMigration,
3577
- "POST /sites/{site_id}/database/migrations/{deploy_id}": runSiteDatabaseMigrations,
3578
- "POST /sites/{site_id}/database/snapshot": createSiteDatabaseSnapshot,
3579
- "GET /sites/{site_id}/database/snapshots": listSiteDatabaseSnapshots,
3580
- "DELETE /sites/{site_id}/database/snapshot/{snapshot_id}": deleteSiteDatabaseSnapshot,
3581
- "POST /sites/{site_id}/database/snapshot/{snapshot_id}/restore": restoreSiteDatabaseSnapshot,
3582
- "PUT /sites/{site_id}/plugins/{_package}": updatePlugin
3583
- };
3584
- const operationsByTag = {
3585
- "site": {
3586
- listSites,
3587
- createSite,
3588
- getSite,
3589
- updateSite,
3590
- deleteSite,
3591
- unlinkSiteRepo,
3592
- enableSite,
3593
- disableSite,
3594
- createSiteInTeam,
3595
- listSitesForAccount
3596
- },
3597
- "snicertificate": {
3598
- provisionSiteTLSCertificate,
3599
- showSiteTLSCertificate,
3600
- getAllCertificates
3601
- },
3602
- "environmentvariables": {
3603
- getEnvVars,
3604
- createEnvVars,
3605
- getSiteEnvVars,
3606
- getEnvVar,
3607
- updateEnvVar,
3608
- setEnvVarValue,
3609
- deleteEnvVar,
3610
- deleteEnvVarValue
3611
- },
3612
- "function": {
3613
- searchSiteFunctions,
3614
- uploadDeployFunction
3615
- },
3616
- "form": {
3617
- listSiteForms,
3618
- deleteSiteForm
3619
- },
3620
- "submission": {
3621
- listSiteSubmissions,
3622
- listFormSubmissions,
3623
- listFormSubmission,
3624
- deleteSubmission
3625
- },
3626
- "file": {
3627
- listSiteFiles,
3628
- getSiteFileByPathName,
3629
- uploadDeployFile
3630
- },
3631
- "asset": {
3632
- listSiteAssets,
3633
- createSiteAsset,
3634
- getSiteAssetInfo,
3635
- updateSiteAsset,
3636
- deleteSiteAsset
3637
- },
3638
- "assetpublicsignature": {
3639
- getSiteAssetPublicSignature
3640
- },
3641
- "purge": {
3642
- purgeCache
3643
- },
3644
- "snippet": {
3645
- listSiteSnippets,
3646
- createSiteSnippet,
3647
- getSiteSnippet,
3648
- updateSiteSnippet,
3649
- deleteSiteSnippet
3650
- },
3651
- "metadata": {
3652
- getSiteMetadata,
3653
- updateSiteMetadata
3654
- },
3655
- "buildhook": {
3656
- listSiteBuildHooks,
3657
- createSiteBuildHook,
3658
- getSiteBuildHook,
3659
- updateSiteBuildHook,
3660
- deleteSiteBuildHook
3661
- },
3662
- "deploy": {
3663
- listSiteDeploys,
3664
- createSiteDeploy,
3665
- getSiteDeploy,
3666
- updateSiteDeploy,
3667
- deleteSiteDeploy,
3668
- cancelSiteDeploy,
3669
- restoreSiteDeploy,
3670
- rollbackSiteDeploy,
3671
- getDeploy,
3672
- deleteDeploy,
3673
- updateDeployValidations,
3674
- lockDeploy,
3675
- unlockDeploy
3676
- },
3677
- "build": {
3678
- listSiteBuilds,
3679
- createSiteBuild,
3680
- getSiteBuild,
3681
- notifyBuildStart,
3682
- getAccountBuildStatus
3683
- },
3684
- "deployedbranch": {
3685
- listSiteDeployedBranches
3686
- },
3687
- "buildlogmsg": {
3688
- updateSiteBuildLog
3689
- },
3690
- "dnszone": {
3691
- getDNSForSite,
3692
- configureDNSForSite,
3693
- createDnsZone,
3694
- getDnsZones,
3695
- getDnsZone,
3696
- deleteDnsZone,
3697
- transferDnsZone,
3698
- getDnsRecords,
3699
- createDnsRecord,
3700
- getIndividualDnsRecord,
3701
- deleteDnsRecord
3702
- },
3703
- "edgefunction": {
3704
- uploadDeployEdgeFunction
3705
- },
3706
- "xInternal": {
3707
- getLatestPluginRuns,
3708
- createPluginRun,
3709
- updatePlugin
3710
- },
3711
- "hook": {
3712
- listHooksBySiteId,
3713
- createHookBySiteId,
3714
- getHook,
3715
- updateHook,
3716
- deleteHook,
3717
- enableHook
3718
- },
3719
- "hooktype": {
3720
- listHookTypes
3721
- },
3722
- "ticket": {
3723
- createTicket,
3724
- showTicket
3725
- },
3726
- "accesstoken": {
3727
- exchangeTicket
3728
- },
3729
- "deploykey": {
3730
- listDeployKeys,
3731
- createDeployKey,
3732
- getDeployKey,
3733
- deleteDeployKey
3734
- },
3735
- "member": {
3736
- listMembersForAccount,
3737
- addMemberToAccount,
3738
- getAccountMember,
3739
- updateAccountMember,
3740
- removeAccountMember
3741
- },
3742
- "paymentmethod": {
3743
- listPaymentMethodsForUser
3744
- },
3745
- "accounttype": {
3746
- listAccountTypesForUser
3747
- },
3748
- "accountmembership": {
3749
- listAccountsForUser,
3750
- createAccount,
3751
- getAccount,
3752
- updateAccount,
3753
- cancelAccount
3754
- },
3755
- "auditlog": {
3756
- listAccountAuditEvents
3757
- },
3758
- "agentrunner": {
3759
- listAgentRunners,
3760
- createAgentRunner,
3761
- createAgentRunnerUploadUrl,
3762
- getAgentRunner,
3763
- updateAgentRunner,
3764
- deleteAgentRunner,
3765
- archiveAgentRunner,
3766
- agentRunnerPullRequest,
3767
- agentRunnerCommitToBranch
3768
- },
3769
- "agentrunnersession": {
3770
- listAgentRunnerSessions,
3771
- createAgentRunnerSession,
3772
- getAgentRunnerSession,
3773
- updateAgentRunnerSession,
3774
- deleteAgentRunnerSession
3775
- },
3776
- "serviceinstance": {
3777
- listServiceInstancesForSite,
3778
- createServiceInstance,
3779
- showServiceInstance,
3780
- updateServiceInstance,
3781
- deleteServiceInstance
3782
- },
3783
- "service": {
3784
- getServices,
3785
- showService,
3786
- showServiceManifest
3787
- },
3788
- "user": {
3789
- getCurrentUser
3790
- },
3791
- "splittest": {
3792
- createSplitTest,
3793
- getSplitTests,
3794
- updateSplitTest,
3795
- getSplitTest,
3796
- enableSplitTest,
3797
- disableSplitTest
3798
- },
3799
- "devserver": {
3800
- listSiteDevServers,
3801
- createSiteDevServer,
3802
- deleteSiteDevServers,
3803
- getSiteDevServer,
3804
- markDevServerActivity,
3805
- updateDevServerState
3806
- },
3807
- "devserverhook": {
3808
- listSiteDevServerHooks,
3809
- createSiteDevServerHook,
3810
- getSiteDevServerHook,
3811
- updateSiteDevServerHook,
3812
- deleteSiteDevServerHook
3813
- },
3814
- "agentrunnerhook": {
3815
- listSiteAgentRunnerHooks,
3816
- createSiteAgentRunnerHook,
3817
- getSiteAgentRunnerHook,
3818
- updateSiteAgentRunnerHook,
3819
- deleteSiteAgentRunnerHook
3820
- },
3821
- "aigateway": {
3822
- getAIGatewayProviders,
3823
- getAIGatewayToken,
3824
- getAccountAIGatewayToken
3825
- },
3826
- "database": {
3827
- createSiteDatabase,
3828
- getSiteDatabase,
3829
- deleteSiteDatabase,
3830
- createSiteDatabaseBranch,
3831
- listSiteDatabaseBranches,
3832
- getSiteDatabaseBranch,
3833
- deleteSiteDatabaseBranch,
3834
- resetSiteDatabaseBranch,
3835
- setSiteDatabaseBranchComputeSettings,
3836
- setSiteDatabaseComputeSettings,
3837
- getSiteDatabaseComputeSettings,
3838
- clearSiteDatabaseComputeSettings,
3839
- listSiteDatabaseMigrations,
3840
- getSiteDatabaseMigration,
3841
- runSiteDatabaseMigrations,
3842
- createSiteDatabaseSnapshot,
3843
- listSiteDatabaseSnapshots,
3844
- deleteSiteDatabaseSnapshot,
3845
- restoreSiteDatabaseSnapshot
3846
- }
3847
- };
3
+ import { o as operationsByTag, a as operationsByPath } from './components-o5x1vdup.js';
3848
4
 
3849
5
  const ApiService = createEffectApi(operationsByTag);
3850
6
  const effectByPath = createEffectByPath(operationsByPath);