@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.
- package/.eslintrc.json +34 -0
- package/CHANGELOG.md +61 -21
- package/CODE_OF_CONDUCT.md +73 -0
- package/CONTRIBUTING.md +116 -0
- package/LICENSE +3 -3
- package/README.md +229 -33
- package/dist/admin/index.d.ts +2 -0
- package/dist/admin/index.js +30 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/lib/AdminApiClient.d.ts +121 -0
- package/dist/admin/lib/AdminApiClient.js +254 -0
- package/dist/admin/lib/AdminApiClient.js.map +1 -0
- package/dist/admin/lib/AdminDto.d.ts +98 -0
- package/dist/admin/lib/AdminDto.js +3 -0
- package/dist/admin/lib/AdminDto.js.map +1 -0
- package/dist/c8/index.d.ts +42 -0
- package/dist/c8/index.js +95 -0
- package/dist/c8/index.js.map +1 -0
- package/dist/index.d.ts +15 -14
- package/dist/index.js +14 -16
- package/dist/index.js.map +1 -1
- package/dist/lib/CertificateAuthority.d.ts +2 -0
- package/dist/lib/CertificateAuthority.js +15 -0
- package/dist/lib/CertificateAuthority.js.map +1 -0
- package/dist/lib/ClientConstructor.d.ts +6 -0
- package/dist/lib/ClientConstructor.js +3 -0
- package/dist/lib/ClientConstructor.js.map +1 -0
- package/dist/lib/Configuration.d.ts +113 -0
- package/dist/lib/Configuration.js +367 -0
- package/dist/lib/Configuration.js.map +1 -0
- package/dist/lib/ConstructOAuthProvider.d.ts +3 -0
- package/dist/lib/ConstructOAuthProvider.js +14 -0
- package/dist/lib/ConstructOAuthProvider.js.map +1 -0
- package/dist/lib/CreateUserAgentString.d.ts +2 -0
- package/dist/lib/CreateUserAgentString.js +11 -0
- package/dist/lib/CreateUserAgentString.js.map +1 -0
- package/dist/lib/Delay.d.ts +1 -0
- package/dist/lib/Delay.js +6 -0
- package/dist/lib/Delay.js.map +1 -0
- package/dist/lib/EnvironmentSetup.d.ts +11 -0
- package/dist/lib/EnvironmentSetup.js +35 -0
- package/dist/lib/EnvironmentSetup.js.map +1 -0
- package/dist/lib/GetPackageVersion.d.ts +1 -0
- package/dist/lib/GetPackageVersion.js +32 -0
- package/dist/lib/GetPackageVersion.js.map +1 -0
- package/dist/lib/LosslessJsonParser.d.ts +103 -0
- package/dist/lib/LosslessJsonParser.js +252 -0
- package/dist/lib/LosslessJsonParser.js.map +1 -0
- package/dist/lib/RequireConfiguration.d.ts +2 -0
- package/dist/lib/RequireConfiguration.js +11 -0
- package/dist/lib/RequireConfiguration.js.map +1 -0
- package/dist/lib/SuppressZeebeLogging.d.ts +2 -0
- package/dist/lib/SuppressZeebeLogging.js +14 -0
- package/dist/lib/SuppressZeebeLogging.js.map +1 -0
- package/dist/lib/ValueOrDefault.d.ts +1 -0
- package/dist/lib/ValueOrDefault.js +8 -0
- package/dist/lib/ValueOrDefault.js.map +1 -0
- package/dist/lib/index.d.ts +12 -0
- package/dist/lib/index.js +32 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/modeler/index.d.ts +2 -0
- package/dist/modeler/index.js +30 -0
- package/dist/modeler/index.js.map +1 -0
- package/dist/modeler/lib/ModelerAPIClient.d.ts +210 -0
- package/dist/modeler/lib/ModelerAPIClient.js +417 -0
- package/dist/modeler/lib/ModelerAPIClient.js.map +1 -0
- package/dist/modeler/lib/ModelerDto.d.ts +187 -0
- package/dist/modeler/lib/ModelerDto.js +3 -0
- package/dist/modeler/lib/ModelerDto.js.map +1 -0
- package/dist/oauth/index.d.ts +15 -0
- package/dist/oauth/index.js +8 -0
- package/dist/oauth/index.js.map +1 -0
- package/dist/oauth/lib/IOAuthProvider.d.ts +4 -0
- package/dist/oauth/lib/IOAuthProvider.js +3 -0
- package/dist/oauth/lib/IOAuthProvider.js.map +1 -0
- package/dist/oauth/lib/NullAuthProvider.d.ts +5 -0
- package/dist/oauth/lib/NullAuthProvider.js +16 -0
- package/dist/oauth/lib/NullAuthProvider.js.map +1 -0
- package/dist/oauth/lib/OAuthProvider.d.ts +44 -0
- package/dist/oauth/lib/OAuthProvider.js +316 -0
- package/dist/oauth/lib/OAuthProvider.js.map +1 -0
- package/dist/operate/index.d.ts +2 -0
- package/dist/operate/index.js +30 -0
- package/dist/operate/index.js.map +1 -0
- package/dist/operate/lib/OperateApiClient.d.ts +204 -0
- package/dist/operate/lib/OperateApiClient.js +440 -0
- package/dist/operate/lib/OperateApiClient.js.map +1 -0
- package/dist/operate/lib/OperateDto.d.ts +126 -0
- package/dist/operate/lib/OperateDto.js +125 -0
- package/dist/operate/lib/OperateDto.js.map +1 -0
- package/dist/operate/lib/TestableOperateApiClient.d.ts +7 -0
- package/dist/operate/lib/TestableOperateApiClient.js +15 -0
- package/dist/operate/lib/TestableOperateApiClient.js.map +1 -0
- package/dist/operate/lib/parseSearchResults.d.ts +4 -0
- package/dist/operate/lib/parseSearchResults.js +26 -0
- package/dist/operate/lib/parseSearchResults.js.map +1 -0
- package/dist/optimize/index.d.ts +2 -0
- package/dist/optimize/index.js +30 -0
- package/dist/optimize/index.js.map +1 -0
- package/dist/optimize/lib/APIObjects.d.ts +191 -0
- package/dist/optimize/lib/APIObjects.js +3 -0
- package/dist/optimize/lib/APIObjects.js.map +1 -0
- package/dist/optimize/lib/OptimizeApiClient.d.ts +269 -0
- package/dist/optimize/lib/OptimizeApiClient.js +410 -0
- package/dist/optimize/lib/OptimizeApiClient.js.map +1 -0
- package/dist/optimize/lib/ReportResults.d.ts +23 -0
- package/dist/optimize/lib/ReportResults.js +28 -0
- package/dist/optimize/lib/ReportResults.js.map +1 -0
- package/dist/proto/zeebe.proto +996 -0
- package/dist/tasklist/index.d.ts +2 -0
- package/dist/tasklist/index.js +30 -0
- package/dist/tasklist/index.js.map +1 -0
- package/dist/tasklist/lib/TasklistApiClient.d.ts +104 -0
- package/dist/tasklist/lib/TasklistApiClient.js +233 -0
- package/dist/tasklist/lib/TasklistApiClient.js.map +1 -0
- package/dist/tasklist/lib/TasklistDto.d.ts +147 -0
- package/dist/tasklist/lib/TasklistDto.js +26 -0
- package/dist/tasklist/lib/TasklistDto.js.map +1 -0
- package/dist/tasklist/lib/utils.d.ts +15 -0
- package/dist/tasklist/lib/utils.js +25 -0
- package/dist/tasklist/lib/utils.js.map +1 -0
- package/dist/zeebe/index.d.ts +21 -0
- package/dist/zeebe/index.js +53 -0
- package/dist/zeebe/index.js.map +1 -0
- package/dist/zeebe/lib/BpmnParser.d.ts +38 -0
- package/dist/zeebe/lib/BpmnParser.js +274 -0
- package/dist/zeebe/lib/BpmnParser.js.map +1 -0
- package/dist/zeebe/lib/ConnectionFactory.d.ts +25 -0
- package/dist/zeebe/lib/ConnectionFactory.js +43 -0
- package/dist/zeebe/lib/ConnectionFactory.js.map +1 -0
- package/dist/zeebe/lib/ConnectionStatusEvent.d.ts +6 -0
- package/dist/zeebe/lib/ConnectionStatusEvent.js +10 -0
- package/dist/zeebe/lib/ConnectionStatusEvent.js.map +1 -0
- package/dist/zeebe/lib/GetPackageVersion.d.ts +1 -0
- package/dist/zeebe/lib/GetPackageVersion.js +32 -0
- package/dist/zeebe/lib/GetPackageVersion.js.map +1 -0
- package/dist/zeebe/lib/GrpcClient.d.ts +75 -0
- package/dist/zeebe/lib/GrpcClient.js +467 -0
- package/dist/zeebe/lib/GrpcClient.js.map +1 -0
- package/dist/zeebe/lib/GrpcError.d.ts +19 -0
- package/dist/zeebe/lib/GrpcError.js +23 -0
- package/dist/zeebe/lib/GrpcError.js.map +1 -0
- package/dist/zeebe/lib/GrpcMiddleware.d.ts +21 -0
- package/dist/zeebe/lib/GrpcMiddleware.js +78 -0
- package/dist/zeebe/lib/GrpcMiddleware.js.map +1 -0
- package/dist/zeebe/lib/MockStdOut.d.ts +7 -0
- package/dist/zeebe/lib/MockStdOut.js +19 -0
- package/dist/zeebe/lib/MockStdOut.js.map +1 -0
- package/dist/zeebe/lib/Queue.d.ts +8 -0
- package/dist/zeebe/lib/Queue.js +15 -0
- package/dist/zeebe/lib/Queue.js.map +1 -0
- package/dist/zeebe/lib/SimpleLogger.d.ts +8 -0
- package/dist/zeebe/lib/SimpleLogger.js +47 -0
- package/dist/zeebe/lib/SimpleLogger.js.map +1 -0
- package/dist/zeebe/lib/StatefulLogInterceptor.d.ts +29 -0
- package/dist/zeebe/lib/StatefulLogInterceptor.js +81 -0
- package/dist/zeebe/lib/StatefulLogInterceptor.js.map +1 -0
- package/dist/zeebe/lib/TypedEmitter.d.ts +16 -0
- package/dist/zeebe/lib/TypedEmitter.js +24 -0
- package/dist/zeebe/lib/TypedEmitter.js.map +1 -0
- package/dist/zeebe/lib/ZBJsonLogger.d.ts +5 -0
- package/dist/zeebe/lib/ZBJsonLogger.js +12 -0
- package/dist/zeebe/lib/ZBJsonLogger.js.map +1 -0
- package/dist/zeebe/lib/ZBLogger.d.ts +20 -0
- package/dist/zeebe/lib/ZBLogger.js +134 -0
- package/dist/zeebe/lib/ZBLogger.js.map +1 -0
- package/dist/zeebe/lib/ZBWorkerBase.d.ts +78 -0
- package/dist/zeebe/lib/ZBWorkerBase.js +417 -0
- package/dist/zeebe/lib/ZBWorkerBase.js.map +1 -0
- package/dist/zeebe/lib/cancelProcesses.d.ts +1 -0
- package/dist/zeebe/lib/cancelProcesses.js +40 -0
- package/dist/zeebe/lib/cancelProcesses.js.map +1 -0
- package/dist/zeebe/lib/createUniqueTaskType.d.ts +0 -0
- package/dist/zeebe/lib/createUniqueTaskType.js +65 -0
- package/dist/zeebe/lib/createUniqueTaskType.js.map +1 -0
- package/dist/zeebe/lib/index.d.ts +2 -0
- package/dist/zeebe/lib/index.js +19 -0
- package/dist/zeebe/lib/index.js.map +1 -0
- package/dist/zeebe/lib/interfaces-1.0.d.ts +303 -0
- package/dist/zeebe/lib/interfaces-1.0.js +5 -0
- package/dist/zeebe/lib/interfaces-1.0.js.map +1 -0
- package/dist/zeebe/lib/interfaces-grpc-1.0.d.ts +679 -0
- package/dist/zeebe/lib/interfaces-grpc-1.0.js +22 -0
- package/dist/zeebe/lib/interfaces-grpc-1.0.js.map +1 -0
- package/dist/zeebe/lib/interfaces-published-contract.d.ts +67 -0
- package/dist/zeebe/lib/interfaces-published-contract.js +3 -0
- package/dist/zeebe/lib/interfaces-published-contract.js.map +1 -0
- package/dist/zeebe/lib/stringifyVariables.d.ts +18 -0
- package/dist/zeebe/lib/stringifyVariables.js +28 -0
- package/dist/zeebe/lib/stringifyVariables.js.map +1 -0
- package/dist/zeebe/lib/utils.d.ts +7 -0
- package/dist/zeebe/lib/utils.js +48 -0
- package/dist/zeebe/lib/utils.js.map +1 -0
- package/dist/zeebe/types.d.ts +3 -0
- package/dist/zeebe/types.js +20 -0
- package/dist/zeebe/types.js.map +1 -0
- package/dist/zeebe/zb/ZBWorker.d.ts +7 -0
- package/dist/zeebe/zb/ZBWorker.js +73 -0
- package/dist/zeebe/zb/ZBWorker.js.map +1 -0
- package/dist/zeebe/zb/ZeebeGrpcClient.d.ts +587 -0
- package/dist/zeebe/zb/ZeebeGrpcClient.js +1021 -0
- package/dist/zeebe/zb/ZeebeGrpcClient.js.map +1 -0
- package/package.json +120 -30
- package/release.config.js +49 -0
- package/renovate.json +9 -0
- package/smoke-test/package-lock.json +29 -0
- package/smoke-test/package.json +15 -0
- package/smoke-test/smoke-test.js +45 -0
- package/test-d/index.test-d.ts +31 -0
- package/.github/workflows/build-docs.yml +0 -39
- package/.github/workflows/tag-and-publish.yml +0 -48
- package/.prettierignore +0 -2
- package/img/video.png +0 -0
- package/jest.config.js +0 -5
- package/src/__tests__/exports.spec.ts +0 -7
- package/src/index.ts +0 -17
- package/tsconfig.build.json +0 -8
- package/tsconfig.json +0 -10
- package/tsconfig.tsbuildinfo +0 -1
- 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
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
28
|
+
* **repo:** make fix type commits release a new package ([ded83cf](https://github.com/camunda/camunda-8-js-sdk/commit/ded83cfaf437a2f62a5ef134d7616538facda614))
|
|
9
29
|
|
|
10
|
-
#
|
|
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
|
-
|
|
33
|
+
### Bug Fixes
|
|
15
34
|
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
40
|
+
### Bug Fixes
|
|
23
41
|
|
|
24
|
-
|
|
42
|
+
* **repo:** only git commit on npm publish success ([9012764](https://github.com/camunda/camunda-8-js-sdk/commit/901276451845c5dbd926af0a6563d5564d3e87b9))
|
|
25
43
|
|
|
26
|
-
|
|
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
|
-
|
|
47
|
+
### Bug Fixes
|
|
31
48
|
|
|
32
|
-
|
|
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
|
-
|
|
73
|
+
### Bug Fixes
|
|
35
74
|
|
|
36
|
-
|
|
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
|
-
###
|
|
77
|
+
### Features
|
|
39
78
|
|
|
40
|
-
-
|
|
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
|
package/CONTRIBUTING.md
ADDED
|
@@ -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
|
|
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
|
|
1
|
+
# Camunda 8 JavaScript SDK
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@camunda8/sdk)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
9
|
+
## What does "supported" mean?
|
|
15
10
|
|
|
16
|
-
-
|
|
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
|
|
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
|
-
|
|
15
|
+
Prioritisation of implementing features is influenced by customer demand.
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
## Semantic versioning
|
|
24
18
|
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
23
|
+
Install the SDK as a dependency:
|
|
36
24
|
|
|
37
25
|
```bash
|
|
38
|
-
npm i
|
|
26
|
+
npm i @camunda8/sdk
|
|
39
27
|
```
|
|
40
28
|
|
|
41
29
|
## Usage
|
|
42
30
|
|
|
43
|
-
|
|
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 {
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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.
|