netlify-api 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +20 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +8802 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +866 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +825 -882
- package/dist/index.mjs.map +1 -0
- package/package.json +14 -6
- package/dist/index.cjs +0 -899
- package/rollup.config.mjs +0 -26
package/dist/index.cjs
DELETED
|
@@ -1,899 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/******************************************************************************
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
21
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
22
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
23
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
27
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
28
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
29
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
30
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
34
|
-
var e = new Error(message);
|
|
35
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const baseUrl = 'https://api.netlify.com';
|
|
39
|
-
async function fetch$1({ url, method, body, headers, pathParams, queryParams, signal, token, fetchImpl, basePath }) {
|
|
40
|
-
try {
|
|
41
|
-
const requestHeaders = {
|
|
42
|
-
'Content-Type': 'application/json',
|
|
43
|
-
Authorization: `Bearer ${token}`,
|
|
44
|
-
...headers
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* As the fetch API is being used, when multipart/form-data is specified
|
|
48
|
-
* the Content-Type header must be deleted so that the browser can set
|
|
49
|
-
* the correct boundary.
|
|
50
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects#sending_files_using_a_formdata_object
|
|
51
|
-
*/
|
|
52
|
-
if (requestHeaders['Content-Type']?.toLowerCase().includes('multipart/form-data')) {
|
|
53
|
-
delete requestHeaders['Content-Type'];
|
|
54
|
-
}
|
|
55
|
-
const response = await fetchImpl(`${baseUrl}${basePath}${resolveUrl(url, queryParams, pathParams)}`, {
|
|
56
|
-
signal,
|
|
57
|
-
method: method.toUpperCase(),
|
|
58
|
-
body: body ? (body instanceof FormData ? body : JSON.stringify(body)) : undefined,
|
|
59
|
-
headers: requestHeaders
|
|
60
|
-
});
|
|
61
|
-
if (!response.ok) {
|
|
62
|
-
let error;
|
|
63
|
-
try {
|
|
64
|
-
error = await response.json();
|
|
65
|
-
}
|
|
66
|
-
catch (e) {
|
|
67
|
-
error = {
|
|
68
|
-
status: 'unknown',
|
|
69
|
-
payload: e instanceof Error ? `Unexpected error (${e.message})` : 'Unexpected error'
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
if (response.headers?.get('content-type')?.includes('json')) {
|
|
75
|
-
return await response.json();
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
// if it is not a json response, assume it is a blob and cast it to TData
|
|
79
|
-
return (await response.text());
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
let errorObject = {
|
|
84
|
-
name: 'unknown',
|
|
85
|
-
message: e instanceof Error ? `Network error (${e.message})` : 'Network error',
|
|
86
|
-
stack: e
|
|
87
|
-
};
|
|
88
|
-
throw errorObject;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const resolveUrl = (url, queryParams = {}, pathParams = {}) => {
|
|
92
|
-
let query = new URLSearchParams(queryParams).toString();
|
|
93
|
-
if (query)
|
|
94
|
-
query = `?${query}`;
|
|
95
|
-
return url.replace(/\{\w*\}/g, (key) => pathParams[key.slice(1, -1)] ?? '') + query;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* **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.
|
|
100
|
-
*/
|
|
101
|
-
const listSites = (variables, signal) => fetch$1({
|
|
102
|
-
url: '/sites',
|
|
103
|
-
method: 'get',
|
|
104
|
-
...variables,
|
|
105
|
-
signal
|
|
106
|
-
});
|
|
107
|
-
/**
|
|
108
|
-
* **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.
|
|
109
|
-
*/
|
|
110
|
-
const createSite = (variables, signal) => fetch$1({
|
|
111
|
-
url: '/sites',
|
|
112
|
-
method: 'post',
|
|
113
|
-
...variables,
|
|
114
|
-
signal
|
|
115
|
-
});
|
|
116
|
-
/**
|
|
117
|
-
* **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.
|
|
118
|
-
*/
|
|
119
|
-
const getSite = (variables, signal) => fetch$1({
|
|
120
|
-
url: '/sites/{siteId}',
|
|
121
|
-
method: 'get',
|
|
122
|
-
...variables,
|
|
123
|
-
signal
|
|
124
|
-
});
|
|
125
|
-
/**
|
|
126
|
-
* **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.
|
|
127
|
-
*/
|
|
128
|
-
const updateSite = (variables, signal) => fetch$1({
|
|
129
|
-
url: '/sites/{siteId}',
|
|
130
|
-
method: 'patch',
|
|
131
|
-
...variables,
|
|
132
|
-
signal
|
|
133
|
-
});
|
|
134
|
-
const deleteSite = (variables, signal) => fetch$1({
|
|
135
|
-
url: '/sites/{siteId}',
|
|
136
|
-
method: 'delete',
|
|
137
|
-
...variables,
|
|
138
|
-
signal
|
|
139
|
-
});
|
|
140
|
-
const provisionSiteTLSCertificate = (variables, signal) => fetch$1({ url: '/sites/{siteId}/ssl', method: 'post', ...variables, signal });
|
|
141
|
-
const showSiteTLSCertificate = (variables, signal) => fetch$1({ url: '/sites/{siteId}/ssl', method: 'get', ...variables, signal });
|
|
142
|
-
/**
|
|
143
|
-
* Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
144
|
-
*/
|
|
145
|
-
const getEnvVars = (variables, signal) => fetch$1({
|
|
146
|
-
url: '/accounts/{accountId}/env',
|
|
147
|
-
method: 'get',
|
|
148
|
-
...variables,
|
|
149
|
-
signal
|
|
150
|
-
});
|
|
151
|
-
/**
|
|
152
|
-
* Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
153
|
-
*/
|
|
154
|
-
const createEnvVars = (variables, signal) => fetch$1({ url: '/accounts/{accountId}/env', method: 'post', ...variables, signal });
|
|
155
|
-
/**
|
|
156
|
-
* Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn't require an `account_id` as input.
|
|
157
|
-
*/
|
|
158
|
-
const getSiteEnvVars = (variables, signal) => fetch$1({ url: '/api/v1/sites/{siteId}/env', method: 'get', ...variables, signal });
|
|
159
|
-
/**
|
|
160
|
-
* Returns an individual environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
161
|
-
*/
|
|
162
|
-
const getEnvVar = (variables, signal) => fetch$1({
|
|
163
|
-
url: '/accounts/{accountId}/env/{key}',
|
|
164
|
-
method: 'get',
|
|
165
|
-
...variables,
|
|
166
|
-
signal
|
|
167
|
-
});
|
|
168
|
-
/**
|
|
169
|
-
* Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
170
|
-
*/
|
|
171
|
-
const updateEnvVar = (variables, signal) => fetch$1({ url: '/accounts/{accountId}/env/{key}', method: 'put', ...variables, signal });
|
|
172
|
-
/**
|
|
173
|
-
* Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
174
|
-
*/
|
|
175
|
-
const setEnvVarValue = (variables, signal) => fetch$1({ url: '/accounts/{accountId}/env/{key}', method: 'patch', ...variables, signal });
|
|
176
|
-
/**
|
|
177
|
-
* Deletes an environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
178
|
-
*/
|
|
179
|
-
const deleteEnvVar = (variables, signal) => fetch$1({
|
|
180
|
-
url: '/accounts/{accountId}/env/{key}',
|
|
181
|
-
method: 'delete',
|
|
182
|
-
...variables,
|
|
183
|
-
signal
|
|
184
|
-
});
|
|
185
|
-
/**
|
|
186
|
-
* Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
|
187
|
-
*/
|
|
188
|
-
const deleteEnvVarValue = (variables, signal) => fetch$1({
|
|
189
|
-
url: '/accounts/{accountId}/env/{key}/value/{id}',
|
|
190
|
-
method: 'delete',
|
|
191
|
-
...variables,
|
|
192
|
-
signal
|
|
193
|
-
});
|
|
194
|
-
const searchSiteFunctions = (variables, signal) => fetch$1({ url: '/sites/{siteId}/functions', method: 'get', ...variables, signal });
|
|
195
|
-
const listSiteForms = (variables, signal) => fetch$1({
|
|
196
|
-
url: '/sites/{siteId}/forms',
|
|
197
|
-
method: 'get',
|
|
198
|
-
...variables,
|
|
199
|
-
signal
|
|
200
|
-
});
|
|
201
|
-
const deleteSiteForm = (variables, signal) => fetch$1({
|
|
202
|
-
url: '/sites/{siteId}/forms/{formId}',
|
|
203
|
-
method: 'delete',
|
|
204
|
-
...variables,
|
|
205
|
-
signal
|
|
206
|
-
});
|
|
207
|
-
const listSiteSubmissions = (variables, signal) => fetch$1({ url: '/sites/{siteId}/submissions', method: 'get', ...variables, signal });
|
|
208
|
-
const listSiteFiles = (variables, signal) => fetch$1({
|
|
209
|
-
url: '/sites/{siteId}/files',
|
|
210
|
-
method: 'get',
|
|
211
|
-
...variables,
|
|
212
|
-
signal
|
|
213
|
-
});
|
|
214
|
-
const listSiteAssets = (variables, signal) => fetch$1({
|
|
215
|
-
url: '/sites/{siteId}/assets',
|
|
216
|
-
method: 'get',
|
|
217
|
-
...variables,
|
|
218
|
-
signal
|
|
219
|
-
});
|
|
220
|
-
const createSiteAsset = (variables, signal) => fetch$1({ url: '/sites/{siteId}/assets', method: 'post', ...variables, signal });
|
|
221
|
-
const getSiteAssetInfo = (variables, signal) => fetch$1({
|
|
222
|
-
url: '/sites/{siteId}/assets/{assetId}',
|
|
223
|
-
method: 'get',
|
|
224
|
-
...variables,
|
|
225
|
-
signal
|
|
226
|
-
});
|
|
227
|
-
const updateSiteAsset = (variables, signal) => fetch$1({ url: '/sites/{siteId}/assets/{assetId}', method: 'put', ...variables, signal });
|
|
228
|
-
const deleteSiteAsset = (variables, signal) => fetch$1({
|
|
229
|
-
url: '/sites/{siteId}/assets/{assetId}',
|
|
230
|
-
method: 'delete',
|
|
231
|
-
...variables,
|
|
232
|
-
signal
|
|
233
|
-
});
|
|
234
|
-
const getSiteAssetPublicSignature = (variables, signal) => fetch$1({ url: '/sites/{siteId}/assets/{assetId}/public_signature', method: 'get', ...variables, signal });
|
|
235
|
-
const getSiteFileByPathName = (variables, signal) => fetch$1({
|
|
236
|
-
url: '/sites/{siteId}/files/{filePath}',
|
|
237
|
-
method: 'get',
|
|
238
|
-
...variables,
|
|
239
|
-
signal
|
|
240
|
-
});
|
|
241
|
-
/**
|
|
242
|
-
* Purges cached content from Netlify's CDN. Supports purging by Cache-Tag.
|
|
243
|
-
*/
|
|
244
|
-
const purgeCache = (variables, signal) => fetch$1({
|
|
245
|
-
url: '/purge',
|
|
246
|
-
method: 'post',
|
|
247
|
-
...variables,
|
|
248
|
-
signal
|
|
249
|
-
});
|
|
250
|
-
const listSiteSnippets = (variables, signal) => fetch$1({
|
|
251
|
-
url: '/sites/{siteId}/snippets',
|
|
252
|
-
method: 'get',
|
|
253
|
-
...variables,
|
|
254
|
-
signal
|
|
255
|
-
});
|
|
256
|
-
const createSiteSnippet = (variables, signal) => fetch$1({ url: '/sites/{siteId}/snippets', method: 'post', ...variables, signal });
|
|
257
|
-
const getSiteSnippet = (variables, signal) => fetch$1({
|
|
258
|
-
url: '/sites/{siteId}/snippets/{snippetId}',
|
|
259
|
-
method: 'get',
|
|
260
|
-
...variables,
|
|
261
|
-
signal
|
|
262
|
-
});
|
|
263
|
-
const updateSiteSnippet = (variables, signal) => fetch$1({ url: '/sites/{siteId}/snippets/{snippetId}', method: 'put', ...variables, signal });
|
|
264
|
-
const deleteSiteSnippet = (variables, signal) => fetch$1({
|
|
265
|
-
url: '/sites/{siteId}/snippets/{snippetId}',
|
|
266
|
-
method: 'delete',
|
|
267
|
-
...variables,
|
|
268
|
-
signal
|
|
269
|
-
});
|
|
270
|
-
const getSiteMetadata = (variables, signal) => fetch$1({
|
|
271
|
-
url: '/sites/{siteId}/metadata',
|
|
272
|
-
method: 'get',
|
|
273
|
-
...variables,
|
|
274
|
-
signal
|
|
275
|
-
});
|
|
276
|
-
const updateSiteMetadata = (variables, signal) => fetch$1({ url: '/sites/{siteId}/metadata', method: 'put', ...variables, signal });
|
|
277
|
-
const listSiteBuildHooks = (variables, signal) => fetch$1({
|
|
278
|
-
url: '/sites/{siteId}/build_hooks',
|
|
279
|
-
method: 'get',
|
|
280
|
-
...variables,
|
|
281
|
-
signal
|
|
282
|
-
});
|
|
283
|
-
const createSiteBuildHook = (variables, signal) => fetch$1({ url: '/sites/{siteId}/build_hooks', method: 'post', ...variables, signal });
|
|
284
|
-
const getSiteBuildHook = (variables, signal) => fetch$1({
|
|
285
|
-
url: '/sites/{siteId}/build_hooks/{id}',
|
|
286
|
-
method: 'get',
|
|
287
|
-
...variables,
|
|
288
|
-
signal
|
|
289
|
-
});
|
|
290
|
-
const updateSiteBuildHook = (variables, signal) => fetch$1({ url: '/sites/{siteId}/build_hooks/{id}', method: 'put', ...variables, signal });
|
|
291
|
-
const deleteSiteBuildHook = (variables, signal) => fetch$1({
|
|
292
|
-
url: '/sites/{siteId}/build_hooks/{id}',
|
|
293
|
-
method: 'delete',
|
|
294
|
-
...variables,
|
|
295
|
-
signal
|
|
296
|
-
});
|
|
297
|
-
const listSiteDeploys = (variables, signal) => fetch$1({ url: '/sites/{siteId}/deploys', method: 'get', ...variables, signal });
|
|
298
|
-
const createSiteDeploy = (variables, signal) => fetch$1({ url: '/sites/{siteId}/deploys', method: 'post', ...variables, signal });
|
|
299
|
-
const getSiteDeploy = (variables, signal) => fetch$1({
|
|
300
|
-
url: '/sites/{siteId}/deploys/{deployId}',
|
|
301
|
-
method: 'get',
|
|
302
|
-
...variables,
|
|
303
|
-
signal
|
|
304
|
-
});
|
|
305
|
-
const updateSiteDeploy = (variables, signal) => fetch$1({ url: '/sites/{siteId}/deploys/{deployId}', method: 'put', ...variables, signal });
|
|
306
|
-
const deleteSiteDeploy = (variables, signal) => fetch$1({
|
|
307
|
-
url: '/sites/{siteId}/deploys/{deployId}',
|
|
308
|
-
method: 'delete',
|
|
309
|
-
...variables,
|
|
310
|
-
signal
|
|
311
|
-
});
|
|
312
|
-
const cancelSiteDeploy = (variables, signal) => fetch$1({
|
|
313
|
-
url: '/deploys/{deployId}/cancel',
|
|
314
|
-
method: 'post',
|
|
315
|
-
...variables,
|
|
316
|
-
signal
|
|
317
|
-
});
|
|
318
|
-
const restoreSiteDeploy = (variables, signal) => fetch$1({
|
|
319
|
-
url: '/sites/{siteId}/deploys/{deployId}/restore',
|
|
320
|
-
method: 'post',
|
|
321
|
-
...variables,
|
|
322
|
-
signal
|
|
323
|
-
});
|
|
324
|
-
const listSiteBuilds = (variables, signal) => fetch$1({ url: '/sites/{siteId}/builds', method: 'get', ...variables, signal });
|
|
325
|
-
const createSiteBuild = (variables, signal) => fetch$1({
|
|
326
|
-
url: '/sites/{siteId}/builds',
|
|
327
|
-
method: 'post',
|
|
328
|
-
...variables,
|
|
329
|
-
signal
|
|
330
|
-
});
|
|
331
|
-
const listSiteDeployedBranches = (variables, signal) => fetch$1({ url: '/sites/{siteId}/deployed-branches', method: 'get', ...variables, signal });
|
|
332
|
-
/**
|
|
333
|
-
* [Beta] Unlinks the repo from the site.
|
|
334
|
-
*
|
|
335
|
-
* This action will also:
|
|
336
|
-
* - Delete associated deploy keys
|
|
337
|
-
* - Delete outgoing webhooks for the repo
|
|
338
|
-
* - Delete the site's build hooks
|
|
339
|
-
*/
|
|
340
|
-
const unlinkSiteRepo = (variables, signal) => fetch$1({
|
|
341
|
-
url: '/sites/{siteId}/unlink_repo',
|
|
342
|
-
method: 'put',
|
|
343
|
-
...variables,
|
|
344
|
-
signal
|
|
345
|
-
});
|
|
346
|
-
const getSiteBuild = (variables, signal) => fetch$1({
|
|
347
|
-
url: '/builds/{buildId}',
|
|
348
|
-
method: 'get',
|
|
349
|
-
...variables,
|
|
350
|
-
signal
|
|
351
|
-
});
|
|
352
|
-
const updateSiteBuildLog = (variables, signal) => fetch$1({
|
|
353
|
-
url: '/builds/{buildId}/log',
|
|
354
|
-
method: 'post',
|
|
355
|
-
...variables,
|
|
356
|
-
signal
|
|
357
|
-
});
|
|
358
|
-
const notifyBuildStart = (variables, signal) => fetch$1({
|
|
359
|
-
url: '/builds/{buildId}/start',
|
|
360
|
-
method: 'post',
|
|
361
|
-
...variables,
|
|
362
|
-
signal
|
|
363
|
-
});
|
|
364
|
-
const getAccountBuildStatus = (variables, signal) => fetch$1({
|
|
365
|
-
url: '/{accountId}/builds/status',
|
|
366
|
-
method: 'get',
|
|
367
|
-
...variables,
|
|
368
|
-
signal
|
|
369
|
-
});
|
|
370
|
-
const getDNSForSite = (variables, signal) => fetch$1({
|
|
371
|
-
url: '/sites/{siteId}/dns',
|
|
372
|
-
method: 'get',
|
|
373
|
-
...variables,
|
|
374
|
-
signal
|
|
375
|
-
});
|
|
376
|
-
const configureDNSForSite = (variables, signal) => fetch$1({
|
|
377
|
-
url: '/sites/{siteId}/dns',
|
|
378
|
-
method: 'put',
|
|
379
|
-
...variables,
|
|
380
|
-
signal
|
|
381
|
-
});
|
|
382
|
-
const rollbackSiteDeploy = (variables, signal) => fetch$1({
|
|
383
|
-
url: '/sites/{siteId}/rollback',
|
|
384
|
-
method: 'put',
|
|
385
|
-
...variables,
|
|
386
|
-
signal
|
|
387
|
-
});
|
|
388
|
-
const getDeploy = (variables, signal) => fetch$1({
|
|
389
|
-
url: '/deploys/{deployId}',
|
|
390
|
-
method: 'get',
|
|
391
|
-
...variables,
|
|
392
|
-
signal
|
|
393
|
-
});
|
|
394
|
-
const deleteDeploy = (variables, signal) => fetch$1({
|
|
395
|
-
url: '/deploys/{deployId}',
|
|
396
|
-
method: 'delete',
|
|
397
|
-
...variables,
|
|
398
|
-
signal
|
|
399
|
-
});
|
|
400
|
-
const lockDeploy = (variables, signal) => fetch$1({
|
|
401
|
-
url: '/deploys/{deployId}/lock',
|
|
402
|
-
method: 'post',
|
|
403
|
-
...variables,
|
|
404
|
-
signal
|
|
405
|
-
});
|
|
406
|
-
const unlockDeploy = (variables, signal) => fetch$1({
|
|
407
|
-
url: '/deploys/{deployId}/unlock',
|
|
408
|
-
method: 'post',
|
|
409
|
-
...variables,
|
|
410
|
-
signal
|
|
411
|
-
});
|
|
412
|
-
const uploadDeployFile = (variables, signal) => fetch$1({ url: '/deploys/{deployId}/files/{path}', method: 'put', ...variables, signal });
|
|
413
|
-
const uploadDeployFunction = (variables, signal) => fetch$1({ url: '/deploys/{deployId}/functions/{name}', method: 'put', ...variables, signal });
|
|
414
|
-
/**
|
|
415
|
-
* This is an internal-only endpoint.
|
|
416
|
-
*/
|
|
417
|
-
const updatePlugin = (variables, signal) => fetch$1({
|
|
418
|
-
url: '/sites/{siteId}/plugins/{package}',
|
|
419
|
-
method: 'put',
|
|
420
|
-
...variables,
|
|
421
|
-
signal
|
|
422
|
-
});
|
|
423
|
-
/**
|
|
424
|
-
* This is an internal-only endpoint.
|
|
425
|
-
*/
|
|
426
|
-
const getLatestPluginRuns = (variables, signal) => fetch$1({ url: '/sites/{siteId}/plugin_runs/latest', method: 'get', ...variables, signal });
|
|
427
|
-
/**
|
|
428
|
-
* This is an internal-only endpoint.
|
|
429
|
-
*/
|
|
430
|
-
const createPluginRun = (variables, signal) => fetch$1({
|
|
431
|
-
url: '/deploys/{deployId}/plugin_runs',
|
|
432
|
-
method: 'post',
|
|
433
|
-
...variables,
|
|
434
|
-
signal
|
|
435
|
-
});
|
|
436
|
-
const listFormSubmissions = (variables, signal) => fetch$1({ url: '/forms/{formId}/submissions', method: 'get', ...variables, signal });
|
|
437
|
-
const listHooksBySiteId = (variables, signal) => fetch$1({
|
|
438
|
-
url: '/hooks',
|
|
439
|
-
method: 'get',
|
|
440
|
-
...variables,
|
|
441
|
-
signal
|
|
442
|
-
});
|
|
443
|
-
const createHookBySiteId = (variables, signal) => fetch$1({ url: '/hooks', method: 'post', ...variables, signal });
|
|
444
|
-
const getHook = (variables, signal) => fetch$1({
|
|
445
|
-
url: '/hooks/{hookId}',
|
|
446
|
-
method: 'get',
|
|
447
|
-
...variables,
|
|
448
|
-
signal
|
|
449
|
-
});
|
|
450
|
-
const updateHook = (variables, signal) => fetch$1({
|
|
451
|
-
url: '/hooks/{hookId}',
|
|
452
|
-
method: 'put',
|
|
453
|
-
...variables,
|
|
454
|
-
signal
|
|
455
|
-
});
|
|
456
|
-
const deleteHook = (variables, signal) => fetch$1({
|
|
457
|
-
url: '/hooks/{hookId}',
|
|
458
|
-
method: 'delete',
|
|
459
|
-
...variables,
|
|
460
|
-
signal
|
|
461
|
-
});
|
|
462
|
-
const enableHook = (variables, signal) => fetch$1({
|
|
463
|
-
url: '/hooks/{hookId}/enable',
|
|
464
|
-
method: 'post',
|
|
465
|
-
...variables,
|
|
466
|
-
signal
|
|
467
|
-
});
|
|
468
|
-
const listHookTypes = (variables, signal) => fetch$1({
|
|
469
|
-
url: '/hooks/types',
|
|
470
|
-
method: 'get',
|
|
471
|
-
...variables,
|
|
472
|
-
signal
|
|
473
|
-
});
|
|
474
|
-
const createTicket = (variables, signal) => fetch$1({
|
|
475
|
-
url: '/oauth/tickets',
|
|
476
|
-
method: 'post',
|
|
477
|
-
...variables,
|
|
478
|
-
signal
|
|
479
|
-
});
|
|
480
|
-
const showTicket = (variables, signal) => fetch$1({
|
|
481
|
-
url: '/oauth/tickets/{ticketId}',
|
|
482
|
-
method: 'get',
|
|
483
|
-
...variables,
|
|
484
|
-
signal
|
|
485
|
-
});
|
|
486
|
-
const exchangeTicket = (variables, signal) => fetch$1({
|
|
487
|
-
url: '/oauth/tickets/{ticketId}/exchange',
|
|
488
|
-
method: 'post',
|
|
489
|
-
...variables,
|
|
490
|
-
signal
|
|
491
|
-
});
|
|
492
|
-
const listDeployKeys = (variables, signal) => fetch$1({
|
|
493
|
-
url: '/deploy_keys',
|
|
494
|
-
method: 'get',
|
|
495
|
-
...variables,
|
|
496
|
-
signal
|
|
497
|
-
});
|
|
498
|
-
const createDeployKey = (variables, signal) => fetch$1({
|
|
499
|
-
url: '/deploy_keys',
|
|
500
|
-
method: 'post',
|
|
501
|
-
...variables,
|
|
502
|
-
signal
|
|
503
|
-
});
|
|
504
|
-
const getDeployKey = (variables, signal) => fetch$1({
|
|
505
|
-
url: '/deploy_keys/{keyId}',
|
|
506
|
-
method: 'get',
|
|
507
|
-
...variables,
|
|
508
|
-
signal
|
|
509
|
-
});
|
|
510
|
-
const deleteDeployKey = (variables, signal) => fetch$1({
|
|
511
|
-
url: '/deploy_keys/{keyId}',
|
|
512
|
-
method: 'delete',
|
|
513
|
-
...variables,
|
|
514
|
-
signal
|
|
515
|
-
});
|
|
516
|
-
/**
|
|
517
|
-
* **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.
|
|
518
|
-
*/
|
|
519
|
-
const createSiteInTeam = (variables, signal) => fetch$1({ url: '/{accountSlug}/sites', method: 'post', ...variables, signal });
|
|
520
|
-
/**
|
|
521
|
-
* **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.
|
|
522
|
-
*/
|
|
523
|
-
const listSitesForAccount = (variables, signal) => fetch$1({ url: '/{accountSlug}/sites', method: 'get', ...variables, signal });
|
|
524
|
-
const listMembersForAccount = (variables, signal) => fetch$1({
|
|
525
|
-
url: '/{accountSlug}/members',
|
|
526
|
-
method: 'get',
|
|
527
|
-
...variables,
|
|
528
|
-
signal
|
|
529
|
-
});
|
|
530
|
-
const addMemberToAccount = (variables, signal) => fetch$1({ url: '/{accountSlug}/members', method: 'post', ...variables, signal });
|
|
531
|
-
const getAccountMember = (variables, signal) => fetch$1({
|
|
532
|
-
url: '/{accountSlug}/members/{memberId}',
|
|
533
|
-
method: 'get',
|
|
534
|
-
...variables,
|
|
535
|
-
signal
|
|
536
|
-
});
|
|
537
|
-
const updateAccountMember = (variables, signal) => fetch$1({ url: '/{accountSlug}/members/{memberId}', method: 'put', ...variables, signal });
|
|
538
|
-
const removeAccountMember = (variables, signal) => fetch$1({
|
|
539
|
-
url: '/{accountSlug}/members/{memberId}',
|
|
540
|
-
method: 'delete',
|
|
541
|
-
...variables,
|
|
542
|
-
signal
|
|
543
|
-
});
|
|
544
|
-
const listPaymentMethodsForUser = (variables, signal) => fetch$1({
|
|
545
|
-
url: '/billing/payment_methods',
|
|
546
|
-
method: 'get',
|
|
547
|
-
...variables,
|
|
548
|
-
signal
|
|
549
|
-
});
|
|
550
|
-
const listAccountTypesForUser = (variables, signal) => fetch$1({
|
|
551
|
-
url: '/accounts/types',
|
|
552
|
-
method: 'get',
|
|
553
|
-
...variables,
|
|
554
|
-
signal
|
|
555
|
-
});
|
|
556
|
-
const listAccountsForUser = (variables, signal) => fetch$1({
|
|
557
|
-
url: '/accounts',
|
|
558
|
-
method: 'get',
|
|
559
|
-
...variables,
|
|
560
|
-
signal
|
|
561
|
-
});
|
|
562
|
-
const createAccount = (variables, signal) => fetch$1({
|
|
563
|
-
url: '/accounts',
|
|
564
|
-
method: 'post',
|
|
565
|
-
...variables,
|
|
566
|
-
signal
|
|
567
|
-
});
|
|
568
|
-
const getAccount = (variables, signal) => fetch$1({
|
|
569
|
-
url: '/accounts/{accountId}',
|
|
570
|
-
method: 'get',
|
|
571
|
-
...variables,
|
|
572
|
-
signal
|
|
573
|
-
});
|
|
574
|
-
const updateAccount = (variables, signal) => fetch$1({
|
|
575
|
-
url: '/accounts/{accountId}',
|
|
576
|
-
method: 'put',
|
|
577
|
-
...variables,
|
|
578
|
-
signal
|
|
579
|
-
});
|
|
580
|
-
const cancelAccount = (variables, signal) => fetch$1({
|
|
581
|
-
url: '/accounts/{accountId}',
|
|
582
|
-
method: 'delete',
|
|
583
|
-
...variables,
|
|
584
|
-
signal
|
|
585
|
-
});
|
|
586
|
-
const listAccountAuditEvents = (variables, signal) => fetch$1({ url: '/accounts/{accountId}/audit', method: 'get', ...variables, signal });
|
|
587
|
-
const listFormSubmission = (variables, signal) => fetch$1({ url: '/submissions/{submissionId}', method: 'get', ...variables, signal });
|
|
588
|
-
const deleteSubmission = (variables, signal) => fetch$1({
|
|
589
|
-
url: '/submissions/{submissionId}',
|
|
590
|
-
method: 'delete',
|
|
591
|
-
...variables,
|
|
592
|
-
signal
|
|
593
|
-
});
|
|
594
|
-
const listServiceInstancesForSite = (variables, signal) => fetch$1({ url: '/sites/{siteId}/service-instances', method: 'get', ...variables, signal });
|
|
595
|
-
const createServiceInstance = (variables, signal) => fetch$1({ url: '/sites/{siteId}/services/{addon}/instances', method: 'post', ...variables, signal });
|
|
596
|
-
const showServiceInstance = (variables, signal) => fetch$1({
|
|
597
|
-
url: '/sites/{siteId}/services/{addon}/instances/{instanceId}',
|
|
598
|
-
method: 'get',
|
|
599
|
-
...variables,
|
|
600
|
-
signal
|
|
601
|
-
});
|
|
602
|
-
const updateServiceInstance = (variables, signal) => fetch$1({ url: '/sites/{siteId}/services/{addon}/instances/{instanceId}', method: 'put', ...variables, signal });
|
|
603
|
-
const deleteServiceInstance = (variables, signal) => fetch$1({
|
|
604
|
-
url: '/sites/{siteId}/services/{addon}/instances/{instanceId}',
|
|
605
|
-
method: 'delete',
|
|
606
|
-
...variables,
|
|
607
|
-
signal
|
|
608
|
-
});
|
|
609
|
-
const getServices = (variables, signal) => fetch$1({
|
|
610
|
-
url: '/services/',
|
|
611
|
-
method: 'get',
|
|
612
|
-
...variables,
|
|
613
|
-
signal
|
|
614
|
-
});
|
|
615
|
-
const showService = (variables, signal) => fetch$1({
|
|
616
|
-
url: '/services/{addonName}',
|
|
617
|
-
method: 'get',
|
|
618
|
-
...variables,
|
|
619
|
-
signal
|
|
620
|
-
});
|
|
621
|
-
const showServiceManifest = (variables, signal) => fetch$1({
|
|
622
|
-
url: '/services/{addonName}/manifest',
|
|
623
|
-
method: 'get',
|
|
624
|
-
...variables,
|
|
625
|
-
signal
|
|
626
|
-
});
|
|
627
|
-
const getCurrentUser = (variables, signal) => fetch$1({
|
|
628
|
-
url: '/user',
|
|
629
|
-
method: 'get',
|
|
630
|
-
...variables,
|
|
631
|
-
signal
|
|
632
|
-
});
|
|
633
|
-
const createSplitTest = (variables, signal) => fetch$1({ url: '/sites/{siteId}/traffic_splits', method: 'post', ...variables, signal });
|
|
634
|
-
const getSplitTests = (variables, signal) => fetch$1({
|
|
635
|
-
url: '/sites/{siteId}/traffic_splits',
|
|
636
|
-
method: 'get',
|
|
637
|
-
...variables,
|
|
638
|
-
signal
|
|
639
|
-
});
|
|
640
|
-
const updateSplitTest = (variables, signal) => fetch$1({ url: '/sites/{siteId}/traffic_splits/{splitTestId}', method: 'put', ...variables, signal });
|
|
641
|
-
const getSplitTest = (variables, signal) => fetch$1({
|
|
642
|
-
url: '/sites/{siteId}/traffic_splits/{splitTestId}',
|
|
643
|
-
method: 'get',
|
|
644
|
-
...variables,
|
|
645
|
-
signal
|
|
646
|
-
});
|
|
647
|
-
const enableSplitTest = (variables, signal) => fetch$1({
|
|
648
|
-
url: '/sites/{siteId}/traffic_splits/{splitTestId}/publish',
|
|
649
|
-
method: 'post',
|
|
650
|
-
...variables,
|
|
651
|
-
signal
|
|
652
|
-
});
|
|
653
|
-
const disableSplitTest = (variables, signal) => fetch$1({
|
|
654
|
-
url: '/sites/{siteId}/traffic_splits/{splitTestId}/unpublish',
|
|
655
|
-
method: 'post',
|
|
656
|
-
...variables,
|
|
657
|
-
signal
|
|
658
|
-
});
|
|
659
|
-
const createDnsZone = (variables, signal) => fetch$1({
|
|
660
|
-
url: '/dns_zones',
|
|
661
|
-
method: 'post',
|
|
662
|
-
...variables,
|
|
663
|
-
signal
|
|
664
|
-
});
|
|
665
|
-
const getDnsZones = (variables, signal) => fetch$1({
|
|
666
|
-
url: '/dns_zones',
|
|
667
|
-
method: 'get',
|
|
668
|
-
...variables,
|
|
669
|
-
signal
|
|
670
|
-
});
|
|
671
|
-
const getDnsZone = (variables, signal) => fetch$1({
|
|
672
|
-
url: '/dns_zones/{zoneId}',
|
|
673
|
-
method: 'get',
|
|
674
|
-
...variables,
|
|
675
|
-
signal
|
|
676
|
-
});
|
|
677
|
-
const deleteDnsZone = (variables, signal) => fetch$1({
|
|
678
|
-
url: '/dns_zones/{zoneId}',
|
|
679
|
-
method: 'delete',
|
|
680
|
-
...variables,
|
|
681
|
-
signal
|
|
682
|
-
});
|
|
683
|
-
const transferDnsZone = (variables, signal) => fetch$1({ url: '/dns_zones/{zoneId}/transfer', method: 'put', ...variables, signal });
|
|
684
|
-
const getDnsRecords = (variables, signal) => fetch$1({
|
|
685
|
-
url: '/dns_zones/{zoneId}/dns_records',
|
|
686
|
-
method: 'get',
|
|
687
|
-
...variables,
|
|
688
|
-
signal
|
|
689
|
-
});
|
|
690
|
-
const createDnsRecord = (variables, signal) => fetch$1({
|
|
691
|
-
url: '/dns_zones/{zoneId}/dns_records',
|
|
692
|
-
method: 'post',
|
|
693
|
-
...variables,
|
|
694
|
-
signal
|
|
695
|
-
});
|
|
696
|
-
const getIndividualDnsRecord = (variables, signal) => fetch$1({ url: '/dns_zones/{zoneId}/dns_records/{dnsRecordId}', method: 'get', ...variables, signal });
|
|
697
|
-
const deleteDnsRecord = (variables, signal) => fetch$1({
|
|
698
|
-
url: '/dns_zones/{zoneId}/dns_records/{dnsRecordId}',
|
|
699
|
-
method: 'delete',
|
|
700
|
-
...variables,
|
|
701
|
-
signal
|
|
702
|
-
});
|
|
703
|
-
const listSiteDevServers = (variables, signal) => fetch$1({ url: '/sites/{siteId}/dev_servers', method: 'get', ...variables, signal });
|
|
704
|
-
const createSiteDevServer = (variables, signal) => fetch$1({ url: '/sites/{siteId}/dev_servers', method: 'post', ...variables, signal });
|
|
705
|
-
const deleteSiteDevServers = (variables, signal) => fetch$1({ url: '/sites/{siteId}/dev_servers', method: 'delete', ...variables, signal });
|
|
706
|
-
const getSiteDevServer = (variables, signal) => fetch$1({
|
|
707
|
-
url: '/sites/{siteId}/dev_servers/{devServerId}',
|
|
708
|
-
method: 'get',
|
|
709
|
-
...variables,
|
|
710
|
-
signal
|
|
711
|
-
});
|
|
712
|
-
const listSiteDevServerHooks = (variables, signal) => fetch$1({ url: '/sites/{siteId}/dev_server_hooks', method: 'get', ...variables, signal });
|
|
713
|
-
const createSiteDevServerHook = (variables, signal) => fetch$1({ url: '/sites/{siteId}/dev_server_hooks', method: 'post', ...variables, signal });
|
|
714
|
-
const getSiteDevServerHook = (variables, signal) => fetch$1({
|
|
715
|
-
url: '/sites/{siteId}/dev_server_hooks/{id}',
|
|
716
|
-
method: 'get',
|
|
717
|
-
...variables,
|
|
718
|
-
signal
|
|
719
|
-
});
|
|
720
|
-
const updateSiteDevServerHook = (variables, signal) => fetch$1({ url: '/sites/{siteId}/dev_server_hooks/{id}', method: 'put', ...variables, signal });
|
|
721
|
-
const deleteSiteDevServerHook = (variables, signal) => fetch$1({
|
|
722
|
-
url: '/sites/{siteId}/dev_server_hooks/{id}',
|
|
723
|
-
method: 'delete',
|
|
724
|
-
...variables,
|
|
725
|
-
signal
|
|
726
|
-
});
|
|
727
|
-
const operationsByTag = {
|
|
728
|
-
site: {
|
|
729
|
-
listSites,
|
|
730
|
-
createSite,
|
|
731
|
-
getSite,
|
|
732
|
-
updateSite,
|
|
733
|
-
deleteSite,
|
|
734
|
-
unlinkSiteRepo,
|
|
735
|
-
createSiteInTeam,
|
|
736
|
-
listSitesForAccount
|
|
737
|
-
},
|
|
738
|
-
sniCertificate: { provisionSiteTLSCertificate, showSiteTLSCertificate },
|
|
739
|
-
environmentVariables: {
|
|
740
|
-
getEnvVars,
|
|
741
|
-
createEnvVars,
|
|
742
|
-
getSiteEnvVars,
|
|
743
|
-
getEnvVar,
|
|
744
|
-
updateEnvVar,
|
|
745
|
-
setEnvVarValue,
|
|
746
|
-
deleteEnvVar,
|
|
747
|
-
deleteEnvVarValue
|
|
748
|
-
},
|
|
749
|
-
function: { searchSiteFunctions, uploadDeployFunction },
|
|
750
|
-
form: { listSiteForms, deleteSiteForm },
|
|
751
|
-
submission: { listSiteSubmissions, listFormSubmissions, listFormSubmission, deleteSubmission },
|
|
752
|
-
file: { listSiteFiles, getSiteFileByPathName, uploadDeployFile },
|
|
753
|
-
asset: { listSiteAssets, createSiteAsset, getSiteAssetInfo, updateSiteAsset, deleteSiteAsset },
|
|
754
|
-
assetPublicSignature: { getSiteAssetPublicSignature },
|
|
755
|
-
purge: { purgeCache },
|
|
756
|
-
snippet: { listSiteSnippets, createSiteSnippet, getSiteSnippet, updateSiteSnippet, deleteSiteSnippet },
|
|
757
|
-
metadata: { getSiteMetadata, updateSiteMetadata },
|
|
758
|
-
buildHook: { listSiteBuildHooks, createSiteBuildHook, getSiteBuildHook, updateSiteBuildHook, deleteSiteBuildHook },
|
|
759
|
-
deploy: {
|
|
760
|
-
listSiteDeploys,
|
|
761
|
-
createSiteDeploy,
|
|
762
|
-
getSiteDeploy,
|
|
763
|
-
updateSiteDeploy,
|
|
764
|
-
deleteSiteDeploy,
|
|
765
|
-
cancelSiteDeploy,
|
|
766
|
-
restoreSiteDeploy,
|
|
767
|
-
rollbackSiteDeploy,
|
|
768
|
-
getDeploy,
|
|
769
|
-
deleteDeploy,
|
|
770
|
-
lockDeploy,
|
|
771
|
-
unlockDeploy
|
|
772
|
-
},
|
|
773
|
-
build: { listSiteBuilds, createSiteBuild, getSiteBuild, notifyBuildStart, getAccountBuildStatus },
|
|
774
|
-
deployedBranch: { listSiteDeployedBranches },
|
|
775
|
-
buildLogMsg: { updateSiteBuildLog },
|
|
776
|
-
dnsZone: {
|
|
777
|
-
getDNSForSite,
|
|
778
|
-
configureDNSForSite,
|
|
779
|
-
createDnsZone,
|
|
780
|
-
getDnsZones,
|
|
781
|
-
getDnsZone,
|
|
782
|
-
deleteDnsZone,
|
|
783
|
-
transferDnsZone,
|
|
784
|
-
getDnsRecords,
|
|
785
|
-
createDnsRecord,
|
|
786
|
-
getIndividualDnsRecord,
|
|
787
|
-
deleteDnsRecord
|
|
788
|
-
},
|
|
789
|
-
xInternal: { updatePlugin, getLatestPluginRuns, createPluginRun },
|
|
790
|
-
hook: { listHooksBySiteId, createHookBySiteId, getHook, updateHook, deleteHook, enableHook },
|
|
791
|
-
hookType: { listHookTypes },
|
|
792
|
-
ticket: { createTicket, showTicket },
|
|
793
|
-
accessToken: { exchangeTicket },
|
|
794
|
-
deployKey: { listDeployKeys, createDeployKey, getDeployKey, deleteDeployKey },
|
|
795
|
-
member: { listMembersForAccount, addMemberToAccount, getAccountMember, updateAccountMember, removeAccountMember },
|
|
796
|
-
paymentMethod: { listPaymentMethodsForUser },
|
|
797
|
-
accountType: { listAccountTypesForUser },
|
|
798
|
-
accountMembership: { listAccountsForUser, createAccount, getAccount, updateAccount, cancelAccount },
|
|
799
|
-
auditLog: { listAccountAuditEvents },
|
|
800
|
-
serviceInstance: {
|
|
801
|
-
listServiceInstancesForSite,
|
|
802
|
-
createServiceInstance,
|
|
803
|
-
showServiceInstance,
|
|
804
|
-
updateServiceInstance,
|
|
805
|
-
deleteServiceInstance
|
|
806
|
-
},
|
|
807
|
-
service: { getServices, showService, showServiceManifest },
|
|
808
|
-
user: { getCurrentUser },
|
|
809
|
-
splitTest: { createSplitTest, getSplitTests, updateSplitTest, getSplitTest, enableSplitTest, disableSplitTest },
|
|
810
|
-
devServer: { listSiteDevServers, createSiteDevServer, deleteSiteDevServers, getSiteDevServer },
|
|
811
|
-
devServerHook: {
|
|
812
|
-
listSiteDevServerHooks,
|
|
813
|
-
createSiteDevServerHook,
|
|
814
|
-
getSiteDevServerHook,
|
|
815
|
-
updateSiteDevServerHook,
|
|
816
|
-
deleteSiteDevServerHook
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
|
|
820
|
-
var _NetlifyApi_token, _NetlifyApi_fetch, _NetlifyApi_basePath;
|
|
821
|
-
class NetlifyApi {
|
|
822
|
-
constructor(options) {
|
|
823
|
-
_NetlifyApi_token.set(this, void 0);
|
|
824
|
-
_NetlifyApi_fetch.set(this, void 0);
|
|
825
|
-
_NetlifyApi_basePath.set(this, void 0);
|
|
826
|
-
__classPrivateFieldSet(this, _NetlifyApi_token, options.token, "f");
|
|
827
|
-
if (!options.token)
|
|
828
|
-
throw new Error('Token is required');
|
|
829
|
-
__classPrivateFieldSet(this, _NetlifyApi_fetch, options.fetch || fetch, "f");
|
|
830
|
-
if (!__classPrivateFieldGet(this, _NetlifyApi_fetch, "f"))
|
|
831
|
-
throw new Error('Fetch is required');
|
|
832
|
-
__classPrivateFieldSet(this, _NetlifyApi_basePath, options.basePath || '/api/v1', "f");
|
|
833
|
-
}
|
|
834
|
-
get api() {
|
|
835
|
-
const token = __classPrivateFieldGet(this, _NetlifyApi_token, "f");
|
|
836
|
-
const fetchImpl = __classPrivateFieldGet(this, _NetlifyApi_fetch, "f");
|
|
837
|
-
const basePath = __classPrivateFieldGet(this, _NetlifyApi_basePath, "f");
|
|
838
|
-
return new Proxy({}, {
|
|
839
|
-
get: (_target, namespace) => {
|
|
840
|
-
if (operationsByTag[namespace] === undefined) {
|
|
841
|
-
return undefined;
|
|
842
|
-
}
|
|
843
|
-
return new Proxy({}, {
|
|
844
|
-
get: (_target, operation) => {
|
|
845
|
-
if (operationsByTag[namespace][operation] === undefined) {
|
|
846
|
-
return undefined;
|
|
847
|
-
}
|
|
848
|
-
const method = operationsByTag[namespace][operation];
|
|
849
|
-
return async (params) => {
|
|
850
|
-
return await method({ ...params, token, fetchImpl, basePath });
|
|
851
|
-
};
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
get auth() {
|
|
858
|
-
return {
|
|
859
|
-
refreshToken: async ({ refreshToken, authToken, clientId, clientSecret }) => {
|
|
860
|
-
const result = await fetch$1({
|
|
861
|
-
method: 'POST',
|
|
862
|
-
url: '/oauth/token',
|
|
863
|
-
body: {
|
|
864
|
-
grant_type: 'refresh_token',
|
|
865
|
-
refresh_token: refreshToken,
|
|
866
|
-
client_id: clientId,
|
|
867
|
-
client_secret: clientSecret
|
|
868
|
-
},
|
|
869
|
-
token: authToken || __classPrivateFieldGet(this, _NetlifyApi_token, "f"),
|
|
870
|
-
fetchImpl: __classPrivateFieldGet(this, _NetlifyApi_fetch, "f"),
|
|
871
|
-
basePath: ''
|
|
872
|
-
});
|
|
873
|
-
return {
|
|
874
|
-
tokenType: result.token_type,
|
|
875
|
-
accessToken: result.access_token,
|
|
876
|
-
refreshToken: result.refresh_token,
|
|
877
|
-
scope: result.scope,
|
|
878
|
-
createdAt: result.created_at
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
async request(endpoint, params) {
|
|
884
|
-
const [method = '', url = ''] = endpoint.split(' ');
|
|
885
|
-
const extraParams = (params || {});
|
|
886
|
-
const result = await fetch$1({
|
|
887
|
-
...extraParams,
|
|
888
|
-
method,
|
|
889
|
-
url,
|
|
890
|
-
token: __classPrivateFieldGet(this, _NetlifyApi_token, "f"),
|
|
891
|
-
fetchImpl: __classPrivateFieldGet(this, _NetlifyApi_fetch, "f"),
|
|
892
|
-
basePath: __classPrivateFieldGet(this, _NetlifyApi_basePath, "f")
|
|
893
|
-
});
|
|
894
|
-
return result;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
_NetlifyApi_token = new WeakMap(), _NetlifyApi_fetch = new WeakMap(), _NetlifyApi_basePath = new WeakMap();
|
|
898
|
-
|
|
899
|
-
exports.NetlifyApi = NetlifyApi;
|