@camunda8/orchestration-cluster-api 8.9.0-alpha.13 → 8.9.0-alpha.14

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/fp/index.cjs CHANGED
@@ -1214,7 +1214,7 @@ var deleteDecisionInstance = (options) => {
1214
1214
  return (options.client ?? client).post({
1215
1215
  requestValidator: void 0,
1216
1216
  responseValidator: void 0,
1217
- url: "/decision-instances/{decisionInstanceKey}/deletion",
1217
+ url: "/decision-instances/{decisionEvaluationKey}/deletion",
1218
1218
  ...options,
1219
1219
  headers: {
1220
1220
  "Content-Type": "application/json",
@@ -1769,6 +1769,18 @@ var getJobTimeSeriesStatistics = (options) => {
1769
1769
  }
1770
1770
  });
1771
1771
  };
1772
+ var getJobErrorStatistics = (options) => {
1773
+ return (options.client ?? client).post({
1774
+ requestValidator: void 0,
1775
+ responseValidator: void 0,
1776
+ url: "/jobs/statistics/errors",
1777
+ ...options,
1778
+ headers: {
1779
+ "Content-Type": "application/json",
1780
+ ...options.headers
1781
+ }
1782
+ });
1783
+ };
1772
1784
  var getLicense = (options) => {
1773
1785
  return (options?.client ?? client).get({
1774
1786
  requestValidator: void 0,
@@ -2365,6 +2377,14 @@ var getUsageMetrics = (options) => {
2365
2377
  ...options
2366
2378
  });
2367
2379
  };
2380
+ var getSystemConfiguration = (options) => {
2381
+ return (options?.client ?? client).get({
2382
+ requestValidator: void 0,
2383
+ responseValidator: void 0,
2384
+ url: "/system/configuration",
2385
+ ...options
2386
+ });
2387
+ };
2368
2388
  var createTenant = (options) => {
2369
2389
  return (options.client ?? client).post({
2370
2390
  requestValidator: void 0,
@@ -3062,6 +3082,7 @@ __export(zod_gen_exports, {
3062
3082
  zEvaluatedDecisionResult: () => zEvaluatedDecisionResult,
3063
3083
  zExpressionEvaluationRequest: () => zExpressionEvaluationRequest,
3064
3084
  zExpressionEvaluationResult: () => zExpressionEvaluationResult,
3085
+ zExpressionEvaluationWarningItem: () => zExpressionEvaluationWarningItem,
3065
3086
  zFailJobData: () => zFailJobData,
3066
3087
  zFailJobResponse: () => zFailJobResponse,
3067
3088
  zFormId: () => zFormId,
@@ -3101,6 +3122,8 @@ __export(zod_gen_exports, {
3101
3122
  zGetGroupResponse: () => zGetGroupResponse,
3102
3123
  zGetIncidentData: () => zGetIncidentData,
3103
3124
  zGetIncidentResponse: () => zGetIncidentResponse,
3125
+ zGetJobErrorStatisticsData: () => zGetJobErrorStatisticsData,
3126
+ zGetJobErrorStatisticsResponse: () => zGetJobErrorStatisticsResponse,
3104
3127
  zGetJobTimeSeriesStatisticsData: () => zGetJobTimeSeriesStatisticsData,
3105
3128
  zGetJobTimeSeriesStatisticsResponse: () => zGetJobTimeSeriesStatisticsResponse,
3106
3129
  zGetJobTypeStatisticsData: () => zGetJobTypeStatisticsData,
@@ -3145,6 +3168,8 @@ __export(zod_gen_exports, {
3145
3168
  zGetStartProcessFormResponse: () => zGetStartProcessFormResponse,
3146
3169
  zGetStatusData: () => zGetStatusData,
3147
3170
  zGetStatusResponse: () => zGetStatusResponse,
3171
+ zGetSystemConfigurationData: () => zGetSystemConfigurationData,
3172
+ zGetSystemConfigurationResponse: () => zGetSystemConfigurationResponse,
3148
3173
  zGetTenantClusterVariableData: () => zGetTenantClusterVariableData,
3149
3174
  zGetTenantClusterVariableResponse: () => zGetTenantClusterVariableResponse,
3150
3175
  zGetTenantData: () => zGetTenantData,
@@ -3225,6 +3250,10 @@ __export(zod_gen_exports, {
3225
3250
  zJobChangeset: () => zJobChangeset,
3226
3251
  zJobCompletionRequest: () => zJobCompletionRequest,
3227
3252
  zJobErrorRequest: () => zJobErrorRequest,
3253
+ zJobErrorStatisticsFilter: () => zJobErrorStatisticsFilter,
3254
+ zJobErrorStatisticsItem: () => zJobErrorStatisticsItem,
3255
+ zJobErrorStatisticsQuery: () => zJobErrorStatisticsQuery,
3256
+ zJobErrorStatisticsQueryResult: () => zJobErrorStatisticsQueryResult,
3228
3257
  zJobFailRequest: () => zJobFailRequest,
3229
3258
  zJobFilter: () => zJobFilter,
3230
3259
  zJobKey: () => zJobKey,
@@ -3236,6 +3265,7 @@ __export(zod_gen_exports, {
3236
3265
  zJobListenerEventTypeEnum: () => zJobListenerEventTypeEnum,
3237
3266
  zJobListenerEventTypeExactMatch: () => zJobListenerEventTypeExactMatch,
3238
3267
  zJobListenerEventTypeFilterProperty: () => zJobListenerEventTypeFilterProperty,
3268
+ zJobMetricsConfigurationResponse: () => zJobMetricsConfigurationResponse,
3239
3269
  zJobResult: () => zJobResult,
3240
3270
  zJobResultActivateElement: () => zJobResultActivateElement,
3241
3271
  zJobResultAdHocSubProcess: () => zJobResultAdHocSubProcess,
@@ -3514,6 +3544,7 @@ __export(zod_gen_exports, {
3514
3544
  zStringFilterProperty: () => zStringFilterProperty,
3515
3545
  zSuspendBatchOperationData: () => zSuspendBatchOperationData,
3516
3546
  zSuspendBatchOperationResponse: () => zSuspendBatchOperationResponse,
3547
+ zSystemConfigurationResponse: () => zSystemConfigurationResponse,
3517
3548
  zTag: () => zTag,
3518
3549
  zTagSet: () => zTagSet,
3519
3550
  zTenantClientResult: () => zTenantClientResult,
@@ -3839,18 +3870,18 @@ var zAuthorizationFilter = import_zod.z.object({
3839
3870
  description: "Authorization search filter."
3840
3871
  });
3841
3872
  var zBatchOperationError = import_zod.z.object({
3842
- partitionId: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
3873
+ partitionId: import_zod.z.int().register(import_zod.z.globalRegistry, {
3843
3874
  description: "The partition ID where the error occurred."
3844
- })),
3845
- type: import_zod.z.optional(import_zod.z.enum([
3875
+ }),
3876
+ type: import_zod.z.enum([
3846
3877
  "QUERY_FAILED",
3847
3878
  "RESULT_BUFFER_SIZE_EXCEEDED"
3848
3879
  ]).register(import_zod.z.globalRegistry, {
3849
3880
  description: "The type of the error that occurred during the batch operation."
3850
- })),
3851
- message: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
3881
+ }),
3882
+ message: import_zod.z.string().register(import_zod.z.globalRegistry, {
3852
3883
  description: "The error message that occurred during the batch operation."
3853
- }))
3884
+ })
3854
3885
  });
3855
3886
  var zBatchOperationItemStateEnum = import_zod.z.enum([
3856
3887
  "ACTIVE",
@@ -3980,10 +4011,10 @@ var zTopologyResponse = import_zod.z.object({
3980
4011
  brokers: import_zod.z.array(zBrokerInfo).register(import_zod.z.globalRegistry, {
3981
4012
  description: "A list of brokers that are part of this cluster."
3982
4013
  }),
3983
- clusterId: import_zod.z.optional(import_zod.z.union([
4014
+ clusterId: import_zod.z.union([
3984
4015
  import_zod.z.string(),
3985
4016
  import_zod.z.null()
3986
- ])),
4017
+ ]),
3987
4018
  clusterSize: import_zod.z.int().register(import_zod.z.globalRegistry, {
3988
4019
  description: "The number of brokers in the cluster."
3989
4020
  }),
@@ -4009,28 +4040,28 @@ var zEndCursor = import_zod.z.string().regex(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0
4009
4040
  description: "The end cursor in a search query result set."
4010
4041
  });
4011
4042
  var zEvaluatedDecisionInputItem = import_zod.z.object({
4012
- inputId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4043
+ inputId: import_zod.z.string().register(import_zod.z.globalRegistry, {
4013
4044
  description: "The identifier of the decision input."
4014
- })),
4015
- inputName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4045
+ }),
4046
+ inputName: import_zod.z.string().register(import_zod.z.globalRegistry, {
4016
4047
  description: "The name of the decision input."
4017
- })),
4018
- inputValue: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4019
- description: "The description of the decision input."
4020
- }))
4048
+ }),
4049
+ inputValue: import_zod.z.string().register(import_zod.z.globalRegistry, {
4050
+ description: "The value of the decision input."
4051
+ })
4021
4052
  }).register(import_zod.z.globalRegistry, {
4022
4053
  description: "A decision input that was evaluated within this decision evaluation."
4023
4054
  });
4024
4055
  var zEvaluatedDecisionOutputItem = import_zod.z.object({
4025
- outputId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4056
+ outputId: import_zod.z.string().register(import_zod.z.globalRegistry, {
4026
4057
  description: "The ID of the evaluated decison output item."
4027
- })),
4028
- outputName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4058
+ }),
4059
+ outputName: import_zod.z.string().register(import_zod.z.globalRegistry, {
4029
4060
  description: "The name of the of the evaluated decison output item."
4030
- })),
4031
- outputValue: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4061
+ }),
4062
+ outputValue: import_zod.z.string().register(import_zod.z.globalRegistry, {
4032
4063
  description: "The value of the evaluated decison output item."
4033
- })),
4064
+ }),
4034
4065
  ruleId: import_zod.z.union([
4035
4066
  import_zod.z.string(),
4036
4067
  import_zod.z.null()
@@ -4043,12 +4074,12 @@ var zEvaluatedDecisionOutputItem = import_zod.z.object({
4043
4074
  description: "The evaluated decision outputs."
4044
4075
  });
4045
4076
  var zMatchedDecisionRuleItem = import_zod.z.object({
4046
- ruleId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4077
+ ruleId: import_zod.z.string().register(import_zod.z.globalRegistry, {
4047
4078
  description: "The ID of the matched rule."
4048
- })),
4049
- ruleIndex: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4079
+ }),
4080
+ ruleIndex: import_zod.z.int().register(import_zod.z.globalRegistry, {
4050
4081
  description: "The index of the matched rule."
4051
- })),
4082
+ }),
4052
4083
  evaluatedOutputs: import_zod.z.array(zEvaluatedDecisionOutputItem).register(import_zod.z.globalRegistry, {
4053
4084
  description: "The evaluated decision outputs."
4054
4085
  })
@@ -4072,18 +4103,18 @@ var zDecisionInstanceStateEnum = import_zod.z.enum([
4072
4103
  description: "The state of the decision instance. UNSPECIFIED and UNKNOWN are deprecated and should not be used anymore, for removal in 8.10"
4073
4104
  });
4074
4105
  var zDocumentCreationFailureDetail = import_zod.z.object({
4075
- fileName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4106
+ fileName: import_zod.z.string().register(import_zod.z.globalRegistry, {
4076
4107
  description: "The name of the file that failed to upload."
4077
- })),
4078
- status: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4108
+ }),
4109
+ status: import_zod.z.int().register(import_zod.z.globalRegistry, {
4079
4110
  description: "The HTTP status code of the failure."
4080
- })),
4081
- title: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4111
+ }),
4112
+ title: import_zod.z.string().register(import_zod.z.globalRegistry, {
4082
4113
  description: "A short, human-readable summary of the problem type."
4083
- })),
4084
- detail: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4114
+ }),
4115
+ detail: import_zod.z.string().register(import_zod.z.globalRegistry, {
4085
4116
  description: "A human-readable explanation specific to this occurrence of the problem."
4086
- }))
4117
+ })
4087
4118
  });
4088
4119
  var zDocumentLinkRequest = import_zod.z.object({
4089
4120
  timeToLive: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
@@ -4120,6 +4151,11 @@ var zExpressionEvaluationRequest = import_zod.z.object({
4120
4151
  import_zod.z.null()
4121
4152
  ]))
4122
4153
  });
