@camunda8/sdk 8.4.0 → 8.5.0-alpha.4

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.
Files changed (215) hide show
  1. package/.eslintrc.json +31 -0
  2. package/CHANGELOG.md +32 -21
  3. package/CODE_OF_CONDUCT.md +73 -0
  4. package/CONTRIBUTING.md +116 -0
  5. package/LICENSE +3 -3
  6. package/README.md +228 -34
  7. package/dist/admin/index.d.ts +2 -0
  8. package/dist/admin/index.js +30 -0
  9. package/dist/admin/index.js.map +1 -0
  10. package/dist/admin/lib/AdminApiClient.d.ts +121 -0
  11. package/dist/admin/lib/AdminApiClient.js +254 -0
  12. package/dist/admin/lib/AdminApiClient.js.map +1 -0
  13. package/dist/admin/lib/AdminDto.d.ts +98 -0
  14. package/dist/admin/lib/AdminDto.js +3 -0
  15. package/dist/admin/lib/AdminDto.js.map +1 -0
  16. package/dist/c8/index.d.ts +42 -0
  17. package/dist/c8/index.js +92 -0
  18. package/dist/c8/index.js.map +1 -0
  19. package/dist/index.d.ts +15 -14
  20. package/dist/index.js +14 -16
  21. package/dist/index.js.map +1 -1
  22. package/dist/lib/CertificateAuthority.d.ts +2 -0
  23. package/dist/lib/CertificateAuthority.js +15 -0
  24. package/dist/lib/CertificateAuthority.js.map +1 -0
  25. package/dist/lib/ClientConstructor.d.ts +6 -0
  26. package/dist/lib/ClientConstructor.js +3 -0
  27. package/dist/lib/ClientConstructor.js.map +1 -0
  28. package/dist/lib/Configuration.d.ts +113 -0
  29. package/dist/lib/Configuration.js +367 -0
  30. package/dist/lib/Configuration.js.map +1 -0
  31. package/dist/lib/ConstructOAuthProvider.d.ts +3 -0
  32. package/dist/lib/ConstructOAuthProvider.js +14 -0
  33. package/dist/lib/ConstructOAuthProvider.js.map +1 -0
  34. package/dist/lib/CreateUserAgentString.d.ts +2 -0
  35. package/dist/lib/CreateUserAgentString.js +11 -0
  36. package/dist/lib/CreateUserAgentString.js.map +1 -0
  37. package/dist/lib/Delay.d.ts +1 -0
  38. package/dist/lib/Delay.js +6 -0
  39. package/dist/lib/Delay.js.map +1 -0
  40. package/dist/lib/EnvironmentSetup.d.ts +11 -0
  41. package/dist/lib/EnvironmentSetup.js +35 -0
  42. package/dist/lib/EnvironmentSetup.js.map +1 -0
  43. package/dist/lib/GetPackageVersion.d.ts +1 -0
  44. package/dist/lib/GetPackageVersion.js +32 -0
  45. package/dist/lib/GetPackageVersion.js.map +1 -0
  46. package/dist/lib/LosslessJsonParser.d.ts +103 -0
  47. package/dist/lib/LosslessJsonParser.js +252 -0
  48. package/dist/lib/LosslessJsonParser.js.map +1 -0
  49. package/dist/lib/RequireConfiguration.d.ts +2 -0
  50. package/dist/lib/RequireConfiguration.js +11 -0
  51. package/dist/lib/RequireConfiguration.js.map +1 -0
  52. package/dist/lib/SuppressZeebeLogging.d.ts +2 -0
  53. package/dist/lib/SuppressZeebeLogging.js +14 -0
  54. package/dist/lib/SuppressZeebeLogging.js.map +1 -0
  55. package/dist/lib/ValueOrDefault.d.ts +1 -0
  56. package/dist/lib/ValueOrDefault.js +8 -0
  57. package/dist/lib/ValueOrDefault.js.map +1 -0
  58. package/dist/lib/index.d.ts +12 -0
  59. package/dist/lib/index.js +32 -0
  60. package/dist/lib/index.js.map +1 -0
  61. package/dist/modeler/index.d.ts +2 -0
  62. package/dist/modeler/index.js +30 -0
  63. package/dist/modeler/index.js.map +1 -0
  64. package/dist/modeler/lib/ModelerAPIClient.d.ts +210 -0
  65. package/dist/modeler/lib/ModelerAPIClient.js +417 -0
  66. package/dist/modeler/lib/ModelerAPIClient.js.map +1 -0
  67. package/dist/modeler/lib/ModelerDto.d.ts +187 -0
  68. package/dist/modeler/lib/ModelerDto.js +3 -0
  69. package/dist/modeler/lib/ModelerDto.js.map +1 -0
  70. package/dist/oauth/index.d.ts +15 -0
  71. package/dist/oauth/index.js +8 -0
  72. package/dist/oauth/index.js.map +1 -0
  73. package/dist/oauth/lib/IOAuthProvider.d.ts +4 -0
  74. package/dist/oauth/lib/IOAuthProvider.js +3 -0
  75. package/dist/oauth/lib/IOAuthProvider.js.map +1 -0
  76. package/dist/oauth/lib/NullAuthProvider.d.ts +5 -0
  77. package/dist/oauth/lib/NullAuthProvider.js +16 -0
  78. package/dist/oauth/lib/NullAuthProvider.js.map +1 -0
  79. package/dist/oauth/lib/OAuthProvider.d.ts +44 -0
  80. package/dist/oauth/lib/OAuthProvider.js +316 -0
  81. package/dist/oauth/lib/OAuthProvider.js.map +1 -0
  82. package/dist/operate/index.d.ts +2 -0
  83. package/dist/operate/index.js +30 -0
  84. package/dist/operate/index.js.map +1 -0
  85. package/dist/operate/lib/OperateApiClient.d.ts +204 -0
  86. package/dist/operate/lib/OperateApiClient.js +440 -0
  87. package/dist/operate/lib/OperateApiClient.js.map +1 -0
  88. package/dist/operate/lib/OperateDto.d.ts +126 -0
  89. package/dist/operate/lib/OperateDto.js +125 -0
  90. package/dist/operate/lib/OperateDto.js.map +1 -0
  91. package/dist/operate/lib/TestableOperateApiClient.d.ts +7 -0
  92. package/dist/operate/lib/TestableOperateApiClient.js +15 -0
  93. package/dist/operate/lib/TestableOperateApiClient.js.map +1 -0
  94. package/dist/operate/lib/parseSearchResults.d.ts +4 -0
  95. package/dist/operate/lib/parseSearchResults.js +26 -0
  96. package/dist/operate/lib/parseSearchResults.js.map +1 -0
  97. package/dist/optimize/index.d.ts +2 -0
  98. package/dist/optimize/index.js +30 -0
  99. package/dist/optimize/index.js.map +1 -0
  100. package/dist/optimize/lib/APIObjects.d.ts +191 -0
  101. package/dist/optimize/lib/APIObjects.js +3 -0
  102. package/dist/optimize/lib/APIObjects.js.map +1 -0
  103. package/dist/optimize/lib/OptimizeApiClient.d.ts +269 -0
  104. package/dist/optimize/lib/OptimizeApiClient.js +410 -0
  105. package/dist/optimize/lib/OptimizeApiClient.js.map +1 -0
  106. package/dist/optimize/lib/ReportResults.d.ts +23 -0
  107. package/dist/optimize/lib/ReportResults.js +28 -0
  108. package/dist/optimize/lib/ReportResults.js.map +1 -0
  109. package/dist/proto/zeebe.proto +996 -0
  110. package/dist/tasklist/index.d.ts +2 -0
  111. package/dist/tasklist/index.js +30 -0
  112. package/dist/tasklist/index.js.map +1 -0
  113. package/dist/tasklist/lib/TasklistApiClient.d.ts +104 -0
  114. package/dist/tasklist/lib/TasklistApiClient.js +233 -0
  115. package/dist/tasklist/lib/TasklistApiClient.js.map +1 -0
  116. package/dist/tasklist/lib/TasklistDto.d.ts +147 -0
  117. package/dist/tasklist/lib/TasklistDto.js +26 -0
  118. package/dist/tasklist/lib/TasklistDto.js.map +1 -0
  119. package/dist/tasklist/lib/utils.d.ts +15 -0
  120. package/dist/tasklist/lib/utils.js +25 -0
  121. package/dist/tasklist/lib/utils.js.map +1 -0
  122. package/dist/zeebe/index.d.ts +21 -0
  123. package/dist/zeebe/index.js +53 -0
  124. package/dist/zeebe/index.js.map +1 -0
  125. package/dist/zeebe/lib/BpmnParser.d.ts +38 -0
  126. package/dist/zeebe/lib/BpmnParser.js +274 -0
  127. package/dist/zeebe/lib/BpmnParser.js.map +1 -0
  128. package/dist/zeebe/lib/ConnectionFactory.d.ts +25 -0
  129. package/dist/zeebe/lib/ConnectionFactory.js +43 -0
  130. package/dist/zeebe/lib/ConnectionFactory.js.map +1 -0
  131. package/dist/zeebe/lib/ConnectionStatusEvent.d.ts +6 -0
  132. package/dist/zeebe/lib/ConnectionStatusEvent.js +10 -0
  133. package/dist/zeebe/lib/ConnectionStatusEvent.js.map +1 -0
  134. package/dist/zeebe/lib/GetPackageVersion.d.ts +1 -0
  135. package/dist/zeebe/lib/GetPackageVersion.js +32 -0
  136. package/dist/zeebe/lib/GetPackageVersion.js.map +1 -0
  137. package/dist/zeebe/lib/GrpcClient.d.ts +75 -0
  138. package/dist/zeebe/lib/GrpcClient.js +467 -0
  139. package/dist/zeebe/lib/GrpcClient.js.map +1 -0
  140. package/dist/zeebe/lib/GrpcError.d.ts +19 -0
  141. package/dist/zeebe/lib/GrpcError.js +23 -0
  142. package/dist/zeebe/lib/GrpcError.js.map +1 -0
  143. package/dist/zeebe/lib/GrpcMiddleware.d.ts +21 -0
  144. package/dist/zeebe/lib/GrpcMiddleware.js +78 -0
  145. package/dist/zeebe/lib/GrpcMiddleware.js.map +1 -0
  146. package/dist/zeebe/lib/MockStdOut.d.ts +7 -0
  147. package/dist/zeebe/lib/MockStdOut.js +19 -0
  148. package/dist/zeebe/lib/MockStdOut.js.map +1 -0
  149. package/dist/zeebe/lib/Queue.d.ts +8 -0
  150. package/dist/zeebe/lib/Queue.js +15 -0
  151. package/dist/zeebe/lib/Queue.js.map +1 -0
  152. package/dist/zeebe/lib/SimpleLogger.d.ts +8 -0
  153. package/dist/zeebe/lib/SimpleLogger.js +47 -0
  154. package/dist/zeebe/lib/SimpleLogger.js.map +1 -0
  155. package/dist/zeebe/lib/StatefulLogInterceptor.d.ts +29 -0
  156. package/dist/zeebe/lib/StatefulLogInterceptor.js +81 -0
  157. package/dist/zeebe/lib/StatefulLogInterceptor.js.map +1 -0
  158. package/dist/zeebe/lib/TypedEmitter.d.ts +16 -0
  159. package/dist/zeebe/lib/TypedEmitter.js +24 -0
  160. package/dist/zeebe/lib/TypedEmitter.js.map +1 -0
  161. package/dist/zeebe/lib/ZBJsonLogger.d.ts +5 -0
  162. package/dist/zeebe/lib/ZBJsonLogger.js +12 -0
  163. package/dist/zeebe/lib/ZBJsonLogger.js.map +1 -0
  164. package/dist/zeebe/lib/ZBLogger.d.ts +20 -0
  165. package/dist/zeebe/lib/ZBLogger.js +134 -0
  166. package/dist/zeebe/lib/ZBLogger.js.map +1 -0
  167. package/dist/zeebe/lib/ZBWorkerBase.d.ts +78 -0
  168. package/dist/zeebe/lib/ZBWorkerBase.js +417 -0
  169. package/dist/zeebe/lib/ZBWorkerBase.js.map +1 -0
  170. package/dist/zeebe/lib/cancelProcesses.d.ts +1 -0
  171. package/dist/zeebe/lib/cancelProcesses.js +40 -0
  172. package/dist/zeebe/lib/cancelProcesses.js.map +1 -0
  173. package/dist/zeebe/lib/createUniqueTaskType.d.ts +0 -0
  174. package/dist/zeebe/lib/createUniqueTaskType.js +65 -0
  175. package/dist/zeebe/lib/createUniqueTaskType.js.map +1 -0
  176. package/dist/zeebe/lib/index.d.ts +2 -0
  177. package/dist/zeebe/lib/index.js +19 -0
  178. package/dist/zeebe/lib/index.js.map +1 -0
  179. package/dist/zeebe/lib/interfaces-1.0.d.ts +303 -0
  180. package/dist/zeebe/lib/interfaces-1.0.js +5 -0
  181. package/dist/zeebe/lib/interfaces-1.0.js.map +1 -0
  182. package/dist/zeebe/lib/interfaces-grpc-1.0.d.ts +679 -0
  183. package/dist/zeebe/lib/interfaces-grpc-1.0.js +22 -0
  184. package/dist/zeebe/lib/interfaces-grpc-1.0.js.map +1 -0
  185. package/dist/zeebe/lib/interfaces-published-contract.d.ts +67 -0
  186. package/dist/zeebe/lib/interfaces-published-contract.js +3 -0
  187. package/dist/zeebe/lib/interfaces-published-contract.js.map +1 -0
  188. package/dist/zeebe/lib/stringifyVariables.d.ts +18 -0
  189. package/dist/zeebe/lib/stringifyVariables.js +28 -0
  190. package/dist/zeebe/lib/stringifyVariables.js.map +1 -0
  191. package/dist/zeebe/lib/utils.d.ts +7 -0
  192. package/dist/zeebe/lib/utils.js +48 -0
  193. package/dist/zeebe/lib/utils.js.map +1 -0
  194. package/dist/zeebe/types.d.ts +3 -0
  195. package/dist/zeebe/types.js +20 -0
  196. package/dist/zeebe/types.js.map +1 -0
  197. package/dist/zeebe/zb/ZBWorker.d.ts +7 -0
  198. package/dist/zeebe/zb/ZBWorker.js +73 -0
  199. package/dist/zeebe/zb/ZBWorker.js.map +1 -0
  200. package/dist/zeebe/zb/ZeebeGrpcClient.d.ts +587 -0
  201. package/dist/zeebe/zb/ZeebeGrpcClient.js +1021 -0
  202. package/dist/zeebe/zb/ZeebeGrpcClient.js.map +1 -0
  203. package/package.json +130 -30
  204. package/renovate.json +9 -0
  205. package/.github/workflows/build-docs.yml +0 -39
  206. package/.github/workflows/tag-and-publish.yml +0 -48
  207. package/.prettierignore +0 -2
  208. package/img/video.png +0 -0
  209. package/jest.config.js +0 -5
  210. package/src/__tests__/exports.spec.ts +0 -7
  211. package/src/index.ts +0 -17
  212. package/tsconfig.build.json +0 -8
  213. package/tsconfig.json +0 -10
  214. package/tsconfig.tsbuildinfo +0 -1
  215. package/typedoc.json +0 -10
