@ultimat3/jobs 4.0.0 → 5.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/jobs",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Durable background work: steps, transactional outbox, cron tasks, one driver interface",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,9 +32,9 @@
32
32
  "test": "bun test"
33
33
  },
34
34
  "dependencies": {
35
- "@ultimat3/core": "4.0.0",
36
- "@ultimat3/entity": "4.0.0",
37
- "@ultimat3/schema": "4.0.0",
38
- "@ultimat3/time": "4.0.0"
35
+ "@ultimat3/core": "5.0.0",
36
+ "@ultimat3/entity": "5.0.0",
37
+ "@ultimat3/schema": "5.0.0",
38
+ "@ultimat3/time": "5.0.0"
39
39
  }
40
40
  }
@@ -16,10 +16,13 @@ import type {
16
16
  import { JobsNotImplementedError } from './errors';
17
17
  import type { StepRecord, StepStore } from './steps';
18
18
 
19
- // Names the config edit that actually removes the stub, plus the runnable command for whatever
20
- // is already queued. The nats driver lands in v2; there is no flag that turns this one on.
19
+ // Names the seam that actually replaces the stub, plus the runnable command for whatever is
20
+ // already queued. NOT `jobs: { driver }` in app.config.ts, which this line said until 2026-08-20:
21
+ // `JobsConfig.driver` has no reader anywhere (see `driver.ts`'s header), so that edit repairs
22
+ // nothing and the reader is sent back to the same throw. #223 removes the field.
23
+ // The nats driver lands in v2; there is no flag that turns this one on.
21
24
  const FIX =
22
- "set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs drain --to memory --json";
25
+ 'call setJobDriver(createPgDriver()) at boot instead of this driver, then move what is already queued: x jobs drain --to memory --json';
23
26
 
24
27
  const unavailable = (method: string): never => {
25
28
  throw new JobsNotImplementedError({ feature: `nats jobs driver (${method})`, fix: FIX });
@@ -19,10 +19,13 @@ import type {
19
19
  import { JobsNotImplementedError } from './errors';
20
20
  import type { StepRecord, StepStore } from './steps';
21
21
 
22
- // Names the config edit that actually removes the stub, plus the runnable command for whatever
23
- // is already queued. The redis driver lands in v2; there is no flag that turns this one on.
22
+ // Names the seam that actually replaces the stub, plus the runnable command for whatever is
23
+ // already queued. NOT `jobs: { driver }` in app.config.ts, which this line said until 2026-08-20:
24
+ // `JobsConfig.driver` has no reader anywhere (see `driver.ts`'s header), so that edit repairs
25
+ // nothing and the reader is sent back to the same throw. #223 removes the field.
26
+ // The redis driver lands in v2; there is no flag that turns this one on.
24
27
  const FIX =
25
- "set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs drain --to memory --json";
28
+ 'call setJobDriver(createPgDriver()) at boot instead of this driver, then move what is already queued: x jobs drain --to memory --json';
26
29
 
27
30
  const unavailable = (method: string): never => {
28
31
  throw new JobsNotImplementedError({ feature: `redis jobs driver (${method})`, fix: FIX });
package/src/errors.ts CHANGED
@@ -355,7 +355,7 @@ export class CancelUnsupportedError extends UltimateError {
355
355
  super({
356
356
  code: 'X_JOB_NOT_CANCELLABLE',
357
357
  cause: `the "${input.driver}" jobs driver cannot cancel a single job`,
358
- fix: "set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs cancel <id> --json",
358
+ fix: 'call setJobDriver(createPgDriver()) at boot only the pg driver implements introspect.cancel then: x jobs cancel <id> --json',
359
359
  docs: docsFor('X_JOB_NOT_CANCELLABLE'),
360
360
  });
361
361
  }
@@ -372,7 +372,7 @@ export class ConcurrencyUnenforceableError extends UltimateError {
372
372
  super({
373
373
  code: 'X_JOB_CONCURRENCY_UNENFORCEABLE',
374
374
  cause: `${input.jobs.join(', ')} declare concurrency and the "${input.driver}" jobs driver has no lease store, so the cap would hold per process and the fleet would run concurrency x replicas`,
375
- fix: `remove concurrency from job("${input.jobs[0] ?? 'the job'}"), or set jobs: { driver: 'postgres' } in app.config.ts`,
375
+ fix: `remove concurrency from job("${input.jobs[0] ?? 'the job'}"), or call setJobDriver(createPgDriver()) at boot — the pg driver is the one with a lease store`,
376
376
  docs: docsFor('X_JOB_CONCURRENCY_UNENFORCEABLE'),
377
377
  });
378
378
  }
package/src/inspect.ts CHANGED
@@ -91,7 +91,7 @@ function requireIntrospection(driver: JobDriver): NonNullable<JobDriver['introsp
91
91
  if (driver.introspect === undefined) {
92
92
  throw new JobsNotImplementedError({
93
93
  feature: `introspection for the "${driver.name}" jobs driver`,
94
- fix: "set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs ls --json",
94
+ fix: 'call setJobDriver(createPgDriver()) at boot — only the pg driver implements introspect then: x jobs ls --json',
95
95
  });
96
96
  }
97
97
  return driver.introspect;
package/src/outbox.ts CHANGED
@@ -338,7 +338,7 @@ export function jobsFacade(): JobsFacade {
338
338
  throw new DriverUnavailableError({
339
339
  driver: 'none',
340
340
  cause: 'no queue driver is installed in this process',
341
- fix: 'call setJobDriver(createMemoryDriver()) before enqueuing or set jobs.driver in app.config.ts and run `x dev`',
341
+ fix: 'call setJobDriver(createMemoryDriver()) before enqueuing, or setJobDriver(createPgDriver()) for a real queue',
342
342
  });
343
343
  }
344
344
  return installed;