4154
+ var zExpressionEvaluationWarningItem = import_zod.z.object({
4155
+ message: import_zod.z.string().register(import_zod.z.globalRegistry, {
4156
+ description: "The warning message"
4157
+ })
4158
+ });
4123
4159
  var zExpressionEvaluationResult = import_zod.z.object({
4124
4160
  expression: import_zod.z.string().register(import_zod.z.globalRegistry, {
4125
4161
  description: "The evaluated expression"
@@ -4127,7 +4163,7 @@ var zExpressionEvaluationResult = import_zod.z.object({
4127
4163
  result: import_zod.z.unknown().register(import_zod.z.globalRegistry, {
4128
4164
  description: "The result value. Its type can vary."
4129
4165
  }),
4130
- warnings: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
4166
+ warnings: import_zod.z.array(zExpressionEvaluationWarningItem).register(import_zod.z.globalRegistry, {
4131
4167
  description: "List of warnings generated during expression evaluation"
4132
4168
  })
4133
4169
  });
@@ -4515,7 +4551,7 @@ var zGroupClientResult = import_zod.z.object({
4515
4551
  description: "The ID of the client."
4516
4552
  })
4517
4553
  });
4518
- var zProcessDefinitionId = import_zod.z.string().min(1).regex(/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/).register(import_zod.z.globalRegistry, {
4554
+ var zProcessDefinitionId = import_zod.z.string().min(1).regex(/^[\p{L}_][\p{L}\p{N}_\-\.]*$/u).register(import_zod.z.globalRegistry, {
4519
4555
  description: "Id of a process definition, from the model. Only ids of process definitions that are deployed are useful."
4520
4556
  });
4521
4557
  var zElementId = import_zod.z.string().register(import_zod.z.globalRegistry, {
@@ -4544,7 +4580,7 @@ var zAdHocSubProcessActivateActivitiesInstruction = import_zod.z.object({
4544
4580
  var zFormId = import_zod.z.string().register(import_zod.z.globalRegistry, {
4545
4581
  description: "The user-defined id for the form"
4546
4582
  });
4547
- var zDecisionDefinitionId = import_zod.z.string().min(1).max(256).regex(/^[A-Za-z0-9_@.+-]+$/).register(import_zod.z.globalRegistry, {
4583
+ var zDecisionDefinitionId = import_zod.z.string().min(1).regex(/^[\p{L}_][\p{L}\p{N}_\-\.]*$/u).register(import_zod.z.globalRegistry, {
4548
4584
  description: "Id of a decision definition, from the model. Only ids of decision definitions that are deployed are useful."
4549
4585
  });
4550
4586
  var zGlobalListenerId = import_zod.z.string().register(import_zod.z.globalRegistry, {
@@ -4646,15 +4682,15 @@ var zAdvancedIncidentStateFilter = import_zod.z.object({
4646
4682
  description: "Advanced IncidentStateEnum filter"
4647
4683
  });
4648
4684
  var zIncidentProcessInstanceStatisticsByErrorResult = import_zod.z.object({
4649
- errorHashCode: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4685
+ errorHashCode: import_zod.z.int().register(import_zod.z.globalRegistry, {
4650
4686
  description: "The hash code identifying a specific incident error.."
4651
- })),
4652
- errorMessage: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4687
+ }),
4688
+ errorMessage: import_zod.z.string().register(import_zod.z.globalRegistry, {
4653
4689
  description: "The error message associated with the incident error hash code."
4654
- })),
4655
- activeInstancesWithErrorCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
4690
+ }),
4691
+ activeInstancesWithErrorCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
4656
4692
  description: "The number of active process instances that currently have an active incident with this error.\n"
4657
- }))
4693
+ })
4658
4694
  });
4659
4695
  var zIncidentProcessInstanceStatisticsByDefinitionFilter = import_zod.z.object({
4660
4696
  errorHashCode: import_zod.z.int().register(import_zod.z.globalRegistry, {
@@ -4723,7 +4759,7 @@ var zJobWorkerStatisticsFilter = import_zod.z.object({
4723
4759
  });
4724
4760
  var zJobWorkerStatisticsItem = import_zod.z.object({
4725
4761
  worker: import_zod.z.string().register(import_zod.z.globalRegistry, {
4726
- description: "The worker identifier."
4762
+ description: "The name of the worker activating the jobs, mostly used for logging purposes."
4727
4763
  }),
4728
4764
  created: zStatusMetric,
4729
4765
  completed: zStatusMetric,
@@ -4757,6 +4793,34 @@ var zJobTimeSeriesStatisticsItem = import_zod.z.object({
4757
4793
  }).register(import_zod.z.globalRegistry, {
4758
4794
  description: "Aggregated job metrics for a single time bucket."
4759
4795
  });
4796
+ var zJobErrorStatisticsFilter = import_zod.z.object({
4797
+ from: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
4798
+ description: "Start of the time window to filter metrics. ISO 8601 date-time format.\n"
4799
+ }),
4800
+ to: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
4801
+ description: "End of the time window to filter metrics. ISO 8601 date-time format.\n"
4802
+ }),
4803
+ jobType: import_zod.z.string().register(import_zod.z.globalRegistry, {
4804
+ description: "Job type to return error metrics for."
4805
+ }),
4806
+ errorCode: import_zod.z.optional(zStringFilterProperty),
4807
+ errorMessage: import_zod.z.optional(zStringFilterProperty)
4808
+ }).register(import_zod.z.globalRegistry, {
4809
+ description: "Job error statistics search filter."
4810
+ });
4811
+ var zJobErrorStatisticsItem = import_zod.z.object({
4812
+ errorCode: import_zod.z.string().register(import_zod.z.globalRegistry, {
4813
+ description: "The error code identifier."
4814
+ }),
4815
+ errorMessage: import_zod.z.string().register(import_zod.z.globalRegistry, {
4816
+ description: "The error message."
4817
+ }),
4818
+ workers: import_zod.z.int().register(import_zod.z.globalRegistry, {
4819
+ description: "Number of distinct workers that encountered this error."
4820
+ })
4821
+ }).register(import_zod.z.globalRegistry, {
4822
+ description: "Aggregated error metrics for a single error type and message combination."
4823
+ });
4760
4824
  var zJobFailRequest = import_zod.z.object({
4761
4825
  retries: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4762
4826
  description: "The amount of retries the job should have left"
@@ -5110,8 +5174,8 @@ var zConditionalEvaluationInstruction = import_zod.z.object({
5110
5174
  })
5111
5175
  });
5112
5176
  var zProcessInstanceReference = import_zod.z.object({
5113
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
5114
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey)
5177
+ processDefinitionKey: zProcessDefinitionKey,
5178
+ processInstanceKey: zProcessInstanceKey
5115
5179
  });
5116
5180
  var zEvaluateConditionalResult = import_zod.z.object({
5117
5181
  conditionalEvaluationKey: zConditionalEvaluationKey,
@@ -5134,32 +5198,32 @@ var zDeploymentProcessResult = import_zod.z.object({
5134
5198
  description: "A deployed process."
5135
5199
  });
5136
5200
  var zIncidentProcessInstanceStatisticsByDefinitionResult = import_zod.z.object({
5137
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
5138
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
5139
- processDefinitionName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5201
+ processDefinitionId: zProcessDefinitionId,
5202
+ processDefinitionKey: zProcessDefinitionKey,
5203
+ processDefinitionName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5140
5204
  description: "The name of the process definition."
5141
- })),
5142
- processDefinitionVersion: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5205
+ }),
5206
+ processDefinitionVersion: import_zod.z.int().register(import_zod.z.globalRegistry, {
5143
5207
  description: "The version of the process definition."
5144
- })),
5145
- tenantId: import_zod.z.optional(zTenantId),
5146
- activeInstancesWithErrorCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
5208
+ }),
5209
+ tenantId: zTenantId,
5210
+ activeInstancesWithErrorCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
5147
5211
  description: "The number of active process instances that currently have an incident\nwith the specified error hash code.\n"
5148
- }))
5212
+ })
5149
5213
  });
5150
5214
  var zElementInstanceKey = zLongKey;
5151
5215
  var zUserTaskKey = zLongKey;
5152
5216
  var zFormKey = zLongKey;
5153
5217
  var zDeploymentFormResult = import_zod.z.object({
5154
- formId: import_zod.z.optional(zFormId),
5155
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5218
+ formId: zFormId,
5219
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5156
5220
  description: "The version of the deployed form."
5157
- })),
5158
- resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5221
+ }),
5222
+ resourceName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5159
5223
  description: "The name of the resource."
5160
- })),
5161
- tenantId: import_zod.z.optional(zTenantId),
5162
- formKey: import_zod.z.optional(zFormKey)
5224
+ }),
5225
+ tenantId: zTenantId,
5226
+ formKey: zFormKey
5163
5227
  }).register(import_zod.z.globalRegistry, {
5164
5228
  description: "A deployed form."
5165
5229
  });
@@ -5175,13 +5239,13 @@ var zFormResult = import_zod.z.object({
5175
5239
  formKey: zFormKey
5176
5240
  });
5177
5241
  var zUserTaskProperties = import_zod.z.object({
5178
- action: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5242
+ action: import_zod.z.string().register(import_zod.z.globalRegistry, {
5179
5243
  description: "The action performed on the user task."
5180
- })),
5181
- assignee: import_zod.z.optional(import_zod.z.union([
5244
+ }),
5245
+ assignee: import_zod.z.union([
5182
5246
  import_zod.z.string(),
5183
5247
  import_zod.z.null()
5184
- ])),
5248
+ ]),
5185
5249
  candidateGroups: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
5186
5250
  description: "The groups eligible to claim the task."
5187
5251
  }),
@@ -5191,23 +5255,26 @@ var zUserTaskProperties = import_zod.z.object({
5191
5255
  changedAttributes: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
5192
5256
  description: "The attributes that were changed in the task."
5193
5257
  }),
5194
- dueDate: import_zod.z.optional(import_zod.z.union([
5258
+ dueDate: import_zod.z.union([
5195
5259
  import_zod.z.string(),
5196
5260
  import_zod.z.null()
5197
- ])),
5198
- followUpDate: import_zod.z.optional(import_zod.z.union([
5261
+ ]),
5262
+ followUpDate: import_zod.z.union([
5199
5263
  import_zod.z.string(),
5200
5264
  import_zod.z.null()
5201
- ])),
5202
- formKey: import_zod.z.optional(zFormKey),
5203
- priority: import_zod.z.optional(import_zod.z.union([
5265
+ ]),
5266
+ formKey: import_zod.z.union([
5267
+ zFormKey,
5268
+ import_zod.z.null()
5269
+ ]),
5270
+ priority: import_zod.z.union([
5204
5271
  import_zod.z.int().gte(0).lte(100),
5205
5272
  import_zod.z.null()
5206
- ])),
5207
- userTaskKey: import_zod.z.optional(import_zod.z.union([
5273
+ ]),
5274
+ userTaskKey: import_zod.z.union([
5208
5275
  zUserTaskKey,
5209
5276
  import_zod.z.null()
5210
- ]))
5277
+ ])
5211
5278
  }).register(import_zod.z.globalRegistry, {
5212
5279
  description: "Contains properties of a user task."
5213
5280
  });
@@ -5219,10 +5286,10 @@ var zElementInstanceResult = import_zod.z.object({
5219
5286
  startDate: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5220
5287
  description: "Date when element instance started."
5221
5288
  }),
5222
- endDate: import_zod.z.optional(import_zod.z.union([
5289
+ endDate: import_zod.z.union([
5223
5290
  import_zod.z.iso.datetime(),
5224
5291
  import_zod.z.null()
5225
- ])),
5292
+ ]),
5226
5293
  elementId: zElementId,
5227
5294
  elementName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5228
5295
  description: "The element name for this element instance."
@@ -5270,10 +5337,10 @@ var zElementInstanceResult = import_zod.z.object({
5270
5337
  import_zod.z.null()
5271
5338
  ]),
5272
5339
  processDefinitionKey: zProcessDefinitionKey,
5273
- incidentKey: import_zod.z.optional(import_zod.z.union([
5340
+ incidentKey: import_zod.z.union([
5274
5341
  zIncidentKey,
5275
5342
  import_zod.z.null()
5276
- ]))
5343
+ ])
5277
5344
  });
5278
5345
  var zJobKey = zLongKey;
