@onivoro/server-process 1.24.0 → 1.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/{index.js → dist/cjs/index.js} +0 -1
  2. package/{lib → dist/cjs/lib}/docker.d.ts +3 -2
  3. package/{lib → dist/cjs/lib}/docker.js +1 -2
  4. package/dist/cjs/lib/exec-promise.d.ts +5 -0
  5. package/{lib → dist/cjs/lib}/exec-promise.js +1 -2
  6. package/{lib → dist/cjs/lib}/exec-rx-as-json.d.ts +2 -1
  7. package/dist/cjs/lib/exec-rx-as-json.js +9 -0
  8. package/{lib → dist/cjs/lib}/exec-rx-as-lines.d.ts +2 -1
  9. package/dist/cjs/lib/exec-rx-as-lines.js +10 -0
  10. package/dist/cjs/lib/exec-rx.d.ts +6 -0
  11. package/{lib → dist/cjs/lib}/exec-rx.js +1 -2
  12. package/{lib → dist/cjs/lib}/exit.js +2 -2
  13. package/dist/cjs/lib/listen.d.ts +5 -0
  14. package/{lib → dist/cjs/lib}/listen.js +2 -2
  15. package/dist/cjs/lib/psql.d.ts +5 -0
  16. package/{lib → dist/cjs/lib}/psql.js +3 -5
  17. package/{lib → dist/cjs/lib}/spawn-promise.js +1 -2
  18. package/dist/esm/index.d.ts +9 -0
  19. package/dist/esm/index.js +21 -0
  20. package/dist/esm/lib/docker.d.ts +10 -0
  21. package/dist/esm/lib/docker.js +14 -0
  22. package/dist/esm/lib/exec-promise.d.ts +5 -0
  23. package/dist/esm/lib/exec-promise.js +17 -0
  24. package/dist/esm/lib/exec-rx-as-json.d.ts +3 -0
  25. package/dist/esm/lib/exec-rx-as-json.js +9 -0
  26. package/dist/esm/lib/exec-rx-as-lines.d.ts +3 -0
  27. package/dist/esm/lib/exec-rx-as-lines.js +10 -0
  28. package/dist/esm/lib/exec-rx.d.ts +6 -0
  29. package/dist/esm/lib/exec-rx.js +19 -0
  30. package/dist/esm/lib/exit.d.ts +1 -0
  31. package/dist/esm/lib/exit.js +5 -0
  32. package/dist/esm/lib/listen.d.ts +5 -0
  33. package/dist/esm/lib/listen.js +12 -0
  34. package/dist/esm/lib/psql.d.ts +5 -0
  35. package/dist/esm/lib/psql.js +19 -0
  36. package/dist/esm/lib/spawn-promise.d.ts +1 -0
  37. package/dist/esm/lib/spawn-promise.js +29 -0
  38. package/dist/types/index.d.ts +9 -0
  39. package/dist/types/lib/docker.d.ts +10 -0
  40. package/dist/types/lib/exec-promise.d.ts +5 -0
  41. package/dist/types/lib/exec-rx-as-json.d.ts +3 -0
  42. package/dist/types/lib/exec-rx-as-lines.d.ts +3 -0
  43. package/dist/types/lib/exec-rx.d.ts +6 -0
  44. package/dist/types/lib/exit.d.ts +1 -0
  45. package/dist/types/lib/listen.d.ts +5 -0
  46. package/dist/types/lib/psql.d.ts +5 -0
  47. package/dist/types/lib/spawn-promise.d.ts +1 -0
  48. package/package.json +40 -21
  49. package/index.js.map +0 -1
  50. package/lib/docker.js.map +0 -1
  51. package/lib/exec-promise.d.ts +0 -4
  52. package/lib/exec-promise.js.map +0 -1
  53. package/lib/exec-rx-as-json.js +0 -9
  54. package/lib/exec-rx-as-json.js.map +0 -1
  55. package/lib/exec-rx-as-lines.js +0 -10
  56. package/lib/exec-rx-as-lines.js.map +0 -1
  57. package/lib/exec-rx.d.ts +0 -5
  58. package/lib/exec-rx.js.map +0 -1
  59. package/lib/exit.js.map +0 -1
  60. package/lib/listen.d.ts +0 -4
  61. package/lib/listen.js.map +0 -1
  62. package/lib/psql.d.ts +0 -6
  63. package/lib/psql.js.map +0 -1
  64. package/lib/spawn-promise.js.map +0 -1
  65. /package/{index.d.ts → dist/cjs/index.d.ts} +0 -0
  66. /package/{lib → dist/cjs/lib}/exit.d.ts +0 -0
  67. /package/{lib → dist/cjs/lib}/spawn-promise.d.ts +0 -0
