@camunda8/sdk 8.4.0 → 8.4.1

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 (220) hide show
  1. package/.eslintrc.json +34 -0
  2. package/CHANGELOG.md +61 -21
  3. package/CODE_OF_CONDUCT.md +73 -0
  4. package/CONTRIBUTING.md +116 -0
  5. package/LICENSE +3 -3
  6. package/README.md +229 -33
  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 +95 -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 +120 -30
  204. package/release.config.js +49 -0
  205. package/renovate.json +9 -0
  206. package/smoke-test/package-lock.json +29 -0
  207. package/smoke-test/package.json +15 -0
  208. package/smoke-test/smoke-test.js +45 -0
  209. package/test-d/index.test-d.ts +31 -0
  210. package/.github/workflows/build-docs.yml +0 -39
  211. package/.github/workflows/tag-and-publish.yml +0 -48
  212. package/.prettierignore +0 -2
  213. package/img/video.png +0 -0
  214. package/jest.config.js +0 -5
  215. package/src/__tests__/exports.spec.ts +0 -7
  216. package/src/index.ts +0 -17
  217. package/tsconfig.build.json +0 -8
  218. package/tsconfig.json +0 -10
  219. package/tsconfig.tsbuildinfo +0 -1
  220. package/typedoc.json +0 -10
package/.eslintrc.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "parser": "@typescript-eslint/parser",
3
+ "plugins": ["@typescript-eslint", "import", "prettier"],
4
+ "extends": [
5
+ "eslint:recommended",
6
+ "plugin:@typescript-eslint/recommended",
7
+ "prettier",
8
+ "plugin:prettier/recommended"
9
+ ],
10
+ "ignorePatterns": ["dist/"],
11
+ "rules": {
12
+ // Define your rules, for example:
13
+ "semi": "off",
14
+ "import/order": [
15
+ "error",
16
+ {
17
+ "groups": [
18
+ "builtin",
19
+ "external",
20
+ "internal",
21
+ "parent",
22
+ "sibling",
23
+ "index"
24
+ ],
25
+ "newlines-between": "always"
26
+ }
27
+ ],
28
+ "import/newline-after-import": "error",
29
+ "prettier/prettier": "error"
30
+ },
31
+ "env": {
32
+ "node": true
33
+ }
34
+ }
package/CHANGELOG.md CHANGED
@@ -1,40 +1,80 @@
1
- # Change Log
1
+ ## [8.4.1](https://github.com/camunda/camunda-8-js-sdk/compare/v8.4.0...v8.4.1) (2024-04-08)
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
3
 
