@quatrain/worker 1.1.51 → 1.1.52

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 (2) hide show
  1. package/README.md +32 -0
  2. package/package.json +4 -4
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @quatrain/worker
2
+
3
+ A comprehensive toolkit for building and managing backend processing workers within the Quatrain ecosystem. It provides robust utilities for executing child processes, interacting with file systems, pushing remote events, and standardizing message handler execution.
4
+
5
+ ## Introduction
6
+
7
+ In distributed architectures, workers are processes that consume events (via queues or CLI) and perform heavy background tasks (such as video rendering, file processing, or data synchronization).
8
+ The `@quatrain/worker` package abstracts away the boilerplate needed to instantiate a worker, connect it to a queue, and report its progress back to a central API.
9
+
10
+ ## Key Concepts
11
+
12
+ - **`Worker`**: The core class offering static methods to execute shell commands (`execPromise`), push webhook events (`pushEvent`), and standardize the message-handling loop (`handler`).
13
+ - **`FileSystem`**: A wrapper around Node.js filesystem operations, providing typed and safe methods for managing files, directories, and temporary processing paths.
14
+ - **`Helpers`**: A collection of utility functions to streamline worker tasks.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @quatrain/worker
20
+ # or
21
+ yarn add @quatrain/worker
22
+ ```
23
+
24
+ ## Features
25
+
26
+ - **Agnostic execution mode**: A worker can run by listening to a queue (`queue` mode) or locally via standard input (`cli` or `test` mode).
27
+ - **Process Spawning**: Safely wrap `child_process.spawn` into Promises with structured logging.
28
+ - **Event Reporting**: Push HTTP patch events to a backend orchestrator using `axios` to update job statuses in real-time.
29
+
30
+ ## License
31
+
32
+ AGPL-3.0-only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/worker",
3
- "version": "1.1.51",
3
+ "version": "1.1.52",
4
4
  "description": "Container Worker helpers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,9 +28,9 @@
28
28
  "typescript": "^5.1.5"
29
29
  },
30
30
  "dependencies": {
31
- "@quatrain/core": "^1.1.48",
32
- "@quatrain/queue": "^1.1.28",
33
- "@quatrain/storage": "^1.1.30",
31
+ "@quatrain/core": "^1.1.49",
32
+ "@quatrain/queue": "^1.1.29",
33
+ "@quatrain/storage": "^1.1.31",
34
34
  "axios": "^1.7.7",
35
35
  "fluent-ffmpeg": "^2.1.2",
36
36
  "fs-extra": "^11.2.0",