@camunda8/orchestration-cluster-api 8.9.0-alpha.23 → 8.9.0-alpha.24
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 +7 -0
- package/README.md +62 -44
- package/dist/{chunk-W7A45XXW.js → chunk-CSVBQQ42.js} +2 -2
- package/dist/{chunk-W7A45XXW.js.map → chunk-CSVBQQ42.js.map} +1 -1
- package/dist/fp/index.cjs +1 -1
- package/dist/fp/index.cjs.map +1 -1
- package/dist/fp/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [8.9.0-alpha.24](https://github.com/camunda/orchestration-cluster-api-js/compare/v8.9.0-alpha.23...v8.9.0-alpha.24) (2026-03-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* harden README code injection ([4745468](https://github.com/camunda/orchestration-cluster-api-js/commit/47454684f052027e1449367204e7097b2b26f271)), closes [#87](https://github.com/camunda/orchestration-cluster-api-js/issues/87)
|
|
7
|
+
|
|
1
8
|
# [8.9.0-alpha.23](https://github.com/camunda/orchestration-cluster-api-js/compare/v8.9.0-alpha.22...v8.9.0-alpha.23) (2026-03-30)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ In the vast majority of use-cases, this will not be an issue; but you should be
|
|
|
54
54
|
|
|
55
55
|
Keep configuration out of application code. Let the factory read `CAMUNDA_*` variables from the environment (12‑factor style). This makes rotation, secret management, and environment promotion safer & simpler.
|
|
56
56
|
|
|
57
|
-
<!-- snippet:ReadmeDefaultImport+ReadmeQuickStart -->
|
|
57
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeDefaultImport+ReadmeQuickStart -->
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
60
|
import createCamundaClient from '@camunda8/orchestration-cluster-api';
|
|
@@ -96,7 +96,7 @@ CAMUNDA_SDK_HTTP_RETRY_MAX_DELAY_MS=2000 # optional: cap (ms)
|
|
|
96
96
|
|
|
97
97
|
Use only when you must supply or mutate configuration dynamically (e.g. multi‑tenant routing, tests, ephemeral preview environments) or in the browser. Keys mirror their `CAMUNDA_*` env names.
|
|
98
98
|
|
|
99
|
-
<!-- snippet:ReadmeOverrides -->
|
|
99
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeOverrides -->
|
|
100
100
|
|
|
101
101
|
```ts
|
|
102
102
|
const camunda = createCamundaClient({
|
|
@@ -113,7 +113,7 @@ const camunda = createCamundaClient({
|
|
|
113
113
|
|
|
114
114
|
Inject a custom `fetch` to add tracing, mock responses, instrumentation, circuit breakers, etc.
|
|
115
115
|
|
|
116
|
-
<!-- snippet:ReadmeCustomFetch -->
|
|
116
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeCustomFetch -->
|
|
117
117
|
|
|
118
118
|
```ts
|
|
119
119
|
const camunda = createCamundaClient({
|
|
@@ -166,7 +166,7 @@ Every API method accepts an optional trailing `options` parameter that lets you
|
|
|
166
166
|
|
|
167
167
|
### Disable Retry for a Single Call
|
|
168
168
|
|
|
169
|
-
<!-- snippet:ReadmeDisableRetry -->
|
|
169
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeDisableRetry -->
|
|
170
170
|
|
|
171
171
|
```ts
|
|
172
172
|
// This call will not retry on transient errors
|
|
@@ -177,7 +177,7 @@ await camunda.completeJob({ jobKey }, { retry: false });
|
|
|
177
177
|
|
|
178
178
|
Pass a partial `HttpRetryPolicy` to override individual fields. Unspecified fields inherit from the global configuration.
|
|
179
179
|
|
|
180
|
-
<!-- snippet:ReadmeRetryOverride -->
|
|
180
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeRetryOverride -->
|
|
181
181
|
|
|
182
182
|
```ts
|
|
183
183
|
// More aggressive retry for this operation only
|
|
@@ -224,6 +224,7 @@ Set `CAMUNDA_SDK_HTTP_RETRY_MAX_ATTEMPTS=1` so the SDK does only the initial att
|
|
|
224
224
|
|
|
225
225
|
### Minimal Example (Single Operation)
|
|
226
226
|
|
|
227
|
+
<!-- snippet-exempt: uses external cockatiel library -->
|
|
227
228
|
```ts
|
|
228
229
|
import { createCamundaClient } from '@camunda8/orchestration-cluster-api';
|
|
229
230
|
import { retry, ExponentialBackoff, handleAll } from 'cockatiel';
|
|
@@ -252,6 +253,7 @@ console.log(topo.brokers?.length);
|
|
|
252
253
|
|
|
253
254
|
### Bulk Wrapping All Operations
|
|
254
255
|
|
|
256
|
+
<!-- snippet-exempt: uses external cockatiel library -->
|
|
255
257
|
```ts
|
|
256
258
|
import { createCamundaClient } from '@camunda8/orchestration-cluster-api';
|
|
257
259
|
import { retry, ExponentialBackoff, handleAll } from 'cockatiel';
|
|
@@ -330,6 +332,7 @@ Refer to `./docs/CONFIG_REFERENCE.md` for the full list of related environment v
|
|
|
330
332
|
|
|
331
333
|
Retry only network errors + 429/503, plus optionally 500 on safe GET endpoints you mark:
|
|
332
334
|
|
|
335
|
+
<!-- snippet-exempt: uses external cockatiel library -->
|
|
333
336
|
```ts
|
|
334
337
|
import { retry, ExponentialBackoff, handleWhen } from 'cockatiel';
|
|
335
338
|
|
|
@@ -474,7 +477,7 @@ The SDK provides a lightweight polling job worker for service task job types usi
|
|
|
474
477
|
|
|
475
478
|
### Minimal Example
|
|
476
479
|
|
|
477
|
-
<!-- snippet:ReadmeJobWorkerImport+ReadmeJobWorkerMinimal -->
|
|
480
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeJobWorkerImport+ReadmeJobWorkerMinimal -->
|
|
478
481
|
|
|
479
482
|
```ts
|
|
480
483
|
import createCamundaClient from '@camunda8/orchestration-cluster-api';
|
|
@@ -521,7 +524,7 @@ TypeScript inference:
|
|
|
521
524
|
|
|
522
525
|
- When you provide `inputSchema`, the type of `fetchVariables` is constrained to the keys of the inferred `variables` type from that schema. Example:
|
|
523
526
|
|
|
524
|
-
<!-- snippet:ReadmeJobWorkerInference -->
|
|
527
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeJobWorkerInference -->
|
|
525
528
|
|
|
526
529
|
```ts
|
|
527
530
|
const Input = z.object({ orderId: z.string(), amount: z.number() });
|
|
@@ -567,26 +570,25 @@ Recommended usage:
|
|
|
567
570
|
|
|
568
571
|
Example patterns:
|
|
569
572
|
|
|
573
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeJobCompletionPatterns -->
|
|
570
574
|
```ts
|
|
571
575
|
// GOOD: explicit completion
|
|
572
|
-
return job.complete({ processed: true });
|
|
576
|
+
return job.complete({ variables: { processed: true } });
|
|
577
|
+
|
|
578
|
+
// GOOD: No-arg completion example, sentinel stored for ultimate return
|
|
573
579
|
const ack = await job.complete();
|
|
574
580
|
// ...
|
|
575
581
|
return ack;
|
|
576
582
|
|
|
577
583
|
// GOOD: explicit ignore
|
|
578
|
-
const
|
|
579
|
-
```
|
|
580
|
-
|
|
581
|
-
```ts
|
|
582
|
-
// No-arg completion example
|
|
584
|
+
const ack2 = await job.ignore();
|
|
583
585
|
```
|
|
584
586
|
|
|
585
587
|
### Job Corrections (User Task Listeners)
|
|
586
588
|
|
|
587
589
|
When a job worker handles a [user task listener](https://docs.camunda.io/docs/components/concepts/user-task-listeners/), it can correct task properties (assignee, due date, candidate groups, etc.) by passing a `result` to `job.complete()`:
|
|
588
590
|
|
|
589
|
-
<!-- snippet:ReadmeJobCorrectionsImport+ReadmeJobCorrections -->
|
|
591
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeJobCorrectionsImport+ReadmeJobCorrections -->
|
|
590
592
|
|
|
591
593
|
```ts
|
|
592
594
|
import type { JobResult } from '@camunda8/orchestration-cluster-api';
|
|
@@ -610,7 +612,7 @@ const worker = client.createJobWorker({
|
|
|
610
612
|
|
|
611
613
|
To deny a task completion (reject the work):
|
|
612
614
|
|
|
613
|
-
<!-- snippet:ReadmeJobCorrectionsDenial -->
|
|
615
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeJobCorrectionsDenial -->
|
|
614
616
|
|
|
615
617
|
```ts
|
|
616
618
|
return job.complete(
|
|
@@ -650,7 +652,7 @@ If `validateSchemas` is true:
|
|
|
650
652
|
|
|
651
653
|
Use `await worker.stopGracefully({ waitUpToMs?, checkIntervalMs? })` to drain without force‑cancelling the current activation request.
|
|
652
654
|
|
|
653
|
-
<!-- snippet:ReadmeJobWorkerGraceful -->
|
|
655
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeJobWorkerGraceful -->
|
|
654
656
|
|
|
655
657
|
```ts
|
|
656
658
|
// Attempt graceful drain for up to 8 seconds
|
|
@@ -679,7 +681,7 @@ You can register multiple workers on a single client instance—one per job type
|
|
|
679
681
|
|
|
680
682
|
When deploying multiple application instances simultaneously (e.g. a rolling restart or scale-up), all workers start polling at the same time and can saturate the server with activation requests. Set `startupJitterMaxSeconds` to spread out the initial poll across a random window:
|
|
681
683
|
|
|
682
|
-
<!-- snippet:ReadmeJobWorkerJitter -->
|
|
684
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeJobWorkerJitter -->
|
|
683
685
|
|
|
684
686
|
```ts
|
|
685
687
|
client.createJobWorker({
|
|
@@ -715,7 +717,7 @@ export CAMUNDA_WORKER_MAX_CONCURRENT_JOBS=8
|
|
|
715
717
|
export CAMUNDA_WORKER_NAME=order-service
|
|
716
718
|
```
|
|
717
719
|
|
|
718
|
-
<!-- snippet:ReadmeWorkerDefaultsEnv -->
|
|
720
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeWorkerDefaultsEnv -->
|
|
719
721
|
```ts
|
|
720
722
|
// Workers inherit timeout, concurrency, and name from environment
|
|
721
723
|
const w1 = client.createJobWorker({
|
|
@@ -738,7 +740,7 @@ const w3 = client.createJobWorker({
|
|
|
738
740
|
|
|
739
741
|
You can also pass defaults programmatically via the client constructor:
|
|
740
742
|
|
|
741
|
-
<!-- snippet:ReadmeWorkerDefaultsClient -->
|
|
743
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeWorkerDefaultsClient -->
|
|
742
744
|
```ts
|
|
743
745
|
const client = createCamundaClient({
|
|
744
746
|
config: {
|
|
@@ -752,7 +754,7 @@ const client = createCamundaClient({
|
|
|
752
754
|
|
|
753
755
|
Action methods return a unique symbol (not a string) to avoid accidental misuse and allow internal metrics. If you store the receipt, annotate its type as `JobActionReceipt` to preserve uniqueness:
|
|
754
756
|
|
|
755
|
-
<!-- snippet:ReadmeReceiptImport+ReadmeReceipt -->
|
|
757
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeReceiptImport+ReadmeReceipt -->
|
|
756
758
|
|
|
757
759
|
```ts
|
|
758
760
|
import type { JobActionReceipt } from '@camunda8/orchestration-cluster-api';
|
|
@@ -790,14 +792,14 @@ This reverts to only per‑request retry for transient errors (no global gating)
|
|
|
790
792
|
|
|
791
793
|
Call `client.getBackpressureState()` to obtain:
|
|
792
794
|
|
|
795
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeBackpressureState -->
|
|
793
796
|
```ts
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
}
|
|
797
|
+
const state = client.getBackpressureState();
|
|
798
|
+
// state.severity: 'healthy' | 'soft' | 'severe'
|
|
799
|
+
// state.consecutive: number — consecutive backpressure signals observed
|
|
800
|
+
// state.permitsMax: number | null — current concurrency cap (null => unlimited/not engaged)
|
|
801
|
+
// state.permitsCurrent: number — currently acquired permits
|
|
802
|
+
// state.waiters: number — queued operations waiting for a permit
|
|
801
803
|
```
|
|
802
804
|
|
|
803
805
|
### Threaded Job Workers (Node.js Only)
|
|
@@ -816,6 +818,7 @@ If your handler is mostly I/O-bound (HTTP calls, database queries), the standard
|
|
|
816
818
|
|
|
817
819
|
The handler must be a **separate file** (not an inline function) that exports a default async function:
|
|
818
820
|
|
|
821
|
+
<!-- snippet-exempt: pseudo-code referencing heavyComputation which cannot be type-checked -->
|
|
819
822
|
```ts
|
|
820
823
|
// my-handler.ts (or my-handler.js)
|
|
821
824
|
import type { ThreadedJobHandler } from '@camunda8/orchestration-cluster-api';
|
|
@@ -838,7 +841,7 @@ The handler receives two arguments:
|
|
|
838
841
|
|
|
839
842
|
#### Minimal example
|
|
840
843
|
|
|
841
|
-
<!-- snippet:ReadmeThreadedWorkerImport+ReadmeThreadedWorker -->
|
|
844
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeThreadedWorkerImport+ReadmeThreadedWorker -->
|
|
842
845
|
|
|
843
846
|
```ts
|
|
844
847
|
import createCamundaClient from '@camunda8/orchestration-cluster-api';
|
|
@@ -870,19 +873,24 @@ Other familiar options: `jobType`, `maxParallelJobs`, `jobTimeoutMs`, `pollInter
|
|
|
870
873
|
|
|
871
874
|
Threaded workers integrate with the same lifecycle as regular workers:
|
|
872
875
|
|
|
876
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeThreadedLifecycle -->
|
|
873
877
|
```ts
|
|
874
878
|
// Returned by getWorkers()
|
|
875
879
|
const allWorkers = client.getWorkers();
|
|
876
880
|
|
|
877
881
|
// Stopped by stopAllWorkers()
|
|
878
882
|
client.stopAllWorkers();
|
|
883
|
+
```
|
|
879
884
|
|
|
885
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeThreadedGraceful -->
|
|
886
|
+
```ts
|
|
880
887
|
// Graceful shutdown (waits for in-flight jobs to finish)
|
|
881
888
|
const { timedOut, remainingJobs } = await worker.stopGracefully({ waitUpToMs: 10_000 });
|
|
882
889
|
```
|
|
883
890
|
|
|
884
891
|
#### Pool stats
|
|
885
892
|
|
|
893
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmePoolStats -->
|
|
886
894
|
```ts
|
|
887
895
|
worker.poolSize; // number of threads
|
|
888
896
|
worker.busyThreads; // threads currently processing a job
|
|
@@ -990,7 +998,7 @@ If both cert & key are available an https.Agent is attached to all outbound call
|
|
|
990
998
|
|
|
991
999
|
Import branded key helpers directly:
|
|
992
1000
|
|
|
993
|
-
<!-- snippet:ReadmeBrandedKeysImport+ReadmeBrandedKeys -->
|
|
1001
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeBrandedKeysImport+ReadmeBrandedKeys -->
|
|
994
1002
|
|
|
995
1003
|
```ts
|
|
996
1004
|
import { ProcessDefinitionKey, ProcessInstanceKey } from '@camunda8/orchestration-cluster-api';
|
|
@@ -1006,7 +1014,7 @@ They are zero‑cost runtime strings with compile‑time separation.
|
|
|
1006
1014
|
|
|
1007
1015
|
All methods return a `CancelablePromise<T>`:
|
|
1008
1016
|
|
|
1009
|
-
<!-- snippet:ReadmeCancelable -->
|
|
1017
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeCancelable -->
|
|
1010
1018
|
|
|
1011
1019
|
```ts
|
|
1012
1020
|
const p = camunda.searchProcessInstances(
|
|
@@ -1043,6 +1051,7 @@ Notes:
|
|
|
1043
1051
|
|
|
1044
1052
|
The main entry stays minimal. To opt in to a TaskEither-style facade & helper combinators import from the dedicated subpath:
|
|
1045
1053
|
|
|
1054
|
+
<!-- snippet-exempt: uses SDK /fp subpath not available in examples project -->
|
|
1046
1055
|
```ts
|
|
1047
1056
|
import {
|
|
1048
1057
|
createCamundaFpClient,
|
|
@@ -1050,7 +1059,7 @@ import {
|
|
|
1050
1059
|
withTimeoutTE,
|
|
1051
1060
|
eventuallyTE,
|
|
1052
1061
|
isLeft,
|
|
1053
|
-
} from '@camunda8/orchestration-cluster/fp';
|
|
1062
|
+
} from '@camunda8/orchestration-cluster-api/fp';
|
|
1054
1063
|
|
|
1055
1064
|
const fp = createCamundaFpClient();
|
|
1056
1065
|
const deployTE = fp.deployResourcesFromFiles(['./bpmn/process.bpmn']);
|
|
@@ -1118,7 +1127,7 @@ Use this to understand convergence speed and data shape evolution during tests o
|
|
|
1118
1127
|
|
|
1119
1128
|
### Example
|
|
1120
1129
|
|
|
1121
|
-
<!-- snippet:ReadmeEventualConsistency -->
|
|
1130
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeEventualConsistency -->
|
|
1122
1131
|
|
|
1123
1132
|
```ts
|
|
1124
1133
|
const jobs = await camunda.searchJobs(
|
|
@@ -1142,7 +1151,7 @@ On timeout an `EventualConsistencyTimeoutError` includes diagnostic fields: `{ a
|
|
|
1142
1151
|
|
|
1143
1152
|
Per‑client logger; no global singleton. The level defaults from `CAMUNDA_SDK_LOG_LEVEL` (default `error`).
|
|
1144
1153
|
|
|
1145
|
-
<!-- snippet:ReadmeLogging -->
|
|
1154
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeLogging -->
|
|
1146
1155
|
|
|
1147
1156
|
```ts
|
|
1148
1157
|
const client = createCamundaClient({
|
|
@@ -1195,9 +1204,10 @@ Provide a `transport` function to forward structured `LogEvent` objects into any
|
|
|
1195
1204
|
|
|
1196
1205
|
#### Pino
|
|
1197
1206
|
|
|
1207
|
+
<!-- snippet-exempt: uses external pino dependency -->
|
|
1198
1208
|
```ts
|
|
1199
1209
|
import pino from 'pino';
|
|
1200
|
-
import createCamundaClient from '@camunda8/orchestration-cluster';
|
|
1210
|
+
import createCamundaClient from '@camunda8/orchestration-cluster-api';
|
|
1201
1211
|
|
|
1202
1212
|
const p = pino();
|
|
1203
1213
|
const client = createCamundaClient({
|
|
@@ -1213,9 +1223,10 @@ const client = createCamundaClient({
|
|
|
1213
1223
|
|
|
1214
1224
|
#### Winston
|
|
1215
1225
|
|
|
1226
|
+
<!-- snippet-exempt: uses external winston dependency -->
|
|
1216
1227
|
```ts
|
|
1217
1228
|
import winston from 'winston';
|
|
1218
|
-
import createCamundaClient from '@camunda8/orchestration-cluster';
|
|
1229
|
+
import createCamundaClient from '@camunda8/orchestration-cluster-api';
|
|
1219
1230
|
|
|
1220
1231
|
const w = winston.createLogger({ transports: [new winston.transports.Console()] });
|
|
1221
1232
|
const client = createCamundaClient({
|
|
@@ -1238,9 +1249,10 @@ const client = createCamundaClient({
|
|
|
1238
1249
|
|
|
1239
1250
|
#### loglevel
|
|
1240
1251
|
|
|
1252
|
+
<!-- snippet-exempt: uses external loglevel dependency -->
|
|
1241
1253
|
```ts
|
|
1242
1254
|
import log from 'loglevel';
|
|
1243
|
-
import createCamundaClient from '@camunda8/orchestration-cluster';
|
|
1255
|
+
import createCamundaClient from '@camunda8/orchestration-cluster-api';
|
|
1244
1256
|
|
|
1245
1257
|
log.setLevel('info'); // host app level
|
|
1246
1258
|
const client = createCamundaClient({
|
|
@@ -1281,7 +1293,7 @@ May throw:
|
|
|
1281
1293
|
|
|
1282
1294
|
All SDK-thrown operational errors normalize to a discriminated union (`SdkError`) when they originate from HTTP, network, auth, or validation layers. Use the guard `isSdkError` to narrow inside a catch:
|
|
1283
1295
|
|
|
1284
|
-
<!-- snippet:ReadmeErrorHandlingImport+ReadmeErrorHandling -->
|
|
1296
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeErrorHandlingImport+ReadmeErrorHandling -->
|
|
1285
1297
|
|
|
1286
1298
|
```ts
|
|
1287
1299
|
import { createCamundaClient, isSdkError } from '@camunda8/orchestration-cluster-api';
|
|
@@ -1331,7 +1343,7 @@ _Note that this feature is experimental and subject to change._
|
|
|
1331
1343
|
|
|
1332
1344
|
If you prefer FP‑style explicit error handling instead of exceptions, use the result client wrapper:
|
|
1333
1345
|
|
|
1334
|
-
<!-- snippet:ReadmeResultClientImport+ReadmeResultClient -->
|
|
1346
|
+
<!-- snippet-source: examples/readme-imports.txt,examples/readme.ts | regions: ReadmeResultClientImport+ReadmeResultClient -->
|
|
1335
1347
|
|
|
1336
1348
|
```ts
|
|
1337
1349
|
import { createCamundaResultClient, isOk } from '@camunda8/orchestration-cluster-api';
|
|
@@ -1353,8 +1365,9 @@ API surface differences:
|
|
|
1353
1365
|
|
|
1354
1366
|
Helpers:
|
|
1355
1367
|
|
|
1368
|
+
<!-- snippet-exempt: one-liner import example -->
|
|
1356
1369
|
```ts
|
|
1357
|
-
import { isOk, isErr } from '@camunda8/orchestration-cluster';
|
|
1370
|
+
import { isOk, isErr } from '@camunda8/orchestration-cluster-api';
|
|
1358
1371
|
```
|
|
1359
1372
|
|
|
1360
1373
|
When to use:
|
|
@@ -1369,8 +1382,9 @@ _Note that this feature is experimental and subject to change._
|
|
|
1369
1382
|
|
|
1370
1383
|
For projects using `fp-ts`, wrap the throwing client in a lazy `TaskEither` facade:
|
|
1371
1384
|
|
|
1385
|
+
<!-- snippet-exempt: requires external fp-ts dependency -->
|
|
1372
1386
|
```ts
|
|
1373
|
-
import { createCamundaFpClient } from '@camunda8/orchestration-cluster';
|
|
1387
|
+
import { createCamundaFpClient } from '@camunda8/orchestration-cluster-api/fp';
|
|
1374
1388
|
import { pipe } from 'fp-ts/function';
|
|
1375
1389
|
import * as TE from 'fp-ts/TaskEither';
|
|
1376
1390
|
|
|
@@ -1418,7 +1432,7 @@ The deployment endpoint requires each resource to have a filename (extension use
|
|
|
1418
1432
|
|
|
1419
1433
|
### Browser
|
|
1420
1434
|
|
|
1421
|
-
<!-- snippet:ReadmeDeployBrowser -->
|
|
1435
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeDeployBrowser -->
|
|
1422
1436
|
|
|
1423
1437
|
```ts
|
|
1424
1438
|
const bpmnXml = `<definitions id="process" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">...</definitions>`;
|
|
@@ -1429,6 +1443,7 @@ console.log(result.deployments.length);
|
|
|
1429
1443
|
|
|
1430
1444
|
From an existing Blob:
|
|
1431
1445
|
|
|
1446
|
+
<!-- snippet-exempt: uses hypothetical getBlob() function -->
|
|
1432
1447
|
```ts
|
|
1433
1448
|
const blob: Blob = getBlob();
|
|
1434
1449
|
const file = new File([blob], 'model.bpmn');
|
|
@@ -1439,7 +1454,7 @@ await camunda.createDeployment({ resources: [file] });
|
|
|
1439
1454
|
|
|
1440
1455
|
Use the built-in helper `deployResourcesFromFiles(...)` to read local files and create `File` objects automatically. It returns the enriched `ExtendedDeploymentResult` (adds typed arrays: `processes`, `decisions`, `decisionRequirements`, `forms`, `resources`).
|
|
1441
1456
|
|
|
1442
|
-
<!-- snippet:ReadmeDeployNode -->
|
|
1457
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeDeployNode -->
|
|
1443
1458
|
|
|
1444
1459
|
```ts
|
|
1445
1460
|
const result = await camunda.deployResourcesFromFiles([
|
|
@@ -1454,12 +1469,14 @@ console.log(result.decisions.length);
|
|
|
1454
1469
|
|
|
1455
1470
|
With explicit tenant (overriding tenant from configuration):
|
|
1456
1471
|
|
|
1472
|
+
<!-- snippet-exempt: small variant of injected deploy example above -->
|
|
1457
1473
|
```ts
|
|
1458
1474
|
await camunda.deployResourcesFromFiles(['./bpmn/order-process.bpmn'], { tenantId: 'tenant-a' });
|
|
1459
1475
|
```
|
|
1460
1476
|
|
|
1461
1477
|
Error handling:
|
|
1462
1478
|
|
|
1479
|
+
<!-- snippet-exempt: small variant of injected deploy example above -->
|
|
1463
1480
|
```ts
|
|
1464
1481
|
try {
|
|
1465
1482
|
await camunda.deployResourcesFromFiles([]); // throws (empty array)
|
|
@@ -1470,6 +1487,7 @@ try {
|
|
|
1470
1487
|
|
|
1471
1488
|
Manual construction alternative (if you need custom logic):
|
|
1472
1489
|
|
|
1490
|
+
<!-- snippet-exempt: alternative construction pattern using node:buffer -->
|
|
1473
1491
|
```ts
|
|
1474
1492
|
import { File } from 'node:buffer';
|
|
1475
1493
|
const bpmnXml =
|
|
@@ -1491,7 +1509,7 @@ Empty arrays are rejected. Always use correct extensions so the server can class
|
|
|
1491
1509
|
|
|
1492
1510
|
Create isolated clients per test file:
|
|
1493
1511
|
|
|
1494
|
-
<!-- snippet:ReadmeTestingClient -->
|
|
1512
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeTestingClient -->
|
|
1495
1513
|
|
|
1496
1514
|
```ts
|
|
1497
1515
|
const client = createCamundaClient({
|
|
@@ -1501,7 +1519,7 @@ const client = createCamundaClient({
|
|
|
1501
1519
|
|
|
1502
1520
|
Inject a mock fetch:
|
|
1503
1521
|
|
|
1504
|
-
<!-- snippet:ReadmeTestingMock -->
|
|
1522
|
+
<!-- snippet-source: examples/readme.ts | regions: ReadmeTestingMock -->
|
|
1505
1523
|
|
|
1506
1524
|
```ts
|
|
1507
1525
|
const client = createCamundaClient({
|
|
@@ -4407,7 +4407,7 @@ function installAuthInterceptor(client2, getStrategy, getAuthHeaders) {
|
|
|
4407
4407
|
}
|
|
4408
4408
|
|
|
4409
4409
|
// src/runtime/version.ts
|
|
4410
|
-
var packageVersion = "8.9.0-alpha.
|
|
4410
|
+
var packageVersion = "8.9.0-alpha.24";
|
|
4411
4411
|
|
|
4412
4412
|
// src/runtime/supportLogger.ts
|
|
4413
4413
|
var NoopSupportLogger = class {
|
|
@@ -16675,4 +16675,4 @@ export {
|
|
|
16675
16675
|
withTimeoutTE,
|
|
16676
16676
|
eventuallyTE
|
|
16677
16677
|
};
|
|
16678
|
-
//# sourceMappingURL=chunk-
|
|
16678
|
+
//# sourceMappingURL=chunk-CSVBQQ42.js.map
|