@camunda8/orchestration-cluster-api 9.1.3 → 9.1.5

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/dist/index.cjs CHANGED
@@ -3182,7 +3182,7 @@ var init_zod_gen = __esm({
3182
3182
  import_zod4.z.object({
3183
3183
  operationReference: import_zod4.z.optional(zOperationReference),
3184
3184
  deleteHistory: import_zod4.z.optional(import_zod4.z.boolean().register(import_zod4.z.globalRegistry, {
3185
- description: "Indicates if the historic data of a process resource should be deleted via a\nbatch operation asynchronously.\n\nThis flag is only effective for process resources. For other resource types\n(decisions, forms, generic resources), this flag is ignored and no history\nwill be deleted. In those cases, the `batchOperation` field in the response\nwill not be populated.\n"
3185
+ description: "Indicates if the historic data associated with the resource should also be deleted\nasynchronously.\n\nThis flag is effective for process definitions and decision requirements definitions.\nFor other resource types (forms, generic resources) it is ignored and no history is\ndeleted. For a decision requirements definition the `batchOperation` field in the\nresponse carries the created batch operation. For a process definition the history is\ndeleted as part of the definition's draining/deletion lifecycle and no batch operation is\nreturned.\n"
3186
3186
  })).default(false)
3187
3187
  }),
3188
3188
  import_zod4.z.null()
@@ -3751,9 +3751,10 @@ var init_zod_gen = __esm({
3751
3751
  })),
3752
3752
  state: import_zod4.z.optional(import_zod4.z.enum([
3753
3753
  "ACTIVE",
3754
+ "DRAINING",
3754
3755
  "DELETED"
3755
3756
  ]).register(import_zod4.z.globalRegistry, {
3756
- description: "Filter by the process definition's state.\nWhen not set, process definitions in any state are returned.\nSet to `ACTIVE` to exclude deleted definitions (recommended for most use cases).\nSet to `DELETED` to return only definitions that have been deleted but are still\nretained in secondary storage.\n"
3757
+ description: "Filter by the process definition's state.\nWhen not set, process definitions in any state are returned.\nSet to `ACTIVE` to exclude draining and deleted definitions (recommended for most use cases).\nSet to `DRAINING` to return only definitions that are being deleted but still have\nactive process instances draining.\nSet to `DELETED` to return only definitions that have been deleted but are still\nretained in secondary storage.\n"
3757
3758
  }))
3758
3759
  }).register(import_zod4.z.globalRegistry, {
3759
3760
  description: "Process definition search filter."
@@ -3781,9 +3782,10 @@ var init_zod_gen = __esm({
3781
3782
  }),
3782
3783
  state: import_zod4.z.enum([
3783
3784
  "ACTIVE",
3785
+ "DRAINING",
3784
3786
  "DELETED"
3785
3787
  ]).register(import_zod4.z.globalRegistry, {
3786
- description: "The state of this process definition."
3788
+ description: "The state of this process definition.\n`DRAINING` indicates the definition is being deleted but still has active process\ninstances draining before it is removed.\n"
3787
3789
  })
3788
3790
  });