5279
5346
  var zIncidentResult = import_zod.z.object({
@@ -5332,10 +5399,10 @@ var zActivatedJobResult = import_zod.z.object({
5332
5399
  elementInstanceKey: zElementInstanceKey,
5333
5400
  kind: zJobKindEnum,
5334
5401
  listenerEventType: zJobListenerEventTypeEnum,
5335
- userTask: import_zod.z.optional(import_zod.z.union([
5402
+ userTask: import_zod.z.union([
5336
5403
  zUserTaskProperties,
5337
5404
  import_zod.z.null()
5338
- ])),
5405
+ ]),
5339
5406
  tags: zTagSet,
5340
5407
  rootProcessInstanceKey: import_zod.z.union([
5341
5408
  zProcessInstanceKey,
@@ -5353,38 +5420,38 @@ var zJobSearchResult = import_zod.z.object({
5353
5420
  customHeaders: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).register(import_zod.z.globalRegistry, {
5354
5421
  description: "A set of custom headers defined during modelling."
5355
5422
  }),
5356
- deadline: import_zod.z.optional(import_zod.z.union([
5423
+ deadline: import_zod.z.union([
5357
5424
  import_zod.z.iso.datetime(),
5358
5425
  import_zod.z.null()
5359
- ])),
5360
- deniedReason: import_zod.z.optional(import_zod.z.union([
5426
+ ]),
5427
+ deniedReason: import_zod.z.union([
5361
5428
  import_zod.z.string(),
5362
5429
  import_zod.z.null()
5363
- ])),
5430
+ ]),
5364
5431
  elementId: import_zod.z.union([
5365
5432
  zElementId,
5366
5433
  import_zod.z.null()
5367
5434
  ]),
5368
5435
  elementInstanceKey: zElementInstanceKey,
5369
- endTime: import_zod.z.optional(import_zod.z.union([
5436
+ endTime: import_zod.z.union([
5370
5437
  import_zod.z.iso.datetime(),
5371
5438
  import_zod.z.null()
5372
- ])),
5373
- errorCode: import_zod.z.optional(import_zod.z.union([
5439
+ ]),
5440
+ errorCode: import_zod.z.union([
5374
5441
  import_zod.z.string(),
5375
5442
  import_zod.z.null()
5376
- ])),
5377
- errorMessage: import_zod.z.optional(import_zod.z.union([
5443
+ ]),
5444
+ errorMessage: import_zod.z.union([
5378
5445
  import_zod.z.string(),
5379
5446
  import_zod.z.null()
5380
- ])),
5447
+ ]),
5381
5448
  hasFailedWithRetriesLeft: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
5382
5449
  description: "Indicates whether the job has failed with retries left."
5383
5450
  }),
5384
- isDenied: import_zod.z.optional(import_zod.z.union([
5451
+ isDenied: import_zod.z.union([
5385
5452
  import_zod.z.boolean(),
5386
5453
  import_zod.z.null()
5387
- ])),
5454
+ ]),
5388
5455
  jobKey: zJobKey,
5389
5456
  kind: zJobKindEnum,
5390
5457
  listenerEventType: zJobListenerEventTypeEnum,
@@ -5406,12 +5473,14 @@ var zJobSearchResult = import_zod.z.object({
5406
5473
  worker: import_zod.z.string().register(import_zod.z.globalRegistry, {
5407
5474
  description: "The name of the worker of this job."
5408
5475
  }),
5409
- creationTime: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5410
- description: "When the job was created. Field is present for jobs created after 8.9."
5411
- })),
5412
- lastUpdateTime: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5413
- description: "When the job was last updated. Field is present for jobs created after 8.9."
5414
- }))
5476
+ creationTime: import_zod.z.union([
5477
+ import_zod.z.iso.datetime(),
5478
+ import_zod.z.null()
5479
+ ]),
5480
+ lastUpdateTime: import_zod.z.union([
5481
+ import_zod.z.iso.datetime(),
5482
+ import_zod.z.null()
5483
+ ])
5415
5484
  });
5416
5485
  var zDecisionDefinitionKey = zLongKey;
5417
5486
  var zDecisionEvaluationByKey = import_zod.z.object({
@@ -5427,28 +5496,28 @@ var zDecisionEvaluationInstruction = import_zod.z.union([
5427
5496
  ]);
5428
5497
  var zDecisionEvaluationInstanceKey = zLongKey;
5429
5498
  var zEvaluatedDecisionResult = import_zod.z.object({
5430
- decisionDefinitionId: import_zod.z.optional(zDecisionDefinitionId),
5431
- decisionDefinitionName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5499
+ decisionDefinitionId: zDecisionDefinitionId,
5500
+ decisionDefinitionName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5432
5501
  description: "The name of the decision which was evaluated."
5433
- })),
5434
- decisionDefinitionVersion: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5502
+ }),
5503
+ decisionDefinitionVersion: import_zod.z.int().register(import_zod.z.globalRegistry, {
5435
5504
  description: "The version of the decision which was evaluated."
5436
- })),
5505
+ }),
5437
5506
  decisionDefinitionType: import_zod.z.string().register(import_zod.z.globalRegistry, {
5438
5507
  description: "The type of the decision which was evaluated."
5439
5508
  }),
5440
- output: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5509
+ output: import_zod.z.string().register(import_zod.z.globalRegistry, {
5441
5510
  description: "JSON document that will instantiate the result of the decision which was evaluated.\n"
5442
- })),
5443
- tenantId: import_zod.z.optional(zTenantId),
5511
+ }),
5512
+ tenantId: zTenantId,
5444
5513
  matchedRules: import_zod.z.array(zMatchedDecisionRuleItem).register(import_zod.z.globalRegistry, {
5445
5514
  description: "The decision rules that matched within this decision evaluation."
5446
5515
  }),
5447
5516
  evaluatedInputs: import_zod.z.array(zEvaluatedDecisionInputItem).register(import_zod.z.globalRegistry, {
5448
5517
  description: "The decision inputs that were evaluated within this decision evaluation."
5449
5518
  }),
5450
- decisionDefinitionKey: import_zod.z.optional(zDecisionDefinitionKey),
5451
- decisionEvaluationInstanceKey: import_zod.z.optional(zDecisionEvaluationInstanceKey)
5519
+ decisionDefinitionKey: zDecisionDefinitionKey,
5520
+ decisionEvaluationInstanceKey: zDecisionEvaluationInstanceKey
5452
5521
  }).register(import_zod.z.globalRegistry, {
5453
5522
  description: "A decision that was evaluated."
5454
5523
  });
@@ -5586,37 +5655,37 @@ var zDecisionRequirementsResult = import_zod.z.object({
5586
5655
  })
5587
5656
  });
5588
5657
  var zDeploymentDecisionResult = import_zod.z.object({
5589
- decisionDefinitionId: import_zod.z.optional(zDecisionDefinitionId),
5590
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5658
+ decisionDefinitionId: zDecisionDefinitionId,
5659
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5591
5660
  description: "The assigned decision version."
5592
- })),
5593
- name: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5661
+ }),
5662
+ name: import_zod.z.string().register(import_zod.z.globalRegistry, {
5594
5663
  description: "The DMN name of the decision, as parsed during deployment."
5595
- })),
5596
- tenantId: import_zod.z.optional(zTenantId),
5597
- decisionRequirementsId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5664
+ }),
5665
+ tenantId: zTenantId,
5666
+ decisionRequirementsId: import_zod.z.string().register(import_zod.z.globalRegistry, {
5598
5667
  description: "The dmn ID of the decision requirements graph that this decision is part of, as parsed during deployment.\n"
5599
- })),
5600
- decisionDefinitionKey: import_zod.z.optional(zDecisionDefinitionKey),
5601
- decisionRequirementsKey: import_zod.z.optional(zDecisionRequirementsKey)
5668
+ }),
5669
+ decisionDefinitionKey: zDecisionDefinitionKey,
5670
+ decisionRequirementsKey: zDecisionRequirementsKey
5602
5671
  }).register(import_zod.z.globalRegistry, {
5603
5672
  description: "A deployed decision."
5604
5673
  });
5605
5674
  var zDeploymentDecisionRequirementsResult = import_zod.z.object({
5606
- decisionRequirementsId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5675
+ decisionRequirementsId: import_zod.z.string().register(import_zod.z.globalRegistry, {
5607
5676
  description: "The id of the deployed decision requirements."
5608
- })),
5609
- decisionRequirementsName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5677
+ }),
5678
+ decisionRequirementsName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5610
5679
  description: "The name of the deployed decision requirements."
5611
- })),
5612
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5680
+ }),
5681
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5613
5682
  description: "The version of the deployed decision requirements."
5614
- })),
5615
- resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5683
+ }),
5684
+ resourceName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5616
5685
  description: "The name of the resource."
5617
- })),
5618
- tenantId: import_zod.z.optional(zTenantId),
5619
- decisionRequirementsKey: import_zod.z.optional(zDecisionRequirementsKey)
5686
+ }),
5687
+ tenantId: zTenantId,
5688
+ decisionRequirementsKey: zDecisionRequirementsKey
5620
5689
  }).register(import_zod.z.globalRegistry, {
5621
5690
  description: "Deployed decision requirements."
5622
5691
  });
@@ -5627,17 +5696,17 @@ var zResourceKey = import_zod.z.union([
5627
5696
  zDecisionDefinitionKey
5628
5697
  ]);
5629
5698
  var zDeploymentResourceResult = import_zod.z.object({
5630
- resourceId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5699
+ resourceId: import_zod.z.string().register(import_zod.z.globalRegistry, {
5631
5700
  description: "The resource id of the deployed resource."
5632
- })),
5633
- resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5701
+ }),
5702
+ resourceName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5634
5703
  description: "The name of the deployed resource."
5635
- })),
5636
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5704
+ }),
5705
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5637
5706
  description: "The description of the deployed resource."
5638
- })),
5639
- tenantId: import_zod.z.optional(zTenantId),
5640
- resourceKey: import_zod.z.optional(zResourceKey)
5707
+ }),
5708
+ tenantId: zTenantId,
5709
+ resourceKey: zResourceKey
5641
5710
  }).register(import_zod.z.globalRegistry, {
5642
5711
  description: "A deployed Resource."
5643
5712
  });
@@ -5747,14 +5816,14 @@ var zBatchOperationResponse = import_zod.z.object({
5747
5816
  batchOperationKey: zBatchOperationKey,
5748
5817
  state: zBatchOperationStateEnum,
5749
5818
  batchOperationType: zBatchOperationTypeEnum,
5750
- startDate: import_zod.z.optional(import_zod.z.union([
5819
+ startDate: import_zod.z.union([
5751
5820
  import_zod.z.iso.datetime(),
5752
5821
  import_zod.z.null()
5753
- ])),
5754
- endDate: import_zod.z.optional(import_zod.z.union([
5822
+ ]),
5823
+ endDate: import_zod.z.union([
5755
5824
  import_zod.z.iso.datetime(),
5756
5825
  import_zod.z.null()
5757
- ])),
5826
+ ]),
5758
5827
  actorType: import_zod.z.union([
5759
5828
  zAuditLogActorTypeEnum,
5760
5829
  import_zod.z.null()
@@ -5777,17 +5846,17 @@ var zBatchOperationResponse = import_zod.z.object({
5777
5846
  })
5778
5847
  });
5779
5848
  var zBatchOperationItemResponse = import_zod.z.object({
5780
- operationType: import_zod.z.optional(zBatchOperationTypeEnum),
5781
- batchOperationKey: import_zod.z.optional(zBatchOperationKey),
5782
- itemKey: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5849
+ operationType: zBatchOperationTypeEnum,
5850
+ batchOperationKey: zBatchOperationKey,
5851
+ itemKey: import_zod.z.string().register(import_zod.z.globalRegistry, {
5783
5852
  description: "Key of the item, e.g. a process instance key."
5784
- })),
5785
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey),
5853
+ }),
5854
+ processInstanceKey: zProcessInstanceKey,
5786
5855
  rootProcessInstanceKey: import_zod.z.union([
5787
5856
  zProcessInstanceKey,
5788
5857
  import_zod.z.null()
5789
5858
  ]),