@@ -19,4 +19,3 @@ var psql_1 = require("./lib/psql");
19
19
  Object.defineProperty(exports, "PSql", { enumerable: true, get: function () { return psql_1.PSql; } });
20
20
  var spawn_promise_1 = require("./lib/spawn-promise");
21
21
  Object.defineProperty(exports, "spawnPromise", { enumerable: true, get: function () { return spawn_promise_1.spawnPromise; } });
22
- //# sourceMappingURL=index.js.map
@@ -1,9 +1,10 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { ExecOptions } from "child_process";
3
- import { BaseEncodingOptions } from "fs";
4
+ import { EncodingOption } from "fs";
4
5
  export declare class Docker {
5
6
  readonly containerName: string;
6
7
  readonly binaryName: string;
7
8
  constructor(containerName: string, binaryName: string);
8
- execRx(cmd: string, options?: BaseEncodingOptions & ExecOptions, emitStdErr?: boolean): any;
9
+ execRx(cmd: string, options?: EncodingOption & ExecOptions, emitStdErr?: boolean): import("rxjs").Observable<any>;
9
10
  }
@@ -8,8 +8,7 @@ class Docker {
8
8
  this.binaryName = binaryName;
9
9
  }
10
10
  execRx(cmd, options, emitStdErr = true) {
11
- return exec_rx_1.execRx(`docker exec ${this.containerName} ${this.binaryName} ${cmd}`, options, emitStdErr);
11
+ return (0, exec_rx_1.execRx)(`docker exec ${this.containerName} ${this.binaryName} ${cmd}`, options, emitStdErr);
12
12
  }
13
13
  }
14
14
  exports.Docker = Docker;
