@camunda8/orchestration-cluster-api 1.2.2 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
- ## [1.2.2](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.2.1...v1.2.2) (2025-12-01)
1
+ ## [1.2.3](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.2.2...v1.2.3) (2025-12-05)
2
+
3
+ ### Bug Fixes
2
4
 
5
+ - support fetchVariables in job worker ([b672d8d](https://github.com/camunda/orchestration-cluster-api-js/commit/b672d8d3ec499624a58d1db2b8e920f3ccc77ebc))
6
+
7
+ ## [1.2.2](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.2.1...v1.2.2) (2025-12-01)
3
8
 
4
9
  ### Bug Fixes
5
10
 
6
- * set default requestTimeout to 0 ([c18a22a](https://github.com/camunda/orchestration-cluster-api-js/commit/c18a22a0f5dacfcd6b16ac16d8260307a17f87d9))
11
+ - set default requestTimeout to 0 ([c18a22a](https://github.com/camunda/orchestration-cluster-api-js/commit/c18a22a0f5dacfcd6b16ac16d8260307a17f87d9))
7
12
 
8
13
  ## [1.2.1](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.2.0...v1.2.1) (2025-11-28)
9
14
 
package/README.md CHANGED
@@ -398,6 +398,8 @@ const worker = client.createJobWorker({
398
398
  maxParallelJobs: 10,
399
399
  timeoutMs: 15_000, // long‑poll timeout (server side requestTimeout)
400
400
  pollIntervalMs: 100, // delay between polls when no jobs / at capacity
401
+ // Optional: only fetch specific variables during activation
402
+ fetchVariables: ['orderId'],
401
403
  inputSchema: Input, // validates incoming variables if validateSchemas true
402
404
  outputSchema: Output, // validates variables passed to complete(...)
403
405
  validateSchemas: true, // set false for max throughput (skip Zod)
@@ -416,6 +418,29 @@ process.on('SIGINT', () => {
416
418
  });
417
419
  ```
418
420
 
421
+ Note on variable fetching:
422
+
423
+ - `fetchVariables: string[]` limits variables returned on activated jobs to the specified keys. If omitted, all visible variables at activation scope are returned. This maps to the REST API field `fetchVariable`.
424
+
425
+ TypeScript inference:
426
+
427
+ - When you provide `inputSchema`, the type of `fetchVariables` is constrained to the keys of the inferred `variables` type from that schema. Example:
428
+
429
+ ```ts
430
+ const Input = z.object({ orderId: z.string(), amount: z.number() });
431
+ client.createJobWorker({
432
+ jobType: 'process-order',
433
+ maxParallelJobs: 5,
434
+ jobTimeoutMs: 30_000,
435
+ inputSchema: Input,
436
+ // Only allows 'orderId' | 'amount' here at compile-time
437
+ fetchVariables: ['orderId', 'amount'],
438
+ jobHandler: async (job) => job.complete(),
439
+ });
440
+ ```
441
+
442
+ - Without `inputSchema`, `fetchVariables` defaults to `string[]`.
443
+
419
444
  ### Job Handler Semantics
420
445
 
421
446
  Your `jobHandler` must ultimately invoke exactly one of:
@@ -228,7 +228,9 @@ var JobWorker = class {
228
228
  worker: this._name,
229
229
  maxJobsToActivate: batchSize,
230
230
  requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT,
231
- timeout: this._cfg.jobTimeoutMs
231
+ timeout: this._cfg.jobTimeoutMs,
232
+ // API expects `fetchVariable`; map from config `fetchVariables`
233
+ ...this._cfg.fetchVariables && this._cfg.fetchVariables.length > 0 ? { fetchVariable: this._cfg.fetchVariables } : {}
232
234
  };
233
235
  this._log.debug(() => ["activation.request", { batchSize }]);
234
236
  let result = [];
@@ -2982,7 +2984,6 @@ __export(zod_gen_exports, {
2982
2984
  zMappingRuleUpdateRequest: () => zMappingRuleUpdateRequest,
2983
2985
  zMappingRuleUpdateResult: () => zMappingRuleUpdateResult,
2984
2986
  zMatchedDecisionRuleItem: () => zMatchedDecisionRuleItem,
2985
- zMessageCorrelationKey: () => zMessageCorrelationKey,
2986
2987
  zMessageCorrelationRequest: () => zMessageCorrelationRequest,
2987
2988
  zMessageCorrelationResult: () => zMessageCorrelationResult,
2988
2989
  zMessageKey: () => zMessageKey,
@@ -3322,7 +3323,6 @@ var zScopeKey = zLongKey;
3322
3323
  var zIncidentKey = zLongKey;
3323
3324
  var zJobKey = zLongKey;
3324
3325
  var zMessageSubscriptionKey = zLongKey;
3325
- var zMessageCorrelationKey = zLongKey;
3326
3326
  var zDecisionDefinitionId = z.string().min(1).max(256).regex(/^[A-Za-z0-9_@.+-]+$/).register(z.globalRegistry, {
3327
3327
  description: "Id of a decision definition, from the model. Only ids of decision definitions that are deployed are useful."
3328
3328
  });
@@ -4510,9 +4510,7 @@ var zIncidentFilter = z.object({
4510
4510
  description: "Error message which describes the error in more detail."
4511
4511
  })),
4512
4512
  elementId: z.optional(zElementId),
4513
- creationTime: z.optional(z.iso.datetime().register(z.globalRegistry, {
4514
- description: "Date of incident creation."
4515
- })),
4513
+ creationTime: z.optional(zDateTimeFilterProperty),
4516
4514
  state: z.optional(z.enum([
4517
4515
  "ACTIVE",
4518
4516
  "MIGRATED",
@@ -4677,7 +4675,9 @@ var zMessageSubscriptionResult = z.object({
4677
4675
  messageName: z.optional(z.string().register(z.globalRegistry, {
4678
4676
  description: "The name of the message associated with the message subscription."
4679
4677
  })),
4680
- correlationKey: z.optional(zMessageCorrelationKey),
4678
+ correlationKey: z.optional(z.string().register(z.globalRegistry, {
4679
+ description: "The correlation key of the message subscription."
4680
+ })),
4681
4681
  tenantId: z.optional(zTenantId)
4682
4682
  });
4683
4683
  var zMessageSubscriptionSearchQueryResult = zSearchQueryResponse.and(z.object({
@@ -5861,7 +5861,6 @@ var zJobSearchQuerySortRequest = z.object({
5861
5861
  "endTime",
5862
5862
  "errorCode",
5863
5863
  "errorMessage",
5864
- "hasFailedWithRetriesLeft",
5865
5864
  "isDenied",
5866
5865
  "jobKey",
5867
5866
  "kind",
@@ -6007,9 +6006,9 @@ var zJobSearchResult = z.object({
6007
6006
  z.string(),
6008
6007
  z.null()
6009
6008
  ])),
6010
- hasFailedWithRetriesLeft: z.optional(z.boolean().register(z.globalRegistry, {
6009
+ hasFailedWithRetriesLeft: z.boolean().register(z.globalRegistry, {
6011
6010
  description: "Indicates whether the job has failed with retries left."
6012
- })),
6011
+ }),
6013
6012
  isDenied: z.optional(z.union([
6014
6013
  z.boolean(),
6015
6014
  z.null()
@@ -6052,7 +6051,7 @@ var zProblemDetail = z.object({
6052
6051
  detail: z.optional(z.string().register(z.globalRegistry, {
6053
6052
  description: "An explanation of the problem in more detail."
6054
6053
  })),
6055
- instance: z.optional(z.string().register(z.globalRegistry, {
6054
+ instance: z.optional(z.url().register(z.globalRegistry, {
6056
6055
  description: "A URI path identifying the origin of the problem."
6057
6056
  }))
6058
6057
  }).register(z.globalRegistry, {
@@ -6346,7 +6345,7 @@ var zMessageCorrelationRequest = z.object({
6346
6345
  });
6347
6346
  var zMessageCorrelationResult = z.object({
6348
6347
  tenantId: z.optional(zTenantId),
6349
- messageKey: z.optional(zMessageCorrelationKey),
6348
+ messageKey: z.optional(zMessageKey),
6350
6349
  processInstanceKey: z.optional(zProcessInstanceKey)
6351
6350
  }).register(z.globalRegistry, {
6352
6351
  description: "The message key of the correlated message, as well as the first process instance key it\ncorrelated with.\n"
@@ -7369,13 +7368,21 @@ var zSearchUserTaskVariablesData = z.object({
7369
7368
  path: z.object({
7370
7369
  userTaskKey: zUserTaskKey
7371
7370
  }),
7372
- query: z.optional(z.never())
7371
+ query: z.optional(z.object({
7372
+ truncateValues: z.optional(z.boolean().register(z.globalRegistry, {
7373
+ description: "When true (default), long variable values in the response are truncated. When false, full variable values are returned."
7374
+ }))
7375
+ }))
7373
7376
  });
7374
7377
  var zSearchUserTaskVariablesResponse = zVariableSearchQueryResult;
7375
7378
  var zSearchVariablesData = z.object({
7376
7379
  body: z.optional(zVariableSearchQuery),
7377
7380
  path: z.optional(z.never()),
7378
- query: z.optional(z.never())
7381
+ query: z.optional(z.object({
7382
+ truncateValues: z.optional(z.boolean().register(z.globalRegistry, {
7383
+ description: "When true (default), long variable values in the response are truncated. When false, full variable values are returned."
7384
+ }))
7385
+ }))
7379
7386
  });
7380
7387
  var zSearchVariablesResponse = zVariableSearchQueryResult;
7381
7388
  var zGetVariableData = z.object({
@@ -9624,7 +9631,7 @@ function installAuthInterceptor(client2, getStrategy, getAuthHeaders) {
9624
9631
  }
9625
9632
 
9626
9633
  // src/runtime/version.ts
9627
- var packageVersion = "1.2.2";
9634
+ var packageVersion = "8.8.0";
9628
9635
 
9629
9636
  // src/runtime/supportLogger.ts
9630
9637
  var NoopSupportLogger = class {
@@ -17396,9 +17403,10 @@ var CamundaClient = class {
17396
17403
  if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
17397
17404
  const useConsistency = consistencyManagement.consistency;
17398
17405
  return toCancelable2(async (signal) => {
17399
- const { userTaskKey, ..._body } = arg || {};
17406
+ const { userTaskKey, truncateValues, ..._body } = arg || {};
17400
17407
  let envelope = {};
17401
17408
  envelope.path = { userTaskKey };
17409
+ envelope.query = { truncateValues };
17402
17410
  envelope.body = _body;
17403
17411
  if (this._validation.settings.req !== "none") {
17404
17412
  const maybe = await this._validation.gateRequest("searchUserTaskVariables", zSearchUserTaskVariablesData, envelope);
@@ -17406,6 +17414,7 @@ var CamundaClient = class {
17406
17414
  }
17407
17415
  const opts = { client: this._client, signal, throwOnError: false };
17408
17416
  if (envelope.path) opts.path = envelope.path;
17417
+ if (envelope.query) opts.query = envelope.query;
17409
17418
  if (envelope.body !== void 0) opts.body = envelope.body;
17410
17419
  const call = async () => {
17411
17420
  try {
@@ -17452,14 +17461,16 @@ var CamundaClient = class {
17452
17461
  if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
17453
17462
  const useConsistency = consistencyManagement.consistency;
17454
17463
  return toCancelable2(async (signal) => {
17455
- const _body = arg;
17464
+ const { truncateValues, ..._body } = arg || {};
17456
17465
  let envelope = {};
17466
+ envelope.query = { truncateValues };
17457
17467
  envelope.body = _body;
17458
17468
  if (this._validation.settings.req !== "none") {
17459
17469
  const maybe = await this._validation.gateRequest("searchVariables", zSearchVariablesData, envelope);
17460
17470
  if (this._validation.settings.req === "strict") envelope = maybe;
17461
17471
  }
17462
17472
  const opts = { client: this._client, signal, throwOnError: false };
17473
+ if (envelope.query) opts.query = envelope.query;
17463
17474
  if (envelope.body !== void 0) opts.body = envelope.body;
17464
17475
  const call = async () => {
17465
17476
  try {
@@ -18880,4 +18891,4 @@ export {
18880
18891
  withTimeoutTE,
18881
18892
  eventuallyTE
18882
18893
  };
18883
- //# sourceMappingURL=chunk-HAWDB7KV.js.map
18894
+ //# sourceMappingURL=chunk-CTXSQJWB.js.map