@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/index.cjs CHANGED
@@ -1256,7 +1256,7 @@ var deleteDecisionInstance = (options) => {
1256
1256
  return (options.client ?? client).post({
1257
1257
  requestValidator: void 0,
1258
1258
  responseValidator: void 0,
1259
- url: "/decision-instances/{decisionInstanceKey}/deletion",
1259
+ url: "/decision-instances/{decisionEvaluationKey}/deletion",
1260
1260
  ...options,
1261
1261
  headers: {
1262
1262
  "Content-Type": "application/json",
@@ -1811,6 +1811,18 @@ var getJobTimeSeriesStatistics = (options) => {
1811
1811
  }
1812
1812
  });
1813
1813
  };
1814
+ var getJobErrorStatistics = (options) => {
1815
+ return (options.client ?? client).post({
1816
+ requestValidator: void 0,
1817
+ responseValidator: void 0,
1818
+ url: "/jobs/statistics/errors",
1819
+ ...options,
1820
+ headers: {
1821
+ "Content-Type": "application/json",
1822
+ ...options.headers
1823
+ }
1824
+ });
1825
+ };
1814
1826
  var getLicense = (options) => {
1815
1827
  return (options?.client ?? client).get({
1816
1828
  requestValidator: void 0,
@@ -2407,6 +2419,14 @@ var getUsageMetrics = (options) => {
2407
2419
  ...options
2408
2420
  });
2409
2421
  };
2422
+ var getSystemConfiguration = (options) => {
2423
+ return (options?.client ?? client).get({
2424
+ requestValidator: void 0,
2425
+ responseValidator: void 0,
2426
+ url: "/system/configuration",
2427
+ ...options
2428
+ });
2429
+ };
2410
2430
  var createTenant = (options) => {
2411
2431
  return (options.client ?? client).post({
2412
2432
  requestValidator: void 0,
@@ -3104,6 +3124,7 @@ __export(zod_gen_exports, {
3104
3124
  zEvaluatedDecisionResult: () => zEvaluatedDecisionResult,
3105
3125
  zExpressionEvaluationRequest: () => zExpressionEvaluationRequest,
3106
3126
  zExpressionEvaluationResult: () => zExpressionEvaluationResult,
3127
+ zExpressionEvaluationWarningItem: () => zExpressionEvaluationWarningItem,
3107
3128
  zFailJobData: () => zFailJobData,
3108
3129
  zFailJobResponse: () => zFailJobResponse,
3109
3130
  zFormId: () => zFormId,
@@ -3143,6 +3164,8 @@ __export(zod_gen_exports, {
3143
3164
  zGetGroupResponse: () => zGetGroupResponse,
3144
3165
  zGetIncidentData: () => zGetIncidentData,
3145
3166
  zGetIncidentResponse: () => zGetIncidentResponse,
3167
+ zGetJobErrorStatisticsData: () => zGetJobErrorStatisticsData,
3168
+ zGetJobErrorStatisticsResponse: () => zGetJobErrorStatisticsResponse,
3146
3169
  zGetJobTimeSeriesStatisticsData: () => zGetJobTimeSeriesStatisticsData,
3147
3170
  zGetJobTimeSeriesStatisticsResponse: () => zGetJobTimeSeriesStatisticsResponse,
3148
3171
  zGetJobTypeStatisticsData: () => zGetJobTypeStatisticsData,
@@ -3187,6 +3210,8 @@ __export(zod_gen_exports, {
3187
3210
  zGetStartProcessFormResponse: () => zGetStartProcessFormResponse,
3188
3211
  zGetStatusData: () => zGetStatusData,
3189
3212
  zGetStatusResponse: () => zGetStatusResponse,
3213
+ zGetSystemConfigurationData: () => zGetSystemConfigurationData,
3214
+ zGetSystemConfigurationResponse: () => zGetSystemConfigurationResponse,
3190
3215
  zGetTenantClusterVariableData: () => zGetTenantClusterVariableData,
3191
3216
  zGetTenantClusterVariableResponse: () => zGetTenantClusterVariableResponse,
3192
3217
  zGetTenantData: () => zGetTenantData,
@@ -3267,6 +3292,10 @@ __export(zod_gen_exports, {
3267
3292
  zJobChangeset: () => zJobChangeset,
3268
3293
  zJobCompletionRequest: () => zJobCompletionRequest,
3269
3294
  zJobErrorRequest: () => zJobErrorRequest,
3295
+ zJobErrorStatisticsFilter: () => zJobErrorStatisticsFilter,
3296
+ zJobErrorStatisticsItem: () => zJobErrorStatisticsItem,
3297
+ zJobErrorStatisticsQuery: () => zJobErrorStatisticsQuery,
3298
+ zJobErrorStatisticsQueryResult: () => zJobErrorStatisticsQueryResult,
3270
3299
  zJobFailRequest: () => zJobFailRequest,
3271
3300
  zJobFilter: () => zJobFilter,
3272
3301
  zJobKey: () => zJobKey,
@@ -3278,6 +3307,7 @@ __export(zod_gen_exports, {
3278
3307
  zJobListenerEventTypeEnum: () => zJobListenerEventTypeEnum,
3279
3308
  zJobListenerEventTypeExactMatch: () => zJobListenerEventTypeExactMatch,
3280
3309
  zJobListenerEventTypeFilterProperty: () => zJobListenerEventTypeFilterProperty,
3310
+ zJobMetricsConfigurationResponse: () => zJobMetricsConfigurationResponse,
3281
3311
  zJobResult: () => zJobResult,
3282
3312
  zJobResultActivateElement: () => zJobResultActivateElement,
3283
3313
  zJobResultAdHocSubProcess: () => zJobResultAdHocSubProcess,
@@ -3556,6 +3586,7 @@ __export(zod_gen_exports, {
3556
3586
  zStringFilterProperty: () => zStringFilterProperty,
3557
3587
  zSuspendBatchOperationData: () => zSuspendBatchOperationData,
3558
3588
  zSuspendBatchOperationResponse: () => zSuspendBatchOperationResponse,
3589
+ zSystemConfigurationResponse: () => zSystemConfigurationResponse,
3559
3590
  zTag: () => zTag,
3560
3591
  zTagSet: () => zTagSet,
3561
3592
  zTenantClientResult: () => zTenantClientResult,
@@ -3881,18 +3912,18 @@ var zAuthorizationFilter = import_zod.z.object({
3881
3912
  description: "Authorization search filter."
3882
3913
  });
3883
3914
  var zBatchOperationError = import_zod.z.object({
3884
- partitionId: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
3915
+ partitionId: import_zod.z.int().register(import_zod.z.globalRegistry, {
3885
3916
  description: "The partition ID where the error occurred."
3886
- })),
3887
- type: import_zod.z.optional(import_zod.z.enum([
3917
+ }),
3918
+ type: import_zod.z.enum([
3888
3919
  "QUERY_FAILED",
3889
3920
  "RESULT_BUFFER_SIZE_EXCEEDED"
3890
3921
  ]).register(import_zod.z.globalRegistry, {
3891
3922
  description: "The type of the error that occurred during the batch operation."
3892
- })),
3893
- message: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
3923
+ }),
3924
+ message: import_zod.z.string().register(import_zod.z.globalRegistry, {
3894
3925
  description: "The error message that occurred during the batch operation."
3895
- }))
3926
+ })
3896
3927
  });
3897
3928
  var zBatchOperationItemStateEnum = import_zod.z.enum([
3898
3929
  "ACTIVE",
@@ -4022,10 +4053,10 @@ var zTopologyResponse = import_zod.z.object({
4022
4053
  brokers: import_zod.z.array(zBrokerInfo).register(import_zod.z.globalRegistry, {
4023
4054
  description: "A list of brokers that are part of this cluster."
4024
4055
  }),
4025
- clusterId: import_zod.z.optional(import_zod.z.union([
4056
+ clusterId: import_zod.z.union([
4026
4057
  import_zod.z.string(),
4027
4058
  import_zod.z.null()
4028
- ])),
4059
+ ]),
4029
4060
  clusterSize: import_zod.z.int().register(import_zod.z.globalRegistry, {
4030
4061
  description: "The number of brokers in the cluster."
4031
4062
  }),
@@ -4051,28 +4082,28 @@ var zEndCursor = import_zod.z.string().regex(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0
4051
4082
  description: "The end cursor in a search query result set."
4052
4083
  });
4053
4084
  var zEvaluatedDecisionInputItem = import_zod.z.object({
4054
- inputId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4085
+ inputId: import_zod.z.string().register(import_zod.z.globalRegistry, {
4055
4086
  description: "The identifier of the decision input."
4056
- })),
4057
- inputName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4087
+ }),
4088
+ inputName: import_zod.z.string().register(import_zod.z.globalRegistry, {
4058
4089
  description: "The name of the decision input."
4059
- })),
4060
- inputValue: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4061
- description: "The description of the decision input."
4062
- }))
4090
+ }),
4091
+ inputValue: import_zod.z.string().register(import_zod.z.globalRegistry, {
4092
+ description: "The value of the decision input."
4093
+ })
4063
4094
  }).register(import_zod.z.globalRegistry, {
4064
4095
  description: "A decision input that was evaluated within this decision evaluation."
4065
4096
  });
4066
4097
  var zEvaluatedDecisionOutputItem = import_zod.z.object({
4067
- outputId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4098
+ outputId: import_zod.z.string().register(import_zod.z.globalRegistry, {
4068
4099
  description: "The ID of the evaluated decison output item."
4069
- })),
4070
- outputName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4100
+ }),
4101
+ outputName: import_zod.z.string().register(import_zod.z.globalRegistry, {
4071
4102
  description: "The name of the of the evaluated decison output item."
4072
- })),
4073
- outputValue: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4103
+ }),
4104
+ outputValue: import_zod.z.string().register(import_zod.z.globalRegistry, {
4074
4105
  description: "The value of the evaluated decison output item."
4075
- })),
4106
+ }),
4076
4107
  ruleId: import_zod.z.union([
4077
4108
  import_zod.z.string(),
4078
4109
  import_zod.z.null()
@@ -4085,12 +4116,12 @@ var zEvaluatedDecisionOutputItem = import_zod.z.object({
4085
4116
  description: "The evaluated decision outputs."
4086
4117
  });
4087
4118
  var zMatchedDecisionRuleItem = import_zod.z.object({
4088
- ruleId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4119
+ ruleId: import_zod.z.string().register(import_zod.z.globalRegistry, {
4089
4120
  description: "The ID of the matched rule."
4090
- })),
4091
- ruleIndex: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4121
+ }),
4122
+ ruleIndex: import_zod.z.int().register(import_zod.z.globalRegistry, {
4092
4123
  description: "The index of the matched rule."
4093
- })),
4124
+ }),
4094
4125
  evaluatedOutputs: import_zod.z.array(zEvaluatedDecisionOutputItem).register(import_zod.z.globalRegistry, {
4095
4126
  description: "The evaluated decision outputs."
4096
4127
  })
@@ -4114,18 +4145,18 @@ var zDecisionInstanceStateEnum = import_zod.z.enum([
4114
4145
  description: "The state of the decision instance. UNSPECIFIED and UNKNOWN are deprecated and should not be used anymore, for removal in 8.10"
4115
4146
  });
4116
4147
  var zDocumentCreationFailureDetail = import_zod.z.object({
4117
- fileName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4148
+ fileName: import_zod.z.string().register(import_zod.z.globalRegistry, {
4118
4149
  description: "The name of the file that failed to upload."
4119
- })),
4120
- status: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4150
+ }),
4151
+ status: import_zod.z.int().register(import_zod.z.globalRegistry, {
4121
4152
  description: "The HTTP status code of the failure."
4122
- })),
4123
- title: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4153
+ }),
4154
+ title: import_zod.z.string().register(import_zod.z.globalRegistry, {
4124
4155
  description: "A short, human-readable summary of the problem type."
4125
- })),
4126
- detail: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4156
+ }),
4157
+ detail: import_zod.z.string().register(import_zod.z.globalRegistry, {
4127
4158
  description: "A human-readable explanation specific to this occurrence of the problem."
4128
- }))
4159
+ })
4129
4160
  });
4130
4161
  var zDocumentLinkRequest = import_zod.z.object({
4131
4162
  timeToLive: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
@@ -4162,6 +4193,11 @@ var zExpressionEvaluationRequest = import_zod.z.object({
4162
4193
  import_zod.z.null()
4163
4194
  ]))
4164
4195
  });
