Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 04be347

Browse files
committed
New and Improved
1 parent c5b9392 commit 04be347

17 files changed

+287
-62
lines changed

.vscode/settings.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
{
22
"editor.codeActionsOnSave": {
33
"source.organizeImports": true
4-
}
4+
},
5+
"workbench.colorCustomizations": {
6+
"activityBar.background": "#8a2ca2",
7+
"activityBar.foreground": "#e7e7e7",
8+
"activityBar.inactiveForeground": "#e7e7e799",
9+
"activityBarBadge.background": "#af9530",
10+
"activityBarBadge.foreground": "#15202b",
11+
"titleBar.activeBackground": "#68217a",
12+
"titleBar.inactiveBackground": "#68217a99",
13+
"titleBar.activeForeground": "#e7e7e7",
14+
"titleBar.inactiveForeground": "#e7e7e799",
15+
"statusBar.background": "#68217a",
16+
"statusBarItem.hoverBackground": "#8a2ca2",
17+
"statusBar.foreground": "#e7e7e7"
18+
},
19+
"peacock.color": "#68217A"
520
}

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,20 +280,17 @@ This will produce output similar to:
280280
// Autogenerated constants for msg-start.bpmn
281281

282282
export enum TaskType = {
283-
284283
CONSOLE_LOG = "console-log"
285-
286284
};
287285

288286
export enum MessageName = {
289-
290287
MSG_EMIT_FRAME = "MSG-EMIT_FRAME",
291288
MSG_START_JOB = "MSG-START_JOB"
292-
293289
};
294-
295290
```
296291

292+
## Scaffolding code from a BPM file
293+
297294
## Logging
298295

299296
Control the log output for the client library by setting the ZBClient log level. Valid log levels are `NONE` (supress all logging), `ERROR` (log only exceptions), `INFO` (general logging), or `DEBUG` (verbose logging). You can set this in the client constructor:

bin/zeebe-node-cli

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env node
2+
const ZB = require("../")
3+
4+
const workfile = args[1]
5+
(async () => {
6+
console.log(await ZB.BpmnParser.scaffold(workflowFile));
7+
})();

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"url": "https://github.com/creditsenseau/zeebe-client-node-js"
2323
},
2424
"main": "dist/index.js",
25+
"bin": "bin/zeebe-node-cli",
2526
"scripts": {
2627
"build": "tsc",
2728
"watch": "tsc -w",

src/__tests__/integration/Client-BrokenBpmn.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { ZBClient } from '../..'
22

33
process.env.ZB_NODE_LOG_LEVEL = process.env.ZB_NODE_LOG_LEVEL || 'NONE'
4+
const gatewayAddress = process.env.ZEEBE_GATEWAY_ADDRESS || '0.0.0.0:26500'
45

56
describe('ZBClient', () => {
67
let zbc: ZBClient
78

89
beforeEach(async () => {
9-
zbc = new ZBClient('0.0.0.0:26500')
10+
zbc = new ZBClient(gatewayAddress)
1011
})
1112

1213
afterEach(async () => {

src/__tests__/integration/Client-DeployWorkflow.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { ZBClient } from '../../index'
2+
const gatewayAddress = process.env.ZEEBE_GATEWAY_ADDRESS || '0.0.0.0:26500'
23

34
describe('ZBClient', () => {
45
it('deploys a workflow', async () => {
5-
const zbc = new ZBClient('localhost')
6+
const zbc = new ZBClient(gatewayAddress)
67
const result = await zbc.deployWorkflow(
78
`./src/__tests__/testdata/Client-DeployWorkflow.bpmn`
89
)

src/__tests__/integration/Client-MessageStart.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { v4 as uuid } from 'uuid'
22
import { ZBClient } from '../..'
33

44
process.env.ZB_NODE_LOG_LEVEL = process.env.ZB_NODE_LOG_LEVEL || 'NONE'
5+
const gatewayAddress = process.env.ZEEBE_GATEWAY_ADDRESS || '0.0.0.0:26500'
56

67
describe('ZBClient', () => {
78
let zbc: ZBClient
89

910
beforeEach(async () => {
10-
zbc = new ZBClient('0.0.0.0:26500')
11+
zbc = new ZBClient(gatewayAddress)
1112
})
1213

1314
afterEach(async () => {

src/__tests__/integration/Worker-Failure.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { ZBClient } from '../..'
22

33
process.env.ZB_NODE_LOG_LEVEL = process.env.ZB_NODE_LOG_LEVEL || 'NONE'
4+
const gatewayAddress = process.env.ZEEBE_GATEWAY_ADDRESS || '0.0.0.0:26500'
45

56
describe('ZBWorker', () => {
67
let zbc: ZBClient
78
let wf
89

910
beforeEach(() => {
10-
zbc = new ZBClient('0.0.0.0:26500')
11+
zbc = new ZBClient(gatewayAddress)
1112
})
1213

1314
afterEach(async () => {

src/__tests__/integration/Worker-LongPoll.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import { ZBClient } from '../..'
22

33
process.env.ZB_NODE_LOG_LEVEL = process.env.ZB_NODE_LOG_LEVEL || 'NONE'
4+
const gatewayAddress = process.env.ZEEBE_GATEWAY_ADDRESS || '0.0.0.0:26500'
45

56
describe('ZBWorker', () => {
67
let wf1
78
let wf2
89

910
afterAll(async () => {
10-
const zbc = new ZBClient('0.0.0.0:26500')
11+
const zbc = new ZBClient(gatewayAddress)
1112
await zbc.cancelWorkflowInstance(wf1.workflowInstanceKey)
1213
await zbc.cancelWorkflowInstance(wf2.workflowInstanceKey)
1314
await zbc.close()
1415
})
1516

1617
it("Doesn't long poll by default", async done => {
17-
const zbc = new ZBClient('0.0.0.0:26500')
18+
const zbc = new ZBClient(gatewayAddress)
1819
const res = await zbc.deployWorkflow(
1920
'./src/__tests__/testdata/Worker-LongPoll.bpmn'
2021
)
@@ -40,7 +41,7 @@ describe('ZBWorker', () => {
4041

4142
it('Can long poll', async done => {
4243
jest.setTimeout(30000)
43-
const zbcLongPoll = new ZBClient('0.0.0.0:26500', {
44+
const zbcLongPoll = new ZBClient(gatewayAddress, {
4445
longPoll: 600000,
4546
})
4647
const res = await zbcLongPoll.deployWorkflow(

src/__tests__/integration/Worker-RaiseIncident.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { ZBClient } from '../..'
2+
const gatewayAddress = process.env.ZEEBE_GATEWAY_ADDRESS || '0.0.0.0:26500'
23

34
/**
45
* Note: This test leaves its workflow instance active so the incident can be manually verified
56
*/
67
describe('ZBWorker', () => {
78
let wfi
8-
const zbc = new ZBClient('0.0.0.0:26500')
9+
const zbc = new ZBClient(gatewayAddress)
910

1011
afterAll(() => {
1112
zbc.cancelWorkflowInstance(wfi)

0 commit comments

Comments
 (0)