netlify-api 1.4.1 → 3.0.5

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