4196
+ var zExpressionEvaluationWarningItem = import_zod.z.object({
4197
+ message: import_zod.z.string().register(import_zod.z.globalRegistry, {
4198
+ description: "The warning message"
4199
+ })
4200
+ });
4165
4201
  var zExpressionEvaluationResult = import_zod.z.object({
4166
4202
  expression: import_zod.z.string().register(import_zod.z.globalRegistry, {
4167
4203
  description: "The evaluated expression"
@@ -4169,7 +4205,7 @@ var zExpressionEvaluationResult = import_zod.z.object({
4169
4205
  result: import_zod.z.unknown().register(import_zod.z.globalRegistry, {
4170
4206
  description: "The result value. Its type can vary."
4171
4207
  }),
4172
- warnings: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
4208
+ warnings: import_zod.z.array(zExpressionEvaluationWarningItem).register(import_zod.z.globalRegistry, {
4173
4209
  description: "List of warnings generated during expression evaluation"
4174
4210
  })
4175
4211
  });
@@ -4557,7 +4593,7 @@ var zGroupClientResult = import_zod.z.object({
4557
4593
  description: "The ID of the client."
4558
4594
  })
4559
4595
  });
4560
- var zProcessDefinitionId = import_zod.z.string().min(1).regex(/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/).register(import_zod.z.globalRegistry, {
4596
+ var zProcessDefinitionId = import_zod.z.string().min(1).regex(/^[\p{L}_][\p{L}\p{N}_\-\.]*$/u).register(import_zod.z.globalRegistry, {
4561
4597
  description: "Id of a process definition, from the model. Only ids of process definitions that are deployed are useful."
4562
4598
  });
4563
4599
  var zElementId = import_zod.z.string().register(import_zod.z.globalRegistry, {
@@ -4586,7 +4622,7 @@ var zAdHocSubProcessActivateActivitiesInstruction = import_zod.z.object({
4586
4622
  var zFormId = import_zod.z.string().register(import_zod.z.globalRegistry, {
4587
4623
  description: "The user-defined id for the form"
4588
4624
  });
4589
- var zDecisionDefinitionId = import_zod.z.string().min(1).max(256).regex(/^[A-Za-z0-9_@.+-]+$/).register(import_zod.z.globalRegistry, {
4625
+ var zDecisionDefinitionId = import_zod.z.string().min(1).regex(/^[\p{L}_][\p{L}\p{N}_\-\.]*$/u).register(import_zod.z.globalRegistry, {
4590
4626
  description: "Id of a decision definition, from the model. Only ids of decision definitions that are deployed are useful."
4591
4627
  });
4592
4628
  var zGlobalListenerId = import_zod.z.string().register(import_zod.z.globalRegistry, {
@@ -4688,15 +4724,15 @@ var zAdvancedIncidentStateFilter = import_zod.z.object({
4688
4724
  description: "Advanced IncidentStateEnum filter"
4689
4725
  });
4690
4726
  var zIncidentProcessInstanceStatisticsByErrorResult = import_zod.z.object({
4691
- errorHashCode: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4727
+ errorHashCode: import_zod.z.int().register(import_zod.z.globalRegistry, {
4692
4728
  description: "The hash code identifying a specific incident error.."
4693
- })),
4694
- errorMessage: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
4729
+ }),
4730
+ errorMessage: import_zod.z.string().register(import_zod.z.globalRegistry, {
4695
4731
  description: "The error message associated with the incident error hash code."
4696
- })),
4697
- activeInstancesWithErrorCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
4732
+ }),
4733
+ activeInstancesWithErrorCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
4698
4734
  description: "The number of active process instances that currently have an active incident with this error.\n"
4699
- }))
4735
+ })
4700
4736
  });
4701
4737
  var zIncidentProcessInstanceStatisticsByDefinitionFilter = import_zod.z.object({
4702
4738
  errorHashCode: import_zod.z.int().register(import_zod.z.globalRegistry, {
@@ -4765,7 +4801,7 @@ var zJobWorkerStatisticsFilter = import_zod.z.object({
4765
4801
  });
4766
4802
  var zJobWorkerStatisticsItem = import_zod.z.object({
4767
4803
  worker: import_zod.z.string().register(import_zod.z.globalRegistry, {
4768
- description: "The worker identifier."
4804
+ description: "The name of the worker activating the jobs, mostly used for logging purposes."
4769
4805
  }),
4770
4806
  created: zStatusMetric,
4771
4807
  completed: zStatusMetric,
@@ -4799,6 +4835,34 @@ var zJobTimeSeriesStatisticsItem = import_zod.z.object({
4799
4835
  }).register(import_zod.z.globalRegistry, {
4800
4836
  description: "Aggregated job metrics for a single time bucket."
4801
4837
  });
4838
+ var zJobErrorStatisticsFilter = import_zod.z.object({
4839
+ from: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
4840
+ description: "Start of the time window to filter metrics. ISO 8601 date-time format.\n"
4841
+ }),
4842
+ to: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
4843
+ description: "End of the time window to filter metrics. ISO 8601 date-time format.\n"
4844
+ }),
4845
+ jobType: import_zod.z.string().register(import_zod.z.globalRegistry, {
4846
+ description: "Job type to return error metrics for."
4847
+ }),
4848
+ errorCode: import_zod.z.optional(zStringFilterProperty),
4849
+ errorMessage: import_zod.z.optional(zStringFilterProperty)
4850
+ }).register(import_zod.z.globalRegistry, {
4851
+ description: "Job error statistics search filter."
4852
+ });
4853
+ var zJobErrorStatisticsItem = import_zod.z.object({
4854
+ errorCode: import_zod.z.string().register(import_zod.z.globalRegistry, {
4855
+ description: "The error code identifier."
4856
+ }),
4857
+ errorMessage: import_zod.z.string().register(import_zod.z.globalRegistry, {
4858
+ description: "The error message."
4859
+ }),
4860
+ workers: import_zod.z.int().register(import_zod.z.globalRegistry, {
4861
+ description: "Number of distinct workers that encountered this error."
4862
+ })
4863
+ }).register(import_zod.z.globalRegistry, {
4864
+ description: "Aggregated error metrics for a single error type and message combination."
4865
+ });
4802
4866
  var zJobFailRequest = import_zod.z.object({
4803
4867
  retries: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
4804
4868
  description: "The amount of retries the job should have left"
@@ -5152,8 +5216,8 @@ var zConditionalEvaluationInstruction = import_zod.z.object({
5152
5216
  })
5153
5217
  });
5154
5218
  var zProcessInstanceReference = import_zod.z.object({
5155
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
5156
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey)
5219
+ processDefinitionKey: zProcessDefinitionKey,
5220
+ processInstanceKey: zProcessInstanceKey
5157
5221
  });
5158
5222
  var zEvaluateConditionalResult = import_zod.z.object({
5159
5223
  conditionalEvaluationKey: zConditionalEvaluationKey,
@@ -5176,32 +5240,32 @@ var zDeploymentProcessResult = import_zod.z.object({
5176
5240
  description: "A deployed process."
5177
5241
  });
5178
5242
  var zIncidentProcessInstanceStatisticsByDefinitionResult = import_zod.z.object({
5179
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
5180
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
5181
- processDefinitionName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5243
+ processDefinitionId: zProcessDefinitionId,
5244
+ processDefinitionKey: zProcessDefinitionKey,
5245
+ processDefinitionName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5182
5246
  description: "The name of the process definition."
5183
- })),
5184
- processDefinitionVersion: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5247
+ }),
5248
+ processDefinitionVersion: import_zod.z.int().register(import_zod.z.globalRegistry, {
5185
5249
  description: "The version of the process definition."
5186
- })),
5187
- tenantId: import_zod.z.optional(zTenantId),
5188
- activeInstancesWithErrorCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
5250
+ }),
5251
+ tenantId: zTenantId,
5252
+ activeInstancesWithErrorCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
5189
5253
  description: "The number of active process instances that currently have an incident\nwith the specified error hash code.\n"
5190
- }))
5254
+ })
5191
5255
  });
5192
5256
  var zElementInstanceKey = zLongKey;
5193
5257
  var zUserTaskKey = zLongKey;
5194
5258
  var zFormKey = zLongKey;
5195
5259
  var zDeploymentFormResult = import_zod.z.object({
5196
- formId: import_zod.z.optional(zFormId),
5197
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5260
+ formId: zFormId,
5261
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5198
5262
  description: "The version of the deployed form."
5199
- })),
5200
- resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5263
+ }),
5264
+ resourceName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5201
5265
  description: "The name of the resource."
5202
- })),
5203
- tenantId: import_zod.z.optional(zTenantId),
5204
- formKey: import_zod.z.optional(zFormKey)
5266
+ }),
5267
+ tenantId: zTenantId,
5268
+ formKey: zFormKey
5205
5269
  }).register(import_zod.z.globalRegistry, {
5206
5270
  description: "A deployed form."
5207
5271
  });
@@ -5217,13 +5281,13 @@ var zFormResult = import_zod.z.object({
5217
5281
  formKey: zFormKey
5218
5282
  });
5219
5283
  var zUserTaskProperties = import_zod.z.object({
5220
- action: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5284
+ action: import_zod.z.string().register(import_zod.z.globalRegistry, {
5221
5285
  description: "The action performed on the user task."
5222
- })),
5223
- assignee: import_zod.z.optional(import_zod.z.union([
5286
+ }),
5287
+ assignee: import_zod.z.union([
5224
5288
  import_zod.z.string(),
5225
5289
  import_zod.z.null()
5226
- ])),
5290
+ ]),
5227
5291
  candidateGroups: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
5228
5292
  description: "The groups eligible to claim the task."
5229
5293
  }),
@@ -5233,23 +5297,26 @@ var zUserTaskProperties = import_zod.z.object({
5233
5297
  changedAttributes: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
5234
5298
  description: "The attributes that were changed in the task."
5235
5299
  }),
5236
- dueDate: import_zod.z.optional(import_zod.z.union([
5300
+ dueDate: import_zod.z.union([
5237
5301
  import_zod.z.string(),
5238
5302
  import_zod.z.null()
5239
- ])),
5240
- followUpDate: import_zod.z.optional(import_zod.z.union([
5303
+ ]),
5304
+ followUpDate: import_zod.z.union([
5241
5305
  import_zod.z.string(),
5242
5306
  import_zod.z.null()
5243
- ])),
5244
- formKey: import_zod.z.optional(zFormKey),
5245
- priority: import_zod.z.optional(import_zod.z.union([
5307
+ ]),
5308
+ formKey: import_zod.z.union([
5309
+ zFormKey,
5310
+ import_zod.z.null()
5311
+ ]),
5312
+ priority: import_zod.z.union([
5246
5313
  import_zod.z.int().gte(0).lte(100),
5247
5314
  import_zod.z.null()
5248
- ])),
5249
- userTaskKey: import_zod.z.optional(import_zod.z.union([
5315
+ ]),
5316
+ userTaskKey: import_zod.z.union([
5250
5317
  zUserTaskKey,
5251
5318
  import_zod.z.null()
5252
- ]))
5319
+ ])
5253
5320
  }).register(import_zod.z.globalRegistry, {
5254
5321
  description: "Contains properties of a user task."
5255
5322
  });
@@ -5261,10 +5328,10 @@ var zElementInstanceResult = import_zod.z.object({
5261
5328
  startDate: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5262
5329
  description: "Date when element instance started."
5263
5330
  }),
5264
- endDate: import_zod.z.optional(import_zod.z.union([
5331
+ endDate: import_zod.z.union([
5265
5332
  import_zod.z.iso.datetime(),
5266
5333
  import_zod.z.null()
5267
- ])),
5334
+ ]),
5268
5335
  elementId: zElementId,
5269
5336
  elementName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5270
5337
  description: "The element name for this element instance."
@@ -5312,10 +5379,10 @@ var zElementInstanceResult = import_zod.z.object({
5312
5379
  import_zod.z.null()
5313
5380
  ]),
5314
5381
  processDefinitionKey: zProcessDefinitionKey,
5315
- incidentKey: import_zod.z.optional(import_zod.z.union([
5382
+ incidentKey: import_zod.z.union([
5316
5383
  zIncidentKey,
5317
5384
  import_zod.z.null()
5318
- ]))
5385
+ ])
5319
5386
  });
5320
5387
  var zJobKey = zLongKey;