5790
- state: import_zod.z.optional(import_zod.z.enum([
5859
+ state: import_zod.z.enum([
5791
5860
  "ACTIVE",
5792
5861
  "COMPLETED",
5793
5862
  "SKIPPED",
@@ -5795,21 +5864,22 @@ var zBatchOperationItemResponse = import_zod.z.object({
5795
5864
  "FAILED"
5796
5865
  ]).register(import_zod.z.globalRegistry, {
5797
5866
  description: "State of the item."
5798
- })),
5799
- processedDate: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5800
- description: "the date this item was processed."
5801
- })),
5802
- errorMessage: import_zod.z.optional(import_zod.z.union([
5867
+ }),
5868
+ processedDate: import_zod.z.union([
5869
+ import_zod.z.iso.datetime(),
5870
+ import_zod.z.null()
5871
+ ]),
5872
+ errorMessage: import_zod.z.union([
5803
5873
  import_zod.z.string(),
5804
5874
  import_zod.z.null()
5805
- ]))
5875
+ ])
5806
5876
  });
5807
5877
  var zDeleteResourceResponse = import_zod.z.object({
5808
5878
  resourceKey: zResourceKey,
5809
- batchOperation: import_zod.z.optional(import_zod.z.union([
5879
+ batchOperation: import_zod.z.union([
5810
5880
  zBatchOperationCreatedResult,
5811
5881
  import_zod.z.null()
5812
- ]))
5882
+ ])
5813
5883
  });
5814
5884
  var zOperationReference = import_zod.z.coerce.bigint().gte(BigInt(1)).register(import_zod.z.globalRegistry, {
5815
5885
  description: "A reference key chosen by the user that will be part of all records resulting from this operation.\nMust be > 0 if provided.\n"
@@ -5870,10 +5940,6 @@ var zAuditLogResult = import_zod.z.object({
5870
5940
  import_zod.z.null()
5871
5941
  ]),
5872
5942
  result: zAuditLogResultEnum,
5873
- annotation: import_zod.z.union([
5874
- import_zod.z.string(),
5875
- import_zod.z.null()
5876
- ]),
5877
5943
  category: zAuditLogCategoryEnum,
5878
5944
  processDefinitionId: import_zod.z.union([
5879
5945
  zProcessDefinitionId,
@@ -6263,27 +6329,37 @@ var zAdvancedMessageSubscriptionStateFilter = import_zod.z.object({
6263
6329
  });
6264
6330
  var zMessageSubscriptionKey = zLongKey;
6265
6331
  var zMessageSubscriptionResult = import_zod.z.object({
6266
- messageSubscriptionKey: import_zod.z.optional(zMessageSubscriptionKey),
6267
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6268
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6269
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey),
6332
+ messageSubscriptionKey: zMessageSubscriptionKey,
6333
+ processDefinitionId: zProcessDefinitionId,
6334
+ processDefinitionKey: import_zod.z.union([
6335
+ zProcessDefinitionKey,
6336
+ import_zod.z.null()
6337
+ ]),
6338
+ processInstanceKey: import_zod.z.union([
6339
+ zProcessInstanceKey,
6340
+ import_zod.z.null()
6341
+ ]),
6270
6342
  rootProcessInstanceKey: import_zod.z.union([
6271
6343
  zProcessInstanceKey,
6272
6344
  import_zod.z.null()
6273
6345
  ]),
6274
- elementId: import_zod.z.optional(zElementId),
6275
- elementInstanceKey: import_zod.z.optional(zElementInstanceKey),
6276
- messageSubscriptionState: import_zod.z.optional(zMessageSubscriptionStateEnum),
6277
- lastUpdatedDate: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
6346
+ elementId: zElementId,
6347
+ elementInstanceKey: import_zod.z.union([
6348
+ zElementInstanceKey,
6349
+ import_zod.z.null()
6350
+ ]),
6351
+ messageSubscriptionState: zMessageSubscriptionStateEnum,
6352
+ lastUpdatedDate: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
6278
6353
  description: "The last updated date of the message subscription."
6279
- })),
6280
- messageName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6354
+ }),
6355
+ messageName: import_zod.z.string().register(import_zod.z.globalRegistry, {
6281
6356
  description: "The name of the message associated with the message subscription."
6282
- })),
6283
- correlationKey: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6284
- description: "The correlation key of the message subscription."
6285
- })),
6286
- tenantId: import_zod.z.optional(zTenantId)
6357
+ }),
6358
+ correlationKey: import_zod.z.union([
6359
+ import_zod.z.string(),
6360
+ import_zod.z.null()
6361
+ ]),
6362
+ tenantId: zTenantId
6287
6363
  });
6288
6364
  var zAdvancedMessageSubscriptionKeyFilter = import_zod.z.object({
6289
6365
  "$eq": import_zod.z.optional(zMessageSubscriptionKey),
@@ -6315,16 +6391,20 @@ var zMessagePublicationResult = import_zod.z.object({
6315
6391
  description: "The message key of the published message."
6316
6392
  });
6317
6393
  var zCorrelatedMessageSubscriptionResult = import_zod.z.object({
6318
- correlationKey: import_zod.z.string().register(import_zod.z.globalRegistry, {
6319
- description: "The correlation key of the message."
6320
- }),
6394
+ correlationKey: import_zod.z.union([
6395
+ import_zod.z.string(),
6396
+ import_zod.z.null()
6397
+ ]),
6321
6398
  correlationTime: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
6322
6399
  description: "The time when the message was correlated."
6323
6400
  }),
6324
6401
  elementId: import_zod.z.string().register(import_zod.z.globalRegistry, {
6325
6402
  description: "The element ID that received the message."
6326
6403
  }),
6327
- elementInstanceKey: import_zod.z.optional(zElementInstanceKey),
6404
+ elementInstanceKey: import_zod.z.union([
6405
+ zElementInstanceKey,
6406
+ import_zod.z.null()
6407
+ ]),
6328
6408
  messageKey: zMessageKey,
6329
6409
  messageName: import_zod.z.string().register(import_zod.z.globalRegistry, {
6330
6410
  description: "The name of the message."
@@ -6333,7 +6413,7 @@ var zCorrelatedMessageSubscriptionResult = import_zod.z.object({
6333
6413
  description: "The partition ID that correlated the message."
6334
6414
  }),
6335
6415
  processDefinitionId: zProcessDefinitionId,
6336
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6416
+ processDefinitionKey: zProcessDefinitionKey,
6337
6417
  processInstanceKey: zProcessInstanceKey,
6338
6418
  rootProcessInstanceKey: import_zod.z.union([
6339
6419
  zProcessInstanceKey,
@@ -6407,19 +6487,19 @@ var zProcessDefinitionResult = import_zod.z.object({
6407
6487
  })
6408
6488
  });
6409
6489
  var zProcessElementStatisticsResult = import_zod.z.object({
6410
- elementId: import_zod.z.optional(zElementId),
6411
- active: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6490
+ elementId: zElementId,
6491
+ active: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6412
6492
  description: "The total number of active instances of the element."
6413
- })),
6414
- canceled: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6493
+ }),
6494
+ canceled: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6415
6495
  description: "The total number of canceled instances of the element."
6416
- })),
6417
- incidents: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6496
+ }),
6497
+ incidents: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6418
6498
  description: "The total number of incidents for the element."
6419
- })),
6420
- completed: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6499
+ }),
6500
+ completed: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6421
6501
  description: "The total number of completed instances of the element."
6422
- }))
6502
+ })
6423
6503
  }).register(import_zod.z.globalRegistry, {
6424
6504
  description: "Process element statistics response."
6425
6505
  });
@@ -6431,32 +6511,32 @@ var zProcessDefinitionElementStatisticsQueryResult = import_zod.z.object({
6431
6511
  description: "Process definition element statistics query response."
6432
6512
  });
6433
6513
  var zProcessDefinitionMessageSubscriptionStatisticsResult = import_zod.z.object({
6434
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6435
- tenantId: import_zod.z.optional(zTenantId),
6436
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6437
- processInstancesWithActiveSubscriptions: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6514
+ processDefinitionId: zProcessDefinitionId,
6515
+ tenantId: zTenantId,
6516
+ processDefinitionKey: zProcessDefinitionKey,
6517
+ processInstancesWithActiveSubscriptions: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6438
6518
  description: "The number of process instances with active message subscriptions."
6439
- })),
6440
- activeSubscriptions: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6519
+ }),
6520
+ activeSubscriptions: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6441
6521
  description: "The total number of active message subscriptions for this process definition key."
6442
- }))
6522
+ })
6443
6523
  });
6444
6524
  var zProcessDefinitionInstanceStatisticsResult = import_zod.z.object({
6445
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6446
- tenantId: import_zod.z.optional(zTenantId),
6447
- latestProcessDefinitionName: import_zod.z.optional(import_zod.z.union([
6525
+ processDefinitionId: zProcessDefinitionId,
6526
+ tenantId: zTenantId,
6527
+ latestProcessDefinitionName: import_zod.z.union([
6448
6528
  import_zod.z.string(),
6449
6529
  import_zod.z.null()
6450
- ])),
6451
- hasMultipleVersions: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
6530
+ ]),
6531
+ hasMultipleVersions: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
6452
6532
  description: "Indicates whether multiple versions of this process definition instance are deployed."
6453
- })),
6454
- activeInstancesWithoutIncidentCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6533
+ }),
6534
+ activeInstancesWithoutIncidentCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6455
6535
  description: "Total number of currently active process instances of this definition that do not have incidents."
6456
- })),
6457
- activeInstancesWithIncidentCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6536
+ }),
6537
+ activeInstancesWithIncidentCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6458
6538
  description: "Total number of currently active process instances of this definition that have at least one incident."
6459
- }))
6539
+ })
6460
6540
  }).register(import_zod.z.globalRegistry, {
6461
6541
  description: "Process definition instance statistics response."
6462
6542
  });
@@ -6572,10 +6652,10 @@ var zCreateProcessInstanceResult = import_zod.z.object({
6572
6652
  processDefinitionKey: zProcessDefinitionKey,
6573
6653
  processInstanceKey: zProcessInstanceKey,
6574
6654
  tags: zTagSet,
6575
- businessId: import_zod.z.optional(import_zod.z.union([
6655
+ businessId: import_zod.z.union([
6576
6656
  zBusinessId,
6577
6657
  import_zod.z.null()
6578
- ]))
6658
+ ])
6579
6659
  });
6580
6660
  var zCancelProcessInstanceRequest = import_zod.z.union([
6581
6661
  import_zod.z.object({
@@ -6597,18 +6677,18 @@ var zProcessInstanceCallHierarchyEntry = import_zod.z.object({
6597
6677
  })
6598
6678
  });
6599
6679
  var zProcessInstanceSequenceFlowResult = import_zod.z.object({
6600
- sequenceFlowId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6680
+ sequenceFlowId: import_zod.z.string().register(import_zod.z.globalRegistry, {
6601
6681
  description: "The sequence flow id."
6602
- })),
6603
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey),
6682
+ }),
6683
+ processInstanceKey: zProcessInstanceKey,
6604
6684
  rootProcessInstanceKey: import_zod.z.union([
6605
6685
  zProcessInstanceKey,
6606
6686
  import_zod.z.null()
6607
6687
  ]),
6608
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6609
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6610
- elementId: import_zod.z.optional(zElementId),
6611
- tenantId: import_zod.z.optional(zTenantId)
6688
+ processDefinitionKey: zProcessDefinitionKey,
6689
+ processDefinitionId: zProcessDefinitionId,
6690
+ elementId: zElementId,
6691
+ tenantId: zTenantId
6612
6692
  }).register(import_zod.z.globalRegistry, {
6613
6693
  description: "Process instance sequence flow result."
6614
6694
  });
@@ -6945,6 +7025,12 @@ var zJobTimeSeriesStatisticsQuery = import_zod.z.object({
6945
7025
  }).register(import_zod.z.globalRegistry, {
6946
7026
  description: "Job time-series statistics query."
6947
7027
  });
