diff --git a/app/lib/index.js b/app/lib/index.js index 87a0794bd..547243eb5 100644 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -22,7 +22,7 @@ const path = require('path'); const fs = require('fs'); -const ZeebeNode = require('zeebe-node'); +const { Camunda8 } = require('@camunda8/sdk'); const Cli = require('./cli'); const Config = require('./config'); @@ -680,7 +680,7 @@ function bootstrap() { errorTracking.setTag(Sentry, 'plugins', generatePluginsTag(plugins)); // (9) zeebe API - const zeebeAPI = new ZeebeAPI({ readFile }, ZeebeNode, flags); + const zeebeAPI = new ZeebeAPI({ readFile }, Camunda8, flags); return { config, diff --git a/app/lib/zeebe-api/zeebe-api.js b/app/lib/zeebe-api/zeebe-api.js index 67b11ba15..c07190d05 100644 --- a/app/lib/zeebe-api/zeebe-api.js +++ b/app/lib/zeebe-api/zeebe-api.js @@ -110,10 +110,10 @@ const CLIENT_OPTIONS_SECRETS = [ */ class ZeebeAPI { - constructor(fs, ZeebeNode, flags, log = createLog('app:zeebe-api')) { + constructor(fs, Camunda8, flags, log = createLog('app:zeebe-api')) { this._fs = fs; - this._ZeebeNode = ZeebeNode; + this._Camunda8 = Camunda8; this._flags = flags; this._log = log; @@ -331,8 +331,9 @@ class ZeebeAPI { url } = endpoint; + /** @type {Camunda8PlatformConfiguration} */ let options = { - retry: false + zeebeGrpcSettings: { ZEEBE_GRPC_CLIENT_RETRY: false } }; if (!values(ENDPOINT_TYPES).includes(type) || !values(AUTH_TYPES).includes(authType)) { @@ -350,31 +351,37 @@ class ZeebeAPI { } else if (authType === AUTH_TYPES.OAUTH) { options = { ...options, - oAuth: { - url: endpoint.oauthURL, - audience: endpoint.audience, - scope: endpoint.scope, - clientId: endpoint.clientId, - clientSecret: endpoint.clientSecret, - cacheOnDisk: false - } + ZEEBE_ADDRESS: endpoint.url, + CAMUNDA_ZEEBE_OAUTH_AUDIENCE: endpoint.audience, + CAMUNDA_TOKEN_SCOPE: endpoint.scope, + CAMUNDA_ZEEBE_CLIENT_ID: endpoint.clientId, + CAMUNDA_ZEEBE_CLIENT_SECRET: endpoint.clientSecret, + CAMUNDA_TOKEN_DISK_CACHE_DISABLE: true }; } else if (type === ENDPOINT_TYPES.CAMUNDA_CLOUD) { options = { ...options, - camundaCloud: { - clientId: endpoint.clientId, - clientSecret: endpoint.clientSecret, - clusterId: endpoint.clusterId, - cacheOnDisk: false, - ...(endpoint.clusterRegion ? { clusterRegion: endpoint.clusterRegion } : {}) - }, - useTLS: true + ZEEBE_ADDRESS: endpoint.camundaCloudClusterUrl, + CAMUNDA_ZEEBE_OAUTH_AUDIENCE: endpoint.audience, + CAMUNDA_TOKEN_SCOPE: endpoint.scope, + CAMUNDA_ZEEBE_CLIENT_ID: endpoint.clientId, + CAMUNDA_ZEEBE_CLIENT_SECRET: endpoint.clientSecret, + CAMUNDA_TOKEN_DISK_CACHE_DISABLE: true, + CAMUNDA_SECURE_CONNECTION: true + }; + } else if (type === ENDPOINT_TYPES.SELF_HOSTED) { + options = { + ...options, + ZEEBE_ADDRESS: endpoint.url }; } options = await this._withTLSConfig(url, options); - options = this._withPortConfig(url, options); + + // do not override camunda cloud port (handled by the client) + if (type !== ENDPOINT_TYPES.CAMUNDA_CLOUD) { + options = this._withPortConfig(url, options); + } this._log.debug('creating client', { url, @@ -389,7 +396,7 @@ class ZeebeAPI { ) }); - return new this._ZeebeNode.ZBClient(url, options); + return (new this._Camunda8(options)).getZeebeGrpcApiClient(); } async _withTLSConfig(url, options) { @@ -443,12 +450,6 @@ class ZeebeAPI { } _withPortConfig(url, options) { - - // do not override camunda cloud port (handled by zeebe-node) - if (options.camundaCloud) { - return options; - } - const parsedUrl = new URL(url); // do not override port if already set in url diff --git a/app/package.json b/app/package.json index 0c2e60ecd..f1b9379db 100644 --- a/app/package.json +++ b/app/package.json @@ -11,6 +11,7 @@ }, "license": "MIT", "dependencies": { + "@camunda8/sdk": "^8.5.3", "@sentry/integrations": "^7.113.0", "@sentry/node": "^8.0.0", "epipebomb": "^1.0.0", @@ -18,8 +19,7 @@ "ids": "^1.0.0", "min-dash": "^4.1.1", "mri": "^1.1.6", - "parents": "^1.0.1", - "zeebe-node": "^8.3.2" + "parents": "^1.0.1" }, "homepage": "https://github.com/camunda/camunda-modeler", "repository": { diff --git a/app/test/spec/zeebe-api/zeebe-api-spec.js b/app/test/spec/zeebe-api/zeebe-api-spec.js index 41ac0153d..78387ab89 100644 --- a/app/test/spec/zeebe-api/zeebe-api-spec.js +++ b/app/test/spec/zeebe-api/zeebe-api-spec.js @@ -36,7 +36,7 @@ describe('ZeebeAPI', function() { it('should set success=true for correct check', async () => { // given - const zeebeAPI = mockZeebeNode(); + const zeebeAPI = mockCamundaClient(); const parameters = { endpoint: { @@ -56,13 +56,11 @@ describe('ZeebeAPI', function() { it('should set success=false on failure', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new Error('TEST ERROR.'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new Error('TEST ERROR.'); + } } }); @@ -86,13 +84,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('TEST ERROR.', 14); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('TEST ERROR.', 14); + } } }); @@ -113,13 +109,11 @@ describe('ZeebeAPI', function() { it('for (Cloud)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('TEST ERROR.', 14); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('TEST ERROR.', 14); + } } }); @@ -139,13 +133,11 @@ describe('ZeebeAPI', function() { it('for (Cloud)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('TEST ERROR.', 13); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('TEST ERROR.', 13); + } } }); @@ -165,13 +157,11 @@ describe('ZeebeAPI', function() { it('for (self-managed)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Error: 13 INTERNAL:'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Error: 13 INTERNAL:'); + } } }); @@ -192,13 +182,11 @@ describe('ZeebeAPI', function() { it('for (self-managed)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Error: 14 UNAVAILABLE:'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Error: 14 UNAVAILABLE:'); + } } }); @@ -219,13 +207,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('ENOTFOUND'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('ENOTFOUND'); + } } }); @@ -246,13 +232,11 @@ describe('ZeebeAPI', function() { it('for (OAuth)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('ENOTFOUND'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('ENOTFOUND'); + } } }); @@ -274,13 +258,11 @@ describe('ZeebeAPI', function() { it('for (Cloud)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('ENOTFOUND'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('ENOTFOUND'); + } } }); @@ -300,13 +282,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Unauthorized'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Unauthorized'); + } } }); @@ -327,13 +307,11 @@ describe('ZeebeAPI', function() { it('for - Cloud', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Unauthorized'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Unauthorized'); + } } }); @@ -353,13 +331,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Forbidden'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Forbidden'); + } } }); @@ -379,13 +355,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Unsupported protocol'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Unsupported protocol'); + } } }); @@ -407,13 +381,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Some random error'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Some random error'); + } } }); @@ -434,13 +406,11 @@ describe('ZeebeAPI', function() { it('for no message', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError(); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError(); + } } }); @@ -461,13 +431,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Method not found', 12); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Method not found', 12); + } } }); @@ -496,7 +464,7 @@ describe('ZeebeAPI', function() { it('should set success=true for successful instance run', async () => { // given - const zeebeAPI = mockZeebeNode(); + const zeebeAPI = mockCamundaClient(); const parameters = { endpoint: { @@ -517,13 +485,11 @@ describe('ZeebeAPI', function() { it('should set success=false on failure', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - createProcessInstance: function() { - throw new Error('TEST ERROR.'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + createProcessInstance: function() { + throw new Error('TEST ERROR.'); + } } }); @@ -548,13 +514,11 @@ describe('ZeebeAPI', function() { it('should return serialized error', async function() { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - createProcessInstance: function() { - throw new Error('TEST ERROR.'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + createProcessInstance: function() { + throw new Error('TEST ERROR.'); + } } }); @@ -581,7 +545,7 @@ describe('ZeebeAPI', function() { it('should set success=true for successful deployment', async () => { // given - const zeebeAPI = mockZeebeNode(); + const zeebeAPI = mockCamundaClient(); const parameters = { endpoint: { @@ -604,13 +568,11 @@ describe('ZeebeAPI', function() { // given const error = new Error('test'); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: function() { - throw error; - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: function() { + throw error; + } } }); @@ -636,13 +598,11 @@ describe('ZeebeAPI', function() { // given const error = new Error('test'); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: function() { - throw error; - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: function() { + throw error; + } } }); @@ -669,7 +629,7 @@ describe('ZeebeAPI', function() { readFile: sinon.spy(() => ({})) }; - const zeebeAPI = mockZeebeNode({ fs }); + const zeebeAPI = mockCamundaClient({ fs }); const parameters = { filePath: 'filePath', @@ -697,11 +657,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy }, fs: { readFile() { @@ -733,11 +691,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy }, fs: { readFile() { @@ -770,11 +726,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy }, fs: { readFile() { @@ -811,11 +765,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -841,11 +793,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -872,11 +822,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -903,11 +851,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -933,11 +879,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -964,11 +908,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -995,11 +937,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1025,11 +965,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1055,11 +993,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1085,11 +1021,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1116,11 +1050,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1147,11 +1079,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1178,11 +1108,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy, - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy, } }); @@ -1219,7 +1147,7 @@ describe('ZeebeAPI', function() { }; }); - const zeebeAPI = mockZeebeNode({ + const zeebeAPI = mockCamundaClient({ ZBClient: ZBClientMock }); @@ -1259,16 +1187,14 @@ describe('ZeebeAPI', function() { it('should pass configuration', async () => { // given + const configSpy = sinon.spy(); const deployResourceSpy = sinon.spy(); - const ZBClientMock = sinon.spy(function() { - return { + const zeebeAPI = mockCamundaClient({ + configSpy, + ZBClient: { deployResource: deployResourceSpy - }; - }); - - const zeebeAPI = mockZeebeNode({ - ZBClient: ZBClientMock + } }); // when @@ -1288,17 +1214,17 @@ describe('ZeebeAPI', function() { }); // then - const [ url, config ] = ZBClientMock.getCall(0).args; + const config = configSpy.getCall(0).args[0]; // ZBClient is invoked accordingly - expect(url).to.eql(TEST_URL); + expect(config.ZEEBE_ADDRESS).to.eql(TEST_URL); - expect(config.oAuth).to.include.keys({ - audience: 'audience', - clientId: 'clientId', - clientSecret: 'clientSecret', - scope: 'scope', - url: 'oauthURL' + expect(config).to.include.keys({ + CAMUNDA_ZEEBE_OAUTH_AUDIENCE: 'audience', + CAMUNDA_ZEEBE_CLIENT_ID: 'clientId', + CAMUNDA_ZEEBE_CLIENT_SECRET: 'clientSecret', + CAMUNDA_TOKEN_SCOPE: 'scope', + ZEEBE_ADDRESS: 'oauthURL' }); // deployment is executed appropriately @@ -1315,11 +1241,9 @@ describe('ZeebeAPI', function() { // given const deployResourceSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: deployResourceSpy - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + deployResource: deployResourceSpy } }); @@ -1356,13 +1280,11 @@ describe('ZeebeAPI', function() { // given const topologyResponse = { clusterSize: 3, gatewayVersion: '0.26.0' }; - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - return topologyResponse; - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + return topologyResponse; + } } }); @@ -1386,13 +1308,11 @@ describe('ZeebeAPI', function() { // given const topologyResponse = { clusterSize: 3, gatewayVersion: '0.26.0' }; - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - return topologyResponse; - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + return topologyResponse; + } } }); @@ -1415,13 +1335,11 @@ describe('ZeebeAPI', function() { it('should set success=false on failure', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new Error('TEST ERROR.'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new Error('TEST ERROR.'); + } } }); @@ -1446,13 +1364,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('TEST ERROR.', 14); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('TEST ERROR.', 14); + } } }); @@ -1473,13 +1389,11 @@ describe('ZeebeAPI', function() { it('for (Cloud)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('TEST ERROR.', 14); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('TEST ERROR.', 14); + } } }); @@ -1499,13 +1413,11 @@ describe('ZeebeAPI', function() { it('for (Cloud)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('TEST ERROR.', 13); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('TEST ERROR.', 13); + } } }); @@ -1525,13 +1437,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('ENOTFOUND'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('ENOTFOUND'); + } } }); @@ -1552,13 +1462,11 @@ describe('ZeebeAPI', function() { it('for (OAuth)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('ENOTFOUND'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('ENOTFOUND'); + } } }); @@ -1580,13 +1488,11 @@ describe('ZeebeAPI', function() { it('for (Cloud)', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('ENOTFOUND'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('ENOTFOUND'); + } } }); @@ -1606,13 +1512,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Unauthorized'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Unauthorized'); + } } }); @@ -1633,13 +1537,11 @@ describe('ZeebeAPI', function() { it('for - Cloud', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Unauthorized'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Unauthorized'); + } } }); @@ -1659,13 +1561,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Forbidden'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Forbidden'); + } } }); @@ -1685,13 +1585,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Unsupported protocol'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Unsupported protocol'); + } } }); @@ -1713,13 +1611,11 @@ describe('ZeebeAPI', function() { it('for ', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError('Some random error'); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError('Some random error'); + } } }); @@ -1740,13 +1636,11 @@ describe('ZeebeAPI', function() { it('for no message', async () => { // given - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - topology: function() { - throw new NetworkError(); - } - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + topology: function() { + throw new NetworkError(); + } } }); @@ -1775,13 +1669,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -1796,7 +1686,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[0]).to.eql('https://camunda.com'); + expect(usedConfig.ZEEBE_ADDRESS).to.eql('https://camunda.com'); }); @@ -1805,8 +1695,8 @@ describe('ZeebeAPI', function() { // given const createSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: createSpy + const zeebeAPI = mockCamundaClient({ + configSpy: createSpy }); const parameters = { @@ -1828,8 +1718,8 @@ describe('ZeebeAPI', function() { // given const createSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: createSpy + const zeebeAPI = mockCamundaClient({ + configSpy: createSpy }); const parameters = { @@ -1852,13 +1742,10 @@ describe('ZeebeAPI', function() { it('should create new client instance if config is different', async () => { // given - const createSpy = sinon.stub().returns({ - deployResource: noop, - close: noop - }); + const createSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: createSpy + const zeebeAPI = mockCamundaClient({ + configSpy: createSpy }); const parameters = { @@ -1890,12 +1777,9 @@ describe('ZeebeAPI', function() { // given const closeSpy = sinon.spy(); - const zeebeAPI = mockZeebeNode({ - ZBClient: function() { - return { - deployResource: noop, - close: closeSpy - }; + const zeebeAPI = mockCamundaClient({ + ZBClient: { + close: closeSpy } }); const parameters = { @@ -1926,13 +1810,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -1947,7 +1827,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).to.have.property('useTLS', true); + expect(usedConfig).to.have.property('useTLS', true); }); @@ -1956,13 +1836,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -1977,7 +1853,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).to.have.property('useTLS', false); + expect(usedConfig).to.have.property('useTLS', false); }); @@ -1986,13 +1862,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -2008,7 +1880,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).to.have.property('useTLS', false); + expect(usedConfig).to.have.property('useTLS', false); }); @@ -2017,13 +1889,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -2038,7 +1906,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).to.have.property('useTLS', true); + expect(usedConfig).to.have.property('CAMUNDA_SECURE_CONNECTION', true); }); @@ -2047,13 +1915,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -2068,7 +1932,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).not.to.have.property('port'); + expect(usedConfig).not.to.have.property('port'); }); @@ -2077,13 +1941,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -2098,7 +1958,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).to.have.property('port', '80'); + expect(usedConfig).to.have.property('port', '80'); }); @@ -2107,13 +1967,9 @@ describe('ZeebeAPI', function() { // given let usedConfig; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - usedConfig = args; - - return { - deployResource: noop - }; + const zeebeAPI = mockCamundaClient({ + configSpy(config) { + usedConfig = config; } }); @@ -2128,7 +1984,7 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - expect(usedConfig[1]).to.have.property('port', '443'); + expect(usedConfig).to.have.property('port', '443'); }); @@ -2140,14 +1996,8 @@ describe('ZeebeAPI', function() { error: sinon.spy(), warn: sinon.spy() }; - const zeebeAPI = mockZeebeNode({ - ZBClient: function(...args) { - configSpy(...args); - - return { - deployResource: noop - }; - }, + const zeebeAPI = mockCamundaClient({ + configSpy, flags: { get() { return '/path/to/cert.pem'; @@ -2380,7 +2230,7 @@ describe('ZeebeAPI', function() { warn: logSpy }; - const zeebeAPI = mockZeebeNode({ log }); + const zeebeAPI = mockCamundaClient({ log }); const parameters = { endpoint: { @@ -2446,7 +2296,7 @@ describe('ZeebeAPI', function() { warn: logSpy }; - const zeebeAPI = mockZeebeNode({ log }); + const zeebeAPI = mockCamundaClient({ log }); const parameters = { endpoint: { @@ -2465,8 +2315,6 @@ describe('ZeebeAPI', function() { await zeebeAPI.deploy(parameters); // then - console.log(logSpy.getCalls().map(call => JSON.stringify(call.args), null, 2)); - expect(logSpy).to.have.been.called; const createClientCall = logSpy.getCalls().find(call => call.args[ 0 ] === 'creating client'); @@ -2476,15 +2324,15 @@ describe('ZeebeAPI', function() { expect(createClientCall.args[ 1 ]).to.eql({ url: 'http://localhost:26500', options:{ - retry: false, - oAuth: { - url: 'oauthURL', - audience: 'audience', - scope: 'scope', - clientId: '******', - clientSecret: '******', - cacheOnDisk: false, + zeebeGrpcSettings: { + ZEEBE_GRPC_CLIENT_RETRY: false }, + CAMUNDA_TOKEN_DISK_CACHE_DISABLE: true, + CAMUNDA_TOKEN_SCOPE: 'scope', + CAMUNDA_ZEEBE_CLIENT_ID: '******', + CAMUNDA_ZEEBE_CLIENT_SECRET: '******', + CAMUNDA_ZEEBE_OAUTH_AUDIENCE: 'audience', + ZEEBE_ADDRESS: 'http://localhost:26500', useTLS: false } }); @@ -2527,7 +2375,7 @@ function setupPlatformStub() { }); } -function mockZeebeNode(options = {}) { +function mockCamundaClient(options = {}) { const fs = options.fs || { readFile: () => ({}) }; @@ -2542,18 +2390,22 @@ function mockZeebeNode(options = {}) { ...(options.log || {}) }; - const ZeebeNode = { - ZBClient: options.ZBClient || function() { - return { + class CamundaClient { + constructor(config) { + options.configSpy && options.configSpy(config); + } + + getZeebeGrpcApiClient() { + return Object.assign({ topology: noop, deployResource: noop, createProcessInstance: noop, close: noop - }; + }, options.ZBClient); } - }; + } - return new ZeebeAPI(fs, ZeebeNode, flags, log); + return new ZeebeAPI(fs, CamundaClient, flags, log); } function noop() {} diff --git a/package-lock.json b/package-lock.json index b79d001fa..37d7fda59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,7 @@ "version": "5.23.0", "license": "MIT", "dependencies": { + "@camunda8/sdk": "^8.5.3", "@sentry/integrations": "^7.113.0", "@sentry/node": "^8.0.0", "epipebomb": "^1.0.0", @@ -60,8 +61,7 @@ "ids": "^1.0.0", "min-dash": "^4.1.1", "mri": "^1.1.6", - "parents": "^1.0.1", - "zeebe-node": "^8.3.2" + "parents": "^1.0.1" }, "optionalDependencies": { "vscode-windows-ca-certs": "^0.3.0" @@ -3127,6 +3127,59 @@ "resolved": "https://registry.npmjs.org/@camunda/zeebe-element-templates-json-schema/-/zeebe-element-templates-json-schema-0.19.2.tgz", "integrity": "sha512-T0U6Ij3AS191KADumm5rXCVUYtKSFBiipexQL3lJHey1XmADmTGIqhAe8+iCyKqUaxixjv5Q/IkuFD2NqBoIpw==" }, + "node_modules/@camunda8/sdk": { + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@camunda8/sdk/-/sdk-8.5.3.tgz", + "integrity": "sha512-nJatfx5VjtqwpAMwKppjP5Mvyf87YAfrUCM2c1dnzzo1TPylGHxUZlJoOK9eCbcRh+re+5Us2tpezdHR9bdnKw==", + "dependencies": { + "@grpc/grpc-js": "1.10.7", + "@grpc/proto-loader": "0.7.13", + "chalk": "^2.4.2", + "console-stamp": "^3.0.2", + "dayjs": "^1.8.15", + "debug": "^4.3.4", + "fast-xml-parser": "^4.1.3", + "got": "^11.8.6", + "jwt-decode": "^4.0.0", + "lodash.mergewith": "^4.6.2", + "long": "^4.0.0", + "lossless-json": "^4.0.1", + "neon-env": "^0.1.3", + "promise-retry": "^1.1.1", + "reflect-metadata": "^0.2.1", + "stack-trace": "0.0.10", + "typed-duration": "^1.0.12", + "uuid": "^7.0.3" + }, + "optionalDependencies": { + "win-ca": "3.5.1" + } + }, + "node_modules/@camunda8/sdk/node_modules/err-code": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", + "integrity": "sha512-CJAN+O0/yA1CKfRn9SXOGctSpEM7DCon/r/5r2eXFMY2zCCJBasFhcM5I+1kh3Ap11FsQCX+vGHceNPvpWKhoA==" + }, + "node_modules/@camunda8/sdk/node_modules/promise-retry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", + "integrity": "sha512-StEy2osPr28o17bIW776GtwO6+Q+M9zPiZkYfosciUUMYqjhU/ffwRAH0zN2+uvGyUsn8/YICIHRzLbPacpZGw==", + "dependencies": { + "err-code": "^1.0.0", + "retry": "^0.10.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/@camunda8/sdk/node_modules/retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==", + "engines": { + "node": "*" + } + }, "node_modules/@carbon/grid": { "version": "11.22.0", "resolved": "https://registry.npmjs.org/@carbon/grid/-/grid-11.22.0.tgz", @@ -3487,25 +3540,25 @@ "license": "MIT" }, "node_modules/@grpc/grpc-js": { - "version": "1.9.7", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.7.tgz", - "integrity": "sha512-yMaA/cIsRhGzW3ymCNpdlPcInXcovztlgu/rirThj2b87u3RzWUszliOqZ/pldy7yhmJPS8uwog+kZSTa4A0PQ==", + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.7.tgz", + "integrity": "sha512-ZMBVjSeDAz3tFSehyO6Pd08xZT1HfIwq3opbeM4cDlBh52gmwp0wVIPcQur53NN0ac68HMZ/7SF2rGRD5KmVmg==", "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" }, "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=12.10.0" } }, "node_modules/@grpc/proto-loader": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.10.tgz", - "integrity": "sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==", + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", "dependencies": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", - "protobufjs": "^7.2.4", + "protobufjs": "^7.2.5", "yargs": "^17.7.2" }, "bin": { @@ -3873,6 +3926,15 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@lerna/create": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@lerna/create/-/create-8.0.0.tgz", @@ -16028,10 +16090,6 @@ "node": ">=0.4.x" } }, - "node_modules/fp-ts": { - "version": "2.12.3", - "license": "MIT" - }, "node_modules/fromentries": { "version": "1.3.2", "dev": true, @@ -16598,8 +16656,9 @@ } }, "node_modules/got": { - "version": "11.8.5", - "license": "MIT", + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", "dependencies": { "@sindresorhus/is": "^4.0.0", "@szmarczak/http-timer": "^4.0.5", @@ -17545,6 +17604,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-electron": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", + "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==", + "optional": true + }, "node_modules/is-empty": { "version": "1.2.0", "dev": true, @@ -18392,6 +18457,14 @@ "dev": true, "license": "MIT" }, + "node_modules/jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "engines": { + "node": ">=18" + } + }, "node_modules/karma": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.2.tgz", @@ -19804,6 +19877,11 @@ "version": "4.6.2", "license": "MIT" }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" + }, "node_modules/lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", @@ -19929,6 +20007,11 @@ "loose-envify": "cli.js" } }, + "node_modules/lossless-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-4.0.1.tgz", + "integrity": "sha512-l0L+ppmgPDnb+JGxNLndPtJZGNf6+ZmVaQzoxQm3u6TXmhdnsA+YtdVR8DjzZd/em58686CQhOFDPewfJ4l7MA==" + }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -21711,6 +21794,14 @@ "dev": true, "license": "MIT" }, + "node_modules/neon-env": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/neon-env/-/neon-env-0.1.3.tgz", + "integrity": "sha512-Zo+L6Nm19gJrjyfhxn/ZDm8eIIDzr75o64ZhijBau4LNuhLzjEAteRg3gchIvgaN8XTo5BxN6iTNP5clZQ0agA==", + "engines": { + "node": "^14.18 || >=16.0.0" + } + }, "node_modules/netmask": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", @@ -21801,9 +21892,9 @@ "optional": true }, "node_modules/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" @@ -21820,6 +21911,15 @@ } } }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "optional": true, + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/node-gyp": { "version": "9.3.0", "dev": true, @@ -24461,7 +24561,7 @@ }, "node_modules/pify": { "version": "3.0.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=4" @@ -24870,9 +24970,9 @@ } }, "node_modules/protobufjs": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", - "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -25822,6 +25922,11 @@ "node": ">=8" } }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==" + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -29520,7 +29625,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, + "devOptional": true, "dependencies": { "through": "2" }, @@ -30186,7 +30291,7 @@ }, "node_modules/through": { "version": "2.3.8", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/through2": { @@ -32828,6 +32933,31 @@ "dev": true, "license": "MIT" }, + "node_modules/win-ca": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/win-ca/-/win-ca-3.5.1.tgz", + "integrity": "sha512-RNy9gpBS6cxWHjfbqwBA7odaHyT+YQNhtdpJZwYCFoxB/Dq22oeOZ9YCXMwjhLytKpo7JJMnKdJ/ve7N12zzfQ==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "is-electron": "^2.2.0", + "make-dir": "^1.3.0", + "node-forge": "^1.2.1", + "split": "^1.0.1" + } + }, + "node_modules/win-ca/node_modules/make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "optional": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -33211,55 +33341,6 @@ "resolved": "https://registry.npmjs.org/zeebe-bpmn-moddle/-/zeebe-bpmn-moddle-1.1.0.tgz", "integrity": "sha512-ES/UZFO0VmKvAzL4+cD3VcQpKvlmgLtnFKTyiv0DdDcxNrdQg1rI0OmUdrKMiybAbtAgPDkVXZCusE3kkXwEyQ==" }, - "node_modules/zeebe-node": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/zeebe-node/-/zeebe-node-8.3.2.tgz", - "integrity": "sha512-3/xbiTvhaa668JHtMEwELv5dN6HR7Qw8gzmCdjp3Brj6ekdhROVx8x/0JWKSV3Mx64ac3+eEc+9nB5+ZXcO/bg==", - "dependencies": { - "@grpc/grpc-js": "1.9.7", - "@grpc/proto-loader": "0.7.10", - "chalk": "^2.4.2", - "console-stamp": "^3.0.2", - "dayjs": "^1.8.15", - "debug": "^4.2.0", - "fast-xml-parser": "^4.1.3", - "fp-ts": "^2.5.1", - "got": "^11.8.5", - "long": "^4.0.0", - "promise-retry": "^1.1.1", - "stack-trace": "0.0.10", - "typed-duration": "^1.0.12", - "uuid": "^7.0.3" - }, - "bin": { - "zeebe-node": "bin/zeebe-node" - }, - "engines": { - "node": ">=16.6.1" - } - }, - "node_modules/zeebe-node/node_modules/err-code": { - "version": "1.1.2", - "license": "MIT" - }, - "node_modules/zeebe-node/node_modules/promise-retry": { - "version": "1.1.1", - "license": "MIT", - "dependencies": { - "err-code": "^1.0.0", - "retry": "^0.10.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/zeebe-node/node_modules/retry": { - "version": "0.10.1", - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/zip-stream": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.0.tgz", @@ -35095,6 +35176,53 @@ "resolved": "https://registry.npmjs.org/@camunda/zeebe-element-templates-json-schema/-/zeebe-element-templates-json-schema-0.19.2.tgz", "integrity": "sha512-T0U6Ij3AS191KADumm5rXCVUYtKSFBiipexQL3lJHey1XmADmTGIqhAe8+iCyKqUaxixjv5Q/IkuFD2NqBoIpw==" }, + "@camunda8/sdk": { + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@camunda8/sdk/-/sdk-8.5.3.tgz", + "integrity": "sha512-nJatfx5VjtqwpAMwKppjP5Mvyf87YAfrUCM2c1dnzzo1TPylGHxUZlJoOK9eCbcRh+re+5Us2tpezdHR9bdnKw==", + "requires": { + "@grpc/grpc-js": "1.10.7", + "@grpc/proto-loader": "0.7.13", + "chalk": "^2.4.2", + "console-stamp": "^3.0.2", + "dayjs": "^1.8.15", + "debug": "^4.3.4", + "fast-xml-parser": "^4.1.3", + "got": "^11.8.6", + "jwt-decode": "^4.0.0", + "lodash.mergewith": "^4.6.2", + "long": "^4.0.0", + "lossless-json": "^4.0.1", + "neon-env": "^0.1.3", + "promise-retry": "^1.1.1", + "reflect-metadata": "^0.2.1", + "stack-trace": "0.0.10", + "typed-duration": "^1.0.12", + "uuid": "^7.0.3", + "win-ca": "3.5.1" + }, + "dependencies": { + "err-code": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", + "integrity": "sha512-CJAN+O0/yA1CKfRn9SXOGctSpEM7DCon/r/5r2eXFMY2zCCJBasFhcM5I+1kh3Ap11FsQCX+vGHceNPvpWKhoA==" + }, + "promise-retry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", + "integrity": "sha512-StEy2osPr28o17bIW776GtwO6+Q+M9zPiZkYfosciUUMYqjhU/ffwRAH0zN2+uvGyUsn8/YICIHRzLbPacpZGw==", + "requires": { + "err-code": "^1.0.0", + "retry": "^0.10.0" + } + }, + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==" + } + } + }, "@carbon/grid": { "version": "11.22.0", "resolved": "https://registry.npmjs.org/@carbon/grid/-/grid-11.22.0.tgz", @@ -35378,22 +35506,22 @@ "dev": true }, "@grpc/grpc-js": { - "version": "1.9.7", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.7.tgz", - "integrity": "sha512-yMaA/cIsRhGzW3ymCNpdlPcInXcovztlgu/rirThj2b87u3RzWUszliOqZ/pldy7yhmJPS8uwog+kZSTa4A0PQ==", + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.7.tgz", + "integrity": "sha512-ZMBVjSeDAz3tFSehyO6Pd08xZT1HfIwq3opbeM4cDlBh52gmwp0wVIPcQur53NN0ac68HMZ/7SF2rGRD5KmVmg==", "requires": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" } }, "@grpc/proto-loader": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.10.tgz", - "integrity": "sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==", + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", "requires": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", - "protobufjs": "^7.2.4", + "protobufjs": "^7.2.5", "yargs": "^17.7.2" }, "dependencies": { @@ -35650,6 +35778,11 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==" + }, "@lerna/create": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@lerna/create/-/create-8.0.0.tgz", @@ -40670,6 +40803,7 @@ "camunda-modeler": { "version": "file:app", "requires": { + "@camunda8/sdk": "^8.5.3", "@sentry/integrations": "^7.113.0", "@sentry/node": "^8.0.0", "epipebomb": "^1.0.0", @@ -40678,8 +40812,7 @@ "min-dash": "^4.1.1", "mri": "^1.1.6", "parents": "^1.0.1", - "vscode-windows-ca-certs": "^0.3.0", - "zeebe-node": "^8.3.2" + "vscode-windows-ca-certs": "^0.3.0" }, "dependencies": { "min-dash": { @@ -45062,9 +45195,6 @@ "version": "0.2.2", "dev": true }, - "fp-ts": { - "version": "2.12.3" - }, "fromentries": { "version": "1.3.2", "dev": true @@ -45468,7 +45598,9 @@ } }, "got": { - "version": "11.8.5", + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", "requires": { "@sindresorhus/is": "^4.0.0", "@szmarczak/http-timer": "^4.0.5", @@ -46104,6 +46236,12 @@ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true }, + "is-electron": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", + "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==", + "optional": true + }, "is-empty": { "version": "1.2.0", "dev": true @@ -46659,6 +46797,11 @@ "version": "4.2.1", "dev": true }, + "jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==" + }, "karma": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.2.tgz", @@ -47683,6 +47826,11 @@ "lodash.merge": { "version": "4.6.2" }, + "lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" + }, "lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", @@ -47763,6 +47911,11 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lossless-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-4.0.1.tgz", + "integrity": "sha512-l0L+ppmgPDnb+JGxNLndPtJZGNf6+ZmVaQzoxQm3u6TXmhdnsA+YtdVR8DjzZd/em58686CQhOFDPewfJ4l7MA==" + }, "loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -48882,6 +49035,11 @@ "version": "2.6.2", "dev": true }, + "neon-env": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/neon-env/-/neon-env-0.1.3.tgz", + "integrity": "sha512-Zo+L6Nm19gJrjyfhxn/ZDm8eIIDzr75o64ZhijBau4LNuhLzjEAteRg3gchIvgaN8XTo5BxN6iTNP5clZQ0agA==" + }, "netmask": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", @@ -48948,14 +49106,20 @@ "optional": true }, "node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "requires": { "whatwg-url": "^5.0.0" } }, + "node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "optional": true + }, "node-gyp": { "version": "9.3.0", "dev": true, @@ -50831,7 +50995,7 @@ }, "pify": { "version": "3.0.0", - "dev": true + "devOptional": true }, "pinkie": { "version": "2.0.4", @@ -51092,9 +51256,9 @@ } }, "protobufjs": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", - "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -51782,6 +51946,11 @@ "strip-indent": "^3.0.0" } }, + "reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==" + }, "regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -54353,7 +54522,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, + "devOptional": true, "requires": { "through": "2" } @@ -54832,7 +55001,7 @@ }, "through": { "version": "2.3.8", - "dev": true + "devOptional": true }, "through2": { "version": "2.0.5", @@ -56617,6 +56786,29 @@ "version": "2.0.0", "dev": true }, + "win-ca": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/win-ca/-/win-ca-3.5.1.tgz", + "integrity": "sha512-RNy9gpBS6cxWHjfbqwBA7odaHyT+YQNhtdpJZwYCFoxB/Dq22oeOZ9YCXMwjhLytKpo7JJMnKdJ/ve7N12zzfQ==", + "optional": true, + "requires": { + "is-electron": "^2.2.0", + "make-dir": "^1.3.0", + "node-forge": "^1.2.1", + "split": "^1.0.1" + }, + "dependencies": { + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "optional": true, + "requires": { + "pify": "^3.0.0" + } + } + } + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -56883,42 +57075,6 @@ "resolved": "https://registry.npmjs.org/zeebe-bpmn-moddle/-/zeebe-bpmn-moddle-1.1.0.tgz", "integrity": "sha512-ES/UZFO0VmKvAzL4+cD3VcQpKvlmgLtnFKTyiv0DdDcxNrdQg1rI0OmUdrKMiybAbtAgPDkVXZCusE3kkXwEyQ==" }, - "zeebe-node": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/zeebe-node/-/zeebe-node-8.3.2.tgz", - "integrity": "sha512-3/xbiTvhaa668JHtMEwELv5dN6HR7Qw8gzmCdjp3Brj6ekdhROVx8x/0JWKSV3Mx64ac3+eEc+9nB5+ZXcO/bg==", - "requires": { - "@grpc/grpc-js": "1.9.7", - "@grpc/proto-loader": "0.7.10", - "chalk": "^2.4.2", - "console-stamp": "^3.0.2", - "dayjs": "^1.8.15", - "debug": "^4.2.0", - "fast-xml-parser": "^4.1.3", - "fp-ts": "^2.5.1", - "got": "^11.8.5", - "long": "^4.0.0", - "promise-retry": "^1.1.1", - "stack-trace": "0.0.10", - "typed-duration": "^1.0.12", - "uuid": "^7.0.3" - }, - "dependencies": { - "err-code": { - "version": "1.1.2" - }, - "promise-retry": { - "version": "1.1.1", - "requires": { - "err-code": "^1.0.0", - "retry": "^0.10.0" - } - }, - "retry": { - "version": "0.10.1" - } - } - }, "zip-stream": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.0.tgz",