5321
5388
  var zIncidentResult = import_zod.z.object({
@@ -5374,10 +5441,10 @@ var zActivatedJobResult = import_zod.z.object({
5374
5441
  elementInstanceKey: zElementInstanceKey,
5375
5442
  kind: zJobKindEnum,
5376
5443
  listenerEventType: zJobListenerEventTypeEnum,
5377
- userTask: import_zod.z.optional(import_zod.z.union([
5444
+ userTask: import_zod.z.union([
5378
5445
  zUserTaskProperties,
5379
5446
  import_zod.z.null()
5380
- ])),
5447
+ ]),
5381
5448
  tags: zTagSet,
5382
5449
  rootProcessInstanceKey: import_zod.z.union([
5383
5450
  zProcessInstanceKey,
@@ -5395,38 +5462,38 @@ var zJobSearchResult = import_zod.z.object({
5395
5462
  customHeaders: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).register(import_zod.z.globalRegistry, {
5396
5463
  description: "A set of custom headers defined during modelling."
5397
5464
  }),
5398
- deadline: import_zod.z.optional(import_zod.z.union([
5465
+ deadline: import_zod.z.union([
5399
5466
  import_zod.z.iso.datetime(),
5400
5467
  import_zod.z.null()
5401
- ])),
5402
- deniedReason: import_zod.z.optional(import_zod.z.union([
5468
+ ]),
5469
+ deniedReason: import_zod.z.union([
5403
5470
  import_zod.z.string(),
5404
5471
  import_zod.z.null()
5405
- ])),
5472
+ ]),
5406
5473
  elementId: import_zod.z.union([
5407
5474
  zElementId,
5408
5475
  import_zod.z.null()
5409
5476
  ]),
5410
5477
  elementInstanceKey: zElementInstanceKey,
5411
- endTime: import_zod.z.optional(import_zod.z.union([
5478
+ endTime: import_zod.z.union([
5412
5479
  import_zod.z.iso.datetime(),
5413
5480
  import_zod.z.null()
5414
- ])),
5415
- errorCode: import_zod.z.optional(import_zod.z.union([
5481
+ ]),
5482
+ errorCode: import_zod.z.union([
5416
5483
  import_zod.z.string(),
5417
5484
  import_zod.z.null()
5418
- ])),
5419
- errorMessage: import_zod.z.optional(import_zod.z.union([
5485
+ ]),
5486
+ errorMessage: import_zod.z.union([
5420
5487
  import_zod.z.string(),
5421
5488
  import_zod.z.null()
5422
- ])),
5489
+ ]),
5423
5490
  hasFailedWithRetriesLeft: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
5424
5491
  description: "Indicates whether the job has failed with retries left."
5425
5492
  }),
5426
- isDenied: import_zod.z.optional(import_zod.z.union([
5493
+ isDenied: import_zod.z.union([
5427
5494
  import_zod.z.boolean(),
5428
5495
  import_zod.z.null()
5429
- ])),
5496
+ ]),
5430
5497
  jobKey: zJobKey,
5431
5498
  kind: zJobKindEnum,
5432
5499
  listenerEventType: zJobListenerEventTypeEnum,
@@ -5448,12 +5515,14 @@ var zJobSearchResult = import_zod.z.object({
5448
5515
  worker: import_zod.z.string().register(import_zod.z.globalRegistry, {
5449
5516
  description: "The name of the worker of this job."
5450
5517
  }),
5451
- creationTime: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5452
- description: "When the job was created. Field is present for jobs created after 8.9."
5453
- })),
5454
- lastUpdateTime: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5455
- description: "When the job was last updated. Field is present for jobs created after 8.9."
5456
- }))
5518
+ creationTime: import_zod.z.union([
5519
+ import_zod.z.iso.datetime(),
5520
+ import_zod.z.null()
5521
+ ]),
5522
+ lastUpdateTime: import_zod.z.union([
5523
+ import_zod.z.iso.datetime(),
5524
+ import_zod.z.null()
5525
+ ])
5457
5526
  });
5458
5527
  var zDecisionDefinitionKey = zLongKey;
5459
5528
  var zDecisionEvaluationByKey = import_zod.z.object({
@@ -5469,28 +5538,28 @@ var zDecisionEvaluationInstruction = import_zod.z.union([
5469
5538
  ]);
5470
5539
  var zDecisionEvaluationInstanceKey = zLongKey;
5471
5540
  var zEvaluatedDecisionResult = import_zod.z.object({
5472
- decisionDefinitionId: import_zod.z.optional(zDecisionDefinitionId),
5473
- decisionDefinitionName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5541
+ decisionDefinitionId: zDecisionDefinitionId,
5542
+ decisionDefinitionName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5474
5543
  description: "The name of the decision which was evaluated."
5475
- })),
5476
- decisionDefinitionVersion: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5544
+ }),
5545
+ decisionDefinitionVersion: import_zod.z.int().register(import_zod.z.globalRegistry, {
5477
5546
  description: "The version of the decision which was evaluated."
5478
- })),
5547
+ }),
5479
5548
  decisionDefinitionType: import_zod.z.string().register(import_zod.z.globalRegistry, {
5480
5549
  description: "The type of the decision which was evaluated."
5481
5550
  }),
5482
- output: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5551
+ output: import_zod.z.string().register(import_zod.z.globalRegistry, {
5483
5552
  description: "JSON document that will instantiate the result of the decision which was evaluated.\n"
5484
- })),
5485
- tenantId: import_zod.z.optional(zTenantId),
5553
+ }),
5554
+ tenantId: zTenantId,
5486
5555
  matchedRules: import_zod.z.array(zMatchedDecisionRuleItem).register(import_zod.z.globalRegistry, {
5487
5556
  description: "The decision rules that matched within this decision evaluation."
5488
5557
  }),
5489
5558
  evaluatedInputs: import_zod.z.array(zEvaluatedDecisionInputItem).register(import_zod.z.globalRegistry, {
5490
5559
  description: "The decision inputs that were evaluated within this decision evaluation."
5491
5560
  }),
5492
- decisionDefinitionKey: import_zod.z.optional(zDecisionDefinitionKey),
5493
- decisionEvaluationInstanceKey: import_zod.z.optional(zDecisionEvaluationInstanceKey)
5561
+ decisionDefinitionKey: zDecisionDefinitionKey,
5562
+ decisionEvaluationInstanceKey: zDecisionEvaluationInstanceKey
5494
5563
  }).register(import_zod.z.globalRegistry, {
5495
5564
  description: "A decision that was evaluated."
5496
5565
  });
@@ -5628,37 +5697,37 @@ var zDecisionRequirementsResult = import_zod.z.object({
5628
5697
  })
5629
5698
  });
5630
5699
  var zDeploymentDecisionResult = import_zod.z.object({
5631
- decisionDefinitionId: import_zod.z.optional(zDecisionDefinitionId),
5632
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5700
+ decisionDefinitionId: zDecisionDefinitionId,
5701
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5633
5702
  description: "The assigned decision version."
5634
- })),
5635
- name: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5703
+ }),
5704
+ name: import_zod.z.string().register(import_zod.z.globalRegistry, {
5636
5705
  description: "The DMN name of the decision, as parsed during deployment."
5637
- })),
5638
- tenantId: import_zod.z.optional(zTenantId),
5639
- decisionRequirementsId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5706
+ }),
5707
+ tenantId: zTenantId,
5708
+ decisionRequirementsId: import_zod.z.string().register(import_zod.z.globalRegistry, {
5640
5709
  description: "The dmn ID of the decision requirements graph that this decision is part of, as parsed during deployment.\n"
5641
- })),
5642
- decisionDefinitionKey: import_zod.z.optional(zDecisionDefinitionKey),
5643
- decisionRequirementsKey: import_zod.z.optional(zDecisionRequirementsKey)
5710
+ }),
5711
+ decisionDefinitionKey: zDecisionDefinitionKey,
5712
+ decisionRequirementsKey: zDecisionRequirementsKey
5644
5713
  }).register(import_zod.z.globalRegistry, {
5645
5714
  description: "A deployed decision."
5646
5715
  });
5647
5716
  var zDeploymentDecisionRequirementsResult = import_zod.z.object({
5648
- decisionRequirementsId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5717
+ decisionRequirementsId: import_zod.z.string().register(import_zod.z.globalRegistry, {
5649
5718
  description: "The id of the deployed decision requirements."
5650
- })),
5651
- decisionRequirementsName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5719
+ }),
5720
+ decisionRequirementsName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5652
5721
  description: "The name of the deployed decision requirements."
5653
- })),
5654
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5722
+ }),
5723
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5655
5724
  description: "The version of the deployed decision requirements."
5656
- })),
5657
- resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5725
+ }),
5726
+ resourceName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5658
5727
  description: "The name of the resource."
5659
- })),
5660
- tenantId: import_zod.z.optional(zTenantId),
5661
- decisionRequirementsKey: import_zod.z.optional(zDecisionRequirementsKey)
5728
+ }),
5729
+ tenantId: zTenantId,
5730
+ decisionRequirementsKey: zDecisionRequirementsKey
5662
5731
  }).register(import_zod.z.globalRegistry, {
5663
5732
  description: "Deployed decision requirements."
5664
5733
  });
@@ -5669,17 +5738,17 @@ var zResourceKey = import_zod.z.union([
5669
5738
  zDecisionDefinitionKey
5670
5739
  ]);
5671
5740
  var zDeploymentResourceResult = import_zod.z.object({
5672
- resourceId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5741
+ resourceId: import_zod.z.string().register(import_zod.z.globalRegistry, {
5673
5742
  description: "The resource id of the deployed resource."
5674
- })),
5675
- resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5743
+ }),
5744
+ resourceName: import_zod.z.string().register(import_zod.z.globalRegistry, {
5676
5745
  description: "The name of the deployed resource."
5677
- })),
5678
- version: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5746
+ }),
5747
+ version: import_zod.z.int().register(import_zod.z.globalRegistry, {
5679
5748
  description: "The description of the deployed resource."
5680
- })),
5681
- tenantId: import_zod.z.optional(zTenantId),
5682
- resourceKey: import_zod.z.optional(zResourceKey)
5749
+ }),
5750
+ tenantId: zTenantId,
5751
+ resourceKey: zResourceKey
5683
5752
  }).register(import_zod.z.globalRegistry, {
5684
5753
  description: "A deployed Resource."
5685
5754
  });
@@ -5789,14 +5858,14 @@ var zBatchOperationResponse = import_zod.z.object({
5789
5858
  batchOperationKey: zBatchOperationKey,
5790
5859
  state: zBatchOperationStateEnum,
5791
5860
  batchOperationType: zBatchOperationTypeEnum,
5792
- startDate: import_zod.z.optional(import_zod.z.union([
5861
+ startDate: import_zod.z.union([
5793
5862
  import_zod.z.iso.datetime(),
5794
5863
  import_zod.z.null()
5795
- ])),
5796
- endDate: import_zod.z.optional(import_zod.z.union([
5864
+ ]),
5865
+ endDate: import_zod.z.union([
5797
5866
  import_zod.z.iso.datetime(),
5798
5867
  import_zod.z.null()
5799
- ])),
5868
+ ]),
5800
5869
  actorType: import_zod.z.union([
5801
5870
  zAuditLogActorTypeEnum,
5802
5871
  import_zod.z.null()
@@ -5819,17 +5888,17 @@ var zBatchOperationResponse = import_zod.z.object({
5819
5888
  })
5820
5889
  });
5821
5890
  var zBatchOperationItemResponse = import_zod.z.object({
5822
- operationType: import_zod.z.optional(zBatchOperationTypeEnum),
5823
- batchOperationKey: import_zod.z.optional(zBatchOperationKey),
5824
- itemKey: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
5891
+ operationType: zBatchOperationTypeEnum,
5892
+ batchOperationKey: zBatchOperationKey,
5893
+ itemKey: import_zod.z.string().register(import_zod.z.globalRegistry, {
5825
5894
  description: "Key of the item, e.g. a process instance key."
5826
- })),
5827
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey),
5895
+ }),
5896
+ processInstanceKey: zProcessInstanceKey,
5828
5897
  rootProcessInstanceKey: import_zod.z.union([
5829
5898
  zProcessInstanceKey,
5830
5899
  import_zod.z.null()
5831
5900
  ]),
5832
- state: import_zod.z.optional(import_zod.z.enum([
5901
+ state: import_zod.z.enum([
5833
5902
  "ACTIVE",
5834
5903
  "COMPLETED",
5835
5904
  "SKIPPED",
@@ -5837,21 +5906,22 @@ var zBatchOperationItemResponse = import_zod.z.object({
5837
5906
  "FAILED"
5838
5907
  ]).register(import_zod.z.globalRegistry, {
5839
5908
  description: "State of the item."
5840
- })),
5841
- processedDate: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
5842
- description: "the date this item was processed."
5843
- })),
5844
- errorMessage: import_zod.z.optional(import_zod.z.union([
5909
+ }),
5910
+ processedDate: import_zod.z.union([
5911
+ import_zod.z.iso.datetime(),
5912
+ import_zod.z.null()
5913
+ ]),
5914
+ errorMessage: import_zod.z.union([
5845
5915
  import_zod.z.string(),
5846
5916
  import_zod.z.null()
5847
- ]))
5917
+ ])
5848
5918
  });
5849
5919
  var zDeleteResourceResponse = import_zod.z.object({
5850
5920
  resourceKey: zResourceKey,
5851
- batchOperation: import_zod.z.optional(import_zod.z.union([
5921
+ batchOperation: import_zod.z.union([
5852
5922
  zBatchOperationCreatedResult,
5853
5923
  import_zod.z.null()
5854
- ]))
5924
+ ])
5855
5925
  });
5856
5926
  var zOperationReference = import_zod.z.coerce.bigint().gte(BigInt(1)).register(import_zod.z.globalRegistry, {
5857
5927
  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"
@@ -5912,10 +5982,6 @@ var zAuditLogResult = import_zod.z.object({
5912
5982
  import_zod.z.null()
5913
5983
  ]),
5914
5984
  result: zAuditLogResultEnum,
5915
- annotation: import_zod.z.union([
5916
- import_zod.z.string(),
5917
- import_zod.z.null()
5918
- ]),
5919
5985
  category: zAuditLogCategoryEnum,
5920
5986
  processDefinitionId: import_zod.z.union([
5921
5987
  zProcessDefinitionId,
@@ -6305,27 +6371,37 @@ var zAdvancedMessageSubscriptionStateFilter = import_zod.z.object({
6305
6371
  });
6306
6372
  var zMessageSubscriptionKey = zLongKey;
6307
6373
  var zMessageSubscriptionResult = import_zod.z.object({
6308
- messageSubscriptionKey: import_zod.z.optional(zMessageSubscriptionKey),
6309
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6310
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6311
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey),
6374
+ messageSubscriptionKey: zMessageSubscriptionKey,
6375
+ processDefinitionId: zProcessDefinitionId,
6376
+ processDefinitionKey: import_zod.z.union([
6377
+ zProcessDefinitionKey,
6378
+ import_zod.z.null()
6379
+ ]),
6380
+ processInstanceKey: import_zod.z.union([
6381
+ zProcessInstanceKey,
6382
+ import_zod.z.null()
6383
+ ]),
6312
6384
  rootProcessInstanceKey: import_zod.z.union([
6313
6385
  zProcessInstanceKey,
6314
6386
  import_zod.z.null()
6315
6387
  ]),
6316
- elementId: import_zod.z.optional(zElementId),
6317
- elementInstanceKey: import_zod.z.optional(zElementInstanceKey),
6318
- messageSubscriptionState: import_zod.z.optional(zMessageSubscriptionStateEnum),
6319
- lastUpdatedDate: import_zod.z.optional(import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
6388
+ elementId: zElementId,
6389
+ elementInstanceKey: import_zod.z.union([
6390
+ zElementInstanceKey,
6391
+ import_zod.z.null()
6392
+ ]),
6393
+ messageSubscriptionState: zMessageSubscriptionStateEnum,
6394
+ lastUpdatedDate: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
6320
6395
  description: "The last updated date of the message subscription."
6321
- })),
6322
- messageName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6396
+ }),
6397
+ messageName: import_zod.z.string().register(import_zod.z.globalRegistry, {
6323
6398
  description: "The name of the message associated with the message subscription."
6324
- })),
6325
- correlationKey: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6326
- description: "The correlation key of the message subscription."
6327
- })),
6328
- tenantId: import_zod.z.optional(zTenantId)
6399
+ }),
6400
+ correlationKey: import_zod.z.union([
6401
+ import_zod.z.string(),
6402
+ import_zod.z.null()
6403
+ ]),
6404
+ tenantId: zTenantId
6329
6405
  });
6330
6406
  var zAdvancedMessageSubscriptionKeyFilter = import_zod.z.object({
6331
6407
  "$eq": import_zod.z.optional(zMessageSubscriptionKey),
@@ -6357,16 +6433,20 @@ var zMessagePublicationResult = import_zod.z.object({
6357
6433
  description: "The message key of the published message."
6358
6434
  });
6359
6435
  var zCorrelatedMessageSubscriptionResult = import_zod.z.object({
6360
- correlationKey: import_zod.z.string().register(import_zod.z.globalRegistry, {
6361
- description: "The correlation key of the message."
6362
- }),
6436
+ correlationKey: import_zod.z.union([
6437
+ import_zod.z.string(),
6438
+ import_zod.z.null()
6439
+ ]),
6363
6440
  correlationTime: import_zod.z.iso.datetime().register(import_zod.z.globalRegistry, {
6364
6441
  description: "The time when the message was correlated."
6365
6442
  }),
6366
6443
  elementId: import_zod.z.string().register(import_zod.z.globalRegistry, {
6367
6444
  description: "The element ID that received the message."
6368
6445
  }),
6369
- elementInstanceKey: import_zod.z.optional(zElementInstanceKey),
6446
+ elementInstanceKey: import_zod.z.union([
6447
+ zElementInstanceKey,
6448
+ import_zod.z.null()
6449
+ ]),
6370
6450
  messageKey: zMessageKey,
6371
6451
  messageName: import_zod.z.string().register(import_zod.z.globalRegistry, {
6372
6452
  description: "The name of the message."
@@ -6375,7 +6455,7 @@ var zCorrelatedMessageSubscriptionResult = import_zod.z.object({
6375
6455
  description: "The partition ID that correlated the message."
6376
6456
  }),
6377
6457
  processDefinitionId: zProcessDefinitionId,
6378
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6458
+ processDefinitionKey: zProcessDefinitionKey,
6379
6459
  processInstanceKey: zProcessInstanceKey,
6380
6460
  rootProcessInstanceKey: import_zod.z.union([
6381
6461
  zProcessInstanceKey,
@@ -6449,19 +6529,19 @@ var zProcessDefinitionResult = import_zod.z.object({
6449
6529
  })
6450
6530
  });
6451
6531
  var zProcessElementStatisticsResult = import_zod.z.object({
6452
- elementId: import_zod.z.optional(zElementId),
6453
- active: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6532
+ elementId: zElementId,
6533
+ active: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6454
6534
  description: "The total number of active instances of the element."
6455
- })),
6456
- canceled: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6535
+ }),
6536
+ canceled: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6457
6537
  description: "The total number of canceled instances of the element."
6458
- })),
6459
- incidents: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6538
+ }),
6539
+ incidents: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6460
6540
  description: "The total number of incidents for the element."
6461
- })),
6462
- completed: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6541
+ }),
6542
+ completed: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6463
6543
  description: "The total number of completed instances of the element."
6464
- }))
6544
+ })
6465
6545
  }).register(import_zod.z.globalRegistry, {
6466
6546
  description: "Process element statistics response."
6467
6547
  });
@@ -6473,32 +6553,32 @@ var zProcessDefinitionElementStatisticsQueryResult = import_zod.z.object({
6473
6553
  description: "Process definition element statistics query response."
6474
6554
  });
6475
6555
  var zProcessDefinitionMessageSubscriptionStatisticsResult = import_zod.z.object({
6476
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6477
- tenantId: import_zod.z.optional(zTenantId),
6478
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6479
- processInstancesWithActiveSubscriptions: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6556
+ processDefinitionId: zProcessDefinitionId,
6557
+ tenantId: zTenantId,
6558
+ processDefinitionKey: zProcessDefinitionKey,
6559
+ processInstancesWithActiveSubscriptions: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6480
6560
  description: "The number of process instances with active message subscriptions."
6481
- })),
6482
- activeSubscriptions: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6561
+ }),
6562
+ activeSubscriptions: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6483
6563
  description: "The total number of active message subscriptions for this process definition key."
6484
- }))
6564
+ })
6485
6565
  });
6486
6566
  var zProcessDefinitionInstanceStatisticsResult = import_zod.z.object({
6487
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6488
- tenantId: import_zod.z.optional(zTenantId),
6489
- latestProcessDefinitionName: import_zod.z.optional(import_zod.z.union([
6567
+ processDefinitionId: zProcessDefinitionId,
6568
+ tenantId: zTenantId,
6569
+ latestProcessDefinitionName: import_zod.z.union([
6490
6570
  import_zod.z.string(),
6491
6571
  import_zod.z.null()
6492
- ])),
6493
- hasMultipleVersions: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
6572
+ ]),
6573
+ hasMultipleVersions: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
6494
6574
  description: "Indicates whether multiple versions of this process definition instance are deployed."
6495
- })),
6496
- activeInstancesWithoutIncidentCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6575
+ }),
6576
+ activeInstancesWithoutIncidentCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6497
6577
  description: "Total number of currently active process instances of this definition that do not have incidents."
6498
- })),
6499
- activeInstancesWithIncidentCount: import_zod.z.optional(import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6578
+ }),
6579
+ activeInstancesWithIncidentCount: import_zod.z.coerce.bigint().register(import_zod.z.globalRegistry, {
6500
6580
  description: "Total number of currently active process instances of this definition that have at least one incident."
6501
- }))
6581
+ })
6502
6582
  }).register(import_zod.z.globalRegistry, {
6503
6583
  description: "Process definition instance statistics response."
6504
6584
  });
@@ -6614,10 +6694,10 @@ var zCreateProcessInstanceResult = import_zod.z.object({
6614
6694
  processDefinitionKey: zProcessDefinitionKey,
6615
6695
  processInstanceKey: zProcessInstanceKey,
6616
6696
  tags: zTagSet,
6617
- businessId: import_zod.z.optional(import_zod.z.union([
6697
+ businessId: import_zod.z.union([
6618
6698
  zBusinessId,
6619
6699
  import_zod.z.null()
6620
- ]))
6700
+ ])
6621
6701
  });
6622
6702
  var zCancelProcessInstanceRequest = import_zod.z.union([
6623
6703
  import_zod.z.object({
@@ -6639,18 +6719,18 @@ var zProcessInstanceCallHierarchyEntry = import_zod.z.object({
6639
6719
  })
6640
6720
  });
6641
6721
  var zProcessInstanceSequenceFlowResult = import_zod.z.object({
6642
- sequenceFlowId: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6722
+ sequenceFlowId: import_zod.z.string().register(import_zod.z.globalRegistry, {
6643
6723
  description: "The sequence flow id."
6644
- })),
6645
- processInstanceKey: import_zod.z.optional(zProcessInstanceKey),
6724
+ }),
6725
+ processInstanceKey: zProcessInstanceKey,
6646
6726
  rootProcessInstanceKey: import_zod.z.union([
6647
6727
  zProcessInstanceKey,
6648
6728
  import_zod.z.null()
6649
6729
  ]),
6650
- processDefinitionKey: import_zod.z.optional(zProcessDefinitionKey),
6651
- processDefinitionId: import_zod.z.optional(zProcessDefinitionId),
6652
- elementId: import_zod.z.optional(zElementId),
6653
- tenantId: import_zod.z.optional(zTenantId)
6730
+ processDefinitionKey: zProcessDefinitionKey,
6731
+ processDefinitionId: zProcessDefinitionId,
6732
+ elementId: zElementId,
6733
+ tenantId: zTenantId
6654
6734
  }).register(import_zod.z.globalRegistry, {
6655
6735
  description: "Process instance sequence flow result."
6656
6736
  });
@@ -6987,6 +7067,12 @@ var zJobTimeSeriesStatisticsQuery = import_zod.z.object({
6987
7067
  }).register(import_zod.z.globalRegistry, {
6988
7068
  description: "Job time-series statistics query."
6989
7069
  });
7070
+ var zJobErrorStatisticsQuery = import_zod.z.object({
7071
+ filter: zJobErrorStatisticsFilter,
7072
+ page: import_zod.z.optional(zCursorForwardPagination)
7073
+ }).register(import_zod.z.globalRegistry, {
7074
+ description: "Job error statistics query."
7075
+ });
6990
7076
  var zCursorBackwardPagination = import_zod.z.object({
6991
7077
  before: zStartCursor,
6992
7078
  limit: import_zod.z.optional(import_zod.z.int().gte(1).lte(1e4).register(import_zod.z.globalRegistry, {
@@ -7012,7 +7098,6 @@ var zAuditLogSearchQuerySortRequest = import_zod.z.object({
7012
7098
  field: import_zod.z.enum([
7013
7099
  "actorId",
7014
7100
  "actorType",
7015
- "annotation",
7016
7101
  "auditLogKey",
7017
7102
  "batchOperationKey",
7018
7103
  "batchOperationType",
@@ -7237,7 +7322,6 @@ var zIncidentSearchQuerySortRequest = import_zod.z.object({
7237
7322
  "processDefinitionId",
7238
7323
  "processInstanceKey",
7239
7324
  "errorType",
7240
- "errorMessage",
7241
7325
  "elementId",
7242
7326
  "elementInstanceKey",
7243
7327
  "creationTime",
@@ -7639,6 +7723,14 @@ var zJobTimeSeriesStatisticsQueryResult = zSearchQueryResponse.and(import_zod.z.
7639
7723
  }).register(import_zod.z.globalRegistry, {
7640
7724
  description: "Job time-series statistics query result."
7641
7725
  }));
7726
+ var zJobErrorStatisticsQueryResult = zSearchQueryResponse.and(import_zod.z.object({
7727
+ items: import_zod.z.array(zJobErrorStatisticsItem).register(import_zod.z.globalRegistry, {
7728
+ description: "The list of per-error statistics items."
7729
+ }),
7730
+ page: zSearchQueryPageResponse
7731
+ }).register(import_zod.z.globalRegistry, {
7732
+ description: "Job error statistics query result."
7733
+ }));
7642
7734
  var zJobSearchQueryResult = zSearchQueryResponse.and(import_zod.z.object({
7643
7735
  items: import_zod.z.array(zJobSearchResult).register(import_zod.z.globalRegistry, {
7644
7736
  description: "The matching jobs."
@@ -7748,6 +7840,33 @@ var zUsageMetricsResponse = zUsageMetricsResponseItem.and(import_zod.z.object({
7748
7840
  description: "The usage metrics by tenants. Only available if request `withTenants` query parameter was `true`."
7749
7841
  })
7750
7842
  }));
7843
+ var zJobMetricsConfigurationResponse = import_zod.z.object({
7844
+ enabled: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
7845
+ description: "Whether job metrics export is enabled."
7846
+ }),
7847
+ exportInterval: import_zod.z.string().register(import_zod.z.globalRegistry, {
7848
+ description: "The interval at which job metrics are exported, as an ISO 8601 duration."
7849
+ }),
7850
+ maxWorkerNameLength: import_zod.z.int().register(import_zod.z.globalRegistry, {
7851
+ description: "The maximum length of the worker name used in job metrics labels."
7852
+ }),
7853
+ maxJobTypeLength: import_zod.z.int().register(import_zod.z.globalRegistry, {
7854
+ description: "The maximum length of the job type used in job metrics labels."
7855
+ }),
7856
+ maxTenantIdLength: import_zod.z.int().register(import_zod.z.globalRegistry, {
7857
+ description: "The maximum length of the tenant ID used in job metrics labels."
7858
+ }),
7859
+ maxUniqueKeys: import_zod.z.int().register(import_zod.z.globalRegistry, {
7860
+ description: "The maximum number of unique metric keys tracked for job metrics."
7861
+ })
7862
+ }).register(import_zod.z.globalRegistry, {
7863
+ description: "Configuration for job metrics collection and export."
7864
+ });
7865
+ var zSystemConfigurationResponse = import_zod.z.object({
7866
+ jobMetrics: zJobMetricsConfigurationResponse
7867
+ }).register(import_zod.z.globalRegistry, {
7868
+ description: "Envelope for all system configuration sections. Each property\nrepresents a feature area.\n"
7869
+ });
7751
7870
  var zTenantCreateRequest = import_zod.z.object({
7752
7871
  tenantId: import_zod.z.string().min(1).max(256).regex(/^[A-Za-z0-9_@.+-]+$/).register(import_zod.z.globalRegistry, {
7753
7872
  description: "The unique ID for the tenant. Must be 255 characters or less. Can contain letters, numbers, [`_`, `-`, `+`, `.`, `@`]."
@@ -7800,18 +7919,18 @@ var zTenantResult = import_zod.z.object({
7800
7919
  description: "Tenant search response item."
7801
7920
  });
7802
7921
  var zCamundaUserResult = import_zod.z.object({
7803
- username: import_zod.z.optional(import_zod.z.union([
7922
+ username: import_zod.z.union([
7804
7923
  zUsername,
7805
7924
  import_zod.z.null()
7806
- ])),
7807
- displayName: import_zod.z.optional(import_zod.z.union([
7925
+ ]),
7926
+ displayName: import_zod.z.union([
7808
7927
  import_zod.z.string(),
7809
7928
  import_zod.z.null()
7810
- ])),
7811
- email: import_zod.z.optional(import_zod.z.union([
7929
+ ]),
7930
+ email: import_zod.z.union([
7812
7931
  import_zod.z.string(),
7813
7932
  import_zod.z.null()
7814
- ])),
7933
+ ]),
7815
7934
  authorizedComponents: import_zod.z.array(import_zod.z.string()).register(import_zod.z.globalRegistry, {
7816
7935
  description: "The web components the user is authorized to use."
7817
7936
  }),
@@ -8252,12 +8371,12 @@ var zVariableResultBase = import_zod.z.object({
8252
8371
  description: "Variable response item."
8253
8372
  });
8254
8373
  var zVariableSearchResult = zVariableResultBase.and(import_zod.z.object({
8255
- value: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
8374
+ value: import_zod.z.string().register(import_zod.z.globalRegistry, {
8256
8375
  description: "Value of this variable. Can be truncated."
8257
- })),
8258
- isTruncated: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
8376
+ }),
8377
+ isTruncated: import_zod.z.boolean().register(import_zod.z.globalRegistry, {
8259
8378
  description: "Whether the value is truncated or not."
8260
- }))
8379
+ })
8261
8380
  }).register(import_zod.z.globalRegistry, {
8262
8381
  description: "Variable search response item."
8263
8382
  }));
@@ -8865,6 +8984,7 @@ var zBaseProcessInstanceFilterFields = import_zod.z.object({
8865
8984
  parentProcessInstanceKey: import_zod.z.optional(zProcessInstanceKeyFilterProperty),
8866
8985
  parentElementInstanceKey: import_zod.z.optional(zElementInstanceKeyFilterProperty),
8867
8986
  batchOperationId: import_zod.z.optional(zStringFilterProperty),
8987
+ batchOperationKey: import_zod.z.optional(zStringFilterProperty),
8868
8988
  errorMessage: import_zod.z.optional(zStringFilterProperty),
8869
8989
  hasRetriesLeft: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
8870
8990
  description: "Whether the process has failed jobs with retries left."
@@ -9266,7 +9386,7 @@ var zDeleteDecisionInstanceData = import_zod.z.object({
9266
9386
  import_zod.z.null()
9267
9387
  ])),
9268
9388
  path: import_zod.z.object({
9269
- decisionInstanceKey: zDecisionInstanceKey
9389
+ decisionEvaluationKey: zDecisionEvaluationKey
9270
9390
  }),
9271
9391
  query: import_zod.z.optional(import_zod.z.never())
9272
9392
  });
@@ -9824,6 +9944,12 @@ var zGetJobTimeSeriesStatisticsData = import_zod.z.object({
9824
9944
  query: import_zod.z.optional(import_zod.z.never())
9825
9945
  });
9826
9946
  var zGetJobTimeSeriesStatisticsResponse = zJobTimeSeriesStatisticsQueryResult;
9947
+ var zGetJobErrorStatisticsData = import_zod.z.object({
9948
+ body: zJobErrorStatisticsQuery,
9949
+ path: import_zod.z.optional(import_zod.z.never()),
9950
+ query: import_zod.z.optional(import_zod.z.never())
9951
+ });
9952
+ var zGetJobErrorStatisticsResponse = zJobErrorStatisticsQueryResult;
9827
9953
  var zGetLicenseData = import_zod.z.object({
9828
9954
  body: import_zod.z.optional(import_zod.z.never()),
9829
9955
  path: import_zod.z.optional(import_zod.z.never()),
@@ -10412,6 +10538,12 @@ var zGetUsageMetricsData = import_zod.z.object({
10412
10538
  })
10413
10539
  });
10414
10540
  var zGetUsageMetricsResponse = zUsageMetricsResponse;
10541
+ var zGetSystemConfigurationData = import_zod.z.object({
10542
+ body: import_zod.z.optional(import_zod.z.never()),
10543
+ path: import_zod.z.optional(import_zod.z.never()),
10544
+ query: import_zod.z.optional(import_zod.z.never())
10545
+ });
10546
+ var zGetSystemConfigurationResponse = zSystemConfigurationResponse;
10415
10547
  var zCreateTenantData = import_zod.z.object({
10416
10548
  body: zTenantCreateRequest,
10417
10549
  path: import_zod.z.optional(import_zod.z.never()),
@@ -12353,7 +12485,7 @@ function createLogger(opts = {}) {
12353
12485
  }
12354
12486
 
12355
12487
  // src/runtime/version.ts
12356
- var packageVersion = "8.9.0-alpha.13";
12488
+ var packageVersion = "8.9.0-alpha.14";
12357
12489
 
12358
12490
  // src/runtime/supportLogger.ts
12359
12491
  var NoopSupportLogger = class {
@@ -13380,34 +13512,307 @@ var BackpressureManager = class {
13380
13512
  }
13381
13513
  }
13382
13514
  }
13383
- }
13384
- };
13515
+ }
13516
+ };
13517
+
13518
+ // src/runtime/jobWorker.ts
13519
+ var JobActionReceipt = "JOB_ACTION_RECEIPT";
13520
+ var _workerCounter = 0;
13521
+ var DEFAULT_LONGPOLL_TIMEOUT = 0;
13522
+ var JobWorker = class {
13523
+ _client;
13524
+ _cfg;
13525
+ _name;
13526
+ _activeJobs = 0;
13527
+ _stopped = false;
13528
+ _pollTimer = null;
13529
+ _inFlightActivation = null;
13530
+ // CancelablePromise-like
13531
+ _log;
13532
+ constructor(client2, cfg) {
13533
+ this._client = client2;
13534
+ this._cfg = { pollIntervalMs: 1, autoStart: true, validateSchemas: false, ...cfg };
13535
+ this._name = cfg.workerName || `worker-${cfg.jobType}-${++_workerCounter}`;
13536
+ this._log = this._client.logger().scope(`worker:${this._name}`);
13537
+ if (cfg.maxBackoffTimeMs !== void 0) {
13538
+ this._log.debug(() => [
13539
+ "worker.config.deprecated",
13540
+ { maxBackoffTimeMs: cfg.maxBackoffTimeMs }
13541
+ ]);
13542
+ }
13543
+ if (this._cfg.autoStart) this.start();
13544
+ }
13545
+ get name() {
13546
+ return this._name;
13547
+ }
13548
+ get activeJobs() {
13549
+ return this._activeJobs;
13550
+ }
13551
+ get stopped() {
13552
+ return this._stopped;
13553
+ }
13554
+ start() {
13555
+ if (this._stopped) return;
13556
+ if (this._pollTimer) return;
13557
+ this._log.info("worker.start");
13558
+ const jitterMax = this._cfg.startupJitterMaxSeconds ?? 0;
13559
+ if (jitterMax > 0) {
13560
+ const jitterMs = Math.floor(Math.random() * jitterMax * 1e3);
13561
+ this._log.info(() => ["worker.start.jitter", { delayMs: jitterMs }]);
13562
+ this._scheduleNext(jitterMs);
13563
+ } else {
13564
+ this._scheduleNext(0);
13565
+ }
13566
+ }
13567
+ stop() {
13568
+ this._stopped = true;
13569
+ if (this._pollTimer) clearTimeout(this._pollTimer);
13570
+ this._pollTimer = null;
13571
+ if (this._inFlightActivation?.cancel) {
13572
+ try {
13573
+ this._inFlightActivation.cancel();
13574
+ } catch {
13575
+ }
13576
+ }
13577
+ this._log.info("worker.stop");
13578
+ }
13579
+ /**
13580
+ * Gracefully stop the worker: prevent new polls, allow any in-flight activation to finish
13581
+ * without cancellation, and wait for currently active jobs to drain (be acknowledged) up to waitUpToMs.
13582
+ * If timeout is reached, falls back to hard stop logic (cancels activation if still pending).
13583
+ */
13584
+ async stopGracefully(opts) {
13585
+ const waitUpToMs = opts?.waitUpToMs ?? 5e3;
13586
+ const checkIntervalMs = opts?.checkIntervalMs ?? 10;
13587
+ this._stopped = true;
13588
+ if (this._pollTimer) clearTimeout(this._pollTimer);
13589
+ this._pollTimer = null;
13590
+ const start = Date.now();
13591
+ if (this._inFlightActivation) {
13592
+ try {
13593
+ await Promise.race([
13594
+ this._inFlightActivation,
13595
+ new Promise(
13596
+ (_, rej) => setTimeout(() => rej(new Error("activation.wait.timeout")), waitUpToMs)
13597
+ )
13598
+ ]);
13599
+ } catch (e) {
13600
+ if (e && e.message === "activation.wait.timeout") {
13601
+ this._log.debug("worker.gracefulStop.activationTimeout");
13602
+ }
13603
+ }
13604
+ }
13605
+ while (this._activeJobs > 0 && Date.now() - start < waitUpToMs) {
13606
+ await new Promise((r) => setTimeout(r, checkIntervalMs));
13607
+ }
13608
+ const timedOut = this._activeJobs > 0;
13609
+ if (timedOut) {
13610
+ if (this._inFlightActivation?.cancel) {
13611
+ try {
13612
+ this._inFlightActivation.cancel();
13613
+ } catch {
13614
+ }
13615
+ }
13616
+ this._log.debug("worker.gracefulStop.timeout", { remaining: this._activeJobs });
13617
+ } else {
13618
+ this._log.debug("worker.gracefulStop.done");
13619
+ }
13620
+ return { remainingJobs: this._activeJobs, timedOut };
13621
+ }
13622
+ _scheduleNext(delayMs) {
13623
+ if (this._stopped) return;
13624
+ this._pollTimer = setTimeout(() => this._poll(), delayMs);
13625
+ }
13626
+ async _poll() {
13627
+ this._pollTimer = null;
13628
+ if (this._stopped) return;
13629
+ if (this._activeJobs >= this._cfg.maxParallelJobs) {
13630
+ this._scheduleNext(this._cfg.pollIntervalMs);
13631
+ return;
13632
+ }
13633
+ const batchSize = this._cfg.maxParallelJobs - this._activeJobs;
13634
+ if (batchSize <= 0) {
13635
+ this._scheduleNext(this._cfg.pollIntervalMs);
13636
+ return;
13637
+ }
13638
+ const body = {
13639
+ type: this._cfg.jobType,
13640
+ worker: this._name,
13641
+ maxJobsToActivate: batchSize,
13642
+ requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT,
13643
+ timeout: this._cfg.jobTimeoutMs,
13644
+ // API expects `fetchVariable`; map from config `fetchVariables`
13645
+ ...this._cfg.fetchVariables && this._cfg.fetchVariables.length > 0 ? { fetchVariable: this._cfg.fetchVariables } : {}
13646
+ };
13647
+ this._log.debug(() => ["activation.request", { batchSize }]);
13648
+ let result = [];
13649
+ try {
13650
+ this._inFlightActivation = this._client.activateJobs(body);
13651
+ const activation = await this._inFlightActivation;
13652
+ this._inFlightActivation = null;
13653
+ result = activation?.jobs || [];
13654
+ this._log.debug(() => ["activation.response", { jobs: result.length }]);
13655
+ } catch (e) {
13656
+ this._inFlightActivation = null;
13657
+ if (this._stopped) return;
13658
+ if (e?.name === "CancelSdkError") {
13659
+ this._log.debug("activation.cancelled");
13660
+ } else {
13661
+ this._log.error("activation.error", e);
13662
+ }
13663
+ this._scheduleNext(this._cfg.pollIntervalMs);
13664
+ return;
13665
+ }
13666
+ if (!result || result.length === 0) {
13667
+ this._scheduleNext(this._cfg.pollIntervalMs);
13668
+ return;
13669
+ }
13670
+ this._activeJobs += result.length;
13671
+ this._scheduleNext(0);
13672
+ for (const raw of result) {
13673
+ this._handleJob(raw).catch((err) => {
13674
+ this._log.error("job.handler.unexpected", err);
13675
+ });
13676
+ }
13677
+ }
13678
+ async _handleJob(raw) {
13679
+ if (this._stopped) {
13680
+ this._decrementOnce();
13681
+ return;
13682
+ }
13683
+ let variables = raw.variables;
13684
+ let headers = raw.customHeaders;
13685
+ if (this._cfg.validateSchemas) {
13686
+ if (this._cfg.inputSchema) {
13687
+ const parsed = this._cfg.inputSchema.safeParse(variables);
13688
+ if (!parsed.success) {
13689
+ this._log.warn("job.validation.variables.failed", parsed.error.flatten());
13690
+ await this._failValidation(raw, "Invalid variables");
13691
+ return;
13692
+ }
13693
+ variables = parsed.data;
13694
+ }
13695
+ if (this._cfg.customHeadersSchema) {
13696
+ const parsed = this._cfg.customHeadersSchema.safeParse(headers);
13697
+ if (!parsed.success) {
13698
+ this._log.warn("job.validation.headers.failed", parsed.error.flatten());
13699
+ await this._failValidation(raw, "Invalid custom headers");
13700
+ return;
13701
+ }
13702
+ headers = parsed.data;
13703
+ }
13704
+ }
13705
+ const job = Object.assign(raw, { variables, customHeaders: headers });
13706
+ try {
13707
+ const receipt = await this._cfg.jobHandler(job);
13708
+ if (!job.acknowledged) {
13709
+ this._log.warn("job.handler.noAction", { jobKey: raw.jobKey });
13710
+ }
13711
+ return receipt;
13712
+ } catch (e) {
13713
+ this._log.error("job.handler.error", e);
13714
+ try {
13715
+ const retries = raw.retries;
13716
+ await this._client.failJob({
13717
+ jobKey: raw.jobKey,
13718
+ errorMessage: e?.message || "Handler error",
13719
+ retries: typeof retries === "number" ? Math.max(0, retries - 1) : 0
13720
+ });
13721
+ } catch (failErr) {
13722
+ this._log.error("job.fail.error", failErr);
13723
+ }
13724
+ return JobActionReceipt;
13725
+ } finally {
13726
+ this._decrementOnce();
13727
+ }
13728
+ }
13729
+ async _failValidation(raw, msg) {
13730
+ try {
13731
+ await this._client.failJob({ jobKey: raw.jobKey, errorMessage: msg });
13732
+ } catch (e) {
13733
+ this._log.error("job.fail.validation.error", e);
13734
+ } finally {
13735
+ this._decrementOnce();
13736
+ }
13737
+ }
13738
+ _decrementOnce() {
13739
+ this._activeJobs = Math.max(0, this._activeJobs - 1);
13740
+ }
13741
+ };
13742
+
13743
+ // src/runtime/jobActions.ts
13744
+ function enrichActivatedJob(raw, client2, log) {
13745
+ let acknowledged = false;
13746
+ const ack = () => {
13747
+ if (!acknowledged) {
13748
+ acknowledged = true;
13749
+ job.acknowledged = true;
13750
+ }
13751
+ };
13752
+ const job = { ...raw, log };
13753
+ job.complete = async (variables = {}) => {
13754
+ try {
13755
+ await client2.completeJob({ variables, jobKey: raw.jobKey });
13756
+ } finally {
13757
+ ack();
13758
+ }
13759
+ return JobActionReceipt;
13760
+ };
13761
+ job.fail = async (reason) => {
13762
+ try {
13763
+ await client2.failJob({ ...reason, jobKey: raw.jobKey });
13764
+ } finally {
13765
+ ack();
13766
+ }
13767
+ return JobActionReceipt;
13768
+ };
13769
+ job.error = async (error) => {
13770
+ try {
13771
+ await client2.throwJobError({ ...error, jobKey: raw.jobKey });
13772
+ } finally {
13773
+ ack();
13774
+ }
13775
+ return JobActionReceipt;
13776
+ };
13777
+ job.cancelWorkflow = async () => {
13778
+ try {
13779
+ await client2.cancelProcessInstance({
13780
+ processInstanceKey: raw.processInstanceKey
13781
+ });
13782
+ } finally {
13783
+ ack();
13784
+ }
13785
+ return JobActionReceipt;
13786
+ };
13787
+ job.ignore = async () => {
13788
+ ack();
13789
+ return JobActionReceipt;
13790
+ };
13791
+ job.modifyJobTimeout = ({ newTimeoutMs }) => client2.updateJob({ changeset: { timeout: newTimeoutMs }, jobKey: raw.jobKey });
13792
+ job.modifyRetries = ({ retries }) => client2.updateJob({ changeset: { retries }, jobKey: raw.jobKey });
13793
+ return job;
13794
+ }
13385
13795
 
13386
- // src/runtime/jobWorker.ts
13387
- var JobActionReceipt = "JOB_ACTION_RECEIPT";
13388
- var _workerCounter = 0;
13389
- var DEFAULT_LONGPOLL_TIMEOUT = 0;
13390
- var JobWorker = class {
13796
+ // src/runtime/threadedJobWorker.ts
13797
+ var _workerCounter2 = 0;
13798
+ var DEFAULT_LONGPOLL_TIMEOUT2 = 0;
13799
+ var ThreadedJobWorker = class {
13391
13800
  _client;
13801
+ _pool;
13392
13802
  _cfg;
13393
13803
  _name;
13394
13804
  _activeJobs = 0;
13395
13805
  _stopped = false;
13396
13806
  _pollTimer = null;
13397
13807
  _inFlightActivation = null;
13398
- // CancelablePromise-like
13399
13808
  _log;
13400
- constructor(client2, cfg) {
13809
+ _jobQueue = [];
13810
+ constructor(client2, pool, cfg) {
13401
13811
  this._client = client2;
13812
+ this._pool = pool;
13402
13813
  this._cfg = { pollIntervalMs: 1, autoStart: true, validateSchemas: false, ...cfg };
13403
- this._name = cfg.workerName || `worker-${cfg.jobType}-${++_workerCounter}`;
13814
+ this._name = cfg.workerName || `threaded-worker-${cfg.jobType}-${++_workerCounter2}`;
13404
13815
  this._log = this._client.logger().scope(`worker:${this._name}`);
13405
- if (cfg.maxBackoffTimeMs !== void 0) {
13406
- this._log.debug(() => [
13407
- "worker.config.deprecated",
13408
- { maxBackoffTimeMs: cfg.maxBackoffTimeMs }
13409
- ]);
13410
- }
13411
13816
  if (this._cfg.autoStart) this.start();
13412
13817
  }
13413
13818
  get name() {
@@ -13419,6 +13824,18 @@ var JobWorker = class {
13419
13824
  get stopped() {
13420
13825
  return this._stopped;
13421
13826
  }
13827
+ /** Number of threads in the shared pool. */
13828
+ get poolSize() {
13829
+ return this._pool.size;
13830
+ }
13831
+ /** Number of threads currently processing a job (across all workers). */
13832
+ get busyThreads() {
13833
+ return this._pool.busyCount;
13834
+ }
13835
+ /** Resolves when the shared thread pool has finished initialising. */
13836
+ get ready() {
13837
+ return this._pool.ready;
13838
+ }
13422
13839
  start() {
13423
13840
  if (this._stopped) return;
13424
13841
  if (this._pollTimer) return;
@@ -13444,11 +13861,6 @@ var JobWorker = class {
13444
13861
  }
13445
13862
  this._log.info("worker.stop");
13446
13863
  }
13447
- /**
13448
- * Gracefully stop the worker: prevent new polls, allow any in-flight activation to finish
13449
- * without cancellation, and wait for currently active jobs to drain (be acknowledged) up to waitUpToMs.
13450
- * If timeout is reached, falls back to hard stop logic (cancels activation if still pending).
13451
- */
13452
13864
  async stopGracefully(opts) {
13453
13865
  const waitUpToMs = opts?.waitUpToMs ?? 5e3;
13454
13866
  const checkIntervalMs = opts?.checkIntervalMs ?? 10;
@@ -13487,6 +13899,47 @@ var JobWorker = class {
13487
13899
  }
13488
13900
  return { remainingJobs: this._activeJobs, timedOut };
13489
13901
  }
13902
+ // ─── Job dispatch ───
13903
+ _drainQueue() {
13904
+ while (this._jobQueue.length > 0) {
13905
+ const idle = this._pool.getIdleWorker();
13906
+ if (!idle) break;
13907
+ const item = this._jobQueue.shift();
13908
+ this._dispatchToThread(idle, item.raw);
13909
+ }
13910
+ }
13911
+ async _dispatchToThread(pw, raw) {
13912
+ const jobData = this._serializeJob(raw);
13913
+ this._pool.dispatch(pw, jobData, this._cfg.handlerModule, {
13914
+ onComplete: () => {
13915
+ this._decrementOnce();
13916
+ this._drainQueue();
13917
+ },
13918
+ onError: (err) => {
13919
+ this._log.error("job.thread.error", { jobKey: raw.jobKey, err });
13920
+ this._client.failJob({
13921
+ jobKey: raw.jobKey,
13922
+ errorMessage: err?.message || "Thread handler error",
13923
+ retries: typeof raw.retries === "number" ? Math.max(0, raw.retries - 1) : 0
13924
+ }).catch((failErr) => {
13925
+ this._log.error("job.fail.error", failErr);
13926
+ }).finally(() => {
13927
+ this._decrementOnce();
13928
+ this._drainQueue();
13929
+ });
13930
+ }
13931
+ });
13932
+ }
13933
+ _serializeJob(raw) {
13934
+ const data = {};
13935
+ for (const [key, value] of Object.entries(raw)) {
13936
+ if (typeof value === "function") continue;
13937
+ if (key === "log") continue;
13938
+ data[key] = value;
13939
+ }
13940
+ return JSON.parse(JSON.stringify(data));
13941
+ }
13942
+ // ─── Polling (same pattern as JobWorker) ───
13490
13943
  _scheduleNext(delayMs) {
13491
13944
  if (this._stopped) return;
13492
13945
  this._pollTimer = setTimeout(() => this._poll(), delayMs);
@@ -13494,11 +13947,13 @@ var JobWorker = class {
13494
13947
  async _poll() {
13495
13948
  this._pollTimer = null;
13496
13949
  if (this._stopped) return;
13950
+ await this._pool.ready;
13497
13951
  if (this._activeJobs >= this._cfg.maxParallelJobs) {
13498
13952
  this._scheduleNext(this._cfg.pollIntervalMs);
13499
13953
  return;
13500
13954
  }
13501
- const batchSize = this._cfg.maxParallelJobs - this._activeJobs;
13955
+ const availableThreads = this._pool.idleCount;
13956
+ const batchSize = Math.min(this._cfg.maxParallelJobs - this._activeJobs, availableThreads);
13502
13957
  if (batchSize <= 0) {
13503
13958
  this._scheduleNext(this._cfg.pollIntervalMs);
13504
13959
  return;
@@ -13507,9 +13962,8 @@ var JobWorker = class {
13507
13962
  type: this._cfg.jobType,
13508
13963
  worker: this._name,
13509
13964
  maxJobsToActivate: batchSize,
13510
- requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT,
13965
+ requestTimeout: this._cfg.pollTimeoutMs ?? DEFAULT_LONGPOLL_TIMEOUT2,
13511
13966
  timeout: this._cfg.jobTimeoutMs,
13512
- // API expects `fetchVariable`; map from config `fetchVariables`
13513
13967
  ...this._cfg.fetchVariables && this._cfg.fetchVariables.length > 0 ? { fetchVariable: this._cfg.fetchVariables } : {}
13514
13968
  };
13515
13969
  this._log.debug(() => ["activation.request", { batchSize }]);
@@ -13538,12 +13992,10 @@ var JobWorker = class {
13538
13992
  this._activeJobs += result.length;
13539
13993
  this._scheduleNext(0);
13540
13994
  for (const raw of result) {
13541
- this._handleJob(raw).catch((err) => {
13542
- this._log.error("job.handler.unexpected", err);
13543
- });
13995
+ this._handleJob(raw);
13544
13996
  }
13545
13997
  }
13546
- async _handleJob(raw) {
13998
+ _handleJob(raw) {
13547
13999
  if (this._stopped) {
13548
14000
  this._decrementOnce();
13549
14001
  return;
@@ -13555,7 +14007,7 @@ var JobWorker = class {
13555
14007
  const parsed = this._cfg.inputSchema.safeParse(variables);
13556
14008
  if (!parsed.success) {
13557
14009
  this._log.warn("job.validation.variables.failed", parsed.error.flatten());
13558
- await this._failValidation(raw, "Invalid variables");
14010
+ this._failValidation(raw, "Invalid variables");
13559
14011
  return;
13560
14012
  }
13561
14013
  variables = parsed.data;
@@ -13564,34 +14016,18 @@ var JobWorker = class {
13564
14016
  const parsed = this._cfg.customHeadersSchema.safeParse(headers);
13565
14017
  if (!parsed.success) {
13566
14018
  this._log.warn("job.validation.headers.failed", parsed.error.flatten());
13567
- await this._failValidation(raw, "Invalid custom headers");
14019
+ this._failValidation(raw, "Invalid custom headers");
13568
14020
  return;
13569
14021
  }
13570
14022
  headers = parsed.data;
13571
14023
  }
13572
14024
  }
13573
- const job = Object.assign(raw, { variables, customHeaders: headers });
13574
- try {
13575
- const receipt = await this._cfg.jobHandler(job);
13576
- if (!job.acknowledged) {
13577
- this._log.warn("job.handler.noAction", { jobKey: raw.jobKey });
13578
- }
13579
- return receipt;
13580
- } catch (e) {
13581
- this._log.error("job.handler.error", e);
13582
- try {
13583
- const retries = raw.retries;
13584
- await this._client.failJob({
13585
- jobKey: raw.jobKey,
13586
- errorMessage: e?.message || "Handler error",
13587
- retries: typeof retries === "number" ? Math.max(0, retries - 1) : 0
13588
- });
13589
- } catch (failErr) {
13590
- this._log.error("job.fail.error", failErr);
13591
- }
13592
- return JobActionReceipt;
13593
- } finally {
13594
- this._decrementOnce();
14025
+ const enriched = Object.assign(raw, { variables, customHeaders: headers });
14026
+ const idle = this._pool.getIdleWorker();
14027
+ if (idle) {
14028
+ this._dispatchToThread(idle, enriched);
14029
+ } else {
14030
+ this._jobQueue.push({ raw: enriched });
13595
14031
  }
13596
14032
  }
13597
14033
  async _failValidation(raw, msg) {
@@ -13608,58 +14044,188 @@ var JobWorker = class {
13608
14044
  }
13609
14045
  };
13610
14046
 
13611
- // src/runtime/jobActions.ts
13612
- function enrichActivatedJob(raw, client2, log) {
13613
- let acknowledged = false;
13614
- const ack = () => {
13615
- if (!acknowledged) {
13616
- acknowledged = true;
13617
- job.acknowledged = true;
13618
- }
13619
- };
13620
- const job = { ...raw, log };
13621
- job.complete = async (variables = {}) => {
13622
- try {
13623
- await client2.completeJob({ variables, jobKey: raw.jobKey });
13624
- } finally {
13625
- ack();
13626
- }
13627
- return JobActionReceipt;
13628
- };
13629
- job.fail = async (reason) => {
14047
+ // src/runtime/clientProxy.ts
14048
+ function installClientCallHandler(port, client2) {
14049
+ port.on("message", async (msg) => {
14050
+ if (msg.type !== "client-call") return;
13630
14051
  try {
13631
- await client2.failJob({ ...reason, jobKey: raw.jobKey });
13632
- } finally {
13633
- ack();
14052
+ const fn = client2[msg.method];
14053
+ if (typeof fn !== "function") {
14054
+ throw new Error(`CamundaClient has no method '${msg.method}'`);
14055
+ }
14056
+ const result = await fn.apply(client2, msg.args);
14057
+ const reply = { type: "client-call-result", callId: msg.callId, result };
14058
+ port.postMessage(reply);
14059
+ } catch (err) {
14060
+ const reply = {
14061
+ type: "client-call-result",
14062
+ callId: msg.callId,
14063
+ error: err?.message || String(err)
14064
+ };
14065
+ port.postMessage(reply);
13634
14066
  }
13635
- return JobActionReceipt;
13636
- };
13637
- job.error = async (error) => {
13638
- try {
13639
- await client2.throwJobError({ ...error, jobKey: raw.jobKey });
13640
- } finally {
13641
- ack();
14067
+ });
14068
+ }
14069
+
14070
+ // src/runtime/threadPool.ts
14071
+ var import_meta = {};
14072
+ var ThreadPool = class {
14073
+ _pool = [];
14074
+ _pending = /* @__PURE__ */ new Map();
14075
+ _node;
14076
+ _log;
14077
+ _client;
14078
+ _ready;
14079
+ _terminated = false;
14080
+ constructor(client2, size) {
14081
+ this._client = client2;
14082
+ this._log = client2.logger().scope("thread-pool");
14083
+ this._ready = this._init(size);
14084
+ }
14085
+ /** Resolves when all threads have been spawned and signalled ready. */
14086
+ get ready() {
14087
+ return this._ready;
14088
+ }
14089
+ /** Total number of threads in the pool. */
14090
+ get size() {
14091
+ return this._pool.length;
14092
+ }
14093
+ /** Number of threads currently processing a job. */
14094
+ get busyCount() {
14095
+ return this._pool.filter((pw) => pw.busy).length;
14096
+ }
14097
+ /** Number of threads that are ready and idle. */
14098
+ get idleCount() {
14099
+ return this._pool.filter((pw) => pw.ready && !pw.busy).length;
14100
+ }
14101
+ /** Find the first ready & idle thread. */
14102
+ getIdleWorker() {
14103
+ return this._pool.find((pw) => pw.ready && !pw.busy);
14104
+ }
14105
+ /**
14106
+ * Dispatch a serialized job to a specific idle worker.
14107
+ * The caller is responsible for checking idleness first.
14108
+ */
14109
+ async dispatch(pw, jobData, handlerModule, callbacks) {
14110
+ const { randomUUID, MessageChannel } = this._node;
14111
+ const taskId = randomUUID();
14112
+ pw.busy = true;
14113
+ pw.currentTaskId = taskId;
14114
+ const { port1: mainPort, port2: workerPort } = new MessageChannel();
14115
+ installClientCallHandler(mainPort, this._client);
14116
+ this._pending.set(taskId, {
14117
+ resolve: () => {
14118
+ this._pending.delete(taskId);
14119
+ mainPort.close();
14120
+ callbacks.onComplete();
14121
+ },
14122
+ reject: (err) => {
14123
+ this._pending.delete(taskId);
14124
+ mainPort.close();
14125
+ callbacks.onError(err);
14126
+ }
14127
+ });
14128
+ pw.worker.postMessage({ type: "job", taskId, jobData, handlerModule, clientPort: workerPort }, [
14129
+ workerPort
14130
+ ]);
14131
+ }
14132
+ /** Terminate all threads and reject any in-flight tasks. */
14133
+ terminate() {
14134
+ this._terminated = true;
14135
+ for (const pw of this._pool) {
14136
+ pw.worker.terminate().catch(() => {
14137
+ });
13642
14138
  }
13643
- return JobActionReceipt;
13644
- };
13645
- job.cancelWorkflow = async () => {
13646
- try {
13647
- await client2.cancelProcessInstance({
13648
- processInstanceKey: raw.processInstanceKey
14139
+ this._pool = [];
14140
+ for (const [, pending] of this._pending) {
14141
+ pending.reject(new Error("Thread pool terminated"));
14142
+ }
14143
+ this._pending.clear();
14144
+ }
14145
+ /** Reject the pending task for a worker that errored/exited and reset its state. */
14146
+ _rejectWorkerTask(pw, message) {
14147
+ pw.busy = false;
14148
+ if (pw.currentTaskId) {
14149
+ const pending = this._pending.get(pw.currentTaskId);
14150
+ if (pending) {
14151
+ this._pending.delete(pw.currentTaskId);
14152
+ pending.reject(new Error(message));
14153
+ }
14154
+ pw.currentTaskId = void 0;
14155
+ }
14156
+ }
14157
+ async _init(requestedSize) {
14158
+ const [workerThreads, pathMod, crypto] = await Promise.all([
14159
+ import("worker_threads"),
14160
+ import("path"),
14161
+ import("crypto")
14162
+ ]);
14163
+ const { Worker } = workerThreads;
14164
+ const { join } = pathMod;
14165
+ this._node = {
14166
+ MessageChannel: workerThreads.MessageChannel,
14167
+ randomUUID: crypto.randomUUID
14168
+ };
14169
+ const cpus = await (async () => {
14170
+ try {
14171
+ const os = await import("os");
14172
+ return os.availableParallelism?.() || os.cpus().length;
14173
+ } catch {
14174
+ return 4;
14175
+ }
14176
+ })();
14177
+ const size = requestedSize ?? cpus;
14178
+ const fs = await import("fs");
14179
+ const url = await import("url");
14180
+ const dir = typeof __dirname !== "undefined" ? __dirname : pathMod.dirname(url.fileURLToPath(import_meta.url));
14181
+ const jsPath = join(dir, "threadWorkerEntry.js");
14182
+ const tsPath = join(dir, "threadWorkerEntry.ts");
14183
+ const entryPath = fs.existsSync(jsPath) ? jsPath : tsPath;
14184
+ const nodeMajor = parseInt(process.versions.node, 10);
14185
+ const execArgv = entryPath.endsWith(".ts") || nodeMajor >= 22 ? ["--experimental-strip-types", "--experimental-transform-types"] : [];
14186
+ for (let i = 0; i < size; i++) {
14187
+ const worker = new Worker(entryPath, { execArgv });
14188
+ const pw = { worker, busy: false, ready: false };
14189
+ worker.on("message", (msg) => {
14190
+ if (msg.type === "ready") {
14191
+ pw.ready = true;
14192
+ this._log.debug(() => ["thread.ready", { index: i }]);
14193
+ return;
14194
+ }
14195
+ if (msg.type === "job-result") {
14196
+ this._log.debug(() => [
14197
+ "thread.job-result",
14198
+ { taskId: msg.taskId, ok: msg.ok, error: msg.error }
14199
+ ]);
14200
+ pw.busy = false;
14201
+ pw.currentTaskId = void 0;
14202
+ const pending = this._pending.get(msg.taskId);
14203
+ if (pending) {
14204
+ if (msg.ok) {
14205
+ pending.resolve(true);
14206
+ } else {
14207
+ pending.reject(new Error(msg.error || "Handler failed"));
14208
+ }
14209
+ }
14210
+ return;
14211
+ }
13649
14212
  });
13650
- } finally {
13651
- ack();
14213
+ worker.on("error", (err) => {
14214
+ this._log.error("thread.error", err);
14215
+ this._rejectWorkerTask(pw, `Worker thread error: ${err.message}`);
14216
+ pw.ready = false;
14217
+ });
14218
+ worker.on("exit", (code) => {
14219
+ if (!this._terminated) {
14220
+ this._log.warn("thread.exit", { code });
14221
+ this._rejectWorkerTask(pw, `Worker thread exited unexpectedly (code ${code})`);
14222
+ }
14223
+ });
14224
+ this._pool.push(pw);
13652
14225
  }
13653
- return JobActionReceipt;
13654
- };
13655
- job.ignore = async () => {
13656
- ack();
13657
- return JobActionReceipt;
13658
- };
13659
- job.modifyJobTimeout = ({ newTimeoutMs }) => client2.updateJob({ changeset: { timeout: newTimeoutMs }, jobKey: raw.jobKey });
13660
- job.modifyRetries = ({ retries }) => client2.updateJob({ changeset: { retries }, jobKey: raw.jobKey });
13661
- return job;
13662
- }
14226
+ this._log.info(() => ["thread-pool.init", { size, entryPath }]);
14227
+ }
14228
+ };
13663
14229
 
13664
14230
  // src/runtime/responseEvaluation.ts
13665
14231
  function evaluateSdkResponse(raw, opts) {
@@ -13755,6 +14321,8 @@ var CamundaClient = class {
13755
14321
  _bp;
13756
14322
  /** Registered job workers created via createJobWorker (lifecycle managed by user). */
13757
14323
  _workers = [];
14324
+ /** Shared thread pool for all threaded job workers (lazy-initialised on first use). */
14325
+ _threadPool = null;
13758
14326
  /** Support logger (Node-only; no-op in browser). */
13759
14327
  _supportLogger = new class {
13760
14328
  log() {
@@ -14050,7 +14618,7 @@ var CamundaClient = class {
14050
14618
  getWorkers() {
14051
14619
  return [...this._workers];
14052
14620
  }
14053
- /** Stop all registered job workers (best-effort). */
14621
+ /** Stop all registered job workers (best-effort) and terminate the shared thread pool. */
14054
14622
  stopAllWorkers() {
14055
14623
  for (const w of this._workers) {
14056
14624
  try {
@@ -14059,6 +14627,17 @@ var CamundaClient = class {
14059
14627
  this._log.warn("worker.stop.error", e);
14060
14628
  }
14061
14629
  }
14630
+ if (this._threadPool) {
14631
+ this._threadPool.terminate();
14632
+ this._threadPool = null;
14633
+ }
14634
+ }
14635
+ /** Get or lazily create the shared thread pool for threaded job workers. */
14636
+ _getOrCreateThreadPool(threadPoolSize) {
14637
+ if (!this._threadPool) {
14638
+ this._threadPool = new ThreadPool(this, threadPoolSize);
14639
+ }
14640
+ return this._threadPool;
14062
14641
  }
14063
14642
  activateAdHocSubProcessActivities(arg, options) {
14064
14643
  return toCancelable2(async (signal) => {
@@ -16069,9 +16648,9 @@ var CamundaClient = class {
16069
16648
  }
16070
16649
  deleteDecisionInstance(arg, options) {
16071
16650
  return toCancelable2(async (signal) => {
16072
- const { decisionInstanceKey, ..._body } = arg || {};
16651
+ const { decisionEvaluationKey, ..._body } = arg || {};
16073
16652
  let envelope = {};
16074
- envelope.path = { decisionInstanceKey };
16653
+ envelope.path = { decisionEvaluationKey };
16075
16654
  envelope.body = _body;
16076
16655
  if (this._validation.settings.req !== "none") {
16077
16656
  const maybe = await this._validation.gateRequest("deleteDecisionInstance", zDeleteDecisionInstanceData, envelope);
@@ -17839,6 +18418,60 @@ var CamundaClient = class {
17839
18418
  return invoke();
17840
18419
  });
17841
18420
  }
18421
+ getJobErrorStatistics(arg, consistencyManagement, options) {
18422
+ if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
18423
+ const useConsistency = consistencyManagement.consistency;
18424
+ return toCancelable2(async (signal) => {
18425
+ const _body = arg;
18426
+ let envelope = {};
18427
+ envelope.body = _body;
18428
+ if (this._validation.settings.req !== "none") {
18429
+ const maybe = await this._validation.gateRequest("getJobErrorStatistics", zGetJobErrorStatisticsData, envelope);
18430
+ if (this._validation.settings.req === "strict") envelope = maybe;
18431
+ }
18432
+ const opts = { client: this._client, signal, throwOnError: false };
18433
+ if (envelope.body !== void 0) opts.body = envelope.body;
18434
+ const call = async () => {
18435
+ try {
18436
+ const _raw = await getJobErrorStatistics(opts);
18437
+ let data = this._evaluateResponse(_raw, "getJobErrorStatistics", (resp) => {
18438
+ const st = resp.status ?? resp.response?.status;
18439
+ if (!st) return void 0;
18440
+ const candidate = st === 429 || st === 503 || st === 500;
18441
+ if (!candidate) return void 0;
18442
+ let prob = void 0;
18443
+ if (resp.error && typeof resp.error === "object") prob = resp.error;
18444
+ const err = new Error(prob && (prob.title || prob.detail) ? prob.title || prob.detail : "HTTP " + st);
18445
+ err.status = st;
18446
+ err.name = "HttpSdkError";
18447
+ if (prob) {
18448
+ for (const k of ["type", "title", "detail", "instance"]) if (prob[k] !== void 0) err[k] = prob[k];
18449
+ }
18450
+ const isBp = st === 429 || st === 503 && err.title === "RESOURCE_EXHAUSTED" || st === 500 && (typeof err.detail === "string" && /RESOURCE_EXHAUSTED/.test(err.detail));
18451
+ if (!isBp) err.nonRetryable = true;
18452
+ return err;
18453
+ });
18454
+ const _respSchemaName = "zGetJobErrorStatisticsResponse";
18455
+ if (this._isVoidResponse(_respSchemaName)) {
18456
+ data = void 0;
18457
+ }
18458
+ if (this._validation.settings.res !== "none") {
18459
+ const _schema = zGetJobErrorStatisticsResponse;
18460
+ if (_schema) {
18461
+ const maybeR = await this._validation.gateResponse("getJobErrorStatistics", _schema, data);
18462
+ if (this._validation.settings.res === "strict") data = maybeR;
18463
+ }
18464
+ }
18465
+ return data;
18466
+ } catch (e) {
18467
+ throw e;
18468
+ }
18469
+ };
18470
+ const invoke = () => toCancelable2(() => call());
18471
+ if (useConsistency) return eventualPoll("getJobErrorStatistics", false, invoke, { ...useConsistency, logger: this._log });
18472
+ return invoke();
18473
+ });
18474
+ }
17842
18475
  getJobTimeSeriesStatistics(arg, consistencyManagement, options) {
17843
18476
  if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
17844
18477
  const useConsistency = consistencyManagement.consistency;
@@ -18997,6 +19630,48 @@ var CamundaClient = class {
18997
19630
  return this._invokeWithRetry(() => call(), { opId: "getStatus", exempt: false, retryOverride: options?.retry });
18998
19631
  });
18999
19632
  }
19633
+ getSystemConfiguration(arg, options) {
19634
+ return toCancelable2(async (signal) => {
19635
+ const opts = { client: this._client, signal, throwOnError: false };
19636
+ const call = async () => {
19637
+ try {
19638
+ const _raw = await getSystemConfiguration(opts);
19639
+ let data = this._evaluateResponse(_raw, "getSystemConfiguration", (resp) => {
19640
+ const st = resp.status ?? resp.response?.status;
19641
+ if (!st) return void 0;
19642
+ const candidate = st === 429 || st === 503 || st === 500;
19643
+ if (!candidate) return void 0;
19644
+ let prob = void 0;
19645
+ if (resp.error && typeof resp.error === "object") prob = resp.error;
19646
+ const err = new Error(prob && (prob.title || prob.detail) ? prob.title || prob.detail : "HTTP " + st);
19647
+ err.status = st;
19648
+ err.name = "HttpSdkError";
19649
+ if (prob) {
19650
+ for (const k of ["type", "title", "detail", "instance"]) if (prob[k] !== void 0) err[k] = prob[k];
19651
+ }
19652
+ const isBp = st === 429 || st === 503 && err.title === "RESOURCE_EXHAUSTED" || st === 500 && (typeof err.detail === "string" && /RESOURCE_EXHAUSTED/.test(err.detail));
19653
+ if (!isBp) err.nonRetryable = true;
19654
+ return err;
19655
+ });
19656
+ const _respSchemaName = "zGetSystemConfigurationResponse";
19657
+ if (this._isVoidResponse(_respSchemaName)) {
19658
+ data = void 0;
19659
+ }
19660
+ if (this._validation.settings.res !== "none") {
19661
+ const _schema = zGetSystemConfigurationResponse;
19662
+ if (_schema) {
19663
+ const maybeR = await this._validation.gateResponse("getSystemConfiguration", _schema, data);
19664
+ if (this._validation.settings.res === "strict") data = maybeR;
19665
+ }
19666
+ }
19667
+ return data;
19668
+ } catch (e) {
19669
+ throw e;
19670
+ }
19671
+ };
19672
+ return this._invokeWithRetry(() => call(), { opId: "getSystemConfiguration", exempt: false, retryOverride: options?.retry });
19673
+ });
19674
+ }
19000
19675
  getTenant(arg, consistencyManagement, options) {
19001
19676
  if (!consistencyManagement) throw new Error("Missing consistencyManagement parameter for eventually consistent endpoint");
19002
19677
  const useConsistency = consistencyManagement.consistency;
@@ -23511,6 +24186,31 @@ var CamundaClient = class {
23511
24186
  this._workers.push(worker);
23512
24187
  return worker;
23513
24188
  }
24189
+ /**
24190
+ * Create a threaded job worker that runs handler logic in a pool of worker threads.
24191
+ * The handler must be a separate module file that exports a default function with
24192
+ * signature `(job, client) => Promise<JobActionReceipt>`.
24193
+ *
24194
+ * This keeps the main event loop free for polling and I/O, dramatically improving
24195
+ * throughput for CPU-bound job handlers.
24196
+ *
24197
+ * @param cfg Threaded worker configuration
24198
+ * @example Create a threaded job worker
24199
+ * ```ts
24200
+ * const worker = client.createThreadedJobWorker({
24201
+ * jobType: 'cpu-heavy-task',
24202
+ * handlerModule: './my-handler.js',
24203
+ * maxParallelJobs: 32,
24204
+ * jobTimeoutMs: 30000,
24205
+ * })
24206
+ * ```
24207
+ */
24208
+ createThreadedJobWorker(cfg) {
24209
+ const pool = this._getOrCreateThreadPool(cfg.threadPoolSize);
24210
+ const worker = new ThreadedJobWorker(this, pool, cfg);
24211
+ this._workers.push(worker);
24212
+ return worker;
24213
+ }
23514
24214
  /**
23515
24215
  * Node-only convenience: deploy resources from local filesystem paths.
23516
24216
  * @param resourceFilenames Absolute or relative file paths to BPMN/DMN/form/resource files.
@@ -23647,7 +24347,7 @@ function createCamundaFpClient(options) {
23647
24347
 
23648
24348
  // src/gen/types.gen.ts
23649
24349
  function assertConstraint(value, label, c) {
23650
- if (c.pattern && !new RegExp(c.pattern).test(value)) throw new Error(`\x1B[31mInvalid pattern for ${label}: '${value}'.\x1B[0m Needs to match: ${JSON.stringify(c)}
24350
+ if (c.pattern && !new RegExp(c.pattern, "u").test(value)) throw new Error(`\x1B[31mInvalid pattern for ${label}: '${value}'.\x1B[0m Needs to match: ${JSON.stringify(c)}
23651
24351
  `);
23652
24352
  if (typeof c.minLength === "number" && value.length < c.minLength) throw new Error(`Value too short for ${label}`);
23653
24353
  if (typeof c.maxLength === "number" && value.length > c.maxLength) throw new Error(`Value too long for ${label}`);
@@ -23769,7 +24469,7 @@ var ConditionalEvaluationKey;
23769
24469
  var DecisionDefinitionId;
23770
24470
  ((DecisionDefinitionId2) => {
23771
24471
  function assumeExists(value) {
23772
- assertConstraint(value, "DecisionDefinitionId", { pattern: "^[A-Za-z0-9_@.+-]+$", minLength: 1, maxLength: 256 });
24472
+ assertConstraint(value, "DecisionDefinitionId", { pattern: "^[\\p{L}_][\\p{L}\\p{N}_\\-\\.]*$", minLength: 1 });
23773
24473
  return value;
23774
24474
  }
23775
24475
  DecisionDefinitionId2.assumeExists = assumeExists;
@@ -23779,7 +24479,7 @@ var DecisionDefinitionId;
23779
24479
  DecisionDefinitionId2.getValue = getValue;
23780
24480
  function isValid(value) {
23781
24481
  try {
23782
- assertConstraint(value, "DecisionDefinitionId", { pattern: "^[A-Za-z0-9_@.+-]+$", minLength: 1, maxLength: 256 });
24482
+ assertConstraint(value, "DecisionDefinitionId", { pattern: "^[\\p{L}_][\\p{L}\\p{N}_\\-\\.]*$", minLength: 1 });
23783
24483
  return true;
23784
24484
  } catch {
23785
24485
  return false;
@@ -24123,7 +24823,7 @@ var MessageSubscriptionKey;
24123
24823
  var ProcessDefinitionId;
24124
24824
  ((ProcessDefinitionId2) => {
24125
24825
  function assumeExists(value) {
24126
- assertConstraint(value, "ProcessDefinitionId", { pattern: "^[a-zA-Z_][a-zA-Z0-9_\\-\\.]*$", minLength: 1 });
24826
+ assertConstraint(value, "ProcessDefinitionId", { pattern: "^[\\p{L}_][\\p{L}\\p{N}_\\-\\.]*$", minLength: 1 });
24127
24827
  return value;
24128
24828
  }
24129
24829
  ProcessDefinitionId2.assumeExists = assumeExists;
@@ -24133,7 +24833,7 @@ var ProcessDefinitionId;
24133
24833
  ProcessDefinitionId2.getValue = getValue;
24134
24834
  function isValid(value) {
24135
24835
  try {
24136
- assertConstraint(value, "ProcessDefinitionId", { pattern: "^[a-zA-Z_][a-zA-Z0-9_\\-\\.]*$", minLength: 1 });
24836
+ assertConstraint(value, "ProcessDefinitionId", { pattern: "^[\\p{L}_][\\p{L}\\p{N}_\\-\\.]*$", minLength: 1 });
24137
24837
  return true;
24138
24838
  } catch {
24139
24839
  return false;