@@ -0,0 +1,303 @@
1
+ import { ClientReadableStream } from '@grpc/grpc-js';
2
+ import { Chalk } from 'chalk';
3
+ import { MaybeTimeDuration } from 'typed-duration';
4
+ import { ZBWorker } from '../zb/ZBWorker';
5
+ import { GrpcClient } from './GrpcClient';
6
+ import { ActivateJobsRequest, BroadcastSignalRequest, BroadcastSignalResponse, CompleteJobRequest, CreateProcessInstanceRequest, CreateProcessInstanceResponse, CreateProcessInstanceWithResultRequest, CreateProcessInstanceWithResultResponseOnWire, DeleteResourceRequest, DeployResourceRequest, DeployResourceResponse, EvaluateDecisionRequest, EvaluateDecisionResponse, FailJobRequest, MigrateProcessInstanceRequest, MigrateProcessInstanceResponse, ModifyProcessInstanceRequest, ModifyProcessInstanceResponse, ProcessInstanceCreationStartInstruction, PublishMessageRequest, PublishMessageResponse, ResolveIncidentRequest, SetVariablesRequestOnTheWire, ThrowErrorRequest, TopologyResponse, UpdateJobRetriesRequest } from './interfaces-grpc-1.0';
7
+ import { Loglevel, ZBCustomLogger } from './interfaces-published-contract';
8
+ export interface ZBLogMessage {
9
+ timestamp: Date;
10
+ context: string;
11
+ id: string;
12
+ level: Loglevel;
13
+ message: string;
14
+ time: string;
15
+ }
16
+ export interface CreateProcessBaseRequest<V extends JSONDoc> {
17
+ /**
18
+ * the BPMN process ID of the process definition
19
+ */
20
+ bpmnProcessId: string;
21
+ /**
22
+ * the version of the process; if not specified it will use the latest version
23
+ */
24
+ version?: number;
25
+ /**
26
+ * JSON document that will instantiate the variables for the root variable scope of the
27
+ * process instance.
28
+ */
29
+ variables: V;
30
+ /** The tenantId for a multi-tenant enabled cluster. */
31
+ tenantId?: string;
32
+ }
33
+ export interface CreateProcessInstanceReq<V extends JSONDoc> extends CreateProcessBaseRequest<V> {
34
+ /**
35
+ * List of start instructions. If empty (default) the process instance
36
+ * will start at the start event. If non-empty the process instance will apply start
37
+ * instructions after it has been created
38
+ */
39
+ startInstructions?: ProcessInstanceCreationStartInstruction[];
40
+ }
41
+ export interface CreateProcessInstanceWithResultReq<T extends JSONDoc> extends CreateProcessBaseRequest<T> {
42
+ /**
43
+ * timeout in milliseconds. the request will be closed if the process is not completed before the requestTimeout.
44
+ * if requestTimeout = 0, uses the generic requestTimeout configured in the gateway.
45
+ */
46
+ requestTimeout?: number;
47
+ /**
48
+ * list of names of variables to be included in `CreateProcessInstanceWithResultResponse.variables`.
49
+ * If empty, all visible variables in the root scope will be returned.
50
+ */
51
+ fetchVariables?: string[];
52
+ }
53
+ export interface OperationOptionsWithRetry {
54
+ maxRetries: number;
55
+ retry: true;
56
+ version?: number;
57
+ }
58
+ export interface OperationOptionsNoRetry {
59
+ retry: false;
60
+ version?: number;
61
+ }
62
+ export type OperationOptions = OperationOptionsWithRetry | OperationOptionsNoRetry;
63
+ export type JSON = string | number | boolean | JSON[] | JSONDoc[] | JSONDoc;
64
+ export interface JSONDoc {
65
+ [key: string]: JSON | undefined;
66
+ }
67
+ export interface IInputVariables {
68
+ [key: string]: JSON;
69
+ }
70
+ export interface IProcessVariables {
71
+ [key: string]: JSON;
72
+ }
73
+ export interface IOutputVariables {
74
+ [key: string]: JSON;
75
+ }
76
+ export interface ICustomHeaders {
77
+ [key: string]: string | number;
78
+ }
79
+ export interface JobFailureConfiguration {
80
+ errorMessage: string;
81
+ /**
82
+ * If not specified, the library will decrement the "current remaining retries" count by one
83
+ */
84
+ retries?: number;
85
+ /**
86
+ * Optional backoff for subsequent retries, in milliseconds. If not specified, it is zero.
87
+ */
88
+ retryBackOff?: number;
89
+ }
90
+ declare function FailureHandler(errorMessage: string, retries?: number): Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
91
+ declare function FailureHandler(failureConfiguration: JobFailureConfiguration): Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
92
+ export interface ErrorJobWithVariables {
93
+ variables: JSONDoc;
94
+ errorCode: string;
95
+ errorMessage?: string;
96
+ }
97
+ export type ErrorJobOutcome = (errorCode: string | ErrorJobWithVariables, errorMessage?: string) => Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
98
+ export interface JobCompletionInterface<WorkerOutputVariables> {
99
+ /**
100
+ * Cancel the workflow.
101
+ */
102
+ cancelWorkflow: () => Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
103
+ /**
104
+ * Complete the job with a success, optionally passing in a state update to merge
105
+ * with the process variables on the broker.
106
+ */
107
+ complete: (updatedVariables?: WorkerOutputVariables) => Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
108
+ /**
109
+ * Fail the job with an informative message as to the cause. Optionally, pass in a
110
+ * value remaining retries. If no value is passed for retries then the current retry
111
+ * count is decremented. Pass in `0`for retries to raise an incident in Operate. Optionally,
112
+ * specify a retry backoff period in milliseconds. Default is 0ms (immediate retry) if not
113
+ * specified.
114
+ */
115
+ fail: typeof FailureHandler;
116
+ /**
117
+ * Mark this job as forwarded to another system for completion. No action is taken by the broker.
118
+ * This method releases worker capacity to handle another job.
119
+ */
120
+ forward: () => JOB_ACTION_ACKNOWLEDGEMENT;
121
+ /**
122
+ *
123
+ * Report a business error (i.e. non-technical) that occurs while processing a job.
124
+ * The error is handled in the process by an error catch event.
125
+ * If there is no error catch event with the specified errorCode then an incident will be raised instead.
126
+ */
127
+ error: ErrorJobOutcome;
128
+ }
129
+ export interface ZeebeJob<WorkerInputVariables = IInputVariables, CustomHeaderShape = ICustomHeaders, WorkerOutputVariables = IOutputVariables> extends Job<WorkerInputVariables, CustomHeaderShape>, JobCompletionInterface<WorkerOutputVariables> {
130
+ }
131
+ export type ZBWorkerTaskHandler<WorkerInputVariables = IInputVariables, CustomHeaderShape = ICustomHeaders, WorkerOutputVariables = IOutputVariables> = (job: Readonly<ZeebeJob<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>>, worker: ZBWorker<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>) => MustReturnJobActionAcknowledgement;
132
+ export interface ZBLoggerOptions {
133
+ loglevel?: Loglevel;
134
+ stdout?: ZBCustomLogger;
135
+ color?: Chalk;
136
+ longPoll?: MaybeTimeDuration;
137
+ namespace: string | string[];
138
+ pollInterval?: MaybeTimeDuration;
139
+ taskType?: string;
140
+ }
141
+ export interface ZBLoggerConfig extends ZBLoggerOptions {
142
+ id?: string;
143
+ colorise?: boolean;
144
+ _tag: 'ZBCLIENT' | 'ZBWORKER';
145
+ }
146
+ export type ConnectionErrorHandler = (error?: unknown) => void;
147
+ export interface Job<Variables = IInputVariables, CustomHeaderShape = ICustomHeaders> {
148
+ /** The key, a unique identifier for the job */
149
+ readonly key: string;
150
+ /**
151
+ * The job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
152
+ * type="payment-service" />)
153
+ */
154
+ readonly type: string;
155
+ /** The job's process instance key */
156
+ readonly processInstanceKey: string;
157
+ /** The bpmn process ID of the job process definition */
158
+ readonly bpmnProcessId: string;
159
+ /** The version of the job process definition */
160
+ readonly processDefinitionVersion: number;
161
+ /** The associated task element ID */
162
+ readonly elementId: string;
163
+ /**
164
+ * The unique key identifying the associated task, unique within the scope of the
165
+ * process instance
166
+ */
167
+ readonly elementInstanceKey: string;
168
+ /**
169
+ * A set of custom headers defined during modelling
170
+ */
171
+ readonly customHeaders: Readonly<CustomHeaderShape>;
172
+ /** The name of the worker that activated this job */
173
+ readonly worker: string;
174
+ readonly retries: number;
175
+ readonly deadline: string;
176
+ /**
177
+ * All visible variables in the task scope, computed at activation time.
178
+ */
179
+ readonly variables: Readonly<Variables>;
180
+ }
181
+ export interface ZBWorkerOptions<InputVars = IInputVariables> {
182
+ /**
183
+ * Max concurrent tasks for this worker. Default 32.
184
+ */
185
+ maxJobsToActivate?: number;
186
+ /**
187
+ * Max seconds to allow before time out of a job given to this worker. Default: 30s.
188
+ * The broker checks deadline timeouts every 30 seconds, so an
189
+ */
190
+ timeout?: MaybeTimeDuration;
191
+ /**
192
+ * Poll Interval in ms. Default 100.
193
+ */
194
+ pollInterval?: MaybeTimeDuration;
195
+ /**
196
+ * Constrain payload to these keys only.
197
+ */
198
+ fetchVariable?: (keyof InputVars)[];
199
+ /**
200
+ * This handler is called when the worker cannot connect to the broker, or loses its connection.
201
+ */
202
+ onConnectionErrorHandler?: ConnectionErrorHandler;
203
+ /**
204
+ * If a handler throws an unhandled exception, if this is set true, the process will be failed. Defaults to false.
205
+ */
206
+ failProcessOnException?: boolean;
207
+ /**
208
+ * Enable debug tracking
209
+ */
210
+ debug?: boolean;
211
+ }
212
+ export declare const JOB_ACTION_ACKNOWLEDGEMENT: "JOB_ACTION_ACKNOWLEDGEMENT";
213
+ export type JOB_ACTION_ACKNOWLEDGEMENT = typeof JOB_ACTION_ACKNOWLEDGEMENT;
214
+ export type MustReturnJobActionAcknowledgement = JOB_ACTION_ACKNOWLEDGEMENT | Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
215
+ export interface ZBWorkerConfig<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables> extends ZBWorkerOptions<WorkerInputVariables> {
216
+ /**
217
+ * A custom id for the worker. If none is supplied, a UUID will be generated.
218
+ */
219
+ id?: string;
220
+ logNamespace?: string;
221
+ /**
222
+ * A custom longpoll timeout. By default long polling is every 30 seconds.
223
+ */
224
+ longPoll?: MaybeTimeDuration;
225
+ /**
226
+ * If your Grpc connection jitters, this is the window before the connectionError
227
+ */
228
+ connectionTolerance?: MaybeTimeDuration;
229
+ /**
230
+ * A log level if you want it to differ from the ZBClient
231
+ */
232
+ loglevel?: Loglevel;
233
+ /**
234
+ * The capacity of the worker. When it is servicing this many jobs, it will not ask for more.
235
+ * It will also ask for a number of jobs that is the delta between this number and its currently
236
+ * active jobs, when activating jobs from the broker.
237
+ */
238
+ /**
239
+ * An implementation of the ZBCustomLogger interface for logging
240
+ */
241
+ stdout?: ZBCustomLogger;
242
+ /**
243
+ * The task type that this worker will request jobs for.
244
+ */
245
+ taskType: string;
246
+ /**
247
+ * A job handler - this must return a job action - e.g.: job.complete(), job.error() - in all code paths.
248
+ */
249
+ taskHandler: ZBWorkerTaskHandler<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>;
250
+ /**
251
+ * This handler is called when the worker (re)establishes its connection to the broker
252
+ */
253
+ onReady?: () => void;
254
+ /**
255
+ * This handler is called when the worker cannot connect to the broker, or loses its connection.
256
+ */
257
+ onConnectionError?: () => void;
258
+ /**
259
+ * Provide an annotated Dto class to control the serialisation of JSON numbers. This allows you to serialise
260
+ * numbers as strings or BigInts to avoid precision loss. This also gives you design-time type safety.
261
+ */
262
+ inputVariableDto?: {
263
+ new (...args: any[]): Readonly<WorkerInputVariables>;
264
+ };
265
+ /**
266
+ * Provide an annotated Dto class to control the serialisation of JSON numbers. This allows you to serialise
267
+ * numbers as strings or BigInts to avoid precision loss. This also gives you design-time type safety.
268
+ */
269
+ customHeadersDto?: {
270
+ new (...args: any[]): Readonly<CustomHeaderShape>;
271
+ };
272
+ }
273
+ export interface BroadcastSignalReq {
274
+ signalName: string;
275
+ variables?: JSONDoc;
276
+ tenantId?: string;
277
+ }
278
+ export interface BroadcastSignalRes {
279
+ key: string;
280
+ }
281
+ export interface ZBGrpc extends GrpcClient {
282
+ completeJobSync: (req: CompleteJobRequest) => Promise<void>;
283
+ activateJobsStream: (req: ActivateJobsRequest) => ClientReadableStream<unknown>;
284
+ publishMessageSync(publishMessageRequest: PublishMessageRequest): Promise<PublishMessageResponse>;
285
+ throwErrorSync(throwErrorRequest: ThrowErrorRequest): Promise<void>;
286
+ topologySync(): Promise<TopologyResponse>;
287
+ updateJobRetriesSync(updateJobRetriesRequest: UpdateJobRetriesRequest): Promise<void>;
288
+ deleteResourceSync: (deleteResourceRequest: DeleteResourceRequest) => Promise<Record<string, never>>;
289
+ deployResourceSync<T>(resource: DeployResourceRequest): Promise<DeployResourceResponse<T>>;
290
+ evaluateDecisionSync(evaluateDecisionRequest: EvaluateDecisionRequest): Promise<EvaluateDecisionResponse>;
291
+ failJobSync(failJobRequest: FailJobRequest): Promise<void>;
292
+ createProcessInstanceSync(createProcessInstanceRequest: CreateProcessInstanceRequest): Promise<CreateProcessInstanceResponse>;
293
+ createProcessInstanceWithResultSync(createProcessInstanceWithResultRequest: CreateProcessInstanceWithResultRequest): Promise<CreateProcessInstanceWithResultResponseOnWire>;
294
+ cancelProcessInstanceSync(processInstanceKey: {
295
+ processInstanceKey: string | number;
296
+ }): Promise<void>;
297
+ migrateProcessInstanceSync(request: MigrateProcessInstanceRequest): Promise<MigrateProcessInstanceResponse>;
298
+ modifyProcessInstanceSync(request: ModifyProcessInstanceRequest): Promise<ModifyProcessInstanceResponse>;
299
+ setVariablesSync(request: SetVariablesRequestOnTheWire): Promise<void>;
300
+ resolveIncidentSync(resolveIncidentRequest: ResolveIncidentRequest): Promise<void>;
301
+ broadcastSignalSync(signal: BroadcastSignalRequest): Promise<BroadcastSignalResponse>;
302
+ }
303
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JOB_ACTION_ACKNOWLEDGEMENT = void 0;
4
+ exports.JOB_ACTION_ACKNOWLEDGEMENT = 'JOB_ACTION_ACKNOWLEDGEMENT';
5
+ //# sourceMappingURL=interfaces-1.0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces-1.0.js","sourceRoot":"","sources":["../../../src/zeebe/lib/interfaces-1.0.ts"],"names":[],"mappings":";;;AA+Sa,QAAA,0BAA0B,GAAG,4BAAqC,CAAA"}