3789
3791
  zProcessElementStatisticsResult = import_zod4.z.object({
@@ -3883,7 +3885,7 @@ var init_zod_gen = __esm({
3883
3885
  zProcessInstanceCreationInstructionById = import_zod4.z.object({
3884
3886
  processDefinitionId: zProcessDefinitionId,
3885
3887
  processDefinitionVersion: import_zod4.z.optional(import_zod4.z.int().register(import_zod4.z.globalRegistry, {
3886
- description: "The version of the process. By default, the latest version of the process is used.\n"
3888
+ description: "The version of the process. If omitted, the latest active version is used.\n"
3887
3889
  })).default(-1),
3888
3890
  variables: import_zod4.z.optional(import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()).register(import_zod4.z.globalRegistry, {
3889
3891
  description: "JSON object that will instantiate the variables for the root variable scope\nof the process instance.\n"
@@ -12651,7 +12653,7 @@ function createLogger(opts = {}) {
12651
12653
  }
12652
12654
 
12653
12655
  // src/runtime/version.ts
12654
- var packageVersion = "9.1.3";
12656
+ var packageVersion = "9.1.5";
12655
12657
 
12656
12658
  // src/runtime/supportLogger.ts
12657
12659
  var NoopSupportLogger = class {
@@ -13682,6 +13684,33 @@ var BackpressureManager = class {
13682
13684
  }
13683
13685
  };
13684
13686
 
13687
+ // src/runtime/pollBackoff.ts
13688
+ var DEFAULT_POLL_BACKOFF_MIN_MS = 1e3;
13689
+ var DEFAULT_POLL_BACKOFF_MAX_MS = 3e4;
13690
+ var MAX_SAFE_TIMEOUT_MS = 2147483647;
13691
+ function computePollBackoffMs(attempt, opts) {
13692
+ const rng = opts.rng ?? Math.random;
13693
+ const min = Number.isFinite(opts.minMs) ? Math.min(MAX_SAFE_TIMEOUT_MS, Math.max(0, Math.floor(opts.minMs))) : 0;
13694
+ const max = Number.isFinite(opts.maxMs) ? Math.min(MAX_SAFE_TIMEOUT_MS, Math.max(min, Math.floor(opts.maxMs))) : min;
13695
+ const safeAttempt = Number.isFinite(attempt) ? Math.max(1, Math.floor(attempt)) : 1;
13696
+ const exponent = Math.min(safeAttempt - 1, 53);
13697
+ const cap = Math.min(max, min * 2 ** exponent);
13698
+ const half = cap / 2;
13699
+ const r = rng();
13700
+ const jitter = Number.isFinite(r) ? Math.min(1, Math.max(0, r)) : 0;
13701
+ return Math.round(half + jitter * half);
13702
+ }
13703
+ function nextActivationRetryDelayMs(attempt, cfg, rng) {
13704
+ if (cfg.pollBackoffMinMs > 0) {
13705
+ return computePollBackoffMs(attempt, {
13706
+ minMs: cfg.pollBackoffMinMs,
13707
+ maxMs: cfg.pollBackoffMaxMs,
13708
+ rng
13709
+ });
13710
+ }
13711
+ return Number.isFinite(cfg.pollIntervalMs) ? Math.max(0, Math.round(cfg.pollIntervalMs)) : 0;
13712
+ }
13713
+
13685
13714
  // src/runtime/jobWorker.ts
13686
13715
  var JobActionReceipt = "JOB_ACTION_RECEIPT";
13687
13716
  var _workerCounter = 0;
@@ -13697,11 +13726,15 @@ var JobWorker = class {
13697
13726
  _pollTimer = null;
13698
13727
  _inFlightActivation = null;
13699
13728
  // CancelablePromise-like
13729
+ /** Consecutive failed activation requests; drives the retry backoff, reset on success. */
13730
+ _consecutiveActivationErrors = 0;
13700
13731
  _log;
13701
13732
  constructor(client2, cfg) {
13702
13733
  this._client = client2;
13703
13734
  this._cfg = {
13704
13735
  pollIntervalMs: 1,
13736
+ pollBackoffMinMs: DEFAULT_POLL_BACKOFF_MIN_MS,
13737
+ pollBackoffMaxMs: DEFAULT_POLL_BACKOFF_MAX_MS,
13705
13738
  autoStart: true,
13706
13739
  validateSchemas: false,
13707
13740
  maxParallelJobs: 10,
@@ -13828,6 +13861,7 @@ var JobWorker = class {
13828
13861
  this._inFlightActivation = this._client.activateJobs(body);
13829
13862
  const activation = await this._inFlightActivation;
13830
13863
  this._inFlightActivation = null;
13864
+ this._consecutiveActivationErrors = 0;
13831
13865
  result = activation?.jobs || [];
13832
13866
  this._log.debug(() => ["activation.response", { jobs: result.length }]);
13833
13867
  } catch (e) {
@@ -13835,10 +13869,21 @@ var JobWorker = class {
13835
13869
  if (this._stopped) return;
13836
13870
  if (e?.name === "CancelSdkError") {
13837
13871
  this._log.debug("activation.cancelled");
13838
- } else {
13839
- this._log.error("activation.error", e);
13872
+ this._scheduleNext(this._cfg.pollIntervalMs);
13873
+ return;
13840
13874
  }
13841
- this._scheduleNext(this._cfg.pollIntervalMs);
13875
+ this._consecutiveActivationErrors += 1;
13876
+ const delayMs = nextActivationRetryDelayMs(this._consecutiveActivationErrors, {
13877
+ pollIntervalMs: this._cfg.pollIntervalMs,
13878
+ pollBackoffMinMs: this._cfg.pollBackoffMinMs,
13879
+ pollBackoffMaxMs: this._cfg.pollBackoffMaxMs
13880
+ });
13881
+ this._log.error("activation.error", e);
13882
+ this._log.debug(() => [
13883
+ "activation.retry",
13884
+ { attempt: this._consecutiveActivationErrors, retryInMs: delayMs }
13885
+ ]);
13886
+ this._scheduleNext(delayMs);
13842
13887
  return;
13843
13888
  }
13844
13889
  if (!result || result.length === 0) {
@@ -13989,6 +14034,8 @@ var ThreadedJobWorker = class {
13989
14034
  _stopped = false;
13990
14035
  _pollTimer = null;
13991
14036
  _inFlightActivation = null;
14037
+ /** Consecutive failed activation requests; drives the retry backoff, reset on success. */
14038
+ _consecutiveActivationErrors = 0;
13992
14039
  _log;
13993
14040
  _jobQueue = [];
13994
14041
  constructor(client2, pool, cfg) {
@@ -13996,6 +14043,8 @@ var ThreadedJobWorker = class {
13996
14043
  this._pool = pool;
13997
14044
  this._cfg = {
13998
14045
  pollIntervalMs: 1,
14046
+ pollBackoffMinMs: DEFAULT_POLL_BACKOFF_MIN_MS,
14047
+ pollBackoffMaxMs: DEFAULT_POLL_BACKOFF_MAX_MS,
13999
14048
  autoStart: true,
14000
14049
  validateSchemas: false,
14001
14050
  maxParallelJobs: 10,
@@ -14209,6 +14258,7 @@ var ThreadedJobWorker = class {
14209
14258
  this._inFlightActivation = this._client.activateJobs(body);
14210
14259
  const activation = await this._inFlightActivation;
14211
14260
  this._inFlightActivation = null;
14261
+ this._consecutiveActivationErrors = 0;
14212
14262
  result = activation?.jobs || [];
14213
14263
  this._log.debug(() => ["activation.response", { jobs: result.length }]);
14214
14264
  } catch (e) {
@@ -14216,10 +14266,21 @@ var ThreadedJobWorker = class {
14216
14266
  if (this._stopped) return;
14217
14267
  if (e?.name === "CancelSdkError") {
14218
14268
  this._log.debug("activation.cancelled");
14219
- } else {
14220
- this._log.error("activation.error", e);
14269
+ this._scheduleNext(this._cfg.pollIntervalMs);
14270
+ return;
14221
14271
  }
14222
- this._scheduleNext(this._cfg.pollIntervalMs);
14272
+ this._consecutiveActivationErrors += 1;
14273
+ const delayMs = nextActivationRetryDelayMs(this._consecutiveActivationErrors, {
14274
+ pollIntervalMs: this._cfg.pollIntervalMs,
14275
+ pollBackoffMinMs: this._cfg.pollBackoffMinMs,
14276
+ pollBackoffMaxMs: this._cfg.pollBackoffMaxMs
14277
+ });
14278
+ this._log.error("activation.error", e);
14279
+ this._log.debug(() => [
14280
+ "activation.retry",
14281
+ { attempt: this._consecutiveActivationErrors, retryInMs: delayMs }
14282
+ ]);
14283
+ this._scheduleNext(delayMs);
14223
14284
  return;
14224
14285
  }
14225
14286
  if (!result || result.length === 0) {
@@ -25110,7 +25171,7 @@ function createCamundaFpClient(options) {
25110
25171
  }
25111
25172
 
25112
25173
  // src/gen/specHash.ts
25113
- var SPEC_HASH = "sha256:186417ed34bb227df96548b0cdeeaa8e8941ebf743d209ba75717a39ac06ef76";
25174
+ var SPEC_HASH = "sha256:31e6f176400015aac7b3e4e2275a3b8f36ec0ed84bb7de539c8bbba1d612d874";
25114
25175
 
25115
25176
  // src/gen/types.gen.ts
25116
25177
  var AuditLogEntityTypeEnum = {