@webdock/sdk 1.0.54 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +101 -85
- package/dist/index.mjs.map +1 -1
- package/dist/servers.d.ts +12 -0
- package/dist/servers.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -509,7 +509,7 @@ const yn = (r) => {
|
|
|
509
509
|
asap: On,
|
|
510
510
|
isIterable: _n
|
|
511
511
|
};
|
|
512
|
-
let
|
|
512
|
+
let w = class dt extends Error {
|
|
513
513
|
static from(e, t, n, s, o, i) {
|
|
514
514
|
const a = new dt(e.message, t || e.code, n, s, o);
|
|
515
515
|
return a.cause = e, a.name = e.name, i && Object.assign(a, i), a;
|
|
@@ -548,18 +548,18 @@ let P = class dt extends Error {
|
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
550
|
};
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
551
|
+
w.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
552
|
+
w.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
553
|
+
w.ECONNABORTED = "ECONNABORTED";
|
|
554
|
+
w.ETIMEDOUT = "ETIMEDOUT";
|
|
555
|
+
w.ERR_NETWORK = "ERR_NETWORK";
|
|
556
|
+
w.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
557
|
+
w.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
558
|
+
w.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
559
|
+
w.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
560
|
+
w.ERR_CANCELED = "ERR_CANCELED";
|
|
561
|
+
w.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
562
|
+
w.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
563
563
|
const Tn = null;
|
|
564
564
|
function tr(r) {
|
|
565
565
|
return c.isPlainObject(r) || c.isArray(r);
|
|
@@ -598,7 +598,7 @@ function Me(r, e, t) {
|
|
|
598
598
|
if (c.isBoolean(h))
|
|
599
599
|
return h.toString();
|
|
600
600
|
if (!b && c.isBlob(h))
|
|
601
|
-
throw new
|
|
601
|
+
throw new w("Blob is not supported. Use a Buffer instead.");
|
|
602
602
|
return c.isArrayBuffer(h) || c.isTypedArray(h) ? b && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
603
603
|
}
|
|
604
604
|
function f(h, O, g) {
|
|
@@ -849,7 +849,7 @@ const Re = {
|
|
|
849
849
|
return JSON.parse(e, this.parseReviver);
|
|
850
850
|
} catch (a) {
|
|
851
851
|
if (i)
|
|
852
|
-
throw a.name === "SyntaxError" ?
|
|
852
|
+
throw a.name === "SyntaxError" ? w.from(a, w.ERR_BAD_RESPONSE, this, null, this.response) : a;
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
855
|
return e;
|
|
@@ -1091,7 +1091,7 @@ function Ge(r, e) {
|
|
|
1091
1091
|
function St(r) {
|
|
1092
1092
|
return !!(r && r.__CANCEL__);
|
|
1093
1093
|
}
|
|
1094
|
-
let ke = class extends
|
|
1094
|
+
let ke = class extends w {
|
|
1095
1095
|
/**
|
|
1096
1096
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
1097
1097
|
*
|
|
@@ -1102,14 +1102,14 @@ let ke = class extends P {
|
|
|
1102
1102
|
* @returns {CanceledError} The created error.
|
|
1103
1103
|
*/
|
|
1104
1104
|
constructor(e, t, n) {
|
|
1105
|
-
super(e ?? "canceled",
|
|
1105
|
+
super(e ?? "canceled", w.ERR_CANCELED, t, n), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
};
|
|
1108
1108
|
function mt(r, e, t) {
|
|
1109
1109
|
const n = t.config.validateStatus;
|
|
1110
|
-
!t.status || !n || n(t.status) ? r(t) : e(new
|
|
1110
|
+
!t.status || !n || n(t.status) ? r(t) : e(new w(
|
|
1111
1111
|
"Request failed with status code " + t.status,
|
|
1112
|
-
[
|
|
1112
|
+
[w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
|
|
1113
1113
|
t.config,
|
|
1114
1114
|
t.request,
|
|
1115
1115
|
t
|
|
@@ -1339,16 +1339,16 @@ const yt = (r) => {
|
|
|
1339
1339
|
"onloadend" in g ? g.onloadend = I : g.onreadystatechange = function() {
|
|
1340
1340
|
!g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(I);
|
|
1341
1341
|
}, g.onabort = function() {
|
|
1342
|
-
g && (n(new
|
|
1342
|
+
g && (n(new w("Request aborted", w.ECONNABORTED, r, g)), g = null);
|
|
1343
1343
|
}, g.onerror = function(F) {
|
|
1344
|
-
const B = F && F.message ? F.message : "Network Error", W = new
|
|
1344
|
+
const B = F && F.message ? F.message : "Network Error", W = new w(B, w.ERR_NETWORK, r, g);
|
|
1345
1345
|
W.event = F || null, n(W), g = null;
|
|
1346
1346
|
}, g.ontimeout = function() {
|
|
1347
1347
|
let F = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1348
1348
|
const B = s.transitional || ar;
|
|
1349
|
-
s.timeoutErrorMessage && (F = s.timeoutErrorMessage), n(new
|
|
1349
|
+
s.timeoutErrorMessage && (F = s.timeoutErrorMessage), n(new w(
|
|
1350
1350
|
F,
|
|
1351
|
-
B.clarifyTimeoutError ?
|
|
1351
|
+
B.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
|
|
1352
1352
|
r,
|
|
1353
1353
|
g
|
|
1354
1354
|
)), g = null;
|
|
@@ -1359,7 +1359,7 @@ const yt = (r) => {
|
|
|
1359
1359
|
}, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f)));
|
|
1360
1360
|
const M = $n(s.url);
|
|
1361
1361
|
if (M && G.protocols.indexOf(M) === -1) {
|
|
1362
|
-
n(new
|
|
1362
|
+
n(new w("Unsupported protocol " + M + ":", w.ERR_BAD_REQUEST, r));
|
|
1363
1363
|
return;
|
|
1364
1364
|
}
|
|
1365
1365
|
g.send(o || null);
|
|
@@ -1372,11 +1372,11 @@ const yt = (r) => {
|
|
|
1372
1372
|
if (!s) {
|
|
1373
1373
|
s = !0, a();
|
|
1374
1374
|
const f = m instanceof Error ? m : this.reason;
|
|
1375
|
-
n.abort(f instanceof
|
|
1375
|
+
n.abort(f instanceof w ? f : new ke(f instanceof Error ? f.message : f));
|
|
1376
1376
|
}
|
|
1377
1377
|
};
|
|
1378
1378
|
let i = e && setTimeout(() => {
|
|
1379
|
-
i = null, o(new
|
|
1379
|
+
i = null, o(new w(`timeout of ${e}ms exceeded`, w.ETIMEDOUT));
|
|
1380
1380
|
}, e);
|
|
1381
1381
|
const a = () => {
|
|
1382
1382
|
r && (i && clearTimeout(i), i = null, r.forEach((m) => {
|
|
@@ -1481,7 +1481,7 @@ const yt = (r) => {
|
|
|
1481
1481
|
let I = O && O[h];
|
|
1482
1482
|
if (I)
|
|
1483
1483
|
return I.call(O);
|
|
1484
|
-
throw new
|
|
1484
|
+
throw new w(`Response type '${h}' is not supported`, w.ERR_NOT_SUPPORT, g);
|
|
1485
1485
|
});
|
|
1486
1486
|
});
|
|
1487
1487
|
const A = async (h) => {
|
|
@@ -1581,11 +1581,11 @@ const yt = (r) => {
|
|
|
1581
1581
|
});
|
|
1582
1582
|
} catch (S) {
|
|
1583
1583
|
throw l && l(), S && S.name === "TypeError" && /Load failed|fetch/i.test(S.message) ? Object.assign(
|
|
1584
|
-
new
|
|
1584
|
+
new w("Network Error", w.ERR_NETWORK, h, u, S && S.response),
|
|
1585
1585
|
{
|
|
1586
1586
|
cause: S.cause || S
|
|
1587
1587
|
}
|
|
1588
|
-
) :
|
|
1588
|
+
) : w.from(S, S && S.code, h, u, S && S.response);
|
|
1589
1589
|
}
|
|
1590
1590
|
};
|
|
1591
1591
|
}, as = /* @__PURE__ */ new Map(), gt = (r) => {
|
|
@@ -1627,7 +1627,7 @@ function us(r, e) {
|
|
|
1627
1627
|
n = r[i];
|
|
1628
1628
|
let a;
|
|
1629
1629
|
if (s = n, !cs(n) && (s = ur[(a = String(n)).toLowerCase()], s === void 0))
|
|
1630
|
-
throw new
|
|
1630
|
+
throw new w(`Unknown adapter '${a}'`);
|
|
1631
1631
|
if (s && (c.isFunction(s) || (s = s.get(e))))
|
|
1632
1632
|
break;
|
|
1633
1633
|
o[a || "#" + i] = s;
|
|
@@ -1639,7 +1639,7 @@ function us(r, e) {
|
|
|
1639
1639
|
let a = t ? i.length > 1 ? `since :
|
|
1640
1640
|
` + i.map(Pr).join(`
|
|
1641
1641
|
`) : " " + Pr(i[0]) : "as no adapter specified";
|
|
1642
|
-
throw new
|
|
1642
|
+
throw new w(
|
|
1643
1643
|
"There is no suitable adapter to dispatch the request " + a,
|
|
1644
1644
|
"ERR_NOT_SUPPORT"
|
|
1645
1645
|
);
|
|
@@ -1693,9 +1693,9 @@ He.transitional = function(e, t, n) {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
return (o, i, a) => {
|
|
1695
1695
|
if (e === !1)
|
|
1696
|
-
throw new
|
|
1696
|
+
throw new w(
|
|
1697
1697
|
s(i, " has been removed" + (t ? " in " + t : "")),
|
|
1698
|
-
|
|
1698
|
+
w.ERR_DEPRECATED
|
|
1699
1699
|
);
|
|
1700
1700
|
return t && !Ar[i] && (Ar[i] = !0, console.warn(
|
|
1701
1701
|
s(
|
|
@@ -1710,7 +1710,7 @@ He.spelling = function(e) {
|
|
|
1710
1710
|
};
|
|
1711
1711
|
function ls(r, e, t) {
|
|
1712
1712
|
if (typeof r != "object")
|
|
1713
|
-
throw new
|
|
1713
|
+
throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
|
|
1714
1714
|
const n = Object.keys(r);
|
|
1715
1715
|
let s = n.length;
|
|
1716
1716
|
for (; s-- > 0; ) {
|
|
@@ -1718,11 +1718,11 @@ function ls(r, e, t) {
|
|
|
1718
1718
|
if (i) {
|
|
1719
1719
|
const a = r[o], b = a === void 0 || i(a, o, r);
|
|
1720
1720
|
if (b !== !0)
|
|
1721
|
-
throw new
|
|
1721
|
+
throw new w("option " + o + " must be " + b, w.ERR_BAD_OPTION_VALUE);
|
|
1722
1722
|
continue;
|
|
1723
1723
|
}
|
|
1724
1724
|
if (t !== !0)
|
|
1725
|
-
throw new
|
|
1725
|
+
throw new w("Unknown option " + o, w.ERR_BAD_OPTION);
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
1728
|
const je = {
|
|
@@ -2026,7 +2026,7 @@ L.CancelToken = ds;
|
|
|
2026
2026
|
L.isCancel = St;
|
|
2027
2027
|
L.VERSION = Ot;
|
|
2028
2028
|
L.toFormData = Me;
|
|
2029
|
-
L.AxiosError =
|
|
2029
|
+
L.AxiosError = w;
|
|
2030
2030
|
L.Cancel = L.CanceledError;
|
|
2031
2031
|
L.all = function(e) {
|
|
2032
2032
|
return Promise.all(e);
|
|
@@ -2057,7 +2057,7 @@ const {
|
|
|
2057
2057
|
getAdapter: Eo,
|
|
2058
2058
|
mergeConfig: Oo
|
|
2059
2059
|
} = L;
|
|
2060
|
-
async function
|
|
2060
|
+
async function P(r) {
|
|
2061
2061
|
var e, t, n;
|
|
2062
2062
|
try {
|
|
2063
2063
|
let s = r.endpoint;
|
|
@@ -2098,7 +2098,7 @@ class hs {
|
|
|
2098
2098
|
this.parent = e;
|
|
2099
2099
|
}
|
|
2100
2100
|
async info() {
|
|
2101
|
-
return await
|
|
2101
|
+
return await P({
|
|
2102
2102
|
token: this.parent.string_token,
|
|
2103
2103
|
endpoint: "/account/accountInformation",
|
|
2104
2104
|
headers: [],
|
|
@@ -2113,7 +2113,7 @@ class vs {
|
|
|
2113
2113
|
async list({ page: e = 1, limit: t = 10, type: n = "" }) {
|
|
2114
2114
|
let s = "/events";
|
|
2115
2115
|
const o = [];
|
|
2116
|
-
return e && o.push(`page=${e}`), t && o.push(`per_page=${t}`), n && o.push(`eventType=${n}`), o.length > 0 && (s += `?${o.join("&")}`), await
|
|
2116
|
+
return e && o.push(`page=${e}`), t && o.push(`per_page=${t}`), n && o.push(`eventType=${n}`), o.length > 0 && (s += `?${o.join("&")}`), await P({
|
|
2117
2117
|
token: this.parent.string_token,
|
|
2118
2118
|
endpoint: s,
|
|
2119
2119
|
headers: ["x-total-count"],
|
|
@@ -2122,7 +2122,7 @@ class vs {
|
|
|
2122
2122
|
}
|
|
2123
2123
|
async waitForEventToEnd(e) {
|
|
2124
2124
|
for (; ; ) {
|
|
2125
|
-
const t = await
|
|
2125
|
+
const t = await P({
|
|
2126
2126
|
endpoint: `/events?callbackId=${e}`,
|
|
2127
2127
|
log: !1,
|
|
2128
2128
|
method: "GET"
|
|
@@ -2147,7 +2147,7 @@ class Ss {
|
|
|
2147
2147
|
async getById({
|
|
2148
2148
|
id: e
|
|
2149
2149
|
}) {
|
|
2150
|
-
return await
|
|
2150
|
+
return await P(
|
|
2151
2151
|
{
|
|
2152
2152
|
endpoint: `hooks/${e}`,
|
|
2153
2153
|
method: "GET",
|
|
@@ -2160,7 +2160,7 @@ class Ss {
|
|
|
2160
2160
|
eventType: t,
|
|
2161
2161
|
callbackId: n
|
|
2162
2162
|
}) {
|
|
2163
|
-
return await
|
|
2163
|
+
return await P(
|
|
2164
2164
|
{
|
|
2165
2165
|
endpoint: "/hooks",
|
|
2166
2166
|
method: "POST",
|
|
@@ -2174,7 +2174,7 @@ class Ss {
|
|
|
2174
2174
|
);
|
|
2175
2175
|
}
|
|
2176
2176
|
async deleteById({ id: e }) {
|
|
2177
|
-
return await
|
|
2177
|
+
return await P(
|
|
2178
2178
|
{
|
|
2179
2179
|
endpoint: `hooks/${e}`,
|
|
2180
2180
|
method: "DELETE",
|
|
@@ -2183,7 +2183,7 @@ class Ss {
|
|
|
2183
2183
|
);
|
|
2184
2184
|
}
|
|
2185
2185
|
async list() {
|
|
2186
|
-
return await
|
|
2186
|
+
return await P(
|
|
2187
2187
|
{
|
|
2188
2188
|
token: this.parent.string_token,
|
|
2189
2189
|
endpoint: "/hooks",
|
|
@@ -2197,7 +2197,7 @@ class ms {
|
|
|
2197
2197
|
this.parent = e;
|
|
2198
2198
|
}
|
|
2199
2199
|
async list() {
|
|
2200
|
-
return await
|
|
2200
|
+
return await P({
|
|
2201
2201
|
token: this.parent.string_token,
|
|
2202
2202
|
endpoint: "/images",
|
|
2203
2203
|
headers: [],
|
|
@@ -2210,7 +2210,7 @@ class bs {
|
|
|
2210
2210
|
this.parent = e;
|
|
2211
2211
|
}
|
|
2212
2212
|
async list() {
|
|
2213
|
-
return await
|
|
2213
|
+
return await P({
|
|
2214
2214
|
token: this.parent.string_token,
|
|
2215
2215
|
endpoint: "/locations",
|
|
2216
2216
|
method: "GET"
|
|
@@ -2225,7 +2225,7 @@ class ys {
|
|
|
2225
2225
|
locationId: e = "dk",
|
|
2226
2226
|
profileSlug: t = ""
|
|
2227
2227
|
}) {
|
|
2228
|
-
const n = await
|
|
2228
|
+
const n = await P({
|
|
2229
2229
|
token: this.parent.string_token,
|
|
2230
2230
|
endpoint: `/profiles?locationId=${e}&profileSlug=${t}`,
|
|
2231
2231
|
method: "GET"
|
|
@@ -2238,7 +2238,7 @@ class gs {
|
|
|
2238
2238
|
this.parent = e;
|
|
2239
2239
|
}
|
|
2240
2240
|
create({ content: e, filename: t, name: n }) {
|
|
2241
|
-
return
|
|
2241
|
+
return P(
|
|
2242
2242
|
{
|
|
2243
2243
|
token: this.parent.string_token,
|
|
2244
2244
|
endpoint: "/account/scripts",
|
|
@@ -2258,7 +2258,7 @@ class gs {
|
|
|
2258
2258
|
executeImmediately: s,
|
|
2259
2259
|
serverSlug: o
|
|
2260
2260
|
}) {
|
|
2261
|
-
return
|
|
2261
|
+
return P(
|
|
2262
2262
|
{
|
|
2263
2263
|
token: this.parent.string_token,
|
|
2264
2264
|
endpoint: `/servers/${o}/scripts`,
|
|
@@ -2274,7 +2274,7 @@ class gs {
|
|
|
2274
2274
|
);
|
|
2275
2275
|
}
|
|
2276
2276
|
delete({ id: e }) {
|
|
2277
|
-
return
|
|
2277
|
+
return P(
|
|
2278
2278
|
{
|
|
2279
2279
|
token: this.parent.string_token,
|
|
2280
2280
|
endpoint: `/account/scripts/${e}`,
|
|
@@ -2283,7 +2283,7 @@ class gs {
|
|
|
2283
2283
|
);
|
|
2284
2284
|
}
|
|
2285
2285
|
deleteScriptFromServer({ serverSlug: e, scriptId: t }) {
|
|
2286
|
-
return
|
|
2286
|
+
return P(
|
|
2287
2287
|
{
|
|
2288
2288
|
token: this.parent.string_token,
|
|
2289
2289
|
endpoint: `/servers/${e}/scripts/${t}`,
|
|
@@ -2292,7 +2292,7 @@ class gs {
|
|
|
2292
2292
|
);
|
|
2293
2293
|
}
|
|
2294
2294
|
executeOnServer({ serverSlug: e, scriptID: t }) {
|
|
2295
|
-
return
|
|
2295
|
+
return P(
|
|
2296
2296
|
{
|
|
2297
2297
|
token: this.parent.string_token,
|
|
2298
2298
|
endpoint: `/servers/${e}/scripts/${t}/execute`,
|
|
@@ -2302,7 +2302,7 @@ class gs {
|
|
|
2302
2302
|
);
|
|
2303
2303
|
}
|
|
2304
2304
|
getById({ scriptId: e }) {
|
|
2305
|
-
return
|
|
2305
|
+
return P(
|
|
2306
2306
|
{
|
|
2307
2307
|
token: this.parent.string_token,
|
|
2308
2308
|
endpoint: `/account/scripts/${e}`,
|
|
@@ -2311,14 +2311,14 @@ class gs {
|
|
|
2311
2311
|
);
|
|
2312
2312
|
}
|
|
2313
2313
|
list(e) {
|
|
2314
|
-
return
|
|
2314
|
+
return P({
|
|
2315
2315
|
token: this.parent.string_token,
|
|
2316
2316
|
endpoint: "/account/scripts",
|
|
2317
2317
|
method: "GET"
|
|
2318
2318
|
});
|
|
2319
2319
|
}
|
|
2320
2320
|
listOnServer({ serverSlug: e }) {
|
|
2321
|
-
return
|
|
2321
|
+
return P(
|
|
2322
2322
|
{
|
|
2323
2323
|
token: this.parent.string_token,
|
|
2324
2324
|
endpoint: `/servers/${e}/scripts`,
|
|
@@ -2332,7 +2332,7 @@ class gs {
|
|
|
2332
2332
|
filename: n,
|
|
2333
2333
|
content: s
|
|
2334
2334
|
}) {
|
|
2335
|
-
return
|
|
2335
|
+
return P(
|
|
2336
2336
|
{
|
|
2337
2337
|
token: this.parent.string_token,
|
|
2338
2338
|
endpoint: `/account/scripts/${e}`,
|
|
@@ -2360,7 +2360,7 @@ class Es {
|
|
|
2360
2360
|
userScriptId: a,
|
|
2361
2361
|
slug: b
|
|
2362
2362
|
}) {
|
|
2363
|
-
return
|
|
2363
|
+
return P(
|
|
2364
2364
|
{
|
|
2365
2365
|
token: this.parent.string_token,
|
|
2366
2366
|
endpoint: "/servers",
|
|
@@ -2380,7 +2380,7 @@ class Es {
|
|
|
2380
2380
|
);
|
|
2381
2381
|
}
|
|
2382
2382
|
delete({ serverSlug: e }) {
|
|
2383
|
-
return
|
|
2383
|
+
return P(
|
|
2384
2384
|
{
|
|
2385
2385
|
token: this.parent.string_token,
|
|
2386
2386
|
endpoint: `/servers/${e}`,
|
|
@@ -2389,11 +2389,27 @@ class Es {
|
|
|
2389
2389
|
}
|
|
2390
2390
|
);
|
|
2391
2391
|
}
|
|
2392
|
+
async fetchFileAsync({
|
|
2393
|
+
path: e,
|
|
2394
|
+
slug: t
|
|
2395
|
+
}) {
|
|
2396
|
+
return P(
|
|
2397
|
+
{
|
|
2398
|
+
endpoint: `servers/${t}/fetchFile`,
|
|
2399
|
+
method: "POST",
|
|
2400
|
+
token: this.parent.string_token,
|
|
2401
|
+
body: {
|
|
2402
|
+
filePath: e
|
|
2403
|
+
},
|
|
2404
|
+
headers: ["x-callback-id"]
|
|
2405
|
+
}
|
|
2406
|
+
);
|
|
2407
|
+
}
|
|
2392
2408
|
async fetchFile({
|
|
2393
2409
|
path: e,
|
|
2394
2410
|
slug: t
|
|
2395
2411
|
}) {
|
|
2396
|
-
const n = await
|
|
2412
|
+
const n = await P(
|
|
2397
2413
|
{
|
|
2398
2414
|
endpoint: `servers/${t}/fetchFile`,
|
|
2399
2415
|
method: "POST",
|
|
@@ -2433,21 +2449,21 @@ class Es {
|
|
|
2433
2449
|
}
|
|
2434
2450
|
}
|
|
2435
2451
|
getBySlug({ serverSlang: e }) {
|
|
2436
|
-
return
|
|
2452
|
+
return P({
|
|
2437
2453
|
token: this.parent.string_token,
|
|
2438
2454
|
endpoint: `/servers/${e}`,
|
|
2439
2455
|
method: "GET"
|
|
2440
2456
|
});
|
|
2441
2457
|
}
|
|
2442
2458
|
list() {
|
|
2443
|
-
return
|
|
2459
|
+
return P({
|
|
2444
2460
|
token: this.parent.string_token,
|
|
2445
2461
|
endpoint: "/servers",
|
|
2446
2462
|
method: "GET"
|
|
2447
2463
|
});
|
|
2448
2464
|
}
|
|
2449
2465
|
metrics({ now: e, serverSlug: t }) {
|
|
2450
|
-
return
|
|
2466
|
+
return P(
|
|
2451
2467
|
{
|
|
2452
2468
|
endpoint: `servers/${t}/metrics${e ? "/now" : ""}`,
|
|
2453
2469
|
method: "GET",
|
|
@@ -2458,7 +2474,7 @@ class Es {
|
|
|
2458
2474
|
reboot({
|
|
2459
2475
|
serverSlug: e
|
|
2460
2476
|
}) {
|
|
2461
|
-
return
|
|
2477
|
+
return P(
|
|
2462
2478
|
{
|
|
2463
2479
|
token: this.parent.string_token,
|
|
2464
2480
|
endpoint: `/servers/${e}/actions/reboot`,
|
|
@@ -2468,7 +2484,7 @@ class Es {
|
|
|
2468
2484
|
);
|
|
2469
2485
|
}
|
|
2470
2486
|
reinstall({ imageSlug: e, serverSlug: t, userScriptId: n, deleteSnapshots: s }) {
|
|
2471
|
-
return
|
|
2487
|
+
return P(
|
|
2472
2488
|
{
|
|
2473
2489
|
token: this.parent.string_token,
|
|
2474
2490
|
endpoint: `/servers/${t}/actions/reinstall`,
|
|
@@ -2484,7 +2500,7 @@ class Es {
|
|
|
2484
2500
|
);
|
|
2485
2501
|
}
|
|
2486
2502
|
resize({ serverSlug: e, profileSlug: t }) {
|
|
2487
|
-
return
|
|
2503
|
+
return P({
|
|
2488
2504
|
token: this.parent.string_token,
|
|
2489
2505
|
endpoint: `/servers/${e}/actions/resize`,
|
|
2490
2506
|
method: "POST",
|
|
@@ -2493,7 +2509,7 @@ class Es {
|
|
|
2493
2509
|
});
|
|
2494
2510
|
}
|
|
2495
2511
|
resizeDryRun({ serverSlug: e, profileSlug: t }) {
|
|
2496
|
-
return
|
|
2512
|
+
return P({
|
|
2497
2513
|
token: this.parent.string_token,
|
|
2498
2514
|
endpoint: `/servers/${e}/actions/resize/dryrun`,
|
|
2499
2515
|
method: "POST",
|
|
@@ -2501,7 +2517,7 @@ class Es {
|
|
|
2501
2517
|
});
|
|
2502
2518
|
}
|
|
2503
2519
|
start({ serverSlug: e }) {
|
|
2504
|
-
return
|
|
2520
|
+
return P({
|
|
2505
2521
|
token: this.parent.string_token,
|
|
2506
2522
|
endpoint: `/servers/${e}/actions/start`,
|
|
2507
2523
|
method: "POST",
|
|
@@ -2509,7 +2525,7 @@ class Es {
|
|
|
2509
2525
|
});
|
|
2510
2526
|
}
|
|
2511
2527
|
stop({ serverSlug: e }) {
|
|
2512
|
-
return
|
|
2528
|
+
return P({
|
|
2513
2529
|
token: this.parent.string_token,
|
|
2514
2530
|
endpoint: `/servers/${e}/actions/stop`,
|
|
2515
2531
|
method: "POST",
|
|
@@ -2517,7 +2533,7 @@ class Es {
|
|
|
2517
2533
|
});
|
|
2518
2534
|
}
|
|
2519
2535
|
archive({ serverSlug: e }) {
|
|
2520
|
-
return
|
|
2536
|
+
return P({
|
|
2521
2537
|
token: this.parent.string_token,
|
|
2522
2538
|
endpoint: `/servers/${e}/actions/suspend`,
|
|
2523
2539
|
method: "POST",
|
|
@@ -2525,7 +2541,7 @@ class Es {
|
|
|
2525
2541
|
});
|
|
2526
2542
|
}
|
|
2527
2543
|
update({ serverSlug: e, nextActionDate: t, name: n, description: s, notes: o }) {
|
|
2528
|
-
return
|
|
2544
|
+
return P({
|
|
2529
2545
|
token: this.parent.string_token,
|
|
2530
2546
|
endpoint: `/servers/${e}`,
|
|
2531
2547
|
method: "PATCH",
|
|
@@ -2538,7 +2554,7 @@ class Os {
|
|
|
2538
2554
|
this.parent = e;
|
|
2539
2555
|
}
|
|
2540
2556
|
create({ serverSlug: e, username: t, password: n, group: s, shell: o, publicKeys: i }) {
|
|
2541
|
-
return
|
|
2557
|
+
return P({
|
|
2542
2558
|
token: this.parent.string_token,
|
|
2543
2559
|
endpoint: `servers/${e}/shellUsers`,
|
|
2544
2560
|
method: "POST",
|
|
@@ -2553,7 +2569,7 @@ class Os {
|
|
|
2553
2569
|
});
|
|
2554
2570
|
}
|
|
2555
2571
|
delete({ serverSlug: e, userId: t }) {
|
|
2556
|
-
return
|
|
2572
|
+
return P({
|
|
2557
2573
|
token: this.parent.string_token,
|
|
2558
2574
|
endpoint: `servers/${e}/shellUsers/${t}`,
|
|
2559
2575
|
method: "DELETE",
|
|
@@ -2561,14 +2577,14 @@ class Os {
|
|
|
2561
2577
|
});
|
|
2562
2578
|
}
|
|
2563
2579
|
list({ serverSlug: e }) {
|
|
2564
|
-
return
|
|
2580
|
+
return P({
|
|
2565
2581
|
token: this.parent.string_token,
|
|
2566
2582
|
endpoint: `/servers/${e}/shellUsers`,
|
|
2567
2583
|
method: "GET"
|
|
2568
2584
|
});
|
|
2569
2585
|
}
|
|
2570
2586
|
edit({ slug: e, id: t, keys: n }) {
|
|
2571
|
-
return
|
|
2587
|
+
return P({
|
|
2572
2588
|
endpoint: `servers/${e}/shellUsers/${t}`,
|
|
2573
2589
|
method: "PATCH",
|
|
2574
2590
|
body: {
|
|
@@ -2579,7 +2595,7 @@ class Os {
|
|
|
2579
2595
|
});
|
|
2580
2596
|
}
|
|
2581
2597
|
websshToken({ serverSlug: e, username: t }) {
|
|
2582
|
-
return
|
|
2598
|
+
return P(
|
|
2583
2599
|
{
|
|
2584
2600
|
endpoint: `servers/${e}/shellUsers/WebsshToken`,
|
|
2585
2601
|
method: "POST",
|
|
@@ -2596,7 +2612,7 @@ class _s {
|
|
|
2596
2612
|
this.parent = e;
|
|
2597
2613
|
}
|
|
2598
2614
|
create({ name: e, publicKey: t }) {
|
|
2599
|
-
return
|
|
2615
|
+
return P({
|
|
2600
2616
|
token: this.parent.string_token,
|
|
2601
2617
|
endpoint: "/account/publicKeys",
|
|
2602
2618
|
method: "POST",
|
|
@@ -2607,21 +2623,21 @@ class _s {
|
|
|
2607
2623
|
});
|
|
2608
2624
|
}
|
|
2609
2625
|
delete({ id: e }) {
|
|
2610
|
-
return
|
|
2626
|
+
return P({
|
|
2611
2627
|
token: this.parent.string_token,
|
|
2612
2628
|
endpoint: `/account/publicKeys/${e}`,
|
|
2613
2629
|
method: "DELETE"
|
|
2614
2630
|
});
|
|
2615
2631
|
}
|
|
2616
2632
|
list() {
|
|
2617
|
-
return
|
|
2633
|
+
return P({
|
|
2618
2634
|
token: this.parent.string_token,
|
|
2619
2635
|
endpoint: "/account/publicKeys",
|
|
2620
2636
|
method: "GET"
|
|
2621
2637
|
});
|
|
2622
2638
|
}
|
|
2623
2639
|
toggleSSHSettings(e) {
|
|
2624
|
-
return
|
|
2640
|
+
return P({
|
|
2625
2641
|
token: e.token || this.parent.string_token,
|
|
2626
2642
|
endpoint: `/servers/${e.serverSlug}/sshSettings`,
|
|
2627
2643
|
headers: ["x-callback-id"],
|
|
@@ -2642,7 +2658,7 @@ class Ts {
|
|
|
2642
2658
|
serverSlug: e,
|
|
2643
2659
|
name: t
|
|
2644
2660
|
}) {
|
|
2645
|
-
return
|
|
2661
|
+
return P({
|
|
2646
2662
|
token: this.parent.string_token,
|
|
2647
2663
|
endpoint: `/servers/${e}/snapshots`,
|
|
2648
2664
|
method: "POST",
|
|
@@ -2655,7 +2671,7 @@ class Ts {
|
|
|
2655
2671
|
list({
|
|
2656
2672
|
serverSlug: e
|
|
2657
2673
|
}) {
|
|
2658
|
-
return
|
|
2674
|
+
return P({
|
|
2659
2675
|
token: this.parent.string_token,
|
|
2660
2676
|
endpoint: `/servers/${e}/snapshots`,
|
|
2661
2677
|
method: "GET"
|
|
@@ -2665,7 +2681,7 @@ class Ts {
|
|
|
2665
2681
|
serverSlug: e,
|
|
2666
2682
|
snapshotId: t
|
|
2667
2683
|
}) {
|
|
2668
|
-
return
|
|
2684
|
+
return P({
|
|
2669
2685
|
token: this.parent.string_token,
|
|
2670
2686
|
endpoint: `/servers/${e}/snapshots/${t}`,
|
|
2671
2687
|
method: "DELETE",
|
|
@@ -2676,7 +2692,7 @@ class Ts {
|
|
|
2676
2692
|
serverSlug: e,
|
|
2677
2693
|
snapshotId: t
|
|
2678
2694
|
}) {
|
|
2679
|
-
return
|
|
2695
|
+
return P({
|
|
2680
2696
|
token: this.parent.string_token,
|
|
2681
2697
|
endpoint: `/servers/${e}/actions/restore`,
|
|
2682
2698
|
method: "POST",
|
|
@@ -4102,7 +4118,7 @@ class Qs {
|
|
|
4102
4118
|
this.parent = e;
|
|
4103
4119
|
}
|
|
4104
4120
|
async fetch(e) {
|
|
4105
|
-
return await
|
|
4121
|
+
return await P({
|
|
4106
4122
|
token: this.parent.string_token,
|
|
4107
4123
|
endpoint: `/events?callbackId=${e}`,
|
|
4108
4124
|
log: !1,
|