@platforma-sdk/bootstrap 3.3.0 → 3.4.0

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
@@ -1,7 +1,7 @@
1
1
  var kr = Object.defineProperty;
2
2
  var Sr = (a, e, t) => e in a ? kr(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var l = (a, e, t) => Sr(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { Flags as w, Command as $, Args as K } from "@oclif/core";
4
+ import { Flags as w, Command as L, Args as K } from "@oclif/core";
5
5
  import D from "node:os";
6
6
  import f, { createWriteStream as $r } from "node:fs";
7
7
  import m, { resolve as Lr } from "node:path";
@@ -102,11 +102,11 @@ const fe = {
102
102
  "pl-log-file": w.file({
103
103
  description: "specify path for Platforma Backend log file"
104
104
  })
105
- }, be = {
105
+ }, pe = {
106
106
  "pl-workdir": w.file({
107
107
  description: "specify working directory for Platforma Backend process"
108
108
  })
109
- }, pe = {
109
+ }, be = {
110
110
  "pl-binary": w.file({
111
111
  description: "start given Platforma Backend binary instead of automatically downloaded version"
112
112
  })
@@ -324,7 +324,7 @@ async function Vr(a, e) {
324
324
  const t = await Kr(a);
325
325
  for (const { from: r, to: n } of e)
326
326
  for (const s of t)
327
- await br(s, r, n);
327
+ await pr(s, r, n);
328
328
  }
329
329
  async function Kr(a) {
330
330
  return (await _.readdir(a, {
@@ -336,13 +336,13 @@ async function Ue(a, e) {
336
336
  const t = await _.readFile(a), r = e(t.toString());
337
337
  await _.writeFile(a, r);
338
338
  }
339
- async function br(a, e, t) {
339
+ async function pr(a, e, t) {
340
340
  return await Ue(a, (r) => r.replaceAll(e, t));
341
341
  }
342
342
  async function ee(a, e) {
343
- return await br(a, e, "");
343
+ return await pr(a, e, "");
344
344
  }
345
- const re = class re extends $ {
345
+ const re = class re extends L {
346
346
  async run() {
347
347
  const { flags: e } = await this.parse(re), t = I(e["log-level"]);
348
348
  await Hr(t);
@@ -352,14 +352,14 @@ l(re, "description", "Helps to create a new block by downloading a block's templ
352
352
  ...A
353
353
  });
354
354
  let Ee = re;
355
- function pr(...a) {
355
+ function br(...a) {
356
356
  return Lr(__dirname, "..", ...a);
357
357
  }
358
358
  function Q(...a) {
359
- return pr("assets", ...a);
359
+ return br("assets", ...a);
360
360
  }
361
361
  function Se(...a) {
362
- return f.readFileSync(pr(...a));
362
+ return f.readFileSync(br(...a));
363
363
  }
364
364
  function gr(a) {
365
365
  return a || (a = ue()), `quay.io/milaboratories/platforma:${a}`;
@@ -523,10 +523,10 @@ function Le(a, e, t, r, n) {
523
523
  if (o.platform && (g.platform = o.platform), o.envs) {
524
524
  g.environment || (g.environment = []);
525
525
  for (let d = 0; d < ((g == null ? void 0 : g.environment.length) ?? 0); ) {
526
- const b = g.environment[d].split("=")[0];
527
- if (o.envs[b]) {
528
- const p = g.environment.pop();
529
- p && g.environment.length !== d && (g.environment[d] = p);
526
+ const p = g.environment[d].split("=")[0];
527
+ if (o.envs[p]) {
528
+ const b = g.environment.pop();
529
+ b && g.environment.length !== d && (g.environment[d] = b);
530
530
  } else
531
531
  d++;
532
532
  }
@@ -616,14 +616,14 @@ function X(a, e, t) {
616
616
  }
617
617
  }
618
618
  function et(a, e) {
619
- var p, y, P, L, S, v, k, le, Ge, Je, He, We, qe, ze, Ye, Ve, Ke, Qe, Xe, Ze, er, rr, tr, ar, nr, sr, ir, cr, or, lr;
619
+ var b, y, P, $, S, v, k, le, Ge, Je, He, We, qe, ze, Ye, Ve, Ke, Qe, Xe, Ze, er, rr, tr, ar, nr, sr, ir, cr, or, lr;
620
620
  const t = (e == null ? void 0 : e.localRoot) ?? u.instanceDir("default"), r = {
621
- level: ((p = e == null ? void 0 : e.log) == null ? void 0 : p.level) ?? "info",
621
+ level: ((b = e == null ? void 0 : e.log) == null ? void 0 : b.level) ?? "info",
622
622
  path: ((y = e == null ? void 0 : e.log) == null ? void 0 : y.path) ?? `${t}/logs/platforma.log`
623
623
  }, n = {
624
624
  listen: ((P = e == null ? void 0 : e.grpc) == null ? void 0 : P.listen) ?? "localhost:6345",
625
625
  tls: {
626
- enable: de((S = (L = e == null ? void 0 : e.grpc) == null ? void 0 : L.tls) == null ? void 0 : S.enable, !1),
626
+ enable: de((S = ($ = e == null ? void 0 : e.grpc) == null ? void 0 : $.tls) == null ? void 0 : S.enable, !1),
627
627
  clientAuthMode: ((k = (v = e == null ? void 0 : e.grpc) == null ? void 0 : v.tls) == null ? void 0 : k.clientAuthMode) ?? "NoAuth",
628
628
  certFile: ((Ge = (le = e == null ? void 0 : e.grpc) == null ? void 0 : le.tls) == null ? void 0 : Ge.certFile) ?? `${t}/certs/tls.cert`,
629
629
  keyFile: ((He = (Je = e == null ? void 0 : e.grpc) == null ? void 0 : Je.tls) == null ? void 0 : He.keyFile) ?? `${t}/certs/tls.key`,
@@ -666,13 +666,13 @@ function et(a, e) {
666
666
  }, h = {
667
667
  enabled: de((ir = e == null ? void 0 : e.debug) == null ? void 0 : ir.enabled, !0),
668
668
  listen: ((cr = e == null ? void 0 : e.debug) == null ? void 0 : cr.listen) ?? "127.0.0.1:9091"
669
- }, b = {
669
+ }, p = {
670
670
  value: ((or = e == null ? void 0 : e.license) == null ? void 0 : or.value) ?? "",
671
671
  file: ((lr = e == null ? void 0 : e.license) == null ? void 0 : lr.file) ?? ""
672
672
  };
673
673
  return {
674
674
  localRoot: t,
675
- license: b,
675
+ license: p,
676
676
  log: r,
677
677
  grpc: n,
678
678
  core: s,
@@ -774,7 +774,12 @@ controllers:
774
774
  packageLoader:
775
775
  packagesRoot: '${a.localRoot}/packages'
776
776
 
777
- workflows: {}
777
+ workflows:
778
+ features:
779
+ pureFutureFields: true
780
+ commandExpressions: true
781
+ workdirLimits: true
782
+ computeLimits: true
778
783
  `;
779
784
  }
780
785
  function de(a, e) {
@@ -831,16 +836,16 @@ function st(a, e) {
831
836
  return;
832
837
  }
833
838
  const h = parseInt(d.headers["content-length"] || "0", 10);
834
- let b = 0;
835
- const p = f.createWriteStream(i);
836
- d.pipe(p), d.on("data", (y) => {
837
- b += y.length;
838
- const P = b / h * 100;
839
+ let p = 0;
840
+ const b = f.createWriteStream(i);
841
+ d.pipe(b), d.on("data", (y) => {
842
+ p += y.length;
843
+ const P = p / h * 100;
839
844
  r && process.stdout.write(` downloading: ${P.toFixed(2)}%\r`);
840
845
  }), d.on("error", (y) => {
841
846
  f.unlinkSync(i), a.error(`Failed to download Platforma Binary: ${y.message}`), c.destroy(), g(y);
842
- }), p.on("finish", () => {
843
- p.close(), a.info(" ... download done."), c.destroy(), o(i);
847
+ }), b.on("finish", () => {
848
+ b.close(), a.info(" ... download done."), c.destroy(), o(i);
844
849
  });
845
850
  });
846
851
  });
@@ -925,7 +930,7 @@ ${r}`);
925
930
  return this.startInstance(e);
926
931
  }
927
932
  createLocal(e, t) {
928
- var g, d, h, b, p, y, P, L, S, v;
933
+ var g, d, h, p, b, y, P, $, S, v;
929
934
  let r = ct(t == null ? void 0 : t.version, "binaries", "platforma");
930
935
  t != null && t.sourcesPath && (r = m.join(D.tmpdir(), "platforma-custom-build")), t != null && t.binaryPath && (r = t.binaryPath);
931
936
  let n = t == null ? void 0 : t.configPath;
@@ -939,12 +944,12 @@ ${r}`);
939
944
  }), t != null && t.libraryURL && (t.configOptions = {
940
945
  ...t.configOptions,
941
946
  storages: {
942
- ...(b = t.configOptions) == null ? void 0 : b.storages,
943
- library: X(t.libraryURL, s, (y = (p = t.configOptions) == null ? void 0 : p.storages) == null ? void 0 : y.library)
947
+ ...(p = t.configOptions) == null ? void 0 : p.storages,
948
+ library: X(t.libraryURL, s, (y = (b = t.configOptions) == null ? void 0 : b.storages) == null ? void 0 : y.library)
944
949
  }
945
950
  });
946
951
  const i = et(this.getLastJwt(), t == null ? void 0 : t.configOptions);
947
- this.logger.debug(" checking license..."), this.checkLicense((L = (P = t == null ? void 0 : t.configOptions) == null ? void 0 : P.license) == null ? void 0 : L.value, (v = (S = t == null ? void 0 : t.configOptions) == null ? void 0 : S.license) == null ? void 0 : v.file);
952
+ this.logger.debug(" checking license..."), this.checkLicense(($ = (P = t == null ? void 0 : t.configOptions) == null ? void 0 : P.license) == null ? void 0 : $.value, (v = (S = t == null ? void 0 : t.configOptions) == null ? void 0 : S.license) == null ? void 0 : v.file);
948
953
  const c = [
949
954
  `${i.localRoot}/packages`,
950
955
  `${i.localRoot}/packages-local`,
@@ -967,7 +972,7 @@ ${r}`);
967
972
  }), o.push({
968
973
  async: !0,
969
974
  cmd: r,
970
- args: ["--config", n],
975
+ args: ["--quiet", "--config", n],
971
976
  workdir: s,
972
977
  runOpts: { stdio: "inherit" }
973
978
  }), u.setInstanceInfo(e, {
@@ -1074,13 +1079,13 @@ ${r}`);
1074
1079
  if (h.type !== "S3")
1075
1080
  throw new Error(`${h.type} storage type is not supported for library storage`);
1076
1081
  h.presignEndpoint = `http://${g}:9000`;
1077
- const b = c("db"), p = c("work"), y = i("users.htpasswd");
1082
+ const p = c("db"), b = c("work"), y = i("users.htpasswd");
1078
1083
  f.existsSync(y) || f.copyFileSync(Q("users.htpasswd"), y);
1079
1084
  const P = i("compose.yaml");
1080
1085
  f.existsSync(P) && this.logger.info(`replacing docker compose file ${P}`);
1081
- const L = [];
1086
+ const $ = [];
1082
1087
  for (const v of (r == null ? void 0 : r.customMounts) ?? [])
1083
- L.push({
1088
+ $.push({
1084
1089
  hostPath: v.hostPath,
1085
1090
  containerPath: v.containerPath ?? v.hostPath
1086
1091
  });
@@ -1088,7 +1093,7 @@ ${r}`);
1088
1093
  ["minio", {}],
1089
1094
  ["backend", {
1090
1095
  platform: r == null ? void 0 : r.platformOverride,
1091
- mounts: L
1096
+ mounts: $
1092
1097
  }]
1093
1098
  ]));
1094
1099
  const S = {
@@ -1102,10 +1107,10 @@ ${r}`);
1102
1107
  PL_LOG_DIR: m.dirname(o),
1103
1108
  PL_LOG_ROTATION_ENABLED: "true",
1104
1109
  PL_RUNNER_WD_CACHE_ON_FAILURE: "1h",
1105
- PL_DATA_DB_ROOT: b,
1110
+ PL_DATA_DB_ROOT: p,
1106
1111
  PL_DATA_PRIMARY_ROOT: c("primary"),
1107
1112
  PL_DATA_LIBRARY_ROOT: c("library"),
1108
- PL_DATA_WORKDIR_ROOT: p,
1113
+ PL_DATA_WORKDIR_ROOT: b,
1109
1114
  // Mount packages storage as volume, because APFS is case-insensitive on Mac OS X and this breaks some pl software installation.
1110
1115
  // PL_DATA_PACKAGE_ROOT: storageDir('packages'),
1111
1116
  ...this.configureDockerStorage("primary", d),
@@ -1141,9 +1146,9 @@ ${r}`);
1141
1146
  apiAddr: r == null ? void 0 : r.grpcAddr,
1142
1147
  logPath: o,
1143
1148
  primary: d,
1144
- work: { type: "FS", rootPath: p },
1149
+ work: { type: "FS", rootPath: b },
1145
1150
  library: h,
1146
- dbPath: b
1151
+ dbPath: p
1147
1152
  }
1148
1153
  }), u.getInstanceInfo(e);
1149
1154
  }
@@ -1156,8 +1161,8 @@ ${r}`);
1156
1161
  return ke(le, { mode: "0775" }), le;
1157
1162
  }, o = i("logs", "platforma.log");
1158
1163
  f.existsSync(o) || (f.mkdirSync(m.dirname(o), { recursive: !0 }), f.writeFileSync(o, ""));
1159
- const g = c("db"), d = c("primary"), h = c("library"), b = c("work"), p = i("users.htpasswd");
1160
- f.existsSync(p) || f.copyFileSync(Q("users.htpasswd"), p);
1164
+ const g = c("db"), d = c("primary"), h = c("library"), p = c("work"), b = i("users.htpasswd");
1165
+ f.existsSync(b) || f.copyFileSync(Q("users.htpasswd"), b);
1161
1166
  const y = i("compose.yaml");
1162
1167
  f.existsSync(y) && this.logger.info(`replacing docker compose file ${y}`);
1163
1168
  const P = [];
@@ -1172,9 +1177,9 @@ ${r}`);
1172
1177
  mounts: P
1173
1178
  }]
1174
1179
  ]));
1175
- const L = X((r == null ? void 0 : r.primaryStorageURL) ?? `file:${d}`, "."), S = X((r == null ? void 0 : r.libraryStorageURL) ?? `file:${h}`, "."), v = {
1180
+ const $ = X((r == null ? void 0 : r.primaryStorageURL) ?? `file:${d}`, "."), S = X((r == null ? void 0 : r.libraryStorageURL) ?? `file:${h}`, "."), v = {
1176
1181
  PL_IMAGE: s,
1177
- PL_AUTH_HTPASSWD_PATH: p,
1182
+ PL_AUTH_HTPASSWD_PATH: b,
1178
1183
  PL_LICENSE: r == null ? void 0 : r.license,
1179
1184
  PL_LICENSE_FILE: r == null ? void 0 : r.licenseFile,
1180
1185
  PL_LOG_LEVEL: "info",
@@ -1184,9 +1189,9 @@ ${r}`);
1184
1189
  PL_DATA_DB_ROOT: g,
1185
1190
  PL_DATA_PRIMARY_ROOT: d,
1186
1191
  PL_DATA_LIBRARY_ROOT: h,
1187
- PL_DATA_WORKDIR_ROOT: b,
1192
+ PL_DATA_WORKDIR_ROOT: p,
1188
1193
  PL_DATA_PACKAGE_ROOT: c("packages"),
1189
- ...this.configureDockerStorage("primary", L),
1194
+ ...this.configureDockerStorage("primary", $),
1190
1195
  ...this.configureDockerStorage("library", S)
1191
1196
  };
1192
1197
  if (r != null && r.grpcAddr && (v.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (v.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (v.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (v.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (v.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (v.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.auth && (r.auth.enabled && (v.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
@@ -1218,8 +1223,8 @@ ${r}`);
1218
1223
  apiPort: r == null ? void 0 : r.grpcPort,
1219
1224
  apiAddr: r == null ? void 0 : r.grpcAddr,
1220
1225
  logPath: o,
1221
- primary: L,
1222
- work: { type: "FS", rootPath: b },
1226
+ primary: $,
1227
+ work: { type: "FS", rootPath: p },
1223
1228
  library: S,
1224
1229
  dbPath: g
1225
1230
  }
@@ -1372,7 +1377,7 @@ function Ae(a, e) {
1372
1377
  throw new Error(`${r}, process exited with code '${t.status}'`);
1373
1378
  }
1374
1379
  }
1375
- const te = class te extends $ {
1380
+ const te = class te extends L {
1376
1381
  async run() {
1377
1382
  const { flags: e } = await this.parse(te), t = I(e["log-level"]);
1378
1383
  new O(t).cleanupInstance();
@@ -1382,7 +1387,7 @@ l(te, "description", "Clear service state (forget last run command, destroy dock
1382
1387
  ...A
1383
1388
  });
1384
1389
  let Te = te;
1385
- const ae = class ae extends $ {
1390
+ const ae = class ae extends L {
1386
1391
  async run() {
1387
1392
  const { flags: e } = await this.parse(ae), t = I(e["log-level"]);
1388
1393
  new O(t).startLast();
@@ -1392,7 +1397,7 @@ l(ae, "description", "Start last run service configuraiton"), l(ae, "examples",
1392
1397
  ...A
1393
1398
  });
1394
1399
  let xe = ae;
1395
- const ne = class ne extends $ {
1400
+ const ne = class ne extends L {
1396
1401
  async run() {
1397
1402
  const { flags: e } = await this.parse(ne), t = I(e["log-level"]), r = new O(t);
1398
1403
  u.currentInstance ? r.stopInstance(u.currentInstance) : t.warn("up/start command was not called for any instance, nothing to stop");
@@ -1403,7 +1408,7 @@ l(ne, "description", "Stop platforma service"), l(ne, "examples", ["<%= config.b
1403
1408
  });
1404
1409
  let Fe = ne;
1405
1410
  var R;
1406
- let lt = (R = class extends $ {
1411
+ let lt = (R = class extends L {
1407
1412
  async run() {
1408
1413
  const { flags: e } = await this.parse(R), t = I(e["log-level"]), r = new O(t);
1409
1414
  r.mergeLicenseEnvs(e);
@@ -1448,7 +1453,7 @@ let lt = (R = class extends $ {
1448
1453
  ...oe
1449
1454
  }), R);
1450
1455
  var T;
1451
- let dt = (T = class extends $ {
1456
+ let dt = (T = class extends L {
1452
1457
  async run() {
1453
1458
  const { flags: e } = await this.parse(T), t = I(e["log-level"]), r = new O(t);
1454
1459
  r.mergeLicenseEnvs(e);
@@ -1457,9 +1462,9 @@ let dt = (T = class extends $ {
1457
1462
  e["grpc-listen"] ? d = e["grpc-listen"] : e["grpc-port"] && (d = `127.0.0.1:${e["grpc-port"]}`);
1458
1463
  let h = "127.0.0.1:9090";
1459
1464
  e["monitoring-listen"] ? h = e["monitoring-listen"] : e["monitoring-port"] && (h = `127.0.0.1:${e["monitoring-port"]}`);
1460
- let b = "127.0.0.1:9091";
1461
- e["debug-listen"] ? b = e["debug-listen"] : e["debug-port"] && (b = `127.0.0.1:${e["debug-port"]}`);
1462
- const p = {
1465
+ let p = "127.0.0.1:9091";
1466
+ e["debug-listen"] ? p = e["debug-listen"] : e["debug-port"] && (p = `127.0.0.1:${e["debug-port"]}`);
1467
+ const b = {
1463
1468
  sourcesPath: e["pl-sources"],
1464
1469
  binaryPath: e["pl-binary"],
1465
1470
  version: e.version,
@@ -1470,7 +1475,7 @@ let dt = (T = class extends $ {
1470
1475
  configOptions: {
1471
1476
  grpc: { listen: d },
1472
1477
  monitoring: { listen: h },
1473
- debug: { listen: b },
1478
+ debug: { listen: p },
1474
1479
  license: { value: e.license, file: e["license-file"] },
1475
1480
  log: { path: c },
1476
1481
  localRoot: i,
@@ -1479,12 +1484,12 @@ let dt = (T = class extends $ {
1479
1484
  work: { type: "FS", rootPath: e["storage-work"] }
1480
1485
  }
1481
1486
  }
1482
- }, y = r.createLocal(n, p);
1483
- p.binaryPath || p.sourcesPath ? r.switchInstance(y) : Pe(t, { version: e.version }).then(() => {
1487
+ }, y = r.createLocal(n, b);
1488
+ b.binaryPath || b.sourcesPath ? r.switchInstance(y) : Pe(t, { version: e.version }).then(() => {
1484
1489
  const P = r.switchInstance(y);
1485
1490
  setTimeout(() => {
1486
- for (const L of P)
1487
- L.unref();
1491
+ for (const $ of P)
1492
+ $.unref();
1488
1493
  }, 1e3);
1489
1494
  }).catch(function(P) {
1490
1495
  t.error(P.message);
@@ -1494,7 +1499,7 @@ let dt = (T = class extends $ {
1494
1499
  ...A,
1495
1500
  ...C,
1496
1501
  ...j,
1497
- ...pe,
1502
+ ...be,
1498
1503
  ...we,
1499
1504
  ...ve,
1500
1505
  ...M,
@@ -1503,10 +1508,10 @@ let dt = (T = class extends $ {
1503
1508
  ...ie,
1504
1509
  ...oe,
1505
1510
  ...ye,
1506
- ...be,
1511
+ ...pe,
1507
1512
  ...U
1508
1513
  }), T);
1509
- const H = class H extends $ {
1514
+ const H = class H extends L {
1510
1515
  async run() {
1511
1516
  const { flags: e, args: t } = await this.parse(H), r = I(e["log-level"]), n = new O(r), s = t.name;
1512
1517
  e.all && (n.cleanupInstance(), process.exit(0)), s || (r.error("Please, specify name of instance to be removed or set '--all' flag instead"), process.exit(1)), n.cleanupInstance(s);
@@ -1522,7 +1527,7 @@ l(H, "description", "List available instances"), l(H, "examples", ["<%= config.b
1522
1527
  name: K.string({ required: !1 })
1523
1528
  });
1524
1529
  let De = H;
1525
- const W = class W extends $ {
1530
+ const W = class W extends L {
1526
1531
  async run() {
1527
1532
  const { flags: e, args: t } = await this.parse(W), r = I(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
1528
1533
  s || (r.info("no pl service instance selected. No service was stopped"), process.exit(0)), n.stopInstance(u.getInstanceInfo(s));
@@ -1534,7 +1539,7 @@ l(W, "description", "List available instances"), l(W, "examples", ["<%= config.b
1534
1539
  name: K.string({ required: !1 })
1535
1540
  });
1536
1541
  let Ne = W;
1537
- const se = class se extends $ {
1542
+ const se = class se extends L {
1538
1543
  async run() {
1539
1544
  await this.parse(se);
1540
1545
  const e = u.instanceList, t = u.currentInstanceName;
@@ -1546,7 +1551,7 @@ const se = class se extends $ {
1546
1551
  };
1547
1552
  l(se, "description", "List available instances"), l(se, "examples", ["<%= config.bin %> <%= command.id %>"]), l(se, "flags", {});
1548
1553
  let _e = se;
1549
- const q = class q extends $ {
1554
+ const q = class q extends L {
1550
1555
  async run() {
1551
1556
  const { flags: e, args: t } = await this.parse(q), r = I(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
1552
1557
  s || (r.error("no pl service instance is selected. Select instance with 'select' command or provide name to 'up'"), process.exit(1));
@@ -1565,7 +1570,7 @@ l(q, "description", "List available instances"), l(q, "examples", ["<%= config.b
1565
1570
  });
1566
1571
  let Ce = q;
1567
1572
  var x;
1568
- let gt = (x = class extends $ {
1573
+ let gt = (x = class extends L {
1569
1574
  async run() {
1570
1575
  const { flags: e } = await this.parse(x), t = I(e["log-level"]), r = new O(t);
1571
1576
  r.mergeLicenseEnvs(e);
@@ -1573,8 +1578,8 @@ let gt = (x = class extends $ {
1573
1578
  enabled: s,
1574
1579
  drivers: r.initAuthDriversList(e, ".")
1575
1580
  } : void 0, c = e.storage ? m.join(".", e.storage) : u.instanceDir(n), o = [];
1576
- for (const b of e.mount ?? [])
1577
- o.push({ hostPath: b });
1581
+ for (const p of e.mount ?? [])
1582
+ o.push({ hostPath: p });
1578
1583
  const g = e.arch ? `linux/${e.arch}` : void 0, d = e["minio-presign-host"] ? "minio" : "localhost", h = r.createDockerS3(n, c, {
1579
1584
  image: e.image,
1580
1585
  version: e.version,
@@ -1606,7 +1611,7 @@ let gt = (x = class extends $ {
1606
1611
  ...hr
1607
1612
  }), x);
1608
1613
  var F;
1609
- let ut = (F = class extends $ {
1614
+ let ut = (F = class extends L {
1610
1615
  async run() {
1611
1616
  const { flags: e } = await this.parse(F), t = I(e["log-level"]), r = new O(t);
1612
1617
  r.mergeLicenseEnvs(e);
@@ -1615,9 +1620,9 @@ let ut = (F = class extends $ {
1615
1620
  e["grpc-listen"] ? d = e["grpc-listen"] : e["grpc-port"] && (d = `127.0.0.1:${e["grpc-port"]}`);
1616
1621
  let h = "127.0.0.1:9090";
1617
1622
  e["monitoring-listen"] ? h = e["monitoring-listen"] : e["monitoring-port"] && (h = `127.0.0.1:${e["monitoring-port"]}`);
1618
- let b = "127.0.0.1:9091";
1619
- e["debug-listen"] ? b = e["debug-listen"] : e["debug-port"] && (b = `127.0.0.1:${e["debug-port"]}`);
1620
- const p = {
1623
+ let p = "127.0.0.1:9091";
1624
+ e["debug-listen"] ? p = e["debug-listen"] : e["debug-port"] && (p = `127.0.0.1:${e["debug-port"]}`);
1625
+ const b = {
1621
1626
  sourcesPath: e["pl-sources"],
1622
1627
  binaryPath: e["pl-binary"],
1623
1628
  version: e.version,
@@ -1630,7 +1635,7 @@ let ut = (F = class extends $ {
1630
1635
  configOptions: {
1631
1636
  grpc: { listen: d },
1632
1637
  monitoring: { listen: h },
1633
- debug: { listen: b },
1638
+ debug: { listen: p },
1634
1639
  license: { value: e.license, file: e["license-file"] },
1635
1640
  log: { path: c },
1636
1641
  localRoot: i,
@@ -1641,13 +1646,14 @@ let ut = (F = class extends $ {
1641
1646
  work: { type: "FS", rootPath: e["storage-work"] }
1642
1647
  }
1643
1648
  }
1644
- }, y = r.createLocalS3(n, p);
1645
- p.binaryPath || p.sourcesPath ? r.switchInstance(y) : Pe(t, { version: e.version }).then(() => {
1646
- const P = r.switchInstance(y);
1647
- setTimeout(() => {
1648
- for (const L of P)
1649
- L.unref();
1650
- }, 1e3);
1649
+ }, y = r.createLocalS3(n, b);
1650
+ b.binaryPath || b.sourcesPath ? r.switchInstance(y) : await Pe(t, { version: e.version }).then(() => {
1651
+ const P = r.switchInstance(y), $ = [];
1652
+ for (const S of P)
1653
+ $.push(new Promise((v, k) => {
1654
+ S.on("close", v), S.on("error", k);
1655
+ }));
1656
+ return Promise.all($);
1651
1657
  }).catch(function(P) {
1652
1658
  t.error(P.message);
1653
1659
  });
@@ -1657,7 +1663,7 @@ let ut = (F = class extends $ {
1657
1663
  ...C,
1658
1664
  ...j,
1659
1665
  ...mr,
1660
- ...pe,
1666
+ ...be,
1661
1667
  ...we,
1662
1668
  ...ve,
1663
1669
  ...M,
@@ -1666,10 +1672,10 @@ let ut = (F = class extends $ {
1666
1672
  ...ie,
1667
1673
  ...oe,
1668
1674
  ...ye,
1669
- ...be,
1675
+ ...pe,
1670
1676
  ...U
1671
1677
  }), F);
1672
- const z = class z extends $ {
1678
+ const z = class z extends L {
1673
1679
  async run() {
1674
1680
  const { flags: e, args: t } = await this.parse(z), r = I(e["log-level"]), n = new O(r);
1675
1681
  n.mergeLicenseEnvs(e);
@@ -1718,17 +1724,17 @@ l(z, "description", "Run Platforma Backend service as docker container on curren
1718
1724
  });
1719
1725
  let Me = z;
1720
1726
  var E;
1721
- let ft = (E = class extends $ {
1727
+ let ft = (E = class extends L {
1722
1728
  async run() {
1723
1729
  const { flags: e, args: t } = await this.parse(E), r = I(e["log-level"]), n = new O(r);
1724
1730
  n.mergeLicenseEnvs(e);
1725
1731
  const s = t.name, i = e["pl-workdir"] ?? ".", c = e.storage ? m.join(i, e.storage) : u.instanceDir(s), o = e["pl-log-file"] ? m.join(i, e["pl-log-file"]) : void 0, g = n.initAuthDriversList(e, i), d = e["auth-enabled"] ?? g !== void 0;
1726
1732
  let h = "127.0.0.1:6345";
1727
1733
  e["grpc-listen"] ? h = e["grpc-listen"] : e["grpc-port"] && (h = `127.0.0.1:${e["grpc-port"]}`);
1728
- let b = "127.0.0.1:9090";
1729
- e["monitoring-listen"] ? b = e["monitoring-listen"] : e["monitoring-port"] && (b = `127.0.0.1:${e["monitoring-port"]}`);
1730
- let p = "127.0.0.1:9091";
1731
- e["debug-listen"] ? p = e["debug-listen"] : e["debug-port"] && (p = `127.0.0.1:${e["debug-port"]}`);
1734
+ let p = "127.0.0.1:9090";
1735
+ e["monitoring-listen"] ? p = e["monitoring-listen"] : e["monitoring-port"] && (p = `127.0.0.1:${e["monitoring-port"]}`);
1736
+ let b = "127.0.0.1:9091";
1737
+ e["debug-listen"] ? b = e["debug-listen"] : e["debug-port"] && (b = `127.0.0.1:${e["debug-port"]}`);
1732
1738
  const y = {
1733
1739
  sourcesPath: e["pl-sources"],
1734
1740
  binaryPath: e["pl-binary"],
@@ -1739,8 +1745,8 @@ let ft = (E = class extends $ {
1739
1745
  libraryURL: e["storage-library"],
1740
1746
  configOptions: {
1741
1747
  grpc: { listen: h },
1742
- monitoring: { listen: b },
1743
- debug: { listen: p },
1748
+ monitoring: { listen: p },
1749
+ debug: { listen: b },
1744
1750
  license: { value: e.license, file: e["license-file"] },
1745
1751
  log: { path: o },
1746
1752
  localRoot: c,
@@ -1762,7 +1768,7 @@ let ft = (E = class extends $ {
1762
1768
  ...A,
1763
1769
  ...C,
1764
1770
  ...j,
1765
- ...pe,
1771
+ ...be,
1766
1772
  ...we,
1767
1773
  ...ve,
1768
1774
  ...M,
@@ -1771,12 +1777,12 @@ let ft = (E = class extends $ {
1771
1777
  ...ie,
1772
1778
  ...oe,
1773
1779
  ...ye,
1774
- ...be,
1780
+ ...pe,
1775
1781
  ...U
1776
1782
  }), l(E, "args", {
1777
1783
  name: K.string({ required: !0 })
1778
1784
  }), E);
1779
- const Y = class Y extends $ {
1785
+ const Y = class Y extends L {
1780
1786
  async run() {
1781
1787
  const { flags: e, args: t } = await this.parse(Y), r = I(e["log-level"]), n = new O(r);
1782
1788
  n.mergeLicenseEnvs(e);
@@ -1784,8 +1790,8 @@ const Y = class Y extends $ {
1784
1790
  enabled: i,
1785
1791
  drivers: n.initAuthDriversList(e, ".")
1786
1792
  } : void 0, o = e.storage ? m.join(".", e.storage) : u.instanceDir(s), g = [];
1787
- for (const b of e.mount ?? [])
1788
- g.push({ hostPath: b });
1793
+ for (const p of e.mount ?? [])
1794
+ g.push({ hostPath: p });
1789
1795
  const d = e.arch ? `linux/${e.arch}` : void 0, h = e["minio-presign-host"] ? "minio" : "localhost";
1790
1796
  n.createDockerS3(s, o, {
1791
1797
  image: e.image,
@@ -1820,17 +1826,17 @@ l(Y, "description", "Run Platforma Backend service as docker container on curren
1820
1826
  name: K.string({ required: !0 })
1821
1827
  });
1822
1828
  let je = Y;
1823
- const V = class V extends $ {
1829
+ const V = class V extends L {
1824
1830
  async run() {
1825
1831
  const { flags: e, args: t } = await this.parse(V), r = I(e["log-level"]), n = new O(r);
1826
1832
  n.mergeLicenseEnvs(e);
1827
1833
  const s = t.name, i = e["pl-workdir"] ?? ".", c = e.storage ? m.join(i, e.storage) : u.instanceDir(s), o = e["pl-log-file"] ? m.join(i, e["pl-log-file"]) : void 0, g = n.initAuthDriversList(e, i), d = e["auth-enabled"] ?? g !== void 0;
1828
1834
  let h = "127.0.0.1:6345";
1829
1835
  e["grpc-listen"] ? h = e["grpc-listen"] : e["grpc-port"] && (h = `127.0.0.1:${e["grpc-port"]}`);
1830
- let b = "127.0.0.1:9090";
1831
- e["monitoring-listen"] ? b = e["monitoring-listen"] : e["monitoring-port"] && (b = `127.0.0.1:${e["monitoring-port"]}`);
1832
- let p = "127.0.0.1:9091";
1833
- e["debug-listen"] ? p = e["debug-listen"] : e["debug-port"] && (p = `127.0.0.1:${e["debug-port"]}`);
1836
+ let p = "127.0.0.1:9090";
1837
+ e["monitoring-listen"] ? p = e["monitoring-listen"] : e["monitoring-port"] && (p = `127.0.0.1:${e["monitoring-port"]}`);
1838
+ let b = "127.0.0.1:9091";
1839
+ e["debug-listen"] ? b = e["debug-listen"] : e["debug-port"] && (b = `127.0.0.1:${e["debug-port"]}`);
1834
1840
  const y = {
1835
1841
  sourcesPath: e["pl-sources"],
1836
1842
  binaryPath: e["pl-binary"],
@@ -1843,8 +1849,8 @@ const V = class V extends $ {
1843
1849
  minioConsolePort: e["s3-console-port"],
1844
1850
  configOptions: {
1845
1851
  grpc: { listen: h },
1846
- monitoring: { listen: b },
1847
- debug: { listen: p },
1852
+ monitoring: { listen: p },
1853
+ debug: { listen: b },
1848
1854
  license: { value: e.license, file: e["license-file"] },
1849
1855
  log: { path: o },
1850
1856
  localRoot: c,
@@ -1868,7 +1874,7 @@ l(V, "description", "Run Platforma Backend service as local process on current h
1868
1874
  ...C,
1869
1875
  ...mr,
1870
1876
  ...j,
1871
- ...pe,
1877
+ ...be,
1872
1878
  ...we,
1873
1879
  ...ve,
1874
1880
  ...M,
@@ -1877,7 +1883,7 @@ l(V, "description", "Run Platforma Backend service as local process on current h
1877
1883
  ...ie,
1878
1884
  ...oe,
1879
1885
  ...ye,
1880
- ...be,
1886
+ ...pe,
1881
1887
  ...U
1882
1888
  }), l(V, "args", {
1883
1889
  name: K.string({ required: !0 })