@camunda8/sdk 8.6.13 → 8.6.15

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 (71) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +24 -2
  3. package/dist/admin/lib/AdminApiClient.js +1 -0
  4. package/dist/admin/lib/AdminApiClient.js.map +1 -1
  5. package/dist/c8/index.d.ts +21 -10
  6. package/dist/c8/index.js +33 -15
  7. package/dist/c8/index.js.map +1 -1
  8. package/dist/c8/lib/C8Dto.d.ts +282 -0
  9. package/dist/c8/lib/C8Dto.js +97 -0
  10. package/dist/c8/lib/C8Dto.js.map +1 -0
  11. package/dist/c8/lib/C8Logger.d.ts +9 -0
  12. package/dist/c8/lib/C8Logger.js +35 -0
  13. package/dist/c8/lib/C8Logger.js.map +1 -0
  14. package/dist/c8/lib/CamundaJobWorker.d.ts +52 -0
  15. package/dist/c8/lib/CamundaJobWorker.js +125 -0
  16. package/dist/c8/lib/CamundaJobWorker.js.map +1 -0
  17. package/dist/c8/lib/CamundaRestClient.d.ts +311 -0
  18. package/dist/c8/lib/CamundaRestClient.js +645 -0
  19. package/dist/c8/lib/CamundaRestClient.js.map +1 -0
  20. package/dist/c8/lib/RestApiJobClassFactory.d.ts +3 -0
  21. package/dist/c8/lib/RestApiJobClassFactory.js +36 -0
  22. package/dist/c8/lib/RestApiJobClassFactory.js.map +1 -0
  23. package/dist/c8/lib/RestApiProcessInstanceClassFactory.d.ts +3 -0
  24. package/dist/c8/lib/RestApiProcessInstanceClassFactory.js +33 -0
  25. package/dist/c8/lib/RestApiProcessInstanceClassFactory.js.map +1 -0
  26. package/dist/index.d.ts +5 -3
  27. package/dist/index.js +12 -2
  28. package/dist/index.js.map +1 -1
  29. package/dist/lib/Configuration.d.ts +15 -6
  30. package/dist/lib/Configuration.js +9 -1
  31. package/dist/lib/Configuration.js.map +1 -1
  32. package/dist/lib/CreateDtoInstance.d.ts +16 -0
  33. package/dist/lib/CreateDtoInstance.js +25 -0
  34. package/dist/lib/CreateDtoInstance.js.map +1 -0
  35. package/dist/lib/GotErrors.d.ts +1 -1
  36. package/dist/lib/GotHooks.js +4 -2
  37. package/dist/lib/GotHooks.js.map +1 -1
  38. package/dist/lib/LosslessJsonParser.d.ts +43 -6
  39. package/dist/lib/LosslessJsonParser.js +158 -24
  40. package/dist/lib/LosslessJsonParser.js.map +1 -1
  41. package/dist/lib/index.d.ts +1 -0
  42. package/dist/lib/index.js +1 -0
  43. package/dist/lib/index.js.map +1 -1
  44. package/dist/modeler/lib/ModelerAPIClient.js +13 -6
  45. package/dist/modeler/lib/ModelerAPIClient.js.map +1 -1
  46. package/dist/modeler/lib/ModelerDto.d.ts +4 -5
  47. package/dist/operate/lib/OperateApiClient.js +1 -0
  48. package/dist/operate/lib/OperateApiClient.js.map +1 -1
  49. package/dist/optimize/lib/OptimizeApiClient.js +1 -0
  50. package/dist/optimize/lib/OptimizeApiClient.js.map +1 -1
  51. package/dist/proto/zeebe.proto +22 -0
  52. package/dist/tasklist/lib/TasklistApiClient.js +1 -0
  53. package/dist/tasklist/lib/TasklistApiClient.js.map +1 -1
  54. package/dist/zeebe/lib/GrpcClient.js +1 -6
  55. package/dist/zeebe/lib/GrpcClient.js.map +1 -1
  56. package/dist/zeebe/lib/ZBWorkerBase.js +2 -3
  57. package/dist/zeebe/lib/ZBWorkerBase.js.map +1 -1
  58. package/dist/zeebe/lib/interfaces-1.0.d.ts +101 -8
  59. package/dist/zeebe/lib/interfaces-1.0.js.map +1 -1
  60. package/dist/zeebe/lib/interfaces-grpc-1.0.d.ts +22 -3
  61. package/dist/zeebe/lib/interfaces-grpc-1.0.js.map +1 -1
  62. package/dist/zeebe/lib/stringifyVariables.d.ts +8 -0
  63. package/dist/zeebe/lib/stringifyVariables.js +18 -4
  64. package/dist/zeebe/lib/stringifyVariables.js.map +1 -1
  65. package/dist/zeebe/zb/ZeebeGrpcClient.d.ts +9 -7
  66. package/dist/zeebe/zb/ZeebeGrpcClient.js +41 -9
  67. package/dist/zeebe/zb/ZeebeGrpcClient.js.map +1 -1
  68. package/dist/zeebe/zb/ZeebeRESTClient.d.ts +3 -0
  69. package/dist/zeebe/zb/ZeebeRESTClient.js +3 -0
  70. package/dist/zeebe/zb/ZeebeRESTClient.js.map +1 -1
  71. package/package.json +7 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ ## [8.6.15](https://github.com/camunda/camunda-8-js-sdk/compare/v8.6.14...v8.6.15) (2024-10-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **modeler:** correct HTTP methods for file methods. fixes [#269](https://github.com/camunda/camunda-8-js-sdk/issues/269) ([7819baa](https://github.com/camunda/camunda-8-js-sdk/commit/7819baa83124a4e0cdf40e33e55803a64a1b6282))
