@ultimat3/jobs 30.0.0 → 30.2.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": "30.0.0",
3
+ "version": "30.2.0",
4
4
  "description": "Durable background work: steps, transactional outbox, cron tasks, one driver interface",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -44,11 +44,11 @@
44
44
  "test": "bun test"
45
45
  },
46
46
  "dependencies": {
47
- "@ultimat3/core": "30.0.0",
48
- "@ultimat3/db": "30.0.0",
49
- "@ultimat3/entity": "30.0.0",
50
- "@ultimat3/http": "30.0.0",
51
- "@ultimat3/schema": "30.0.0",
52
- "@ultimat3/time": "30.0.0"
47
+ "@ultimat3/core": "30.2.0",
48
+ "@ultimat3/db": "30.2.0",
49
+ "@ultimat3/entity": "30.2.0",
50
+ "@ultimat3/http": "30.2.0",
51
+ "@ultimat3/schema": "30.2.0",
52
+ "@ultimat3/time": "30.2.0"
53
53
  }
54
54
  }
@@ -3,6 +3,7 @@
3
3
  // result fails at compile time, and if forced, on attempt 1 rather than on the first resume.
4
4
 
5
5
  import { isJsonObject, isUltimateError, jsonbRefusal, renderThrowable } from '@ultimat3/core';
6
+ import type { JsonValue } from '@ultimat3/schema';
6
7
  import { StepOutputUnserializableError } from './errors-steps';
7
8
 
8
9
  type Callable = ((...args: never[]) => unknown) | (abstract new (...args: never[]) => unknown);
@@ -77,7 +78,13 @@ type JsonOf<T> = T extends string | number | boolean | null
77
78
  * `bigint` is `never`: the value raises `X_STEP_OUTPUT_UNSERIALIZABLE` instead of arriving, as do
78
79
  * `NaN`, an infinity, an invalid `Date` and text `jsonb` refuses, which the type cannot see.
79
80
  */
80
- export type StepOutput<T> = unknown extends T ? T : JsonOf<T>;
81
+ export type StepOutput<T> = unknown extends T
82
+ ? T
83
+ : // Already JSON, so the round trip changes nothing. Checked first: `JsonValue` is recursive, and
84
+ // walking it member by member never bottoms out (TS2589).
85
+ [T] extends [JsonValue]
86
+ ? T
87
+ : JsonOf<T>;
81
88
 
82
89
  /**
83
90
  * The value both attempts see. One stringify and one parse per EXECUTED step, none on a replay; a
package/src/type-pins.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // excludes `src/**/*.test.ts`, so `tsc -b` never reads a test file and a claim written there can
3
3
  // never fail. Nothing here is called — a regression is a build error (axiom 3).
4
4
 
5
+ import type { JsonValue } from '@ultimat3/schema';
5
6
  import { t } from '@ultimat3/schema';
6
7
  import type { StepApi, StepOutput } from './steps';
7
8
 
@@ -64,6 +65,14 @@ export type StepOutputPins = [
64
65
  Assert<Same<StepOutput<Uint8Array>, Record<string, number>>>,
65
66
  // `bigint` never arrives: X_STEP_OUTPUT_UNSERIALIZABLE.
66
67
  Assert<Same<StepOutput<bigint>, never>>,
68
+ // Already JSON comes back as itself, recursive type and all — it was TS2589 before 30.1.0.
69
+ Assert<Same<StepOutput<JsonValue>, JsonValue>>,
70
+ Assert<
71
+ Same<
72
+ StepOutput<{ readonly payload: JsonValue; readonly at: Date }>,
73
+ { readonly payload: JsonValue; readonly at: string }
74
+ >
75
+ >,
67
76
  ];
68
77
 
69
78
  const Approval = t.object({ amount: t.number });