@quatrain/worker 1.1.32 → 1.1.34

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/lib/Worker.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Core } from '@quatrain/core';
2
2
  import { HandlerParameters } from './types/HandlerParameters';
3
3
  export declare class Worker extends Core {
4
4
  static endpoint: string;
5
- static logger: any;
5
+ static readonly logger: any;
6
6
  /**
7
7
  * Execute an external command in a promise
8
8
  * @see https://stackoverflow.com/questions/46289682/how-to-wait-for-child-process-spawn-execution-with-async-await
@@ -11,7 +11,7 @@ export declare class Worker extends Core {
11
11
  * @param array args
12
12
  * @return Promise
13
13
  */
14
- static execPromise: (command: string, args?: any[], cwd?: string) => Promise<any>;
14
+ static readonly execPromise: (command: string, args?: any[], cwd?: string) => Promise<any>;
15
15
  /**
16
16
  * Push an event to the backend endpoint, if available
17
17
  * @param event string
@@ -25,5 +25,5 @@ export declare class Worker extends Core {
25
25
  * @param messageHandler function
26
26
  * @param config object
27
27
  */
28
- static handler: (messageHandler: Function, config: HandlerParameters) => Promise<void>;
28
+ static readonly handler: (messageHandler: Function, config: HandlerParameters) => Promise<void>;
29
29
  }
package/lib/Worker.js CHANGED
@@ -30,7 +30,7 @@ class Worker extends core_1.Core {
30
30
  child.on('close', (code) => {
31
31
  if (code !== 0) {
32
32
  Worker.error(`Command execution failed with code: ${code}`);
33
- reject(code);
33
+ reject(new Error(`Process failed and returned code: ${code}`));
34
34
  }
35
35
  else {
36
36
  Worker.info(`Command execution completed with code: ${code}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/worker",
3
- "version": "1.1.32",
3
+ "version": "1.1.34",
4
4
  "description": "Container Worker helpers",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "typescript": "^5.1.5"
26
26
  },
27
27
  "dependencies": {
28
- "@quatrain/core": "^1.1.19",
28
+ "@quatrain/core": "^1.1.22",
29
29
  "@quatrain/queue": "^1.1.16",
30
30
  "axios": "^1.7.7",
31
31
  "fluent-ffmpeg": "^2.1.2",