@bernierllc/job-scheduler 1.0.0 → 1.0.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.
- package/README.md +37 -3
- package/package.json +16 -15
package/README.md
CHANGED
|
@@ -356,9 +356,43 @@ process.on('SIGTERM', () => {
|
|
|
356
356
|
|
|
357
357
|
## Integration Status
|
|
358
358
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
### Logger Integration
|
|
360
|
+
**Status**: Integrated
|
|
361
|
+
|
|
362
|
+
**Justification**: This package uses `@bernierllc/logger` for structured logging of job scheduling operations. Logs include job creation, execution start/completion, failures, retries, and scheduling events to help with debugging and monitoring job workflows.
|
|
363
|
+
|
|
364
|
+
**Pattern**: Direct integration - logger is a required dependency for this package.
|
|
365
|
+
|
|
366
|
+
### NeverHub Integration
|
|
367
|
+
**Status**: Optional (recommended for job orchestration)
|
|
368
|
+
|
|
369
|
+
**Justification**: While this package can function without NeverHub, it's highly recommended to integrate `@bernierllc/neverhub-adapter` for job orchestration and event publishing. Job schedulers often need to coordinate with other services, and NeverHub provides a service mesh for publishing job execution events that other services can subscribe to. However, the package is designed to work without NeverHub for simpler use cases.
|
|
370
|
+
|
|
371
|
+
**Pattern**: Optional integration - package works without NeverHub, but NeverHub enhances job orchestration capabilities.
|
|
372
|
+
|
|
373
|
+
**Example Integration**:
|
|
374
|
+
```typescript
|
|
375
|
+
import { NeverHubAdapter } from '@bernierllc/neverhub-adapter';
|
|
376
|
+
import { JobScheduler } from '@bernierllc/job-scheduler';
|
|
377
|
+
|
|
378
|
+
const neverhub = new NeverHubAdapter({ service: 'job-scheduler' });
|
|
379
|
+
const scheduler = new JobScheduler({ /* config */ });
|
|
380
|
+
|
|
381
|
+
// Publish job events to NeverHub
|
|
382
|
+
scheduler.on('job:completed', async (job) => {
|
|
383
|
+
await neverhub.publish('job.completed', {
|
|
384
|
+
jobId: job.id,
|
|
385
|
+
jobType: job.type,
|
|
386
|
+
duration: job.duration,
|
|
387
|
+
timestamp: new Date()
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Docs-Suite Integration
|
|
393
|
+
**Status**: Ready
|
|
394
|
+
|
|
395
|
+
**Format**: TypeDoc-compatible JSDoc comments are included throughout the source code. All public APIs are documented with examples and type information.
|
|
362
396
|
|
|
363
397
|
## Error Handling
|
|
364
398
|
|
package/package.json
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bernierllc/job-scheduler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Cron-based job scheduling for recurring tasks with execution tracking",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"prebuild": "npm run clean",
|
|
10
|
-
"clean": "rimraf dist",
|
|
11
|
-
"test": "jest --watch",
|
|
12
|
-
"test:watch": "jest --watch",
|
|
13
|
-
"test:coverage": "jest --coverage",
|
|
14
|
-
"test:run": "jest",
|
|
15
|
-
"lint": "eslint src __tests__ --ext .ts"
|
|
16
|
-
},
|
|
17
7
|
"files": [
|
|
18
8
|
"dist/**/*",
|
|
19
9
|
"README.md",
|
|
@@ -31,8 +21,8 @@
|
|
|
31
21
|
"author": "Bernier LLC",
|
|
32
22
|
"license": "SEE LICENSE IN LICENSE",
|
|
33
23
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
24
|
+
"cron-parser": "^4.9.0",
|
|
25
|
+
"@bernierllc/logger": "1.0.4"
|
|
36
26
|
},
|
|
37
27
|
"devDependencies": {
|
|
38
28
|
"@types/node": "^20.0.0",
|
|
@@ -55,7 +45,8 @@
|
|
|
55
45
|
},
|
|
56
46
|
"homepage": "https://github.com/bernierllc/tools/tree/main/packages/core/job-scheduler#readme",
|
|
57
47
|
"publishConfig": {
|
|
58
|
-
"access": "restricted"
|
|
48
|
+
"access": "restricted",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
59
50
|
},
|
|
60
51
|
"engines": {
|
|
61
52
|
"node": ">=16.0.0"
|
|
@@ -64,5 +55,15 @@
|
|
|
64
55
|
"integration": {
|
|
65
56
|
"neverhub": "optional"
|
|
66
57
|
}
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc",
|
|
61
|
+
"prebuild": "npm run clean",
|
|
62
|
+
"clean": "rimraf dist",
|
|
63
|
+
"test": "jest --watch",
|
|
64
|
+
"test:watch": "jest --watch",
|
|
65
|
+
"test:coverage": "jest --coverage",
|
|
66
|
+
"test:run": "jest",
|
|
67
|
+
"lint": "eslint src __tests__ --ext .ts"
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
}
|