@platforma-sdk/bootstrap 3.5.1 → 3.5.3

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,9 +1,9 @@
1
1
  var Sr = Object.defineProperty;
2
2
  var $r = (a, e, t) => e in a ? Sr(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var l = (a, e, t) => $r(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { Flags as p, Command as L, Args as Q } from "@oclif/core";
4
+ import { Flags as P, Command as $, Args as Q } from "@oclif/core";
5
5
  import * as me from "node:os";
6
- import N from "node:os";
6
+ import _ from "node:os";
7
7
  import f, { createWriteStream as Lr } from "node:fs";
8
8
  import m, { resolve as Ar } from "node:path";
9
9
  import { execSync as xe, spawn as Ir, spawnSync as Or } from "node:child_process";
@@ -18,121 +18,121 @@ import { getDefaultPlVersion as he } from "@milaboratories/pl-deployments";
18
18
  import ur from "yaml";
19
19
  import Tr from "node:https";
20
20
  import * as Fr from "tar";
21
- const A = {
22
- "log-level": p.string({
21
+ const L = {
22
+ "log-level": P.string({
23
23
  description: "logging level",
24
24
  default: "info",
25
25
  options: ["error", "warn", "info", "debug"],
26
26
  required: !1
27
27
  })
28
28
  };
29
- p.string({
29
+ P.string({
30
30
  description: "name of instance",
31
31
  required: !1
32
32
  });
33
33
  const ye = {
34
- image: p.string({
34
+ image: P.string({
35
35
  description: "use custom docker image to run platforma"
36
36
  })
37
37
  }, j = {
38
- version: p.string({
38
+ version: P.string({
39
39
  description: "use custom platforma release (official docker image or binary package)"
40
40
  })
41
41
  }, be = {
42
- arch: p.string({
42
+ arch: P.string({
43
43
  description: "override architecture. You can start amd64 linux image on arm-based host (say, Apple M family processor). I.e. arm64, amd64, amd64/v2"
44
44
  })
45
45
  }, B = {
46
- license: p.string({
46
+ license: P.string({
47
47
  description: 'pass a license code. The license can be got from "https://licensing.milaboratories.com".'
48
48
  }),
49
- "license-file": p.file({
49
+ "license-file": P.file({
50
50
  exists: !0,
51
51
  description: "specify a path to the file with a license. The license can be got from 'https://licensing.milaboratories.com'."
52
52
  })
53
53
  }, U = {
54
- "grpc-port": p.integer({
54
+ "grpc-port": P.integer({
55
55
  description: "port for Platforma Backend gRPC API. Default is 6345",
56
56
  env: "PLATFORMA_GRPC_PORT"
57
57
  }),
58
- "grpc-listen": p.string({
58
+ "grpc-listen": P.string({
59
59
  description: "full listen addr for Platforma Backend gRPC API. Default is 127.0.0.1:6345",
60
60
  env: "PLATFORMA_GRPC_LISTEN"
61
61
  }),
62
- "monitoring-port": p.integer({
62
+ "monitoring-port": P.integer({
63
63
  description: "port for Platforma Backend monitoring API. Default is 9090",
64
64
  env: "PLATFORMA_MONITORING_PORT"
65
65
  }),
66
- "monitoring-listen": p.string({
66
+ "monitoring-listen": P.string({
67
67
  description: "full listen addr for Platforma Backend monitoring API. Default is 127.0.0.1:9090",
68
68
  env: "PLATFORMA_MONITORING_LISTEN"
69
69
  }),
70
- "debug-port": p.integer({
70
+ "debug-port": P.integer({
71
71
  description: "port for Platforma Backend debug API. Default is 9091",
72
72
  env: "PLATFORMA_DEBUG_PORT"
73
73
  }),
74
- "debug-listen": p.string({
74
+ "debug-listen": P.string({
75
75
  description: "full listen addr for Platforma Backend debug API. Default is 127.0.0.1:9091",
76
76
  env: "PLATFORMA_DEBUG_LISTEN"
77
77
  })
78
78
  }, we = {
79
- "s3-port": p.integer({
79
+ "s3-port": P.integer({
80
80
  description: "port that S3 will listen, default is 9000",
81
81
  default: 9e3,
82
82
  env: "PLATFORMA_S3_PORT"
83
83
  }),
84
- "s3-console-port": p.integer({
84
+ "s3-console-port": P.integer({
85
85
  description: "port that a console of S3 will listen, default is 9001",
86
86
  default: 9001,
87
87
  env: "PLATFORMA_S3_CONSOLE_PORT"
88
88
  })
89
89
  }, G = {
90
- storage: p.string({
90
+ storage: P.string({
91
91
  description: "specify path on host to be used as storage for all Platforma Backend data"
92
92
  })
93
93
  }, yr = {
94
- "minio-presign-host": p.boolean({
94
+ "minio-presign-host": P.boolean({
95
95
  description: "use 'minio' host instead of 'localhost' in presign URLs"
96
96
  })
97
97
  }, pe = {
98
- mount: p.string({
98
+ mount: P.string({
99
99
  multiple: !0,
100
100
  description: "things to be mounted into platforma docker container. Targets will appear inside the container under the same absolute paths"
101
101
  })
102
102
  }, Pe = {
103
- "pl-log-file": p.file({
103
+ "pl-log-file": P.file({
104
104
  description: "specify path for Platforma Backend log file"
105
105
  })
106
106
  }, ve = {
107
- "pl-workdir": p.file({
107
+ "pl-workdir": P.file({
108
108
  description: "specify working directory for Platforma Backend process"
109
109
  })
110
110
  }, ke = {
111
- "pl-binary": p.file({
111
+ "pl-binary": P.file({
112
112
  description: "start given Platforma Backend binary instead of automatically downloaded version"
113
113
  })
114
114
  }, Se = {
115
- "pl-sources": p.file({
115
+ "pl-sources": P.file({
116
116
  description: "path to pl repository root: build Platforma Backend from sources and start the resulting binary"
117
117
  })
118
118
  }, $e = {
119
- config: p.string({
119
+ config: P.string({
120
120
  description: "use custom Platforma Backend config"
121
121
  })
122
122
  };
123
- p.file({
123
+ P.file({
124
124
  description: "specify path on host to be used as 'primary' storage"
125
125
  });
126
126
  const oe = {
127
- "storage-work": p.file({
127
+ "storage-work": P.file({
128
128
  description: "specify path on host to be used as 'work' storage"
129
129
  })
130
130
  };
131
- p.file({
131
+ P.file({
132
132
  description: "specify path on host to be used as 'library' storage"
133
133
  });
134
134
  const le = {
135
- "storage-primary": p.string({
135
+ "storage-primary": P.string({
136
136
  description: `specify 'primary' storage destination URL.
137
137
  file:/path/to/dir for directory on local FS
138
138
  s3://<bucket>/?region=<name> for real AWS bucket
@@ -140,7 +140,7 @@ const le = {
140
140
  s3es://<endpoint>/<bucket>/?region=<name> for bucket behind custom endpoint via https`
141
141
  })
142
142
  }, de = {
143
- "storage-library": p.string({
143
+ "storage-library": P.string({
144
144
  description: `specify 'library' storage destination URL.
145
145
  file:/path/to/dir for directory on local FS
146
146
  s3://<bucket>/?region=<name> for real AWS bucket
@@ -148,19 +148,19 @@ const le = {
148
148
  s3es://<endpoint>/<bucket>/?region=<name> for bucket behind custom endpoint via https`
149
149
  })
150
150
  }, Dr = {
151
- "auth-enabled": p.boolean({
151
+ "auth-enabled": P.boolean({
152
152
  description: "enable authorization"
153
153
  })
154
154
  }, Nr = {
155
- "auth-htpasswd-file": p.file({
155
+ "auth-htpasswd-file": P.file({
156
156
  description: "path to .htpasswd file with Platforma users (static user DB auth source)"
157
157
  })
158
158
  }, _r = {
159
- "auth-ldap-server": p.string({
159
+ "auth-ldap-server": P.string({
160
160
  description: "address of LDAP server to use for auth in Platforma (auth source)"
161
161
  })
162
162
  }, Cr = {
163
- "auth-ldap-default-dn": p.string({
163
+ "auth-ldap-default-dn": P.string({
164
164
  description: "DN to use when checking user with LDAP bind operation: e.g. cn=%u,ou=users,dc=example,dc=com"
165
165
  })
166
166
  }, J = {
@@ -175,7 +175,7 @@ function Mr(a) {
175
175
  function H(a) {
176
176
  throw new Error("this should never happen");
177
177
  }
178
- function I(a = "debug") {
178
+ function A(a = "debug") {
179
179
  return fe.createLogger({
180
180
  level: a,
181
181
  format: fe.format.printf(({ level: e, message: t }) => {
@@ -201,14 +201,14 @@ function jr(a) {
201
201
  return Er(Math.ceil(a / 2)).toString("hex").slice(0, a);
202
202
  }
203
203
  function Br(a) {
204
- return a.startsWith("~") ? m.join(N.homedir(), a.slice(1)) : a;
204
+ return a.startsWith("~") ? m.join(_.homedir(), a.slice(1)) : a;
205
205
  }
206
206
  function Ae(a, e) {
207
207
  f.existsSync(a) || (f.mkdirSync(a, { recursive: !0 }), e != null && e.mode && f.chmodSync(a, e.mode));
208
208
  }
209
209
  function Ur(a) {
210
210
  try {
211
- if (N.platform() !== "win32")
211
+ if (_.platform() !== "win32")
212
212
  return xe(`ps -p ${a} -o comm=`, { encoding: "utf8" }).trim();
213
213
  const e = `wmic process where processid=${a} get Caption`, t = xe(e, { encoding: "utf8" }).split(`
214
214
  `);
@@ -279,7 +279,7 @@ function qr() {
279
279
  return s.data;
280
280
  }
281
281
  async function zr(a, e, t) {
282
- const n = await (await fetch(a)).blob(), s = await M.mkdtemp(m.join(N.tmpdir(), "create-repo")), i = m.join(s, "packed-repo.zip"), c = Rr.toWeb(Lr(i));
282
+ const n = await (await fetch(a)).blob(), s = await M.mkdtemp(m.join(_.tmpdir(), "create-repo")), i = m.join(s, "packed-repo.zip"), c = Rr.toWeb(Lr(i));
283
283
  await n.stream().pipeTo(c);
284
284
  const o = m.join(s, "unpacked-repo");
285
285
  await M.mkdir(o), await xr(i, o), await M.cp(m.join(o, e), t, { recursive: !0 });
@@ -343,14 +343,14 @@ async function wr(a, e, t) {
343
343
  async function te(a, e) {
344
344
  return await wr(a, e, "");
345
345
  }
346
- const ae = class ae extends L {
346
+ const ae = class ae extends $ {
347
347
  async run() {
348
- const { flags: e } = await this.parse(ae), t = I(e["log-level"]);
348
+ const { flags: e } = await this.parse(ae), t = A(e["log-level"]);
349
349
  await Wr(t);
350
350
  }
351
351
  };
352
352
  l(ae, "description", "Helps to create a new block by downloading a block's template."), l(ae, "examples", ["<%= name %>"]), l(ae, "flags", {
353
- ...A
353
+ ...L
354
354
  });
355
355
  let Fe = ae;
356
356
  function pr(...a) {
@@ -372,7 +372,7 @@ const W = class W {
372
372
  });
373
373
  l(this, "filePath");
374
374
  l(this, "dirPath");
375
- e = e ?? m.resolve(N.homedir(), ".config", "pl-bootstrap");
375
+ e = e ?? m.resolve(_.homedir(), ".config", "pl-bootstrap");
376
376
  const t = m.join(e, "state.json");
377
377
  this.dirPath = e, this.filePath = t, f.existsSync(e) || f.mkdirSync(e, { recursive: !0 }), f.existsSync(t) && (this.state = JSON.parse(Ie(t).toString()));
378
378
  }
@@ -617,17 +617,17 @@ function ee(a, e, t) {
617
617
  }
618
618
  }
619
619
  function rt(a, e) {
620
- var w, y, v, $, k, P, S, _, ge, E, qe, ze, Ye, Ve, Ke, Xe, Qe, Ze, er, rr, tr, ar, nr, sr, ir, cr, or, lr, dr, gr;
620
+ var w, y, k, S, I, p, v, E, ge, R, qe, ze, Ye, Ve, Ke, Xe, Qe, Ze, er, rr, tr, ar, nr, sr, ir, cr, or, lr, dr, gr;
621
621
  const t = (e == null ? void 0 : e.localRoot) ?? u.instanceDir("default"), r = {
622
622
  level: ((w = e == null ? void 0 : e.log) == null ? void 0 : w.level) ?? "info",
623
623
  path: ((y = e == null ? void 0 : e.log) == null ? void 0 : y.path) ?? `${t}/logs/platforma.log`
624
624
  }, n = {
625
- listen: ((v = e == null ? void 0 : e.grpc) == null ? void 0 : v.listen) ?? "localhost:6345",
625
+ listen: ((k = e == null ? void 0 : e.grpc) == null ? void 0 : k.listen) ?? "localhost:6345",
626
626
  tls: {
627
- enable: ue((k = ($ = e == null ? void 0 : e.grpc) == null ? void 0 : $.tls) == null ? void 0 : k.enable, !1),
628
- clientAuthMode: ((S = (P = e == null ? void 0 : e.grpc) == null ? void 0 : P.tls) == null ? void 0 : S.clientAuthMode) ?? "NoAuth",
629
- certFile: ((ge = (_ = e == null ? void 0 : e.grpc) == null ? void 0 : _.tls) == null ? void 0 : ge.certFile) ?? `${t}/certs/tls.cert`,
630
- keyFile: ((qe = (E = e == null ? void 0 : e.grpc) == null ? void 0 : E.tls) == null ? void 0 : qe.keyFile) ?? `${t}/certs/tls.key`,
627
+ enable: ue((I = (S = e == null ? void 0 : e.grpc) == null ? void 0 : S.tls) == null ? void 0 : I.enable, !1),
628
+ clientAuthMode: ((v = (p = e == null ? void 0 : e.grpc) == null ? void 0 : p.tls) == null ? void 0 : v.clientAuthMode) ?? "NoAuth",
629
+ certFile: ((ge = (E = e == null ? void 0 : e.grpc) == null ? void 0 : E.tls) == null ? void 0 : ge.certFile) ?? `${t}/certs/tls.cert`,
630
+ keyFile: ((qe = (R = e == null ? void 0 : e.grpc) == null ? void 0 : R.tls) == null ? void 0 : qe.keyFile) ?? `${t}/certs/tls.key`,
631
631
  ...(ze = e == null ? void 0 : e.grpc) == null ? void 0 : ze.tls
632
632
  }
633
633
  }, s = {
@@ -795,7 +795,7 @@ function ue(a, e) {
795
795
  }
796
796
  const at = ["linux", "macos", "windows"];
797
797
  function nt(a) {
798
- const e = N.platform();
798
+ const e = _.platform();
799
799
  switch (e) {
800
800
  case "darwin":
801
801
  return "macos";
@@ -811,7 +811,7 @@ function nt(a) {
811
811
  }
812
812
  const st = ["amd64", "arm64"];
813
813
  function vr(a) {
814
- const e = N.arch();
814
+ const e = _.arch();
815
815
  switch (e) {
816
816
  case "arm64":
817
817
  return "arm64";
@@ -848,8 +848,8 @@ function it(a, e) {
848
848
  const w = f.createWriteStream(i);
849
849
  d.pipe(w), d.on("data", (y) => {
850
850
  b += y.length;
851
- const v = b / h * 100;
852
- r && process.stdout.write(` downloading: ${v.toFixed(2)}%\r`);
851
+ const k = b / h * 100;
852
+ r && process.stdout.write(` downloading: ${k.toFixed(2)}%\r`);
853
853
  }), d.on("error", (y) => {
854
854
  f.unlinkSync(i), a.error(`Failed to download Platforma Binary: ${y.message}`), c.destroy(), g(y);
855
855
  }), w.on("finish", () => {
@@ -938,9 +938,9 @@ ${r}`);
938
938
  return this.startInstance(e);
939
939
  }
940
940
  createLocal(e, t) {
941
- var d, h, b, w, y, v, $, k, P, S, _, ge;
941
+ var d, h, b, w, y, k, S, I, p, v, E, ge;
942
942
  let r = ot(t == null ? void 0 : t.version, "binaries", "platforma");
943
- t != null && t.sourcesPath && (r = m.join(N.tmpdir(), "platforma-custom-build")), t != null && t.binaryPath && (r = t.binaryPath);
943
+ t != null && t.sourcesPath && (r = m.join(_.tmpdir(), "platforma-custom-build")), t != null && t.binaryPath && (r = t.binaryPath);
944
944
  let n = t == null ? void 0 : t.configPath;
945
945
  const s = (t == null ? void 0 : t.workdir) ?? (n ? process.cwd() : u.instanceDir(e));
946
946
  t != null && t.primaryURL && (t.configOptions = {
@@ -953,21 +953,21 @@ ${r}`);
953
953
  ...t.configOptions,
954
954
  storages: {
955
955
  ...(w = t.configOptions) == null ? void 0 : w.storages,
956
- library: ee(t.libraryURL, s, (v = (y = t.configOptions) == null ? void 0 : y.storages) == null ? void 0 : v.library)
956
+ library: ee(t.libraryURL, s, (k = (y = t.configOptions) == null ? void 0 : y.storages) == null ? void 0 : k.library)
957
957
  }
958
958
  });
959
959
  const i = rt(this.getLastJwt(), t == null ? void 0 : t.configOptions);
960
- this.logger.debug(" checking license..."), this.checkLicense((k = ($ = t == null ? void 0 : t.configOptions) == null ? void 0 : $.license) == null ? void 0 : k.value, (S = (P = t == null ? void 0 : t.configOptions) == null ? void 0 : P.license) == null ? void 0 : S.file);
960
+ this.logger.debug(" checking license..."), this.checkLicense((I = (S = t == null ? void 0 : t.configOptions) == null ? void 0 : S.license) == null ? void 0 : I.value, (v = (p = t == null ? void 0 : t.configOptions) == null ? void 0 : p.license) == null ? void 0 : v.file);
961
961
  const c = [
962
962
  `${i.localRoot}/packages`,
963
963
  `${i.localRoot}/packages-local`,
964
964
  `${i.localRoot}/blocks-local`
965
965
  ];
966
966
  i.storages.primary.type === "FS" && c.push(i.storages.primary.rootPath), i.storages.library.type === "FS" && (c.push(i.storages.library.rootPath), i.hacks.libraryDownloadable = !1), i.storages.work.type === "FS" && c.push(i.storages.work.rootPath), this.logger.debug(" creating pl state directories...");
967
- for (const E of c)
968
- f.existsSync(E) || (this.logger.debug(` '${E}'`), f.mkdirSync(E, { recursive: !0 }));
969
- for (const E of i.core.auth.drivers)
970
- E.driver === "htpasswd" && (f.existsSync(E.path) || (this.logger.debug(` installing default 'users.htpasswd' to ${E.path}...`), f.copyFileSync(Z("users.htpasswd"), E.path)));
967
+ for (const R of c)
968
+ f.existsSync(R) || (this.logger.debug(` '${R}'`), f.mkdirSync(R, { recursive: !0 }));
969
+ for (const R of i.core.auth.drivers)
970
+ R.driver === "htpasswd" && (f.existsSync(R.path) || (this.logger.debug(` installing default 'users.htpasswd' to ${R.path}...`), f.copyFileSync(Z("users.htpasswd"), R.path)));
971
971
  n || (n = m.join(i.localRoot, "config.yaml"), this.logger.debug(` rendering configuration '${n}'...`), f.writeFileSync(n, tt(i)));
972
972
  const o = [];
973
973
  t != null && t.sourcesPath && o.push({
@@ -987,7 +987,7 @@ ${r}`);
987
987
  stdio: "inherit"
988
988
  }
989
989
  };
990
- return (_ = t == null ? void 0 : t.configOptions) != null && _.numCpu && (g.runOpts.env = {
990
+ return (E = t == null ? void 0 : t.configOptions) != null && E.numCpu && (g.runOpts.env = {
991
991
  GOMAXPROCS: String((ge = t == null ? void 0 : t.configOptions) == null ? void 0 : ge.numCpu)
992
992
  }), o.push(g), u.setInstanceInfo(e, {
993
993
  type: "process",
@@ -1080,89 +1080,89 @@ ${r}`);
1080
1080
  this.logger.debug("creating platforma instance in 'docker s3' mode...");
1081
1081
  const n = Z("compose-backend.yaml"), s = (r == null ? void 0 : r.image) ?? fr(r == null ? void 0 : r.version);
1082
1082
  this.checkLicense(r == null ? void 0 : r.license, r == null ? void 0 : r.licenseFile);
1083
- const i = (...P) => m.join(t, ...P), c = (P) => {
1084
- const S = i(P);
1085
- return Ae(S, { mode: "0775" }), S;
1083
+ const i = (...v) => m.join(t, ...v), c = (v) => {
1084
+ const E = i(v);
1085
+ return Ae(E, { mode: "0775" }), E;
1086
1086
  }, o = i("logs", "platforma.log");
1087
1087
  f.existsSync(o) || (f.mkdirSync(m.dirname(o), { recursive: !0 }), f.writeFileSync(o, ""));
1088
- const g = (r == null ? void 0 : r.presignHost) ?? "localhost", d = ee("s3e://testuser:testpassword@minio:9000/main-bucket");
1089
- if (d.type !== "S3")
1090
- throw new Error("primary storage must have 'S3' type in 'docker s3' configuration");
1091
- d.presignEndpoint = `http://${g}:9000`;
1092
- const h = ee("s3e://testuser:testpassword@minio:9000/library-bucket");
1088
+ const g = (r == null ? void 0 : r.presignHost) ?? "localhost", d = (r == null ? void 0 : r.s3Port) ?? 9e3, h = ee(`s3e://testuser:testpassword@minio:${d}/main-bucket`);
1093
1089
  if (h.type !== "S3")
1094
- throw new Error(`${h.type} storage type is not supported for library storage`);
1095
- h.presignEndpoint = `http://${g}:9000`;
1096
- const b = c("db"), w = c("work"), y = i("users.htpasswd");
1097
- f.existsSync(y) || f.copyFileSync(Z("users.htpasswd"), y);
1098
- const v = i("compose.yaml");
1099
- f.existsSync(v) && this.logger.info(`replacing docker compose file ${v}`);
1100
- const $ = [];
1101
- for (const P of (r == null ? void 0 : r.customMounts) ?? [])
1102
- $.push({
1103
- hostPath: P.hostPath,
1104
- containerPath: P.containerPath ?? P.hostPath
1090
+ throw new Error("primary storage must have 'S3' type in 'docker s3' configuration");
1091
+ h.presignEndpoint = `http://${g}:${d}`;
1092
+ const b = ee(`s3e://testuser:testpassword@minio:${d}/library-bucket`);
1093
+ if (b.type !== "S3")
1094
+ throw new Error(`${b.type} storage type is not supported for library storage`);
1095
+ b.presignEndpoint = `http://${g}:${d}`;
1096
+ const w = c("db"), y = c("work"), k = i("users.htpasswd");
1097
+ f.existsSync(k) || f.copyFileSync(Z("users.htpasswd"), k);
1098
+ const S = i("compose.yaml");
1099
+ f.existsSync(S) && this.logger.info(`replacing docker compose file ${S}`);
1100
+ const I = [];
1101
+ for (const v of (r == null ? void 0 : r.customMounts) ?? [])
1102
+ I.push({
1103
+ hostPath: v.hostPath,
1104
+ containerPath: v.containerPath ?? v.hostPath
1105
1105
  });
1106
- Ee(n, v, `pl-${e}`, /* @__PURE__ */ new Map([
1106
+ Ee(n, S, `pl-${e}`, /* @__PURE__ */ new Map([
1107
1107
  ["minio", {}],
1108
1108
  ["backend", {
1109
1109
  platform: r == null ? void 0 : r.platformOverride,
1110
- mounts: $
1110
+ mounts: I
1111
1111
  }]
1112
1112
  ]));
1113
- const k = {
1113
+ const p = {
1114
1114
  MINIO_IMAGE: "quay.io/minio/minio",
1115
1115
  MINIO_STORAGE: c("minio"),
1116
1116
  PL_IMAGE: s,
1117
- PL_AUTH_HTPASSWD_PATH: y,
1117
+ PL_AUTH_HTPASSWD_PATH: k,
1118
1118
  PL_LICENSE: r == null ? void 0 : r.license,
1119
1119
  PL_LICENSE_FILE: r == null ? void 0 : r.licenseFile,
1120
1120
  PL_LOG_LEVEL: (r == null ? void 0 : r.logLevel) ?? "info",
1121
1121
  PL_LOG_DIR: m.dirname(o),
1122
1122
  PL_LOG_ROTATION_ENABLED: "true",
1123
1123
  PL_RUNNER_WD_CACHE_ON_FAILURE: "1h",
1124
- PL_DATA_DB_ROOT: b,
1124
+ PL_DATA_DB_ROOT: w,
1125
1125
  PL_DATA_PRIMARY_ROOT: c("primary"),
1126
1126
  PL_DATA_LIBRARY_ROOT: c("library"),
1127
- PL_DATA_WORKDIR_ROOT: w,
1127
+ PL_DATA_WORKDIR_ROOT: y,
1128
1128
  // Mount packages storage as volume, because APFS is case-insensitive on Mac OS X and this breaks some pl software installation.
1129
1129
  // PL_DATA_PACKAGE_ROOT: storageDir('packages'),
1130
- ...this.configureDockerStorage("primary", d),
1131
- ...this.configureDockerStorage("library", h)
1130
+ ...this.configureDockerStorage("primary", h),
1131
+ ...this.configureDockerStorage("library", b)
1132
1132
  };
1133
- if (r != null && r.grpcAddr && (k.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (k.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (k.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (k.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (k.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (k.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.s3Port && (k.MINIO_PORT = r.s3Port.toString()), r != null && r.s3ConsolePort && (k.MINIO_CONSOLE_PORT = r.s3ConsolePort.toString()), r != null && r.auth && (r.auth.enabled && (k.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
1134
- for (const P of r.auth.drivers)
1135
- P.driver === "htpasswd" && (k.PL_AUTH_HTPASSWD_PATH = m.resolve(P.path), P.path = "/etc/platforma/users.htpasswd");
1136
- k.PL_AUTH_DRIVERS = JSON.stringify(r.auth.drivers);
1133
+ if (r != null && r.grpcAddr && (p.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (p.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (p.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (p.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (p.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (p.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.s3Port && (p.MINIO_PORT = r.s3Port.toString()), r != null && r.s3ConsolePort && (p.MINIO_CONSOLE_PORT = r.s3ConsolePort.toString()), r != null && r.auth && (r.auth.enabled && (p.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
1134
+ for (const v of r.auth.drivers)
1135
+ v.driver === "htpasswd" && (p.PL_AUTH_HTPASSWD_PATH = m.resolve(v.path), v.path = "/etc/platforma/users.htpasswd");
1136
+ p.PL_AUTH_DRIVERS = JSON.stringify(r.auth.drivers);
1137
1137
  }
1138
1138
  return u.setInstanceInfo(e, {
1139
1139
  type: "docker",
1140
1140
  upCommands: [{
1141
1141
  cmd: "docker",
1142
- args: ["compose", `--file=${v}`, "up", "--detach", "--remove-orphans", "--pull=missing"],
1143
- envs: k,
1142
+ args: ["compose", `--file=${S}`, "up", "--detach", "--remove-orphans", "--pull=missing"],
1143
+ envs: p,
1144
1144
  runOpts: { stdio: "inherit" }
1145
1145
  }],
1146
1146
  downCommands: [{
1147
1147
  cmd: "docker",
1148
- args: ["compose", `--file=${v}`, "down"],
1149
- envs: k,
1148
+ args: ["compose", `--file=${S}`, "down"],
1149
+ envs: p,
1150
1150
  runOpts: { stdio: "inherit" }
1151
1151
  }],
1152
1152
  cleanupCommands: [{
1153
1153
  cmd: "docker",
1154
- args: ["compose", `--file=${v}`, "down", "--volumes", "--remove-orphans"],
1155
- envs: k,
1154
+ args: ["compose", `--file=${S}`, "down", "--volumes", "--remove-orphans"],
1155
+ envs: p,
1156
1156
  runOpts: { stdio: "inherit" }
1157
1157
  }],
1158
1158
  runInfo: {
1159
1159
  apiPort: r == null ? void 0 : r.grpcPort,
1160
1160
  apiAddr: r == null ? void 0 : r.grpcAddr,
1161
1161
  logPath: o,
1162
- primary: d,
1163
- work: { type: "FS", rootPath: w },
1164
- library: h,
1165
- dbPath: b
1162
+ primary: h,
1163
+ work: { type: "FS", rootPath: y },
1164
+ library: b,
1165
+ dbPath: w
1166
1166
  }
1167
1167
  }), u.getInstanceInfo(e);
1168
1168
  }
@@ -1170,28 +1170,28 @@ ${r}`);
1170
1170
  this.logger.debug("creating platforma instance in 'docker' mode...");
1171
1171
  const n = Z("compose-backend.yaml"), s = (r == null ? void 0 : r.image) ?? fr(r == null ? void 0 : r.version);
1172
1172
  this.checkLicense(r == null ? void 0 : r.license, r == null ? void 0 : r.licenseFile);
1173
- const i = (...S) => m.join(t, ...S), c = (S) => {
1174
- const _ = i(S);
1175
- return Ae(_, { mode: "0775" }), _;
1173
+ const i = (...v) => m.join(t, ...v), c = (v) => {
1174
+ const E = i(v);
1175
+ return Ae(E, { mode: "0775" }), E;
1176
1176
  }, o = i("logs", "platforma.log");
1177
1177
  f.existsSync(o) || (f.mkdirSync(m.dirname(o), { recursive: !0 }), f.writeFileSync(o, ""));
1178
1178
  const g = c("db"), d = c("primary"), h = c("library"), b = c("work"), w = i("users.htpasswd");
1179
1179
  f.existsSync(w) || f.copyFileSync(Z("users.htpasswd"), w);
1180
1180
  const y = i("compose.yaml");
1181
1181
  f.existsSync(y) && this.logger.info(`replacing docker compose file ${y}`);
1182
- const v = [];
1183
- for (const S of (r == null ? void 0 : r.customMounts) ?? [])
1184
- v.push({
1185
- hostPath: S.hostPath,
1186
- containerPath: S.containerPath ?? S.hostPath
1182
+ const k = [];
1183
+ for (const v of (r == null ? void 0 : r.customMounts) ?? [])
1184
+ k.push({
1185
+ hostPath: v.hostPath,
1186
+ containerPath: v.containerPath ?? v.hostPath
1187
1187
  });
1188
1188
  this.logger.debug(`Rendering docker compose file '${y}' using '${n}' as base template`), Ee(n, y, `pl-${e}`, /* @__PURE__ */ new Map([
1189
1189
  ["backend", {
1190
1190
  platform: r == null ? void 0 : r.platformOverride,
1191
- mounts: v
1191
+ mounts: k
1192
1192
  }]
1193
1193
  ]));
1194
- const $ = ee((r == null ? void 0 : r.primaryStorageURL) ?? `file:${d}`, "."), k = ee((r == null ? void 0 : r.libraryStorageURL) ?? `file:${h}`, "."), P = {
1194
+ const S = ee((r == null ? void 0 : r.primaryStorageURL) ?? `file:${d}`, "."), I = ee((r == null ? void 0 : r.libraryStorageURL) ?? `file:${h}`, "."), p = {
1195
1195
  PL_IMAGE: s,
1196
1196
  PL_AUTH_HTPASSWD_PATH: w,
1197
1197
  PL_LICENSE: r == null ? void 0 : r.license,
@@ -1205,41 +1205,41 @@ ${r}`);
1205
1205
  PL_DATA_LIBRARY_ROOT: h,
1206
1206
  PL_DATA_WORKDIR_ROOT: b,
1207
1207
  PL_DATA_PACKAGE_ROOT: c("packages"),
1208
- ...this.configureDockerStorage("primary", $),
1209
- ...this.configureDockerStorage("library", k)
1208
+ ...this.configureDockerStorage("primary", S),
1209
+ ...this.configureDockerStorage("library", I)
1210
1210
  };
1211
- if (r != null && r.grpcAddr && (P.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (P.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (P.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (P.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (P.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (P.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.auth && (r.auth.enabled && (P.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
1212
- for (const S of r.auth.drivers)
1213
- S.driver === "htpasswd" && (P.PL_AUTH_HTPASSWD_PATH = m.resolve(S.path), S.path = "/etc/platforma/users.htpasswd");
1214
- P.PL_AUTH_DRIVERS = JSON.stringify(r.auth.drivers);
1211
+ if (r != null && r.grpcAddr && (p.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (p.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (p.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (p.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (p.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (p.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.auth && (r.auth.enabled && (p.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
1212
+ for (const v of r.auth.drivers)
1213
+ v.driver === "htpasswd" && (p.PL_AUTH_HTPASSWD_PATH = m.resolve(v.path), v.path = "/etc/platforma/users.htpasswd");
1214
+ p.PL_AUTH_DRIVERS = JSON.stringify(r.auth.drivers);
1215
1215
  }
1216
1216
  return u.setInstanceInfo(e, {
1217
1217
  type: "docker",
1218
1218
  upCommands: [{
1219
1219
  cmd: "docker",
1220
1220
  args: ["compose", `--file=${y}`, "up", "--detach", "--remove-orphans", "--pull=missing"],
1221
- envs: P,
1221
+ envs: p,
1222
1222
  runOpts: { stdio: "inherit" }
1223
1223
  }],
1224
1224
  downCommands: [{
1225
1225
  cmd: "docker",
1226
1226
  args: ["compose", `--file=${y}`, "down"],
1227
- envs: P,
1227
+ envs: p,
1228
1228
  runOpts: { stdio: "inherit" }
1229
1229
  }],
1230
1230
  cleanupCommands: [{
1231
1231
  cmd: "docker",
1232
1232
  args: ["compose", `--file=${y}`, "down", "--volumes", "--remove-orphans"],
1233
- envs: P,
1233
+ envs: p,
1234
1234
  runOpts: { stdio: "inherit" }
1235
1235
  }],
1236
1236
  runInfo: {
1237
1237
  apiPort: r == null ? void 0 : r.grpcPort,
1238
1238
  apiAddr: r == null ? void 0 : r.grpcAddr,
1239
1239
  logPath: o,
1240
- primary: $,
1240
+ primary: S,
1241
1241
  work: { type: "FS", rootPath: b },
1242
- library: k,
1242
+ library: I,
1243
1243
  dbPath: g
1244
1244
  }
1245
1245
  }), u.getInstanceInfo(e);
@@ -1299,7 +1299,7 @@ If you want to remove all downloaded platforma binaries, delete '${u.binaries()}
1299
1299
  );
1300
1300
  }
1301
1301
  mergeLicenseEnvs(e) {
1302
- e.license === void 0 && ((process.env.MI_LICENSE ?? "") != "" ? e.license = process.env.MI_LICENSE : (process.env.PL_LICENSE ?? "") != "" && (e.license = process.env.PL_LICENSE)), e["license-file"] === void 0 && e.license === void 0 && ((process.env.MI_LICENSE_FILE ?? "") != "" ? e["license-file"] = process.env.MI_LICENSE_FILE : (process.env.PL_LICENSE_FILE ?? "") != "" ? e["license-file"] = process.env.PL_LICENSE_FILE : f.existsSync(m.resolve(N.homedir(), ".pl.license")) && (e["license-file"] = m.resolve(N.homedir(), ".pl.license")));
1302
+ e.license === void 0 && ((process.env.MI_LICENSE ?? "") != "" ? e.license = process.env.MI_LICENSE : (process.env.PL_LICENSE ?? "") != "" && (e.license = process.env.PL_LICENSE)), e["license-file"] === void 0 && e.license === void 0 && ((process.env.MI_LICENSE_FILE ?? "") != "" ? e["license-file"] = process.env.MI_LICENSE_FILE : (process.env.PL_LICENSE_FILE ?? "") != "" ? e["license-file"] = process.env.PL_LICENSE_FILE : f.existsSync(m.resolve(_.homedir(), ".pl.license")) && (e["license-file"] = m.resolve(_.homedir(), ".pl.license")));
1303
1303
  }
1304
1304
  initAuthDriversList(e, t) {
1305
1305
  const r = [];
@@ -1391,40 +1391,40 @@ function Re(a, e) {
1391
1391
  throw new Error(`${r}, process exited with code '${t.status}'`);
1392
1392
  }
1393
1393
  }
1394
- const ne = class ne extends L {
1394
+ const ne = class ne extends $ {
1395
1395
  async run() {
1396
- const { flags: e } = await this.parse(ne), t = I(e["log-level"]);
1396
+ const { flags: e } = await this.parse(ne), t = A(e["log-level"]);
1397
1397
  new O(t).cleanupInstance();
1398
1398
  }
1399
1399
  };
1400
1400
  l(ne, "description", "Clear service state (forget last run command, destroy docker services, volumes and so on)"), l(ne, "examples", ["<%= config.bin %> <%= command.id %>"]), l(ne, "flags", {
1401
- ...A
1401
+ ...L
1402
1402
  });
1403
1403
  let Ne = ne;
1404
- const se = class se extends L {
1404
+ const se = class se extends $ {
1405
1405
  async run() {
1406
- const { flags: e } = await this.parse(se), t = I(e["log-level"]);
1406
+ const { flags: e } = await this.parse(se), t = A(e["log-level"]);
1407
1407
  new O(t).startLast();
1408
1408
  }
1409
1409
  };
1410
1410
  l(se, "description", "Start last run service configuraiton"), l(se, "examples", ["<%= config.bin %> <%= command.id %>"]), l(se, "flags", {
1411
- ...A
1411
+ ...L
1412
1412
  });
1413
1413
  let _e = se;
1414
- const ie = class ie extends L {
1414
+ const ie = class ie extends $ {
1415
1415
  async run() {
1416
- const { flags: e } = await this.parse(ie), t = I(e["log-level"]), r = new O(t);
1416
+ const { flags: e } = await this.parse(ie), t = A(e["log-level"]), r = new O(t);
1417
1417
  u.currentInstance ? r.stopInstance(u.currentInstance) : t.warn("up/start command was not called for any instance, nothing to stop");
1418
1418
  }
1419
1419
  };
1420
1420
  l(ie, "description", "Stop platforma service"), l(ie, "examples", ["<%= config.bin %> <%= command.id %>"]), l(ie, "flags", {
1421
- ...A
1421
+ ...L
1422
1422
  });
1423
1423
  let Ce = ie;
1424
- var x;
1425
- let dt = (x = class extends L {
1424
+ var T;
1425
+ let dt = (T = class extends $ {
1426
1426
  async run() {
1427
- const { flags: e } = await this.parse(x), t = I(e["log-level"]), r = new O(t);
1427
+ const { flags: e } = await this.parse(T), t = A(e["log-level"]), r = new O(t);
1428
1428
  r.mergeLicenseEnvs(e);
1429
1429
  const n = "docker", s = e["auth-enabled"], i = s ? {
1430
1430
  enabled: s,
@@ -1452,8 +1452,8 @@ let dt = (x = class extends L {
1452
1452
  });
1453
1453
  r.switchInstance(d);
1454
1454
  }
1455
- }, l(x, "description", "Run platforma backend service with 'FS' primary storage type"), l(x, "examples", ["<%= config.bin %> <%= command.id %>"]), l(x, "flags", {
1456
- ...A,
1455
+ }, l(T, "description", "Run platforma backend service with 'FS' primary storage type"), l(T, "examples", ["<%= config.bin %> <%= command.id %>"]), l(T, "flags", {
1456
+ ...L,
1457
1457
  ...U,
1458
1458
  ...ye,
1459
1459
  ...j,
@@ -1465,11 +1465,11 @@ let dt = (x = class extends L {
1465
1465
  ...le,
1466
1466
  ...oe,
1467
1467
  ...de
1468
- }), x);
1469
- var T;
1470
- let gt = (T = class extends L {
1468
+ }), T);
1469
+ var F;
1470
+ let gt = (F = class extends $ {
1471
1471
  async run() {
1472
- const { flags: e } = await this.parse(T), t = I(e["log-level"]), r = new O(t);
1472
+ const { flags: e } = await this.parse(F), t = A(e["log-level"]), r = new O(t);
1473
1473
  r.mergeLicenseEnvs(e);
1474
1474
  const n = "local", s = e["pl-workdir"] ?? ".", i = e.storage ? m.join(s, e.storage) : u.instanceDir(n), c = e["pl-log-file"] ? m.join(s, e["pl-log-file"]) : void 0, o = r.initAuthDriversList(e, s), g = e["auth-enabled"] ?? o !== void 0;
1475
1475
  let d = "127.0.0.1:6345";
@@ -1503,17 +1503,17 @@ let gt = (T = class extends L {
1503
1503
  }
1504
1504
  }, y = r.createLocal(n, w);
1505
1505
  w.binaryPath || w.sourcesPath ? r.switchInstance(y) : Le(t, { version: e.version }).then(() => {
1506
- const v = r.switchInstance(y);
1506
+ const k = r.switchInstance(y);
1507
1507
  setTimeout(() => {
1508
- for (const $ of v)
1509
- $.unref();
1508
+ for (const S of k)
1509
+ S.unref();
1510
1510
  }, 1e3);
1511
- }).catch(function(v) {
1512
- t.error(v.message);
1511
+ }).catch(function(k) {
1512
+ t.error(k.message);
1513
1513
  });
1514
1514
  }
1515
- }, l(T, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(T, "examples", ["<%= config.bin %> <%= command.id %>"]), l(T, "flags", {
1516
- ...A,
1515
+ }, l(F, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(F, "examples", ["<%= config.bin %> <%= command.id %>"]), l(F, "flags", {
1516
+ ...L,
1517
1517
  ...j,
1518
1518
  ...U,
1519
1519
  ...ke,
@@ -1527,16 +1527,16 @@ let gt = (T = class extends L {
1527
1527
  ...Pe,
1528
1528
  ...ve,
1529
1529
  ...J
1530
- }), T);
1531
- const q = class q extends L {
1530
+ }), F);
1531
+ const q = class q extends $ {
1532
1532
  async run() {
1533
- const { flags: e, args: t } = await this.parse(q), r = I(e["log-level"]), n = new O(r), s = t.name;
1533
+ const { flags: e, args: t } = await this.parse(q), r = A(e["log-level"]), n = new O(r), s = t.name;
1534
1534
  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);
1535
1535
  }
1536
1536
  };
1537
1537
  l(q, "description", "List available instances"), l(q, "examples", ["<%= config.bin %> <%= command.id %>"]), l(q, "flags", {
1538
- ...A,
1539
- all: p.boolean({
1538
+ ...L,
1539
+ all: P.boolean({
1540
1540
  description: "remove all known instances",
1541
1541
  required: !1
1542
1542
  })
@@ -1544,19 +1544,19 @@ l(q, "description", "List available instances"), l(q, "examples", ["<%= config.b
1544
1544
  name: Q.string({ required: !1 })
1545
1545
  });
1546
1546
  let Me = q;
1547
- const z = class z extends L {
1547
+ const z = class z extends $ {
1548
1548
  async run() {
1549
- const { flags: e, args: t } = await this.parse(z), r = I(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
1549
+ const { flags: e, args: t } = await this.parse(z), r = A(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
1550
1550
  s || (r.info("no pl service instance selected. No service was stopped"), process.exit(0)), n.stopInstance(u.getInstanceInfo(s));
1551
1551
  }
1552
1552
  };
1553
1553
  l(z, "description", "List available instances"), l(z, "examples", ["<%= config.bin %> <%= command.id %>"]), l(z, "flags", {
1554
- ...A
1554
+ ...L
1555
1555
  }), l(z, "args", {
1556
1556
  name: Q.string({ required: !1 })
1557
1557
  });
1558
1558
  let je = z;
1559
- const ce = class ce extends L {
1559
+ const ce = class ce extends $ {
1560
1560
  async run() {
1561
1561
  await this.parse(ce);
1562
1562
  const e = u.instanceList, t = u.currentInstanceName;
@@ -1568,9 +1568,9 @@ const ce = class ce extends L {
1568
1568
  };
1569
1569
  l(ce, "description", "List available instances"), l(ce, "examples", ["<%= config.bin %> <%= command.id %>"]), l(ce, "flags", {});
1570
1570
  let Be = ce;
1571
- const Y = class Y extends L {
1571
+ const Y = class Y extends $ {
1572
1572
  async run() {
1573
- const { flags: e, args: t } = await this.parse(Y), r = I(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
1573
+ const { flags: e, args: t } = await this.parse(Y), r = A(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
1574
1574
  s || (r.error("no pl service instance is selected. Select instance with 'select' command or provide name to 'up'"), process.exit(1));
1575
1575
  const i = n.switchInstance(u.getInstanceInfo(s)), c = [];
1576
1576
  for (const o of i)
@@ -1581,15 +1581,15 @@ const Y = class Y extends L {
1581
1581
  }
1582
1582
  };
1583
1583
  l(Y, "description", "List available instances"), l(Y, "examples", ["<%= config.bin %> <%= command.id %>"]), l(Y, "flags", {
1584
- ...A
1584
+ ...L
1585
1585
  }), l(Y, "args", {
1586
1586
  name: Q.string({ required: !1 })
1587
1587
  });
1588
1588
  let Ue = Y;
1589
- var F;
1590
- let ut = (F = class extends L {
1589
+ var D;
1590
+ let ut = (D = class extends $ {
1591
1591
  async run() {
1592
- const { flags: e } = await this.parse(F), t = I(e["log-level"]), r = new O(t);
1592
+ const { flags: e } = await this.parse(D), t = A(e["log-level"]), r = new O(t);
1593
1593
  r.mergeLicenseEnvs(e);
1594
1594
  const n = "docker-s3", s = e["auth-enabled"], i = s ? {
1595
1595
  enabled: s,
@@ -1617,8 +1617,8 @@ let ut = (F = class extends L {
1617
1617
  });
1618
1618
  r.switchInstance(h);
1619
1619
  }
1620
- }, l(F, "description", "Run platforma backend service with 'S3' primary storage type"), l(F, "examples", ["<%= config.bin %> <%= command.id %>"]), l(F, "flags", {
1621
- ...A,
1620
+ }, l(D, "description", "Run platforma backend service with 'S3' primary storage type"), l(D, "examples", ["<%= config.bin %> <%= command.id %>"]), l(D, "flags", {
1621
+ ...L,
1622
1622
  ...U,
1623
1623
  ...we,
1624
1624
  ...ye,
@@ -1629,11 +1629,11 @@ let ut = (F = class extends L {
1629
1629
  ...pe,
1630
1630
  ...G,
1631
1631
  ...yr
1632
- }), F);
1633
- var D;
1634
- let ft = (D = class extends L {
1632
+ }), D);
1633
+ var N;
1634
+ let ft = (N = class extends $ {
1635
1635
  async run() {
1636
- const { flags: e } = await this.parse(D), t = I(e["log-level"]), r = new O(t);
1636
+ const { flags: e } = await this.parse(N), t = A(e["log-level"]), r = new O(t);
1637
1637
  r.mergeLicenseEnvs(e);
1638
1638
  const n = "local-s3", s = e["pl-workdir"] ?? ".", i = e.storage ? m.join(s, e.storage) : u.instanceDir(n), c = e["pl-log-file"] ? m.join(s, e["pl-log-file"]) : void 0, o = r.initAuthDriversList(e, s), g = e["auth-enabled"] ?? o !== void 0;
1639
1639
  let d = "127.0.0.1:6345";
@@ -1671,18 +1671,18 @@ let ft = (D = class extends L {
1671
1671
  }
1672
1672
  }, y = r.createLocalS3(n, w);
1673
1673
  w.binaryPath || w.sourcesPath ? r.switchInstance(y) : await Le(t, { version: e.version }).then(() => {
1674
- const v = r.switchInstance(y), $ = [];
1675
- for (const k of v)
1676
- $.push(new Promise((P, S) => {
1677
- k.on("close", P), k.on("error", S);
1674
+ const k = r.switchInstance(y), S = [];
1675
+ for (const I of k)
1676
+ S.push(new Promise((p, v) => {
1677
+ I.on("close", p), I.on("error", v);
1678
1678
  }));
1679
- return Promise.all($);
1680
- }).catch(function(v) {
1681
- t.error(v.message);
1679
+ return Promise.all(S);
1680
+ }).catch(function(k) {
1681
+ t.error(k.message);
1682
1682
  });
1683
1683
  }
1684
- }, l(D, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(D, "examples", ["<%= config.bin %> <%= command.id %>"]), l(D, "flags", {
1685
- ...A,
1684
+ }, l(N, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(N, "examples", ["<%= config.bin %> <%= command.id %>"]), l(N, "flags", {
1685
+ ...L,
1686
1686
  ...j,
1687
1687
  ...U,
1688
1688
  ...we,
@@ -1697,10 +1697,10 @@ let ft = (D = class extends L {
1697
1697
  ...Pe,
1698
1698
  ...ve,
1699
1699
  ...J
1700
- }), D);
1701
- const V = class V extends L {
1700
+ }), N);
1701
+ const V = class V extends $ {
1702
1702
  async run() {
1703
- const { flags: e, args: t } = await this.parse(V), r = I(e["log-level"]), n = new O(r);
1703
+ const { flags: e, args: t } = await this.parse(V), r = A(e["log-level"]), n = new O(r);
1704
1704
  n.mergeLicenseEnvs(e);
1705
1705
  const s = t.name, i = e["auth-enabled"], c = i ? {
1706
1706
  enabled: i,
@@ -1730,7 +1730,7 @@ const V = class V extends L {
1730
1730
  }
1731
1731
  };
1732
1732
  l(V, "description", "Run Platforma Backend service as docker container on current host"), l(V, "examples", ["<%= config.bin %> <%= command.id %>"]), l(V, "flags", {
1733
- ...A,
1733
+ ...L,
1734
1734
  ...U,
1735
1735
  ...ye,
1736
1736
  ...j,
@@ -1746,10 +1746,10 @@ l(V, "description", "Run Platforma Backend service as docker container on curren
1746
1746
  name: Q.string({ required: !0 })
1747
1747
  });
1748
1748
  let Ge = V;
1749
- var R;
1750
- let mt = (R = class extends L {
1749
+ var x;
1750
+ let mt = (x = class extends $ {
1751
1751
  async run() {
1752
- const { flags: e, args: t } = await this.parse(R), r = I(e["log-level"]), n = new O(r);
1752
+ const { flags: e, args: t } = await this.parse(x), r = A(e["log-level"]), n = new O(r);
1753
1753
  n.mergeLicenseEnvs(e);
1754
1754
  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;
1755
1755
  let h = "127.0.0.1:6345";
@@ -1786,12 +1786,12 @@ let mt = (R = class extends L {
1786
1786
  r.info(`Instance '${s}' was created. To start it run 'up' command`);
1787
1787
  return;
1788
1788
  }
1789
- Le(r, { version: e.version }).then(() => r.info(`Instance '${s}' was created. To start it run 'svc up' command`)).catch(function(v) {
1790
- r.error(v.message);
1789
+ Le(r, { version: e.version }).then(() => r.info(`Instance '${s}' was created. To start it run 'svc up' command`)).catch(function(k) {
1790
+ r.error(k.message);
1791
1791
  });
1792
1792
  }
1793
- }, l(R, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(R, "examples", ["<%= config.bin %> <%= command.id %>"]), l(R, "flags", {
1794
- ...A,
1793
+ }, l(x, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(x, "examples", ["<%= config.bin %> <%= command.id %>"]), l(x, "flags", {
1794
+ ...L,
1795
1795
  ...j,
1796
1796
  ...U,
1797
1797
  ...ke,
@@ -1805,12 +1805,12 @@ let mt = (R = class extends L {
1805
1805
  ...Pe,
1806
1806
  ...ve,
1807
1807
  ...J
1808
- }), l(R, "args", {
1808
+ }), l(x, "args", {
1809
1809
  name: Q.string({ required: !0 })
1810
- }), R);
1811
- const K = class K extends L {
1810
+ }), x);
1811
+ const K = class K extends $ {
1812
1812
  async run() {
1813
- const { flags: e, args: t } = await this.parse(K), r = I(e["log-level"]), n = new O(r);
1813
+ const { flags: e, args: t } = await this.parse(K), r = A(e["log-level"]), n = new O(r);
1814
1814
  n.mergeLicenseEnvs(e);
1815
1815
  const s = t.name, i = e["auth-enabled"], c = i ? {
1816
1816
  enabled: i,
@@ -1840,7 +1840,7 @@ const K = class K extends L {
1840
1840
  }
1841
1841
  };
1842
1842
  l(K, "description", "Run Platforma Backend service as docker container on current host with MinIO as local S3 storage"), l(K, "examples", ["<%= config.bin %> <%= command.id %>"]), l(K, "flags", {
1843
- ...A,
1843
+ ...L,
1844
1844
  ...U,
1845
1845
  ...we,
1846
1846
  ...ye,
@@ -1855,9 +1855,9 @@ l(K, "description", "Run Platforma Backend service as docker container on curren
1855
1855
  name: Q.string({ required: !0 })
1856
1856
  });
1857
1857
  let Je = K;
1858
- const X = class X extends L {
1858
+ const X = class X extends $ {
1859
1859
  async run() {
1860
- const { flags: e, args: t } = await this.parse(X), r = I(e["log-level"]), n = new O(r);
1860
+ const { flags: e, args: t } = await this.parse(X), r = A(e["log-level"]), n = new O(r);
1861
1861
  n.mergeLicenseEnvs(e);
1862
1862
  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;
1863
1863
  let h = "127.0.0.1:6345";
@@ -1896,13 +1896,13 @@ const X = class X extends L {
1896
1896
  r.info(`Instance '${s}' was created. To start it run 'up' command`);
1897
1897
  return;
1898
1898
  }
1899
- Le(r, { version: e.version }).then(() => r.info(`Instance '${s}' was created. To start it run 'svc up' command`)).catch(function(v) {
1900
- r.error(v.message);
1899
+ Le(r, { version: e.version }).then(() => r.info(`Instance '${s}' was created. To start it run 'svc up' command`)).catch(function(k) {
1900
+ r.error(k.message);
1901
1901
  });
1902
1902
  }
1903
1903
  };
1904
1904
  l(X, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(X, "examples", ["<%= config.bin %> <%= command.id %>"]), l(X, "flags", {
1905
- ...A,
1905
+ ...L,
1906
1906
  ...j,
1907
1907
  ...we,
1908
1908
  ...U,