@webdock/sdk 1.0.592 → 1.0.593

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -27,7 +27,7 @@ const Nt = "17.3.1", jt = {
27
27
  version: Nt
28
28
  };
29
29
  var dr;
30
- function Ut() {
30
+ function Ft() {
31
31
  if (dr) return Q.exports;
32
32
  dr = 1;
33
33
  const r = Rt, e = kt, t = It, n = Dt, o = jt.version, i = [
@@ -148,7 +148,7 @@ function Ut() {
148
148
  k = e.resolve(process.cwd(), ".env.vault");
149
149
  return r.existsSync(k) ? k : null;
150
150
  }
151
- function F(y) {
151
+ function U(y) {
152
152
  return y[0] === "~" ? e.join(t.homedir(), y.slice(1)) : y;
153
153
  }
154
154
  function B(y) {
@@ -167,11 +167,11 @@ function Ut() {
167
167
  let d = [k];
168
168
  if (y && y.path)
169
169
  if (!Array.isArray(y.path))
170
- d = [F(y.path)];
170
+ d = [U(y.path)];
171
171
  else {
172
172
  d = [];
173
173
  for (const R of y.path)
174
- d.push(F(R));
174
+ d.push(U(R));
175
175
  }
176
176
  let p;
177
177
  const T = {};
@@ -187,10 +187,10 @@ function Ut() {
187
187
  const R = Object.keys(C).length, _ = [];
188
188
  for (const q of d)
189
189
  try {
190
- const U = e.relative(process.cwd(), q);
191
- _.push(U);
192
- } catch (U) {
193
- v && O(`Failed to load ${q} ${U.message}`), p = U;
190
+ const F = e.relative(process.cwd(), q);
191
+ _.push(F);
192
+ } catch (F) {
193
+ v && O(`Failed to load ${q} ${F.message}`), p = F;
194
194
  }
195
195
  g(`injecting env (${R}) from ${_.join(",")} ${f(`-- tip: ${a()}`)}`);
196
196
  }
@@ -243,13 +243,13 @@ function Ut() {
243
243
  };
244
244
  return Q.exports.configDotenv = j.configDotenv, Q.exports._configVault = j._configVault, Q.exports._parseVault = j._parseVault, Q.exports.config = j.config, Q.exports.decrypt = j.decrypt, Q.exports.parse = j.parse, Q.exports.populate = j.populate, Q.exports = j, Q.exports;
245
245
  }
246
- var Ft = Ut();
246
+ var Ut = Ft();
247
247
  function nt(r, e) {
248
248
  return function() {
249
249
  return r.apply(e, arguments);
250
250
  };
251
251
  }
252
- const { toString: Lt } = Object.prototype, { getPrototypeOf: or } = Object, { iterator: Fe, toStringTag: st } = Symbol, Le = /* @__PURE__ */ ((r) => (e) => {
252
+ const { toString: Lt } = Object.prototype, { getPrototypeOf: or } = Object, { iterator: Ue, toStringTag: st } = Symbol, Le = /* @__PURE__ */ ((r) => (e) => {
253
253
  const t = Lt.call(e);
254
254
  return r[t] || (r[t] = t.slice(8, -1).toLowerCase());
255
255
  })(/* @__PURE__ */ Object.create(null)), X = (r) => (r = r.toLowerCase(), (e) => Le(e) === r), Be = (r) => (e) => typeof e === r, { isArray: ce } = Array, ae = Be("undefined");
@@ -265,7 +265,7 @@ const Mt = Be("string"), K = Be("function"), it = Be("number"), we = (r) => r !=
265
265
  if (Le(r) !== "object")
266
266
  return !1;
267
267
  const e = or(r);
268
- return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(st in r) && !(Fe in r);
268
+ return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(st in r) && !(Ue in r);
269
269
  }, xt = (r) => {
270
270
  if (!we(r) || Pe(r))
271
271
  return !1;
@@ -375,7 +375,7 @@ const rn = (r, e, t, { allOwnKeys: n } = {}) => (Ae(
375
375
  t[e] = r[e];
376
376
  return t;
377
377
  }, cn = /* @__PURE__ */ ((r) => (e) => r && e instanceof r)(typeof Uint8Array < "u" && or(Uint8Array)), un = (r, e) => {
378
- const n = (r && r[Fe]).call(r);
378
+ const n = (r && r[Ue]).call(r);
379
379
  let s;
380
380
  for (; (s = n.next()) && !s.done; ) {
381
381
  const o = s.value;
@@ -420,7 +420,7 @@ const rn = (r, e, t, { allOwnKeys: n } = {}) => (Ae(
420
420
  }, Sn = () => {
421
421
  }, mn = (r, e) => r != null && Number.isFinite(r = +r) ? r : e;
422
422
  function bn(r) {
423
- return !!(r && K(r.append) && r[st] === "FormData" && r[Fe]);
423
+ return !!(r && K(r.append) && r[st] === "FormData" && r[Ue]);
424
424
  }
425
425
  const yn = (r) => {
426
426
  const e = new Array(10), t = (n, s) => {
@@ -449,7 +449,7 @@ const yn = (r) => {
449
449
  !1
450
450
  ), (s) => {
451
451
  n.push(s), se.postMessage(t, "*");
452
- }))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(typeof setImmediate == "function", K(se.postMessage)), On = typeof queueMicrotask < "u" ? queueMicrotask.bind(se) : typeof process < "u" && process.nextTick || lt, _n = (r) => r != null && K(r[Fe]), c = {
452
+ }))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(typeof setImmediate == "function", K(se.postMessage)), On = typeof queueMicrotask < "u" ? queueMicrotask.bind(se) : typeof process < "u" && process.nextTick || lt, _n = (r) => r != null && K(r[Ue]), c = {
453
453
  isArray: ce,
454
454
  isArrayBuffer: ot,
455
455
  isBuffer: Pe,
@@ -607,10 +607,10 @@ function Me(r, e, t) {
607
607
  if (c.endsWith(O, "{}"))
608
608
  O = n ? O : O.slice(0, -2), h = JSON.stringify(h);
609
609
  else if (c.isArray(h) && Pn(h) || (c.isFileList(h) || c.endsWith(O, "[]")) && (I = c.toArray(h)))
610
- return O = ft(O), I.forEach(function(N, F) {
610
+ return O = ft(O), I.forEach(function(N, U) {
611
611
  !(c.isUndefined(N) || N === null) && e.append(
612
612
  // eslint-disable-next-line no-nested-ternary
613
- i === !0 ? pr([O], F, o) : i === null ? O : O + "[]",
613
+ i === !0 ? pr([O], U, o) : i === null ? O : O + "[]",
614
614
  m(N)
615
615
  );
616
616
  }), !1;
@@ -766,7 +766,7 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Nn
766
766
  ...jn,
767
767
  ...Dn
768
768
  };
769
- function Un(r, e) {
769
+ function Fn(r, e) {
770
770
  return Me(r, new G.classes.URLSearchParams(), {
771
771
  visitor: function(t, n, s, o) {
772
772
  return G.isNode && c.isBuffer(t) ? (this.append(n, t.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
@@ -774,7 +774,7 @@ function Un(r, e) {
774
774
  ...e
775
775
  });
776
776
  }
777
- function Fn(r) {
777
+ function Un(r) {
778
778
  return c.matchAll(/\w+|\[(\w*)]/g, r).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
779
779
  }
780
780
  function Ln(r) {
@@ -796,7 +796,7 @@ function vt(r) {
796
796
  if (c.isFormData(r) && c.isFunction(r.entries)) {
797
797
  const t = {};
798
798
  return c.forEachEntry(r, (n, s) => {
799
- e(Fn(n), s, t, 0);
799
+ e(Un(n), s, t, 0);
800
800
  }), t;
801
801
  }
802
802
  return null;
@@ -827,7 +827,7 @@ const Re = {
827
827
  let a;
828
828
  if (o) {
829
829
  if (n.indexOf("application/x-www-form-urlencoded") > -1)
830
- return Un(e, this.formSerializer).toString();
830
+ return Fn(e, this.formSerializer).toString();
831
831
  if ((a = c.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
832
832
  const b = this.env && this.env.FormData;
833
833
  return Me(
@@ -1147,7 +1147,7 @@ function Wn(r, e) {
1147
1147
  }, n - E)));
1148
1148
  }, () => s && i(s)];
1149
1149
  }
1150
- const Ue = (r, e, t = 3) => {
1150
+ const Fe = (r, e, t = 3) => {
1151
1151
  let n = 0;
1152
1152
  const s = zn(50, 250);
1153
1153
  return Wn((o) => {
@@ -1340,21 +1340,21 @@ const yt = (r) => {
1340
1340
  !g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(I);
1341
1341
  }, g.onabort = function() {
1342
1342
  g && (n(new w("Request aborted", w.ECONNABORTED, r, g)), g = null);
1343
- }, g.onerror = function(F) {
1344
- const B = F && F.message ? F.message : "Network Error", W = new w(B, w.ERR_NETWORK, r, g);
1345
- W.event = F || null, n(W), g = null;
1343
+ }, g.onerror = function(U) {
1344
+ const B = U && U.message ? U.message : "Network Error", W = new w(B, w.ERR_NETWORK, r, g);
1345
+ W.event = U || null, n(W), g = null;
1346
1346
  }, g.ontimeout = function() {
1347
- let F = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1347
+ let U = 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 w(
1350
- F,
1349
+ s.timeoutErrorMessage && (U = s.timeoutErrorMessage), n(new w(
1350
+ U,
1351
1351
  B.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
1352
1352
  r,
1353
1353
  g
1354
1354
  )), g = null;
1355
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in g && c.forEach(i.toJSON(), function(F, B) {
1356
- g.setRequestHeader(B, F);
1357
- }), c.isUndefined(s.withCredentials) || (g.withCredentials = !!s.withCredentials), a && a !== "json" && (g.responseType = s.responseType), m && ([A, h] = Ue(m, !0), g.addEventListener("progress", A)), b && g.upload && ([E, D] = Ue(b), g.upload.addEventListener("progress", E), g.upload.addEventListener("loadend", D)), (s.cancelToken || s.signal) && (f = (N) => {
1355
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in g && c.forEach(i.toJSON(), function(U, B) {
1356
+ g.setRequestHeader(B, U);
1357
+ }), c.isUndefined(s.withCredentials) || (g.withCredentials = !!s.withCredentials), a && a !== "json" && (g.responseType = s.responseType), m && ([A, h] = Fe(m, !0), g.addEventListener("progress", A)), b && g.upload && ([E, D] = Fe(b), g.upload.addEventListener("progress", E), g.upload.addEventListener("loadend", D)), (s.cancelToken || s.signal) && (f = (N) => {
1358
1358
  g && (n(!N || N.type ? new ke(null, r, g) : N), g.abort(), g = null);
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);
@@ -1509,7 +1509,7 @@ const yt = (r) => {
1509
1509
  data: I,
1510
1510
  signal: M,
1511
1511
  cancelToken: N,
1512
- timeout: F,
1512
+ timeout: U,
1513
1513
  onDownloadProgress: B,
1514
1514
  onUploadProgress: W,
1515
1515
  responseType: H,
@@ -1518,7 +1518,7 @@ const yt = (r) => {
1518
1518
  fetchOptions: j
1519
1519
  } = yt(h), y = e || fetch;
1520
1520
  H = H ? (H + "").toLowerCase() : "text";
1521
- let k = rs([M, N && N.toAbortSignal()], F), u = null;
1521
+ let k = rs([M, N && N.toAbortSignal()], U), u = null;
1522
1522
  const l = k && k.unsubscribe && (() => {
1523
1523
  k.unsubscribe();
1524
1524
  });
@@ -1531,11 +1531,11 @@ const yt = (r) => {
1531
1531
  duplex: "half"
1532
1532
  }), _;
1533
1533
  if (c.isFormData(I) && (_ = R.headers.get("content-type")) && Z.setContentType(_), R.body) {
1534
- const [q, U] = mr(
1534
+ const [q, F] = mr(
1535
1535
  v,
1536
- Ue(br(W))
1536
+ Fe(br(W))
1537
1537
  );
1538
- I = gr(R.body, Er, q, U);
1538
+ I = gr(R.body, Er, q, F);
1539
1539
  }
1540
1540
  }
1541
1541
  c.isString(Y) || (Y = Y ? "include" : "omit");
@@ -1556,13 +1556,13 @@ const yt = (r) => {
1556
1556
  ["status", "statusText", "headers"].forEach((re) => {
1557
1557
  R[re] = p[re];
1558
1558
  });
1559
- const _ = c.toFiniteNumber(p.headers.get("content-length")), [q, U] = B && mr(
1559
+ const _ = c.toFiniteNumber(p.headers.get("content-length")), [q, F] = B && mr(
1560
1560
  _,
1561
- Ue(br(B), !0)
1561
+ Fe(br(B), !0)
1562
1562
  ) || [];
1563
1563
  p = new n(
1564
1564
  gr(p.body, Er, q, () => {
1565
- U && U(), l && l();
1565
+ F && F(), l && l();
1566
1566
  }),
1567
1567
  R
1568
1568
  );
@@ -2907,9 +2907,9 @@ function ks() {
2907
2907
  })(r.PriceDTO || (r.PriceDTO = {}));
2908
2908
  })(Xe)), Xe;
2909
2909
  }
2910
- var Ye = {}, Ur;
2910
+ var Ye = {}, Fr;
2911
2911
  function Is() {
2912
- return Ur || (Ur = 1, (function(r) {
2912
+ return Fr || (Fr = 1, (function(r) {
2913
2913
  Object.defineProperty(r, "__esModule", { value: !0 }), r.ServerDTO = void 0, (function(e) {
2914
2914
  (function(t) {
2915
2915
  t.PROVISIONING = "provisioning", t.RUNNING = "running", t.STOPPED = "stopped", t.ERROR = "error", t.REBOOTING = "rebooting", t.STARTING = "starting", t.STOPPING = "stopping", t.REINSTALLING = "reinstalling";
@@ -2921,9 +2921,9 @@ function Is() {
2921
2921
  })(r.ServerDTO || (r.ServerDTO = {}));
2922
2922
  })(Ye)), Ye;
2923
2923
  }
2924
- var Qe = {}, Fr;
2924
+ var Qe = {}, Ur;
2925
2925
  function Ds() {
2926
- return Fr || (Fr = 1, (function(r) {
2926
+ return Ur || (Ur = 1, (function(r) {
2927
2927
  Object.defineProperty(r, "__esModule", { value: !0 }), r.ServerImageDTO = void 0, (function(e) {
2928
2928
  (function(t) {
2929
2929
  t.APACHE = "Apache", t.NGINX = "Nginx";
@@ -3000,15 +3000,15 @@ function z() {
3000
3000
  function C(q) {
3001
3001
  try {
3002
3002
  _(S.next(q));
3003
- } catch (U) {
3004
- T(U);
3003
+ } catch (F) {
3004
+ T(F);
3005
3005
  }
3006
3006
  }
3007
3007
  function R(q) {
3008
3008
  try {
3009
3009
  _(S.throw(q));
3010
- } catch (U) {
3011
- T(U);
3010
+ } catch (F) {
3011
+ T(F);
3012
3012
  }
3013
3013
  }
3014
3014
  function _(q) {
@@ -3116,7 +3116,7 @@ function z() {
3116
3116
  return !((C = l.path) === null || C === void 0) && C.hasOwnProperty(T) ? v(String(l.path[T])) : p;
3117
3117
  }), d = "".concat(u.BASE).concat(S);
3118
3118
  return l.query ? "".concat(d).concat(M(l.query)) : d;
3119
- }, F = function(u) {
3119
+ }, U = function(u) {
3120
3120
  if (u.formData) {
3121
3121
  var l = new b.default(), v = function(S, d) {
3122
3122
  D(d) || O(d) ? l.append(S, d) : l.append(S, JSON.stringify(d));
@@ -3157,8 +3157,8 @@ function z() {
3157
3157
  var q = _[1];
3158
3158
  return A(q);
3159
3159
  }).reduce(function(_, q) {
3160
- var U, re = q[0], Ie = q[1];
3161
- return e(e({}, _), (U = {}, U[re] = String(Ie), U));
3160
+ var F, re = q[0], Ie = q[1];
3161
+ return e(e({}, _), (F = {}, F[re] = String(Ie), F));
3162
3162
  }, {}), h(v) && (T.Authorization = "Bearer ".concat(v)), h(S) && h(d) && (C = I("".concat(S, ":").concat(d)), T.Authorization = "Basic ".concat(C)), l.body && (l.mediaType ? T["Content-Type"] = l.mediaType : O(l.body) ? T["Content-Type"] = "application/octet-stream" : D(l.body) ? T["Content-Type"] = "text/plain" : g(l.body) || (T["Content-Type"] = "application/json")), [2, new m.Headers(T)];
3163
3163
  }
3164
3164
  });
@@ -3228,22 +3228,22 @@ function z() {
3228
3228
  }, k = function(u, l) {
3229
3229
  return new E.CancelablePromise(function(v, S, d) {
3230
3230
  return o(void 0, void 0, void 0, function() {
3231
- var p, T, C, R, _, q, U, re, Ie;
3231
+ var p, T, C, R, _, q, F, re, Ie;
3232
3232
  return i(this, function(te) {
3233
3233
  switch (te.label) {
3234
3234
  case 0:
3235
- return te.trys.push([0, 5, , 6]), p = N(u, l), T = F(l), C = H(l), [4, W(u, l)];
3235
+ return te.trys.push([0, 5, , 6]), p = N(u, l), T = U(l), C = H(l), [4, W(u, l)];
3236
3236
  case 1:
3237
3237
  return R = te.sent(), d.isCancelled ? [3, 4] : [4, (0, r.sendRequest)(l, p, C, T, R, d)];
3238
3238
  case 2:
3239
3239
  return _ = te.sent(), [4, j(_)];
3240
3240
  case 3:
3241
- q = te.sent(), U = Y(_, l.responseHeader), re = {
3241
+ q = te.sent(), F = Y(_, l.responseHeader), re = {
3242
3242
  url: p,
3243
3243
  ok: _.ok,
3244
3244
  status: _.status,
3245
3245
  statusText: _.statusText,
3246
- body: U ?? q
3246
+ body: F ?? q
3247
3247
  }, y(l, re), v(re.body), te.label = 4;
3248
3248
  case 4:
3249
3249
  return [3, 6];
@@ -3282,7 +3282,7 @@ function js() {
3282
3282
  return de.AccountInformationService = t, de;
3283
3283
  }
3284
3284
  var fe = {}, Gr;
3285
- function Us() {
3285
+ function Fs() {
3286
3286
  if (Gr) return fe;
3287
3287
  Gr = 1, Object.defineProperty(fe, "__esModule", { value: !0 }), fe.AccountScriptsFilesService = void 0;
3288
3288
  var r = V(), e = z(), t = (
@@ -3347,7 +3347,7 @@ function Us() {
3347
3347
  return fe.AccountScriptsFilesService = t, fe;
3348
3348
  }
3349
3349
  var pe = {}, Vr;
3350
- function Fs() {
3350
+ function Us() {
3351
3351
  if (Vr) return pe;
3352
3352
  Vr = 1, Object.defineProperty(pe, "__esModule", { value: !0 }), pe.EventCallbacksHooksService = void 0;
3353
3353
  var r = V(), e = z(), t = (
@@ -4054,11 +4054,11 @@ function Js() {
4054
4054
  Object.defineProperty(r, "AccountInformationService", { enumerable: !0, get: function() {
4055
4055
  return A.AccountInformationService;
4056
4056
  } });
4057
- var D = Us();
4057
+ var D = Fs();
4058
4058
  Object.defineProperty(r, "AccountScriptsFilesService", { enumerable: !0, get: function() {
4059
4059
  return D.AccountScriptsFilesService;
4060
4060
  } });
4061
- var h = Fs();
4061
+ var h = Us();
4062
4062
  Object.defineProperty(r, "EventCallbacksHooksService", { enumerable: !0, get: function() {
4063
4063
  return h.EventCallbacksHooksService;
4064
4064
  } });
@@ -4082,9 +4082,9 @@ function Js() {
4082
4082
  Object.defineProperty(r, "ServerActionsService", { enumerable: !0, get: function() {
4083
4083
  return N.ServerActionsService;
4084
4084
  } });
4085
- var F = Gs();
4085
+ var U = Gs();
4086
4086
  Object.defineProperty(r, "ServerConfigurationsService", { enumerable: !0, get: function() {
4087
- return F.ServerConfigurationsService;
4087
+ return U.ServerConfigurationsService;
4088
4088
  } });
4089
4089
  var B = Vs();
4090
4090
  Object.defineProperty(r, "ServerMetricsService", { enumerable: !0, get: function() {
@@ -4125,8 +4125,30 @@ class Qs {
4125
4125
  method: "GET"
4126
4126
  });
4127
4127
  }
4128
+ async waitForEventToEnd(e) {
4129
+ for (; ; ) {
4130
+ const t = await this.fetch(e);
4131
+ if (!t.success)
4132
+ return {
4133
+ success: !1,
4134
+ error: t.error
4135
+ };
4136
+ const n = t.response.body[0];
4137
+ if (n.status === "finished")
4138
+ return {
4139
+ success: !0,
4140
+ data: n.message
4141
+ };
4142
+ if (n.status === "error")
4143
+ return {
4144
+ success: !1,
4145
+ error: n.message
4146
+ };
4147
+ await new Promise((s) => setTimeout(s, 3e3));
4148
+ }
4149
+ }
4128
4150
  }
4129
- process.env.MODE != "PROD" && Ft.config();
4151
+ process.env.MODE != "PROD" && Ut.config();
4130
4152
  const _o = Ys;
4131
4153
  class To {
4132
4154
  constructor(e) {