6
- # 8.4.0 (2024-02-01)
4
+ ### Features
5
+
6
+ * **oauth:** support optional scope in OAuth request ([#25](https://github.com/camunda/camunda-8-js-sdk/issues/25)) ([0451b80](https://github.com/camunda/camunda-8-js-sdk/commit/0451b802594f76518830b9bdff515d67fc0231b9))
7
+ * **operate:** add multitenant support and lossless Json parsing ([#82](https://github.com/camunda/camunda-8-js-sdk/issues/82)) ([cf49a71](https://github.com/camunda/camunda-8-js-sdk/commit/cf49a717e2632af845529b3c1fde85ee1b0b347b)), closes [#78](https://github.com/camunda/camunda-8-js-sdk/issues/78) [#67](https://github.com/camunda/camunda-8-js-sdk/issues/67)
8
+ * **repo:** add enhanced debug output for http errors ([#88](https://github.com/camunda/camunda-8-js-sdk/issues/88)) ([881b039](https://github.com/camunda/camunda-8-js-sdk/commit/881b03965cc37431885a76291f7c0aa762f26227)), closes [#87](https://github.com/camunda/camunda-8-js-sdk/issues/87)
9
+ * **tasklist:** add multitenant support to tasklist ([#85](https://github.com/camunda/camunda-8-js-sdk/issues/85)) ([46bb564](https://github.com/camunda/camunda-8-js-sdk/commit/46bb564365afc3bc6758cd436490a459708128e6))
10
+ * **zeebe:** add MigrateProcessInstance ([#97](https://github.com/camunda/camunda-8-js-sdk/issues/97)) ([2a9a123](https://github.com/camunda/camunda-8-js-sdk/commit/2a9a1232b160962f86b9450edd9047a8a933068a)), closes [#49](https://github.com/camunda/camunda-8-js-sdk/issues/49)
11
+ * **zeebe:** implement deleteResource ([#73](https://github.com/camunda/camunda-8-js-sdk/issues/73)) ([0cd08b7](https://github.com/camunda/camunda-8-js-sdk/commit/0cd08b7b85d23ab44e42b36b2d9b48c1cfcb8c63))
12
+ * **zeebe:** implement lossless parsing of job payload ([#95](https://github.com/camunda/camunda-8-js-sdk/issues/95)) ([57f3ea8](https://github.com/camunda/camunda-8-js-sdk/commit/57f3ea85d4cf86256301f5f2a9bcead09c01a199)), closes [#81](https://github.com/camunda/camunda-8-js-sdk/issues/81)
13
+ * **zeebe:** normalise useragent, thread config ([#94](https://github.com/camunda/camunda-8-js-sdk/issues/94)) ([c1c4211](https://github.com/camunda/camunda-8-js-sdk/commit/c1c4211db11173c56d2410f489503ef9acf185f2))
14
+ * **zeebe:** remove deployProcess method ([#71](https://github.com/camunda/camunda-8-js-sdk/issues/71)) ([6cb98f0](https://github.com/camunda/camunda-8-js-sdk/commit/6cb98f0ff3baf643015bacfa690f4f119caf6083))
15
+
16
+ # [8.5.0-alpha.6](https://github.com/camunda/camunda-8-js-sdk/compare/v8.5.0-alpha.5...v8.5.0-alpha.6) (2024-04-08)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **issue118:** add smoke test and type surface tests ([fe0c709](https://github.com/camunda/camunda-8-js-sdk/commit/fe0c70925cf3df610b049e776eed5bffe56ef604)), closes [#118](https://github.com/camunda/camunda-8-js-sdk/issues/118)
22
+
23
+ # [8.5.0-alpha.5](https://github.com/camunda/camunda-8-js-sdk/compare/v8.5.0-alpha.4...v8.5.0-alpha.5) (2024-04-07)
24
+
25
+
26
+ ### Bug Fixes
7
27
 
8
- **Note:** Version bump only for package @camunda8/sdk
28
+ * **repo:** make fix type commits release a new package ([ded83cf](https://github.com/camunda/camunda-8-js-sdk/commit/ded83cfaf437a2f62a5ef134d7616538facda614))
9
29
 
10
- # CHANGELOG
30
+ # [8.5.0-alpha.4](https://github.com/camunda/camunda-8-js-sdk/compare/v8.5.0-alpha.3...v8.5.0-alpha.4) (2024-04-05)
11
31
 
12
- ## Version 0.15.1
13
32
 
14
- ## Fixes
33
+ ### Bug Fixes
15
34
 
16
- _Things that were broken and are now fixed._
35
+ * **repo:** use ts-patch to transform module mapping in output ([#112](https://github.com/camunda/camunda-8-js-sdk/issues/112)) ([7efdcf3](https://github.com/camunda/camunda-8-js-sdk/commit/7efdcf3478a0d68b4f1cbc62c1526ba7275008b0)), closes [#110](https://github.com/camunda/camunda-8-js-sdk/issues/110)
17
36
 
18
- - Update dependency `camunda-saas-oauth` to 1.2.4 to fix an issue with token expiration. Cached tokens were not correctly expired, leading to a 401 Unauthorized response to API calls after some time. The tokens are now correctly evicted from the cache. Thanks to [@hanh-le-clv](https://github.com/hanh-le-clv) for reporting this. See [this issue](https://github.com/camunda-community-hub/camunda-8-sdk-node-js/issues/7) for more details.
37
+ # [8.5.0-alpha.3](https://github.com/camunda/camunda-8-js-sdk/compare/v8.5.0-alpha.2...v8.5.0-alpha.3) (2024-04-05)
19
38
 
20
- ## Version 0.15.0
21
39
 
22
- - Update Operate client to 1.2.3, safely parsing variables when retrieving all variables for a process.
40
+ ### Bug Fixes
23
41
 
24
- ## Version 0.14.0
42
+ * **repo:** only git commit on npm publish success ([9012764](https://github.com/camunda/camunda-8-js-sdk/commit/901276451845c5dbd926af0a6563d5564d3e87b9))
25
43
 
26
- ### Enhancements
44
+ # [8.5.0-alpha.2](https://github.com/camunda/camunda-8-js-sdk/compare/v8.5.0-alpha.1...v8.5.0-alpha.2) (2024-04-05)
27
45
 
28
- - Update Tasklist client to 0.9.5, safely parsing variables when retrieving a Task.
29
46
 
30
- ## Version 0.13.0
47
+ ### Bug Fixes
31
48
 
32
- ### Enhancements
49
+ * **repo:** add note on "supported" ([#107](https://github.com/camunda/camunda-8-js-sdk/issues/107)) ([fc45d61](https://github.com/camunda/camunda-8-js-sdk/commit/fc45d618bc459a06fbf76bd6907511d08e1f583b)), closes [#70](https://github.com/camunda/camunda-8-js-sdk/issues/70)
50
+
51
+ # [8.5.0-alpha.1](https://github.com/camunda/camunda-8-js-sdk/compare/v8.4.0...v8.5.0-alpha.1) (2024-04-04)
52
+
53
+
54
+ ### Features
55
+
56
+ * **oauth:** support optional scope in OAuth request ([#25](https://github.com/camunda/camunda-8-js-sdk/issues/25)) ([0451b80](https://github.com/camunda/camunda-8-js-sdk/commit/0451b802594f76518830b9bdff515d67fc0231b9))
57
+ * **operate:** add multitenant support and lossless Json parsing ([#82](https://github.com/camunda/camunda-8-js-sdk/issues/82)) ([cf49a71](https://github.com/camunda/camunda-8-js-sdk/commit/cf49a717e2632af845529b3c1fde85ee1b0b347b)), closes [#78](https://github.com/camunda/camunda-8-js-sdk/issues/78) [#67](https://github.com/camunda/camunda-8-js-sdk/issues/67)
58
+ * **repo:** add enhanced debug output for http errors ([#88](https://github.com/camunda/camunda-8-js-sdk/issues/88)) ([881b039](https://github.com/camunda/camunda-8-js-sdk/commit/881b03965cc37431885a76291f7c0aa762f26227)), closes [#87](https://github.com/camunda/camunda-8-js-sdk/issues/87)
59
+ * **tasklist:** add multitenant support to tasklist ([#85](https://github.com/camunda/camunda-8-js-sdk/issues/85)) ([46bb564](https://github.com/camunda/camunda-8-js-sdk/commit/46bb564365afc3bc6758cd436490a459708128e6))
60
+ * **zeebe:** add MigrateProcessInstance ([#97](https://github.com/camunda/camunda-8-js-sdk/issues/97)) ([2a9a123](https://github.com/camunda/camunda-8-js-sdk/commit/2a9a1232b160962f86b9450edd9047a8a933068a)), closes [#49](https://github.com/camunda/camunda-8-js-sdk/issues/49)
61
+ * **zeebe:** implement deleteResource ([#73](https://github.com/camunda/camunda-8-js-sdk/issues/73)) ([0cd08b7](https://github.com/camunda/camunda-8-js-sdk/commit/0cd08b7b85d23ab44e42b36b2d9b48c1cfcb8c63))
62
+ * **zeebe:** implement lossless parsing of job payload ([#95](https://github.com/camunda/camunda-8-js-sdk/issues/95)) ([57f3ea8](https://github.com/camunda/camunda-8-js-sdk/commit/57f3ea85d4cf86256301f5f2a9bcead09c01a199)), closes [#81](https://github.com/camunda/camunda-8-js-sdk/issues/81)
63
+ * **zeebe:** normalise useragent, thread config ([#94](https://github.com/camunda/camunda-8-js-sdk/issues/94)) ([c1c4211](https://github.com/camunda/camunda-8-js-sdk/commit/c1c4211db11173c56d2410f489503ef9acf185f2))
64
+ * **zeebe:** remove deployProcess method ([#71](https://github.com/camunda/camunda-8-js-sdk/issues/71)) ([6cb98f0](https://github.com/camunda/camunda-8-js-sdk/commit/6cb98f0ff3baf643015bacfa690f4f119caf6083))
65
+
66
+ # Change Log
67
+
68
+ All notable changes to this project will be documented in this file.
69
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
70
+
71
+ # 8.4.0 (2024-02-01)
33
72
 
34
- - Update Operate API client to 1.2.2.
73
+ ### Bug Fixes
35
74
 
36
- ## Version 0.11.0
75
+ - REST getForm returns a flattened shape of the form compared to GraphQL ([58ec6d1](https://github.com/camunda/camunda-8-js-sdk/commit/58ec6d1de08e39cb4699326b67ebbf6a398fb30f))
37
76
 
38
- ### Enhancements
77
+ ### Features
39
78
 
40
- - Update Operate API client to 1.2.0, enabling multiple clusters per application via custom OAuth injection.
79
+ - configure specs to import configuration from .env file ([00804d1](https://github.com/camunda/camunda-8-js-sdk/commit/00804d132c0e1840846a5af9eee26351f9580c74))
80
+ - **tasklist:** enable multiple clusters via constructor options ([#16](https://github.com/camunda/camunda-8-js-sdk/issues/16)) ([fb12e25](https://github.com/camunda/camunda-8-js-sdk/commit/fb12e258321e6bba03d11d38119c740f0e242773))
@@ -0,0 +1,73 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at code-of-conduct@zeebe.io. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,116 @@
1
+ # Contributing to @camunda8/sdk
2
+
3
+ Thank you for considering contributing to @camunda8/sdk! We welcome contributions from the community to make our package even better.
4
+
5
+ ## Getting Started
6
+
7
+ To get started with contributing, please follow these steps:
8
+
9
+ 1. Fork the repository and clone it to your local machine.
10
+ 2. Check out the `alpha` branch. This is the development branch.
11
+ 3. Install the dependencies by running `npm install`.
12
+ 4. Make your changes or additions to the codebase.
13
+ 5. Write tests to cover your changes and ensure existing tests pass.
14
+ 6. Run the tests using `npm test` to make sure everything is working correctly. See below for details on running integration tests.
15
+ 7. Commit your changes and push them to your forked repository. Use [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) format for the commit message. See the note below.
16
+ 8. Submit a pull request to the main repository.
17
+ 9. When your PR is merged into the `alpha` branch, an alpha package is published to NPM.
18
+ 10. When the `alpha` branch is merged into `main`, a new package is published to NPM.
19
+
20
+ ## A note on commit messages
21
+
22
+ The repository uses []`semantic-release`](https://github.com/semantic-release/semantic-release) to create releases. Because we track the Camunda 8 Platform minor version, we treat feature implementation during a minor release cycle as a patch release rather than a minor release.
23
+
24
+ Creating a commit with a `feat` commit message will cause the package version patch release number to increment. To update the minor version, a commit with the type `minor` is needed.
25
+
26
+ ## Running tests
27
+
28
+ Run all the unit tests with `npm run test`.
29
+
30
+ ### Integration tests
31
+
32
+ Integration tests can be run against Self-Managed or against Camunda SaaS.
33
+
34
+ To run integration tests against Camunda SaaS, but credentials for a Camunda SaaS API Client with scopes for all components in the environment, then run the integration tests against Camunda SaaS with `npm run test:integration`.
35
+
36
+ To run the integration tests against Self-Managed, you can use either your own Self-Managed instance, or start one locally using Docker.
37
+
38
+ To start one locally, run `docker compose -f docker-compose-modeler.yaml -f docker-compose-multitenancy.yml up -d`.
39
+
40
+ Put the following credentials in the environment:
41
+
42
+ ```bash
43
+ # Self-Managed
44
+ export ZEEBE_SECURE_CONNECTION=false
45
+ export ZEEBE_ADDRESS='localhost:26500'
46
+ export ZEEBE_CLIENT_ID='zeebe'
47
+ export ZEEBE_CLIENT_SECRET='zecret'
48
+ export ZEEBE_AUTHORIZATION_SERVER_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
49
+ export ZEEBE_TOKEN_AUDIENCE='zeebe.camunda.io'
50
+ export CAMUNDA_CREDENTIALS_SCOPES='Zeebe,Tasklist,Operate,Optimize'
51
+ export CAMUNDA_OAUTH_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
52
+ export CAMUNDA_TASKLIST_BASE_URL='http://localhost:8082'
53
+ export CAMUNDA_OPERATE_BASE_URL='http://localhost:8081'
54
+ export CAMUNDA_OPTIMIZE_BASE_URL='http://localhost:8083'
55
+ export CAMUNDA_MODELER_BASE_URL='http://localhost:8086'
56
+ export CAMUNDA_MODELER_OAUTH_AUDIENCE='_omit_'
57
+ export CAMUNDA_TENANT_ID=''
58
+
59
+ export CAMUNDA_TEST_TYPE='local'
60
+
61
+ # Modeler API Client
62
+ export CAMUNDA_CONSOLE_CLIENT_ID='zeebe'
63
+ export CAMUNDA_CONSOLE_CLIENT_SECRET='zecret'
64
+ # export CAMUNDA_CONSOLE_BASE_URL='https://api.cloud.camunda.io'
65
+ # export CAMUNDA_CONSOLE_OAUTH_AUDIENCE='api.cloud.camunda.io'
66
+ ```
67
+
68
+ Now run the integration tests against Self-Managed with `npm run test:local-integration`.
69
+
70
+ ### Multi-tenancy tests
71
+
72
+ To run the multi-tenancy tests, use the following environment variables:
73
+
74
+ ```bash
75
+ # Self-Managed
76
+ export ZEEBE_SECURE_CONNECTION=false
77
+ export ZEEBE_ADDRESS='localhost:26500'
78
+ export ZEEBE_CLIENT_ID='zeebe'
79
+ export ZEEBE_CLIENT_SECRET='zecret'
80
+ export ZEEBE_AUTHORIZATION_SERVER_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
81
+ export ZEEBE_TOKEN_AUDIENCE='zeebe.camunda.io'
82
+ export CAMUNDA_CREDENTIALS_SCOPES='Zeebe,Tasklist,Operate,Optimize'
83
+ export CAMUNDA_OAUTH_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
84
+ export CAMUNDA_TASKLIST_BASE_URL='http://localhost:8082'
85
+ export CAMUNDA_OPERATE_BASE_URL='http://localhost:8081'
86
+ export CAMUNDA_OPTIMIZE_BASE_URL='http://localhost:8083'
87
+ export CAMUNDA_TEST_TYPE='local'
88
+ export CAMUNDA_TENANT_ID='<default>'
89
+ ```
90
+
91
+ Now run the integration tests against Self-Managed with `npm run test:multitenancy`.
92
+
93
+ ## Code Style
94
+
95
+ We follow a specific code style in our project to maintain consistency. Please make sure to adhere to the following guidelines:
96
+
97
+ - Run `npm run lint` to lint your code with ESLint.
98
+ - Run `npm run format` to format your code to the project standard.
99
+
100
+ ## Issue Reporting
101
+
102
+ If you encounter any bugs or issues while using @camunda/sdk, please report them in the [issue tracker](https://github.com/camunda/camunda-8-js-sdk/issues). Provide as much detail as possible, including steps to reproduce the issue.
103
+
104
+ ## Feature Requests
105
+
106
+ If you have any ideas or feature requests for @camunda/sdk, please submit them in the [issue tracker](https://github.com/camunda/camunda-8-js-sdk/issues). We appreciate your feedback and suggestions.
107
+
108
+ ## License
109
+
110
+ By contributing to @camunda/sdk, you agree that your contributions will be licensed under the [Apache License](https://opensource.org/licenses/Apache).
111
+
112
+ ## Contact
113
+
114
+ If you have any questions or need further assistance, open an issue in the repository.
115
+
116
+ Happy contributing!
package/LICENSE CHANGED
@@ -178,7 +178,7 @@
178
178
  APPENDIX: How to apply the Apache License to your work.
179
179
 
180
180
  To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
182
  replaced with your own identifying information. (Don't include
183
183
  the brackets!) The text should be enclosed in the appropriate
184
184
  comment syntax for the file format. We also recommend that a
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright {yyyy} {name of copyright owner}
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -198,4 +198,4 @@
198
198
  distributed under the License is distributed on an "AS IS" BASIS,
199
199
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  See the License for the specific language governing permissions and
201
- limitations under the License.
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,55 +1,251 @@
1
- # Camunda 8 Unified SDK for Node.js
1
+ # Camunda 8 JavaScript SDK
2
2
 
3
- [![NPM](https://nodei.co/npm/camunda-8-sdk.png)](https://npmjs.org/package/camunda-8-sdk)
3
+ [![NPM](https://nodei.co/npm/@camunda8/sdk.png)](https://www.npmjs.com/package/@camunda8/sdk)
4
4
 
5
- This SDK provides a high-level Node.js API for Camunda Platform 8. It is a wrapper around the following individual clients:
5
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
6
 
7
- - [Web Console](https://github.com/camunda-community-hub/console-client-node-js)
8
- - [Optimize API Client](https://github.com/camunda-community-hub/optimize-client-node-js)
9
- - [Operate API Client](https://github.com/camunda-community-hub/operate-client-node-js)
10
- - [Tasklist API Client](https://github.com/camunda-community-hub/tasklist-client-node-js)
11
- - [Zeebe API Client](https://github.com/camunda-community-hub/zeebe-client-node-js)
12
- - [Web Modeler API Client](https://github.com/camunda-community-hub/modeler-client-node-js)
7
+ This is the official Camunda 8 JavaScript SDK. It is written in TypeScript and runs on Node.js. See why [this does not run in a web browser](https://github.com/camunda/camunda-8-js-sdk/issues/79).
13
8
 
14
- It uses the following libraries to hydrate credentials from the environment:
9
+ ## What does "supported" mean?
15
10
 
16
- - [Camunda 8 Credentials from Environment](https://github.com/camunda-community-hub/camunda-8-credentials-from-env)
17
- - [Camunda SaaS OAuth](https://github.com/camunda-community-hub/camunda-saas-oauth-nodejs)
11
+ This is the official supported-by-Camunda Nodejs SDK for Camunda Platform 8.
18
12
 
19
- The full API documentation is hosted [here](https://camunda-community-hub.github.io/camunda-8-sdk-node-js/).
13
+ The Node.js SDK will not always support all features of Camunda Platform 8 immediately upon their release. Complete API coverage for a platform release will lag behind the platform release.
20
14
 
21
- Watch a seven-minute speedrun demo video here:
15
+ Prioritisation of implementing features is influenced by customer demand.
22
16
 
23
- [![](./img/video.png)](https://www.youtube.com/watch?v=A-P6upPCQWA)
17
+ ## Semantic versioning
24
18
 
25
- ## API Coverage
19
+ The SDK package tracks Camunda Platform 8 minor versioning. Feature releases to support current Platform minor version features result in a patch release of the SDK.
26
20
 
27
- | Component | Tested Environment |
28
- |---|---|
29
- | Zeebe | SaaS, Self-hosted |
30
- | Operate | SaaS |
31
- | Optimize | SaaS |
32
- | Tasklist | SaaS |
33
- | Console | SaaS |
21
+ ## Using the SDK in your project
34
22
 
35
- ## Installation
23
+ Install the SDK as a dependency:
36
24
 
37
25
  ```bash
38
- npm i camunda-8-sdk
26
+ npm i @camunda8/sdk
39
27
  ```
40
28
 
41
29
  ## Usage
42
30
 
43
- Set your Camunda SaaS credentials in the environment (at the moment, only Camunda SaaS is fully supported).
31
+ In this release, the functionality of Camunda 8 is exposed via dedicated clients for the component APIs.
44
32
 
45
33
  ```typescript
46
- import { C8 } from 'camunda-8-sdk'
34
+ import { Camunda8 } from '@camunda8/sdk'
35
+
36
+ const c8 = new Camunda8()
37
+ const zeebe = c8.getZeebeGrpcClient()
38
+ const operate = c8.getOperateApiClient()
39
+ const optimize = c8.getOptimizeApiClient()
40
+ const tasklist = c8.getTasklistApiClient()
41
+ const modeler = c8.getModelerApiClient()
42
+ const admin = c8.getAdminApiClient()
43
+ ```
44
+
45
+ ## Configuration
46
+
47
+ The configuration for the SDK can be done by any combination of environment variables and explicit configuration passed to the `Camunda8` constructor.
48
+
49
+ Any configuration passed in to the `Camunda8` constructor is merged over any configuration in the environment.
50
+
51
+ The configuration object fields and the environment variables have exactly the same names. See the file `src/lib/Configuration.ts` for a complete configuration outline.
52
+
53
+ ## A note on how int64 is handled in the JavaScript SDK
54
+
55
+ Entity keys in Camunda 8 are stored and represented as `int64` numbers. The range of `int64` extends to numbers that cannot be represented by the JavaScript `number` type. To deal with this, `int64` keys are serialised by the SDK to the JavaScript `string` type. See [this issue](https://github.com/camunda/camunda-8-js-sdk/issues/78) for more details.
56
+
57
+ 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`.
58
+
59
+ 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.
60
+
61
+ ## OAuth
47
62
 
48
- const zbc = new C8.ZBClient()
49
- const console = new C8.ConsoleApiClient()
50
- const operate = new C8.OperateApiClient()
51
- const optimize = new C8.OptimizeApiClient()
52
- const tasklist = new C8.TasklistApiClient()
63
+ Calls to APIs are authorized using a token that is obtained via a client id/secret pair exchange, and then passes as an authorization header on API calls. The SDK handles this for you.
64
+
65
+ If your Camunda 8 platform is secured using token exchange, provide the client id and secret to the SDK.
66
+
67
+ ### Disable OAuth
68
+
69
+ To disable OAuth, set the environment variable `CAMUNDA_OAUTH_DISABLED`. You can use this when running against a minimal Zeebe broker in a development environment, for example.
70
+
71
+ With this environment variable set, the SDK will inject a `NullAuthProvider` that does nothing.
72
+
73
+ ### Configuring OAuth
74
+
75
+ To get a token for use with the application APIs, provide the following configuration fields at a minimum, either via the `Camunda8` constructor or in environment variables:
76
+
77
+ ```bash
78
+ ZEEBE_ADDRESS
79
+ ZEEBE_CLIENT_ID
80
+ ZEEBE_CLIENT_SECRET
81
+ CAMUNDA_OAUTH_URL
53
82
  ```
54
83
 
55
- Refer to the API docs [here](https://camunda-community-hub.github.io/camunda-8-sdk-node-js/) for full documentation of each component.
84
+ To get a token for the Camunda SaaS Administration API or the Camunda SaaS Modeler API, set the following:
85
+
86
+ ```bash
87
+ CAMUNDA_CONSOLE_CLIENT_ID
88
+ CAMUNDA_CONSOLE_CLIENT_SECRET
89
+ ```
90
+
91
+ ### Token caching
92
+
93
+ OAuth tokens are cached in-memory and on-disk. The disk cache is useful to prevent token endpoint saturation when restarting or rolling over workers, for example. They can all hit the cache instead of requesting new tokens.
94
+
95
+ You can turn off the disk caching by setting `CAMUNDA_TOKEN_DISK_CACHE_DISABLE` to true. This will cache tokens in-memory only.
96
+
97
+ By default, the token cache directory is `$HOME/.camunda`. You can specify a different directory by providing a full file path value for `CAMUNDA_TOKEN_CACHE_DIR`.
98
+
99
+ Here is an example of specifying a different cache directory via the constructor:
100
+
101
+ ```typescript
102
+ import { Camunda8 } from '@camunda8/sdk'
103
+
104
+ const c8 = new Camunda8({
105
+ config: {
106
+ CAMUNDA_TOKEN_CACHE_DIR: '/tmp/cache',
107
+ },
108
+ })
109
+ ```
110
+
111
+ If the cache directory does not exist, the SDK will attempt to create it (recursively). If the SDK is unable to create it, or the directory exists but is not writeable by your application, the SDK will throw an exception.
112
+
113
+ ### Token refresh
114
+
115
+ Token refresh timing relative to expiration is controlled by the `CAMUNDA_OAUTH_TOKEN_REFRESH_THRESHOLD_MS` value. By default, this is 1000ms. Tokens are renewed this amount of time before they expire.
116
+
117
+ If you experience intermittent `401: Unauthorized` errors, this may not be sufficient time to refresh the token before it expires in your infrastructure. Increase this value to force a token to be refreshed before it expires.
118
+
119
+ ## Connection configuration examples
120
+
121
+ ### Self-Managed
122
+
123
+ This is the complete environment configuration needed to run against the Dockerised Self-Managed stack in the `docker` subdirectory:
124
+
125
+ ```bash
126
+ # Self-Managed
127
+ export ZEEBE_ADDRESS='localhost:26500'
128
+ export ZEEBE_CLIENT_ID='zeebe'
129
+ export ZEEBE_CLIENT_SECRET='zecret'
130
+ export CAMUNDA_OAUTH_URL='http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
131
+ export CAMUNDA_TASKLIST_BASE_URL='http://localhost:8082'
132
+ export CAMUNDA_OPERATE_BASE_URL='http://localhost:8081'
133
+ export CAMUNDA_OPTIMIZE_BASE_URL='http://localhost:8083'
134
+ export CAMUNDA_MODELER_BASE_URL='http://localhost:8070/api'
135
+
136
+ # Turn off the tenant ID, which may have been set by multi-tenant tests
137
+ # You can set this in a constructor config, or in the environment if running multi-tenant
138
+ export CAMUNDA_TENANT_ID=''
139
+
140
+ # TLS for gRPC is on by default. If the Zeebe broker is not secured by TLS, turn it off
141
+ export CAMUNDA_SECURE_CONNECTION=false
142
+ ```
143
+
144
+ If you are using an OIDC that requires a `scope` parameter to be passed with the token request, set the following variable:
145
+
146
+ ```
147
+ CAMUNDA_TOKEN_SCOPE
148
+ ```
149
+
150
+ Here is an example of doing this via the constructor, rather than via the environment:
151
+
152
+ ```typescript
153
+ import { Camunda8 } from '@camunda8/sdk'
154
+
155
+ const c8 = new Camunda8({
156
+ config: {
157
+ ZEEBE_ADDRESS: 'localhost:26500'
158
+ ZEEBE_CLIENT_ID: 'zeebe'
159
+ ZEEBE_CLIENT_SECRET: 'zecret'
160
+ CAMUNDA_OAUTH_URL: 'http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token'
161
+ CAMUNDA_TASKLIST_BASE_URL: 'http://localhost:8082'
162
+ CAMUNDA_OPERATE_BASE_URL: 'http://localhost:8081'
163
+ CAMUNDA_OPTIMIZE_BASE_URL: 'http://localhost:8083'
164
+ CAMUNDA_MODELER_BASE_URL: 'http://localhost:8070/api'
165
+ CAMUNDA_TENANT_ID: '' // We can override values in the env by passing an empty string value
166
+ CAMUNDA_SECURE_CONNECTION: false
167
+ }
168
+ })
169
+ ```
170
+
171
+ ### Camunda SaaS
172
+
173
+ Here is a complete configuration example for connection to Camunda SaaS:
174
+
175
+ ```bash
176
+ export ZEEBE_ADDRESS='5c34c0a7-7f29-4424-8414-125615f7a9b9.syd-1.zeebe.camunda.io:443'
177
+ export ZEEBE_CLIENT_ID='yvvURO9TmBnP3zx4Xd8Ho6apgeiZTjn6'
178
+ export ZEEBE_CLIENT_SECRET='iJJu-SHgUtuJTTAMnMLdcb8WGF8s2mHfXhXutEwe8eSbLXn98vUpoxtuLk5uG0en'
179
+ # export CAMUNDA_CREDENTIALS_SCOPES='Zeebe,Tasklist,Operate,Optimize' # What APIs these client creds are authorised for
180
+ export CAMUNDA_TASKLIST_BASE_URL='https://syd-1.tasklist.camunda.io/5c34c0a7-7f29-4424-8414-125615f7a9b9'
181
+ export CAMUNDA_OPTIMIZE_BASE_URL='https://syd-1.optimize.camunda.io/5c34c0a7-7f29-4424-8414-125615f7a9b9'
182
+ export CAMUNDA_OPERATE_BASE_URL='https://syd-1.operate.camunda.io/5c34c0a7-7f29-4424-8414-125615f7a9b9'
183
+ export CAMUNDA_OAUTH_URL='https://login.cloud.camunda.io/oauth/token'
184
+
185
+ # This is on by default, but we include it in case it got turned off for local tests
186
+ export CAMUNDA_SECURE_CONNECTION=true
187
+
188
+ # Admin Console and Modeler API Client
189
+ export CAMUNDA_CONSOLE_CLIENT_ID='e-JdgKfJy9hHSXzi'
190
+ export CAMUNDA_CONSOLE_CLIENT_SECRET='DT8Pe-ANC6e3Je_ptLyzZvBNS0aFwaIV'
191
+ export CAMUNDA_CONSOLE_BASE_URL='https://api.cloud.camunda.io'
192
+ export CAMUNDA_CONSOLE_OAUTH_AUDIENCE='api.cloud.camunda.io'
193
+ ```
194
+
195
+ ## Debugging
196
+
197
+ The SDK uses the [`debug`](https://github.com/debug-js/debug) library. To enable debugging output, set a value for the `DEBUG` environment variable. The value is a comma-separated list of debugging namespaces. The SDK has the following namespaces:
198
+
199
+ | Value | Component |
200
+ | ---------------------- | -------------------- |
201
+ | `camunda:adminconsole` | Administration API |
202
+ | `camunda:modeler` | Modeler API |
203
+ | `camunda:operate` | Operate API |
204
+ | `camunda:optimize` | Optimize API |
205
+ | `camunda:tasklist` | Tasklist API |
206
+ | `camunda:oauth` | OAuth Token Exchange |
207
+ | `camunda:grpc` | Zeebe gRPC channel |
208
+ | `camunda:worker` | Zeebe Worker |
209
+ | `camunda:zeebeclient` | Zeebe Client |
210
+
211
+ ## Typing of Zeebe worker variables
212
+
213
+ The variable payload in a Zeebe worker task handler is available as an object `job.variables`. By default, this is of type `any`.
214
+
215
+ 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:
216
+
217
+ - To provide design-time type information on the `job.variables` object.
218
+ - To specify the parsing of JSON number fields. These can potentially represent `int64` values that cannot be represented accurately by the JavaScript `number` type. With a DTO, you can specify that a specific JSON number fields be parsed losslessly to a `string` or `BigInt`.
219
+
220
+ With no DTO specified, there is no design-time type safety. At run-time, all JSON numbers are converted to the JavaScript `number` type. If a variable field has a number value that cannot be safely represented using the JavaScript number type (a value greater than 2^53 -1), an exception is thrown.
221
+
222
+ To provide a DTO, extend the `LosslessDto` class like so:
223
+
224
+ ```typescript
225
+ class MyVariableDto extends LosslessDto {
226
+ name!: string
227
+ maybeAge?: number
228
+ @Int64String
229
+ veryBigNumber!: string
230
+ @BigIntValue
231
+ veryBigInteger!: bigint
232
+ }
233
+ ```
234
+
235
+ In this case, `veryBigNumber` is an `int64` value. It is transferred as a JSON number on the wire, but the parser will parse it into a `string` so that no loss of precision occurs. Similarly, `veryBigInteger` is a very large integer value. In this case, we direct the parser to parse this variable field as a `bigint`.
236
+
237
+ You can nest DTOs like this:
238
+
239
+ ```typescript
240
+ class MyLargerDto extends LosslessDto {
241
+ id!: string
242
+ @ChildDto(MyVariableDto)
243
+ entry!: MyVariableDto
244
+ }
245
+ ```
246
+
247
+ ## Typing of custom headers
248
+
249
+ The Zeebe worker receives custom headers as `job.customHeaders`. The `ZBClient.createWorker()` method accepts a `customHeadersDto` to control the behavior of custom header parsing of number values and provide design-time type information.
250
+
251
+ This follows the same strategy as the job variables, as previously described.
@@ -0,0 +1,2 @@
1
+ export { AdminApiClient } from './lib/AdminApiClient';
2
+ export * as AdminDto from './lib/AdminDto';