7
+
8
+ ## [8.6.14](https://github.com/camunda/camunda-8-js-sdk/compare/v8.6.13...v8.6.14) (2024-10-24)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **camunda8:** correctly parse autostart parameter of JobWorker ([cb95946](https://github.com/camunda/camunda-8-js-sdk/commit/cb95946ab989f86a5992900292db2227be0824db))
14
+ * **camunda8:** type variables in async process instance start as never ([3055734](https://github.com/camunda/camunda-8-js-sdk/commit/3055734f521341aff850b6545c8919d38d9642a6))
15
+ * **lossless-parser:** correctly parse number array ([d69729a](https://github.com/camunda/camunda-8-js-sdk/commit/d69729ad07f05649a59b9f89282dc01f87698b4f)), closes [#258](https://github.com/camunda/camunda-8-js-sdk/issues/258)
16
+ * **lossless-parser:** throw on encountering Date, Map, or Set ([bb5d8ea](https://github.com/camunda/camunda-8-js-sdk/commit/bb5d8ea666d7d6f0da9823f7ecf0a187708eab6b)), closes [#254](https://github.com/camunda/camunda-8-js-sdk/issues/254)
17
+ * **zeebe:** do not override explicit ZEEBE_GRPC_ADDRESS with default ZEEBE_ADDRESS ([cd6080f](https://github.com/camunda/camunda-8-js-sdk/commit/cd6080fcaa8073e4655f72127af30db11f9ef743)), closes [#245](https://github.com/camunda/camunda-8-js-sdk/issues/245)
18
+ * **zeebe:** throw on client if array passed as variables to CompleteJob ([40a6316](https://github.com/camunda/camunda-8-js-sdk/commit/40a63164a7588ea81fa0df16e9538fa5366dc049)), closes [#247](https://github.com/camunda/camunda-8-js-sdk/issues/247)
19
+
20
+
21
+ ### Features
22
+
23
+ * **camunda8:** add C8RestClient ([8e93c92](https://github.com/camunda/camunda-8-js-sdk/commit/8e93c92bfb3684b530428f253f5de05c771e4215)), closes [#235](https://github.com/camunda/camunda-8-js-sdk/issues/235)
24
+ * **camunda8:** add modifyAuthorization method ([0d97f68](https://github.com/camunda/camunda-8-js-sdk/commit/0d97f681ad1a1c9d295f43c83f342b6eb5cfa3da))
25
+ * **camunda8:** complete deployResources feature ([8043ac9](https://github.com/camunda/camunda-8-js-sdk/commit/8043ac9afe5f6f6ec6e8bdfa90dbf40def6a0510))
26
+ * **camunda8:** implement createProcessInstanceWithResult ([4ec4fa1](https://github.com/camunda/camunda-8-js-sdk/commit/4ec4fa1b6c1554bbac04ba275da3e1bba2dbf012))
27
+ * **camunda8:** implement deleteResource over REST ([1dcb101](https://github.com/camunda/camunda-8-js-sdk/commit/1dcb1019b96788d952363d776a6976b99588d541)), closes [#251](https://github.com/camunda/camunda-8-js-sdk/issues/251)
28
+ * **camunda8:** implement deployResources REST API ([debd212](https://github.com/camunda/camunda-8-js-sdk/commit/debd2122e713e98e3180a0bf0b200a1560788b81))
29
+ * **camunda8:** implement publishMessage over REST ([057a9fe](https://github.com/camunda/camunda-8-js-sdk/commit/057a9feaf1a6e13011f130ca201947e39de54390)), closes [#250](https://github.com/camunda/camunda-8-js-sdk/issues/250)
30
+ * **camunda8:** support broadcastSignal over REST ([43f82a4](https://github.com/camunda/camunda-8-js-sdk/commit/43f82a44f69f0217003775d422c741555f1fe6b1)), closes [#248](https://github.com/camunda/camunda-8-js-sdk/issues/248)
31
+ * **camunda8:** support pluggable winston logging for C8RestClient ([d41d3f8](https://github.com/camunda/camunda-8-js-sdk/commit/d41d3f8de6afe2d8d3daff207519a52119f26cc9))
32
+ * **camunda8:** support updateElementInstanceVariables ([7de82b7](https://github.com/camunda/camunda-8-js-sdk/commit/7de82b75c9a08fe34444d549e3c9c2077a768b3e)), closes [#249](https://github.com/camunda/camunda-8-js-sdk/issues/249)
33
+ * **repo:** support passing middleware ([1b7715e](https://github.com/camunda/camunda-8-js-sdk/commit/1b7715e0e2778b058d7e0d8b67f29a27007c06af)), closes [#261](https://github.com/camunda/camunda-8-js-sdk/issues/261)
34
+ * **zeebe:** add operationReference field to gRPC methods ([2e5af66](https://github.com/camunda/camunda-8-js-sdk/commit/2e5af662f9ecc1ee23115eb4232e0633afde3efe)), closes [#237](https://github.com/camunda/camunda-8-js-sdk/issues/237)
35
+ * **zeebe:** create and cancel process instances over REST ([a49d217](https://github.com/camunda/camunda-8-js-sdk/commit/a49d217f95b9b550bedd9af79fe9d950ad31add2))
36
+ * **zeebe:** lossless parse REST variables and customheaders ([f19a252](https://github.com/camunda/camunda-8-js-sdk/commit/f19a2520778836c34a3685d584c4969380672804)), closes [#244](https://github.com/camunda/camunda-8-js-sdk/issues/244)
37
+
1
38
  ## [8.6.13](https://github.com/camunda/camunda-8-js-sdk/compare/v8.6.12...v8.6.13) (2024-09-26)
2
39
 
3
40
 
package/README.md CHANGED
@@ -59,7 +59,7 @@ Entity keys in Camunda 8 are stored and represented as `int64` numbers. The rang
59
59
 
60
60
  Some number values - for example: "_total returned results_ " - may be specified as `int64` in the API specifications. Although these numbers will usually not contain unsafe values, they are always serialised to `string`.
61
61
 
62
- For `int64` values whose type is not known ahead of time, such as job variables, you can pass an annotated data transfer object (DTO) to decode them reliably. If no DTO is specified, the default behavior of the SDK is to serialise all numbers to JavaScript `number`, and if a number value is detected at a runtime that cannot be accurately stored as `number`, to throw an exception.
62
+ For `int64` values whose type is not known ahead of time, such as job variables, you can pass an annotated data transfer object (DTO) to decode them reliably. If no DTO is specified, the default behavior of the SDK is to serialise all numbers to JavaScript `number`, and to throw an exception if a number value is detected at a runtime that cannot be accurately represented as the JavaScript `number` type (that is, a value greater than 2^53-1).
63
63
 
64
64
  ## Authorization
65
65
 
@@ -222,9 +222,31 @@ Here is an example of turning on debugging for the OAuth and Operate components:
222
222
  DEBUG=camunda:oauth,camunda:operate node app.js
223
223
  ```
224
224
 
225
+ ## Process Variable Typing
226
+
227
+ Process variables - the `variables` of Zeebe messages, jobs, and process instance creation requests and responses - are stored in the broker as key:value pairs. They are transported as a JSON string. The SDK parses the JSON string into a JavaScript object.
228
+
229
+ Various Zeebe methods accept DTO classes for variable input and output. These DTO classes are used to provide design-time type information on the `variables` object. They are also used to safely decode 64-bit integer values that cannot be accurately represented by the JavaScript `number` type.
230
+
231
+ To create a DTO to represent the expected shape and type of the `variables` object, extend the `LosslessDto` class:
232
+
233
+ ```typescript
234
+ class myVariableDTO extends LosslessDto {
235
+ firstName!: string
236
+ lastName!: string
237
+ age!: number
238
+ optionalValue?: number
239
+ @Int64String
240
+ veryBigInteger?: string
241
+ constructor(data: Partial<myVariableDTO>) {
242
+ super(data)
243
+ }
244
+ }
245
+ ```
246
+
225
247
  ## Typing of Zeebe worker variables
226
248
 
227
- The variable payload in a Zeebe worker task handler is available as an object `job.variables`. By default, this is of type `any`.
249
+ The variable payload in a Zeebe worker task handler is available as an object `job.variables`. By default, this is of type `any` for the gRPC API, and `unknown` for the REST API.
228
250
 
229
251
  The `ZBClient.createWorker()` method accepts an `inputVariableDto` to control the parsing of number values and provide design-time type information. Passing an `inputVariableDto` class to a Zeebe worker is optional. If a DTO class is passed to the Zeebe worker, it is used for two purposes:
230
252
 
@@ -31,6 +31,7 @@ class AdminApiClient {
31
31
  (0, lib_1.makeBeforeRetryHandlerFor401TokenRetry)(this.getHeaders.bind(this)),
32
32
  ],
33
33
  beforeError: [lib_1.gotBeforeErrorHook],
34
+ beforeRequest: config.middleware ?? [],
34
35
  },
35
36
  }));
36
37
  debug('prefixUrl', `${prefixUrl}`);
@@ -1 +1 @@
1
- {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AG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAA;QAC5B,OAAO,IAAI;aACT,IAAI,CAAC,WAAW,KAAK,EAAE,EAAE;YACzB,OAAO;YACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;SAClC,CAAC;aACD,IAAI,EAAE,CAAA;IACT,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAAC,KAAa;QAC/B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAA;QAC5B,OAAO,IAAI;aACT,MAAM,CAAC,WAAW,KAAK,EAAE,EAAE;YAC3B,OAAO;SACP,CAAC;aACD,IAAI,EAAE,CAAA;IACT,CAAC;CACD;AAxUD,wCAwUC"}
@@ -1,10 +1,12 @@
1
1
  import { AdminApiClient } from '../admin';
2
- import { CamundaPlatform8Configuration, DeepPartial } from '../lib';
2
+ import { Camunda8ClientConfiguration } from '../lib';
3
3
  import { ModelerApiClient } from '../modeler';
4
4
  import { OperateApiClient } from '../operate';
5
5
  import { OptimizeApiClient } from '../optimize';
6
6
  import { TasklistApiClient } from '../tasklist';
7
7
  import { ZeebeGrpcClient, ZeebeRestClient } from '../zeebe';
8
+ import { Logger } from './lib/C8Logger';
9
+ import { CamundaRestClient } from './lib/CamundaRestClient';
8
10
  /**
9
11
  * A single point of configuration for all Camunda Platform 8 clients.
10
12
  *
@@ -16,12 +18,12 @@ import { ZeebeGrpcClient, ZeebeRestClient } from '../zeebe';
16
18
  *
17
19
  * const c8 = new Camunda8()
18
20
  * const zeebe = c8.getZeebeGrpcApiClient()
19
- * const zeebeRest = c8.getZeebeRestClient()
20
21
  * const operate = c8.getOperateApiClient()
21
22
  * const optimize = c8.getOptimizeApiClient()
22
23
  * const tasklist = c8.getTasklistApiClient()
23
24
  * const modeler = c8.getModelerApiClient()
24
25
  * const admin = c8.getAdminApiClient()
26
+ * const c8Rest = c8.getCamundaRestClient()
25
27
  * ```
26
28
  */
27
29
  export declare class Camunda8 {
@@ -34,12 +36,21 @@ export declare class Camunda8 {
34
36
  private zeebeRestClient?;
35
37
  private configuration;
36
38
  private oAuthProvider;
37
- constructor(config?: DeepPartial<CamundaPlatform8Configuration>);
38
- getOperateApiClient(): OperateApiClient;
39
- getAdminApiClient(): AdminApiClient;
40
- getModelerApiClient(): ModelerApiClient;
41
- getOptimizeApiClient(): OptimizeApiClient;
42
- getTasklistApiClient(): TasklistApiClient;
43
- getZeebeGrpcApiClient(): ZeebeGrpcClient;
44
- getZeebeRestClient(): ZeebeRestClient;
39
+ private camundaRestClient?;
40
+ log: Logger;
41
+ /**
42
+ * All constructor parameters for configuration are optional. If no configuration is provided, the SDK will use environment variables to configure itself.
43
+ */
44
+ constructor(config?: Camunda8ClientConfiguration);
45
+ getOperateApiClient(config?: Camunda8ClientConfiguration): OperateApiClient;
46
+ getAdminApiClient(config?: Camunda8ClientConfiguration): AdminApiClient;
47
+ getModelerApiClient(config?: Camunda8ClientConfiguration): ModelerApiClient;
48
+ getOptimizeApiClient(config?: Camunda8ClientConfiguration): OptimizeApiClient;
49
+ getTasklistApiClient(config?: Camunda8ClientConfiguration): TasklistApiClient;
50
+ getZeebeGrpcApiClient(config?: Camunda8ClientConfiguration): ZeebeGrpcClient;
51
+ /**
52
+ * @deprecated from 8.6.0. Please use getCamundaRestClient() instead.
53
+ */
54
+ getZeebeRestClient(config?: Camunda8ClientConfiguration): ZeebeRestClient;
55
+ getCamundaRestClient(config?: Camunda8ClientConfiguration): CamundaRestClient;
45
56
  }
package/dist/c8/index.js CHANGED
@@ -8,6 +8,8 @@ const operate_1 = require("../operate");
8
8
  const optimize_1 = require("../optimize");
9
9
  const tasklist_1 = require("../tasklist");
10
10
  const zeebe_1 = require("../zeebe");
11
+ const C8Logger_1 = require("./lib/C8Logger");
12
+ const CamundaRestClient_1 = require("./lib/CamundaRestClient");
11
13
  /**
12
14
  * A single point of configuration for all Camunda Platform 8 clients.
13
15
  *
@@ -19,83 +21,99 @@ const zeebe_1 = require("../zeebe");
19
21
  *
20
22
  * const c8 = new Camunda8()
21
23
  * const zeebe = c8.getZeebeGrpcApiClient()
22
- * const zeebeRest = c8.getZeebeRestClient()
23
24
  * const operate = c8.getOperateApiClient()
24
25
  * const optimize = c8.getOptimizeApiClient()
25
26
  * const tasklist = c8.getTasklistApiClient()
26
27
  * const modeler = c8.getModelerApiClient()
27
28
  * const admin = c8.getAdminApiClient()
29
+ * const c8Rest = c8.getCamundaRestClient()
28
30
  * ```
29
31
  */
30
32
  class Camunda8 {
33
+ /**
34
+ * All constructor parameters for configuration are optional. If no configuration is provided, the SDK will use environment variables to configure itself.
35
+ */
31
36
  constructor(config = {}) {
32
37
  this.configuration =
33
38
  lib_1.CamundaEnvironmentConfigurator.mergeConfigWithEnvironment(config);
34
39
  this.oAuthProvider = (0, lib_1.constructOAuthProvider)(this.configuration);
40
+ this.log = (0, C8Logger_1.getLogger)(config);
35
41
  }
36
- getOperateApiClient() {
42
+ getOperateApiClient(config = {}) {
37
43
  if (!this.operateApiClient) {
38
44
  this.operateApiClient = new operate_1.OperateApiClient({
39
- config: this.configuration,
45
+ config: { ...this.configuration, ...config },
40
46
  oAuthProvider: this.oAuthProvider,
41
47
  });
42
48
  }
43
49
  return this.operateApiClient;
44
50
  }
45
- getAdminApiClient() {
51
+ getAdminApiClient(config = {}) {
46
52
  if (!this.adminApiClient) {
47
53
  this.adminApiClient = new admin_1.AdminApiClient({
48
- config: this.configuration,
54
+ config: { ...this.configuration, ...config },
49
55
  oAuthProvider: this.oAuthProvider,
50
56
  });
51
57
  }
52
58
  return this.adminApiClient;
53
59
  }
54
- getModelerApiClient() {
60
+ getModelerApiClient(config = {}) {
55
61
  if (!this.modelerApiClient) {
56
62
  this.modelerApiClient = new modeler_1.ModelerApiClient({
57
- config: this.configuration,
63
+ config: { ...this.configuration, ...config },
58
64
  oAuthProvider: this.oAuthProvider,
59
65
  });
60
66
  }
61
67
  return this.modelerApiClient;
62
68
  }
63
- getOptimizeApiClient() {
69
+ getOptimizeApiClient(config = {}) {
64
70
  if (!this.optimizeApiClient) {
65
71
  this.optimizeApiClient = new optimize_1.OptimizeApiClient({
66
- config: this.configuration,
72
+ config: { ...this.configuration, ...config },
67
73
  oAuthProvider: this.oAuthProvider,
68
74
  });
69
75
  }
70
76
  return this.optimizeApiClient;
71
77
  }
72
- getTasklistApiClient() {
78
+ getTasklistApiClient(config = {}) {
73
79
  if (!this.tasklistApiClient) {
74
80
  this.tasklistApiClient = new tasklist_1.TasklistApiClient({
75
- config: this.configuration,
81
+ config: { ...this.configuration, ...config },
76
82
  oAuthProvider: this.oAuthProvider,
77
83
  });
78
84
  }
79
85
  return this.tasklistApiClient;
80
86
  }
81
- getZeebeGrpcApiClient() {
87
+ getZeebeGrpcApiClient(config = {}) {
82
88
  if (!this.zeebeGrpcApiClient) {
83
89
  this.zeebeGrpcApiClient = new zeebe_1.ZeebeGrpcClient({
84
- config: this.configuration,
90
+ config: { ...this.configuration, ...config },
85
91
  oAuthProvider: this.oAuthProvider,
86
92
  });
87
93
  }
88
94
  return this.zeebeGrpcApiClient;
89
95
  }
90
- getZeebeRestClient() {
96
+ /**
97
+ * @deprecated from 8.6.0. Please use getCamundaRestClient() instead.
98
+ */
99
+ getZeebeRestClient(config = {}) {
91
100
  if (!this.zeebeRestClient) {
92
101
  this.zeebeRestClient = new zeebe_1.ZeebeRestClient({
93
- config: this.configuration,
102
+ config: { ...this.configuration, ...config },
94
103
  oAuthProvider: this.oAuthProvider,
95
104
  });
96
105
  }
97
106
  return this.zeebeRestClient;
98
107
  }
108
+ getCamundaRestClient(config = {}) {
109
+ if (!this.camundaRestClient) {
110
+ this.camundaRestClient = new CamundaRestClient_1.CamundaRestClient({
111
+ config: { ...this.configuration, ...config },
112
+ oAuthProvider: this.oAuthProvider,
113
+ });
114
+ }
115
+ return this.camundaRestClient;
116
+ }
99
117
  }
100
118
  exports.Camunda8 = Camunda8;
101
119
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/c8/index.ts"],"names":[],"mappings":";;;AAAA,oCAAyC;AACzC,gCAKe;AACf,wCAA6C;AAE7C,wCAA6C;AAC7C,0CAA+C;AAC/C,0CAA+C;AAC/C,oCAA2D;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,QAAQ;IAWpB,YAAY,SAAqD,EAAE;QAClE,IAAI,CAAC,aAAa;YACjB,oCAA8B,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAA;QAClE,IAAI,CAAC,aAAa,GAAG,IAAA,4BAAsB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAChE,CAAC;IAEM,mBAAmB;QACzB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAgB,CAAC;gBAC5C,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC7B,CAAC;IAEM,iBAAiB;QACvB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,sBAAc,CAAC;gBACxC,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAA;IAC3B,CAAC;IAEM,mBAAmB;QACzB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAgB,CAAC;gBAC5C,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B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AO,IAAI,CAAC,kBAAkB,CAAA;IAC/B,CAAC;IAED;;OAEG;IACI,kBAAkB,CACxB,SAAsC,EAAE;QAExC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,uBAAe,CAAC;gBAC1C,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,EAAE;gBAC5C,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAA;IAC5B,CAAC;IAEM,oBAAoB,CAC1B,SAAsC,EAAE;QAExC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC7B,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAAiB,CAAC;gBAC9C,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,EAAE;gBAC5C,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC9B,CAAC;CACD;AAzHD,4BAyHC"}
@@ -0,0 +1,282 @@
1
+ import { LosslessNumber } from 'lossless-json';
2
+ import { LosslessDto } from '../../lib';
3
+ import { ICustomHeaders, IInputVariables, JSONDoc } from '../../zeebe/types';
4
+ export declare class RestApiJob<Variables = LosslessDto, CustomHeaders = LosslessDto> extends LosslessDto {
5
+ jobKey: string;
6
+ type: string;
7
+ processInstanceKey: string;
8
+ processDefinitionId: string;
9
+ processDefinitionVersion: number;
10
+ processDefinitionKey: string;
11
+ elementId: string;
12
+ elementInstanceKey: string;
13
+ customHeaders: CustomHeaders;
14
+ worker: string;
15
+ retries: number;
16
+ deadline: string;
17
+ variables: Variables;
18
+ tenantId: string;
19
+ }
20
+ /**
21
+ * JSON object with changed task attribute values.
22
+ */
23
+ export interface TaskChangeSet {
24
+ dueDate?: Date | string;
25
+ followUpDate?: Date | string;
26
+ candidateUsers?: string[];
27
+ candidateGroups?: string[];
28
+ }
29
+ /** JSON object with changed job attribute values. */
30
+ export interface JobUpdateChangeset {
31
+ retries?: number;
32
+ /** The duration of the new timeout in ms, starting from the current moment. */
33
+ timeout?: number;
34
+ }
35
+ export interface NewUserInfo {
36
+ password: string;
37
+ id: number;
38
+ username: string;
39
+ name: string;
40
+ email: string;
41
+ enabled: boolean;
42
+ }
43
+ export type Ctor<T> = new (obj: any) => T;
44
+ export declare class ProcessDeployment extends LosslessDto {
45
+ processDefinitionId: string;
46
+ processDefinitionVersion: number;
47
+ processDefinitionKey: string;
48
+ resourceName: string;
49
+ tenantId: string;
50
+ }
51
+ export declare class DecisionDeployment extends LosslessDto {
52
+ dmnDecisionId: string;
53
+ version: number;
54
+ decisionKey: string;
55
+ dmnDecisionName: string;
56
+ tenantId: string;
57
+ dmnDecisionRequirementsId: string;
58
+ dmnDecisionRequirementsKey: string;
59
+ }
60
+ export declare class DecisionRequirementsDeployment extends LosslessDto {
61
+ dmnDecisionRequirementsId: string;
62
+ version: number;
63
+ dmnDecisionRequirementsName: string;
64
+ tenantId: string;
65
+ dmnDecisionRequirementsKey: string;
66
+ resourceName: string;
67
+ }
68
+ export declare class FormDeployment {
69
+ formId: string;
70
+ version: number;
71
+ formKey: string;
72
+ resourceName: string;
73
+ tenantId: string;
74
+ }
75
+ export declare class DeployResourceResponseDto extends LosslessDto {
76
+ deploymentKey: string;
77
+ deployments: ({
78
+ processDefinition: ProcessDeployment;
79
+ } | {
80
+ decisionDefinition: DecisionDeployment;
81
+ } | {
82
+ decisionRequirements: DecisionRequirementsDeployment;
83
+ } | {
84
+ form: FormDeployment;
85
+ })[];
86
+ tenantId: string;
87
+ }
88
+ export declare class DeployResourceResponse extends DeployResourceResponseDto {
89
+ processes: ProcessDeployment[];
90
+ decisions: DecisionDeployment[];
91
+ decisionRequirements: DecisionRequirementsDeployment[];
92
+ forms: FormDeployment[];
93
+ }
94
+ export declare class CreateProcessInstanceResponse<T = Record<string, never>> {
95
+ /**
96
+ * The unique key identifying the process definition (e.g. returned from a process
97
+ * in the DeployResourceResponse message)
98
+ */
99
+ readonly processDefinitionKey: string;
100
+ /**
101
+ * The BPMN process ID of the process definition
102
+ */
103
+ readonly processDefinitionId: string;
104
+ /**
105
+ * The version of the process; set to -1 to use the latest version
106
+ */
107
+ readonly version: number;
108
+ readonly processInstanceKey: string;
109
+ /**
110
+ * the tenant identifier of the created process instance
111
+ */
112
+ readonly tenantId: string;
113
+ /**
114
+ * If `awaitCompletion` is true, this will be populated with the output variables. Otherwise, it will be an empty object.
115
+ */
116
+ readonly variables: T;
117
+ }
118
+ export interface MigrationMappingInstruction {
119
+ /** The element ID to migrate from. */
120
+ sourceElementId: string;
121
+ /** The element ID to migrate into. */
122
+ targetElementId: string;
123
+ }
124
+ /** Migrates a process instance to a new process definition.
125
+ * This request can contain multiple mapping instructions to define mapping between the active process instance's elements and target process definition elements.
126
+ */
127
+ export interface MigrationRequest {
128
+ processInstanceKey: string;
129
+ /** The key of process definition to migrate the process instance to. */
130
+ targetProcessDefinitionKey: string;
131
+ mappingInstructions: MigrationMappingInstruction[];
132
+ /** A reference key chosen by the user that will be part of all records resulting from this operation. Must be > 0 if provided. */
133
+ operationReference?: number | LosslessNumber;
134
+ }
135
+ /** The signal was broadcast. */
136
+ export declare class BroadcastSignalResponse extends LosslessDto {
137
+ /** The unique ID of the signal that was broadcast. */
138
+ signalKey: string;
139
+ /** The tenant ID of the signal that was broadcast. */
140
+ tenantId: string;
141
+ }
142
+ export interface UpdateElementVariableRequest {
143
+ /**
144
+ * The key of the element instance to update the variables for.
145
+ * This can be the process instance key (as obtained during instance creation), or a given element,
146
+ * such as a service task (see the elementInstanceKey on the job message). */
147
+ elementInstanceKey: string;
148
+ variables: JSONDoc | LosslessDto;
149
+ /**
150
+ * Defaults to false.
151
+ * If set to true, the variables are merged strictly into the local scope (as specified by the elementInstanceKey). Otherwise, the variables are propagated to upper scopes and set at the outermost one.
152
+ * Let’s consider the following example:
153
+ * There are two scopes '1' and '2'. Scope '1' is the parent scope of '2'. The effective variables of the scopes are: 1 => { "foo" : 2 } 2 => { "bar" : 1 }
154
+ * An update request with elementInstanceKey as '2', variables { "foo" : 5 }, and local set to true leaves scope '1' unchanged and adjusts scope '2' to { "bar" : 1, "foo" 5 }.
155
+ * By default, with local set to false, scope '1' will be { "foo": 5 } and scope '2' will be { "bar" : 1 }.
156
+ */
157
+ local?: boolean;
158
+ /**
159
+ * A reference key chosen by the user that will be part of all records resulting from this operation.
160
+ * Must be > 0 if provided.
161
+ */
162
+ operationReference?: number;
163
+ }
164
+ export declare class CorrelateMessageResponse extends LosslessDto {
165
+ /** the unique ID of the message that was published */
166
+ key: string;
167
+ /** the tenantId of the message */
168
+ tenantId: string;
169
+ /** The key of the first process instance the message correlated with */
170
+ processInstanceKey: string;
171
+ }
172
+ export declare class PublishMessageResponse extends LosslessDto {
173
+ /** the unique ID of the message that was published */
174
+ key: string;
175
+ /** the tenantId of the message */
176
+ tenantId: string;
177
+ }
178
+ export interface CreateProcessBaseRequest<V extends JSONDoc | LosslessDto> {
179
+ /**
180
+ * the version of the process; if not specified it will use the latest version
181
+ */
182
+ version?: number;
183
+ /**
184
+ * JSON document that will instantiate the variables for the root variable scope of the
185
+ * process instance.
186
+ */
187
+ variables: V;
188
+ /** The tenantId for a multi-tenant enabled cluster. */
189
+ tenantId?: string;
190
+ /** a reference key chosen by the user and will be part of all records resulted from this operation */
191
+ operationReference?: number | LosslessNumber;
192
+ /**
193
+ * List of start instructions. If empty (default) the process instance
194
+ * will start at the start event. If non-empty the process instance will apply start
195
+ * instructions after it has been created
196
+ */
197
+ startInstructions?: ProcessInstanceCreationStartInstruction[];
198
+ /**
199
+ * Wait for the process instance to complete. If the process instance completion does not occur within the requestTimeout, the request will be closed. Defaults to false.
200
+ */
201
+ /**
202
+ * Timeout (in ms) the request waits for the process to complete. By default or when set to 0, the generic request timeout configured in the cluster is applied.
203
+ */
204
+ requestTimeout?: number;
205
+ }
206
+ export interface ProcessInstanceCreationStartInstruction {
207
+ /**
208
+ * future extensions might include
209
+ * - different types of start instructions
210
+ * - ability to set local variables for different flow scopes
211
+ * for now, however, the start instruction is implicitly a
212
+ * "startBeforeElement" instruction
213
+ */
214
+ elementId: string;
215
+ }
216
+ export interface CreateProcessInstanceFromProcessDefinitionId<V extends JSONDoc | LosslessDto> extends CreateProcessBaseRequest<V> {
217
+ /**
218
+ * the BPMN process ID of the process definition
219
+ */
220
+ processDefinitionId: string;
221
+ }
222
+ export interface CreateProcessInstanceFromProcessDefinition<V extends JSONDoc | LosslessDto> extends CreateProcessBaseRequest<V> {
223
+ /**
224
+ * the key of the process definition
225
+ */
226
+ processDefinitionKey: string;
227
+ }
228
+ export type CreateProcessInstanceReq<T extends JSONDoc | LosslessDto> = CreateProcessInstanceFromProcessDefinitionId<T> | CreateProcessInstanceFromProcessDefinition<T>;
229
+ export interface PatchAuthorizationRequest {
230
+ /** The key of the owner of the authorization. */
231
+ ownerKey: string;
232
+ /** Indicates if permissions should be added or removed. */
233
+ action: 'ADD' | 'REMOVE';
234
+ /** The type of resource to add/remove perissions to/from. */
235
+ resourceType: 'AUTHORIZATION' | 'MESSAGE' | 'JOB' | 'APPLICATION' | 'TENANT' | 'DEPLOYMENT' | 'PROCESS_DEFINITION' | 'USER_TASK' | 'DECISION_REQUIREMENTS_DEFINITION' | 'DECISION_DEFINITION' | 'USER_GROUP' | 'USER' | 'ROLE';
236
+ /** The permissions to add/remove. */
237
+ permissions: {
238
+ /** Specifies the type of permissions. */
239
+ permissionType: 'CREATE' | 'READ' | 'UPDATE' | 'DELETE';
240
+ /** A list of resource IDs the permission relates to. */
241
+ resourceIds: [];
242
+ }[];
243
+ }
244
+ export interface RestJob<Variables = IInputVariables, CustomHeaderShape = ICustomHeaders> {
245
+ /** The key, a unique identifier for the job */
246
+ readonly jobKey: string;
247
+ /**
248
+ * The job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
249
+ * type="payment-service" />)
250
+ */
251
+ readonly type: string;
252
+ /** The job's process instance key */
253
+ readonly processInstanceKey: string;
254
+ /** The bpmn process ID of the job process definition */
255
+ readonly bpmnProcessId: string;
256
+ /** The version of the job process definition */
257
+ readonly processDefinitionVersion: number;
258
+ /** The associated task element ID */
259
+ readonly elementId: string;
260
+ /**
261
+ * The unique key identifying the associated task, unique within the scope of the
262
+ * process instance
263
+ */
264
+ readonly elementInstanceKey: string;
265
+ /**
266
+ * A set of custom headers defined during modelling
267
+ */
268
+ readonly customHeaders: Readonly<CustomHeaderShape>;
269
+ /** The name of the worker that activated this job */
270
+ readonly worker: string;
271
+ readonly retries: number;
272
+ /** Epoch milliseconds */
273
+ readonly deadline: string;
274
+ /**
275
+ * All visible variables in the task scope, computed at activation time.
276
+ */
277
+ readonly variables: Readonly<Variables>;
278
+ /**
279
+ * The `tenantId` of the job in a multi-tenant cluster
280
+ */
281
+ readonly tenantId: string;
282
+ }