7028
+ var zJobErrorStatisticsQuery = import_zod.z.object({
7029
+ filter: zJobErrorStatisticsFilter,
7030
+ page: import_zod.z.optional(zCursorForwardPagination)
7031
+ }).register(import_zod.z.globalRegistry, {
7032
+ description: "Job error statistics query."
7033
+ });
6948
7034
  var zCursorBackwardPagination = import_zod.z.object({
6949
7035
  before: zStartCursor,
6950
7036
  limit: import_zod.z.optional(import_zod.z.int().gte(1).lte(1e4).register(import_zod.z.globalRegistry, {
@@ -6970,7 +7056,6 @@ var zAuditLogSearchQuerySortRequest = import_zod.z.object({
6970
7056
  field: import_zod.z.enum([
6971
7057
  "actorId",
6972
7058
  "actorType",
6973
- "annotation",
6974
7059
  "auditLogKey",
6975
7060
  "batchOperationKey",
6976
7061
  "batchOperationType",
@@ -7195,7 +7280,6 @@ var zIncidentSearchQuerySortRequest = import_zod.z.object({
7195
7280
  "processDefinitionId",
7196
7281
  "processInstanceKey",
7197
7282
  "errorType",
7198
- "errorMessage",
7199
7283
  "elementId",
7200
7284
  "elementInstanceKey",
7201
7285
  "creationTime",
@@ -7597,6 +7681,14 @@ var zJobTimeSeriesStatisticsQueryResult = zSearchQueryResponse.and(import_zod.z.
7597
7681
  }).register(import_zod.z.globalRegistry, {
7598
7682
  description: "Job time-series statistics query result."
7599
7683
  }));
7684
+ var zJobErrorStatisticsQueryResult = zSearchQueryResponse.and(import_zod.z.object({
7685
+ items: import_zod.z.array(zJobErrorStatisticsItem).register(import_zod.z.globalRegistry, {
7686
+ description: "The list of per-error statistics items."
7687
+ }),
7688
+ page: zSearchQueryPageResponse
7689
+ }).register(import_zod.z.globalRegistry, {
7690
+ description: "Job error statistics query result."
7691
+ }));
7600
7692
  var zJobSearchQueryResult = zSearchQueryResponse.and(import_zod.z.object({
7601
7693
  items: import_zod.z.array(zJobSearchResult).register(import_zod.z.globalRegistry, {
7602
7694
  description: "The matching jobs."
@@ -7706,6 +7798,33 @@ var zUsageMetricsResponse = zUsageMetricsResponseItem.and(import_zod.z.object({
7706
7798
  description: "The usage metrics by tenants. Only available if request `withTenants` query parameter was `true`."
7707
7799
  })
7708
7800
  }));
7801
+ var zJobMetricsConfigurationResponse = import_zod.z.object({
7802
+ enabled: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
7803
+ description: "Whether job metrics export is enabled."
7804
+ }),
7805
+ exportInterval: import_zod.z.string().register(import_zod.z.globalRegistry, {
7806
+ description: "The interval at which job metrics are exported, as an ISO 8601 duration."
7807
+ }),
7808
+ maxWorkerNameLength: import_zod.z.int().register(import_zod.z.globalRegistry, {
7809
+ description: "The maximum length of the worker name used in job metrics labels."
7810
+ }),
7811
+ maxJobTypeLength: import_zod.z.int().register(import_zod.z.globalRegistry, {
7812
+ description: "The maximum length of the job type used in job metrics labels."
7813
+ }),
7814
+ maxTenantIdLength: import_zod.z.int().register(import_zod.z.globalRegistry, {
7815
+ description: "The maximum length of the tenant ID used in job metrics labels."
7816
+ }),
7817
+ maxUniqueKeys: import_zod.z.int().register(import_zod.z.globalRegistry, {
7818
+ description: "The maximum number of unique metric keys tracked for job metrics."
7819
+ })
7820
+ }).register(import_zod.z.globalRegistry, {
7821
+ description: "Configuration for job metrics collection and export."
7822
+ });
7823
+ var zSystemConfigurationResponse = import_zod.z.object({
7824
+ jobMetrics: zJobMetricsConfigurationResponse
7825
+ }).register(import_zod.z.globalRegistry, {
7826
+ description: "Envelope for all system configuration sections. Each property\nrepresents a feature area.\n"
7827
+ });
7709
7828
  var zTenantCreateRequest = import_zod.z.object({
7710
7829
  tenantId: import_zod.z.string().min(1).max(256).regex(/^[A-Za-z0-9_@.+-]+$/).register(import_zod.z.globalRegistry, {
7711
7830
  description: "The unique ID for the tenant. Must be 255 characters or less. Can contain letters, numbers, [`_`, `-`, `+`, `.`, `@`]."
@@ -7758,18 +7877,18 @@ var zTenantResult = import_zod.z.object({
7758
7877
  description: "Tenant search response item."
7759
7878
  });
7760
7879
  var zCamundaUserResult = import_zod.z.object({
7761
- username: import_zod.z.optional(import_zod.z.union([
7880
+ username: import_zod.z.union([
7762
7881
  zUsername,
7763
7882
  import_zod.z.null()
7764
- ])),
7765
- displayName: import_zod.z.optional(import_zod.z.union([
7883
+ ]),
7884
+ displayName: import_zod.z.union([
7766
7885
  import_zod.z.string(),
7767
7886
  import_zod.z.null()
7768
- ])),
7769
- email: import_zod.z.optional(import_zod.z.union([
7887
+ ]),
7888
+ email: import_zod.z.union([
7770
7889
  import_zod.z.string(),
7771
7890
  import_zod.z.null()
7772
- ])),
7891
+ ]),
7773
7892
  authorizedComponents: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
7774
7893
  description: "The web components the user is authorized to use."
7775
7894
  }),
@@ -8210,12 +8329,12 @@ var zVariableResultBase = import_zod.z.object({
8210
8329
  description: "Variable response item."
8211
8330
  });
8212
8331
  var zVariableSearchResult = zVariableResultBase.and(import_zod.z.object({
8213
- value: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
8332
+ value: import_zod.z.string().register(import_zod.z.globalRegistry, {
8214
8333
  description: "Value of this variable. Can be truncated."
8215
- })),
8216
- isTruncated: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
8334
+ }),
8335
+ isTruncated: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
8217
8336
  description: "Whether the value is truncated or not."
8218
- }))
8337
+ })
8219
8338
  }).register(import_zod.z.globalRegistry, {
8220
8339
  description: "Variable search response item."
8221
8340
  }));
@@ -8823,6 +8942,7 @@ var zBaseProcessInstanceFilterFields = import_zod.z.object({
8823
8942
  parentProcessInstanceKey: import_zod.z.optional(zProcessInstanceKeyFilterProperty),
8824
8943
  parentElementInstanceKey: import_zod.z.optional(zElementInstanceKeyFilterProperty),
8825
8944
  batchOperationId: import_zod.z.optional(zStringFilterProperty),
8945
+ batchOperationKey: import_zod.z.optional(zStringFilterProperty),
8826
8946
  errorMessage: import_zod.z.optional(zStringFilterProperty),
8827
8947
  hasRetriesLeft: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
8828
8948
  description: "Whether the process has failed jobs with retries left."
@@ -9224,7 +9344,7 @@ var zDeleteDecisionInstanceData = import_zod.z.object({
9224
9344
  import_zod.z.null()
9225
9345
  ])),
9226
9346
  path: import_zod.z.object({
9227
- decisionInstanceKey: zDecisionInstanceKey
9347
+ decisionEvaluationKey: zDecisionEvaluationKey
9228
9348
  }),
9229
9349
  query: import_zod.z.optional(import_zod.z.never())
9230
9350
  });
@@ -9782,6 +9902,12 @@ var zGetJobTimeSeriesStatisticsData = import_zod.z.object({
9782
9902
  query: import_zod.z.optional(import_zod.z.never())
9783
9903
  });
9784
9904
  var zGetJobTimeSeriesStatisticsResponse = zJobTimeSeriesStatisticsQueryResult;
9905
+ var zGetJobErrorStatisticsData = import_zod.z.object({
9906
+ body: zJobErrorStatisticsQuery,
9907
+ path: import_zod.z.optional(import_zod.z.never()),
9908
+ query: import_zod.z.optional(import_zod.z.never())
9909
+ });
9910
+ var zGetJobErrorStatisticsResponse = zJobErrorStatisticsQueryResult;
9785
9911
  var zGetLicenseData = import_zod.z.object({
9786
9912
  body: import_zod.z.optional(import_zod.z.never()),
9787
9913
  path: import_zod.z.optional(import_zod.z.never()),
@@ -10370,6 +10496,12 @@ var zGetUsageMetricsData = import_zod.z.object({
10370
10496
  })
10371
10497
  });
10372
10498
  var zGetUsageMetricsResponse = zUsageMetricsResponse;
10499
+ var zGetSystemConfigurationData = import_zod.z.object({
10500
+ body: import_zod.z.optional(import_zod.z.never()),
10501
+ path: import_zod.z.optional(import_zod.z.never()),
10502
+ query: import_zod.z.optional(import_zod.z.never())
10503
+ });
10504
+ var zGetSystemConfigurationResponse = zSystemConfigurationResponse;
10373
10505
  var zCreateTenantData = import_zod.z.object({
10374
10506
  body: zTenantCreateRequest,
10375
10507
  path: import_zod.z.optional(import_zod.z.never()),
@@ -12311,7 +12443,7 @@ function createLogger(opts = {}) {
12311
12443
  }
12312
12444
 
12313
12445
  // src/runtime/version.ts
12314
- var packageVersion = "8.9.0-alpha.13";
12446
+ var packageVersion = "8.9.0-alpha.14";
12315
12447
 
12316
12448
  // src/runtime/supportLogger.ts
12317
12449
  var NoopSupportLogger = class {
@@ -13338,34 +13470,307 @@ var BackpressureManager = class {
13338
13470
  }
13339
13471
  }
13340
13472
  }
13341
- }
13342
- };
13473
+ }
13474
+ };
13475
+
13476
+ // src/runtime/jobWorker.ts
13477
+ var JobActionReceipt = "JOB_ACTION_RECEIPT";
13478
+ var _workerCounter = 0;
13479
+ var DEFAULT_LONGPOLL_TIMEOUT = 0;
13480
+ var JobWorker = class {
13481
+ _client;
13482
+ _cfg;
13483
+ _name;
13484
+ _activeJobs = 0;
13485
+ _stopped = false;
13486
+ _pollTimer = null;
13487
+ _inFlightActivation = null;
13488
+ // CancelablePromise-like
13489
+ _log;
13490
+ constructor(client2, cfg) {
13491
+ this._client = client2;
13492
+ this._cfg = { pollIntervalMs: 1, autoStart: true, validateSchemas: false, ...cfg };
13493
+ this._name = cfg.workerName || `worker-${cfg.jobType}-${++_workerCounter}`;
13494
+ this._log = this._client.logger().scope(`worker:${this._name}`);
13495
+ if (cfg.maxBackoffTimeMs !== void 0) {
13496
+ this._log.debug(() => [
13497
+ "worker.config.deprecated",
13498
+ { maxBackoffTimeMs: cfg.maxBackoffTimeMs }
13499
+ ]);
13500
+ }
13501
+ if (this._cfg.autoStart) this.start();
13502
+ }
13503
+ get name() {
13504
+ return this._name;
13505
+ }
13506
+ get activeJobs() {
13507
+ return this._activeJobs;
13508
+ }
13509
+ get stopped() {
13510
+ return this._stopped;
13511
+ }
13512
+ start() {
13513
+ if (this._stopped) return;
13514
+ if (this._pollTimer) return;
13515
+ this._log.info("worker.start");
13516
+ const jitterMax = this._cfg.startupJitterMaxSeconds ?? 0;
13517
+ if (jitterMax > 0) {
13518
+ const jitterMs = Math.floor(Math.random() * jitterMax * 1e3);
13519
+ this._log.info(() => ["worker.start.jitter", { delayMs: jitterMs }]);
13520
+ this._scheduleNext(jitterMs);
13521
+ } else {
13522
+ this._scheduleNext(0);
13523
+ }
13524
+ }
13525
+ stop() {
13526
+ this._stopped = true;
13527
+ if (this._pollTimer) clearTimeout(this._pollTimer);
13528
+ this._pollTimer = null;
13529
+ if (this._inFlightActivation?.cancel) {
13530
+ try {
13531
+ this._inFlightActivation.cancel();
13532
+ } catch {
13533
+ }
13534
+ }
13535
+ this._log.info("worker.stop");
13536
+ }
13537
+ /**
13538
+ * Gracefully stop the worker: prevent new polls, allow any in-flight activation to finish
13539
+ * without cancellation, and wait for currently active jobs to drain (be acknowledged) up to waitUpToMs.
13540
+ * If timeout is reached, falls back to hard stop logic (cancels activation if still pending).
13541
+ */
13542
+ async stopGracefully(opts) {
13543
+ const waitUpToMs = opts?.waitUpToMs ?? 5e3;
13544
+ const checkIntervalMs = opts?.checkIntervalMs ?? 10;
13545
+ this._stopped = true;
13546
+ if (this._pollTimer) clearTimeout(this._pollTimer);
13547
+ this._pollTimer = null;
13548
+ const start = Date.now();
13549
+ if (this._inFlightActivation) {
13550
+ try {
13551
+ await Promise.race([
13552
+ this._inFlightActivation,
13553
+ new Promise(
13554
+ (_, rej) => setTimeout(() => rej(new Error("activation.wait.timeout")), waitUpToMs)
13555
+ )
13556
+ ]);
13557
+ } catch (e) {
13558
+ if (e && e.message === "activation.wait.timeout") {
13559
+ this._log.debug("worker.gracefulStop.activationTimeout");
13560
+ }
13561
+ }
13562
+ }
13563
+ while (this._activeJobs > 0 && Date.now() - start < waitUpToMs) {
13564
+ await new Promise((r) => setTimeout(r, checkIntervalMs));
13565
+ }
13566
+ const timedOut = this._activeJobs > 0;
13567
+ if (timedOut) {
13568
+ if (this._inFlightActivation?.cancel) {
13569
+ try {
13570
+ this._inFlightActivation.cancel();
13571
+ } catch {
13572
+ }
13573
+ }
13574
+ this._log.debug("worker.gracefulStop.timeout", { remaining: this._activeJobs });
13575
+ } else {
13576
+ this._log.debug("worker.gracefulStop.done");
13577
+ }
13578
+ return { remainingJobs: this._activeJobs, timedOut };
13579
+ }
13580
+ _scheduleNext(delayMs) {
13581
+ if (this._stopped) return;
13582
+ this._pollTimer = setTimeout(() => this._poll(), delayMs);
13583
+ }
13584
+ async _poll() {
13585
+ this._pollTimer = null;
13586
+ if (this._stopped) return;
13587
+ if (this._activeJobs >= this._cfg.maxParallelJobs) {
13588
+ this._scheduleNext(this._cfg.pollIntervalMs);
13589
+ return;
13590
+ }
13591
+ const batchSize = this._cfg.maxParallelJobs - this._activeJobs;
13592
+ if (batchSize <= 0) {
13593
+ this._scheduleNext(this._cfg.pollIntervalMs);
13594
+ return;
13595
+ }
13596
+ const body = {
13597
+ type: this._cfg.jobType,
13598
+ worker: this._name,
13599
+ maxJobsToActivate: batchSize,
13600
+ requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT,
13601
+ timeout: this._cfg.jobTimeoutMs,
13602
+ // API expects `fetchVariable`; map from config `fetchVariables`
13603
+ ...this._cfg.fetchVariables && this._cfg.fetchVariables.length > 0 ? { fetchVariable: this._cfg.fetchVariables } : {}
13604
+ };
13605
+ this._log.debug(() => ["activation.request", { batchSize }]);
13606
+ let result = [];
13607
+ try {
13608
+ this._inFlightActivation = this._client.activateJobs(body);
13609
+ const activation = await this._inFlightActivation;
13610
+ this._inFlightActivation = null;
13611
+ result = activation?.jobs || [];
13612
+ this._log.debug(() => ["activation.response", { jobs: result.length }]);
13613
+ } catch (e) {
13614
+ this._inFlightActivation = null;
13615
+ if (this._stopped) return;
13616
+ if (e?.name === "CancelSdkError") {
13617
+ this._log.debug("activation.cancelled");
13618
+ } else {
13619
+ this._log.error("activation.error", e);
13620
+ }
13621
+ this._scheduleNext(this._cfg.pollIntervalMs);
13622
+ return;
13623
+ }
13624
+ if (!result || result.length === 0) {
13625
+ this._scheduleNext(this._cfg.pollIntervalMs);
13626
+ return;
13627
+ }
13628
+ this._activeJobs += result.length;
13629
+ this._scheduleNext(0);
13630
+ for (const raw of result) {
13631
+ this._handleJob(raw).catch((err) => {
13632
+ this._log.error("job.handler.unexpected", err);
13633
+ });
13634
+ }
13635
+ }
13636
+ async _handleJob(raw) {
13637
+ if (this._stopped) {
13638
+ this._decrementOnce();
13639
+ return;
13640
+ }
13641
+ let variables = raw.variables;
13642
+ let headers = raw.customHeaders;
13643
+ if (this._cfg.validateSchemas) {
13644
+ if (this._cfg.inputSchema) {
13645
+ const parsed = this._cfg.inputSchema.safeParse(variables);
13646
+ if (!parsed.success) {
13647
+ this._log.warn("job.validation.variables.failed", parsed.error.flatten());
13648
+ await this._failValidation(raw, "Invalid variables");
13649
+ return;
13650
+ }
13651
+ variables = parsed.data;
13652
+ }
13653
+ if (this._cfg.customHeadersSchema) {
13654
+ const parsed = this._cfg.customHeadersSchema.safeParse(headers);
13655
+ if (!parsed.success) {
13656
+ this._log.warn("job.validation.headers.failed", parsed.error.flatten());
13657
+ await this._failValidation(raw, "Invalid custom headers");
13658
+ return;
13659
+ }
13660
+ headers = parsed.data;
13661
+ }
13662
+ }
13663
+ const job = Object.assign(raw, { variables, customHeaders: headers });
13664
+ try {
13665
+ const receipt = await this._cfg.jobHandler(job);
13666
+ if (!job.acknowledged) {
13667
+ this._log.warn("job.handler.noAction", { jobKey: raw.jobKey });
13668
+ }
13669
+ return receipt;
13670
+ } catch (e) {
13671
+ this._log.error("job.handler.error", e);
13672
+ try {
13673
+ const retries = raw.retries;
13674
+ await this._client.failJob({
13675
+ jobKey: raw.jobKey,
13676
+ errorMessage: e?.message || "Handler error",
13677
+ retries: typeof retries === "number" ? Math.max(0, retries - 1) : 0
13678
+ });
13679
+ } catch (failErr) {
13680
+ this._log.error("job.fail.error", failErr);
13681
+ }
13682
+ return JobActionReceipt;
13683
+ } finally {
13684
+ this._decrementOnce();
13685
+ }
13686
+ }
13687
+ async _failValidation(raw, msg) {
13688
+ try {
13689
+ await this._client.failJob({ jobKey: raw.jobKey, errorMessage: msg });
13690
+ } catch (e) {
13691
+ this._log.error("job.fail.validation.error", e);
13692
+ } finally {
13693
+ this._decrementOnce();
13694
+ }
13695
+ }
13696
+ _decrementOnce() {
13697
+ this._activeJobs = Math.max(0, this._activeJobs - 1);
13698
+ }
13699
+ };
13700
+
13701
+ // src/runtime/jobActions.ts
13702
+ function enrichActivatedJob(raw, client2, log) {
13703
+ let acknowledged = false;
13704
+ const ack = () => {
13705
+ if (!acknowledged) {
13706
+ acknowledged = true;
13707
+ job.acknowledged = true;
13708
+ }
13709
+ };
13710
+ const job = { ...raw, log };
13711
+ job.complete = async (variables = {}) => {
13712
+ try {
13713
+ await client2.completeJob({ variables, jobKey: raw.jobKey });
13714
+ } finally {
13715
+ ack();
13716
+ }
13717
+ return JobActionReceipt;
13718
+ };
13719
+ job.fail = async (reason) => {
13720
+ try {
13721
+ await client2.failJob({ ...reason, jobKey: raw.jobKey });
13722
+ } finally {
13723
+ ack();
13724
+ }
13725
+ return JobActionReceipt;
13726
+ };
13727
+ job.error = async (error) => {
13728
+ try {
13729
+ await client2.throwJobError({ ...error, jobKey: raw.jobKey });
13730
+ } finally {
13731
+ ack();
13732
+ }
13733
+ return JobActionReceipt;
13734
+ };
13735
+ job.cancelWorkflow = async () => {
13736
+ try {
13737
+ await client2.cancelProcessInstance({
13738
+ processInstanceKey: raw.processInstanceKey
13739
+ });
13740
+ } finally {
13741
+ ack();
13742
+ }
13743
+ return JobActionReceipt;
13744
+ };
13745
+ job.ignore = async () => {
13746
+ ack();
13747
+ return JobActionReceipt;
13748
+ };
13749
+ job.modifyJobTimeout = ({ newTimeoutMs }) => client2.updateJob({ changeset: { timeout: newTimeoutMs }, jobKey: raw.jobKey });
13750
+ job.modifyRetries = ({ retries }) => client2.updateJob({ changeset: { retries }, jobKey: raw.jobKey });
13751
+ return job;
13752
+ }
13343
13753
 
13344
- // src/runtime/jobWorker.ts
13345
- var JobActionReceipt = "JOB_ACTION_RECEIPT";
13346
- var _workerCounter = 0;
13347
- var DEFAULT_LONGPOLL_TIMEOUT = 0;
13348
- var JobWorker = class {
13754
+ // src/runtime/threadedJobWorker.ts
13755
+ var _workerCounter2 = 0;
13756
+ var DEFAULT_LONGPOLL_TIMEOUT2 = 0;
13757
+ var ThreadedJobWorker = class {
13349
13758
  _client;
13759
+ _pool;
13350
13760
  _cfg;
13351
13761
  _name;
13352
13762
  _activeJobs = 0;
13353
13763
  _stopped = false;
13354
13764
  _pollTimer = null;
13355
13765
  _inFlightActivation = null;
13356
- // CancelablePromise-like
13357
13766
  _log;
13358
- constructor(client2, cfg) {
13767
+ _jobQueue = [];
13768
+ constructor(client2, pool, cfg) {
13359
13769
  this._client = client2;
13770
+ this._pool = pool;
13360
13771
  this._cfg = { pollIntervalMs: 1, autoStart: true, validateSchemas: false, ...cfg };
13361
- this._name = cfg.workerName || `worker-${cfg.jobType}-${++_workerCounter}`;
13772
+ this._name = cfg.workerName || `threaded-worker-${cfg.jobType}-${++_workerCounter2}`;
13362
13773
  this._log = this._client.logger().scope(`worker:${this._name}`);
13363
- if (cfg.maxBackoffTimeMs !== void 0) {
13364
- this._log.debug(() => [
13365
- "worker.config.deprecated",
13366
- { maxBackoffTimeMs: cfg.maxBackoffTimeMs }
13367
- ]);
13368
- }
13369
13774
  if (this._cfg.autoStart) this.start();
13370
13775
  }
13371
13776
  get name() {
@@ -13377,6 +13782,18 @@ var JobWorker = class {
13377
13782
  get stopped() {
13378
13783
  return this._stopped;
13379
13784
  }
13785
+ /** Number of threads in the shared pool. */
13786
+ get poolSize() {
13787
+ return this._pool.size;
13788
+ }
13789
+ /** Number of threads currently processing a job (across all workers). */
13790
+ get busyThreads() {
13791
+ return this._pool.busyCount;
13792
+ }
13793
+ /** Resolves when the shared thread pool has finished initialising. */
13794
+ get ready() {
13795
+ return this._pool.ready;
13796
+ }
13380
13797
  start() {
13381
13798
  if (this._stopped) return;
13382
13799
  if (this._pollTimer) return;
@@ -13402,11 +13819,6 @@ var JobWorker = class {
13402
13819
  }
13403
13820
  this._log.info("worker.stop");
13404
13821
  }
13405
- /**
13406
- * Gracefully stop the worker: prevent new polls, allow any in-flight activation to finish
13407
- * without cancellation, and wait for currently active jobs to drain (be acknowledged) up to waitUpToMs.
13408
- * If timeout is reached, falls back to hard stop logic (cancels activation if still pending).
13409
- */
13410
13822
  async stopGracefully(opts) {
13411
13823
  const waitUpToMs = opts?.waitUpToMs ?? 5e3;
13412
13824
  const checkIntervalMs = opts?.checkIntervalMs ?? 10;
@@ -13445,6 +13857,47 @@ var JobWorker = class {
13445
13857
  }
13446
13858
  return { remainingJobs: this._activeJobs, timedOut };
13447
13859
  }
13860
+ // ─── Job dispatch ───
13861
+ _drainQueue() {
13862
+ while (this._jobQueue.length > 0) {
13863
+ const idle = this._pool.getIdleWorker();
13864
+ if (!idle) break;
13865
+ const item = this._jobQueue.shift();
13866
+ this._dispatchToThread(idle, item.raw);
13867
+ }
13868
+ }
13869
+ async _dispatchToThread(pw, raw) {
13870
+ const jobData = this._serializeJob(raw);
13871
+ this._pool.dispatch(pw, jobData, this._cfg.handlerModule, {
13872
+ onComplete: () => {
13873
+ this._decrementOnce();
13874
+ this._drainQueue();
13875
+ },
13876
+ onError: (err) => {
13877
+ this._log.error("job.thread.error", { jobKey: raw.jobKey, err });
13878
+ this._client.failJob({
13879
+ jobKey: raw.jobKey,
13880
+ errorMessage: err?.message || "Thread handler error",
13881
+ retries: typeof raw.retries === "number" ? Math.max(0, raw.retries - 1) : 0
13882
+ }).catch((failErr) => {
13883
+ this._log.error("job.fail.error", failErr);
13884
+ }).finally(() => {
13885
+ this._decrementOnce();
13886
+ this._drainQueue();
13887
+ });
13888
+ }
13889
+ });
13890
+ }
13891
+ _serializeJob(raw) {
13892
+ const data = {};
13893
+ for (const [key, value] of Object.entries(raw)) {
13894
+ if (typeof value === "function") continue;
13895
+ if (key === "log") continue;
13896
+ data[key] = value;
13897
+ }
13898
+ return JSON.parse(JSON.stringify(data));
13899
+ }
13900
+ // ─── Polling (same pattern as JobWorker) ───
13448
13901
  _scheduleNext(delayMs) {
13449
13902
  if (this._stopped) return;
13450
13903
  this._pollTimer = setTimeout(() => this._poll(), delayMs);
@@ -13452,11 +13905,13 @@ var JobWorker = class {
13452
13905
  async _poll() {
13453
13906
  this._pollTimer = null;
13454
13907
  if (this._stopped) return;
13908
+ await this._pool.ready;
13455
13909
  if (this._activeJobs >= this._cfg.maxParallelJobs) {
13456
13910
  this._scheduleNext(this._cfg.pollIntervalMs);
13457
13911
  return;
13458
13912
  }
13459
- const batchSize = this._cfg.maxParallelJobs - this._activeJobs;
13913
+ const availableThreads = this._pool.idleCount;
13914
+ const batchSize = Math.min(this._cfg.maxParallelJobs - this._activeJobs, availableThreads);
13460
13915
  if (batchSize <= 0) {
13461
13916
  this._scheduleNext(this._cfg.pollIntervalMs);
13462
13917
  return;
@@ -13465,9 +13920,8 @@ var JobWorker = class {
13465
13920
  type: this._cfg.jobType,
13466
13921
  worker: this._name,
13467
13922
  maxJobsToActivate: batchSize,
13468
- requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT,
13923
+ requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT2,
13469
13924
  timeout: this._cfg.jobTimeoutMs,
13470
- // API expects `fetchVariable`; map from config `fetchVariables`
13471
13925
  ...this._cfg.fetchVariables && this._cfg.fetchVariables.length > 0 ? { fetchVariable: this._cfg.fetchVariables } : {}
13472
13926
  };
13473
13927
  this._log.debug(() => ["activation.request", { batchSize }]);
@@ -13496,12 +13950,10 @@ var JobWorker = class {
13496
13950
  this._activeJobs += result.length;
13497
13951
  this._scheduleNext(0);
13498
13952
  for (const raw of result) {
13499
- this._handleJob(raw).catch((err) => {
13500
- this._log.error("job.handler.unexpected", err);
13501
- });
13953
+ this._handleJob(raw);
13502
13954
  }
13503
13955
  }
13504
- async _handleJob(raw) {
13956
+ _handleJob(raw) {
13505
13957
  if (this._stopped) {
13506
13958
  this._decrementOnce();
13507
13959
  return;
@@ -13513,7 +13965,7 @@ var JobWorker = class {
13513
13965
  const parsed = this._cfg.inputSchema.safeParse(variables);
13514
13966
  if (!parsed.success) {
13515
13967
  this._log.warn("job.validation.variables.failed", parsed.error.flatten());
13516
- await this._failValidation(raw, "Invalid variables");
13968
+ this._failValidation(raw, "Invalid variables");
13517
13969
  return;
13518
13970
  }
13519
13971
  variables = parsed.data;
@@ -13522,34 +13974,18 @@ var JobWorker = class {
13522
13974
  const parsed = this._cfg.customHeadersSchema.safeParse(headers);
13523
13975
  if (!parsed.success) {
13524
13976
  this._log.warn("job.validation.headers.failed", parsed.error.flatten());
13525
- await this._failValidation(raw, "Invalid custom headers");
13977
+ this._failValidation(raw, "Invalid custom headers");
13526
13978
  return;
13527
13979
  }
13528
13980
  headers = parsed.data;
13529
13981
  }
13530
13982
  }
13531
- const job = Object.assign(raw, { variables, customHeaders: headers });
13532
- try {
13533
- const receipt = await this._cfg.jobHandler(job);
13534
- if (!job.acknowledged) {
13535
- this._log.warn("job.handler.noAction", { jobKey: raw.jobKey });
13536
- }
13537
- return receipt;
13538
- } catch (e) {
13539
- this._log.error("job.handler.error", e);
13540
- try {
13541
- const retries = raw.retries;
13542
- await this._client.failJob({
13543
- jobKey: raw.jobKey,
13544
- errorMessage: e?.message || "Handler error",
13545
- retries: typeof retries === "number" ? Math.max(0, retries - 1) : 0
13546
- });
13547
- } catch (failErr) {
13548
- this._log.error("job.fail.error", failErr);
13549
- }
13550
- return JobActionReceipt;
13551
- } finally {
13552
- this._decrementOnce();
13983
+ const enriched = Object.assign(raw, { variables, customHeaders: headers });
13984
+ const idle = this._pool.getIdleWorker();
13985
+ if (idle) {
13986
+ this._dispatchToThread(idle, enriched);
13987
+ } else {
13988
+ this._jobQueue.push({ raw: enriched });
13553
13989
  }
13554
13990
  }
13555
13991
  async _failValidation(raw, msg) {
@@ -13566,58 +14002,188 @@ var JobWorker = class {
13566
14002
  }
13567
14003
  };
13568
14004
 
13569
- // src/runtime/jobActions.ts
13570
- function enrichActivatedJob(raw, client2, log) {
13571
- let acknowledged = false;
13572
- const ack = () => {
13573
- if (!acknowledged) {
13574
- acknowledged = true;
13575
- job.acknowledged = true;
13576
- }
13577
- };
13578
- const job = { ...raw, log };
13579
- job.complete = async (variables = {}) => {
14005
+ // src/runtime/clientProxy.ts
14006
+ function installClientCallHandler(port, client2) {
14007
+ port.on("message", async (msg) => {
14008
+ if (msg.type !== "client-call") return;
13580
14009
  try {
13581
- await client2.completeJob({ variables, jobKey: raw.jobKey });
13582
- } finally {
13583
- ack();
14010
+ const fn = client2[msg.method];
14011
+ if (typeof fn !== "function") {
14012
+ throw new Error(`CamundaClient has no method '${msg.method}'`);
14013
+ }
14014
+ const result = await fn.apply(client2, msg.args);
14015
+ const reply = { type: "client-call-result", callId: msg.callId, result };
14016
+ port.postMessage(reply);
14017
+ } catch (err) {
14018
+ const reply = {
14019
+ type: "client-call-result",
14020
+ callId: msg.callId,
14021
+ error: err?.message || String(err)
14022
+ };
14023
+ port.postMessage(reply);
13584
14024
  }
13585
- return JobActionReceipt;
13586
- };
13587
- job.fail = async (reason) => {
13588
- try {
13589
- await client2.failJob({ ...reason, jobKey: raw.jobKey });
13590
- } finally {
13591
- ack();
14025
+ });
14026
+ }
14027
+
14028
+ // src/runtime/threadPool.ts
14029
+ var import_meta = {};
14030
+ var ThreadPool = class {
14031
+ _pool = [];
14032
+ _pending = /* @__PURE__ */ new Map();
14033
+ _node;
14034
+ _log;
14035
+ _client;
14036
+ _ready;
14037
+ _terminated = false;
14038
+ constructor(client2, size) {
14039
+ this._client = client2;
14040
+ this._log = client2.logger().scope("thread-pool");
14041
+ this._ready = this._init(size);
14042
+ }
14043
+ /** Resolves when all threads have been spawned and signalled ready. */
14044
+ get ready() {
14045
+ return this._ready;
14046
+ }
14047
+ /** Total number of threads in the pool. */
14048
+ get size() {
14049
+ return this._pool.length;
14050
+ }
14051
+ /** Number of threads currently processing a job. */
14052
+ get busyCount() {
14053
+ return this._pool.filter((pw) => pw.busy).length;
14054
+ }
14055
+ /** Number of threads that are ready and idle. */
14056
+ get idleCount() {
14057
+ return this._pool.filter((pw) => pw.ready && !pw.busy).length;
14058
+ }
14059
+ /** Find the first ready & idle thread. */
14060
+ getIdleWorker() {
14061
+ return this._pool.find((pw) => pw.ready && !pw.busy);
14062
+ }
14063
+ /**
14064
+ * Dispatch a serialized job to a specific idle worker.
14065
+ * The caller is responsible for checking idleness first.
14066
+ */
14067
+ async dispatch(pw, jobData, handlerModule, callbacks) {
14068
+ const { randomUUID, MessageChannel } = this._node;
14069
+ const taskId = randomUUID();
14070
+ pw.busy = true;
14071
+ pw.currentTaskId = taskId;
14072
+ const { port1: mainPort, port2: workerPort } = new MessageChannel();
14073
+ installClientCallHandler(mainPort, this._client);
14074
+ this._pending.set(taskId, {
14075
+ resolve: () => {
14076
+ this._pending.delete(taskId);
14077
+ mainPort.close();
14078
+ callbacks.onComplete();
14079
+ },
14080
+ reject: (err) => {
14081
+ this._pending.delete(taskId);
14082
+ mainPort.close();
14083
+ callbacks.onError(err);
14084
+ }
14085
+ });
14086
+ pw.worker.postMessage({ type: "job", taskId, jobData, handlerModule, clientPort: workerPort }, [
14087
+ workerPort
14088
+ ]);
14089
+ }
14090
+ /** Terminate all threads and reject any in-flight tasks. */
14091
+ terminate() {
14092
+ this._terminated = true;
14093
+ for (const pw of this._pool) {
14094
+ pw.worker.terminate().catch(() => {
14095
+ });
13592
14096
  }
13593
- return JobActionReceipt;
13594
- };
13595
- job.error = async (error) => {
13596
- try {
13597
- await client2.throwJobError({ ...error, jobKey: raw.jobKey });
13598
- } finally {
13599
- ack();
14097
+ this._pool = [];
14098
+ for (const [, pending] of this._pending) {
14099
+ pending.reject(new Error("Thread pool terminated"));
13600
14100
  }
13601
- return JobActionReceipt;
13602
- };
13603
- job.cancelWorkflow = async () => {
13604
- try {
13605
- await client2.cancelProcessInstance({
13606
- processInstanceKey: raw.processInstanceKey
14101
+ this._pending.clear();
14102
+ }
14103
+ /** Reject the pending task for a worker that errored/exited and reset its state. */
14104
+ _rejectWorkerTask(pw, message) {
14105
+ pw.busy = false;
14106
+ if (pw.currentTaskId) {
14107
+ const pending = this._pending.get(pw.currentTaskId);
14108
+ if (pending) {
14109
+ this._pending.delete(pw.currentTaskId);
14110
+ pending.reject(new Error(message));
14111
+ }
14112
+ pw.currentTaskId = void 0;
14113
+ }
14114
+ }
14115
+ async _init(requestedSize) {
14116
+ const [workerThreads, pathMod, crypto] = await Promise.all([
14117
+ import("worker_threads"),
14118
+ import("path"),
14119
+ import("crypto")
14120
+ ]);
14121
+ const { Worker } = workerThreads;
14122
+ const { join } = pathMod;
14123
+ this._node = {
14124
+ MessageChannel: workerThreads.MessageChannel,
14125
+ randomUUID: crypto.randomUUID
14126
+ };
14127
+ const cpus = await (async () => {
14128
+ try {
14129
+ const os = await import("os");
14130
+ return os.availableParallelism?.() || os.cpus().length;
14131
+ } catch {
14132
+ return 4;
14133
+ }
14134
+ })();
14135
+ const size = requestedSize ?? cpus;
14136
+ const fs = await import("fs");
14137
+ const url = await import("url");
14138
+ const dir = typeof __dirname !== "undefined" ? __dirname : pathMod.dirname(url.fileURLToPath(import_meta.url));
14139
+ const jsPath = join(dir, "threadWorkerEntry.js");
14140
+ const tsPath = join(dir, "threadWorkerEntry.ts");
14141
+ const entryPath = fs.existsSync(jsPath) ? jsPath : tsPath;
14142
+ const nodeMajor = parseInt(process.versions.node, 10);
14143
+ const execArgv = entryPath.endsWith(".ts") || nodeMajor >= 22 ? ["--experimental-strip-types", "--experimental-transform-types"] : [];
14144
+ for (let i = 0; i < size; i++) {
14145
+ const worker = new Worker(entryPath, { execArgv });
14146
+ const pw = { worker, busy: false, ready: false };
14147
+ worker.on("message", (msg) => {
14148
+ if (msg.type === "ready") {
14149
+ pw.ready = true;
14150
+ this._log.debug(() => ["thread.ready", { index: i }]);
14151
+ return;
14152
+ }
14153
+ if (msg.type === "job-result") {
14154
+ this._log.debug(() => [
14155
+ "thread.job-result",
14156
+ { taskId: msg.taskId, ok: msg.ok, error: msg.error }
14157
+ ]);
14158
+ pw.busy = false;
14159
+ pw.currentTaskId = void 0;
14160
+ const pending = this._pending.get(msg.taskId);
14161
+ if (pending) {
14162
+ if (msg.ok) {
14163
+ pending.resolve(true);
14164
+ } else {
14165
+ pending.reject(new Error(msg.error || "Handler failed"));
14166
+ }
14167
+ }
14168
+ return;
14169
+ }
13607
14170
  });
13608
- } finally {
13609
- ack();
14171
+ worker.on("error", (err) => {
14172
+ this._log.error("thread.error", err);
14173
+ this._rejectWorkerTask(pw, `Worker thread error: ${err.message}`);
14174
+ pw.ready = false;
14175
+ });
14176
+ worker.on("exit", (code) => {
14177
+ if (!this._terminated) {
14178
+ this._log.warn("thread.exit", { code });
14179
+ this._rejectWorkerTask(pw, `Worker thread exited unexpectedly (code ${code})`);
14180
+ }
14181
+ });
14182
+ this._pool.push(pw);
13610
14183
  }
13611
- return JobActionReceipt;
13612
- };
13613
- job.ignore = async () => {
13614
- ack();
13615
- return JobActionReceipt;
13616
- };
13617
- job.modifyJobTimeout = ({ newTimeoutMs }) => client2.updateJob({ changeset: { timeout: newTimeoutMs }, jobKey: raw.jobKey });
13618
- job.modifyRetries = ({ retries }) => client2.updateJob({ changeset: { retries }, jobKey: raw.jobKey });
13619
- return job;
13620
- }
14184
+ this._log.info(() => ["thread-pool.init", { size, entryPath }]);
14185
+ }
14186
+ };
13621
14187
 
13622
14188
  // src/runtime/responseEvaluation.ts
13623
14189
  function evaluateSdkResponse(raw, opts) {
@@ -13707,6 +14273,8 @@ var CamundaClient = class {
13707
14273
  _bp;
13708
14274
  /** Registered job workers created via createJobWorker (lifecycle managed by user). */
13709
14275
  _workers = [];
14276
+ /** Shared thread pool for all threaded job workers (lazy-initialised on first use). */
14277
+ _threadPool = null;
13710
14278
  /** Support logger (Node-only; no-op in browser). */
13711
14279
  _supportLogger = new class {
13712
14280
  log() {
@@ -14002,7 +14570,7 @@ var CamundaClient = class {
14002
14570
  getWorkers() {
14003
14571
  return [...this._workers];
14004
14572
  }
14005
- /** Stop all registered job workers (best-effort). */
14573
+ /** Stop all registered job workers (best-effort) and terminate the shared thread pool. */
14006
14574
  stopAllWorkers() {
14007
14575
  for (const w of this._workers) {
14008
14576
  try {
@@ -14011,6 +14579,17 @@ var CamundaClient = class {
14011
14579
  this._log.warn("worker.stop.error", e);
14012
14580
  }
14013
14581
  }
14582
+ if (this._threadPool) {
14583
+ this._threadPool.terminate();
14584
+ this._threadPool = null;
14585
+ }
14586
+ }
14587
+ /** Get or lazily create the shared thread pool for threaded job workers. */
14588
+ _getOrCreateThreadPool(threadPoolSize) {
14589
+ if (!this._threadPool) {
14590
+ this._threadPool = new ThreadPool(this, threadPoolSize);
14591
+ }
14592
+ return this._threadPool;
14014
14593
  }
14015
14594
  activateAdHocSubProcessActivities(arg, options) {
14016
14595
  return toCancelable2(async (signal) => {
@@ -16021,9 +16600,9 @@ var CamundaClient = class {
16021
16600
  }
16022
16601
  deleteDecisionInstance(arg, options) {
16023
16602
  return toCancelable2(async (signal) => {
16024
- const { decisionInstanceKey, ..._body } = arg || {};
16603
+ const { decisionEvaluationKey, ..._body } = arg || {};
16025
16604
  let envelope = {};
16026
- envelope.path = { decisionInstanceKey };
16605
+ envelope.path = { decisionEvaluationKey };
16027
16606
  envelope.body = _body;
16028
16607
  if (this._validation.settings.req !== "none") {
16029
16608
  const maybe = await this._validation.gateRequest("deleteDecisionInstance", zDeleteDecisionInstanceData, envelope);
@@ -17791,6 +18370,60 @@ var CamundaClient = class {
17791
18370
  return invoke();
17792
18371
  });
17793
18372
  }
18373
+ getJobErrorStatistics(arg, consistencyManagement, options) {
18374
+ if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
18375
+ const useConsistency = consistencyManagement.consistency;
18376
+ return toCancelable2(async (signal) => {
18377
+ const _body = arg;
18378
+ let envelope = {};
18379
+ envelope.body = _body;
18380
+ if (this._validation.settings.req !== "none") {
18381
+ const maybe = await this._validation.gateRequest("getJobErrorStatistics", zGetJobErrorStatisticsData, envelope);
18382
+ if (this._validation.settings.req === "strict") envelope = maybe;
18383
+ }
18384
+ const opts = { client: this._client, signal, throwOnError: false };
18385
+ if (envelope.body !== void 0) opts.body = envelope.body;
18386
+ const call = async () => {
18387
+ try {
18388
+ const _raw = await getJobErrorStatistics(opts);
18389
+ let data = this._evaluateResponse(_raw, "getJobErrorStatistics", (resp) => {
18390
+ const st = resp.status ?? resp.response?.status;
18391
+ if (!st) return void 0;
18392
+ const candidate = st === 429 || st === 503 || st === 500;
18393
+ if (!candidate) return void 0;
18394
+ let prob = void 0;
18395
+ if (resp.error && typeof resp.error === "object") prob = resp.error;
18396
+ const err = new Error(prob && (prob.title || prob.detail) ? prob.title || prob.detail : "HTTP " + st);
18397
+ err.status = st;
18398
+ err.name = "HttpSdkError";
18399
+ if (prob) {
18400
+ for (const k of ["type", "title", "detail", "instance"]) if (prob[k] !== void 0) err[k] = prob[k];
18401
+ }
18402
+ const isBp = st === 429 || st === 503 && err.title === "RESOURCE_EXHAUSTED" || st === 500 && (typeof err.detail === "string" && /RESOURCE_EXHAUSTED/.test(err.detail));
18403
+ if (!isBp) err.nonRetryable = true;
18404
+ return err;
18405
+ });
18406
+ const _respSchemaName = "zGetJobErrorStatisticsResponse";
18407
+ if (this._isVoidResponse(_respSchemaName)) {
18408
+ data = void 0;
18409
+ }
18410
+ if (this._validation.settings.res !== "none") {
18411
+ const _schema = zGetJobErrorStatisticsResponse;
18412
+ if (_schema) {
18413
+ const maybeR = await this._validation.gateResponse("getJobErrorStatistics", _schema, data);
18414
+ if (this._validation.settings.res === "strict") data = maybeR;
18415
+ }
18416
+ }
18417
+ return data;
18418
+ } catch (e) {
18419
+ throw e;
18420
+ }
18421
+ };
18422
+ const invoke = () => toCancelable2(() => call());
18423
+ if (useConsistency) return eventualPoll("getJobErrorStatistics", false, invoke, { ...useConsistency, logger: this._log });
18424
+ return invoke();
18425
+ });
18426
+ }
17794
18427
  getJobTimeSeriesStatistics(arg, consistencyManagement, options) {
17795
18428
  if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
17796
18429
  const useConsistency = consistencyManagement.consistency;
@@ -18949,6 +19582,48 @@ var CamundaClient = class {
18949
19582
  return this._invokeWithRetry(() => call(), { opId: "getStatus", exempt: false, retryOverride: options?.retry });
18950
19583
  });
18951
19584
  }
19585
+ getSystemConfiguration(arg, options) {
19586
+ return toCancelable2(async (signal) => {
19587
+ const opts = { client: this._client, signal, throwOnError: false };
19588
+ const call = async () => {
19589
+ try {
19590
+ const _raw = await getSystemConfiguration(opts);
19591
+ let data = this._evaluateResponse(_raw, "getSystemConfiguration", (resp) => {
19592
+ const st = resp.status ?? resp.response?.status;
19593
+ if (!st) return void 0;
19594
+ const candidate = st === 429 || st === 503 || st === 500;
19595
+ if (!candidate) return void 0;
19596
+ let prob = void 0;
19597
+ if (resp.error && typeof resp.error === "object") prob = resp.error;
19598
+ const err = new Error(prob && (prob.title || prob.detail) ? prob.title || prob.detail : "HTTP " + st);
19599
+ err.status = st;
19600
+ err.name = "HttpSdkError";
19601
+ if (prob) {
19602
+ for (const k of ["type", "title", "detail", "instance"]) if (prob[k] !== void 0) err[k] = prob[k];
19603
+ }
19604
+ const isBp = st === 429 || st === 503 && err.title === "RESOURCE_EXHAUSTED" || st === 500 && (typeof err.detail === "string" && /RESOURCE_EXHAUSTED/.test(err.detail));
19605
+ if (!isBp) err.nonRetryable = true;
19606
+ return err;
19607
+ });
19608
+ const _respSchemaName = "zGetSystemConfigurationResponse";
19609
+ if (this._isVoidResponse(_respSchemaName)) {
19610
+ data = void 0;
19611
+ }
19612
+ if (this._validation.settings.res !== "none") {
19613
+ const _schema = zGetSystemConfigurationResponse;
19614
+ if (_schema) {
19615
+ const maybeR = await this._validation.gateResponse("getSystemConfiguration", _schema, data);
19616
+ if (this._validation.settings.res === "strict") data = maybeR;
19617
+ }
19618
+ }
19619
+ return data;
19620
+ } catch (e) {
19621
+ throw e;
19622
+ }
19623
+ };
19624
+ return this._invokeWithRetry(() => call(), { opId: "getSystemConfiguration", exempt: false, retryOverride: options?.retry });
19625
+ });
19626
+ }
18952
19627
  getTenant(arg, consistencyManagement, options) {
18953
19628
  if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
18954
19629
  const useConsistency = consistencyManagement.consistency;
@@ -23463,6 +24138,31 @@ var CamundaClient = class {
23463
24138
  this._workers.push(worker);
23464
24139
  return worker;
23465
24140
  }
24141
+ /**
24142
+ * Create a threaded job worker that runs handler logic in a pool of worker threads.
24143
+ * The handler must be a separate module file that exports a default function with
24144
+ * signature `(job, client) => Promise<JobActionReceipt>`.
24145
+ *
24146
+ * This keeps the main event loop free for polling and I/O, dramatically improving
24147
+ * throughput for CPU-bound job handlers.
24148
+ *
24149
+ * @param cfg Threaded worker configuration
24150
+ * @example Create a threaded job worker
24151
+ * ```ts
24152
+ * const worker = client.createThreadedJobWorker({
24153
+ * jobType: 'cpu-heavy-task',
24154
+ * handlerModule: './my-handler.js',
24155
+ * maxParallelJobs: 32,
24156
+ * jobTimeoutMs: 30000,
24157
+ * })
24158
+ * ```
24159
+ */
24160
+ createThreadedJobWorker(cfg) {
24161
+ const pool = this._getOrCreateThreadPool(cfg.threadPoolSize);
24162
+ const worker = new ThreadedJobWorker(this, pool, cfg);
24163
+ this._workers.push(worker);
24164
+ return worker;
24165
+ }
23466
24166
  /**
23467
24167
  * Node-only convenience: deploy resources from local filesystem paths.
23468
24168
  * @param resourceFilenames Absolute or relative file paths to BPMN/DMN/form/resource files.