@camunda8/orchestration-cluster-api 1.2.0 → 1.2.2

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 CHANGED
@@ -1,9 +1,21 @@
1
- # [1.2.0](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.5...v1.2.0) (2025-11-13)
1
+ ## [1.2.2](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.2.1...v1.2.2) (2025-12-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * set default requestTimeout to 0 ([c18a22a](https://github.com/camunda/orchestration-cluster-api-js/commit/c18a22a0f5dacfcd6b16ac16d8260307a17f87d9))
2
7
 
8
+ ## [1.2.1](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.2.0...v1.2.1) (2025-11-28)
9
+
10
+ ### Bug Fixes
11
+
12
+ - add job.error method ([285e743](https://github.com/camunda/orchestration-cluster-api-js/commit/285e743a0d6f0020ba5b25bf7f048748edcd63b4))
13
+
14
+ # [1.2.0](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.5...v1.2.0) (2025-11-13)
3
15
 
4
16
  ### Features
5
17
 
6
- * add silly level logging ([a8a4aad](https://github.com/camunda/orchestration-cluster-api-js/commit/a8a4aadd3556d5c441d63d2a9b3943a68dc747e5))
18
+ - add silly level logging ([a8a4aad](https://github.com/camunda/orchestration-cluster-api-js/commit/a8a4aadd3556d5c441d63d2a9b3943a68dc747e5))
7
19
 
8
20
  ## [1.1.5](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.4...v1.1.5) (2025-11-13)
9
21
 
package/README.md CHANGED
@@ -35,7 +35,7 @@ Keep configuration out of application code. Let the factory read `CAMUNDA_*` var
35
35
  ```ts
36
36
  import createCamundaClient from '@camunda8/orchestration-cluster-api';
37
37
 
38
- // Zero‑config construction: reads CAMUNDA_* from process.env once.
38
+ // Zero‑config construction: reads CAMUNDA_* from process.env. If no configuration is present, defaults to Camunda 8 Run on localhost.
39
39
  const camunda = createCamundaClient();
40
40
 
41
41
  const topology = await camunda.getTopology();
@@ -102,6 +102,14 @@ You can call `client.configure({ config: { ... } })` to re‑hydrate. The expose
102
102
 
103
103
  ## Validation
104
104
 
105
+ This allows you to validate that requests to the API from your application and responses from the API have the expected types and shape declared in the type system.
106
+
107
+ This protects your application from runtime bugs or errors in the type system leading to undefined states hitting your business logic.
108
+
109
+ Recommended to use `fanatical` or `strict` in development and then switch to `strict` or `warn` in production.
110
+
111
+ Or you can just YOLO it and leave it on `none` all the time.
112
+
105
113
  Controlled by `CAMUNDA_SDK_VALIDATION` (or `config` override). Grammar:
106
114
 
107
115
  ```
@@ -113,12 +121,17 @@ Examples:
113
121
 
114
122
  ```bash
115
123
  CAMUNDA_SDK_VALIDATION=warn # warn on both
116
- CAMUNDA_SDK_VALIDATION=req:strict,res:warn
124
+ CAMUNDA_SDK_VALIDATION=req:strict,res:warn # strict on requests, warn on responses
117
125
  CAMUNDA_SDK_VALIDATION=none
118
126
  ```
119
127
 
120
128
  Behavior:
121
129
 
130
+ - `none` - no validation performed
131
+ - `warn` - emit warning on invalid shape
132
+ - `strict` - fail on type mismatch or missing required fields
133
+ - `fanatical` - fail on type mismatch, missing required fields, or unknown additional fields
134
+
122
135
  ## Advanced HTTP Retry: Cockatiel Adapter (Optional)
123
136
 
124
137
  The SDK includes built‑in transient HTTP retry (429, 503, network errors) using a p‑retry based engine plus a fallback implementation. For advanced resilience patterns (circuit breakers, timeouts, custom classification, combining policies) you can integrate [cockatiel](https://github.com/connor4312/cockatiel).
@@ -237,18 +250,6 @@ To disable, unset the env variable or set `CAMUNDA_SUPPORT_LOG_ENABLED=false`.
237
250
 
238
251
  Refer to `./docs/CONFIG_REFERENCE.md` for the full list of related environment variables.
239
252
 
240
- ## Contributing
241
-
242
- We welcome issues and pull requests. Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guide before opening a PR to understand:
243
-
244
- - Deterministic builds policy (no committed timestamps) – see CONTRIBUTING
245
- - Commit message conventions (Conventional Commits with enforced subject length)
246
- - Release workflow & how to dry‑run semantic‑release locally
247
- - Testing strategy (unit vs integration)
248
- - Performance and security considerations
249
-
250
- If you plan to help migrate to npm Trusted Publishing (OIDC), open an issue so we can coordinate workflow permission changes (`id-token: write`) and removal of the legacy `NPM_TOKEN` secret.
251
-
252
253
  ### Custom Classification Example
253
254
 
254
255
  Retry only network errors + 429/503, plus optionally 500 on safe GET endpoints you mark:
@@ -422,6 +423,7 @@ Your `jobHandler` must ultimately invoke exactly one of:
422
423
  - `job.complete({ variables? })` OR `job.complete()`
423
424
  - `job.fail({ errorMessage, retries?, retryBackoff? })`
424
425
  - `job.cancelWorkflow({})` (cancels the process instance)
426
+ - `job.error({ errorCode, errorMessage? })` (throws a business error)
425
427
  - `job.ignore()` (marks as done locally without reporting to broker – can be used for decoupled flows)
426
428
 
427
429
  Each action returns an opaque unique symbol receipt (`JobActionReceipt`). The handler's declared return type (`Promise<JobActionReceipt>`) is intentional:
@@ -1119,10 +1121,6 @@ const client = createCamundaClient({
1119
1121
  });
1120
1122
  ```
1121
1123
 
1122
- ## License
1123
-
1124
- Apache 2.0
1125
-
1126
1124
  ## API Documentation
1127
1125
 
1128
1126
  Generate an HTML API reference site with TypeDoc (public entry points only):
@@ -1132,3 +1130,17 @@ npm run docs:api
1132
1130
  ```
1133
1131
 
1134
1132
  Output: static site in `docs/api` (open `docs/api/index.html` in a browser or serve the folder, e.g. `npx http-server docs/api`). Entry points: `src/index.ts`, `src/logger.ts`, `src/fp/index.ts`. Internal generated code, scripts, tests are excluded and private / protected members are filtered. Regenerate after changing public exports.
1133
+
1134
+ ## Contributing
1135
+
1136
+ We welcome issues and pull requests. Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guide before opening a PR to understand:
1137
+
1138
+ - Deterministic builds policy (no committed timestamps) – see CONTRIBUTING
1139
+ - Commit message conventions (Conventional Commits with enforced subject length)
1140
+ - Release workflow & how to dry‑run semantic‑release locally
1141
+ - Testing strategy (unit vs integration)
1142
+ - Performance and security considerations
1143
+
1144
+ ## License
1145
+
1146
+ Apache 2.0
@@ -113,7 +113,7 @@ var EventualConsistencyTimeoutError = class extends Error {
113
113
  // src/runtime/jobWorker.ts
114
114
  var JobActionReceipt = "JOB_ACTION_RECEIPT";
115
115
  var _workerCounter = 0;
116
- var DEFAULT_LONGPOLL_TIMEOUT = 55e3;
116
+ var DEFAULT_LONGPOLL_TIMEOUT = 0;
117
117
  var JobWorker = class {
118
118
  _client;
119
119
  _cfg;
@@ -9624,7 +9624,7 @@ function installAuthInterceptor(client2, getStrategy, getAuthHeaders) {
9624
9624
  }
9625
9625
 
9626
9626
  // src/runtime/version.ts
9627
- var packageVersion = "1.2.0";
9627
+ var packageVersion = "1.2.2";
9628
9628
 
9629
9629
  // src/runtime/supportLogger.ts
9630
9630
  var NoopSupportLogger = class {
@@ -10603,6 +10603,14 @@ function enrichActivatedJob(raw, client2, log) {
10603
10603
  }
10604
10604
  return JobActionReceipt;
10605
10605
  };
10606
+ job.error = async (error) => {
10607
+ try {
10608
+ await client2.throwJobError({ ...error, jobKey: raw.jobKey });
10609
+ } finally {
10610
+ ack();
10611
+ }
10612
+ return JobActionReceipt;
10613
+ };
10606
10614
  job.cancelWorkflow = async () => {
10607
10615
  try {
10608
10616
  await client2.cancelProcessInstance({
@@ -18872,4 +18880,4 @@ export {
18872
18880
  withTimeoutTE,
18873
18881
  eventuallyTE
18874
18882
  };
18875
- //# sourceMappingURL=chunk-7RIALC7K.js.map
18883
+ //# sourceMappingURL=chunk-HAWDB7KV.js.map