@camunda8/orchestration-cluster-api 10.0.0-alpha.31 → 10.0.0-alpha.33
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/CHANGELOG.md +19 -0
- package/README.md +72 -0
- package/dist/{CamundaClient-esvUSLtB.d.cts → CamundaClient-CcbPiyq9.d.cts} +898 -14
- package/dist/{CamundaClient-D95Qr9pC.d.ts → CamundaClient-CjiqDv80.d.ts} +898 -14
- package/dist/{chunk-M5UHGQJ3.js → chunk-AH6BQSBI.js} +453 -4
- package/dist/chunk-AH6BQSBI.js.map +1 -0
- package/dist/effect/index.cjs +889 -76
- package/dist/effect/index.cjs.map +1 -1
- package/dist/effect/index.d.cts +142 -3
- package/dist/effect/index.d.ts +142 -3
- package/dist/effect/index.js +177 -2
- package/dist/effect/index.js.map +1 -1
- package/dist/index.cjs +660 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{zod.gen-CGU4FBRF.js → zod.gen-GHFW5D76.js} +208 -17
- package/dist/zod.gen-GHFW5D76.js.map +1 -0
- package/package.json +2 -2
- package/dist/chunk-M5UHGQJ3.js.map +0 -1
- package/dist/zod.gen-CGU4FBRF.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [10.0.0-alpha.33](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.32...v10.0.0-alpha.33) (2026-08-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **examples:** add coverage for 7 runtime backup cluster-admin ops ([#448](https://github.com/camunda/orchestration-cluster-api-js/issues/448)) ([504821d](https://github.com/camunda/orchestration-cluster-api-js/commit/504821d3bc2b7edd69efe5ded47df0e0a926a275))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Performance Improvements
|
|
10
|
+
|
|
11
|
+
* **test:** parallelize unit test files (~4x faster) ([#447](https://github.com/camunda/orchestration-cluster-api-js/issues/447)) ([0138e07](https://github.com/camunda/orchestration-cluster-api-js/commit/0138e0708ff29836cb96593fed7fed622d78eeab))
|
|
12
|
+
|
|
13
|
+
# [10.0.0-alpha.32](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.31...v10.0.0-alpha.32) (2026-08-20)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **effect:** Effect-native job-worker surface ([#444](https://github.com/camunda/orchestration-cluster-api-js/issues/444)) ([754c096](https://github.com/camunda/orchestration-cluster-api-js/commit/754c09625a930ff6507e7a5f0e6f0a050f80175e)), closes [#437](https://github.com/camunda/orchestration-cluster-api-js/issues/437) [#438](https://github.com/camunda/orchestration-cluster-api-js/issues/438)
|
|
19
|
+
|
|
1
20
|
# [10.0.0-alpha.31](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.30...v10.0.0-alpha.31) (2026-08-20)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
|
@@ -1330,6 +1330,78 @@ Exports available from `.../effect`:
|
|
|
1330
1330
|
**Clock-class win:** `eventually` / `withTimeout` run on the Effect `Clock`, so `TestClock.adjust`
|
|
1331
1331
|
advances eventual/timeout deterministically in tests — no real-clock burn.
|
|
1332
1332
|
|
|
1333
|
+
### Effect Job Workers
|
|
1334
|
+
|
|
1335
|
+
The same subpath also exposes an **Effect-native job worker** — the long-running
|
|
1336
|
+
`activateJobs` → handle → `completeJob`/`failJob` loop, modelled as Effect. A handler is
|
|
1337
|
+
`(job) => Effect.Effect<CompleteVars, JobError, R>` with a **typed failure channel**: a
|
|
1338
|
+
`RetryableJobError` becomes `failJob` with `retries - 1` (plus an optional server-side backoff),
|
|
1339
|
+
and a `TerminalJobError` becomes `throwJobError` (caught by a BPMN error boundary, or an incident if
|
|
1340
|
+
uncaught). Success completes the job with the returned variables. It composes over the same
|
|
1341
|
+
activation/backpressure runtime the Promise worker uses — it does not reimplement activation.
|
|
1342
|
+
|
|
1343
|
+
<!-- snippet-exempt: uses SDK /effect subpath + optional effect peer not available in examples project -->
|
|
1344
|
+
```ts
|
|
1345
|
+
import { Effect, Schedule } from 'effect';
|
|
1346
|
+
import {
|
|
1347
|
+
createCamundaEffectWorker,
|
|
1348
|
+
layer,
|
|
1349
|
+
RetryableJobError,
|
|
1350
|
+
TerminalJobError,
|
|
1351
|
+
} from '@camunda8/orchestration-cluster-api/effect';
|
|
1352
|
+
|
|
1353
|
+
const program = Effect.gen(function* () {
|
|
1354
|
+
// Forked into the current Scope: interrupted (with a best-effort lease release) when
|
|
1355
|
+
// the scope closes.
|
|
1356
|
+
yield* createCamundaEffectWorker<{ ok: boolean }>({
|
|
1357
|
+
type: 'payment-processing',
|
|
1358
|
+
maxJobsToActivate: 10, // activation batch size
|
|
1359
|
+
concurrency: 10, // max jobs handled in parallel (backpressure)
|
|
1360
|
+
pollInterval: '1 second', // between empty polls, on the Effect Clock
|
|
1361
|
+
// Optional: retry the handler in-process on a RetryableJobError before failing the job.
|
|
1362
|
+
handlerRetrySchedule: Schedule.spaced('2 seconds'),
|
|
1363
|
+
handler: (job) =>
|
|
1364
|
+
Effect.gen(function* () {
|
|
1365
|
+
if (!job.variables.amount) {
|
|
1366
|
+
// Terminal → raise a BPMN error / incident.
|
|
1367
|
+
return yield* Effect.fail(
|
|
1368
|
+
new TerminalJobError({ code: 'INVALID_INPUT', message: 'amount is required' })
|
|
1369
|
+
);
|
|
1370
|
+
}
|
|
1371
|
+
if (yield* isServiceDown()) {
|
|
1372
|
+
// Retryable → failJob(retries - 1) with a re-activation backoff.
|
|
1373
|
+
return yield* Effect.fail(
|
|
1374
|
+
new RetryableJobError({ message: 'downstream unavailable', retryBackoff: '5 seconds' })
|
|
1375
|
+
);
|
|
1376
|
+
}
|
|
1377
|
+
return { ok: true }; // success → completeJob(variables)
|
|
1378
|
+
}),
|
|
1379
|
+
});
|
|
1380
|
+
|
|
1381
|
+
// ... the worker runs for the lifetime of this scope.
|
|
1382
|
+
yield* Effect.never;
|
|
1383
|
+
}).pipe(
|
|
1384
|
+
Effect.scoped,
|
|
1385
|
+
Effect.provide(layer()) // provides the `/effect` client the worker depends on
|
|
1386
|
+
);
|
|
1387
|
+
|
|
1388
|
+
void program;
|
|
1389
|
+
```
|
|
1390
|
+
|
|
1391
|
+
Worker exports from `.../effect`:
|
|
1392
|
+
|
|
1393
|
+
- `createCamundaEffectWorker(config)` – forks the worker into the current `Scope` and returns a
|
|
1394
|
+
handle (`{ type, join, interrupt }`); provide the client `layer()` as its dependency.
|
|
1395
|
+
- `activateJobsStream(type, options)` – the lower-level `Stream.Stream<Job, DomainError, …>` of
|
|
1396
|
+
activated jobs, polling on the Effect `Clock`.
|
|
1397
|
+
- `workerLayer(config)` – a `Layer` that runs a worker for the layer's lifetime.
|
|
1398
|
+
- Tagged job failures: `RetryableJobError` (→ `failJob`), `TerminalJobError` (→ `throwJobError`),
|
|
1399
|
+
together the `JobError` channel.
|
|
1400
|
+
|
|
1401
|
+
**Clock-class win:** the activation poll interval and the handler-retry `Schedule` run on the Effect
|
|
1402
|
+
`Clock`, so `TestClock.adjust` bounds activation/retry timing in virtual time — the whole loop is
|
|
1403
|
+
deterministic in tests, with no real-clock burn.
|
|
1404
|
+
|
|
1333
1405
|
## Eventual Consistency Polling
|
|
1334
1406
|
|
|
1335
1407
|
Some endpoints accept consistency management options. Pass a `consistency` block (where supported) with `waitUpToMs` and optional `pollIntervalMs` (default 500). If the condition is not met within timeout an `EventualConsistencyTimeoutError` is thrown.
|