@camunda8/orchestration-cluster-api 10.0.0-alpha.30 → 10.0.0-alpha.32
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 +21 -0
- package/README.md +153 -67
- package/dist/{index-CIGXnFfe.d.ts → CamundaClient-BRj4omSA.d.ts} +2094 -2204
- package/dist/{index-Cv5fK0gZ.d.cts → CamundaClient-D9CRR7D0.d.cts} +2094 -2204
- package/dist/{chunk-SHE5T54L.js → chunk-WHBUDCPU.js} +10 -140
- package/dist/chunk-WHBUDCPU.js.map +1 -0
- package/dist/{fp → effect}/index.cjs +309 -117
- package/dist/effect/index.cjs.map +1 -0
- package/dist/effect/index.d.cts +258 -0
- package/dist/effect/index.d.ts +258 -0
- package/dist/effect/index.js +330 -0
- package/dist/effect/index.js.map +1 -0
- package/dist/index.cjs +9 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -20
- package/dist/index.d.ts +85 -20
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/{zod.gen-CGU4FBRF.js → zod.gen-2LVIU5XR.js} +2 -2
- package/dist/{zod.gen-CGU4FBRF.js.map → zod.gen-2LVIU5XR.js.map} +1 -1
- package/package.json +11 -11
- package/dist/chunk-SHE5T54L.js.map +0 -1
- package/dist/fp/index.cjs.map +0 -1
- package/dist/fp/index.d.cts +0 -3
- package/dist/fp/index.d.ts +0 -3
- package/dist/fp/index.js +0 -23
- package/dist/fp/index.js.map +0 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CamundaValidationError,
|
|
3
|
+
EventualConsistencyTimeoutError,
|
|
4
|
+
createCamundaClient
|
|
5
|
+
} from "../chunk-WHBUDCPU.js";
|
|
6
|
+
import "../chunk-KQ4UL2WX.js";
|
|
7
|
+
import "../chunk-DGUM43GV.js";
|
|
8
|
+
|
|
9
|
+
// src/effect.ts
|
|
10
|
+
import { Context, Data, Duration, Effect, Layer, Schedule } from "effect";
|
|
11
|
+
var CamundaValidationError2 = class extends Data.TaggedError("CamundaValidationError") {
|
|
12
|
+
};
|
|
13
|
+
var EventualConsistencyTimeout = class extends Data.TaggedError("EventualConsistencyTimeout") {
|
|
14
|
+
};
|
|
15
|
+
var HttpError = class extends Data.TaggedError("HttpError") {
|
|
16
|
+
};
|
|
17
|
+
var CamundaGenericError = class extends Data.TaggedError("CamundaGenericError") {
|
|
18
|
+
};
|
|
19
|
+
function toDomainError(err) {
|
|
20
|
+
if (err instanceof CamundaValidationError) {
|
|
21
|
+
return new CamundaValidationError2({
|
|
22
|
+
side: err.side,
|
|
23
|
+
operationId: err.operationId,
|
|
24
|
+
summary: err.summary,
|
|
25
|
+
issues: err.issues,
|
|
26
|
+
message: err.message,
|
|
27
|
+
cause: err
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (err instanceof EventualConsistencyTimeoutError) {
|
|
31
|
+
return new EventualConsistencyTimeout({
|
|
32
|
+
attempts: err.attempts,
|
|
33
|
+
elapsedMs: err.elapsedMs,
|
|
34
|
+
message: err.message,
|
|
35
|
+
cause: err
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const anyErr = err;
|
|
39
|
+
if (anyErr && typeof anyErr === "object" && typeof anyErr.status === "number") {
|
|
40
|
+
return new HttpError({
|
|
41
|
+
status: anyErr.status,
|
|
42
|
+
body: anyErr.body,
|
|
43
|
+
message: typeof anyErr.message === "string" ? anyErr.message : `HTTP ${anyErr.status}`,
|
|
44
|
+
cause: err
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (err instanceof Error) {
|
|
48
|
+
return new CamundaGenericError({ message: err.message, cause: err });
|
|
49
|
+
}
|
|
50
|
+
return new CamundaGenericError({ message: String(err), cause: err });
|
|
51
|
+
}
|
|
52
|
+
function isPromiseLike(v) {
|
|
53
|
+
return !!v && typeof v.then === "function";
|
|
54
|
+
}
|
|
55
|
+
function createCamundaEffectClient(options) {
|
|
56
|
+
const base = createCamundaClient(options);
|
|
57
|
+
const cache = /* @__PURE__ */ new Map();
|
|
58
|
+
function wrap(fn) {
|
|
59
|
+
return (...args) => Effect.suspend(() => {
|
|
60
|
+
let r;
|
|
61
|
+
try {
|
|
62
|
+
r = fn.apply(base, args);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
return Effect.fail(toDomainError(e));
|
|
65
|
+
}
|
|
66
|
+
if (!isPromiseLike(r)) return Effect.succeed(r);
|
|
67
|
+
const promise = r;
|
|
68
|
+
return Effect.callback((resume) => {
|
|
69
|
+
promise.then(
|
|
70
|
+
(a) => resume(Effect.succeed(a)),
|
|
71
|
+
(e) => resume(Effect.fail(toDomainError(e)))
|
|
72
|
+
);
|
|
73
|
+
const cancel = r.cancel;
|
|
74
|
+
return typeof cancel === "function" ? Effect.sync(() => cancel.call(r)) : void 0;
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const handler = {
|
|
79
|
+
get(_t, prop) {
|
|
80
|
+
if (prop === "inner") return base;
|
|
81
|
+
if (cache.has(prop)) return cache.get(prop);
|
|
82
|
+
const value = base[prop];
|
|
83
|
+
if (typeof value === "function") {
|
|
84
|
+
const w = wrap(value);
|
|
85
|
+
cache.set(prop, w);
|
|
86
|
+
return w;
|
|
87
|
+
}
|
|
88
|
+
cache.set(prop, value);
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
return new Proxy({}, handler);
|
|
93
|
+
}
|
|
94
|
+
function formatDuration(d) {
|
|
95
|
+
try {
|
|
96
|
+
return Duration.format(Duration.fromInputUnsafe(d));
|
|
97
|
+
} catch {
|
|
98
|
+
return String(d);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function retryWithBackoff(effect, opts) {
|
|
102
|
+
const backoff = Schedule.exponential(opts.baseDelay ?? "100 millis").pipe(Schedule.jittered);
|
|
103
|
+
return Effect.retry(effect, {
|
|
104
|
+
schedule: backoff,
|
|
105
|
+
times: Math.max(0, opts.max - 1),
|
|
106
|
+
while: opts.while
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function withTimeout(effect, duration, onTimeout) {
|
|
110
|
+
return Effect.timeoutOrElse(effect, {
|
|
111
|
+
duration,
|
|
112
|
+
orElse: () => Effect.fail(
|
|
113
|
+
onTimeout ? onTimeout() : new EventualConsistencyTimeout({
|
|
114
|
+
message: `Timed out after ${formatDuration(duration)}`
|
|
115
|
+
})
|
|
116
|
+
)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function eventually(effect, predicate, opts) {
|
|
120
|
+
const interval = opts.interval ?? "500 millis";
|
|
121
|
+
const poll = Effect.suspend(
|
|
122
|
+
() => effect.pipe(
|
|
123
|
+
Effect.flatMap(
|
|
124
|
+
(a) => predicate(a) ? Effect.succeed(a) : Effect.sleep(interval).pipe(Effect.andThen(poll))
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
return withTimeout(
|
|
129
|
+
poll,
|
|
130
|
+
opts.waitUpTo,
|
|
131
|
+
() => new EventualConsistencyTimeout({
|
|
132
|
+
message: `Eventual consistency timeout after ${formatDuration(opts.waitUpTo)}`
|
|
133
|
+
})
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
var CamundaEffect = class extends Context.Service()(
|
|
137
|
+
"CamundaEffect"
|
|
138
|
+
) {
|
|
139
|
+
};
|
|
140
|
+
function layer(options) {
|
|
141
|
+
return Layer.sync(CamundaEffect, () => createCamundaEffectClient(options));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/effect-worker.ts
|
|
145
|
+
import {
|
|
146
|
+
Cause,
|
|
147
|
+
Data as Data2,
|
|
148
|
+
Duration as Duration2,
|
|
149
|
+
Effect as Effect2,
|
|
150
|
+
Fiber,
|
|
151
|
+
Layer as Layer2,
|
|
152
|
+
Stream
|
|
153
|
+
} from "effect";
|
|
154
|
+
var RetryableJobError = class extends Data2.TaggedError("RetryableJobError") {
|
|
155
|
+
};
|
|
156
|
+
var TerminalJobError = class extends Data2.TaggedError("TerminalJobError") {
|
|
157
|
+
};
|
|
158
|
+
var DEFAULT_MAX_JOBS = 10;
|
|
159
|
+
var DEFAULT_POLL_INTERVAL = "1 second";
|
|
160
|
+
var DEFAULT_JOB_TIMEOUT = "60 seconds";
|
|
161
|
+
var DEFAULT_LONGPOLL_TIMEOUT = 0;
|
|
162
|
+
var _workerCounter = 0;
|
|
163
|
+
function toMillis(d) {
|
|
164
|
+
return Duration2.toMillis(Duration2.fromInputUnsafe(d));
|
|
165
|
+
}
|
|
166
|
+
function activateJobsStream(type, options = {}) {
|
|
167
|
+
const worker = options.workerName ?? `effect-worker-${type}-${++_workerCounter}`;
|
|
168
|
+
const batch = options.maxJobsToActivate ?? DEFAULT_MAX_JOBS;
|
|
169
|
+
const pollInterval = options.pollInterval ?? DEFAULT_POLL_INTERVAL;
|
|
170
|
+
const jobTimeout = options.jobTimeout ?? DEFAULT_JOB_TIMEOUT;
|
|
171
|
+
const requestTimeout = typeof options.requestTimeout === "number" ? options.requestTimeout : options.requestTimeout !== void 0 ? toMillis(options.requestTimeout) : DEFAULT_LONGPOLL_TIMEOUT;
|
|
172
|
+
const body = {
|
|
173
|
+
type,
|
|
174
|
+
worker,
|
|
175
|
+
maxJobsToActivate: batch,
|
|
176
|
+
requestTimeout,
|
|
177
|
+
timeout: toMillis(jobTimeout),
|
|
178
|
+
...options.fetchVariables && options.fetchVariables.length > 0 ? { fetchVariable: [...options.fetchVariables] } : {}
|
|
179
|
+
};
|
|
180
|
+
const pollOnce = Effect2.gen(function* () {
|
|
181
|
+
const camunda = yield* CamundaEffect;
|
|
182
|
+
const result = yield* camunda.activateJobs(body);
|
|
183
|
+
const jobs = result?.jobs ?? [];
|
|
184
|
+
if (jobs.length === 0) yield* Effect2.sleep(pollInterval);
|
|
185
|
+
return jobs;
|
|
186
|
+
});
|
|
187
|
+
const activation = options.activationRetrySchedule ? Effect2.retry(pollOnce, { schedule: options.activationRetrySchedule }) : pollOnce;
|
|
188
|
+
return Stream.fromIterableEffectRepeat(activation);
|
|
189
|
+
}
|
|
190
|
+
function completeJob(job, vars) {
|
|
191
|
+
return Effect2.gen(function* () {
|
|
192
|
+
const camunda = yield* CamundaEffect;
|
|
193
|
+
yield* camunda.completeJob({
|
|
194
|
+
jobKey: job.jobKey,
|
|
195
|
+
variables: vars ?? {},
|
|
196
|
+
...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function failJobRetryable(job, error) {
|
|
201
|
+
return Effect2.gen(function* () {
|
|
202
|
+
const camunda = yield* CamundaEffect;
|
|
203
|
+
yield* camunda.failJob({
|
|
204
|
+
jobKey: job.jobKey,
|
|
205
|
+
errorMessage: error.message,
|
|
206
|
+
retries: Math.max(0, (job.retries ?? 1) - 1),
|
|
207
|
+
...error.retryBackoff !== void 0 ? { retryBackOff: toMillis(error.retryBackoff) } : {},
|
|
208
|
+
...error.variables ? { variables: { ...error.variables } } : {},
|
|
209
|
+
...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
function raiseIncident(job, error) {
|
|
214
|
+
return Effect2.gen(function* () {
|
|
215
|
+
const camunda = yield* CamundaEffect;
|
|
216
|
+
yield* camunda.throwJobError({
|
|
217
|
+
jobKey: job.jobKey,
|
|
218
|
+
errorCode: error.code,
|
|
219
|
+
errorMessage: error.message,
|
|
220
|
+
...error.variables ? { variables: { ...error.variables } } : {},
|
|
221
|
+
...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function releaseLease(job) {
|
|
226
|
+
return Effect2.gen(function* () {
|
|
227
|
+
const camunda = yield* CamundaEffect;
|
|
228
|
+
yield* camunda.failJob({
|
|
229
|
+
jobKey: job.jobKey,
|
|
230
|
+
errorMessage: "worker interrupted; releasing lease for re-activation",
|
|
231
|
+
retries: job.retries ?? 1,
|
|
232
|
+
...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
|
|
233
|
+
});
|
|
234
|
+
}).pipe(Effect2.ignore);
|
|
235
|
+
}
|
|
236
|
+
function failJobOnDefect(job, defect) {
|
|
237
|
+
return Effect2.gen(function* () {
|
|
238
|
+
const camunda = yield* CamundaEffect;
|
|
239
|
+
yield* Effect2.logError(
|
|
240
|
+
`effect-worker: handler for job ${job.jobKey} threw an unexpected defect; failing job with retries - 1`,
|
|
241
|
+
defect
|
|
242
|
+
);
|
|
243
|
+
yield* camunda.failJob({
|
|
244
|
+
jobKey: job.jobKey,
|
|
245
|
+
errorMessage: defect instanceof Error ? defect.message : "Handler error",
|
|
246
|
+
retries: Math.max(0, (job.retries ?? 1) - 1),
|
|
247
|
+
...job.leaseToken != null ? { leaseToken: job.leaseToken } : {}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function processJob(config, job) {
|
|
252
|
+
const handled = config.handlerRetrySchedule ? Effect2.retry(config.handler(job), {
|
|
253
|
+
schedule: config.handlerRetrySchedule,
|
|
254
|
+
while: (e) => e._tag === "RetryableJobError"
|
|
255
|
+
}) : config.handler(job);
|
|
256
|
+
return handled.pipe(
|
|
257
|
+
Effect2.flatMap((vars) => completeJob(job, vars)),
|
|
258
|
+
Effect2.catchTag("RetryableJobError", (e) => failJobRetryable(job, e)),
|
|
259
|
+
Effect2.catchTag("TerminalJobError", (e) => raiseIncident(job, e)),
|
|
260
|
+
// Interruption is re-raised (not a defect) by `onInterrupt` below; only genuine
|
|
261
|
+
// handler defects reach here and are converted to a best-effort failJob.
|
|
262
|
+
Effect2.catchDefect((defect) => failJobOnDefect(job, defect)),
|
|
263
|
+
Effect2.onInterrupt(() => releaseLease(job))
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
function runWorkerLoop(config) {
|
|
267
|
+
const concurrency = config.concurrency ?? config.maxJobsToActivate ?? DEFAULT_MAX_JOBS;
|
|
268
|
+
const maxJobsToActivate = typeof concurrency === "number" ? Math.min(config.maxJobsToActivate ?? DEFAULT_MAX_JOBS, concurrency) : config.maxJobsToActivate;
|
|
269
|
+
return activateJobsStream(config.type, { ...config, maxJobsToActivate }).pipe(
|
|
270
|
+
Stream.mapEffect(
|
|
271
|
+
(job) => (
|
|
272
|
+
// A per-job acknowledgement failure (completeJob/failJob/throwJobError raising a
|
|
273
|
+
// `DomainError`) must not tear down the worker: a transient ack outage on one job
|
|
274
|
+
// would otherwise fail `Stream.runDrain` and stop all processing. Log it and keep
|
|
275
|
+
// going so `join` ends only on a fatal activation error (its documented contract),
|
|
276
|
+
// matching the Promise worker which swallows per-job ack failures. Two causes are
|
|
277
|
+
// re-raised instead of swallowed: a pure interruption (scope close / `interrupt`),
|
|
278
|
+
// so shutdown and the best-effort lease release in `processJob` still propagate;
|
|
279
|
+
// and a genuine defect (`die`), so an unexpected bug surfaces rather than hiding —
|
|
280
|
+
// note handler defects are already converted to a best-effort failJob inside
|
|
281
|
+
// `processJob`, so only truly unexpected defects reach here.
|
|
282
|
+
// NOTE: `Effect.catchAll` is avoided deliberately — under the effect 4.0.0-rc it
|
|
283
|
+
// suppresses `Stream.mapEffect` emission even on the success path; `catchCause`
|
|
284
|
+
// does not.
|
|
285
|
+
processJob(config, job).pipe(
|
|
286
|
+
Effect2.catchCause(
|
|
287
|
+
(cause) => Cause.hasInterruptsOnly(cause) || Cause.hasDies(cause) ? Effect2.failCause(cause) : Effect2.logError(
|
|
288
|
+
`effect-worker[${config.type}]: acknowledging job ${job.jobKey} failed; continuing`,
|
|
289
|
+
cause
|
|
290
|
+
)
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
),
|
|
294
|
+
{ concurrency }
|
|
295
|
+
),
|
|
296
|
+
Stream.runDrain
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
function createCamundaEffectWorker(config) {
|
|
300
|
+
return Effect2.gen(function* () {
|
|
301
|
+
const fiber = yield* Effect2.forkScoped(runWorkerLoop(config));
|
|
302
|
+
return {
|
|
303
|
+
type: config.type,
|
|
304
|
+
join: Fiber.join(fiber),
|
|
305
|
+
interrupt: Fiber.interrupt(fiber).pipe(Effect2.asVoid)
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function workerLayer(config) {
|
|
310
|
+
return Layer2.effectDiscard(createCamundaEffectWorker(config));
|
|
311
|
+
}
|
|
312
|
+
export {
|
|
313
|
+
CamundaEffect,
|
|
314
|
+
CamundaGenericError,
|
|
315
|
+
CamundaValidationError2 as CamundaValidationError,
|
|
316
|
+
EventualConsistencyTimeout,
|
|
317
|
+
HttpError,
|
|
318
|
+
RetryableJobError,
|
|
319
|
+
TerminalJobError,
|
|
320
|
+
activateJobsStream,
|
|
321
|
+
createCamundaEffectClient,
|
|
322
|
+
createCamundaEffectWorker,
|
|
323
|
+
eventually,
|
|
324
|
+
layer,
|
|
325
|
+
retryWithBackoff,
|
|
326
|
+
runWorkerLoop,
|
|
327
|
+
withTimeout,
|
|
328
|
+
workerLayer
|
|
329
|
+
};
|
|
330
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/effect.ts","../../src/effect-worker.ts"],"sourcesContent":["// First-class Effect adapter for the Camunda client.\n//\n// Mirrors the Promise-based `CamundaClient` surface, mapping every method to an\n// `Effect.Effect<Awaited<R>, DomainError, never>` via the same `Proxy` +\n// method-memoization trick the former functional adapter used (it already handles\n// `CancelablePromise`/sync returns via `isPromiseLike`).\n//\n// `effect` is an OPTIONAL peer dependency: importing this module (the `./effect`\n// subpath) is the only way to pull `effect` into the runtime graph. The main `.`\n// entry never imports it, so Promise-first users are never forced to adopt Effect.\n\nimport { Context, Data, Duration, Effect, Layer, Schedule } from 'effect';\nimport { type CamundaClient, type CamundaOptions, createCamundaClient } from './gen/CamundaClient';\nimport {\n EventualConsistencyTimeoutError as RuntimeEventualConsistencyTimeoutError,\n CamundaValidationError as RuntimeValidationError,\n} from './runtime/errors';\n\n// --- Tagged domain errors -------------------------------------------------------\n//\n// Modeled as `Data.TaggedError` classes so callers discriminate with\n// `Effect.catchTag` / `Effect.catchTags` instead of a hand-rolled classification\n// switch. Each carries a stable `_tag` literal.\n\n/** A request/response validation failure surfaced by the SDK. */\nexport class CamundaValidationError extends Data.TaggedError('CamundaValidationError')<{\n readonly side: 'request' | 'response';\n readonly operationId?: string;\n readonly summary: string;\n readonly issues: string[];\n readonly message: string;\n readonly cause?: unknown;\n}> {}\n\n/** An eventual-consistency poll that did not converge within its budget. */\nexport class EventualConsistencyTimeout extends Data.TaggedError('EventualConsistencyTimeout')<{\n readonly attempts?: number;\n readonly elapsedMs?: number;\n readonly message: string;\n readonly cause?: unknown;\n}> {}\n\n/** An HTTP-level failure (non-2xx / transport carrying a status). */\nexport class HttpError extends Data.TaggedError('HttpError')<{\n readonly status?: number;\n readonly body?: unknown;\n readonly message: string;\n readonly cause?: unknown;\n}> {}\n\n/** Any other thrown value that does not map to a more specific tag. */\nexport class CamundaGenericError extends Data.TaggedError('CamundaGenericError')<{\n readonly message: string;\n readonly cause?: unknown;\n}> {}\n\n/** The typed error channel for every Effect the client produces. */\nexport type DomainError =\n | CamundaValidationError\n | EventualConsistencyTimeout\n | HttpError\n | CamundaGenericError;\n\n/** The tag literals of the {@link DomainError} union. */\nexport type DomainErrorTag = DomainError['_tag'];\n\n// Narrow an arbitrary thrown value into the tagged `DomainError` union.\nfunction toDomainError(err: unknown): DomainError {\n if (err instanceof RuntimeValidationError) {\n return new CamundaValidationError({\n side: err.side,\n operationId: err.operationId,\n summary: err.summary,\n issues: err.issues,\n message: err.message,\n cause: err,\n });\n }\n if (err instanceof RuntimeEventualConsistencyTimeoutError) {\n return new EventualConsistencyTimeout({\n attempts: err.attempts,\n elapsedMs: err.elapsedMs,\n message: err.message,\n cause: err,\n });\n }\n const anyErr = err as { status?: unknown; body?: unknown; message?: unknown } | null | undefined;\n if (anyErr && typeof anyErr === 'object' && typeof anyErr.status === 'number') {\n return new HttpError({\n status: anyErr.status,\n body: anyErr.body,\n message: typeof anyErr.message === 'string' ? anyErr.message : `HTTP ${anyErr.status}`,\n cause: err,\n });\n }\n if (err instanceof Error) {\n return new CamundaGenericError({ message: err.message, cause: err });\n }\n return new CamundaGenericError({ message: String(err), cause: err });\n}\n\n// --- Client shape ---------------------------------------------------------------\n\n/** Keys of `C` whose values are callable. */\nexport type FnKeys<C> = { [K in keyof C]: C[K] extends (...a: any) => any ? K : never }[keyof C];\n\n/** Maps every method of `C` to an Effect-returning method, preserving non-fn members. */\nexport type Effectify<C> = {\n [K in FnKeys<C>]: C[K] extends (...a: infer A) => infer R\n ? (...a: A) => Effect.Effect<Awaited<R>, DomainError, never>\n : never;\n} & { inner: C } & { [K in Exclude<keyof C, FnKeys<C>>]: C[K] };\n\n/** The Effect-flavoured Camunda client. Every operation returns an `Effect`. */\nexport type CamundaEffectClient = Effectify<CamundaClient>;\n\n// Runtime detection of promise-like (includes CancelablePromise).\nfunction isPromiseLike<T>(v: unknown): v is Promise<T> {\n return !!v && typeof (v as { then?: unknown }).then === 'function';\n}\n\n/**\n * Create an Effect-flavoured Camunda client.\n *\n * Every `CamundaClient` method becomes `(...args) => Effect.Effect<Awaited<R>,\n * DomainError, never>`. Failures are narrowed into the tagged {@link DomainError}\n * union so callers use `Effect.catchTag`/`catchTags`. The underlying throwing\n * client is reachable via the `.inner` escape hatch.\n *\n * @description Camunda Effect Client. See the README and [this test](https://github.com/camunda/orchestration-cluster-api-js/blob/main/tests-integration/effect.test.ts) for example usage.\n */\nexport function createCamundaEffectClient(options?: CamundaOptions): CamundaEffectClient {\n const base = createCamundaClient(options);\n const cache = new Map<string | symbol, unknown>();\n\n function wrap(fn: (...a: any[]) => any) {\n return (...args: any[]) =>\n Effect.suspend(() => {\n // The generated client can throw *synchronously* (e.g. an eventual\n // endpoint invoked without `consistencyManagement`). Map those to the\n // tagged error channel too, rather than letting them escape as a defect.\n let r: unknown;\n try {\n r = fn.apply(base, args);\n } catch (e) {\n return Effect.fail(toDomainError(e));\n }\n if (!isPromiseLike(r)) return Effect.succeed(r);\n const promise = r;\n return Effect.callback<any, DomainError>((resume) => {\n promise.then(\n (a: unknown) => resume(Effect.succeed(a)),\n (e: unknown) => resume(Effect.fail(toDomainError(e)))\n );\n // Honour Effect interruption: if the fiber is interrupted (e.g. by\n // `withTimeout` or a parent), cancel the underlying `CancelablePromise`\n // so the in-flight HTTP request is aborted instead of leaking.\n const cancel = (r as { cancel?: () => void }).cancel;\n return typeof cancel === 'function' ? Effect.sync(() => cancel.call(r)) : undefined;\n });\n });\n }\n\n const handler: ProxyHandler<any> = {\n get(_t, prop: string | symbol) {\n if (prop === 'inner') return base;\n if (cache.has(prop)) return cache.get(prop);\n const value = (base as any)[prop];\n if (typeof value === 'function') {\n const w = wrap(value);\n cache.set(prop, w);\n return w;\n }\n cache.set(prop, value);\n return value;\n },\n };\n\n return new Proxy({}, handler) as CamundaEffectClient;\n}\n\n// --- Combinators (Effect-native) ------------------------------------------------\n\n/**\n * Human-readable rendering of a `Duration.Input` for error messages. `String()`\n * degrades to `[object Object]` for non-string inputs (millis-numbers, `Duration`\n * values, `[seconds, nanos]` tuples); this normalises them via `Duration.format`.\n */\nfunction formatDuration(d: Duration.Input): string {\n // Only used to build error messages. `fromInputUnsafe` throws on a malformed\n // (but statically typed) Duration.Input, so guard it — a formatting failure\n // must never turn a typed timeout failure into an unexpected defect.\n try {\n return Duration.format(Duration.fromInputUnsafe(d));\n } catch {\n return String(d);\n }\n}\n\n/**\n * Retry an effect with exponential backoff (+ jitter), capped attempts, and an\n * optional predicate over the error.\n */\nexport function retryWithBackoff<A, E, R>(\n effect: Effect.Effect<A, E, R>,\n opts: {\n max: number;\n baseDelay?: Duration.Input;\n while?: (e: E) => boolean;\n }\n): Effect.Effect<A, E, R> {\n const backoff = Schedule.exponential(opts.baseDelay ?? '100 millis').pipe(Schedule.jittered);\n // `times: n` caps at n retries after the initial attempt → n+1 total attempts.\n // (v4 dropped `Schedule.intersect`; the retry options object composes the\n // exponential-backoff schedule with the attempt cap and the error predicate.)\n return Effect.retry(effect, {\n schedule: backoff,\n times: Math.max(0, opts.max - 1),\n while: opts.while,\n });\n}\n\n/**\n * Fail an effect with a real interruption if it does not settle within `duration`\n * (true interruption, not a best-effort `Promise.race`).\n */\nexport function withTimeout<A, E, R>(\n effect: Effect.Effect<A, E, R>,\n duration: Duration.Input,\n onTimeout?: () => E | EventualConsistencyTimeout\n): Effect.Effect<A, E | EventualConsistencyTimeout, R> {\n return Effect.timeoutOrElse(effect, {\n duration,\n orElse: () =>\n Effect.fail(\n onTimeout\n ? onTimeout()\n : new EventualConsistencyTimeout({\n message: `Timed out after ${formatDuration(duration)}`,\n })\n ),\n });\n}\n\n/**\n * Poll `effect` on the Effect `Clock` until `predicate` holds, timing out to\n * {@link EventualConsistencyTimeout} once `waitUpTo` elapses. Because it uses the\n * Effect `Clock` (not `Date.now`/`setTimeout`), `TestClock.adjust` advances it\n * deterministically in tests — no real-clock burn.\n */\nexport function eventually<A, E, R>(\n effect: Effect.Effect<A, E, R>,\n predicate: (a: A) => boolean,\n opts: {\n waitUpTo: Duration.Input;\n interval?: Duration.Input;\n }\n): Effect.Effect<A, E | EventualConsistencyTimeout, R> {\n const interval = opts.interval ?? '500 millis';\n // Poll on the Effect `Clock` (Effect.sleep), returning the value A once the\n // predicate holds. Kept as an Effect-valued loop (not `Effect.repeat` with a\n // schedule, whose success channel is the schedule output, not A).\n const poll: Effect.Effect<A, E, R> = Effect.suspend(() =>\n effect.pipe(\n Effect.flatMap((a) =>\n predicate(a) ? Effect.succeed(a) : Effect.sleep(interval).pipe(Effect.andThen(poll))\n )\n )\n );\n return withTimeout(\n poll,\n opts.waitUpTo,\n () =>\n new EventualConsistencyTimeout({\n message: `Eventual consistency timeout after ${formatDuration(opts.waitUpTo)}`,\n })\n );\n}\n\n// --- Dependency injection -------------------------------------------------------\n\n/**\n * `Context` service key for the Effect Camunda client. Compose worker/orchestration\n * code against this tag and provide {@link layer} (or a test double) via `Layer`.\n */\nexport class CamundaEffect extends Context.Service<CamundaEffect, CamundaEffectClient>()(\n 'CamundaEffect'\n) {}\n\n/**\n * A `Layer` that constructs a {@link CamundaEffectClient} and provides it as the\n * {@link CamundaEffect} service. Swap in a test double by providing a different\n * `Layer` for the same tag.\n */\nexport function layer(options?: CamundaOptions): Layer.Layer<CamundaEffect> {\n return Layer.sync(CamundaEffect, () => createCamundaEffectClient(options));\n}\n","// Effect-native job-worker surface for the Camunda client.\n//\n// Where `./effect` (see `effect.ts`) gives an Effect surface over the *single-call*\n// client (deploy/create/search/…), this adds the Effect surface for **job workers**:\n// the long-running `activateJobs` → handle → `completeJob`/`failJob` loop.\n//\n// It composes over the existing client machinery — activation goes through the same\n// `activateJobs` call (and therefore the same backpressure/retry runtime) as the\n// Promise worker — rather than reimplementing activation. What it adds on top is\n// Effect-native:\n// - a job handler `(job) => Effect<CompleteVars, JobError, R>` with a **typed\n// failure channel** (retryable → `failJob` with decremented retries; terminal →\n// `throwJobError`/incident);\n// - **`Schedule`** for activation backoff and in-handler retry, both running on the\n// Effect `Clock` (so `TestClock` makes their timing virtual in tests);\n// - **`Stream`** with bounded `concurrency` for backpressure over the activation loop;\n// - **`Layer`**/**`Scope`** DI + lifecycle: the worker forks into a scope and is\n// interrupted (with a best-effort lease release) when the scope closes.\n//\n// `effect` remains an OPTIONAL peer dependency: importing this module (via the\n// `./effect` subpath) is the only way to pull `effect` into the runtime graph. The\n// main `.` (Promise) worker API is untouched.\n\nimport {\n Cause,\n Data,\n Duration,\n Effect,\n Fiber,\n Layer,\n type Schedule,\n type Scope,\n Stream,\n} from 'effect';\nimport { CamundaEffect, type DomainError } from './effect';\nimport type { ActivatedJobResult } from './gen/types.gen';\n\n// --- Job shape ------------------------------------------------------------------\n\n/**\n * A single activated job handed to an Effect handler. This is the raw activation\n * payload (variables + custom headers + lifecycle keys); acknowledgement is driven\n * by the value/error the handler's `Effect` produces, not by imperative methods.\n */\nexport type Job = ActivatedJobResult;\n\n/** Variables to complete a job with. `void`/`undefined` completes with no variables. */\n// biome-ignore lint/suspicious/noConfusingVoidType: a handler may complete a job with no variables, i.e. return Effect<void>\nexport type CompleteVars = { readonly [key: string]: unknown } | void | undefined;\n\n// --- Typed job-failure channel --------------------------------------------------\n//\n// A handler discriminates its two failure modes with tagged errors instead of a\n// hand-rolled classification: a **retryable** failure decrements retries and calls\n// `failJob` (optionally after in-handler `Schedule` retries); a **terminal** failure\n// raises a BPMN error / incident via `throwJobError`.\n\n/**\n * A retryable job failure: the handler could not complete the job now, but a later\n * activation might succeed. Mapped to `failJob` with `retries - 1` and an optional\n * server-side re-activation backoff.\n */\nexport class RetryableJobError extends Data.TaggedError('RetryableJobError')<{\n readonly message: string;\n /** Server-side delay before the job becomes re-activatable (`failJob` `retryBackOff`). */\n readonly retryBackoff?: Duration.Input;\n /** Optional variables to attach to the job on failure. */\n readonly variables?: { readonly [key: string]: unknown };\n readonly cause?: unknown;\n}> {}\n\n/**\n * A terminal job failure: retrying will not help. Mapped to `throwJobError`, which\n * is caught by a matching BPMN error boundary event or — if uncaught — raises an\n * incident.\n */\nexport class TerminalJobError extends Data.TaggedError('TerminalJobError')<{\n /** The BPMN error code matched against an error catch event. */\n readonly code: string;\n readonly message: string;\n /** Optional variables to instantiate at the error catch event's scope. */\n readonly variables?: { readonly [key: string]: unknown };\n readonly cause?: unknown;\n}> {}\n\n/** The typed error channel a job handler may fail with. */\nexport type JobError = RetryableJobError | TerminalJobError;\n\n/** A job handler: consumes a {@link Job}, produces completion variables or a {@link JobError}. */\nexport type JobHandler<A extends CompleteVars, R> = (job: Job) => Effect.Effect<A, JobError, R>;\n\n// --- Configuration --------------------------------------------------------------\n\nexport interface ActivateJobsStreamOptions<R = never> {\n /** Worker name recorded on the activation request. Defaults to `effect-worker-<type>-<n>`, where `<n>` is an incrementing per-process counter. */\n readonly workerName?: string;\n /** Max jobs to activate per poll (the activation batch size). Default `10`. */\n readonly maxJobsToActivate?: number;\n /**\n * Delay between polls that returned **no** jobs, on the Effect `Clock` (so it is\n * virtual under `TestClock`). A poll that returns jobs schedules the next poll\n * immediately. Default `1 second`.\n */\n readonly pollInterval?: Duration.Input;\n /** Per-job activation lock timeout (server-side). Default `60 seconds`. */\n readonly jobTimeout?: Duration.Input;\n /**\n * Long-poll request timeout. `0` (the default) lets the broker hold the request\n * for its configured default; a negative value returns immediately when idle.\n */\n readonly requestTimeout?: Duration.Input | number;\n /** Restrict activation to these variable names. */\n readonly fetchVariables?: readonly string[];\n /**\n * `Schedule` used to back off and retry a **failed activation request** (transport\n * outage, broker restart, transient server error). Runs on the Effect `Clock`.\n * When omitted, an activation failure fails the stream.\n */\n readonly activationRetrySchedule?: Schedule.Schedule<unknown, DomainError, never, R>;\n}\n\nexport interface EffectWorkerConfig<A extends CompleteVars, R = never>\n extends ActivateJobsStreamOptions<R> {\n /** The job type to activate. */\n readonly type: string;\n /** The Effect job handler. */\n readonly handler: JobHandler<A, R>;\n /**\n * Max jobs processed concurrently (handler parallelism / backpressure). The\n * activation loop will not pull faster than handlers drain, and the activation\n * batch is capped to this value (when it is a finite number) so the worker never\n * leases more jobs than it can process at once. Default: the value of\n * {@link ActivateJobsStreamOptions.maxJobsToActivate} (or `10`).\n */\n readonly concurrency?: number | 'unbounded';\n /**\n * `Schedule` used to retry the **handler** in-process on a {@link RetryableJobError}\n * before the job is failed back to the broker. Runs on the Effect `Clock`\n * (virtual under `TestClock`). A {@link TerminalJobError} is never retried.\n */\n readonly handlerRetrySchedule?: Schedule.Schedule<unknown, JobError, never, R>;\n}\n\n/** A handle to a running Effect worker. */\nexport interface CamundaEffectWorkerHandle {\n /** The job type this worker activates. */\n readonly type: string;\n /** Completes when the worker loop ends (only on a fatal, non-retryable activation error). */\n readonly join: Effect.Effect<void, DomainError>;\n /** Interrupt the worker (also happens automatically when the owning scope closes). */\n readonly interrupt: Effect.Effect<void>;\n}\n\nconst DEFAULT_MAX_JOBS = 10;\nconst DEFAULT_POLL_INTERVAL: Duration.Input = '1 second';\nconst DEFAULT_JOB_TIMEOUT: Duration.Input = '60 seconds';\nconst DEFAULT_LONGPOLL_TIMEOUT = 0;\n\nlet _workerCounter = 0;\n\nfunction toMillis(d: Duration.Input): number {\n return Duration.toMillis(Duration.fromInputUnsafe(d));\n}\n\n// --- Activation stream ----------------------------------------------------------\n\n/**\n * A `Stream` of activated jobs of `type`. Repeatedly calls `activateJobs` (through the\n * `/effect` client `Layer`, i.e. the same backpressure-aware runtime the Promise worker\n * uses) and emits each activated job. The between-empty-polls delay and the optional\n * activation-retry `Schedule` both run on the Effect `Clock`, so `TestClock.adjust`\n * advances them deterministically in tests.\n */\nexport function activateJobsStream<R = never>(\n type: string,\n options: ActivateJobsStreamOptions<R> = {}\n): Stream.Stream<Job, DomainError, CamundaEffect | R> {\n const worker = options.workerName ?? `effect-worker-${type}-${++_workerCounter}`;\n const batch = options.maxJobsToActivate ?? DEFAULT_MAX_JOBS;\n const pollInterval = options.pollInterval ?? DEFAULT_POLL_INTERVAL;\n const jobTimeout = options.jobTimeout ?? DEFAULT_JOB_TIMEOUT;\n const requestTimeout =\n typeof options.requestTimeout === 'number'\n ? options.requestTimeout\n : options.requestTimeout !== undefined\n ? toMillis(options.requestTimeout)\n : DEFAULT_LONGPOLL_TIMEOUT;\n\n const body = {\n type,\n worker,\n maxJobsToActivate: batch,\n requestTimeout,\n timeout: toMillis(jobTimeout),\n ...(options.fetchVariables && options.fetchVariables.length > 0\n ? { fetchVariable: [...options.fetchVariables] }\n : {}),\n };\n\n const pollOnce: Effect.Effect<Job[], DomainError, CamundaEffect> = Effect.gen(function* () {\n const camunda = yield* CamundaEffect;\n const result = yield* camunda.activateJobs(body);\n const jobs = (result?.jobs ?? []) as Job[];\n // Empty poll → wait on the Effect Clock before the next activation (virtual under\n // TestClock). A non-empty poll proceeds immediately; downstream `concurrency`\n // provides the backpressure.\n if (jobs.length === 0) yield* Effect.sleep(pollInterval);\n return jobs;\n });\n\n const activation: Effect.Effect<Job[], DomainError, CamundaEffect | R> =\n options.activationRetrySchedule\n ? Effect.retry(pollOnce, { schedule: options.activationRetrySchedule })\n : pollOnce;\n\n return Stream.fromIterableEffectRepeat(activation);\n}\n\n// --- Worker loop ----------------------------------------------------------------\n\nfunction completeJob<A extends CompleteVars>(\n job: Job,\n vars: A\n): Effect.Effect<void, DomainError, CamundaEffect> {\n return Effect.gen(function* () {\n const camunda = yield* CamundaEffect;\n yield* camunda.completeJob({\n jobKey: job.jobKey,\n variables: (vars ?? {}) as { [key: string]: unknown },\n ...(job.leaseToken != null ? { leaseToken: job.leaseToken } : {}),\n });\n });\n}\n\nfunction failJobRetryable(\n job: Job,\n error: RetryableJobError\n): Effect.Effect<void, DomainError, CamundaEffect> {\n return Effect.gen(function* () {\n const camunda = yield* CamundaEffect;\n yield* camunda.failJob({\n jobKey: job.jobKey,\n errorMessage: error.message,\n retries: Math.max(0, (job.retries ?? 1) - 1),\n ...(error.retryBackoff !== undefined ? { retryBackOff: toMillis(error.retryBackoff) } : {}),\n ...(error.variables ? { variables: { ...error.variables } } : {}),\n ...(job.leaseToken != null ? { leaseToken: job.leaseToken } : {}),\n });\n });\n}\n\nfunction raiseIncident(\n job: Job,\n error: TerminalJobError\n): Effect.Effect<void, DomainError, CamundaEffect> {\n return Effect.gen(function* () {\n const camunda = yield* CamundaEffect;\n yield* camunda.throwJobError({\n jobKey: job.jobKey,\n errorCode: error.code,\n errorMessage: error.message,\n ...(error.variables ? { variables: { ...error.variables } } : {}),\n ...(job.leaseToken != null ? { leaseToken: job.leaseToken } : {}),\n });\n });\n}\n\n// On interruption mid-handling, release the lease by failing the job back with its\n// retries **unchanged** so it re-activates promptly instead of waiting for the lock\n// to expire. Best-effort: a failure here (e.g. shutdown racing the HTTP call) is\n// swallowed so it cannot turn interruption into a defect.\nfunction releaseLease(job: Job): Effect.Effect<void, never, CamundaEffect> {\n return Effect.gen(function* () {\n const camunda = yield* CamundaEffect;\n yield* camunda.failJob({\n jobKey: job.jobKey,\n errorMessage: 'worker interrupted; releasing lease for re-activation',\n retries: job.retries ?? 1,\n ...(job.leaseToken != null ? { leaseToken: job.leaseToken } : {}),\n });\n }).pipe(Effect.ignore);\n}\n\n// An unexpected handler *defect* (an untyped throw / `Effect.die`, not a typed\n// `JobError`) is a bug, not a modelled outcome. Rather than let it be swallowed by the\n// worker-loop cause handler — which would leave the job unacknowledged until its\n// server-side lock expires (risking duplicate delivery) and hide the bug — translate it\n// into a best-effort `failJob` with `retries - 1`, matching the Promise worker\n// (`src/runtime/jobWorker.ts`). The defect is logged first so the handler bug stays\n// visible. This raises a `DomainError` on the ack channel if `failJob` itself fails,\n// which the worker loop then logs-and-continues like any other ack failure.\nfunction failJobOnDefect(\n job: Job,\n defect: unknown\n): Effect.Effect<void, DomainError, CamundaEffect> {\n return Effect.gen(function* () {\n const camunda = yield* CamundaEffect;\n yield* Effect.logError(\n `effect-worker: handler for job ${job.jobKey} threw an unexpected defect; failing job with retries - 1`,\n defect\n );\n yield* camunda.failJob({\n jobKey: job.jobKey,\n errorMessage: defect instanceof Error ? defect.message : 'Handler error',\n retries: Math.max(0, (job.retries ?? 1) - 1),\n ...(job.leaseToken != null ? { leaseToken: job.leaseToken } : {}),\n });\n });\n}\n\nfunction processJob<A extends CompleteVars, R>(\n config: EffectWorkerConfig<A, R>,\n job: Job\n): Effect.Effect<void, DomainError, CamundaEffect | R> {\n const handled: Effect.Effect<A, JobError, R> = config.handlerRetrySchedule\n ? Effect.retry(config.handler(job), {\n schedule: config.handlerRetrySchedule,\n while: (e: JobError) => e._tag === 'RetryableJobError',\n })\n : config.handler(job);\n\n return handled.pipe(\n Effect.flatMap((vars) => completeJob(job, vars)),\n Effect.catchTag('RetryableJobError', (e) => failJobRetryable(job, e)),\n Effect.catchTag('TerminalJobError', (e) => raiseIncident(job, e)),\n // Interruption is re-raised (not a defect) by `onInterrupt` below; only genuine\n // handler defects reach here and are converted to a best-effort failJob.\n Effect.catchDefect((defect) => failJobOnDefect(job, defect)),\n Effect.onInterrupt(() => releaseLease(job))\n );\n}\n\n/**\n * The worker loop: drains {@link activateJobsStream}, running the handler for each job\n * with bounded `concurrency` (the backpressure knob), and acknowledging via\n * `completeJob`/`failJob`/`throwJobError` per the handler's typed outcome.\n */\nexport function runWorkerLoop<A extends CompleteVars, R = never>(\n config: EffectWorkerConfig<A, R>\n): Effect.Effect<void, DomainError, CamundaEffect | R> {\n const concurrency = config.concurrency ?? config.maxJobsToActivate ?? DEFAULT_MAX_JOBS;\n // Never lease more jobs per poll than we can process concurrently. Jobs activated\n // beyond `concurrency` would sit buffered in the stream while their server-side lock\n // timeout counts down, risking lock expiry / duplicate delivery (and stale-lease\n // rejections). Cap the activation batch to `concurrency` when it is a finite number,\n // matching the Promise worker's headroom-bounded activation. When `concurrency` is\n // `'unbounded'`, leave the batch as configured.\n const maxJobsToActivate =\n typeof concurrency === 'number'\n ? Math.min(config.maxJobsToActivate ?? DEFAULT_MAX_JOBS, concurrency)\n : config.maxJobsToActivate;\n return activateJobsStream<R>(config.type, { ...config, maxJobsToActivate }).pipe(\n Stream.mapEffect(\n (job) =>\n // A per-job acknowledgement failure (completeJob/failJob/throwJobError raising a\n // `DomainError`) must not tear down the worker: a transient ack outage on one job\n // would otherwise fail `Stream.runDrain` and stop all processing. Log it and keep\n // going so `join` ends only on a fatal activation error (its documented contract),\n // matching the Promise worker which swallows per-job ack failures. Two causes are\n // re-raised instead of swallowed: a pure interruption (scope close / `interrupt`),\n // so shutdown and the best-effort lease release in `processJob` still propagate;\n // and a genuine defect (`die`), so an unexpected bug surfaces rather than hiding —\n // note handler defects are already converted to a best-effort failJob inside\n // `processJob`, so only truly unexpected defects reach here.\n // NOTE: `Effect.catchAll` is avoided deliberately — under the effect 4.0.0-rc it\n // suppresses `Stream.mapEffect` emission even on the success path; `catchCause`\n // does not.\n processJob(config, job).pipe(\n Effect.catchCause((cause) =>\n Cause.hasInterruptsOnly(cause) || Cause.hasDies(cause)\n ? Effect.failCause(cause)\n : Effect.logError(\n `effect-worker[${config.type}]: acknowledging job ${job.jobKey} failed; continuing`,\n cause\n )\n )\n ),\n { concurrency }\n ),\n Stream.runDrain\n );\n}\n\n/**\n * Create and start an Effect job worker, forked into the current `Scope`. The worker\n * runs until its scope closes (or {@link CamundaEffectWorkerHandle.interrupt} is run),\n * at which point it is interrupted and any in-flight job's lease is released.\n *\n * Depends on the {@link CamundaEffect} service — provide the `/effect` client `layer`.\n *\n * @description Camunda Effect Worker. See the README and [this test](https://github.com/camunda/orchestration-cluster-api-js/blob/main/tests-integration/effect-worker.test.ts) for example usage.\n */\nexport function createCamundaEffectWorker<A extends CompleteVars, R = never>(\n config: EffectWorkerConfig<A, R>\n): Effect.Effect<CamundaEffectWorkerHandle, never, Scope.Scope | CamundaEffect | R> {\n return Effect.gen(function* () {\n const fiber = yield* Effect.forkScoped(runWorkerLoop(config));\n return {\n type: config.type,\n join: Fiber.join(fiber),\n interrupt: Fiber.interrupt(fiber).pipe(Effect.asVoid),\n } satisfies CamundaEffectWorkerHandle;\n });\n}\n\n/**\n * A `Layer` that runs a Camunda Effect worker for the layer's lifetime. Compose it\n * with the `/effect` client `layer` (which provides its {@link CamundaEffect}\n * dependency) plus a `Layer` for the handler's own requirements `R`.\n */\nexport function workerLayer<A extends CompleteVars, R = never>(\n config: EffectWorkerConfig<A, R>\n): Layer.Layer<never, never, CamundaEffect | R> {\n return Layer.effectDiscard(createCamundaEffectWorker(config));\n}\n"],"mappings":";;;;;;;;;AAWA,SAAS,SAAS,MAAM,UAAU,QAAQ,OAAO,gBAAgB;AAc1D,IAAMA,0BAAN,cAAqC,KAAK,YAAY,wBAAwB,EAOlF;AAAC;AAGG,IAAM,6BAAN,cAAyC,KAAK,YAAY,4BAA4B,EAK1F;AAAC;AAGG,IAAM,YAAN,cAAwB,KAAK,YAAY,WAAW,EAKxD;AAAC;AAGG,IAAM,s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EAAE,GAAG,QAAQ,kBAAkB,CAAC,EAAE;AAAA,IAC1E,OAAO;AAAA,MACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAcC,WAAW,QAAQ,GAAG,EAAE;AAAA,UACtBA,QAAO;AAAA,YAAW,CAAC,UACjB,MAAM,kBAAkB,KAAK,KAAK,MAAM,QAAQ,KAAK,IACjDA,QAAO,UAAU,KAAK,IACtBA,QAAO;AAAA,cACL,iBAAiB,OAAO,IAAI,wBAAwB,IAAI,MAAM;AAAA,cAC9D;AAAA,YACF;AAAA,UACN;AAAA,QACF;AAAA;AAAA,MACF,EAAE,YAAY;AAAA,IAChB;AAAA,IACA,OAAO;AAAA,EACT;AACF;AAWO,SAAS,0BACd,QACkF;AAClF,SAAOA,QAAO,IAAI,aAAa;AAC7B,UAAM,QAAQ,OAAOA,QAAO,WAAW,cAAc,MAAM,CAAC;AAC5D,WAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,MAAM,MAAM,KAAK,KAAK;AAAA,MACtB,WAAW,MAAM,UAAU,KAAK,EAAE,KAAKA,QAAO,MAAM;AAAA,IACtD;AAAA,EACF,CAAC;AACH;AAOO,SAAS,YACd,QAC8C;AAC9C,SAAOC,OAAM,cAAc,0BAA0B,MAAM,CAAC;AAC9D;","names":["CamundaValidationError","Data","Duration","Effect","Layer","Data","Duration","Effect","Layer"]}
|
package/dist/index.cjs
CHANGED
|
@@ -6473,7 +6473,7 @@ var init_zod_gen = __esm({
|
|
|
6473
6473
|
}));
|
|
6474
6474
|
zSecretResolveRequest = z.object({
|
|
6475
6475
|
references: z.array(z.string().max(256).register(z.globalRegistry, {
|
|
6476
|
-
description: "A secret reference of the form `camunda.secrets.<name
|
|
6476
|
+
description: "A secret reference of the form `camunda.secrets.<name>`, where `<name>` is a\nnon-empty token of letters, digits, `_` and `-`. A reference outside that form is\nreported in `errors` with `INVALID_REFERENCE` rather than failing the request.\n"
|
|
6477
6477
|
})).max(20).register(z.globalRegistry, {
|
|
6478
6478
|
description: "The secret references to resolve, each of the form `camunda.secrets.<name>`.\nDuplicate references are deduplicated by the server and resolved once.\nAt most 20 references may be requested in a single batch.\n"
|
|
6479
6479
|
})
|
|
@@ -9316,13 +9316,10 @@ __export(index_exports, {
|
|
|
9316
9316
|
collectTypedVariables: () => collectTypedVariables,
|
|
9317
9317
|
createCamundaClient: () => createCamundaClient,
|
|
9318
9318
|
createCamundaClientLoose: () => createCamundaClientLoose,
|
|
9319
|
-
createCamundaFpClient: () => createCamundaFpClient,
|
|
9320
9319
|
createCamundaResultClient: () => createCamundaResultClient,
|
|
9321
9320
|
default: () => index_default,
|
|
9322
9321
|
isErr: () => isErr,
|
|
9323
|
-
isLeft: () => isLeft,
|
|
9324
9322
|
isOk: () => isOk,
|
|
9325
|
-
isRight: () => isRight,
|
|
9326
9323
|
isSdkError: () => isSdkError,
|
|
9327
9324
|
variableNamesFromSchema: () => variableNamesFromSchema
|
|
9328
9325
|
});
|
|
@@ -13878,7 +13875,7 @@ function createLogger(opts = {}) {
|
|
|
13878
13875
|
}
|
|
13879
13876
|
|
|
13880
13877
|
// src/runtime/version.ts
|
|
13881
|
-
var packageVersion = "10.0.0-alpha.
|
|
13878
|
+
var packageVersion = "10.0.0-alpha.32";
|
|
13882
13879
|
|
|
13883
13880
|
// src/runtime/supportLogger.ts
|
|
13884
13881
|
var NoopSupportLogger = class {
|
|
@@ -14334,18 +14331,18 @@ function unwrapForInspection(s) {
|
|
|
14334
14331
|
continue;
|
|
14335
14332
|
}
|
|
14336
14333
|
if (t === "ZodIntersection") {
|
|
14337
|
-
const
|
|
14338
|
-
const
|
|
14339
|
-
if (
|
|
14334
|
+
const left = cur._def.left;
|
|
14335
|
+
const right = cur._def.right;
|
|
14336
|
+
if (left?._def?.typeName === "ZodObject" && right?._def?.typeName === "ZodObject") {
|
|
14340
14337
|
try {
|
|
14341
|
-
const leftShapeFn =
|
|
14342
|
-
const rightShapeFn =
|
|
14338
|
+
const leftShapeFn = left._def.shape;
|
|
14339
|
+
const rightShapeFn = right._def.shape;
|
|
14343
14340
|
const merged = { ...leftShapeFn(), ...rightShapeFn() };
|
|
14344
14341
|
return import_zod.ZodObject.create(merged);
|
|
14345
14342
|
} catch {
|
|
14346
14343
|
}
|
|
14347
14344
|
}
|
|
14348
|
-
cur =
|
|
14345
|
+
cur = left;
|
|
14349
14346
|
continue;
|
|
14350
14347
|
}
|
|
14351
14348
|
break;
|
|
@@ -30064,54 +30061,8 @@ function createCamundaClientLoose(...args) {
|
|
|
30064
30061
|
return strict;
|
|
30065
30062
|
}
|
|
30066
30063
|
|
|
30067
|
-
// src/fp-ts.ts
|
|
30068
|
-
var left = (e) => ({ _tag: "Left", left: e });
|
|
30069
|
-
var right = (a) => ({ _tag: "Right", right: a });
|
|
30070
|
-
var isLeft = (e) => e._tag === "Left";
|
|
30071
|
-
var isRight = (e) => e._tag === "Right";
|
|
30072
|
-
function toDomainError(err) {
|
|
30073
|
-
if (err instanceof CamundaValidationError) return err;
|
|
30074
|
-
if (err instanceof EventualConsistencyTimeoutError) return err;
|
|
30075
|
-
if (err instanceof Error) return err;
|
|
30076
|
-
if (typeof err === "object") return err;
|
|
30077
|
-
return { message: String(err) };
|
|
30078
|
-
}
|
|
30079
|
-
function isPromiseLike(v) {
|
|
30080
|
-
return v && typeof v.then === "function";
|
|
30081
|
-
}
|
|
30082
|
-
function createCamundaFpClient(options) {
|
|
30083
|
-
const base = createCamundaClient(options);
|
|
30084
|
-
const cache = /* @__PURE__ */ new Map();
|
|
30085
|
-
function wrap(fn) {
|
|
30086
|
-
return (...args) => async () => {
|
|
30087
|
-
try {
|
|
30088
|
-
const r = fn.apply(base, args);
|
|
30089
|
-
const val = isPromiseLike(r) ? await r : r;
|
|
30090
|
-
return right(val);
|
|
30091
|
-
} catch (e) {
|
|
30092
|
-
return left(toDomainError(e));
|
|
30093
|
-
}
|
|
30094
|
-
};
|
|
30095
|
-
}
|
|
30096
|
-
const handler = {
|
|
30097
|
-
get(_t, prop) {
|
|
30098
|
-
if (prop === "inner") return base;
|
|
30099
|
-
if (cache.has(prop)) return cache.get(prop);
|
|
30100
|
-
const value = base[prop];
|
|
30101
|
-
if (typeof value === "function") {
|
|
30102
|
-
const w = wrap(value);
|
|
30103
|
-
cache.set(prop, w);
|
|
30104
|
-
return w;
|
|
30105
|
-
}
|
|
30106
|
-
cache.set(prop, value);
|
|
30107
|
-
return value;
|
|
30108
|
-
}
|
|
30109
|
-
};
|
|
30110
|
-
return new Proxy({}, handler);
|
|
30111
|
-
}
|
|
30112
|
-
|
|
30113
30064
|
// src/gen/specHash.ts
|
|
30114
|
-
var SPEC_HASH = "sha256:
|
|
30065
|
+
var SPEC_HASH = "sha256:26f148434b44532d51a65c5cedc96032ac6c39ef3f8733f1b76d51dbe7e9055d";
|
|
30115
30066
|
|
|
30116
30067
|
// src/gen/types.gen.ts
|
|
30117
30068
|
var AgentDefinitionTypeEnum = {
|
|
@@ -31464,12 +31415,9 @@ var index_default = createCamundaClient;
|
|
|
31464
31415
|
collectTypedVariables,
|
|
31465
31416
|
createCamundaClient,
|
|
31466
31417
|
createCamundaClientLoose,
|
|
31467
|
-
createCamundaFpClient,
|
|
31468
31418
|
createCamundaResultClient,
|
|
31469
31419
|
isErr,
|
|
31470
|
-
isLeft,
|
|
31471
31420
|
isOk,
|
|
31472
|
-
isRight,
|
|
31473
31421
|
isSdkError,
|
|
31474
31422
|
variableNamesFromSchema
|
|
31475
31423
|
});
|