15
- //# sourceMappingURL=docker.js.map
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ export declare function execPromise(cmd: string, options?: EncodingOption & ExecOptions): Promise<any>;
@@ -4,7 +4,7 @@ exports.execPromise = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  function execPromise(cmd, options) {
6
6
  return new Promise((resolve, reject) => {
7
- child_process_1.exec(cmd, options, (err, stdout) => {
7
+ (0, child_process_1.exec)(cmd, options, (err, stdout) => {
8
8
  if (err) {
9
9
  reject(err);
10
10
  }
@@ -15,4 +15,3 @@ function execPromise(cmd, options) {
15
15
  });
16
16
  }
17
17
  exports.execPromise = execPromise;
18
- //# sourceMappingURL=exec-promise.js.map
@@ -1,2 +1,3 @@
1
+ /// <reference types="node" />
1
2
  import { ExecOptions } from 'child_process';
2
- export declare const execRxAsJson: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => any;
3
+ export declare const execRxAsJson: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => import("rxjs").Observable<any>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execRxAsJson = void 0;
4
+ const operators_1 = require("rxjs/operators");
5
+ const exec_rx_1 = require("./exec-rx");
6
+ const execRxAsJson = (cmd, options, emitStdErr = true) => {
7
+ return (0, exec_rx_1.execRx)(cmd, options, emitStdErr).pipe((0, operators_1.map)((s) => JSON.parse(s)));
8
+ };
9
+ exports.execRxAsJson = execRxAsJson;
@@ -1,2 +1,3 @@
1
+ /// <reference types="node" />
1
2
  import { ExecOptions } from 'child_process';
2
- export declare const execRxAsLines: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => any;
3
+ export declare const execRxAsLines: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => import("rxjs").Observable<string>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execRxAsLines = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const exec_rx_1 = require("./exec-rx");
7
+ const execRxAsLines = (cmd, options, emitStdErr = true) => {
8
+ return (0, exec_rx_1.execRx)(cmd, options, emitStdErr).pipe((0, operators_1.concatMap)((s) => (0, rxjs_1.from)(s.split('\n'))));
9
+ };
10
+ exports.execRxAsLines = execRxAsLines;
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ import { Observable } from "rxjs";
6
+ export declare function execRx(cmd: string, options?: EncodingOption & ExecOptions, emitStdErr?: boolean): Observable<any>;
@@ -5,7 +5,7 @@ const child_process_1 = require("child_process");
5
5
  const rxjs_1 = require("rxjs");
6
6
  function execRx(cmd, options, emitStdErr = true) {
7
7
  return new rxjs_1.Observable((observer) => {
8
- child_process_1.exec(cmd, options, (err, stdout, stderr) => {
8
+ (0, child_process_1.exec)(cmd, options, (err, stdout, stderr) => {
9
9
  if (err) {
10
10
  observer.error(err);
11
11
  }
@@ -17,4 +17,3 @@ function execRx(cmd, options, emitStdErr = true) {
17
17
  });
18
18
  }
19
19
  exports.execRx = execRx;
20
- //# sourceMappingURL=exec-rx.js.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.exit = void 0;
4
- exports.exit = (code) => process.exit.bind(process, code);
5
- //# sourceMappingURL=exit.js.map
4
+ const exit = (code) => process.exit.bind(process, code);
5
+ exports.exit = exit;
@@ -0,0 +1,5 @@
1
+ import { Subject } from 'rxjs';
2
+ export declare const listen: () => {
3
+ stdout: Subject<unknown>;
4
+ stdin: Subject<unknown>;
5
+ };
@@ -4,9 +4,9 @@ exports.listen = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const stdin = new rxjs_1.Subject();
6
6
  const stdout = new rxjs_1.Subject();
7
- exports.listen = () => {
7
+ const listen = () => {
8
8
  process.stdin.on('data', d => stdin.next(d));
9
9
  process.stdin.on('close', () => stdin.complete());
10
10
  return { stdout, stdin };
11
11
  };
12
- //# sourceMappingURL=listen.js.map
12
+ exports.listen = listen;
@@ -0,0 +1,5 @@
1
+ export declare class PSql {
2
+ readonly containerName: string;
3
+ constructor(containerName?: string);
4
+ execRx(cmd: string, db: string, username: string): import("rxjs").Observable<any>;
5
+ }
@@ -5,17 +5,15 @@ const docker_1 = require("./docker");
5
5
  const exec_rx_1 = require("./exec-rx");
6
6
  const binaryName = 'psql';
7
7
  class PSql {
8
- constructor(containerName) {
8
+ constructor(containerName = '') {
9
9
  this.containerName = containerName;
10
- this.container = new docker_1.Docker(this.containerName, binaryName);
11
10
  }
12
11
  execRx(cmd, db, username) {
13
12
  const dbOptions = db ? ['-d', db] : [];
14
13
  const commonArgs = ['-qtAX', '-U', username, ...dbOptions, '-c'].join(' ') + cmd;
15
14
  return this.containerName
16
- ? this.container.execRx(commonArgs)
17
- : exec_rx_1.execRx([binaryName, commonArgs].join(' '));
15
+ ? (new docker_1.Docker(this.containerName, binaryName)).execRx(commonArgs)
16
+ : (0, exec_rx_1.execRx)([binaryName, commonArgs].join(' '));
18
17
  }
19
18
  }
20
19
  exports.PSql = PSql;
21
- //# sourceMappingURL=psql.js.map
@@ -7,7 +7,7 @@ function spawnPromise(program, args, options) {
7
7
  return new Promise((res, rej) => {
8
8
  let stdout = [];
9
9
  let stderr = [];
10
- const proc = child_process_1.spawn(program, args, options);
10
+ const proc = (0, child_process_1.spawn)(program, args, options);
11
11
  proc.stdout.on(data, (data) => {
12
12
  stdout.push(`${data}`);
13
13
  });
@@ -27,4 +27,3 @@ function spawnPromise(program, args, options) {
27
27
  });
28
28
  }
29
29
  exports.spawnPromise = spawnPromise;
30
- //# sourceMappingURL=spawn-promise.js.map
@@ -0,0 +1,9 @@
1
+ export { Docker } from './lib/docker';
2
+ export { execPromise } from './lib/exec-promise';
3
+ export { execRxAsJson } from './lib/exec-rx-as-json';
4
+ export { execRxAsLines } from './lib/exec-rx-as-lines';
5
+ export { execRx } from './lib/exec-rx';
6
+ export { exit } from './lib/exit';
7
+ export { listen } from './lib/listen';
8
+ export { PSql } from './lib/psql';
9
+ export { spawnPromise } from './lib/spawn-promise';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.spawnPromise = exports.PSql = exports.listen = exports.exit = exports.execRx = exports.execRxAsLines = exports.execRxAsJson = exports.execPromise = exports.Docker = void 0;
4
+ var docker_1 = require("./lib/docker");
5
+ Object.defineProperty(exports, "Docker", { enumerable: true, get: function () { return docker_1.Docker; } });
6
+ var exec_promise_1 = require("./lib/exec-promise");
7
+ Object.defineProperty(exports, "execPromise", { enumerable: true, get: function () { return exec_promise_1.execPromise; } });
8
+ var exec_rx_as_json_1 = require("./lib/exec-rx-as-json");
9
+ Object.defineProperty(exports, "execRxAsJson", { enumerable: true, get: function () { return exec_rx_as_json_1.execRxAsJson; } });
10
+ var exec_rx_as_lines_1 = require("./lib/exec-rx-as-lines");
11
+ Object.defineProperty(exports, "execRxAsLines", { enumerable: true, get: function () { return exec_rx_as_lines_1.execRxAsLines; } });
12
+ var exec_rx_1 = require("./lib/exec-rx");
13
+ Object.defineProperty(exports, "execRx", { enumerable: true, get: function () { return exec_rx_1.execRx; } });
14
+ var exit_1 = require("./lib/exit");
15
+ Object.defineProperty(exports, "exit", { enumerable: true, get: function () { return exit_1.exit; } });
16
+ var listen_1 = require("./lib/listen");
17
+ Object.defineProperty(exports, "listen", { enumerable: true, get: function () { return listen_1.listen; } });
18
+ var psql_1 = require("./lib/psql");
19
+ Object.defineProperty(exports, "PSql", { enumerable: true, get: function () { return psql_1.PSql; } });
20
+ var spawn_promise_1 = require("./lib/spawn-promise");
21
+ Object.defineProperty(exports, "spawnPromise", { enumerable: true, get: function () { return spawn_promise_1.spawnPromise; } });
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ export declare class Docker {
6
+ readonly containerName: string;
7
+ readonly binaryName: string;
8
+ constructor(containerName: string, binaryName: string);
9
+ execRx(cmd: string, options?: EncodingOption & ExecOptions, emitStdErr?: boolean): import("rxjs").Observable<any>;
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Docker = void 0;
4
+ const exec_rx_1 = require("./exec-rx");
5
+ class Docker {
6
+ constructor(containerName, binaryName) {
7
+ this.containerName = containerName;
8
+ this.binaryName = binaryName;
9
+ }
10
+ execRx(cmd, options, emitStdErr = true) {
11
+ return (0, exec_rx_1.execRx)(`docker exec ${this.containerName} ${this.binaryName} ${cmd}`, options, emitStdErr);
12
+ }
13
+ }
14
+ exports.Docker = Docker;
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ export declare function execPromise(cmd: string, options?: EncodingOption & ExecOptions): Promise<any>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execPromise = void 0;
4
+ const child_process_1 = require("child_process");
5
+ function execPromise(cmd, options) {
6
+ return new Promise((resolve, reject) => {
7
+ (0, child_process_1.exec)(cmd, options, (err, stdout) => {
8
+ if (err) {
9
+ reject(err);
10
+ }
11
+ else {
12
+ resolve(stdout.toString());
13
+ }
14
+ });
15
+ });
16
+ }
17
+ exports.execPromise = execPromise;
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { ExecOptions } from 'child_process';
3
+ export declare const execRxAsJson: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => import("rxjs").Observable<any>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execRxAsJson = void 0;
4
+ const operators_1 = require("rxjs/operators");
5
+ const exec_rx_1 = require("./exec-rx");
6
+ const execRxAsJson = (cmd, options, emitStdErr = true) => {
7
+ return (0, exec_rx_1.execRx)(cmd, options, emitStdErr).pipe((0, operators_1.map)((s) => JSON.parse(s)));
8
+ };
9
+ exports.execRxAsJson = execRxAsJson;
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { ExecOptions } from 'child_process';
3
+ export declare const execRxAsLines: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => import("rxjs").Observable<string>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execRxAsLines = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const exec_rx_1 = require("./exec-rx");
7
+ const execRxAsLines = (cmd, options, emitStdErr = true) => {
8
+ return (0, exec_rx_1.execRx)(cmd, options, emitStdErr).pipe((0, operators_1.concatMap)((s) => (0, rxjs_1.from)(s.split('\n'))));
9
+ };
10
+ exports.execRxAsLines = execRxAsLines;
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ import { Observable } from "rxjs";
6
+ export declare function execRx(cmd: string, options?: EncodingOption & ExecOptions, emitStdErr?: boolean): Observable<any>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execRx = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const rxjs_1 = require("rxjs");
6
+ function execRx(cmd, options, emitStdErr = true) {
7
+ return new rxjs_1.Observable((observer) => {
8
+ (0, child_process_1.exec)(cmd, options, (err, stdout, stderr) => {
9
+ if (err) {
10
+ observer.error(err);
11
+ }
12
+ else {
13
+ observer.next(`${stdout}${emitStdErr && ` ${stderr}`}`);
14
+ observer.complete();
15
+ }
16
+ });
17
+ });
18
+ }
19
+ exports.execRx = execRx;
@@ -0,0 +1 @@
1
+ export declare const exit: (code: number) => any;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exit = void 0;
4
+ const exit = (code) => process.exit.bind(process, code);
5
+ exports.exit = exit;
@@ -0,0 +1,5 @@
1
+ import { Subject } from 'rxjs';
2
+ export declare const listen: () => {
3
+ stdout: Subject<unknown>;
4
+ stdin: Subject<unknown>;
5
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listen = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const stdin = new rxjs_1.Subject();
6
+ const stdout = new rxjs_1.Subject();
7
+ const listen = () => {
8
+ process.stdin.on('data', d => stdin.next(d));
9
+ process.stdin.on('close', () => stdin.complete());
10
+ return { stdout, stdin };
11
+ };
12
+ exports.listen = listen;
@@ -0,0 +1,5 @@
1
+ export declare class PSql {
2
+ readonly containerName: string;
3
+ constructor(containerName?: string);
4
+ execRx(cmd: string, db: string, username: string): import("rxjs").Observable<any>;
5
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PSql = void 0;
4
+ const docker_1 = require("./docker");
5
+ const exec_rx_1 = require("./exec-rx");
6
+ const binaryName = 'psql';
7
+ class PSql {
8
+ constructor(containerName = '') {
9
+ this.containerName = containerName;
10
+ }
11
+ execRx(cmd, db, username) {
12
+ const dbOptions = db ? ['-d', db] : [];
13
+ const commonArgs = ['-qtAX', '-U', username, ...dbOptions, '-c'].join(' ') + cmd;
14
+ return this.containerName
15
+ ? (new docker_1.Docker(this.containerName, binaryName)).execRx(commonArgs)
16
+ : (0, exec_rx_1.execRx)([binaryName, commonArgs].join(' '));
17
+ }
18
+ }
19
+ exports.PSql = PSql;
@@ -0,0 +1 @@
1
+ export declare function spawnPromise(program: string, args?: string[], options?: any): Promise<unknown>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.spawnPromise = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const data = 'data';
6
+ function spawnPromise(program, args, options) {
7
+ return new Promise((res, rej) => {
8
+ let stdout = [];
9
+ let stderr = [];
10
+ const proc = (0, child_process_1.spawn)(program, args, options);
11
+ proc.stdout.on(data, (data) => {
12
+ stdout.push(`${data}`);
13
+ });
14
+ proc.stderr.on(data, (data) => {
15
+ stderr.push(`${data}`);
16
+ });
17
+ proc.on('close', (code) => {
18
+ if (code) {
19
+ rej(stderr.join(' '));
20
+ }
21
+ else {
22
+ res(stdout.join(' '));
23
+ }
24
+ stdout = undefined;
25
+ stderr = undefined;
26
+ });
27
+ });
28
+ }
29
+ exports.spawnPromise = spawnPromise;
@@ -0,0 +1,9 @@
1
+ export { Docker } from './lib/docker';
2
+ export { execPromise } from './lib/exec-promise';
3
+ export { execRxAsJson } from './lib/exec-rx-as-json';
4
+ export { execRxAsLines } from './lib/exec-rx-as-lines';
5
+ export { execRx } from './lib/exec-rx';
6
+ export { exit } from './lib/exit';
7
+ export { listen } from './lib/listen';
8
+ export { PSql } from './lib/psql';
9
+ export { spawnPromise } from './lib/spawn-promise';
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ export declare class Docker {
6
+ readonly containerName: string;
7
+ readonly binaryName: string;
8
+ constructor(containerName: string, binaryName: string);
9
+ execRx(cmd: string, options?: EncodingOption & ExecOptions, emitStdErr?: boolean): import("rxjs").Observable<any>;
10
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ export declare function execPromise(cmd: string, options?: EncodingOption & ExecOptions): Promise<any>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { ExecOptions } from 'child_process';
3
+ export declare const execRxAsJson: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => import("rxjs").Observable<any>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { ExecOptions } from 'child_process';
3
+ export declare const execRxAsLines: (cmd: string, options?: ExecOptions, emitStdErr?: boolean) => import("rxjs").Observable<string>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { ExecOptions } from "child_process";
4
+ import { EncodingOption } from "fs";
5
+ import { Observable } from "rxjs";
6
+ export declare function execRx(cmd: string, options?: EncodingOption & ExecOptions, emitStdErr?: boolean): Observable<any>;
@@ -0,0 +1 @@
1
+ export declare const exit: (code: number) => any;
@@ -0,0 +1,5 @@
1
+ import { Subject } from 'rxjs';
2
+ export declare const listen: () => {
3
+ stdout: Subject<unknown>;
4
+ stdin: Subject<unknown>;
5
+ };
@@ -0,0 +1,5 @@
1
+ export declare class PSql {
2
+ readonly containerName: string;
3
+ constructor(containerName?: string);
4
+ execRx(cmd: string, db: string, username: string): import("rxjs").Observable<any>;
5
+ }
@@ -0,0 +1 @@
1
+ export declare function spawnPromise(program: string, args?: string[], options?: any): Promise<unknown>;
package/package.json CHANGED
@@ -1,23 +1,42 @@
1
1
  {
2
- "name": "@onivoro/server-process",
3
- "version": "1.24.0",
4
- "repository": {
5
- "url": "https://github.com/onivoro/server-process.git"
6
- },
7
- "scripts": {
8
- "test": "jest",
9
- "build": "tsc -p tsconfig.json",
10
- "release": "rm -rf dist && npm run build && npm version minor && cp package.json dist && cd dist && npm publish --access public"
11
- },
12
- "devDependencies": {
13
- "@types/jest": "^26.0.14",
14
- "@types/node": "^14.11.2",
15
- "jest": "^26.4.2",
16
- "ts-jest": "^26.4.1",
17
- "tslib": "^2.4.0",
18
- "typescript": "^4.0.3"
19
- },
20
- "dependencies": {
21
- "rxjs": "^7.4.0"
22
- }
2
+ "name": "@onivoro/server-process",
3
+ "version": "1.24.2",
4
+ "repository": {
5
+ "url": "git+https://github.com/onivoro/server-process.git"
6
+ },
7
+ "main": "dist/cjs/index.js",
8
+ "module": "dist/esm/index.js",
9
+ "types": "dist/types/index.d.ts",
10
+ "files": [
11
+ "dist/*"
12
+ ],
13
+ "scripts": {
14
+ "onx": "onx",
15
+ "build": "onx Build",
16
+ "deploy": "onx Publish",
17
+ "test": "onx Test",
18
+ "update": "onx Update"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/types/index.d.ts",
23
+ "require": "./dist/cjs/index.js",
24
+ "import": "./dist/esm/index.js",
25
+ "default": "./dist/esm/lib.js"
26
+ }
27
+ },
28
+ "onx": {
29
+ "platform": "server",
30
+ "module": "commonjs"
31
+ },
32
+ "devDependencies": {
33
+ "@onivoro/cli": "*",
34
+ "@types/jest": "*",
35
+ "@types/node": "18.19",
36
+ "typescript": "*"
37
+ },
38
+ "engines": {
39
+ "node": "18.19.1",
40
+ "npm": "10.2.4"
41
+ }
23
42
  }
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,mDAAiD;AAAxC,2GAAA,WAAW,OAAA;AACpB,yDAAqD;AAA5C,+GAAA,YAAY,OAAA;AACrB,2DAAuD;AAA9C,iHAAA,aAAa,OAAA;AACtB,yCAAuC;AAA9B,iGAAA,MAAM,OAAA;AACf,mCAAkC;AAAzB,4FAAA,IAAI,OAAA;AACb,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,mCAAkC;AAAzB,4FAAA,IAAI,OAAA;AACb,qDAAmD;AAA1C,6GAAA,YAAY,OAAA"}
package/lib/docker.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/lib/docker.ts"],"names":[],"mappings":";;;AAEA,uCAAmC;AAEnC,MAAa,MAAM;IACjB,YACkB,aAAqB,EACrB,UAAkB;QADlB,kBAAa,GAAb,aAAa,CAAQ;QACrB,eAAU,GAAV,UAAU,CAAQ;IAChC,CAAC;IAEL,MAAM,CAAC,GAAW,EAAE,OAA2C,EAAE,UAAU,GAAC,IAAI;QAC9E,OAAO,gBAAM,CAAC,eAAe,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACpG,CAAC;CACF;AATD,wBASC"}
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- import { ExecOptions } from "child_process";
3
- import { BaseEncodingOptions } from 'fs';
4
- export declare function execPromise(cmd: string, options?: BaseEncodingOptions & ExecOptions): Promise<any>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"exec-promise.js","sourceRoot":"","sources":["../../src/lib/exec-promise.ts"],"names":[],"mappings":";;;AAAA,iDAAkD;AAGlD,SAAgB,WAAW,CAAC,GAAW,EAAE,OAA2C;IAChF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,oBAAI,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC/B,IAAI,GAAG,EAAE;gBACL,MAAM,CAAC,GAAG,CAAC,CAAC;aACf;iBAAM;gBACH,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC9B;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAVD,kCAUC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.execRxAsJson = void 0;
4
- const operators_1 = require("rxjs/operators");
5
- const exec_rx_1 = require("./exec-rx");
6
- exports.execRxAsJson = (cmd, options, emitStdErr = true) => {
7
- return exec_rx_1.execRx(cmd, options, emitStdErr).pipe(operators_1.map((s) => JSON.parse(s)));
8
- };
9
- //# sourceMappingURL=exec-rx-as-json.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exec-rx-as-json.js","sourceRoot":"","sources":["../../src/lib/exec-rx-as-json.ts"],"names":[],"mappings":";;;AACA,8CAAqC;AACrC,uCAAmC;AAEtB,QAAA,YAAY,GAAG,CAAC,GAAW,EAAE,OAAqB,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IACpF,OAAO,gBAAM,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,IAAI,CAC1C,eAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAClC,CAAA;AACH,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.execRxAsLines = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const exec_rx_1 = require("./exec-rx");
7
- exports.execRxAsLines = (cmd, options, emitStdErr = true) => {
8
- return exec_rx_1.execRx(cmd, options, emitStdErr).pipe(operators_1.concatMap((s) => rxjs_1.from(s.split('\n'))));
9
- };
10
- //# sourceMappingURL=exec-rx-as-lines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exec-rx-as-lines.js","sourceRoot":"","sources":["../../src/lib/exec-rx-as-lines.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAC5B,8CAA2C;AAC3C,uCAAmC;AAEtB,QAAA,aAAa,GAAG,CAAC,GAAW,EAAE,OAAqB,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IACrF,OAAO,gBAAM,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,IAAI,CAC1C,qBAAS,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,WAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAC9C,CAAA;AACH,CAAC,CAAC"}
package/lib/exec-rx.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /// <reference types="node" />
2
- import { ExecOptions } from "child_process";
3
- import { BaseEncodingOptions } from 'fs';
4
- import { Observable } from "rxjs";
5
- export declare function execRx(cmd: string, options?: BaseEncodingOptions & ExecOptions, emitStdErr?: boolean): Observable<any>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"exec-rx.js","sourceRoot":"","sources":["../../src/lib/exec-rx.ts"],"names":[],"mappings":";;;AAAA,iDAAkD;AAElD,+BAAkC;AAElC,SAAgB,MAAM,CAAC,GAAW,EAAE,OAA2C,EAAE,UAAU,GAAC,IAAI;IAC5F,OAAO,IAAI,iBAAU,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC/B,oBAAI,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACvC,IAAI,GAAG,EAAE;gBACL,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACvB;iBAAM;gBACH,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,UAAU,IAAI,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;gBACxD,QAAQ,CAAC,QAAQ,EAAE,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAXD,wBAWC"}
package/lib/exit.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"exit.js","sourceRoot":"","sources":["../../src/lib/exit.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC"}
package/lib/listen.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare const listen: () => {
2
- stdout: any;
3
- stdin: any;
4
- };
package/lib/listen.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"listen.js","sourceRoot":"","sources":["../../src/lib/listen.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,MAAM,KAAK,GAAG,IAAI,cAAO,EAAE,CAAC;AAC5B,MAAM,MAAM,GAAG,IAAI,cAAO,EAAE,CAAC;AAEhB,QAAA,MAAM,GAAG,GAAG,EAAE;IAEvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAElD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC,CAAA"}
package/lib/psql.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare class PSql {
2
- readonly containerName: string;
3
- private container;
4
- constructor(containerName: string);
5
- execRx(cmd: string, db: string, username: string): any;
6
- }
package/lib/psql.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"psql.js","sourceRoot":"","sources":["../../src/lib/psql.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,uCAAmC;AAEnC,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAa,IAAI;IAEf,YAA4B,aAAqB;QAArB,kBAAa,GAAb,aAAa,CAAQ;QADzC,cAAS,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACV,CAAC;IAEtD,MAAM,CAAC,GAAW,EAAE,EAAU,EAAE,QAAgB;QAC9C,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QACjF,OAAO,IAAI,CAAC,aAAa;YACvB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC;YACnC,CAAC,CAAC,gBAAM,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;CACF;AAXD,oBAWC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawn-promise.js","sourceRoot":"","sources":["../../src/lib/spawn-promise.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEtC,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,SAAgB,YAAY,CAAC,OAAe,EAAE,IAAe,EAAE,OAAa;IACxE,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC5B,IAAI,MAAM,GAAa,EAAE,CAAC;QAC1B,IAAI,MAAM,GAAa,EAAE,CAAC;QAE1B,MAAM,IAAI,GAAG,qBAAK,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;YAC1B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;YAC1B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACtB,IAAI,IAAI,EAAE;gBACN,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aACzB;iBAAM;gBACH,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aACzB;YAED,MAAM,GAAG,SAAgB,CAAC;YAC1B,MAAM,GAAG,SAAgB,CAAC;QAC9B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AA1BD,oCA0BC"}
File without changes
File without changes
File without changes