From 2cc310c11927f414e64fc4193840301a428d518c Mon Sep 17 00:00:00 2001 From: Josh Wulf Date: Thu, 4 Apr 2024 17:56:43 +1300 Subject: [PATCH 1/3] ci(repo): create npm publish workflow --- .github/workflows/multitenancy.yml | 5 -- .github/workflows/tag-and-publish.yml | 64 +++++---------- .npmignore | 13 ++++ .releaserc | 14 ++-- CHANGELOG.md | 6 +- CONTRIBUTING.md | 33 +++++--- README.md | 6 +- lerna.json | 17 ---- package-lock.json | 55 +++++++++++++ package.json | 14 ++-- src/__tests__/oauth/OAuthProvider.spec.ts | 12 +-- src/lib/Configuration.ts | 2 +- src/lib/LosslessJsonParser.ts | 2 +- src/oauth/lib/OAuthProvider.ts | 4 +- zeebe-extra/CHANGELOG.md | 94 +++++++++++------------ zeebe-extra/DEVELOP.md | 2 +- zeebe-extra/package.json | 6 +- 17 files changed, 189 insertions(+), 160 deletions(-) delete mode 100644 lerna.json diff --git a/.github/workflows/multitenancy.yml b/.github/workflows/multitenancy.yml index 346377d3..9921caf7 100644 --- a/.github/workflows/multitenancy.yml +++ b/.github/workflows/multitenancy.yml @@ -16,11 +16,6 @@ jobs: with: node-version: "18" # Specify a Node.js version - # This is to force nx arch-specific packages to correctly install - # This is to work around https://github.com/npm/cli/issues/4828 - - name: Remove package-lock.json - run: rm -f package-lock.json - - name: Install dependencies run: npm install diff --git a/.github/workflows/tag-and-publish.yml b/.github/workflows/tag-and-publish.yml index 2d7843b8..85433f4f 100644 --- a/.github/workflows/tag-and-publish.yml +++ b/.github/workflows/tag-and-publish.yml @@ -1,39 +1,24 @@ name: Tag and publish a new version on: - workflow_dispatch: - inputs: - version: - description: "Version" - required: true + workflow_run: + workflows: + [ + "Single Tenant Integration Tests", + "Multitenant Integration Tests", + "SaaS Integration Tests", + ] + types: + - completed jobs: tag-and-publish: runs-on: ubuntu-latest + if: > + github.event.workflow_run.conclusion == 'success' && + (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'alpha') environment: name: publish - services: - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:7.17.5 - env: - discovery.type: single-node - cluster.name: docker-cluster - bootstrap.memory_lock: true - xpack.security.enabled: false - ES_JAVA_OPTS: -Xms1024m -Xmx1024m - ports: - - 9200:9200 - - 9300:9300 - zeebe: - image: camunda/zeebe:8.4.5 - env: - JAVA_TOOL_OPTIONS: "-Xms512m -Xmx512m" - ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_CLASSNAME: io.camunda.zeebe.exporter.ElasticsearchExporter - ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_URL: http://elasticsearch:9200 - ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_BULK_SIZE: 1 - ZEEBE_BROKER_BACKPRESSURE_ENABLED: false - ports: - - 26500:26500 steps: - name: Checkout repository uses: actions/checkout@v3 @@ -42,32 +27,19 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16.17.0 + node-version: "18" cache: "npm" - name: Install run: npm ci --ignore-scripts - - name: Run integration tests - run: npm run test:integration - - name: Run tests - run: npm run test - - name: Run local integration tests - run: npm run test:local - name: Build run: npm run build - - name: Set version - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - npm version ${{ inputs.version }} -m "Publish v%s" - - name: Publish to NPM - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access=public - - name: Push changes - run: git push --follow-tags - - name: Build Docs run: npm run docs + - name: Semantic Release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Deploy Docs uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.npmignore b/.npmignore index 1784c8c8..e33b1c04 100644 --- a/.npmignore +++ b/.npmignore @@ -7,3 +7,16 @@ src .vscode .husky docs +coverage +zeebe-extra +commitlint.config.js +.editorconfig +.eslintrc.js +.prettier* +prettier* +ts-jest.log +.eslintignore +.releaserc +typedoc.json +lerna.json +docker* \ No newline at end of file diff --git a/.releaserc b/.releaserc index b447a09a..ff592983 100644 --- a/.releaserc +++ b/.releaserc @@ -1,15 +1,17 @@ { - "branches": ["main"], - "repositoryUrl": "https://github.com/camunda-community-hub/camunda-8-js-sdk.git", + "branches": [ + "main", + { + "name": "alpha", + "prerelease": true + } + ], + "repositoryUrl": "https://github.com/camunda/camunda-8-js-sdk.git", "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/changelog", "@semantic-release/npm", - { - "path": "semantic-release-lerna", - "generateNotes": false - }, "@semantic-release/github", "@semantic-release/git" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index a7282bda..a5129a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- REST getForm returns a flattened shape of the form compared to GraphQL ([58ec6d1](https://github.com/camunda-community-hub/camunda-8-js-sdk/commit/58ec6d1de08e39cb4699326b67ebbf6a398fb30f)) +- REST getForm returns a flattened shape of the form compared to GraphQL ([58ec6d1](https://github.com/camunda/camunda-8-js-sdk/commit/58ec6d1de08e39cb4699326b67ebbf6a398fb30f)) ### Features -- configure specs to import configuration from .env file ([00804d1](https://github.com/camunda-community-hub/camunda-8-js-sdk/commit/00804d132c0e1840846a5af9eee26351f9580c74)) -- **tasklist:** enable multiple clusters via constructor options ([#16](https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/16)) ([fb12e25](https://github.com/camunda-community-hub/camunda-8-js-sdk/commit/fb12e258321e6bba03d11d38119c740f0e242773)) +- configure specs to import configuration from .env file ([00804d1](https://github.com/camunda/camunda-8-js-sdk/commit/00804d132c0e1840846a5af9eee26351f9580c74)) +- **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)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87c99382..f0e8433b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,22 +7,31 @@ Thank you for considering contributing to @camunda8/sdk! We welcome contribution To get started with contributing, please follow these steps: 1. Fork the repository and clone it to your local machine. -2. Install the dependencies by running `npm install`. -3. Make your changes or additions to the codebase. -4. Write tests to cover your changes and ensure existing tests pass. -5. Run the tests using `npm test` to make sure everything is working correctly. -6. Commit your changes and push them to your forked repository. -7. Submit a pull request to the main repository. +2. Check out the `alpha` branch. This is the development branch. +3. Install the dependencies by running `npm install`. +4. Make your changes or additions to the codebase. +5. Write tests to cover your changes and ensure existing tests pass. +6. Run the tests using `npm test` to make sure everything is working correctly. See below for details on running integration tests. +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. +8. Submit a pull request to the main repository. +9. When your PR is merged into the `alpha` branch, an alpha package is published to NPM. +10. When the `alpha` branch is merged into `main`, a new package is published to NPM. + +## A note on commit messages + +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 need to treat feature implementation during a minor release cycle as a `fix` rather than a `feature`. + +Creating a commit with a `feature` commit message will cause the package version minor release number to increment, which we only do when Camunda 8 Platform releases a new minor version. ## Running tests -Run all the unit tests with `lerna run test`. +Run all the unit tests with `npm run test`. ### Integration tests Integration tests can be run against Self-Managed or against Camunda SaaS. -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 `lerna run test:integration`. +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`. To run the integration tests against Self-Managed, you can use either your own Self-Managed instance, or start one locally using Docker. @@ -79,6 +88,8 @@ export CAMUNDA_TEST_TYPE='local' export CAMUNDA_TENANT_ID='' ``` +Now run the integration tests against Self-Managed with `npm run test:multitenancy`. + ## Code Style We follow a specific code style in our project to maintain consistency. Please make sure to adhere to the following guidelines: @@ -88,11 +99,11 @@ We follow a specific code style in our project to maintain consistency. Please m ## Issue Reporting -If you encounter any bugs or issues while using @camunda/sdk, please report them in the [issue tracker](https://github.com/camunda-community-hub/camunda-8-js-sdk/issues). Provide as much detail as possible, including steps to reproduce the issue. +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. ## Feature Requests -If you have any ideas or feature requests for @camunda/sdk, please submit them in the [issue tracker](https://github.com/camunda-community-hub/camunda-8-js-sdk/issues). We appreciate your feedback and suggestions. +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. ## License @@ -100,6 +111,6 @@ By contributing to @camunda/sdk, you agree that your contributions will be licen ## Contact -If you have any questions or need further assistance, feel free to reach out to us at [your-email@example.com]. +If you have any questions or need further assistance, open an issue in the repository. Happy contributing! diff --git a/README.md b/README.md index 1b7f8faa..b40f0e52 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![NPM](https://nodei.co/npm/@camunda8/sdk.png)](https://www.npmjs.com/package/@camunda8/sdk) -This is the official Camunda 8 JavaScript SDK. It is written in TypeScript and runs on Node.js. See details on why [this is not in a web browser](https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/79)). +This is the official Camunda 8 JavaScript SDK. It is written in TypeScript and runs on Node.js. See details on why [this is not in a web browser](https://github.com/camunda/camunda-8-js-sdk/issues/79)). ## Using the SDK in your project @@ -38,7 +38,7 @@ The configuration object fields and the environment variables have exactly the s ## A note on how int64 is handled in the JavaScript SDK -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-community-hub/camunda-8-js-sdk/issues/78) for more details. +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. 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`. @@ -184,7 +184,7 @@ The SDK uses the [`debug`](https://github.com/debug-js/debug) library. To enable | Value | Component | | ---------------------- | -------------------- | -| `camunda:adminconsole` | Administration API | +| `camunda:adminconsole` | Administration API | | `camunda:modeler` | Modeler API | | `camunda:operate` | Operate API | | `camunda:optimize` | Optimize API | diff --git a/lerna.json b/lerna.json deleted file mode 100644 index d5ef5fbf..00000000 --- a/lerna.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "8.4.0", - "packages": [ - "packages/*" - ], - "command": { - "publish": { - "registry": "https://registry.npmjs.org", - "conventionalCommits": true - }, - "version": { - "conventionalCommits": true - } - }, - "npmClient": "npm" -} diff --git a/package-lock.json b/package-lock.json index 1149966b..55a5b99f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,6 +54,7 @@ "lint-staged": "^15.2.0", "prettier": "^3.1.1", "semantic-release": "^22.0.12", + "shx": "^0.3.4", "ts-jest": "^29.1.1", "tsconfig-paths": "^4.2.0", "typedoc": "^0.25.9", @@ -7767,6 +7768,15 @@ "node": ">= 0.4" } }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/into-stream": { "version": "7.0.0", "dev": true, @@ -14969,6 +14979,18 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/redent": { "version": "3.0.0", "dev": true, @@ -15796,6 +15818,23 @@ "node": ">=8" } }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/shiki": { "version": "0.14.7", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", @@ -15808,6 +15847,22 @@ "vscode-textmate": "^8.0.0" } }, + "node_modules/shx": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", + "dev": true, + "dependencies": { + "minimist": "^1.2.3", + "shelljs": "^0.8.5" + }, + "bin": { + "shx": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/side-channel": { "version": "1.0.4", "dev": true, diff --git a/package.json b/package.json index e4e06729..4f75e421 100644 --- a/package.json +++ b/package.json @@ -4,23 +4,20 @@ "description": "", "main": "dist/index.js", "scripts": { - "build": "npm run clean && npm run compile", + "build": "npm run clean && npm run compile && shx mkdir dist/proto && shx cp src/proto/zeebe.proto dist/proto/", "clean": "rm -rf ./dist && rm -f ./tsconfig.tsbuildinfo", "compile": "tsc --project tsconfig.json", "docs": "rm -rf ./docs && typedoc", - "test": "jest --detectOpenHandles --testPathIgnorePatterns integration local-integration disconnection multitenancy", + "test": "jest --detectOpenHandles --testPathIgnorePatterns integration --testPathIgnorePatterns local-integration --testPathIgnorePatterns disconnection --testPathIgnorePatterns multitenancy --testPathIgnorePatterns __tests__/config", "test:integration": "jest --runInBand --testPathIgnorePatterns disconnection --testPathIgnorePatterns __tests__/config --testPathIgnorePatterns multitenancy --detectOpenHandles --verbose true -u", "test:multitenancy": "jest --runInBand --testPathIgnorePatterns disconnection --testPathIgnorePatterns admin --testPathIgnorePatterns __tests__/config - --detectOpenHandles --verbose true -u", "test:local": "jest --runInBand --verbose true --detectOpenHandles local-integration -u", "test:local-integration": "jest --runInBand --detectOpenHandles --verbose --testPathIgnorePatterns disconnection --testPathIgnorePatterns admin --testPathIgnorePatterns multitenancy --testPathIgnorePatterns __tests__/config -u", "test:docker": "jest --runInBand --testPathIgnorePatterns disconnection --testPathIgnorePatterns __tests__/config local-integration --detectOpenHandles --verbose true", "test:disconnect": "jest --runInBand --verbose true --detectOpenHandles --testPathIgnorePatterns __tests__/config disconnection", - "test&docs": "npm test && npm run docs", - "publish": "npm run build && npm run test && lerna publish", + "prepublishOnly": "npm run build && npm run test", "commit": "cz", - "publish:canary": "npm run build && npm run test && lerna publish --canary", "prepare": "husky install", - "prepublishOnly": "npm run build", "lint": "eslint 'src/**/*.{ts,tsx}'", "format": "prettier --write 'src/**/*.ts'" }, @@ -33,7 +30,7 @@ "license": "Apache 2.0", "repository": { "type": "git", - "url": "git+https://github.com/camunda-community-hub/camunda-8-js-sdk.git" + "url": "git+https://github.com/camunda/camunda-8-js-sdk.git" }, "husky": { "hooks": { @@ -115,6 +112,7 @@ "lint-staged": "^15.2.0", "prettier": "^3.1.1", "semantic-release": "^22.0.12", + "shx": "^0.3.4", "ts-jest": "^29.1.1", "tsconfig-paths": "^4.2.0", "typedoc": "^0.25.9", @@ -142,4 +140,4 @@ "typed-duration": "^1.0.12", "uuid": "^7.0.3" } -} +} \ No newline at end of file diff --git a/src/__tests__/oauth/OAuthProvider.spec.ts b/src/__tests__/oauth/OAuthProvider.spec.ts index 0f7a884c..96bafc5c 100644 --- a/src/__tests__/oauth/OAuthProvider.spec.ts +++ b/src/__tests__/oauth/OAuthProvider.spec.ts @@ -161,9 +161,9 @@ test('Throws in the constructor if the token cache is not writable', () => { expect(fs.existsSync(tokenCacheDir)).toBe(false) }) -// Added test for https://github.com/camunda-community-hub/camunda-saas-oauth-nodejs/issues/8 +// Added test for https://github.com/camunda/camunda-saas-oauth-nodejs/issues/8 // "Can not renew expired token" -// Updated test for https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/3 +// Updated test for https://github.com/camunda/camunda-8-js-sdk/issues/3 // "Remove expiry timer from oAuth token implementation" test('In-memory cache is populated and evicted after timeout', (done) => { const delay = (timeout: number) => @@ -216,7 +216,7 @@ test('In-memory cache is populated and evicted after timeout', (done) => { }) }) -// Added test for https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/62 +// Added test for https://github.com/camunda/camunda-8-js-sdk/issues/62 // "OAuth token refresh has a race condition" test('In-memory cache is populated and evicted respecting CAMUNDA_OAUTH_TOKEN_REFRESH_THRESHOLD_MS', (done) => { const delay = (timeout: number) => @@ -529,7 +529,7 @@ test('Can set a custom user agent', () => { expect(o.userAgentString.includes(' modeler')).toBe(true) }) -// See: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/60 +// See: https://github.com/camunda/camunda-8-js-sdk/issues/60 test('Passes no audience for Modeler API when self-hosted', (done) => { const serverPort3006 = 3006 const o = new OAuthProvider({ @@ -563,7 +563,7 @@ test('Passes no audience for Modeler API when self-hosted', (done) => { o.getToken('MODELER') }) -// See: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/60 +// See: https://github.com/camunda/camunda-8-js-sdk/issues/60 test('Throws if you try to get a Modeler token from SaaS without console creds', async () => { let thrown = false const o = new OAuthProvider({ @@ -586,7 +586,7 @@ test('Throws if you try to get a Modeler token from SaaS without console creds', }) }) -// See: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/60 +// See: https://github.com/camunda/camunda-8-js-sdk/issues/60 test('Throws if you try to get a Modeler token from Self-hosted without application creds', async () => { let thrown = false const o = new OAuthProvider({ diff --git a/src/lib/Configuration.ts b/src/lib/Configuration.ts index 3013f91c..cc43e2f2 100644 --- a/src/lib/Configuration.ts +++ b/src/lib/Configuration.ts @@ -75,7 +75,7 @@ const getMainEnv = () => optional: true, // No default for this, because on Self-Managed it's not needed, and we omit it if the user doesn't set it. // However, if someone sets up Self-Managed in a way that needs it, we let them set one. - // See: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/60 + // See: https://github.com/camunda/camunda-8-js-sdk/issues/60 }, /** The audience parameter for an Optimize OAuth token request. Defaults to optimize.camunda.io */ CAMUNDA_OPTIMIZE_OAUTH_AUDIENCE: { diff --git a/src/lib/LosslessJsonParser.ts b/src/lib/LosslessJsonParser.ts index 7b2cc894..637f090b 100644 --- a/src/lib/LosslessJsonParser.ts +++ b/src/lib/LosslessJsonParser.ts @@ -7,7 +7,7 @@ * * It also handles nested Dtos by using the `@ChildDto` decorator. * - * More details on the design here: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/81#issuecomment-2022213859 + * More details on the design here: https://github.com/camunda/camunda-8-js-sdk/issues/81#issuecomment-2022213859 */ /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/oauth/lib/OAuthProvider.ts b/src/oauth/lib/OAuthProvider.ts index c786129b..d698690d 100644 --- a/src/oauth/lib/OAuthProvider.ts +++ b/src/oauth/lib/OAuthProvider.ts @@ -138,7 +138,7 @@ export class OAuthProvider implements IOAuthProvider { // We use the Console credential set if it we are requesting from // the SaaS OAuth endpoint, and it is a Modeler or Admin Console token. // Otherwise we use the application credential set, unless a Console credential set exists. - // See: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/60 + // See: https://github.com/camunda/camunda-8-js-sdk/issues/60 const requestingFromSaaSConsole = this.isCamundaSaaS && (audienceType === 'CONSOLE' || audienceType === 'MODELER') @@ -231,7 +231,7 @@ export class OAuthProvider implements IOAuthProvider { private addAudienceIfNeeded(audienceType: TokenGrantAudienceType) { /** If we are running on Self-Managed (ie: not Camunda SaaS), and no explicit audience was set, * we should not include an audience in the token request. - * See: https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/60 + * See: https://github.com/camunda/camunda-8-js-sdk/issues/60 */ if ( audienceType === 'MODELER' && diff --git a/zeebe-extra/CHANGELOG.md b/zeebe-extra/CHANGELOG.md index 8af83c80..e4b3adbb 100644 --- a/zeebe-extra/CHANGELOG.md +++ b/zeebe-extra/CHANGELOG.md @@ -7,7 +7,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Features -- **tasklist:** enable multiple clusters via constructor options ([#16](https://github.com/camunda-community-hub/camunda-8-js-sdk/issues/16)) ([fb12e25](https://github.com/camunda-community-hub/camunda-8-js-sdk/commit/fb12e258321e6bba03d11d38119c740f0e242773)) +- **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)) # 8.3.1 @@ -15,7 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline _New shiny stuff_ -- You can now deploy forms to the Zeebe broker using `ZBClient.deployResource()`. See [#332](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/332) for more details. +- You can now deploy forms to the Zeebe broker using `ZBClient.deployResource()`. See [#332](https://github.com/camunda/zeebe-client-node-js/issues/332) for more details. # 8.3.0 @@ -23,31 +23,31 @@ _New shiny stuff_ _Changes in APIs or behaviour that may affect existing applications that use zeebe-node._ -- Several method signatures for `CreateProcessInstance` and `CreateProcessInstanceWithResult` have been removed, leaving only the method that takes an object parameter. See [#330](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/330#issuecomment-1672535320) for more details. +- Several method signatures for `CreateProcessInstance` and `CreateProcessInstanceWithResult` have been removed, leaving only the method that takes an object parameter. See [#330](https://github.com/camunda/zeebe-client-node-js/issues/330#issuecomment-1672535320) for more details. ## Known Issues _Things that don't work or don't work as expected, and which will be addressed in a future release_ -- The `onConnectionError` event fires correctly for Camunda SaaS, but fires a false positive when connecting to a Self-Managed instance. See [#340](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/340) for more details. +- The `onConnectionError` event fires correctly for Camunda SaaS, but fires a false positive when connecting to a Self-Managed instance. See [#340](https://github.com/camunda/zeebe-client-node-js/issues/340) for more details. ## New Features _New shiny stuff._ -- Camunda Platform 8.3.0 introduces multi-tenancy. To support this, the Node.js client adds an optional `tenantId` parameter to `DeployResource`, `DeployProcess`, `CreateProcessInstance`, `CreateProcessInstanceWithResult`, and `PublishMessage`. You can also specify a `tenantId` in the ZBClient constructor or via the environment variable `ZEEBE_TENANT_ID`. In the case that you specify it via the environment or constructor, it will be transparently added to all method invocations. See [#330](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/330) for more details. +- Camunda Platform 8.3.0 introduces multi-tenancy. To support this, the Node.js client adds an optional `tenantId` parameter to `DeployResource`, `DeployProcess`, `CreateProcessInstance`, `CreateProcessInstanceWithResult`, and `PublishMessage`. You can also specify a `tenantId` in the ZBClient constructor or via the environment variable `ZEEBE_TENANT_ID`. In the case that you specify it via the environment or constructor, it will be transparently added to all method invocations. See [#330](https://github.com/camunda/zeebe-client-node-js/issues/330) for more details. - `@grpc/grpc-js` has been updated to 1.9.7, and `@grpc/proto-loader` has been updated to 0.7.10. _Things that were broken and are now fixed._ -- The `onReady` and `onConnection` event tests now pass, so these events should be usable. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215) for more details. +- The `onReady` and `onConnection` event tests now pass, so these events should be usable. See [#215](https://github.com/camunda/zeebe-client-node-js/issues/215) for more details. ## Fixes _Things that were broken and are now fixed._ -- An error message "Grpc Stream Error: 16 UNAUTHENTICATED: Failed to parse bearer token, see cause for details" would be logged intermittently. This was because under particular conditions an expired token cached on disk could be used for API calls. To prevent this, the disk-cached token is evicted at the same time as the in-memory token. See [#336](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/336) for more details. -- The `onReady` and `onConnection` event tests now pass for Camunda SaaS. The `onReady` event fires correctly for Self-Managed started with docker-compose. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215) and [#340](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/340) for more details. +- An error message "Grpc Stream Error: 16 UNAUTHENTICATED: Failed to parse bearer token, see cause for details" would be logged intermittently. This was because under particular conditions an expired token cached on disk could be used for API calls. To prevent this, the disk-cached token is evicted at the same time as the in-memory token. See [#336](https://github.com/camunda/zeebe-client-node-js/issues/336) for more details. +- The `onReady` and `onConnection` event tests now pass for Camunda SaaS. The `onReady` event fires correctly for Self-Managed started with docker-compose. See [#215](https://github.com/camunda/zeebe-client-node-js/issues/215) and [#340](https://github.com/camunda/zeebe-client-node-js/issues/340) for more details. # Version 8.2.5 @@ -55,7 +55,7 @@ _Things that were broken and are now fixed._ _New shiny stuff._ -- Throwing a BPMN Error, either from the `ZBClient` or in the job handler of a `ZBWorker`, accepted an error message and an error code. The gRPC API for ThrowError now accepts a `variables` field, but the Node client did not allow you to set variables along with the error code and message. The Node client now accepts an object for `job.error` that includes a `variables` field, as does `ZBClient.throwError`, allowing you to set variables when throwing a BPMN error. See [#323](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/323), the README file, and the [Client API documentation](https://camunda-community-hub.github.io/zeebe-client-node-js/) for more details. +- Throwing a BPMN Error, either from the `ZBClient` or in the job handler of a `ZBWorker`, accepted an error message and an error code. The gRPC API for ThrowError now accepts a `variables` field, but the Node client did not allow you to set variables along with the error code and message. The Node client now accepts an object for `job.error` that includes a `variables` field, as does `ZBClient.throwError`, allowing you to set variables when throwing a BPMN error. See [#323](https://github.com/camunda/zeebe-client-node-js/issues/323), the README file, and the [Client API documentation](https://camunda.github.io/zeebe-client-node-js/) for more details. ## Chores @@ -69,7 +69,7 @@ _Things that shouldn't have a visible impact._ _Things that were broken and are now fixed._ -- Custom root certificates were not being passed to the Camunda SaaS OAuth provider. This caused a failure to connect when an SSL terminating firewall that uses a custom root certificate sits between the client and Camunda SaaS. Custom root certificates are now passed to the Camunda SaaS OAuth provider, and are used when making the connection. Thanks to [@nikku](https://github.com/nikku) for reporting this and providing the patch. See [#319](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/319) for more details. +- Custom root certificates were not being passed to the Camunda SaaS OAuth provider. This caused a failure to connect when an SSL terminating firewall that uses a custom root certificate sits between the client and Camunda SaaS. Custom root certificates are now passed to the Camunda SaaS OAuth provider, and are used when making the connection. Thanks to [@nikku](https://github.com/nikku) for reporting this and providing the patch. See [#319](https://github.com/camunda/zeebe-client-node-js/issues/319) for more details. # Version 8.2.3 @@ -77,7 +77,7 @@ _Things that were broken and are now fixed._ _Things that were broken and are now fixed._ -- The object signature for `job.fail()` did not correctly apply an explicit value for `retries`. As a result, job retries would decrement automatically if this signature and option were used. The value is now correctly parsed and applied, and job retry count can be explicitly set in the `job.fail()` command with the object signature. Thanks to [@patozgg](https://github.com/patozgg) for reporting this. See [#316](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/316) for more details. +- The object signature for `job.fail()` did not correctly apply an explicit value for `retries`. As a result, job retries would decrement automatically if this signature and option were used. The value is now correctly parsed and applied, and job retry count can be explicitly set in the `job.fail()` command with the object signature. Thanks to [@patozgg](https://github.com/patozgg) for reporting this. See [#316](https://github.com/camunda/zeebe-client-node-js/issues/316) for more details. # Version 8.2.2 @@ -93,13 +93,13 @@ _Things that shouldn't have a visible impact._ _New shiny stuff._ -- Add `ZBClient.broadcastSignal`, enabling the client to broadcast a signal. See [#312](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/312) for more details. +- Add `ZBClient.broadcastSignal`, enabling the client to broadcast a signal. See [#312](https://github.com/camunda/zeebe-client-node-js/issues/312) for more details. ## Fixes _Things that were broken and are now fixed._ -- Previously, the `timeToLive` property of `ZBClient.publishMessage` was required, although it was documented as optional. In this release, both `timeToLive` and `variables` have been made optional. If no value is supplied for `timeToLive`, it defaults to 0. Thanks to [@nhomble]() for raising this issue. See [#311](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/311) for more details. +- Previously, the `timeToLive` property of `ZBClient.publishMessage` was required, although it was documented as optional. In this release, both `timeToLive` and `variables` have been made optional. If no value is supplied for `timeToLive`, it defaults to 0. Thanks to [@nhomble]() for raising this issue. See [#311](https://github.com/camunda/zeebe-client-node-js/issues/311) for more details. # Version 8.2.0 @@ -107,7 +107,7 @@ _Things that were broken and are now fixed._ _New shiny stuff._ -- Add `ZBClient.evaluateDecision`, enabling a DMN table to be evaluated on a Zeebe 8.2 and later broker. See [#296](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/296) for more details. +- Add `ZBClient.evaluateDecision`, enabling a DMN table to be evaluated on a Zeebe 8.2 and later broker. See [#296](https://github.com/camunda/zeebe-client-node-js/issues/296) for more details. # Version 8.1.8 @@ -115,7 +115,7 @@ _New shiny stuff._ _Things that were broken and are now fixed._ -- The OAuth token was being evicted from the in-memory cache immediately, resulting in the file cache being used for every request. This release correctly sets the expiry time for the in-memory token cache. See [#307](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/307) for more details. Thanks to [@walliee](https://github.com/Walliee) for the fix. +- The OAuth token was being evicted from the in-memory cache immediately, resulting in the file cache being used for every request. This release correctly sets the expiry time for the in-memory token cache. See [#307](https://github.com/camunda/zeebe-client-node-js/issues/307) for more details. Thanks to [@walliee](https://github.com/Walliee) for the fix. # Version 8.1.7 @@ -123,7 +123,7 @@ _Things that were broken and are now fixed._ _Things that were broken and are now fixed._ -- With `cacheOnDisk` disabled, the OAuthProvider could cause excessive requests to the token endpoint, leading to blacklisting and denial-of-service. This version makes several adjustments to mitigate this: it caches the token in memory, reuses a single inflight request to the token endpoint, and backs off the token endpoint on a request failure. See [#301](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/301) for more details. Thanks to [@nhomble](https://github.com/nhomble) for raising this issue. +- With `cacheOnDisk` disabled, the OAuthProvider could cause excessive requests to the token endpoint, leading to blacklisting and denial-of-service. This version makes several adjustments to mitigate this: it caches the token in memory, reuses a single inflight request to the token endpoint, and backs off the token endpoint on a request failure. See [#301](https://github.com/camunda/zeebe-client-node-js/issues/301) for more details. Thanks to [@nhomble](https://github.com/nhomble) for raising this issue. # Version 8.1.6 @@ -139,8 +139,8 @@ _Things that shouldn't have a visible impact._ _New shiny stuff._ -- The ZBClient now implements the `modifyProcessInstance` API, introduced in Zeebe 8.1. This allows you to modify a running process instance, moving execution tokens and changing variables. This can be used, for example, to migrate a running process instance to a new version of the process model. See [#294](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/294) for more details. -- The ZBClient `createProcessInstance` method now allows you to specify `startInstructions` (introduced in Zeebe 8.1), allowing you to start a new process instance from an arbitrary point. Along with `modifyProcessInstance`, this is a powerful primitive for building migration functionality. See [[#295](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/295)] for more details. +- The ZBClient now implements the `modifyProcessInstance` API, introduced in Zeebe 8.1. This allows you to modify a running process instance, moving execution tokens and changing variables. This can be used, for example, to migrate a running process instance to a new version of the process model. See [#294](https://github.com/camunda/zeebe-client-node-js/issues/294) for more details. +- The ZBClient `createProcessInstance` method now allows you to specify `startInstructions` (introduced in Zeebe 8.1), allowing you to start a new process instance from an arbitrary point. Along with `modifyProcessInstance`, this is a powerful primitive for building migration functionality. See [[#295](https://github.com/camunda/zeebe-client-node-js/issues/295)] for more details. # Version 8.1.4 @@ -148,14 +148,14 @@ _New shiny stuff._ _Things that were broken and are now fixed._ -- The @grpc dependencies are now pinned to a specific version - 1.8.7 for grpc-js and 0.7.4 for proto-loader. This is to avoid broken upstream dependencies impacting installs. Previously, with the dependency unpinned, an install on different days could result in a library that worked, or did not work, depending on the state of the upstream libraries. Now, the same dependencies are installed every time, resulting in a consistent experience. Thanks to [@nikku](https://github.com/nikku) and [@barmac](https://github.com/barmac) from the [Camunda Modeler](https://github.com/camunda/camunda-modeler) team for identifying this. See [#290](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/290) for more context. -- The `docker` subdirectory is back, with a `docker-compose.yml` file to start a local broker for testing purposes. See [#289](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/289) for more details. +- The @grpc dependencies are now pinned to a specific version - 1.8.7 for grpc-js and 0.7.4 for proto-loader. This is to avoid broken upstream dependencies impacting installs. Previously, with the dependency unpinned, an install on different days could result in a library that worked, or did not work, depending on the state of the upstream libraries. Now, the same dependencies are installed every time, resulting in a consistent experience. Thanks to [@nikku](https://github.com/nikku) and [@barmac](https://github.com/barmac) from the [Camunda Modeler](https://github.com/camunda/camunda-modeler) team for identifying this. See [#290](https://github.com/camunda/zeebe-client-node-js/issues/290) for more context. +- The `docker` subdirectory is back, with a `docker-compose.yml` file to start a local broker for testing purposes. See [#289](https://github.com/camunda/zeebe-client-node-js/issues/289) for more details. ## New Features _New shiny stuff._ -- A custom SSL certificate is now able to be used for the oAuth endpoint. The `got` library used for the token exchange needs the certificate explicitly, and it can now be passed in as a `customRootCert` property to the `oAuth` property in the ZBClient constructor. Thanks to [luca-waldmann-cimt](https://github.com/luca-waldmann-cimt) for the feature. See [#284](https://github.com/camunda-community-hub/zeebe-client-node-js/pull/284) for more details. +- A custom SSL certificate is now able to be used for the oAuth endpoint. The `got` library used for the token exchange needs the certificate explicitly, and it can now be passed in as a `customRootCert` property to the `oAuth` property in the ZBClient constructor. Thanks to [luca-waldmann-cimt](https://github.com/luca-waldmann-cimt) for the feature. See [#284](https://github.com/camunda/zeebe-client-node-js/pull/284) for more details. # Version 8.1.2 @@ -163,13 +163,13 @@ _New shiny stuff._ _Things that were broken and are now fixed._ -- In 8.1.1, the update to the version of `got` introduced a regression that broke the OAuth token request with certain gateway configurations. This is now reverted, and a test has been introduced to ensure this regression does not happen again. See [#280](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/280) for more details. +- In 8.1.1, the update to the version of `got` introduced a regression that broke the OAuth token request with certain gateway configurations. This is now reverted, and a test has been introduced to ensure this regression does not happen again. See [#280](https://github.com/camunda/zeebe-client-node-js/issues/280) for more details. ## New Features _New shiny stuff._ -- Applications can now extend the user agent identifier by setting a value for the environment variable `ZEEBE_CLIENT_CUSTOM_AGENT_STRING`. This will be appended to the standard user agent string. See [#279](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/279) for more details. +- Applications can now extend the user agent identifier by setting a value for the environment variable `ZEEBE_CLIENT_CUSTOM_AGENT_STRING`. This will be appended to the standard user agent string. See [#279](https://github.com/camunda/zeebe-client-node-js/issues/279) for more details. # Version 8.1.1 @@ -177,7 +177,7 @@ _New shiny stuff._ _Things that shouldn't have a visible impact._ -- Bump got to 11.8.5 to fix [CVE-2022-33987](https://github.com/advisories/GHSA-pfrx-2q88-qq97). Thanks to [@nithinssabu](https://github.com/nithinssabu) for the PR. See [#275](https://github.com/camunda-community-hub/zeebe-client-node-js/pull/275) for more detail. +- Bump got to 11.8.5 to fix [CVE-2022-33987](https://github.com/advisories/GHSA-pfrx-2q88-qq97). Thanks to [@nithinssabu](https://github.com/nithinssabu) for the PR. See [#275](https://github.com/camunda/zeebe-client-node-js/pull/275) for more detail. # Version 8.1 @@ -191,9 +191,9 @@ _Changes in APIs or behaviour that may affect existing applications that use zee _Things that were broken and are now fixed._ -- Previously, the `connectionTolerance` option to `createWorker` did not take a `MaybeTimeDuration`, requiring users to provide a number (the value units is milliseconds). The signature has now been fixed, and `connectionTolerance` can now take a number or a typed Duration. See [#260](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/260) for more detail. Thanks to [@dancrumb](https://github.com/dancrumb) for reporting this. -- Previously, the autogenerated code for a BPMN model used the deprecated worker constructor and did not return the job acknowledgement token. It now uses the object constructor and correctly returns the job acknowledgement token. See [#257](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/257) for more details. Thanks to [@megankirkbride](https://github.com/megankirkbride) for reporting this issue. -- Previously, the OAuth token request sent by the library used JSON encoding. This worked with Camunda SaaS, but would fail with Keycloak in self-managed. The library now correctly encodes the request as x-www-form-urlencoded. See [#272](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/272) for more details. Thanks to [@AdrianErnstLGLN](https://github.com/AdrianErnstLGLN) for reporting this issue and providing a patch. +- Previously, the `connectionTolerance` option to `createWorker` did not take a `MaybeTimeDuration`, requiring users to provide a number (the value units is milliseconds). The signature has now been fixed, and `connectionTolerance` can now take a number or a typed Duration. See [#260](https://github.com/camunda/zeebe-client-node-js/issues/260) for more detail. Thanks to [@dancrumb](https://github.com/dancrumb) for reporting this. +- Previously, the autogenerated code for a BPMN model used the deprecated worker constructor and did not return the job acknowledgement token. It now uses the object constructor and correctly returns the job acknowledgement token. See [#257](https://github.com/camunda/zeebe-client-node-js/issues/257) for more details. Thanks to [@megankirkbride](https://github.com/megankirkbride) for reporting this issue. +- Previously, the OAuth token request sent by the library used JSON encoding. This worked with Camunda SaaS, but would fail with Keycloak in self-managed. The library now correctly encodes the request as x-www-form-urlencoded. See [#272](https://github.com/camunda/zeebe-client-node-js/issues/272) for more details. Thanks to [@AdrianErnstLGLN](https://github.com/AdrianErnstLGLN) for reporting this issue and providing a patch. # Version 8.0.3 @@ -201,7 +201,7 @@ _Things that were broken and are now fixed._ _Things that were broken and are now fixed._ -- Previously, the `fetchVariable` option passed to `createWorker` had no effect. All variables were always fetched by workers. This option setting is now respected, allowing you to constrain the variables fetched by workers. See [#264](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/264) for details. Thanks to [@Veckatimest](https://github.com/Veckatimest) for reporting this. +- Previously, the `fetchVariable` option passed to `createWorker` had no effect. All variables were always fetched by workers. This option setting is now respected, allowing you to constrain the variables fetched by workers. See [#264](https://github.com/camunda/zeebe-client-node-js/issues/264) for details. Thanks to [@Veckatimest](https://github.com/Veckatimest) for reporting this. # Version 8.0.2 @@ -209,7 +209,7 @@ _Things that were broken and are now fixed._ _Things that were broken and are now fixed._ -- Custom SSL certificates configured via environment variables now work correctly. See [PR #263](https://github.com/camunda-community-hub/zeebe-client-node-js/pull/263) for the details. Thanks to [@barmac](https://github.com/barmac) for the PR. +- Custom SSL certificates configured via environment variables now work correctly. See [PR #263](https://github.com/camunda/zeebe-client-node-js/pull/263) for the details. Thanks to [@barmac](https://github.com/barmac) for the PR. # Version 8.0.0 @@ -219,7 +219,7 @@ Version 8.0.0 is the release to support Camunda Platform 8. The semver change do _New shiny stuff._ -- Zeebe 8.0.0 and later support an optional retry backoff for failed jobs. This is a communication to the broker about how long it should delay before making the job available for activation again. This is implemented as a new interface for `job.fail`. See [[#248](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/248)] for more details. +- Zeebe 8.0.0 and later support an optional retry backoff for failed jobs. This is a communication to the broker about how long it should delay before making the job available for activation again. This is implemented as a new interface for `job.fail`. See [[#248](https://github.com/camunda/zeebe-client-node-js/issues/248)] for more details. # Version 2.4.0 @@ -227,13 +227,13 @@ _New shiny stuff._ _Changes in APIs or behaviour that may affect existing applications that use zeebe-node._ -- The C-based gRPC implementation has been removed in this release. It is unmaintained, and does not build with Node 17. The Zeebe Node client now uses the pure JS gRPC implementation and requires Node version 12.22.5+, 14.17.5+, or 16.6.1+. See [#201](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/201) and [#247](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/247) for more details. +- The C-based gRPC implementation has been removed in this release. It is unmaintained, and does not build with Node 17. The Zeebe Node client now uses the pure JS gRPC implementation and requires Node version 12.22.5+, 14.17.5+, or 16.6.1+. See [#201](https://github.com/camunda/zeebe-client-node-js/issues/201) and [#247](https://github.com/camunda/zeebe-client-node-js/issues/247) for more details. ## Known Issues _Things that don't work or don't work as expected, and which will be addressed in a future release_ -- The `onConnectionError` and `onReady` events do not work as expected. Applications that rely on these should not upgrade until this is fixed. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215). +- The `onConnectionError` and `onReady` events do not work as expected. Applications that rely on these should not upgrade until this is fixed. See [#215](https://github.com/camunda/zeebe-client-node-js/issues/215). # Version 1.3.5 @@ -241,8 +241,8 @@ _Things that don't work or don't work as expected, and which will be addressed i _Things that were broken and are now fixed._ -- Incident resolution via `ZBClient.resolveIncident()` now works. Thanks to [mrsateeshp](https://github.com/mrsateeshp) for the Pull Request. See [#242](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/242) for more details. -- Auth token retries now have an automatic back-off to avoid saturating the endpoint and getting blacklisted if invalid credentials are supplied. See [#244](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/244) for more details. +- Incident resolution via `ZBClient.resolveIncident()` now works. Thanks to [mrsateeshp](https://github.com/mrsateeshp) for the Pull Request. See [#242](https://github.com/camunda/zeebe-client-node-js/issues/242) for more details. +- Auth token retries now have an automatic back-off to avoid saturating the endpoint and getting blacklisted if invalid credentials are supplied. See [#244](https://github.com/camunda/zeebe-client-node-js/issues/244) for more details. # Version 1.3.3 @@ -250,13 +250,13 @@ _Things that were broken and are now fixed._ _Changes in APIs or behaviour that may affect existing applications that use zeebe-node._ -- Previously, you could pass an entire URL to the `clusterId` field in the `camundaCloud` option in the `ZBClient` constructor. The library would parse this and extract the cluster ID. With the changes to support multiple regions, this no longer works. From version 1.4.0, you must pass in only the cluster Id, not the complete URL. See [#232](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/232). +- Previously, you could pass an entire URL to the `clusterId` field in the `camundaCloud` option in the `ZBClient` constructor. The library would parse this and extract the cluster ID. With the changes to support multiple regions, this no longer works. From version 1.4.0, you must pass in only the cluster Id, not the complete URL. See [#232](https://github.com/camunda/zeebe-client-node-js/issues/232). ## New Features _New shiny stuff._ -- With Camunda Cloud 1.1, the DNS schema for the hosted service has been upgraded to include regions. To support this, the `camundaCloud` object in the ZBClient constructor now has an optional `clusterRegion` field. When no value is specified it defaults to `bru-2` (Belgium). See [#232](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/232). +- With Camunda Cloud 1.1, the DNS schema for the hosted service has been upgraded to include regions. To support this, the `camundaCloud` object in the ZBClient constructor now has an optional `clusterRegion` field. When no value is specified it defaults to `bru-2` (Belgium). See [#232](https://github.com/camunda/zeebe-client-node-js/issues/232). ## Chores @@ -271,7 +271,7 @@ _Things that shouldn't have a visible impact._ _Things that were broken and are now fixed._ -- Setting `maxRetries` and `maxRetryTimeout` in the ZBClient constructor had no effect. Only setting the environment variables `ZEEBE_CLIENT_MAX_RETRIES` and `ZEEBE_CLIENT_MAX_RETRY_TIMEOUT` had an effect. Now, the constructor options take effect. The constructor options will be overridden by the environment variables if those are set. See [#228](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/228). +- Setting `maxRetries` and `maxRetryTimeout` in the ZBClient constructor had no effect. Only setting the environment variables `ZEEBE_CLIENT_MAX_RETRIES` and `ZEEBE_CLIENT_MAX_RETRY_TIMEOUT` had an effect. Now, the constructor options take effect. The constructor options will be overridden by the environment variables if those are set. See [#228](https://github.com/camunda/zeebe-client-node-js/issues/228). # Version 1.3.1 @@ -279,7 +279,7 @@ _Things that were broken and are now fixed._ _Things that were broken and are now fixed._ -- The user agent was added to requests for an OAuth token, but not for gRPC calls. It is now set in the gRPC call metadata for all gRPC calls. Thanks to [@zelldon](https://github.com/Zelldon) for opening the issue and helping track it down. See [#225](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/225). +- The user agent was added to requests for an OAuth token, but not for gRPC calls. It is now set in the gRPC call metadata for all gRPC calls. Thanks to [@zelldon](https://github.com/Zelldon) for opening the issue and helping track it down. See [#225](https://github.com/camunda/zeebe-client-node-js/issues/225). # Version 1.3.0 @@ -291,22 +291,22 @@ Versions 1.0 - 1.2 were released two years ago, under the old numbering scheme. _Things that don't work or don't work as expected, and which will be addressed in a future release_ -- `onReady` and `onConnectionError` events are not firing reliably. At the moment, the `onConnectionError` is called even when a gateway is present and accessible, and `onReady` is not called. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215). -- The TLS connection does not work with self-managed Zeebe brokers secured with TLS. See [#218](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/218) and [#219](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/219). -- An exception in the gRPC layer can cause an application to exit. The workaround for this at the moment is to add a handler on the process for uncaught exceptions. See [#217](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/217). +- `onReady` and `onConnectionError` events are not firing reliably. At the moment, the `onConnectionError` is called even when a gateway is present and accessible, and `onReady` is not called. See [#215](https://github.com/camunda/zeebe-client-node-js/issues/215). +- The TLS connection does not work with self-managed Zeebe brokers secured with TLS. See [#218](https://github.com/camunda/zeebe-client-node-js/issues/218) and [#219](https://github.com/camunda/zeebe-client-node-js/issues/219). +- An exception in the gRPC layer can cause an application to exit. The workaround for this at the moment is to add a handler on the process for uncaught exceptions. See [#217](https://github.com/camunda/zeebe-client-node-js/issues/217). ## Breaking changes _Changes in APIs or behaviour that may affect existing applications that use zeebe-node._ -- The Zeebe API has changed in 1.0.0 and uses a gRPC protocol that is incompatible with pre-1.0.0 brokers. _The 1.0.0 package will not work with a pre-1.0.0 broker_. Nor will a pre-1.0.0 version of `zeebe-node` work with a 1.0.0 broker. See [#208](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/208). -- The worker task handler has a new type signature: `job => Promise`. This means that all code branches in the worker handler must return a `complete` method call (deprecated), or one of the new `job.complete`, `job.fail`, `job.error`, `job.forward`, or `job.cancelWorkflowInstance` methods. This signature means that the type system can now do an exhaustiveness check to detect code paths that will always time out in the worker. See [#210](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/210). +- The Zeebe API has changed in 1.0.0 and uses a gRPC protocol that is incompatible with pre-1.0.0 brokers. _The 1.0.0 package will not work with a pre-1.0.0 broker_. Nor will a pre-1.0.0 version of `zeebe-node` work with a 1.0.0 broker. See [#208](https://github.com/camunda/zeebe-client-node-js/issues/208). +- The worker task handler has a new type signature: `job => Promise`. This means that all code branches in the worker handler must return a `complete` method call (deprecated), or one of the new `job.complete`, `job.fail`, `job.error`, `job.forward`, or `job.cancelWorkflowInstance` methods. This signature means that the type system can now do an exhaustiveness check to detect code paths that will always time out in the worker. See [#210](https://github.com/camunda/zeebe-client-node-js/issues/210). ## Deprecations _Things that are deprecated and will be removed in a future release. Existing code will work for now, but should be migrated at some point. New code should not use these features._ -- The previous methods with the word `workflow` in them (e.g.: `deployWorkflow`, `startWorkflowInstance`) are deprecated. In the 1.0.0 package they transparently call the new methods with `process` in them (e.g.: `deployProcess`, `startProcessInstance`), so existing code does not need to be rewritten. However, new code should not use these deprecated methods. These methods are scheduled to be removed in whichever comes first: the 1.2.0 release, or three months from the release of the 1.0.0 release. See [#208](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/208). +- The previous methods with the word `workflow` in them (e.g.: `deployWorkflow`, `startWorkflowInstance`) are deprecated. In the 1.0.0 package they transparently call the new methods with `process` in them (e.g.: `deployProcess`, `startProcessInstance`), so existing code does not need to be rewritten. However, new code should not use these deprecated methods. These methods are scheduled to be removed in whichever comes first: the 1.2.0 release, or three months from the release of the 1.0.0 release. See [#208](https://github.com/camunda/zeebe-client-node-js/issues/208). - The `complete` parameter in the worker task handler callback is deprecated, and will be removed in a future release. Use the new methods on the `job` object instead. - The non-object constructors for `createWorker` are deprecated, and will be removed in a future release. Use the object constructor instead. @@ -314,9 +314,9 @@ _Things that are deprecated and will be removed in a future release. Existing co _New shiny stuff._ -- The worker task handler now has a new signature: `job => Promise`. The `complete` parameter is deprecated, and the job object now has the methods `job.complete`, `job.fail`, `job.error`, `job.forward`. See [#209](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/209). -- The `job` object has a new method `job.cancelWorkflowInstance`. This allows you to cancel a workflow from within a worker, and return a `Promise` in the worker handler. See [#211](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/211). -- Attempting to call two outcome methods on a job (for example: `job.complete()` and `job.fail()`, or the deprecated `complete.success()` and `complete.error()`) will now log an error to the console, alerting you to the behaviour and identifying the task type of the worker. See [#213](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/213). +- The worker task handler now has a new signature: `job => Promise`. The `complete` parameter is deprecated, and the job object now has the methods `job.complete`, `job.fail`, `job.error`, `job.forward`. See [#209](https://github.com/camunda/zeebe-client-node-js/issues/209). +- The `job` object has a new method `job.cancelWorkflowInstance`. This allows you to cancel a workflow from within a worker, and return a `Promise` in the worker handler. See [#211](https://github.com/camunda/zeebe-client-node-js/issues/211). +- Attempting to call two outcome methods on a job (for example: `job.complete()` and `job.fail()`, or the deprecated `complete.success()` and `complete.error()`) will now log an error to the console, alerting you to the behaviour and identifying the task type of the worker. See [#213](https://github.com/camunda/zeebe-client-node-js/issues/213). # Version 0.26.0 diff --git a/zeebe-extra/DEVELOP.md b/zeebe-extra/DEVELOP.md index 32472ffd..f42fd1fd 100644 --- a/zeebe-extra/DEVELOP.md +++ b/zeebe-extra/DEVELOP.md @@ -64,7 +64,7 @@ sudo apt install -y build-essential curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash source ~/.bashrc nvm install 14 -git clone https://github.com/camunda-community-hub/zeebe-client-node-js.git +git clone https://github.com/camunda/zeebe-client-node-js.git cd zeebe-client-node-js npm i diff --git a/zeebe-extra/package.json b/zeebe-extra/package.json index 063829be..893fe02d 100644 --- a/zeebe-extra/package.json +++ b/zeebe-extra/package.json @@ -18,13 +18,13 @@ "Uber", "Cadence" ], - "homepage": "https://camunda-community-hub.github.io/camunda-8-js-sdk/", + "homepage": "https://camunda.github.io/camunda-8-js-sdk/", "bugs": { - "url": "https://github.com/camunda-community-hub/camunda-8-js-sdk/issues" + "url": "https://github.com/camunda/camunda-8-js-sdk/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/camunda-community-hub/camunda-8-js-sdk.git" + "url": "git+https://github.com/camunda/camunda-8-js-sdk.git" }, "private": false, "publishConfig": { From 49f34eaf486609e6ddf180db30788c617f41cc85 Mon Sep 17 00:00:00 2001 From: Josh Wulf Date: Thu, 4 Apr 2024 17:59:45 +1300 Subject: [PATCH 2/3] ci(repo): remove lerna from commitlint --- .github/workflows/commitlint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index b3797e85..2a4222bf 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -25,10 +25,10 @@ jobs: run: npx commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.event.pull_request.head.sha }} --verbose - name: Run Prettier - run: lerna run prettify + run: npm run format - name: Run ESLint - run: lerna run lint + run: npm run lint - name: Commit and push if changes run: | From a34cb3953f0eaaefd15ff38128d31c8ff156e4c5 Mon Sep 17 00:00:00 2001 From: Josh Wulf Date: Thu, 4 Apr 2024 18:06:07 +1300 Subject: [PATCH 3/3] build(repo): remove workaround for lerna arch-specific issue --- .github/workflows/commitlint.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 2a4222bf..c888d052 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -15,9 +15,6 @@ jobs: with: node-version: "18" # Specify a Node.js version - - name: Remove package-lock.json # This is to work around https://github.com/npm/cli/issues/4828 - run: rm -f package-lock.json - - name: Install dependencies run: npm install @@ -40,7 +37,7 @@ jobs: git checkout ${{ github.head_ref }} # Add, commit, and push changes, ignoring package-lock.json - git diff --name-only | grep -v 'package-lock.json' | xargs git add + git diff --name-only | xargs git add git diff --staged --quiet || git commit -m "Apply Prettier formatting" git push origin ${{ github.head_ref }} env: