├── .gitignore ├── template ├── {.gitignore} ├── README.md ├── src │ ├── lib │ │ ├── colors.js │ │ ├── path.js │ │ ├── config.js │ │ └── asyncapi.js │ └── api │ │ ├── index.js │ │ ├── routes.js │ │ └── services │ │ └── $$channel$$.js ├── config │ └── common.yml ├── .editorconfig ├── Dockerfile ├── package.json ├── .eslintrc └── index.html ├── assets └── github-repobanner-nodewstemp.png ├── .eslintignore ├── NOTICE ├── .asyncapi-tool ├── .github └── workflows │ ├── scripts │ ├── README.md │ └── mailchimp │ │ ├── package.json │ │ ├── index.js │ │ ├── htmlContent.js │ │ └── package-lock.json │ ├── update-maintainers-trigger.yaml │ ├── automerge-for-humans-remove-ready-to-merge-label-on-edit.yml │ ├── autoupdate.yml │ ├── bump.yml │ ├── automerge.yml │ ├── please-take-a-look-command.yml │ ├── transfer-issue.yml │ ├── lint-pr-title.yml │ ├── stale-issues-prs.yml │ ├── automerge-orphans.yml │ ├── add-good-first-issue-labels.yml │ ├── if-nodejs-pr-testing.yml │ ├── help-command.yml │ ├── issues-prs-notifications.yml │ ├── if-nodejs-version-bump.yml │ ├── automerge-for-humans-merging.yml │ ├── welcome-first-time-contrib.yml │ ├── update-pr.yml │ ├── bounty-program-commands.yml │ ├── release-announcements.yml │ ├── automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml │ ├── if-nodejs-release.yml │ └── notify-tsc-members-mention.yml ├── CODEOWNERS ├── .releaserc ├── filters └── all.js ├── test ├── integration.test.js └── __snapshots__ │ └── integration.test.js.snap ├── .all-contributorsrc ├── .eslintrc ├── package.json ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT.md ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | output 4 | test/temp 5 | -------------------------------------------------------------------------------- /template/{.gitignore}: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | npm-debug.log 4 | -------------------------------------------------------------------------------- /template/README.md: -------------------------------------------------------------------------------- 1 | # {{ asyncapi.info().title() }} 2 | 3 | {{ asyncapi.info().description() | safe }} 4 | -------------------------------------------------------------------------------- /template/src/lib/colors.js: -------------------------------------------------------------------------------- 1 | module.exports.yellow = (text) => { 2 | return `\x1b[33m${text}\x1b[0m`; 3 | }; 4 | -------------------------------------------------------------------------------- /template/src/lib/path.js: -------------------------------------------------------------------------------- 1 | module.exports.pathParser = (path) => { 2 | return path.substr(0, path.length - '/.websocket'.length); 3 | }; -------------------------------------------------------------------------------- /assets/github-repobanner-nodewstemp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi/nodejs-ws-template/HEAD/assets/github-repobanner-nodewstemp.png -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test/temp 3 | template/src/api/routes.js 4 | template/src/api/services/$$channel$$.js 5 | template/src/lib/asyncapi.js 6 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2016-2025 AsyncAPI Initiative 2 | 3 | This product includes software developed at 4 | AsyncAPI Initiative (http://www.asyncapi.com/). -------------------------------------------------------------------------------- /template/config/common.yml: -------------------------------------------------------------------------------- 1 | default: 2 | port: {{ asyncapi.server(params.server).url() | port }} 3 | 4 | development: 5 | 6 | test: 7 | 8 | staging: 9 | 10 | production: 11 | -------------------------------------------------------------------------------- /.asyncapi-tool: -------------------------------------------------------------------------------- 1 | title: Node.js Websockets Template 2 | filters: 3 | language: javascript 4 | technology: 5 | - Node.js 6 | categories: 7 | - generator-template 8 | hasCommercial: false -------------------------------------------------------------------------------- /.github/workflows/scripts/README.md: -------------------------------------------------------------------------------- 1 | The entire `scripts` directory is centrally managed in [.github](https://github.com/asyncapi/.github/) repository. Any changes in this folder should be done in central repository. -------------------------------------------------------------------------------- /template/src/lib/config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const yamlConfig = require('node-yaml-config'); 3 | 4 | const config = yamlConfig.load(path.join(__dirname, '../../config/common.yml')); 5 | 6 | module.exports = config; 7 | -------------------------------------------------------------------------------- /template/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | indent_style = space 9 | indent_size = 2 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /template/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine 2 | 3 | # Create app directory 4 | RUN mkdir -p /usr/src/app 5 | WORKDIR /usr/src/app 6 | 7 | # Install app dependencies 8 | COPY package.json /usr/src/app/ 9 | RUN npm install 10 | 11 | # Copy app source 12 | COPY . /usr/src/app 13 | 14 | CMD [ "npm", "start" ] 15 | -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schedule-email", 3 | "description": "This code is responsible for scheduling an email campaign. This file is centrally managed in https://github.com/asyncapi/.github/", 4 | "license": "Apache 2.0", 5 | "dependencies": { 6 | "@actions/core": "1.6.0", 7 | "@mailchimp/mailchimp_marketing": "3.0.74" 8 | } 9 | } -------------------------------------------------------------------------------- /template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ asyncapi.info().title() | kebabCase }}", 3 | "description": "{{ asyncapi.info().description() | oneLine }}", 4 | "version": "{{ asyncapi.info().version() }}", 5 | "scripts": { 6 | "start": "node src/api/index.js" 7 | }, 8 | "dependencies": { 9 | "@asyncapi/parser": "^3.4.0", 10 | "express": "4.19.2", 11 | "express-ws": "4.0.0", 12 | "node-yaml-config": "1.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This file provides an overview of code owners in this repository. 2 | 3 | # Each line is a file pattern followed by one or more owners. 4 | # The last matching pattern has the most precedence. 5 | # For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/. 6 | 7 | # The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file. 8 | * @fmvilas @derberg @asyncapi-bot-eve 9 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | --- 2 | branches: 3 | - master 4 | # by default release workflow reacts on push not only to master. 5 | #This is why out of the box sematic release is configured for all these branches 6 | - name: next-spec 7 | prerelease: true 8 | - name: next-major 9 | prerelease: true 10 | - name: next-major-spec 11 | prerelease: true 12 | - name: beta 13 | prerelease: true 14 | - name: alpha 15 | prerelease: true 16 | - name: next 17 | prerelease: true 18 | plugins: 19 | - - "@semantic-release/commit-analyzer" 20 | - preset: conventionalcommits 21 | - - "@semantic-release/release-notes-generator" 22 | - preset: conventionalcommits 23 | - "@semantic-release/npm" 24 | - "@semantic-release/github" 25 | -------------------------------------------------------------------------------- /template/src/api/index.js: -------------------------------------------------------------------------------- 1 | const app = require('express')(); 2 | require('express-ws')(app); 3 | const config = require('../lib/config'); 4 | const routes = require('./routes'); 5 | const asyncapi = require('../lib/asyncapi'); 6 | 7 | const start = async () => { 8 | //you have access to parsed AsyncAPI document in the runtime with asyncapi.get() 9 | await asyncapi.init(); 10 | 11 | app.use(routes); 12 | 13 | app.use((req, res, next) => { 14 | res.status(404).send('Error: path not found'); 15 | next(); 16 | }); 17 | 18 | app.use((err, req, res, next) => { 19 | console.error(err); 20 | next(); 21 | }); 22 | 23 | app.listen(config.port); 24 | console.info(`Listening on port ${config.port}`); 25 | }; 26 | 27 | start(); 28 | -------------------------------------------------------------------------------- /template/src/lib/asyncapi.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { Parser } = require('@asyncapi/parser'); 4 | 5 | const parser = new Parser(); 6 | 7 | let cached; 8 | 9 | module.exports.init = async () => { 10 | if (cached) return; 11 | 12 | let content; 13 | 14 | try { 15 | content = fs.readFileSync(path.resolve(__dirname, '../../asyncapi.yaml'), { encoding: 'utf8' }); 16 | } catch (e) { 17 | try { 18 | content = fs.readFileSync(path.resolve(__dirname, '../../asyncapi.json'), { encoding: 'utf8' }); 19 | } catch (err) { 20 | throw new Error('Coud not find asyncapi.yaml or asyncapi.json file in the root directory of the project.'); 21 | } 22 | } 23 | 24 | try { 25 | cached = await parser.parse(content); 26 | } catch (e) { 27 | throw e; 28 | } 29 | 30 | return cached; 31 | }; 32 | 33 | module.exports.get = () => cached; 34 | -------------------------------------------------------------------------------- /template/src/api/routes.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const { Router } = require('express'); 3 | const { pathParser } = require('../lib/path'); 4 | const { yellow } = require('../lib/colors'); 5 | {%- for channelName, channel in asyncapi.channels() -%} 6 | {% set allOperationIds = channel | getOperationIds %} 7 | const { {{ allOperationIds }} } = require('./services/{{ channelName | kebabCase }}'); 8 | {%- endfor %} 9 | const router = Router(); 10 | module.exports = router; 11 | {% for channelName, channel in asyncapi.channels() -%} 12 | router.ws('{{channelName | pathResolve}}', async (ws, req) => { 13 | const path = pathParser(req.path); 14 | console.log(`${yellow(path)} client connected.`); 15 | {%- if channel.hasSubscribe() %} 16 | await {{ channel.subscribe().id() }}(ws); 17 | {%- endif %} 18 | 19 | {%- if channel.hasPublish() %} 20 | ws.on('message', async (msg) => { 21 | console.log(`${yellow(path)} message was received:`); 22 | console.log(util.inspect(msg, { depth: null, colors: true })); 23 | await {{ channel.publish().id() }}(ws, { message: msg, path, query: req.query }); 24 | }); 25 | {%- endif %} 26 | }); 27 | {% endfor -%} 28 | 29 | -------------------------------------------------------------------------------- /filters/all.js: -------------------------------------------------------------------------------- 1 | 2 | const filter = module.exports; 3 | const URL = require('url'); 4 | const path = require('path'); 5 | 6 | function port(url, defaultPort) { 7 | const parsed = URL.parse(url); 8 | return parsed.port || defaultPort || 80; 9 | } 10 | filter.port = port; 11 | 12 | function pathResolve(pathName, basePath = '/') { 13 | if (pathName.startsWith('/')) { 14 | return pathName; 15 | } 16 | 17 | path.resolve(basePath,pathName); 18 | } 19 | filter.pathResolve = pathResolve; 20 | 21 | /* 22 | * returns comma separated string of all operationIds of a given channel 23 | */ 24 | const parseOperationId = (channel, opName) => { 25 | const id = opName === 'subscribe' ? channel.subscribe().id() : channel.publish().id(); 26 | if (!id) throw new Error('This template requires operationId to be set in every operation.'); 27 | return id; 28 | }; 29 | 30 | function getOperationIds(channel) { 31 | const list = []; 32 | if (channel.hasSubscribe()) { 33 | list.push(parseOperationId(channel, 'subscribe')); 34 | } 35 | if (channel.hasPublish()) { 36 | list.push(parseOperationId(channel, 'publish')); 37 | } 38 | return list.filter(Boolean).join(', '); 39 | } 40 | filter.getOperationIds = getOperationIds; 41 | -------------------------------------------------------------------------------- /.github/workflows/update-maintainers-trigger.yaml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Trigger MAINTAINERS.yaml file update 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | paths: 10 | # Check all valid CODEOWNERS locations: 11 | # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location 12 | - 'CODEOWNERS' 13 | - '.github/CODEOWNERS' 14 | - '.docs/CODEOWNERS' 15 | 16 | jobs: 17 | trigger-maintainers-update: 18 | name: Trigger updating MAINTAINERS.yaml because of CODEOWNERS change 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | - name: Repository Dispatch 23 | uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # https://github.com/peter-evans/repository-dispatch/releases/tag/v3.0.0 24 | with: 25 | # The PAT with the 'public_repo' scope is required 26 | token: ${{ secrets.GH_TOKEN }} 27 | repository: ${{ github.repository_owner }}/community 28 | event-type: trigger-maintainers-update 29 | -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # Defence from evil contributor that after adding `ready-to-merge` all suddenly makes evil commit or evil change in PR title 5 | # Label is removed once above action is detected 6 | name: Remove ready-to-merge label 7 | 8 | on: 9 | pull_request_target: 10 | types: 11 | - synchronize 12 | - edited 13 | 14 | jobs: 15 | remove-ready-label: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Remove label 19 | uses: actions/github-script@v7 20 | with: 21 | github-token: ${{ secrets.GH_TOKEN }} 22 | script: | 23 | const labelToRemove = 'ready-to-merge'; 24 | const labels = context.payload.pull_request.labels; 25 | const isLabelPresent = labels.some(label => label.name === labelToRemove) 26 | if(!isLabelPresent) return; 27 | github.rest.issues.removeLabel({ 28 | issue_number: context.issue.number, 29 | owner: context.repo.owner, 30 | repo: context.repo.repo, 31 | name: labelToRemove 32 | }) 33 | -------------------------------------------------------------------------------- /.github/workflows/autoupdate.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # This workflow is designed to work with: 5 | # - autoapprove and automerge workflows for dependabot and asyncapibot. 6 | # - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against 7 | 8 | # It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. 9 | # Autoupdating to latest destination branch works only in the context of upstream repo and not forks 10 | 11 | name: autoupdate 12 | 13 | on: 14 | push: 15 | branches-ignore: 16 | - 'version-bump/**' 17 | - 'dependabot/**' 18 | - 'bot/**' 19 | - 'all-contributors/**' 20 | 21 | jobs: 22 | autoupdate-for-bot: 23 | if: startsWith(github.repository, 'asyncapi/') 24 | name: Autoupdate autoapproved PR created in the upstream 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Autoupdating 28 | uses: docker://chinthakagodawita/autoupdate-action:v1 29 | env: 30 | GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' 31 | PR_FILTER: "labelled" 32 | PR_LABELS: "autoupdate" 33 | PR_READY_STATE: "ready_for_review" 34 | MERGE_CONFLICT_ACTION: "ignore" 35 | -------------------------------------------------------------------------------- /template/src/api/services/$$channel$$.js: -------------------------------------------------------------------------------- 1 | const service = module.exports = {}; 2 | {% if channel.hasSubscribe() %} 3 | /** 4 | * {{ channel.subscribe().summary() }} 5 | * @param {object} ws WebSocket connection. 6 | */ 7 | service.{{ channel.subscribe().id() }} = async (ws) => { 8 | ws.send('Message from the server: Implement here your business logic that sends messages to a client after it connects.'); 9 | }; 10 | 11 | {%- endif %} 12 | {%- if channel.hasPublish() %} 13 | /** 14 | * {{ channel.publish().summary() }} 15 | * @param {object} ws WebSocket connection. 16 | * @param {object} options 17 | * @param {string} options.path The path in which the message was received. 18 | * @param {object} options.query The query parameters used when connecting to the server. 19 | * @param {%raw%}{{%endraw%}{{channel.publish().message(0).payload().type()}}{%raw%}}{%endraw%} options.message The received message. 20 | {%- if channel.publish().message(0).headers() %} 21 | {%- for fieldName, field in channel.publish().message(0).headers().properties() %} 22 | {{ field | docline(fieldName, 'options.message.headers') }} 23 | {%- endfor %} 24 | {%- endif %} 25 | {%- if channel.publish().message(0).payload() %} 26 | {%- for fieldName, field in channel.publish().message(0).payload().properties() %} 27 | {{ field | docline(fieldName, 'options.message.payload') }} 28 | {%- endfor %} 29 | {%- endif %} 30 | */ 31 | service.{{ channel.publish().id() }} = async (ws, { message, path, query }) => { 32 | ws.send('Message from the server: Implement here your business logic that reacts on messages sent from a client.'); 33 | }; 34 | 35 | {%- endif %} 36 | -------------------------------------------------------------------------------- /test/integration.test.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const Generator = require('@asyncapi/generator'); 3 | const {readFile} = require('fs').promises; 4 | const fetch = require('node-fetch'); 5 | const console = require('console'); 6 | 7 | const MAIN_TEST_RESULT_PATH = path.join('test', 'temp', ' integrationTestResult'); 8 | const URL = 'https://raw.githubusercontent.com/asyncapi/generator/master/apps/generator/test/docs/ws.yml'; 9 | 10 | describe('template integration test using generator', () => { 11 | const generateFolderName = () => { 12 | return path.resolve(MAIN_TEST_RESULT_PATH, Date.now().toString()); 13 | }; 14 | 15 | jest.setTimeout(30000); 16 | 17 | it('should generate application files ', async () => { 18 | const outputDir = generateFolderName(); 19 | const asyncapiFile = await fetch(URL); 20 | if (!asyncapiFile.ok) throw new Error('Failed to fetch the AsyncAPI file'); 21 | 22 | const params = { 23 | server: 'localhost' 24 | }; 25 | const generator = new Generator(path.normalize('./'), outputDir, { 26 | forceWrite: true, 27 | templateParams: params 28 | }); 29 | console.log(outputDir); 30 | await generator.generateFromString(await asyncapiFile.text()); 31 | const expectedFiles = [ 32 | 'src/api/index.js', 33 | 'src/api/routes.js', 34 | 'src/lib/asyncapi.js', 35 | 'src/lib/colors.js', 36 | 'src/lib/config.js', 37 | 'src/lib/path.js' 38 | ]; 39 | 40 | for (const index in expectedFiles) { 41 | const file = await readFile(path.join(outputDir, expectedFiles[index]), 'utf8'); 42 | expect(file).toMatchSnapshot(); 43 | } 44 | }); 45 | }); -------------------------------------------------------------------------------- /template/.eslintrc: -------------------------------------------------------------------------------- 1 | extends: 'eslint:recommended' 2 | 3 | parserOptions: 4 | ecmaVersion: 8 5 | 6 | env: 7 | node: true 8 | es6: true 9 | 10 | rules: 11 | # Possible Errors 12 | no-console: 0 13 | valid-jsdoc: [0, {requireReturn: false, requireParamDescription: false, requireReturnDescription: false}] 14 | 15 | # Best Practices 16 | consistent-return: 0 17 | curly: 0 18 | block-scoped-var: 2 19 | no-else-return: 2 20 | no-process-env: 2 21 | no-self-compare: 2 22 | no-throw-literal: 2 23 | no-void: 2 24 | radix: 2 25 | wrap-iife: [2, outside] 26 | 27 | # Variables 28 | no-shadow: 0 29 | no-use-before-define: [2, nofunc] 30 | 31 | # Node.js 32 | no-process-exit: 0 33 | handle-callback-err: [2, err] 34 | no-new-require: 2 35 | no-path-concat: 2 36 | 37 | # Stylistic Issues 38 | quotes: [2, single] 39 | camelcase: 0 40 | indent: [2, 2] 41 | no-lonely-if: 2 42 | no-floating-decimal: 2 43 | brace-style: [2, 1tbs, { "allowSingleLine": true }] 44 | comma-style: [2, last] 45 | consistent-this: [0, self] 46 | func-style: 0 47 | max-nested-callbacks: 0 48 | new-cap: 2 49 | no-multiple-empty-lines: [2, {max: 1}] 50 | no-nested-ternary: 2 51 | semi-spacing: [2, {before: false, after: true}] 52 | operator-assignment: [2, always] 53 | padded-blocks: [2, never] 54 | quote-props: [2, as-needed] 55 | space-before-function-paren: [2, always] 56 | keyword-spacing: [2, {"before": true, "after": true}] 57 | space-before-blocks: [2, always] 58 | array-bracket-spacing: [2, never] 59 | computed-property-spacing: [2, never] 60 | space-in-parens: [2, never] 61 | space-unary-ops: [2, {words: true, nonwords: false}] 62 | #spaced-line-comment: [2, always] 63 | wrap-regex: 2 64 | linebreak-style: [2, unix] 65 | semi: [2, always] 66 | 67 | # ECMAScript 6 68 | arrow-spacing: [2, {before: true, after: true}] 69 | no-class-assign: 2 70 | no-const-assign: 2 71 | no-dupe-class-members: 2 72 | no-this-before-super: 2 73 | no-var: 2 74 | object-shorthand: [2, always] 75 | prefer-arrow-callback: 2 76 | prefer-const: 2 77 | prefer-spread: 2 78 | prefer-template: 2 79 | -------------------------------------------------------------------------------- /template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ asyncapi.info().title() }} 5 | 6 | 7 | 8 | 9 | 10 |

Open your browser console to see the logs and details of API you can use to talk to the server.

11 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.github/workflows/bump.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # Purpose of this action is to update npm package in libraries that use it. It is like dependabot for asyncapi npm modules only. 5 | # It runs in a repo after merge of release commit and searches for other packages that use released package. Every found package gets updated with lates version 6 | 7 | name: Bump package version in dependent repos - if Node project 8 | 9 | on: 10 | # It cannot run on release event as when release is created then version is not yet bumped in package.json 11 | # This means we cannot extract easily latest version and have a risk that package is not yet on npm 12 | push: 13 | branches: 14 | - master 15 | 16 | jobs: 17 | bump-in-dependent-projects: 18 | name: Bump this package in repositories that depend on it 19 | if: startsWith(github.event.commits[0].message, 'chore(release):') 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout repo 23 | uses: actions/checkout@v4 24 | - name: Check if Node.js project and has package.json 25 | id: packagejson 26 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 27 | - name: Setup corepack with pnpm and yarn 28 | if: steps.packagejson.outputs.exists == 'true' 29 | run: corepack enable 30 | - if: steps.packagejson.outputs.exists == 'true' 31 | name: Bumping latest version of this package in other repositories 32 | uses: derberg/npm-dependency-manager-for-your-github-org@f95b99236e8382a210042d8cfb84f42584e29c24 # using v6.2.0.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6.2.0 33 | with: 34 | github_token: ${{ secrets.GH_TOKEN }} 35 | committer_username: asyncapi-bot 36 | committer_email: info@asyncapi.io 37 | repos_to_ignore: spec,bindings,saunter,server-api 38 | custom_id: "dependency update from asyncapi bot" 39 | search: "true" 40 | ignore_paths: .github/workflows 41 | -------------------------------------------------------------------------------- /.github/workflows/automerge.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo. 3 | 4 | name: Automerge PRs from bots 5 | 6 | on: 7 | pull_request_target: 8 | types: 9 | - opened 10 | - synchronize 11 | 12 | jobs: 13 | autoapprove-for-bot: 14 | name: Autoapprove PR comming from a bot 15 | if: > 16 | contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]"]'), github.event.pull_request.user.login) && 17 | contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]"]'), github.actor) && 18 | !contains(github.event.pull_request.labels.*.name, 'released') 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Autoapproving 22 | uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1 is used https://github.com/hmarr/auto-approve-action/releases/tag/v3.2.1 23 | with: 24 | github-token: "${{ secrets.GH_TOKEN_BOT_EVE }}" 25 | 26 | - name: Label autoapproved 27 | uses: actions/github-script@v7 28 | with: 29 | github-token: ${{ secrets.GH_TOKEN }} 30 | script: | 31 | github.rest.issues.addLabels({ 32 | issue_number: context.issue.number, 33 | owner: context.repo.owner, 34 | repo: context.repo.repo, 35 | labels: ['autoapproved', 'autoupdate'] 36 | }) 37 | 38 | automerge-for-bot: 39 | name: Automerge PR autoapproved by a bot 40 | needs: [autoapprove-for-bot] 41 | runs-on: ubuntu-latest 42 | steps: 43 | - name: Automerging 44 | uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 45 | env: 46 | GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" 47 | GITHUB_LOGIN: asyncapi-bot 48 | MERGE_LABELS: "!do-not-merge" 49 | MERGE_METHOD: "squash" 50 | MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})" 51 | MERGE_RETRIES: "20" 52 | MERGE_RETRY_SLEEP: "30000" 53 | -------------------------------------------------------------------------------- /.github/workflows/please-take-a-look-command.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # It uses Github actions to listen for comments on issues and pull requests and 5 | # if the comment contains /please-take-a-look or /ptal it will add a comment pinging 6 | # the code-owners who are reviewers for PR 7 | 8 | name: Please take a Look 9 | 10 | on: 11 | issue_comment: 12 | types: [created] 13 | 14 | jobs: 15 | ping-for-attention: 16 | if: > 17 | github.event.issue.pull_request && 18 | github.event.issue.state != 'closed' && 19 | github.actor != 'asyncapi-bot' && 20 | ( 21 | contains(github.event.comment.body, '/please-take-a-look') || 22 | contains(github.event.comment.body, '/ptal') || 23 | contains(github.event.comment.body, '/PTAL') 24 | ) 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Check for Please Take a Look Command 28 | uses: actions/github-script@v7 29 | with: 30 | github-token: ${{ secrets.GH_TOKEN }} 31 | script: | 32 | const prDetailsUrl = context.payload.issue.pull_request.url; 33 | const { data: pull } = await github.request(prDetailsUrl); 34 | const reviewers = pull.requested_reviewers.map(reviewer => reviewer.login); 35 | 36 | const { data: reviews } = await github.rest.pulls.listReviews({ 37 | owner: context.repo.owner, 38 | repo: context.repo.repo, 39 | pull_number: context.issue.number 40 | }); 41 | 42 | const reviewersWhoHaveReviewed = reviews.map(review => review.user.login); 43 | 44 | const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); 45 | 46 | if (reviewersWhoHaveNotReviewed.length > 0) { 47 | const comment = reviewersWhoHaveNotReviewed.filter(reviewer => reviewer !== 'asyncapi-bot-eve' ).map(reviewer => `@${reviewer}`).join(' '); 48 | await github.rest.issues.createComment({ 49 | issue_number: context.issue.number, 50 | owner: context.repo.owner, 51 | repo: context.repo.repo, 52 | body: `${comment} Please take a look at this PR. Thanks! :wave:` 53 | }); 54 | } 55 | -------------------------------------------------------------------------------- /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "nodejs-ws-template", 3 | "projectOwner": "asyncapi", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "files": [ 7 | "README.md" 8 | ], 9 | "imageSize": 100, 10 | "commit": false, 11 | "commitConvention": "angular", 12 | "contributors": [ 13 | { 14 | "login": "fmvilas", 15 | "name": "Fran Méndez", 16 | "avatar_url": "https://avatars.githubusercontent.com/u/242119?v=4", 17 | "profile": "http://www.fmvilas.com/", 18 | "contributions": [ 19 | "code", 20 | "ideas" 21 | ] 22 | }, 23 | { 24 | "login": "derberg", 25 | "name": "Lukasz Gornicki", 26 | "avatar_url": "https://avatars.githubusercontent.com/u/6995927?v=4", 27 | "profile": "https://dev.to/derberg", 28 | "contributions": [ 29 | "infra", 30 | "code", 31 | "review", 32 | "maintenance", 33 | "doc", 34 | "blog" 35 | ] 36 | }, 37 | { 38 | "login": "aayushmau5", 39 | "name": "Aayush Kumar Sahu", 40 | "avatar_url": "https://avatars.githubusercontent.com/u/54525741?v=4", 41 | "profile": "https://aayushsahu.com", 42 | "contributions": [ 43 | "security" 44 | ] 45 | }, 46 | { 47 | "login": "KatrinaAS", 48 | "name": "Katrina Knight", 49 | "avatar_url": "https://avatars.githubusercontent.com/u/690546?v=4", 50 | "profile": "https://github.com/KatrinaAS", 51 | "contributions": [ 52 | "infra" 53 | ] 54 | }, 55 | { 56 | "login": "RageZBla", 57 | "name": "Olivier Lechevalier", 58 | "avatar_url": "https://avatars.githubusercontent.com/u/1196871?v=4", 59 | "profile": "https://github.com/RageZBla", 60 | "contributions": [ 61 | "code" 62 | ] 63 | }, 64 | { 65 | "login": "Krishks369", 66 | "name": "Krishna Kumar S", 67 | "avatar_url": "https://avatars.githubusercontent.com/u/71367204?v=4", 68 | "profile": "https://github.com/Krishks369", 69 | "contributions": [ 70 | "test" 71 | ] 72 | }, 73 | { 74 | "login": "ivankahl", 75 | "name": "Ivan Kahl", 76 | "avatar_url": "https://avatars.githubusercontent.com/u/5931577?v=4", 77 | "profile": "http://ivankahl.com/", 78 | "contributions": [ 79 | "code", 80 | "test" 81 | ] 82 | } 83 | ], 84 | "contributorsPerLine": 7, 85 | "skipCi": false 86 | } 87 | -------------------------------------------------------------------------------- /.github/workflows/transfer-issue.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Transfer Issues between repositories 5 | 6 | on: 7 | issue_comment: 8 | types: 9 | - created 10 | 11 | permissions: 12 | issues: write 13 | 14 | jobs: 15 | transfer: 16 | if: ${{(!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot') && (startsWith(github.event.comment.body, '/transfer-issue') || startsWith(github.event.comment.body, '/ti'))}} 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout Repository 20 | uses: actions/checkout@v4 21 | - name: Extract Input 22 | id: extract_step 23 | env: 24 | COMMENT: "${{ github.event.comment.body }}" 25 | run: | 26 | REPO=$(echo "$COMMENT" | awk '{print $2}') 27 | echo "repo=$REPO" >> $GITHUB_OUTPUT 28 | - name: Check Repo 29 | uses: actions/github-script@v7 30 | with: 31 | github-token: ${{secrets.GH_TOKEN}} 32 | script: | 33 | const r = "${{github.repository}}" 34 | const [owner, repo] = r.split('/') 35 | const repoToMove = process.env.REPO_TO_MOVE 36 | const issue_number = context.issue.number 37 | try { 38 | const {data} = await github.rest.repos.get({ 39 | owner, 40 | repo: repoToMove 41 | }) 42 | }catch (e) { 43 | const body = `${repoToMove} is not a repo under ${owner}. You can only transfer issue to repos that belong to the same organization.` 44 | await github.rest.issues.createComment({ 45 | owner, 46 | repo, 47 | issue_number, 48 | body 49 | }) 50 | process.exit(1) 51 | } 52 | env: 53 | REPO_TO_MOVE: ${{steps.extract_step.outputs.repo}} 54 | - name: Transfer Issue 55 | id: transferIssue 56 | working-directory: ./ 57 | run: | 58 | gh issue transfer "$ISSUE_NUMBER" "asyncapi/$REPO_NAME" 59 | env: 60 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 61 | ISSUE_NUMBER: ${{ github.event.issue.number }} 62 | REPO_NAME: ${{ steps.extract_step.outputs.repo }} 63 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | node: true 3 | es6: true 4 | jest/globals: true 5 | 6 | plugins: 7 | - jest 8 | - sonarjs 9 | 10 | extends: 11 | - plugin:sonarjs/recommended 12 | 13 | parserOptions: 14 | ecmaVersion: 2018 15 | 16 | rules: 17 | # Ignore Rules 18 | strict: 0 19 | no-underscore-dangle: 0 20 | no-mixed-requires: 0 21 | no-process-exit: 0 22 | no-warning-comments: 0 23 | curly: 0 24 | no-multi-spaces: 0 25 | no-alert: 0 26 | consistent-return: 0 27 | consistent-this: [0, self] 28 | func-style: 0 29 | max-nested-callbacks: 0 30 | camelcase: 0 31 | 32 | # Warnings 33 | no-debugger: 1 34 | no-empty: 1 35 | no-invalid-regexp: 1 36 | no-unused-expressions: 1 37 | no-native-reassign: 1 38 | no-fallthrough: 1 39 | sonarjs/cognitive-complexity: 1 40 | 41 | # Errors 42 | eqeqeq: 2 43 | no-undef: 2 44 | no-dupe-keys: 2 45 | no-empty-character-class: 2 46 | no-self-compare: 2 47 | valid-typeof: 2 48 | no-unused-vars: [2, { "args": "none" }] 49 | handle-callback-err: 2 50 | no-shadow-restricted-names: 2 51 | no-new-require: 2 52 | no-mixed-spaces-and-tabs: 2 53 | block-scoped-var: 2 54 | no-else-return: 2 55 | no-throw-literal: 2 56 | no-void: 2 57 | radix: 2 58 | wrap-iife: [2, outside] 59 | no-shadow: 0 60 | no-use-before-define: [2, nofunc] 61 | no-path-concat: 2 62 | valid-jsdoc: [0, {requireReturn: false, requireParamDescription: false, requireReturnDescription: false}] 63 | 64 | # stylistic errors 65 | no-spaced-func: 2 66 | semi-spacing: 2 67 | quotes: [2, 'single'] 68 | key-spacing: [2, { beforeColon: false, afterColon: true }] 69 | indent: [2, 2] 70 | no-lonely-if: 2 71 | no-floating-decimal: 2 72 | brace-style: [2, 1tbs, { allowSingleLine: true }] 73 | comma-style: [2, last] 74 | no-multiple-empty-lines: [2, {max: 1}] 75 | no-nested-ternary: 2 76 | operator-assignment: [2, always] 77 | padded-blocks: [2, never] 78 | quote-props: [2, as-needed] 79 | keyword-spacing: [2, {'before': true, 'after': true, 'overrides': {}}] 80 | space-before-blocks: [2, always] 81 | array-bracket-spacing: [2, never] 82 | computed-property-spacing: [2, never] 83 | space-in-parens: [2, never] 84 | space-unary-ops: [2, {words: true, nonwords: false}] 85 | wrap-regex: 2 86 | linebreak-style: 0 87 | semi: [2, always] 88 | arrow-spacing: [2, {before: true, after: true}] 89 | no-class-assign: 2 90 | no-const-assign: 2 91 | no-dupe-class-members: 2 92 | no-this-before-super: 2 93 | no-var: 2 94 | object-shorthand: [2, always] 95 | prefer-arrow-callback: 2 96 | prefer-const: 2 97 | prefer-spread: 2 98 | prefer-template: 2 -------------------------------------------------------------------------------- /.github/workflows/lint-pr-title.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Lint PR title 5 | 6 | on: 7 | pull_request_target: 8 | types: [opened, reopened, synchronize, edited, ready_for_review] 9 | 10 | jobs: 11 | lint-pr-title: 12 | name: Lint PR title 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Since this workflow is REQUIRED for a PR to be mergable, we have to have this 'if' statement in step level instead of job level. 16 | - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} 17 | uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 #version 5.2.0 https://github.com/amannn/action-semantic-pull-request/releases/tag/v5.2.0 18 | id: lint_pr_title 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} 21 | with: 22 | subjectPattern: ^(?![A-Z]).+$ 23 | subjectPatternError: | 24 | The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. 25 | 26 | # Comments the error message from the above lint_pr_title action 27 | - if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor)}} 28 | name: Comment on PR 29 | uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 30 | with: 31 | header: pr-title-lint-error 32 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} 33 | message: | 34 | 35 | We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). 36 | More details 👇🏼 37 | ``` 38 | ${{ steps.lint_pr_title.outputs.error_message}} 39 | ``` 40 | # deletes the error comment if the title is correct 41 | - if: ${{ steps.lint_pr_title.outputs.error_message == null }} 42 | name: delete the comment 43 | uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 44 | with: 45 | header: pr-title-lint-error 46 | delete: true 47 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} 48 | -------------------------------------------------------------------------------- /.github/workflows/stale-issues-prs.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Manage stale issues and PRs 5 | 6 | on: 7 | schedule: 8 | - cron: "0 0 * * *" 9 | 10 | jobs: 11 | stale: 12 | if: startsWith(github.repository, 'asyncapi/') 13 | name: Mark issue or PR as stale 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 #v9.1.0 but pointing to commit for security reasons 17 | with: 18 | repo-token: ${{ secrets.GITHUB_TOKEN }} 19 | stale-issue-message: | 20 | This issue has been automatically marked as stale because it has not had recent activity :sleeping: 21 | 22 | It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. 23 | 24 | There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under [open governance model](https://github.com/asyncapi/community/blob/master/CHARTER.md). 25 | 26 | Let us figure out together how to push this issue forward. Connect with us through [one of many communication channels](https://github.com/asyncapi/community/issues/1) we established here. 27 | 28 | Thank you for your patience :heart: 29 | stale-pr-message: | 30 | This pull request has been automatically marked as stale because it has not had recent activity :sleeping: 31 | 32 | It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. 33 | 34 | There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under [open governance model](https://github.com/asyncapi/community/blob/master/CHARTER.md). 35 | 36 | Let us figure out together how to push this pull request forward. Connect with us through [one of many communication channels](https://github.com/asyncapi/community/issues/1) we established here. 37 | 38 | Thank you for your patience :heart: 39 | days-before-stale: 120 40 | days-before-close: 120 41 | stale-issue-label: stale 42 | stale-pr-label: stale 43 | exempt-issue-labels: keep-open 44 | exempt-pr-labels: keep-open 45 | close-issue-reason: not_planned 46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@asyncapi/nodejs-ws-template", 3 | "version": "0.10.0", 4 | "description": "Node.js WebSockets template for AsyncAPI generator.", 5 | "keywords": [ 6 | "asyncapi", 7 | "generator", 8 | "nodejs", 9 | "websockets", 10 | "ws", 11 | "template" 12 | ], 13 | "author": "Fran Mendez (fmvilas.com)", 14 | "license": "Apache-2.0", 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/asyncapi/nodejs-ws-template.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/asyncapi/nodejs-ws-template/issues" 21 | }, 22 | "homepage": "https://github.com/asyncapi/nodejs-ws-template#readme", 23 | "scripts": { 24 | "release": "semantic-release", 25 | "lint": "eslint --max-warnings 0 --config .eslintrc .", 26 | "lint:fix": "eslint --fix --ext .js,.jsx .", 27 | "generate:assets": "npm run generate:readme:toc", 28 | "generate:readme:toc": "markdown-toc -i README.md", 29 | "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", 30 | "test": "rimraf test/temp && jest" 31 | }, 32 | "publishConfig": { 33 | "access": "public" 34 | }, 35 | "dependencies": { 36 | "@asyncapi/generator-filters": "^2.1.0", 37 | "@asyncapi/generator-hooks": "^0.1.0" 38 | }, 39 | "devDependencies": { 40 | "@asyncapi/generator": "^1.9.17", 41 | "@semantic-release/commit-analyzer": "^8.0.1", 42 | "@semantic-release/github": "^7.0.4", 43 | "@semantic-release/npm": "^7.0.3", 44 | "@semantic-release/release-notes-generator": "^9.0.1", 45 | "conventional-changelog-conventionalcommits": "^4.2.3", 46 | "eslint": "^8.6.0", 47 | "eslint-plugin-jest": "^25.3.4", 48 | "eslint-plugin-sonarjs": "^0.11.0", 49 | "jest": "^27.4.5", 50 | "markdown-toc": "^1.2.0", 51 | "node-fetch": "^2.6.1", 52 | "rimraf": "^3.0.2", 53 | "semantic-release": "^21.0.1" 54 | }, 55 | "release": { 56 | "branches": [ 57 | "master" 58 | ], 59 | "plugins": [ 60 | [ 61 | "@semantic-release/commit-analyzer", 62 | { 63 | "preset": "conventionalcommits" 64 | } 65 | ], 66 | [ 67 | "@semantic-release/release-notes-generator", 68 | { 69 | "preset": "conventionalcommits" 70 | } 71 | ], 72 | "@semantic-release/npm", 73 | "@semantic-release/github" 74 | ] 75 | }, 76 | "generator": { 77 | "supportedProtocols": [ 78 | "ws" 79 | ], 80 | "parameters": { 81 | "server": { 82 | "description": "The server you want to use in the code.", 83 | "required": true 84 | }, 85 | "asyncapiFileDir": { 86 | "description": "Custom location of the AsyncAPI file that you provided as an input in generation. By default it is located in the root of the output directory" 87 | } 88 | }, 89 | "generator": ">=0.50.0 <3.0.0", 90 | "filters": [ 91 | "@asyncapi/generator-filters" 92 | ], 93 | "hooks": { 94 | "@asyncapi/generator-hooks": "createAsyncapiFile" 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is centrally managed in https://github.com/asyncapi/.github/ 3 | * Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 4 | */ 5 | const mailchimp = require('@mailchimp/mailchimp_marketing'); 6 | const core = require('@actions/core'); 7 | const htmlContent = require('./htmlContent.js'); 8 | 9 | /** 10 | * Sending API request to mailchimp to schedule email to subscribers 11 | * Input is the URL to issue/discussion or other resource 12 | */ 13 | module.exports = async (link, title) => { 14 | 15 | let newCampaign; 16 | 17 | mailchimp.setConfig({ 18 | apiKey: process.env.MAILCHIMP_API_KEY, 19 | server: 'us12' 20 | }); 21 | 22 | /* 23 | * First we create campaign 24 | */ 25 | try { 26 | newCampaign = await mailchimp.campaigns.create({ 27 | type: 'regular', 28 | recipients: { 29 | list_id: '6e3e437abe', 30 | segment_opts: { 31 | match: 'any', 32 | conditions: [{ 33 | condition_type: 'Interests', 34 | field: 'interests-2801e38b9f', 35 | op: 'interestcontains', 36 | value: ['f7204f9b90'] 37 | }] 38 | } 39 | }, 40 | settings: { 41 | subject_line: `TSC attention required: ${ title }`, 42 | preview_text: 'Check out the latest topic that TSC members have to be aware of', 43 | title: `New topic info - ${ new Date(Date.now()).toUTCString()}`, 44 | from_name: 'AsyncAPI Initiative', 45 | reply_to: 'info@asyncapi.io', 46 | } 47 | }); 48 | } catch (error) { 49 | return core.setFailed(`Failed creating campaign: ${ JSON.stringify(error) }`); 50 | } 51 | 52 | /* 53 | * Content of the email is added separately after campaign creation 54 | */ 55 | try { 56 | await mailchimp.campaigns.setContent(newCampaign.id, { html: htmlContent(link, title) }); 57 | } catch (error) { 58 | return core.setFailed(`Failed adding content to campaign: ${ JSON.stringify(error) }`); 59 | } 60 | 61 | /* 62 | * We schedule an email to send it immediately 63 | */ 64 | try { 65 | //schedule for next hour 66 | //so if this code was created by new issue creation at 9:46, the email is scheduled for 10:00 67 | //is it like this as schedule has limitiations and you cannot schedule email for 9:48 68 | const scheduleDate = new Date(Date.parse(new Date(Date.now()).toISOString()) + 1 * 1 * 60 * 60 * 1000); 69 | scheduleDate.setUTCMinutes(00); 70 | 71 | await mailchimp.campaigns.schedule(newCampaign.id, { 72 | schedule_time: scheduleDate.toISOString(), 73 | }); 74 | } catch (error) { 75 | return core.setFailed(`Failed scheduling email: ${ JSON.stringify(error) }`); 76 | } 77 | 78 | core.info(`New email campaign created`); 79 | } -------------------------------------------------------------------------------- /.github/workflows/automerge-orphans.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: 'Notify on failing automerge' 5 | 6 | on: 7 | schedule: 8 | - cron: "0 0 * * *" 9 | 10 | jobs: 11 | identify-orphans: 12 | if: startsWith(github.repository, 'asyncapi/') 13 | name: Find orphans and notify 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v4 18 | - name: Get list of orphans 19 | uses: actions/github-script@v7 20 | id: orphans 21 | with: 22 | github-token: ${{ secrets.GITHUB_TOKEN }} 23 | script: | 24 | const query = `query($owner:String!, $name:String!) { 25 | repository(owner:$owner, name:$name){ 26 | pullRequests(first: 100, states: OPEN){ 27 | nodes{ 28 | title 29 | url 30 | author { 31 | resourcePath 32 | } 33 | } 34 | } 35 | } 36 | }`; 37 | const variables = { 38 | owner: context.repo.owner, 39 | name: context.repo.repo 40 | }; 41 | const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables); 42 | 43 | let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot') 44 | 45 | if (orphans.length) { 46 | core.setOutput('found', 'true'); 47 | //Yes, this is very naive approach to assume there is just one PR causing issues, there can be a case that more PRs are affected the same day 48 | //The thing is that handling multiple PRs will increase a complexity in this PR that in my opinion we should avoid 49 | //The other PRs will be reported the next day the action runs, or person that checks first url will notice the other ones 50 | core.setOutput('url', orphans[0].url); 51 | core.setOutput('title', orphans[0].title); 52 | } 53 | - if: steps.orphans.outputs.found == 'true' 54 | name: Convert markdown to slack markdown 55 | # This workflow is from our own org repo and safe to reference by 'master'. 56 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 57 | id: issuemarkdown 58 | with: 59 | markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})" 60 | - if: steps.orphans.outputs.found == 'true' 61 | name: Send info about orphan to slack 62 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 63 | env: 64 | SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}} 65 | SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨 66 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 67 | MSG_MINIMAL: true -------------------------------------------------------------------------------- /.github/workflows/add-good-first-issue-labels.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # Purpose of this workflow is to enable anyone to label issue with 'Good First Issue' and 'area/*' with a single command. 5 | name: Add 'Good First Issue' and 'area/*' labels # if proper comment added 6 | 7 | on: 8 | issue_comment: 9 | types: 10 | - created 11 | 12 | jobs: 13 | add-labels: 14 | if: ${{(!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot') && (contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' ))}} 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Add label 18 | uses: actions/github-script@v7 19 | with: 20 | github-token: ${{ secrets.GH_TOKEN }} 21 | script: | 22 | const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design']; 23 | const words = context.payload.comment.body.trim().split(" "); 24 | const areaIndex = words.findIndex((word)=> word === '/gfi' || word === '/good-first-issue') + 1 25 | let area = words[areaIndex]; 26 | switch(area){ 27 | case 'ts': 28 | area = 'typescript'; 29 | break; 30 | case 'js': 31 | area = 'javascript'; 32 | break; 33 | case 'markdown': 34 | area = 'docs'; 35 | break; 36 | } 37 | if(!areas.includes(area)){ 38 | const message = `Hey @${context.payload.sender.login}, your message doesn't follow the requirements, you can try \`/help\`.` 39 | 40 | await github.rest.issues.createComment({ 41 | issue_number: context.issue.number, 42 | owner: context.repo.owner, 43 | repo: context.repo.repo, 44 | body: message 45 | }) 46 | } else { 47 | 48 | // remove area if there is any before adding new labels. 49 | const currentLabels = (await github.rest.issues.listLabelsOnIssue({ 50 | issue_number: context.issue.number, 51 | owner: context.repo.owner, 52 | repo: context.repo.repo, 53 | })).data.map(label => label.name); 54 | 55 | const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(area))); 56 | shouldBeRemoved.forEach(label => { 57 | github.rest.issues.deleteLabel({ 58 | owner: context.repo.owner, 59 | repo: context.repo.repo, 60 | name: label, 61 | }); 62 | }); 63 | 64 | // Add new labels. 65 | github.rest.issues.addLabels({ 66 | issue_number: context.issue.number, 67 | owner: context.repo.owner, 68 | repo: context.repo.repo, 69 | labels: ['good first issue', `area/${area}`] 70 | }); 71 | } 72 | -------------------------------------------------------------------------------- /test/__snapshots__/integration.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`template integration test using generator should generate application files 1`] = ` 4 | "const app = require('express')(); 5 | require('express-ws')(app); 6 | const config = require('../lib/config'); 7 | const routes = require('./routes'); 8 | const asyncapi = require('../lib/asyncapi'); 9 | 10 | const start = async () => { 11 | //you have access to parsed AsyncAPI document in the runtime with asyncapi.get() 12 | await asyncapi.init(); 13 | 14 | app.use(routes); 15 | 16 | app.use((req, res, next) => { 17 | res.status(404).send('Error: path not found'); 18 | next(); 19 | }); 20 | 21 | app.use((err, req, res, next) => { 22 | console.error(err); 23 | next(); 24 | }); 25 | 26 | app.listen(config.port); 27 | console.info(\`Listening on port \${config.port}\`); 28 | }; 29 | 30 | start(); 31 | " 32 | `; 33 | 34 | exports[`template integration test using generator should generate application files 2`] = ` 35 | "const util = require('util'); 36 | const { Router } = require('express'); 37 | const { pathParser } = require('../lib/path'); 38 | const { yellow } = require('../lib/colors'); 39 | const { onEcho, sendEcho } = require('./services/echo'); 40 | const router = Router(); 41 | module.exports = router; 42 | router.ws('/echo', async (ws, req) => { 43 | const path = pathParser(req.path); 44 | console.log(\`\${yellow(path)} client connected.\`); 45 | await onEcho(ws); 46 | ws.on('message', async (msg) => { 47 | console.log(\`\${yellow(path)} message was received:\`); 48 | console.log(util.inspect(msg, { depth: null, colors: true })); 49 | await sendEcho(ws, { message: msg, path, query: req.query }); 50 | }); 51 | }); 52 | " 53 | `; 54 | 55 | exports[`template integration test using generator should generate application files 3`] = ` 56 | "const fs = require('fs'); 57 | const path = require('path'); 58 | const { Parser } = require('@asyncapi/parser'); 59 | 60 | const parser = new Parser(); 61 | 62 | let cached; 63 | 64 | module.exports.init = async () => { 65 | if (cached) return; 66 | 67 | let content; 68 | 69 | try { 70 | content = fs.readFileSync(path.resolve(__dirname, '../../asyncapi.yaml'), { encoding: 'utf8' }); 71 | } catch (e) { 72 | try { 73 | content = fs.readFileSync(path.resolve(__dirname, '../../asyncapi.json'), { encoding: 'utf8' }); 74 | } catch (err) { 75 | throw new Error('Coud not find asyncapi.yaml or asyncapi.json file in the root directory of the project.'); 76 | } 77 | } 78 | 79 | try { 80 | cached = await parser.parse(content); 81 | } catch (e) { 82 | throw e; 83 | } 84 | 85 | return cached; 86 | }; 87 | 88 | module.exports.get = () => cached; 89 | " 90 | `; 91 | 92 | exports[`template integration test using generator should generate application files 4`] = ` 93 | "module.exports.yellow = (text) => { 94 | return \`\\\\x1b[33m\${text}\\\\x1b[0m\`; 95 | }; 96 | " 97 | `; 98 | 99 | exports[`template integration test using generator should generate application files 5`] = ` 100 | "const path = require('path'); 101 | const yamlConfig = require('node-yaml-config'); 102 | 103 | const config = yamlConfig.load(path.join(__dirname, '../../config/common.yml')); 104 | 105 | module.exports = config; 106 | " 107 | `; 108 | 109 | exports[`template integration test using generator should generate application files 6`] = ` 110 | "module.exports.pathParser = (path) => { 111 | return path.substr(0, path.length - '/.websocket'.length); 112 | };" 113 | `; 114 | -------------------------------------------------------------------------------- /.github/workflows/if-nodejs-pr-testing.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # It does magic only if there is package.json file in the root of the project 5 | name: PR testing - if Node project 6 | 7 | on: 8 | pull_request: 9 | types: [opened, reopened, synchronize, ready_for_review] 10 | 11 | jobs: 12 | test-nodejs-pr: 13 | name: Test NodeJS PR - ${{ matrix.os }} 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | matrix: 17 | os: [ubuntu-latest, macos-latest, windows-latest] 18 | steps: 19 | - if: > 20 | !github.event.pull_request.draft && !( 21 | (github.actor == 'asyncapi-bot' && ( 22 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 23 | startsWith(github.event.pull_request.title, 'chore(release):') 24 | )) || 25 | (github.actor == 'asyncapi-bot-eve' && ( 26 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 27 | startsWith(github.event.pull_request.title, 'chore(release):') 28 | )) || 29 | (github.actor == 'allcontributors[bot]' && 30 | startsWith(github.event.pull_request.title, 'docs: add') 31 | ) 32 | ) 33 | id: should_run 34 | name: Should Run 35 | run: echo "shouldrun=true" >> $GITHUB_OUTPUT 36 | shell: bash 37 | - if: steps.should_run.outputs.shouldrun == 'true' 38 | name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 39 | run: | 40 | git config --global core.autocrlf false 41 | git config --global core.eol lf 42 | shell: bash 43 | - if: steps.should_run.outputs.shouldrun == 'true' 44 | name: Checkout repository 45 | uses: actions/checkout@v4 46 | - if: steps.should_run.outputs.shouldrun == 'true' 47 | name: Check if Node.js project and has package.json 48 | id: packagejson 49 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 50 | shell: bash 51 | - if: steps.packagejson.outputs.exists == 'true' 52 | name: Determine what node version to use 53 | # This workflow is from our own org repo and safe to reference by 'master'. 54 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master # //NOSONAR 55 | with: 56 | node-version: ${{ vars.NODE_VERSION }} 57 | id: lockversion 58 | - if: steps.packagejson.outputs.exists == 'true' 59 | name: Setup Node.js 60 | uses: actions/setup-node@v4 61 | with: 62 | node-version: "${{ steps.lockversion.outputs.version }}" 63 | - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' 64 | #npm cli 10 is buggy because of some cache issue 65 | name: Install npm cli 8 66 | shell: bash 67 | run: npm install -g npm@8.19.4 68 | - if: steps.packagejson.outputs.exists == 'true' 69 | name: Install dependencies 70 | shell: bash 71 | run: npm ci 72 | - if: steps.packagejson.outputs.exists == 'true' 73 | name: Test 74 | run: npm test --if-present 75 | - if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' 76 | #linting should run just one and not on all possible operating systems 77 | name: Run linter 78 | run: npm run lint --if-present 79 | - if: steps.packagejson.outputs.exists == 'true' 80 | name: Run release assets generation to make sure PR does not break it 81 | shell: bash 82 | run: npm run generate:assets --if-present 83 | -------------------------------------------------------------------------------- /.github/workflows/help-command.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Create help comment 5 | 6 | on: 7 | issue_comment: 8 | types: 9 | - created 10 | 11 | jobs: 12 | create_help_comment_pr: 13 | if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Add comment to PR 17 | uses: actions/github-script@v7 18 | env: 19 | ACTOR: ${{ github.actor }} 20 | with: 21 | github-token: ${{ secrets.GH_TOKEN }} 22 | script: | 23 | //Yes to add comment to PR the same endpoint is use that we use to create a comment in issue 24 | //For more details http://developer.github.com/v3/issues/comments/ 25 | //Also proved by this action https://github.com/actions-ecosystem/action-create-comment/blob/main/src/main.ts 26 | github.rest.issues.createComment({ 27 | issue_number: context.issue.number, 28 | owner: context.repo.owner, 29 | repo: context.repo.repo, 30 | body: `Hello, @${process.env.ACTOR}! 👋🏼 31 | 32 | I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! 33 | 34 | At the moment the following comments are supported in pull requests: 35 | 36 | - \`/please-take-a-look\` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. 37 | - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added 38 | - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added 39 | - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. (Currently only works for upstream branches.) 40 | - \`/update\` or \`/u\` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.` 41 | }) 42 | 43 | create_help_comment_issue: 44 | if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} 45 | runs-on: ubuntu-latest 46 | steps: 47 | - name: Add comment to Issue 48 | uses: actions/github-script@v7 49 | env: 50 | ACTOR: ${{ github.actor }} 51 | with: 52 | github-token: ${{ secrets.GH_TOKEN }} 53 | script: | 54 | github.rest.issues.createComment({ 55 | issue_number: context.issue.number, 56 | owner: context.repo.owner, 57 | repo: context.repo.repo, 58 | body: `Hello, @${process.env.ACTOR}! 👋🏼 59 | 60 | I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! 61 | 62 | At the moment the following comments are supported in issues: 63 | 64 | - \`/good-first-issue {js | ts | java | go | docs | design | ci-cd}\` or \`/gfi {js | ts | java | go | docs | design | ci-cd}\` - label an issue as a \`good first issue\`. 65 | example: \`/gfi js\` or \`/good-first-issue ci-cd\` 66 | - \`/transfer-issue {repo-name}\` or \`/ti {repo-name}\` - transfer issue from the source repository to the other repository passed by the user. example: \`/ti cli\` or \`/transfer-issue cli\`.` 67 | }) -------------------------------------------------------------------------------- /.github/workflows/issues-prs-notifications.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository 5 | name: Notify slack 6 | 7 | on: 8 | issues: 9 | types: [opened, reopened] 10 | 11 | pull_request_target: 12 | types: [opened, reopened, ready_for_review] 13 | 14 | discussion: 15 | types: [created] 16 | 17 | jobs: 18 | issue: 19 | if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 20 | name: Notify slack on every new issue 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Convert markdown to slack markdown for issue 24 | # This workflow is from our own org repo and safe to reference by 'master'. 25 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 26 | id: issuemarkdown 27 | env: 28 | ISSUE_TITLE: ${{github.event.issue.title}} 29 | ISSUE_URL: ${{github.event.issue.html_url}} 30 | ISSUE_BODY: ${{github.event.issue.body}} 31 | with: 32 | markdown: "[${{ env.ISSUE_TITLE }}](${{ env.ISSUE_URL }}) \n ${{ env.ISSUE_BODY }}" 33 | - name: Send info about issue 34 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 35 | env: 36 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 37 | SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛 38 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 39 | MSG_MINIMAL: true 40 | 41 | pull_request: 42 | if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 43 | name: Notify slack on every new pull request 44 | runs-on: ubuntu-latest 45 | steps: 46 | - name: Convert markdown to slack markdown for pull request 47 | # This workflow is from our own org repo and safe to reference by 'master'. 48 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 49 | id: prmarkdown 50 | env: 51 | PR_TITLE: ${{github.event.pull_request.title}} 52 | PR_URL: ${{github.event.pull_request.html_url}} 53 | PR_BODY: ${{github.event.pull_request.body}} 54 | with: 55 | markdown: "[${{ env.PR_TITLE }}](${{ env.PR_URL }}) \n ${{ env.PR_BODY }}" 56 | - name: Send info about pull request 57 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 58 | env: 59 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 60 | SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪 61 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 62 | MSG_MINIMAL: true 63 | 64 | discussion: 65 | if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 66 | name: Notify slack on every new pull request 67 | runs-on: ubuntu-latest 68 | steps: 69 | - name: Convert markdown to slack markdown for pull request 70 | # This workflow is from our own org repo and safe to reference by 'master'. 71 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 72 | id: discussionmarkdown 73 | env: 74 | DISCUSSION_TITLE: ${{github.event.discussion.title}} 75 | DISCUSSION_URL: ${{github.event.discussion.html_url}} 76 | DISCUSSION_BODY: ${{github.event.discussion.body}} 77 | with: 78 | markdown: "[${{ env.DISCUSSION_TITLE }}](${{ env.DISCUSSION_URL }}) \n ${{ env.DISCUSSION_BODY }}" 79 | - name: Send info about pull request 80 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 81 | env: 82 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 83 | SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬 84 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 85 | MSG_MINIMAL: true 86 | -------------------------------------------------------------------------------- /.github/workflows/if-nodejs-version-bump.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # It does magic only if there is package.json file in the root of the project 5 | name: Version bump - if Node.js project 6 | 7 | on: 8 | release: 9 | types: 10 | - published 11 | 12 | jobs: 13 | version_bump: 14 | name: Generate assets and bump NodeJS 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v4 19 | with: 20 | # target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases 21 | # in case release is created from release branch then we need to checkout from given branch 22 | # if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working 23 | ref: ${{ github.event.release.target_commitish }} 24 | - name: Check if Node.js project and has package.json 25 | id: packagejson 26 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 27 | - if: steps.packagejson.outputs.exists == 'true' 28 | name: Determine what node version to use 29 | # This workflow is from our own org repo and safe to reference by 'master'. 30 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master # //NOSONAR 31 | with: 32 | node-version: ${{ vars.NODE_VERSION }} 33 | id: lockversion 34 | - if: steps.packagejson.outputs.exists == 'true' 35 | name: Setup Node.js 36 | uses: actions/setup-node@v4 37 | with: 38 | node-version: "${{ steps.lockversion.outputs.version }}" 39 | cache: 'npm' 40 | cache-dependency-path: '**/package-lock.json' 41 | - if: steps.packagejson.outputs.exists == 'true' 42 | name: Install dependencies 43 | run: npm ci 44 | - if: steps.packagejson.outputs.exists == 'true' 45 | name: Assets generation 46 | run: npm run generate:assets --if-present 47 | - if: steps.packagejson.outputs.exists == 'true' 48 | name: Bump version in package.json 49 | # There is no need to substract "v" from the tag as version script handles it 50 | # When adding "bump:version" script in package.json, make sure no tags are added by default (--no-git-tag-version) as they are already added by release workflow 51 | # When adding "bump:version" script in package.json, make sure --allow-same-version is set in case someone forgot and updated package.json manually and we want to avoide this action to fail and raise confusion 52 | env: 53 | VERSION: ${{github.event.release.tag_name}} 54 | run: npm run bump:version 55 | - if: steps.packagejson.outputs.exists == 'true' 56 | name: Create Pull Request with updated asset files including package.json 57 | uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # use 4.2.4 https://github.com/peter-evans/create-pull-request/releases/tag/v4.2.4 58 | env: 59 | RELEASE_TAG: ${{github.event.release.tag_name}} 60 | RELEASE_URL: ${{github.event.release.html_url}} 61 | with: 62 | token: ${{ secrets.GH_TOKEN }} 63 | commit-message: 'chore(release): ${{ env.RELEASE_TAG }}' 64 | committer: asyncapi-bot 65 | author: asyncapi-bot 66 | title: 'chore(release): ${{ env.RELEASE_TAG }}' 67 | body: 'Version bump in package.json for release [${{ env.RELEASE_TAG }}](${{ env.RELEASE_URL }})' 68 | branch: version-bump/${{ env.RELEASE_TAG }} 69 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 70 | name: Report workflow run status to Slack 71 | uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 #using https://github.com/8398a7/action-slack/releases/tag/v3.16.2 72 | with: 73 | status: ${{ job.status }} 74 | fields: repo,action,workflow 75 | text: 'Unable to bump the version in package.json after the release' 76 | env: 77 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-merging.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # Purpose of this workflow is to allow people to merge PR without a need of maintainer doing it. If all checks are in place (including maintainers approval) - JUST MERGE IT! 5 | name: Automerge For Humans 6 | 7 | on: 8 | pull_request_target: 9 | types: 10 | - labeled 11 | - unlabeled 12 | - synchronize 13 | - opened 14 | - edited 15 | - ready_for_review 16 | - reopened 17 | - unlocked 18 | 19 | jobs: 20 | automerge-for-humans: 21 | # it runs only if PR actor is not a bot, at least not a bot that we know 22 | if: | 23 | github.event.pull_request.draft == false && 24 | (github.event.pull_request.user.login != 'asyncapi-bot' || 25 | github.event.pull_request.user.login != 'dependabot[bot]' || 26 | github.event.pull_request.user.login != 'dependabot-preview[bot]') 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Get PR authors 30 | id: authors 31 | uses: actions/github-script@v7 32 | with: 33 | script: | 34 | // Get paginated list of all commits in the PR 35 | try { 36 | const commitOpts = github.rest.pulls.listCommits.endpoint.merge({ 37 | owner: context.repo.owner, 38 | repo: context.repo.repo, 39 | pull_number: context.issue.number 40 | }); 41 | 42 | const commits = await github.paginate(commitOpts); 43 | 44 | if (commits.length === 0) { 45 | core.setFailed('No commits found in the PR'); 46 | return ''; 47 | } 48 | 49 | // Get unique authors from the commits list 50 | const authors = commits.reduce((acc, commit) => { 51 | const username = commit.author?.login || commit.commit.author?.name; 52 | if (username && !acc[username]) { 53 | acc[username] = { 54 | name: commit.commit.author?.name, 55 | email: commit.commit.author?.email, 56 | } 57 | } 58 | 59 | return acc; 60 | }, {}); 61 | 62 | return authors; 63 | } catch (error) { 64 | core.setFailed(error.message); 65 | return []; 66 | } 67 | 68 | - name: Create commit message 69 | id: create-commit-message 70 | uses: actions/github-script@v7 71 | with: 72 | script: | 73 | const authors = ${{ steps.authors.outputs.result }}; 74 | 75 | if (Object.keys(authors).length === 0) { 76 | core.setFailed('No authors found in the PR'); 77 | return ''; 78 | } 79 | 80 | // Create a string of the form "Co-authored-by: Name " 81 | // ref: https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors 82 | const coAuthors = Object.values(authors).map(author => { 83 | return `Co-authored-by: ${author.name} <${author.email}>`; 84 | }).join('\n'); 85 | 86 | core.debug(coAuthors);; 87 | 88 | return coAuthors; 89 | 90 | - name: Automerge PR 91 | uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 92 | env: 93 | GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" 94 | MERGE_LABELS: "!do-not-merge,ready-to-merge" 95 | MERGE_METHOD: "squash" 96 | # Using the output of the previous step (`Co-authored-by: ...` lines) as commit description. 97 | # Important to keep 2 empty lines as https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line mentions 98 | MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})\n\n\n${{ fromJSON(steps.create-commit-message.outputs.result) }}" 99 | MERGE_RETRIES: "20" 100 | MERGE_RETRY_SLEEP: "30000" 101 | -------------------------------------------------------------------------------- /.github/workflows/welcome-first-time-contrib.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Welcome first time contributors 5 | 6 | on: 7 | pull_request_target: 8 | types: 9 | - opened 10 | issues: 11 | types: 12 | - opened 13 | 14 | jobs: 15 | welcome: 16 | name: Post welcome message 17 | if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/github-script@v7 21 | with: 22 | github-token: ${{ secrets.GITHUB_TOKEN }} 23 | script: | 24 | const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/community/blob/master/git-workflow.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; 25 | const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; 26 | if (!issueMessage && !prMessage) { 27 | throw new Error('Action must have at least one of issue-message or pr-message set'); 28 | } 29 | const isIssue = !!context.payload.issue; 30 | let isFirstContribution; 31 | if (isIssue) { 32 | const query = `query($owner:String!, $name:String!, $contributer:String!) { 33 | repository(owner:$owner, name:$name){ 34 | issues(first: 1, filterBy: {createdBy:$contributer}){ 35 | totalCount 36 | } 37 | } 38 | }`; 39 | const variables = { 40 | owner: context.repo.owner, 41 | name: context.repo.repo, 42 | contributer: context.payload.sender.login 43 | }; 44 | const { repository: { issues: { totalCount } } } = await github.graphql(query, variables); 45 | isFirstContribution = totalCount === 1; 46 | } else { 47 | const query = `query($qstr: String!) { 48 | search(query: $qstr, type: ISSUE, first: 1) { 49 | issueCount 50 | } 51 | }`; 52 | const variables = { 53 | "qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`, 54 | }; 55 | const { search: { issueCount } } = await github.graphql(query, variables); 56 | isFirstContribution = issueCount === 1; 57 | } 58 | 59 | if (!isFirstContribution) { 60 | console.log(`Not the users first contribution.`); 61 | return; 62 | } 63 | const message = isIssue ? issueMessage : prMessage; 64 | // Add a comment to the appropriate place 65 | if (isIssue) { 66 | const issueNumber = context.payload.issue.number; 67 | console.log(`Adding message: ${message} to issue #${issueNumber}`); 68 | await github.rest.issues.createComment({ 69 | owner: context.payload.repository.owner.login, 70 | repo: context.payload.repository.name, 71 | issue_number: issueNumber, 72 | body: message 73 | }); 74 | } 75 | else { 76 | const pullNumber = context.payload.pull_request.number; 77 | console.log(`Adding message: ${message} to pull request #${pullNumber}`); 78 | await github.rest.pulls.createReview({ 79 | owner: context.payload.repository.owner.login, 80 | repo: context.payload.repository.name, 81 | pull_number: pullNumber, 82 | body: message, 83 | event: 'COMMENT' 84 | }); 85 | } 86 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to AsyncAPI 2 | We love your input! We want to make contributing to this project as easy and transparent as possible. 3 | 4 | ## Contribution recogniton 5 | 6 | We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions. For more details read [this](https://www.asyncapi.com/docs/community/010-contribution-guidelines/recognize-contributors#main-content) document. 7 | 8 | 9 | 10 | 11 | ## Summary of the contribution flow 12 | 13 | The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate. 14 | 15 | ``` 16 | ┌───────────────────────┐ 17 | │ │ 18 | │ Open an issue │ 19 | │ (a bug report or a │ 20 | │ feature request) │ 21 | │ │ 22 | └───────────────────────┘ 23 | ⇩ 24 | ┌───────────────────────┐ 25 | │ │ 26 | │ Open a Pull Request │ 27 | │ (only after issue │ 28 | │ is approved) │ 29 | │ │ 30 | └───────────────────────┘ 31 | ⇩ 32 | ┌───────────────────────┐ 33 | │ │ 34 | │ Your changes will │ 35 | │ be merged and │ 36 | │ published on the next │ 37 | │ release │ 38 | │ │ 39 | └───────────────────────┘ 40 | ``` 41 | 42 | ## Code of Conduct 43 | AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected. 44 | 45 | ## Our Development Process 46 | We use Github to host code, to track issues and feature requests, as well as accept pull requests. 47 | 48 | ## Issues 49 | [Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. Don't forget to follow our [Slack Etiquette](https://www.asyncapi.com/docs/community/060-meetings-and-communication/slack-etiquette) while interacting with community members! It's more likely you'll get help, and much faster! 50 | 51 | ## Bug Reports and Feature Requests 52 | 53 | Please use our issues templates that provide you with hints on what information we need from you to help you out. 54 | 55 | ## Pull Requests 56 | 57 | **Please, make sure you open an issue before starting with a Pull Request, unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification. Get familiar with our document that explains [Git workflow](https://www.asyncapi.com/docs/community/010-contribution-guidelines/git-workflow) used in our repositories. 58 | 59 | ## Conventional commits 60 | 61 | Our repositories follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/). 62 | 63 | Pull requests should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification simply ask maintainers to modify. You can also use this cheatsheet if you want: 64 | 65 | - `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered. 66 | - `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered. 67 | - `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release. 68 | - `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release. 69 | - `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release. 70 | - `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release. 71 | 72 | What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: ` 73 | 74 | Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative). 75 | 76 | Happy contributing :heart: 77 | 78 | ## License 79 | When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](https://github.com/asyncapi/asyncapi/blob/master/LICENSE) that covers the project. Feel free to [contact the maintainers](https://www.asyncapi.com/slack-invite) if that's a concern. 80 | 81 | ## References 82 | This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md). 83 | -------------------------------------------------------------------------------- /.github/workflows/update-pr.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # This workflow will run on every comment with /update or /u. And will create merge-commits for the PR. 5 | # This also works with forks, not only with branches in the same repository/organization. 6 | # Currently, does not work with forks in different organizations. 7 | 8 | # This workflow will be distributed to all repositories in the AsyncAPI organization 9 | 10 | name: Update PR branches from fork 11 | 12 | on: 13 | issue_comment: 14 | types: [created] 15 | 16 | jobs: 17 | update-pr: 18 | if: > 19 | startsWith(github.repository, 'asyncapi/') && 20 | github.event.issue.pull_request && 21 | github.event.issue.state != 'closed' && ( 22 | contains(github.event.comment.body, '/update') || 23 | contains(github.event.comment.body, '/u') 24 | ) 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Get Pull Request Details 28 | id: pr 29 | uses: actions/github-script@v7 30 | with: 31 | github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} 32 | previews: 'merge-info-preview' # https://docs.github.com/en/graphql/overview/schema-previews#merge-info-preview-more-detailed-information-about-a-pull-requests-merge-state-preview 33 | script: | 34 | const prNumber = context.payload.issue.number; 35 | core.debug(`PR Number: ${prNumber}`); 36 | const { data: pr } = await github.rest.pulls.get({ 37 | owner: context.repo.owner, 38 | repo: context.repo.repo, 39 | pull_number: prNumber 40 | }); 41 | 42 | // If the PR has conflicts, we don't want to update it 43 | const updateable = ['behind', 'blocked', 'unknown', 'draft', 'clean'].includes(pr.mergeable_state); 44 | console.log(`PR #${prNumber} is ${pr.mergeable_state} and is ${updateable ? 'updateable' : 'not updateable'}`); 45 | core.setOutput('updateable', updateable); 46 | 47 | core.debug(`Updating PR #${prNumber} with head ${pr.head.sha}`); 48 | 49 | return { 50 | id: pr.node_id, 51 | number: prNumber, 52 | head: pr.head.sha, 53 | } 54 | - name: Update the Pull Request 55 | if: steps.pr.outputs.updateable == 'true' 56 | uses: actions/github-script@v7 57 | with: 58 | github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} 59 | script: | 60 | const mutation = `mutation update($input: UpdatePullRequestBranchInput!) { 61 | updatePullRequestBranch(input: $input) { 62 | pullRequest { 63 | mergeable 64 | } 65 | } 66 | }`; 67 | 68 | const pr_details = ${{ steps.pr.outputs.result }}; 69 | 70 | try { 71 | const { data } = await github.graphql(mutation, { 72 | input: { 73 | pullRequestId: pr_details.id, 74 | expectedHeadOid: pr_details.head, 75 | } 76 | }); 77 | } catch (GraphQLError) { 78 | core.debug(GraphQLError); 79 | if ( 80 | GraphQLError.name === 'GraphqlResponseError' && 81 | GraphQLError.errors.some( 82 | error => error.type === 'FORBIDDEN' || error.type === 'UNAUTHORIZED' 83 | ) 84 | ) { 85 | // Add comment to PR if the bot doesn't have permissions to update the PR 86 | const comment = `Hi @${context.actor}. Update of PR has failed. It can be due to one of the following reasons: 87 | - I don't have permissions to update this PR. To update your fork with upstream using bot you need to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in the PR. 88 | - The fork is located in an organization, not under your personal profile. No solution for that. You are on your own with manual update. 89 | - There may be a conflict in the PR. Please resolve the conflict and try again.`; 90 | 91 | await github.rest.issues.createComment({ 92 | owner: context.repo.owner, 93 | repo: context.repo.repo, 94 | issue_number: context.issue.number, 95 | body: comment 96 | }); 97 | 98 | core.setFailed('Bot does not have permissions to update the PR'); 99 | } else { 100 | core.setFailed(GraphQLError.message); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /.github/workflows/bounty-program-commands.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed at https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repository, as they will be overwritten with 3 | # changes made to the same file in the abovementioned repository. 4 | 5 | # The purpose of this workflow is to allow Bounty Team members 6 | # (https://github.com/orgs/asyncapi/teams/bounty_team) to issue commands to the 7 | # organization's global AsyncAPI bot related to the Bounty Program, while at the 8 | # same time preventing unauthorized users from misusing them. 9 | 10 | name: Bounty Program commands 11 | 12 | on: 13 | issue_comment: 14 | types: 15 | - created 16 | 17 | env: 18 | BOUNTY_PROGRAM_LABELS_JSON: | 19 | [ 20 | {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} 21 | ] 22 | 23 | jobs: 24 | guard-against-unauthorized-use: 25 | if: > 26 | github.actor != ('aeworxet' || 'thulieblack') && 27 | ( 28 | startsWith(github.event.comment.body, '/bounty' ) 29 | ) 30 | 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command 35 | uses: actions/github-script@v7 36 | env: 37 | ACTOR: ${{ github.actor }} 38 | with: 39 | github-token: ${{ secrets.GH_TOKEN }} 40 | script: | 41 | const commentText = `❌ @${process.env.ACTOR} is not authorized to use the Bounty Program's commands. 42 | These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`; 43 | 44 | console.log(`❌ @${process.env.ACTOR} made an unauthorized attempt to use a Bounty Program's command.`); 45 | github.rest.issues.createComment({ 46 | issue_number: context.issue.number, 47 | owner: context.repo.owner, 48 | repo: context.repo.repo, 49 | body: commentText 50 | }) 51 | 52 | add-label-bounty: 53 | if: > 54 | github.actor == ('aeworxet' || 'thulieblack') && 55 | ( 56 | startsWith(github.event.comment.body, '/bounty' ) 57 | ) 58 | 59 | runs-on: ubuntu-latest 60 | 61 | steps: 62 | - name: Add label `bounty` 63 | uses: actions/github-script@v7 64 | with: 65 | github-token: ${{ secrets.GH_TOKEN }} 66 | script: | 67 | const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); 68 | let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({ 69 | owner: context.repo.owner, 70 | repo: context.repo.repo, 71 | }); 72 | 73 | LIST_OF_LABELS_FOR_REPO = LIST_OF_LABELS_FOR_REPO.data.map(key => key.name); 74 | 75 | if (!LIST_OF_LABELS_FOR_REPO.includes(BOUNTY_PROGRAM_LABELS[0].name)) { 76 | await github.rest.issues.createLabel({ 77 | owner: context.repo.owner, 78 | repo: context.repo.repo, 79 | name: BOUNTY_PROGRAM_LABELS[0].name, 80 | color: BOUNTY_PROGRAM_LABELS[0].color, 81 | description: BOUNTY_PROGRAM_LABELS[0].description 82 | }); 83 | } 84 | 85 | console.log('Adding label `bounty`...'); 86 | github.rest.issues.addLabels({ 87 | issue_number: context.issue.number, 88 | owner: context.repo.owner, 89 | repo: context.repo.repo, 90 | labels: [BOUNTY_PROGRAM_LABELS[0].name] 91 | }) 92 | 93 | remove-label-bounty: 94 | if: > 95 | github.actor == ('aeworxet' || 'thulieblack') && 96 | ( 97 | startsWith(github.event.comment.body, '/unbounty' ) 98 | ) 99 | 100 | runs-on: ubuntu-latest 101 | 102 | steps: 103 | - name: Remove label `bounty` 104 | uses: actions/github-script@v7 105 | with: 106 | github-token: ${{ secrets.GH_TOKEN }} 107 | script: | 108 | const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); 109 | let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({ 110 | owner: context.repo.owner, 111 | repo: context.repo.repo, 112 | issue_number: context.issue.number, 113 | }); 114 | 115 | LIST_OF_LABELS_FOR_ISSUE = LIST_OF_LABELS_FOR_ISSUE.data.map(key => key.name); 116 | 117 | if (LIST_OF_LABELS_FOR_ISSUE.includes(BOUNTY_PROGRAM_LABELS[0].name)) { 118 | console.log('Removing label `bounty`...'); 119 | github.rest.issues.removeLabel({ 120 | issue_number: context.issue.number, 121 | owner: context.repo.owner, 122 | repo: context.repo.repo, 123 | name: [BOUNTY_PROGRAM_LABELS[0].name] 124 | }) 125 | } 126 | -------------------------------------------------------------------------------- /.github/workflows/release-announcements.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: 'Announce releases in different channels' 5 | 6 | on: 7 | release: 8 | types: 9 | - published 10 | 11 | jobs: 12 | 13 | slack-announce: 14 | name: Slack - notify on every release 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v4 19 | - name: Convert markdown to slack markdown for issue 20 | # This workflow is from our own org repo and safe to reference by 'master'. 21 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 22 | id: markdown 23 | env: 24 | RELEASE_TAG: ${{github.event.release.tag_name}} 25 | RELEASE_URL: ${{github.event.release.html_url}} 26 | RELEASE_BODY: ${{ github.event.release.body }} 27 | with: 28 | markdown: "[${{ env.RELEASE_TAG }}](${{ env.RELEASE_URL }}) \n ${{ env.RELEASE_BODY }}" 29 | - name: Send info about release to Slack 30 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 31 | env: 32 | SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }} 33 | SLACK_TITLE: Release ${{ env.RELEASE_TAG }} for ${{ env.REPO_NAME }} is out in the wild 😱💪🍾🎂 34 | SLACK_MESSAGE: ${{steps.markdown.outputs.text}} 35 | MSG_MINIMAL: true 36 | RELEASE_TAG: ${{github.event.release.tag_name}} 37 | REPO_NAME: ${{github.repository}} 38 | 39 | twitter-announce: 40 | name: Twitter - notify on minor and major releases 41 | runs-on: ubuntu-latest 42 | steps: 43 | - name: Checkout repo 44 | uses: actions/checkout@v4 45 | - name: Get version of last and previous release 46 | uses: actions/github-script@v7 47 | id: versions 48 | with: 49 | github-token: ${{ secrets.GITHUB_TOKEN }} 50 | script: | 51 | const query = `query($owner:String!, $name:String!) { 52 | repository(owner:$owner, name:$name){ 53 | releases(first: 2, orderBy: {field: CREATED_AT, direction: DESC}) { 54 | nodes { 55 | name 56 | } 57 | } 58 | } 59 | }`; 60 | const variables = { 61 | owner: context.repo.owner, 62 | name: context.repo.repo 63 | }; 64 | const { repository: { releases: { nodes } } } = await github.graphql(query, variables); 65 | core.setOutput('lastver', nodes[0].name); 66 | // In case of first release in the package, there is no such thing as previous error, so we set info about previous version only once we have it 67 | // We should tweet about the release no matter of the type as it is initial release 68 | if (nodes.length != 1) core.setOutput('previousver', nodes[1].name); 69 | - name: Identify release type 70 | id: releasetype 71 | # if previousver is not provided then this steps just logs information about missing version, no errors 72 | env: 73 | PREV_VERSION: ${{steps.versions.outputs.previousver}} 74 | LAST_VERSION: ${{steps.versions.outputs.lastver}} 75 | run: echo "type=$(npx -q -p semver-diff-cli semver-diff "$PREV_VERSION" "$LAST_VERSION")" >> $GITHUB_OUTPUT 76 | - name: Get name of the person that is behind the newly released version 77 | id: author 78 | run: | 79 | AUTHOR_NAME=$(git log -1 --pretty=format:'%an') 80 | printf 'name=%s\n' "$AUTHOR_NAME" >> $GITHUB_OUTPUT 81 | - name: Publish information about the release to Twitter # tweet only if detected version change is not a patch 82 | # tweet goes out even if the type is not major or minor but "You need provide version number to compare." 83 | # it is ok, it just means we did not identify previous version as we are tweeting out information about the release for the first time 84 | if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same 85 | uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0 86 | env: 87 | RELEASE_TAG: ${{github.event.release.tag_name}} 88 | REPO_NAME: ${{github.repository}} 89 | AUTHOR_NAME: ${{ steps.author.outputs.name }} 90 | RELEASE_URL: ${{github.event.release.html_url}} 91 | with: 92 | twitter_status: "Release ${{ env.RELEASE_TAG }} for ${{ env.REPO_NAME }} is out in the wild 😱💪🍾🎂\n\nThank you for the contribution ${{ env.AUTHOR_NAME }} ${{ env.RELEASE_URL }}" 93 | twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} 94 | twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} 95 | twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} 96 | twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # Purpose of this workflow is to enable anyone to label PR with the following labels: 5 | # `ready-to-merge` and `do-not-merge` labels to get stuff merged or blocked from merging 6 | # `autoupdate` to keep a branch up-to-date with the target branch 7 | 8 | name: Label PRs # if proper comment added 9 | 10 | on: 11 | issue_comment: 12 | types: 13 | - created 14 | 15 | jobs: 16 | add-ready-to-merge-label: 17 | if: > 18 | github.event.issue.pull_request && 19 | github.event.issue.state != 'closed' && 20 | github.actor != 'asyncapi-bot' && 21 | ( 22 | contains(github.event.comment.body, '/ready-to-merge') || 23 | contains(github.event.comment.body, '/rtm' ) 24 | ) 25 | 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: Add ready-to-merge label 29 | uses: actions/github-script@v7 30 | env: 31 | GITHUB_ACTOR: ${{ github.actor }} 32 | with: 33 | github-token: ${{ secrets.GH_TOKEN }} 34 | script: | 35 | const prDetailsUrl = context.payload.issue.pull_request.url; 36 | const { data: pull } = await github.request(prDetailsUrl); 37 | const { draft: isDraft} = pull; 38 | if(!isDraft) { 39 | console.log('adding ready-to-merge label...'); 40 | github.rest.issues.addLabels({ 41 | issue_number: context.issue.number, 42 | owner: context.repo.owner, 43 | repo: context.repo.repo, 44 | labels: ['ready-to-merge'] 45 | }) 46 | } 47 | 48 | const { data: comparison } = 49 | await github.rest.repos.compareCommitsWithBasehead({ 50 | owner: pull.head.repo.owner.login, 51 | repo: pull.head.repo.name, 52 | basehead: `${pull.base.label}...${pull.head.label}`, 53 | }); 54 | if (comparison.behind_by !== 0 && pull.mergeable_state === 'behind') { 55 | console.log(`This branch is behind the target by ${comparison.behind_by} commits`) 56 | console.log('adding out-of-date comment...'); 57 | github.rest.issues.createComment({ 58 | issue_number: context.issue.number, 59 | owner: context.repo.owner, 60 | repo: context.repo.repo, 61 | body: `Hello, @${process.env.GITHUB_ACTOR}! 👋🏼 62 | This PR is not up to date with the base branch and can't be merged. 63 | Please update your branch manually with the latest version of the base branch. 64 | PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly. 65 | 66 | The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. Also the update will not work if your fork is located in an organization, not under your personal profile. 67 | Thanks 😄` 68 | }) 69 | } 70 | 71 | add-do-not-merge-label: 72 | if: > 73 | github.event.issue.pull_request && 74 | github.event.issue.state != 'closed' && 75 | github.actor != 'asyncapi-bot' && 76 | ( 77 | contains(github.event.comment.body, '/do-not-merge') || 78 | contains(github.event.comment.body, '/dnm' ) 79 | ) 80 | runs-on: ubuntu-latest 81 | steps: 82 | - name: Add do-not-merge label 83 | uses: actions/github-script@v7 84 | with: 85 | github-token: ${{ secrets.GH_TOKEN }} 86 | script: | 87 | github.rest.issues.addLabels({ 88 | issue_number: context.issue.number, 89 | owner: context.repo.owner, 90 | repo: context.repo.repo, 91 | labels: ['do-not-merge'] 92 | }) 93 | add-autoupdate-label: 94 | if: > 95 | github.event.issue.pull_request && 96 | github.event.issue.state != 'closed' && 97 | github.actor != 'asyncapi-bot' && 98 | ( 99 | contains(github.event.comment.body, '/autoupdate') || 100 | contains(github.event.comment.body, '/au' ) 101 | ) 102 | runs-on: ubuntu-latest 103 | steps: 104 | - name: Add autoupdate label 105 | uses: actions/github-script@v7 106 | with: 107 | github-token: ${{ secrets.GH_TOKEN }} 108 | script: | 109 | github.rest.issues.addLabels({ 110 | issue_number: context.issue.number, 111 | owner: context.repo.owner, 112 | repo: context.repo.repo, 113 | labels: ['autoupdate'] 114 | }) 115 | -------------------------------------------------------------------------------- /.github/workflows/if-nodejs-release.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # It does magic only if there is package.json file in the root of the project 5 | name: Release - if Node project 6 | 7 | on: 8 | push: 9 | branches: 10 | - master 11 | # below lines are not enough to have release supported for these branches 12 | # make sure configuration of `semantic-release` package mentions these branches 13 | - next-spec 14 | - next-major 15 | - next-major-spec 16 | - beta 17 | - alpha 18 | - next 19 | 20 | permissions: 21 | contents: write # to be able to publish a GitHub release 22 | issues: write # to be able to comment on released issues 23 | pull-requests: write # to be able to comment on released pull requests 24 | id-token: write # to enable use of OIDC for trusted publishing and npm provenance 25 | 26 | jobs: 27 | 28 | test-nodejs: 29 | # We just check the message of first commit as there is always just one commit because we squash into one before merging 30 | # "commits" contains array of objects where one of the properties is commit "message" 31 | # Release workflow will be skipped if release conventional commits are not used 32 | if: | 33 | startsWith( github.repository, 'asyncapi/' ) && 34 | (startsWith( github.event.commits[0].message , 'fix:' ) || 35 | startsWith( github.event.commits[0].message, 'fix!:' ) || 36 | startsWith( github.event.commits[0].message, 'feat:' ) || 37 | startsWith( github.event.commits[0].message, 'feat!:' )) 38 | name: Test NodeJS release on ${{ matrix.os }} 39 | runs-on: ${{ matrix.os }} 40 | strategy: 41 | matrix: 42 | os: [ubuntu-latest, macos-latest, windows-latest] 43 | steps: 44 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 45 | run: | 46 | git config --global core.autocrlf false 47 | git config --global core.eol lf 48 | shell: bash 49 | - name: Checkout repository 50 | uses: actions/checkout@v4 51 | - name: Check if Node.js project and has package.json 52 | id: packagejson 53 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 54 | shell: bash 55 | - if: steps.packagejson.outputs.exists == 'true' 56 | name: Determine what node version to use 57 | # This workflow is from our own org repo and safe to reference by 'master'. 58 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master # //NOSONAR 59 | with: 60 | node-version: ${{ vars.NODE_VERSION }} 61 | id: lockversion 62 | - if: steps.packagejson.outputs.exists == 'true' 63 | name: Setup Node.js 64 | uses: actions/setup-node@v4 65 | with: 66 | node-version: "${{ steps.lockversion.outputs.version }}" 67 | - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' 68 | name: Install npm cli 8 69 | shell: bash 70 | #npm cli 10 is buggy because of some cache issues 71 | run: npm install -g npm@8.19.4 72 | - if: steps.packagejson.outputs.exists == 'true' 73 | name: Install dependencies 74 | shell: bash 75 | run: npm ci 76 | - if: steps.packagejson.outputs.exists == 'true' 77 | name: Run test 78 | run: npm test --if-present 79 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 80 | name: Report workflow run status to Slack 81 | uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 #using https://github.com/8398a7/action-slack/releases/tag/v3.16.2 82 | with: 83 | status: ${{ job.status }} 84 | fields: repo,action,workflow 85 | text: 'Release workflow failed in testing job' 86 | env: 87 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} 88 | 89 | release: 90 | needs: [test-nodejs] 91 | name: Publish to any of NPM, Github, or Docker Hub 92 | runs-on: ubuntu-latest 93 | steps: 94 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 95 | run: | 96 | git config --global core.autocrlf false 97 | git config --global core.eol lf 98 | - name: Checkout repository 99 | uses: actions/checkout@v4 100 | - name: Check if Node.js project and has package.json 101 | id: packagejson 102 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 103 | shell: bash 104 | - if: steps.packagejson.outputs.exists == 'true' 105 | name: Determine what node version to use 106 | # This workflow is from our own org repo and safe to reference by 'master'. 107 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master # //NOSONAR 108 | with: 109 | node-version: ${{ vars.NODE_VERSION }} 110 | id: lockversion 111 | - if: steps.packagejson.outputs.exists == 'true' 112 | name: Setup Node.js 113 | uses: actions/setup-node@v4 114 | with: 115 | node-version: "${{ steps.lockversion.outputs.version }}" 116 | registry-url: "https://registry.npmjs.org" 117 | - if: steps.packagejson.outputs.exists == 'true' 118 | name: Install dependencies 119 | shell: bash 120 | run: npm ci 121 | - if: steps.packagejson.outputs.exists == 'true' 122 | name: Add plugin for conventional commits for semantic-release 123 | run: npm install --save-dev conventional-changelog-conventionalcommits@9.1.0 124 | - if: steps.packagejson.outputs.exists == 'true' 125 | name: Publish to any of NPM, Github, and Docker Hub 126 | id: release 127 | env: 128 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 129 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 130 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 131 | GIT_AUTHOR_NAME: asyncapi-bot 132 | GIT_AUTHOR_EMAIL: info@asyncapi.io 133 | GIT_COMMITTER_NAME: asyncapi-bot 134 | GIT_COMMITTER_EMAIL: info@asyncapi.io 135 | run: npx semantic-release@25.0.2 136 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 137 | name: Report workflow run status to Slack 138 | uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 #using https://github.com/8398a7/action-slack/releases/tag/v3.16.2 139 | with: 140 | status: ${{ job.status }} 141 | fields: repo,action,workflow 142 | text: 'Release workflow failed in release job' 143 | env: 144 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} 145 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant 3.0 Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We pledge to make our community welcoming, safe, and equitable for all. 7 | 8 | We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant. 9 | 10 | ## Encouraged Behaviors 11 | 12 | While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language. 13 | 14 | With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including: 15 | 16 | 1. Respecting the **purpose of our community**, our activities, and our ways of gathering. 17 | 2. Engaging **kindly and honestly** with others. 18 | 3. Respecting **different viewpoints** and experiences. 19 | 4. **Taking responsibility** for our actions and contributions. 20 | 5. Gracefully giving and accepting **constructive feedback**. 21 | 6. Committing to **repairing harm** when it occurs. 22 | 7. Behaving in other ways that promote and sustain the **well-being of our community**. 23 | 24 | 25 | ## Restricted Behaviors 26 | 27 | We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct. 28 | 29 | 1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop. 30 | 2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people. 31 | 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits. 32 | 4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community. 33 | 5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission. 34 | 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group. 35 | 7. Behaving in other ways that **threaten the well-being** of our community. 36 | 37 | ### Other Restrictions 38 | 39 | 1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions. 40 | 2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. 41 | 3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community. 42 | 4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors. 43 | 44 | 45 | ## Reporting an Issue 46 | 47 | Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm. 48 | 49 | When an incident does occur, it is important to report it promptly. To report a possible violation, here are a few simple ways to do it: 50 | 51 | - Join our [AsyncAPI Slack](https://asyncapi.com/slack-invite) and share your report in the `#coc` channel. 52 | - Reach out directly to any member of the [Code of Conduct Committee](https://github.com/orgs/asyncapi/teams/code_of_conduct). 53 | - Or, if you’d prefer, just send us an email at **conduct@asyncapi.com**. 54 | 55 | Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution. 56 | 57 | 58 | ## Addressing and Repairing Harm 59 | 60 | **** 61 | 62 | If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped. 63 | 64 | 1) Warning 65 | 1) Event: A violation involving a single incident or series of incidents. 66 | 2) Consequence: A private, written warning from the Community Moderators. 67 | 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations. 68 | 2) Temporarily Limited Activities 69 | 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation. 70 | 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members. 71 | 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over. 72 | 3) Temporary Suspension 73 | 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation. 74 | 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions. 75 | 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted. 76 | 4) Permanent Ban 77 | 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member. 78 | 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior. 79 | 3) Repair: There is no possible repair in cases of this severity. 80 | 81 | This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community. 82 | 83 | 84 | ## Scope 85 | 86 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 87 | 88 | 89 | ## Attribution 90 | 91 | This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/). 92 | 93 | Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/) 94 | 95 | For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion). -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![AsyncAPI logo](./assets/github-repobanner-nodewstemp.png)](https://www.asyncapi.com) 2 | 3 | ![npm](https://img.shields.io/npm/v/@asyncapi/nodejs-ws-template?style=for-the-badge) ![npm](https://img.shields.io/npm/dt/@asyncapi/nodejs-ws-template?style=for-the-badge) 4 | 5 | 6 | 7 | 8 | 9 | - [Overview](#overview) 10 | - [Technical requirements](#technical-requirements) 11 | - [Specification requirements](#specification-requirements) 12 | - [Supported protocols](#supported-protocols) 13 | - [How to use the template](#how-to-use-the-template) 14 | * [CLI](#cli) 15 | - [Template configuration](#template-configuration) 16 | - [Custom hooks that you can disable](#custom-hooks-that-you-can-disable) 17 | - [Development](#development) 18 | - [Contributors](#contributors) 19 | 20 | 21 | 22 | ## Overview 23 | 24 | This template generates two resources related to WebSockets: 25 | - Server application with WebSocket endpoint based on [Express.js](https://expressjs.com/) 26 | - Client HTML file with simple scripts that give you a basic API to talk to the server 27 | 28 | Other files are for the setup of developer environment, like `.editorconfig` or `.eslint`. 29 | 30 | ## Technical requirements 31 | 32 | - 0.50.0 =< [Generator](https://github.com/asyncapi/generator/) < 2.0.0, 33 | - Generator specific [requirements](https://github.com/asyncapi/generator/#requirements) 34 | 35 | 36 | ## Specification requirements 37 | 38 | This is a very early version of the template and not all specification features are supported: 39 | 40 | Property name | Reason | Fallback | Default 41 | ---|---|---|--- 42 | `servers.*.url` | Template doesn't support variables in the server url. | - | - 43 | `bindings` | Template doesn't use [websockets](https://github.com/asyncapi/bindings/tree/master/websockets) bindings.| - | - 44 | `operationId` | Operation ID must be set for every operation to generate proper functions as there is no fallback in place | - | - 45 | 46 | ## Supported protocols 47 | 48 | [WebSocket](https://en.wikipedia.org/wiki/WebSocket) 49 | 50 | ## How to use the template 51 | 52 | This template must be used with the AsyncAPI Generator. You can find all available options [here](https://github.com/asyncapi/generator/). 53 | 54 | ### CLI 55 | 56 | ```bash 57 | # Install the AsyncAPI Generator 58 | npm install -g @asyncapi/generator 59 | 60 | # Run generation 61 | ag https://raw.githubusercontent.com/asyncapi/generator/v1.4.0/test/docs/ws.yml @asyncapi/nodejs-ws-template -o output -p server=localhost 62 | 63 | ## 64 | ## Start the server 65 | ## 66 | 67 | # Go to the generated server 68 | cd output 69 | 70 | # Build generated application 71 | npm i 72 | 73 | # Start server 74 | npm start 75 | 76 | ## 77 | ## Start the client 78 | ## 79 | 80 | # From another terminal tab open generated HTML in browser 81 | open output/index.html 82 | 83 | # Open developers console and follow instructions from there 84 | # Connect with server 85 | listen('/echo') 86 | 87 | # Send example message 88 | send({ greet: 'Hello from client' }) 89 | 90 | # You should see the sent message in the logs of the previously started server 91 | ``` 92 | 93 | ## Template configuration 94 | 95 | You can configure this template by passing different parameters in the Generator CLI: `-p PARAM1_NAME=PARAM1_VALUE -p PARAM2_NAME=PARAM2_VALUE` 96 | 97 | | Name | Description | Required | Default | Allowed Values | Example 98 | |---|---|---|---|---|---| 99 | |server|The server you want to use in the code.|Yes| - | Name of the server from the list of servers under Servers object | `localhost`| 100 | 101 | 102 | ## Custom hooks that you can disable 103 | 104 | The functionality of this template is extended with different hooks that you can disable like this in the Generator CLI: `-d HOOK_TYPE1=HOOK_NAME1,HOOK_NAME2 -d HOOK_TYPE2` 105 | 106 | Type | Name | Description 107 | ---|---|--- 108 | generate:after | createAsyncapiFile | It creates AsyncAPI file with content of the spec file passed to the generator 109 | 110 | ## Development 111 | 112 | The most straightforward command to use this template is: 113 | ```bash 114 | ag https://raw.githubusercontent.com/asyncapi/generator/v1.4.0/test/docs/ws.yml @asyncapi/nodejs-ws-template -o output -p server=localhost 115 | ``` 116 | 117 | For local development, you need different variations of this command. First of all, you need to know about three important CLI flags: 118 | - `--debug` enables the debug mode in Nunjucks engine what makes filters debugging simpler. 119 | - `--watch-template` enables a watcher of changes that you make in the template. It regenerates your template whenever it detects a change. 120 | - `--install` enforces reinstallation of the template. 121 | 122 | 123 | There are two ways you can work on template development: 124 | - Use global Generator and template from your local sources: 125 | ```bash 126 | # assumption is that you run this command from the root of your template 127 | ag https://raw.githubusercontent.com/asyncapi/generator/v1.4.0/test/docs/ws.yml ./ -o output 128 | ``` 129 | - Use Generator from sources and template also from local sources. This approach enables more debugging options with awesome `console.log` in the Generator sources or even the Parser located in `node_modules` of the Generator: 130 | ```bash 131 | # assumption is that you run this command from the root of your template 132 | # assumption is that generator sources are cloned on the same level as the template 133 | ../generator/cli.js https://raw.githubusercontent.com/asyncapi/generator/v1.4.0/test/docs/ws.yml ./ -o output 134 | ``` 135 | 136 | 137 | ## Contributors 138 | 139 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 |
Fran Méndez
Fran Méndez

💻 🤔
Lukasz Gornicki
Lukasz Gornicki

🚇 💻 👀 🚧 📖 📝
Aayush Kumar Sahu
Aayush Kumar Sahu

🛡️
Katrina Knight
Katrina Knight

🚇
Olivier Lechevalier
Olivier Lechevalier

💻
Krishna Kumar S
Krishna Kumar S

⚠️
Ivan Kahl
Ivan Kahl

💻 ⚠️
157 | 158 | 159 | 160 | 161 | 162 | 163 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /.github/workflows/notify-tsc-members-mention.yml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository 5 | name: Notify slack and email subscribers whenever TSC members are mentioned in GitHub 6 | 7 | on: 8 | issue_comment: 9 | types: 10 | - created 11 | 12 | discussion_comment: 13 | types: 14 | - created 15 | 16 | issues: 17 | types: 18 | - opened 19 | 20 | pull_request_target: 21 | types: 22 | - opened 23 | 24 | discussion: 25 | types: 26 | - created 27 | 28 | jobs: 29 | issue: 30 | if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members') 31 | name: TSC notification on every new issue 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: Checkout repository 35 | uses: actions/checkout@v4 36 | - name: Setup Node.js 37 | uses: actions/setup-node@v4 38 | with: 39 | node-version: 16 40 | cache: 'npm' 41 | cache-dependency-path: '**/package-lock.json' 42 | ######### 43 | # Handling Slack notifications 44 | ######### 45 | - name: Convert markdown to slack markdown 46 | # This workflow is from our own org repo and safe to reference by 'master'. 47 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 48 | id: issuemarkdown 49 | with: 50 | markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" 51 | - name: Send info about issue 52 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 53 | env: 54 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 55 | SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘 56 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 57 | MSG_MINIMAL: true 58 | ######### 59 | # Handling Mailchimp notifications 60 | ######### 61 | - name: Install deps 62 | run: npm install 63 | working-directory: ./.github/workflows/scripts/mailchimp 64 | - name: Send email with MailChimp 65 | uses: actions/github-script@v7 66 | env: 67 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 68 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 69 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 70 | TITLE: ${{ github.event.issue.title }} 71 | with: 72 | script: | 73 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 74 | sendEmail('${{github.event.issue.html_url}}', process.env.TITLE); 75 | 76 | pull_request: 77 | if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members') 78 | name: TSC notification on every new pull request 79 | runs-on: ubuntu-latest 80 | steps: 81 | - name: Checkout repository 82 | uses: actions/checkout@v4 83 | - name: Setup Node.js 84 | uses: actions/setup-node@v4 85 | with: 86 | node-version: 16 87 | cache: 'npm' 88 | cache-dependency-path: '**/package-lock.json' 89 | ######### 90 | # Handling Slack notifications 91 | ######### 92 | - name: Convert markdown to slack markdown 93 | # This workflow is from our own org repo and safe to reference by 'master'. 94 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 95 | id: prmarkdown 96 | with: 97 | markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" 98 | - name: Send info about pull request 99 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 100 | env: 101 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 102 | SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘 103 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 104 | MSG_MINIMAL: true 105 | ######### 106 | # Handling Mailchimp notifications 107 | ######### 108 | - name: Install deps 109 | run: npm install 110 | working-directory: ./.github/workflows/scripts/mailchimp 111 | - name: Send email with MailChimp 112 | uses: actions/github-script@v7 113 | env: 114 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 115 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 116 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 117 | TITLE: ${{ github.event.pull_request.title }} 118 | with: 119 | script: | 120 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 121 | sendEmail('${{github.event.pull_request.html_url}}', process.env.TITLE); 122 | 123 | discussion: 124 | if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members') 125 | name: TSC notification on every new discussion 126 | runs-on: ubuntu-latest 127 | steps: 128 | - name: Checkout repository 129 | uses: actions/checkout@v4 130 | - name: Setup Node.js 131 | uses: actions/setup-node@v4 132 | with: 133 | node-version: 16 134 | cache: 'npm' 135 | cache-dependency-path: '**/package-lock.json' 136 | ######### 137 | # Handling Slack notifications 138 | ######### 139 | - name: Convert markdown to slack markdown 140 | # This workflow is from our own org repo and safe to reference by 'master'. 141 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 142 | id: discussionmarkdown 143 | with: 144 | markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" 145 | - name: Send info about pull request 146 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 147 | env: 148 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 149 | SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘 150 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 151 | MSG_MINIMAL: true 152 | ######### 153 | # Handling Mailchimp notifications 154 | ######### 155 | - name: Install deps 156 | run: npm install 157 | working-directory: ./.github/workflows/scripts/mailchimp 158 | - name: Send email with MailChimp 159 | uses: actions/github-script@v7 160 | env: 161 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 162 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 163 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 164 | TITLE: ${{ github.event.discussion.title }} 165 | with: 166 | script: | 167 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 168 | sendEmail('${{github.event.discussion.html_url}}', process.env.TITLE); 169 | 170 | issue_comment: 171 | if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }} 172 | name: TSC notification on every new comment in issue 173 | runs-on: ubuntu-latest 174 | steps: 175 | - name: Checkout repository 176 | uses: actions/checkout@v4 177 | - name: Setup Node.js 178 | uses: actions/setup-node@v4 179 | with: 180 | node-version: 16 181 | cache: 'npm' 182 | cache-dependency-path: '**/package-lock.json' 183 | ######### 184 | # Handling Slack notifications 185 | ######### 186 | - name: Convert markdown to slack markdown 187 | # This workflow is from our own org repo and safe to reference by 'master'. 188 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 189 | id: issuemarkdown 190 | with: 191 | markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 192 | - name: Send info about issue comment 193 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 194 | env: 195 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 196 | SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘 197 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 198 | MSG_MINIMAL: true 199 | ######### 200 | # Handling Mailchimp notifications 201 | ######### 202 | - name: Install deps 203 | run: npm install 204 | working-directory: ./.github/workflows/scripts/mailchimp 205 | - name: Send email with MailChimp 206 | uses: actions/github-script@v7 207 | env: 208 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 209 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 210 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 211 | TITLE: ${{ github.event.issue.title }} 212 | with: 213 | script: | 214 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 215 | sendEmail('${{github.event.comment.html_url}}', process.env.TITLE); 216 | 217 | pr_comment: 218 | if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') 219 | name: TSC notification on every new comment in pr 220 | runs-on: ubuntu-latest 221 | steps: 222 | - name: Checkout repository 223 | uses: actions/checkout@v4 224 | - name: Setup Node.js 225 | uses: actions/setup-node@v4 226 | with: 227 | node-version: 16 228 | cache: 'npm' 229 | cache-dependency-path: '**/package-lock.json' 230 | ######### 231 | # Handling Slack notifications 232 | ######### 233 | - name: Convert markdown to slack markdown 234 | # This workflow is from our own org repo and safe to reference by 'master'. 235 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 236 | id: prmarkdown 237 | with: 238 | markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 239 | - name: Send info about PR comment 240 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 241 | env: 242 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 243 | SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘 244 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 245 | MSG_MINIMAL: true 246 | ######### 247 | # Handling Mailchimp notifications 248 | ######### 249 | - name: Install deps 250 | run: npm install 251 | working-directory: ./.github/workflows/scripts/mailchimp 252 | - name: Send email with MailChimp 253 | uses: actions/github-script@v7 254 | env: 255 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 256 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 257 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 258 | TITLE: ${{ github.event.issue.title }} 259 | with: 260 | script: | 261 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 262 | sendEmail('${{github.event.comment.html_url}}', process.env.TITLE); 263 | 264 | discussion_comment: 265 | if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members') 266 | name: TSC notification on every new comment in discussion 267 | runs-on: ubuntu-latest 268 | steps: 269 | - name: Checkout repository 270 | uses: actions/checkout@v4 271 | - name: Setup Node.js 272 | uses: actions/setup-node@v4 273 | with: 274 | node-version: 16 275 | cache: 'npm' 276 | cache-dependency-path: '**/package-lock.json' 277 | ######### 278 | # Handling Slack notifications 279 | ######### 280 | - name: Convert markdown to slack markdown 281 | # This workflow is from our own org repo and safe to reference by 'master'. 282 | uses: asyncapi/.github/.github/actions/slackify-markdown@master # //NOSONAR 283 | id: discussionmarkdown 284 | with: 285 | markdown: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 286 | - name: Send info about discussion comment 287 | uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # Using v2.3.2 288 | env: 289 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 290 | SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘 291 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 292 | MSG_MINIMAL: true 293 | ######### 294 | # Handling Mailchimp notifications 295 | ######### 296 | - name: Install deps 297 | run: npm install 298 | working-directory: ./.github/workflows/scripts/mailchimp 299 | - name: Send email with MailChimp 300 | uses: actions/github-script@v7 301 | env: 302 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 303 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 304 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 305 | TITLE: ${{ github.event.discussion.title }} 306 | with: 307 | script: | 308 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 309 | sendEmail('${{github.event.comment.html_url}}', process.env.TITLE); 310 | -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/htmlContent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is centrally managed in https://github.com/asyncapi/.github/ 3 | * Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 4 | */ 5 | module.exports = (link, title) => { 6 | 7 | return ` 8 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | *|MC:SUBJECT|* 23 | 24 | 350 | 351 | 352 | 353 | 354 |
355 | 356 | 357 | 489 | 490 |
358 | 359 | 364 | 365 | 366 | 405 | 406 | 407 | 443 | 444 | 445 | 480 | 481 |
367 | 368 | 369 | 402 | 403 | 404 |
370 | 374 | 375 | 378 | 379 | 380 | 381 | 391 | 392 |
382 | 383 | Hey *|FNAME|*,
384 |
385 | There is a new topic at AsyncAPI Initiative that requires Technical Steering Committee attention. 386 |
387 | Please have a look if it is just something you need to be aware of, or maybe your vote is needed. 388 |
389 | Topic: ${ title }. 390 |
393 | 396 | 397 | 401 |
408 | 409 | 410 | 411 | 412 | 440 | 441 | 442 |
413 | 417 | 418 | 421 | 422 | 423 | 424 | 429 | 430 |
425 | 426 | Cheers,
427 | AsyncAPI Initiative 428 |
431 | 434 | 435 | 439 |
446 | 447 | 448 | 477 | 478 | 479 |
449 | 453 | 454 | 457 | 458 | 459 | 460 | 466 | 467 |
461 | 462 | Want to change how you receive these emails?
463 | You can update your preferences or unsubscribe from this list.
464 |   465 |
468 | 471 | 472 | 476 |
482 | 487 | 488 |
491 |
492 | 493 | 494 | ` 495 | } -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schedule-email", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "name": "schedule-email", 8 | "license": "Apache 2.0", 9 | "dependencies": { 10 | "@actions/core": "1.6.0", 11 | "@mailchimp/mailchimp_marketing": "3.0.74" 12 | } 13 | }, 14 | "node_modules/@actions/core": { 15 | "version": "1.6.0", 16 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", 17 | "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", 18 | "dependencies": { 19 | "@actions/http-client": "^1.0.11" 20 | } 21 | }, 22 | "node_modules/@actions/http-client": { 23 | "version": "1.0.11", 24 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", 25 | "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", 26 | "dependencies": { 27 | "tunnel": "0.0.6" 28 | } 29 | }, 30 | "node_modules/@mailchimp/mailchimp_marketing": { 31 | "version": "3.0.74", 32 | "resolved": "https://registry.npmjs.org/@mailchimp/mailchimp_marketing/-/mailchimp_marketing-3.0.74.tgz", 33 | "integrity": "sha512-039iu4GRr7wpXqweBLuS05wvOBtPxSa31cjxgftBYSt7031f0sHEi8Up2DicfbSuQK0AynPDeVyuxrb31Lx+yQ==", 34 | "dependencies": { 35 | "dotenv": "^8.2.0", 36 | "superagent": "3.8.1" 37 | }, 38 | "engines": { 39 | "node": ">=10.0.0" 40 | } 41 | }, 42 | "node_modules/asynckit": { 43 | "version": "0.4.0", 44 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 45 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 46 | }, 47 | "node_modules/call-bind": { 48 | "version": "1.0.2", 49 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 50 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 51 | "dependencies": { 52 | "function-bind": "^1.1.1", 53 | "get-intrinsic": "^1.0.2" 54 | }, 55 | "funding": { 56 | "url": "https://github.com/sponsors/ljharb" 57 | } 58 | }, 59 | "node_modules/call-bind-apply-helpers": { 60 | "version": "1.0.2", 61 | "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", 62 | "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", 63 | "dependencies": { 64 | "es-errors": "^1.3.0", 65 | "function-bind": "^1.1.2" 66 | }, 67 | "engines": { 68 | "node": ">= 0.4" 69 | } 70 | }, 71 | "node_modules/combined-stream": { 72 | "version": "1.0.8", 73 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 74 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 75 | "dependencies": { 76 | "delayed-stream": "~1.0.0" 77 | }, 78 | "engines": { 79 | "node": ">= 0.8" 80 | } 81 | }, 82 | "node_modules/component-emitter": { 83 | "version": "1.3.0", 84 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 85 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" 86 | }, 87 | "node_modules/cookiejar": { 88 | "version": "2.1.3", 89 | "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", 90 | "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" 91 | }, 92 | "node_modules/core-util-is": { 93 | "version": "1.0.3", 94 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 95 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 96 | }, 97 | "node_modules/delayed-stream": { 98 | "version": "1.0.0", 99 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 100 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 101 | "engines": { 102 | "node": ">=0.4.0" 103 | } 104 | }, 105 | "node_modules/dotenv": { 106 | "version": "8.6.0", 107 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", 108 | "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", 109 | "engines": { 110 | "node": ">=10" 111 | } 112 | }, 113 | "node_modules/dunder-proto": { 114 | "version": "1.0.1", 115 | "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", 116 | "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", 117 | "dependencies": { 118 | "call-bind-apply-helpers": "^1.0.1", 119 | "es-errors": "^1.3.0", 120 | "gopd": "^1.2.0" 121 | }, 122 | "engines": { 123 | "node": ">= 0.4" 124 | } 125 | }, 126 | "node_modules/es-define-property": { 127 | "version": "1.0.1", 128 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", 129 | "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", 130 | "engines": { 131 | "node": ">= 0.4" 132 | } 133 | }, 134 | "node_modules/es-errors": { 135 | "version": "1.3.0", 136 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 137 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 138 | "engines": { 139 | "node": ">= 0.4" 140 | } 141 | }, 142 | "node_modules/es-object-atoms": { 143 | "version": "1.1.1", 144 | "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", 145 | "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", 146 | "dependencies": { 147 | "es-errors": "^1.3.0" 148 | }, 149 | "engines": { 150 | "node": ">= 0.4" 151 | } 152 | }, 153 | "node_modules/es-set-tostringtag": { 154 | "version": "2.1.0", 155 | "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", 156 | "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", 157 | "dependencies": { 158 | "es-errors": "^1.3.0", 159 | "get-intrinsic": "^1.2.6", 160 | "has-tostringtag": "^1.0.2", 161 | "hasown": "^2.0.2" 162 | }, 163 | "engines": { 164 | "node": ">= 0.4" 165 | } 166 | }, 167 | "node_modules/extend": { 168 | "version": "3.0.2", 169 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 170 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 171 | }, 172 | "node_modules/form-data": { 173 | "version": "2.5.5", 174 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", 175 | "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", 176 | "dependencies": { 177 | "asynckit": "^0.4.0", 178 | "combined-stream": "^1.0.8", 179 | "es-set-tostringtag": "^2.1.0", 180 | "hasown": "^2.0.2", 181 | "mime-types": "^2.1.35", 182 | "safe-buffer": "^5.2.1" 183 | }, 184 | "engines": { 185 | "node": ">= 0.12" 186 | } 187 | }, 188 | "node_modules/formidable": { 189 | "version": "1.2.6", 190 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", 191 | "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==", 192 | "deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau", 193 | "funding": { 194 | "url": "https://ko-fi.com/tunnckoCore/commissions" 195 | } 196 | }, 197 | "node_modules/function-bind": { 198 | "version": "1.1.2", 199 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 200 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 201 | "funding": { 202 | "url": "https://github.com/sponsors/ljharb" 203 | } 204 | }, 205 | "node_modules/get-intrinsic": { 206 | "version": "1.3.0", 207 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", 208 | "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", 209 | "dependencies": { 210 | "call-bind-apply-helpers": "^1.0.2", 211 | "es-define-property": "^1.0.1", 212 | "es-errors": "^1.3.0", 213 | "es-object-atoms": "^1.1.1", 214 | "function-bind": "^1.1.2", 215 | "get-proto": "^1.0.1", 216 | "gopd": "^1.2.0", 217 | "has-symbols": "^1.1.0", 218 | "hasown": "^2.0.2", 219 | "math-intrinsics": "^1.1.0" 220 | }, 221 | "engines": { 222 | "node": ">= 0.4" 223 | }, 224 | "funding": { 225 | "url": "https://github.com/sponsors/ljharb" 226 | } 227 | }, 228 | "node_modules/get-proto": { 229 | "version": "1.0.1", 230 | "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", 231 | "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", 232 | "dependencies": { 233 | "dunder-proto": "^1.0.1", 234 | "es-object-atoms": "^1.0.0" 235 | }, 236 | "engines": { 237 | "node": ">= 0.4" 238 | } 239 | }, 240 | "node_modules/gopd": { 241 | "version": "1.2.0", 242 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", 243 | "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", 244 | "engines": { 245 | "node": ">= 0.4" 246 | }, 247 | "funding": { 248 | "url": "https://github.com/sponsors/ljharb" 249 | } 250 | }, 251 | "node_modules/has-symbols": { 252 | "version": "1.1.0", 253 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", 254 | "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", 255 | "engines": { 256 | "node": ">= 0.4" 257 | }, 258 | "funding": { 259 | "url": "https://github.com/sponsors/ljharb" 260 | } 261 | }, 262 | "node_modules/has-tostringtag": { 263 | "version": "1.0.2", 264 | "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", 265 | "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", 266 | "dependencies": { 267 | "has-symbols": "^1.0.3" 268 | }, 269 | "engines": { 270 | "node": ">= 0.4" 271 | }, 272 | "funding": { 273 | "url": "https://github.com/sponsors/ljharb" 274 | } 275 | }, 276 | "node_modules/hasown": { 277 | "version": "2.0.2", 278 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 279 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 280 | "dependencies": { 281 | "function-bind": "^1.1.2" 282 | }, 283 | "engines": { 284 | "node": ">= 0.4" 285 | } 286 | }, 287 | "node_modules/inherits": { 288 | "version": "2.0.4", 289 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 290 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 291 | }, 292 | "node_modules/isarray": { 293 | "version": "1.0.0", 294 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 295 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 296 | }, 297 | "node_modules/math-intrinsics": { 298 | "version": "1.1.0", 299 | "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", 300 | "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", 301 | "engines": { 302 | "node": ">= 0.4" 303 | } 304 | }, 305 | "node_modules/methods": { 306 | "version": "1.1.2", 307 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 308 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", 309 | "engines": { 310 | "node": ">= 0.6" 311 | } 312 | }, 313 | "node_modules/mime": { 314 | "version": "1.6.0", 315 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 316 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 317 | "bin": { 318 | "mime": "cli.js" 319 | }, 320 | "engines": { 321 | "node": ">=4" 322 | } 323 | }, 324 | "node_modules/mime-db": { 325 | "version": "1.52.0", 326 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 327 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 328 | "engines": { 329 | "node": ">= 0.6" 330 | } 331 | }, 332 | "node_modules/mime-types": { 333 | "version": "2.1.35", 334 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 335 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 336 | "dependencies": { 337 | "mime-db": "1.52.0" 338 | }, 339 | "engines": { 340 | "node": ">= 0.6" 341 | } 342 | }, 343 | "node_modules/ms": { 344 | "version": "2.1.3", 345 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 346 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 347 | }, 348 | "node_modules/object-inspect": { 349 | "version": "1.12.0", 350 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", 351 | "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", 352 | "funding": { 353 | "url": "https://github.com/sponsors/ljharb" 354 | } 355 | }, 356 | "node_modules/process-nextick-args": { 357 | "version": "2.0.1", 358 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 359 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 360 | }, 361 | "node_modules/qs": { 362 | "version": "6.10.3", 363 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", 364 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", 365 | "dependencies": { 366 | "side-channel": "^1.0.4" 367 | }, 368 | "engines": { 369 | "node": ">=0.6" 370 | }, 371 | "funding": { 372 | "url": "https://github.com/sponsors/ljharb" 373 | } 374 | }, 375 | "node_modules/readable-stream": { 376 | "version": "2.3.7", 377 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 378 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 379 | "dependencies": { 380 | "core-util-is": "~1.0.0", 381 | "inherits": "~2.0.3", 382 | "isarray": "~1.0.0", 383 | "process-nextick-args": "~2.0.0", 384 | "safe-buffer": "~5.1.1", 385 | "string_decoder": "~1.1.1", 386 | "util-deprecate": "~1.0.1" 387 | } 388 | }, 389 | "node_modules/readable-stream/node_modules/safe-buffer": { 390 | "version": "5.1.2", 391 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 392 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 393 | }, 394 | "node_modules/safe-buffer": { 395 | "version": "5.2.1", 396 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 397 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 398 | "funding": [ 399 | { 400 | "type": "github", 401 | "url": "https://github.com/sponsors/feross" 402 | }, 403 | { 404 | "type": "patreon", 405 | "url": "https://www.patreon.com/feross" 406 | }, 407 | { 408 | "type": "consulting", 409 | "url": "https://feross.org/support" 410 | } 411 | ] 412 | }, 413 | "node_modules/side-channel": { 414 | "version": "1.0.4", 415 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 416 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 417 | "dependencies": { 418 | "call-bind": "^1.0.0", 419 | "get-intrinsic": "^1.0.2", 420 | "object-inspect": "^1.9.0" 421 | }, 422 | "funding": { 423 | "url": "https://github.com/sponsors/ljharb" 424 | } 425 | }, 426 | "node_modules/string_decoder": { 427 | "version": "1.1.1", 428 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 429 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 430 | "dependencies": { 431 | "safe-buffer": "~5.1.0" 432 | } 433 | }, 434 | "node_modules/string_decoder/node_modules/safe-buffer": { 435 | "version": "5.1.2", 436 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 437 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 438 | }, 439 | "node_modules/superagent": { 440 | "version": "3.8.1", 441 | "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", 442 | "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", 443 | "deprecated": "Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at .", 444 | "dependencies": { 445 | "component-emitter": "^1.2.0", 446 | "cookiejar": "^2.1.0", 447 | "debug": "^3.1.0", 448 | "extend": "^3.0.0", 449 | "form-data": "^2.3.1", 450 | "formidable": "^1.1.1", 451 | "methods": "^1.1.1", 452 | "mime": "^1.4.1", 453 | "qs": "^6.5.1", 454 | "readable-stream": "^2.0.5" 455 | }, 456 | "engines": { 457 | "node": ">= 4.0" 458 | } 459 | }, 460 | "node_modules/superagent/node_modules/debug": { 461 | "version": "3.2.7", 462 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 463 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 464 | "dependencies": { 465 | "ms": "^2.1.1" 466 | } 467 | }, 468 | "node_modules/tunnel": { 469 | "version": "0.0.6", 470 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 471 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 472 | "engines": { 473 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 474 | } 475 | }, 476 | "node_modules/util-deprecate": { 477 | "version": "1.0.2", 478 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 479 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 480 | } 481 | }, 482 | "dependencies": { 483 | "@actions/core": { 484 | "version": "1.6.0", 485 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", 486 | "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", 487 | "requires": { 488 | "@actions/http-client": "^1.0.11" 489 | } 490 | }, 491 | "@actions/http-client": { 492 | "version": "1.0.11", 493 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", 494 | "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", 495 | "requires": { 496 | "tunnel": "0.0.6" 497 | } 498 | }, 499 | "@mailchimp/mailchimp_marketing": { 500 | "version": "3.0.74", 501 | "resolved": "https://registry.npmjs.org/@mailchimp/mailchimp_marketing/-/mailchimp_marketing-3.0.74.tgz", 502 | "integrity": "sha512-039iu4GRr7wpXqweBLuS05wvOBtPxSa31cjxgftBYSt7031f0sHEi8Up2DicfbSuQK0AynPDeVyuxrb31Lx+yQ==", 503 | "requires": { 504 | "dotenv": "^8.2.0", 505 | "superagent": "3.8.1" 506 | } 507 | }, 508 | "asynckit": { 509 | "version": "0.4.0", 510 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 511 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 512 | }, 513 | "call-bind": { 514 | "version": "1.0.2", 515 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 516 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 517 | "requires": { 518 | "function-bind": "^1.1.1", 519 | "get-intrinsic": "^1.0.2" 520 | } 521 | }, 522 | "call-bind-apply-helpers": { 523 | "version": "1.0.2", 524 | "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", 525 | "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", 526 | "requires": { 527 | "es-errors": "^1.3.0", 528 | "function-bind": "^1.1.2" 529 | } 530 | }, 531 | "combined-stream": { 532 | "version": "1.0.8", 533 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 534 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 535 | "requires": { 536 | "delayed-stream": "~1.0.0" 537 | } 538 | }, 539 | "component-emitter": { 540 | "version": "1.3.0", 541 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 542 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" 543 | }, 544 | "cookiejar": { 545 | "version": "2.1.3", 546 | "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", 547 | "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" 548 | }, 549 | "core-util-is": { 550 | "version": "1.0.3", 551 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 552 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 553 | }, 554 | "delayed-stream": { 555 | "version": "1.0.0", 556 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 557 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 558 | }, 559 | "dotenv": { 560 | "version": "8.6.0", 561 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", 562 | "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==" 563 | }, 564 | "dunder-proto": { 565 | "version": "1.0.1", 566 | "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", 567 | "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", 568 | "requires": { 569 | "call-bind-apply-helpers": "^1.0.1", 570 | "es-errors": "^1.3.0", 571 | "gopd": "^1.2.0" 572 | } 573 | }, 574 | "es-define-property": { 575 | "version": "1.0.1", 576 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", 577 | "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" 578 | }, 579 | "es-errors": { 580 | "version": "1.3.0", 581 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 582 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" 583 | }, 584 | "es-object-atoms": { 585 | "version": "1.1.1", 586 | "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", 587 | "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", 588 | "requires": { 589 | "es-errors": "^1.3.0" 590 | } 591 | }, 592 | "es-set-tostringtag": { 593 | "version": "2.1.0", 594 | "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", 595 | "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", 596 | "requires": { 597 | "es-errors": "^1.3.0", 598 | "get-intrinsic": "^1.2.6", 599 | "has-tostringtag": "^1.0.2", 600 | "hasown": "^2.0.2" 601 | } 602 | }, 603 | "extend": { 604 | "version": "3.0.2", 605 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 606 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 607 | }, 608 | "form-data": { 609 | "version": "2.5.5", 610 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", 611 | "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", 612 | "requires": { 613 | "asynckit": "^0.4.0", 614 | "combined-stream": "^1.0.8", 615 | "es-set-tostringtag": "^2.1.0", 616 | "hasown": "^2.0.2", 617 | "mime-types": "^2.1.35", 618 | "safe-buffer": "^5.2.1" 619 | } 620 | }, 621 | "formidable": { 622 | "version": "1.2.6", 623 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", 624 | "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==" 625 | }, 626 | "function-bind": { 627 | "version": "1.1.2", 628 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 629 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" 630 | }, 631 | "get-intrinsic": { 632 | "version": "1.3.0", 633 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", 634 | "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", 635 | "requires": { 636 | "call-bind-apply-helpers": "^1.0.2", 637 | "es-define-property": "^1.0.1", 638 | "es-errors": "^1.3.0", 639 | "es-object-atoms": "^1.1.1", 640 | "function-bind": "^1.1.2", 641 | "get-proto": "^1.0.1", 642 | "gopd": "^1.2.0", 643 | "has-symbols": "^1.1.0", 644 | "hasown": "^2.0.2", 645 | "math-intrinsics": "^1.1.0" 646 | } 647 | }, 648 | "get-proto": { 649 | "version": "1.0.1", 650 | "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", 651 | "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", 652 | "requires": { 653 | "dunder-proto": "^1.0.1", 654 | "es-object-atoms": "^1.0.0" 655 | } 656 | }, 657 | "gopd": { 658 | "version": "1.2.0", 659 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", 660 | "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" 661 | }, 662 | "has-symbols": { 663 | "version": "1.1.0", 664 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", 665 | "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" 666 | }, 667 | "has-tostringtag": { 668 | "version": "1.0.2", 669 | "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", 670 | "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", 671 | "requires": { 672 | "has-symbols": "^1.0.3" 673 | } 674 | }, 675 | "hasown": { 676 | "version": "2.0.2", 677 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 678 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 679 | "requires": { 680 | "function-bind": "^1.1.2" 681 | } 682 | }, 683 | "inherits": { 684 | "version": "2.0.4", 685 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 686 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 687 | }, 688 | "isarray": { 689 | "version": "1.0.0", 690 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 691 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 692 | }, 693 | "math-intrinsics": { 694 | "version": "1.1.0", 695 | "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", 696 | "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" 697 | }, 698 | "methods": { 699 | "version": "1.1.2", 700 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 701 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 702 | }, 703 | "mime": { 704 | "version": "1.6.0", 705 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 706 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 707 | }, 708 | "mime-db": { 709 | "version": "1.52.0", 710 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 711 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" 712 | }, 713 | "mime-types": { 714 | "version": "2.1.35", 715 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 716 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 717 | "requires": { 718 | "mime-db": "1.52.0" 719 | } 720 | }, 721 | "ms": { 722 | "version": "2.1.3", 723 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 724 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 725 | }, 726 | "object-inspect": { 727 | "version": "1.12.0", 728 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", 729 | "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" 730 | }, 731 | "process-nextick-args": { 732 | "version": "2.0.1", 733 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 734 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 735 | }, 736 | "qs": { 737 | "version": "6.10.3", 738 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", 739 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", 740 | "requires": { 741 | "side-channel": "^1.0.4" 742 | } 743 | }, 744 | "readable-stream": { 745 | "version": "2.3.7", 746 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 747 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 748 | "requires": { 749 | "core-util-is": "~1.0.0", 750 | "inherits": "~2.0.3", 751 | "isarray": "~1.0.0", 752 | "process-nextick-args": "~2.0.0", 753 | "safe-buffer": "~5.1.1", 754 | "string_decoder": "~1.1.1", 755 | "util-deprecate": "~1.0.1" 756 | }, 757 | "dependencies": { 758 | "safe-buffer": { 759 | "version": "5.1.2", 760 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 761 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 762 | } 763 | } 764 | }, 765 | "safe-buffer": { 766 | "version": "5.2.1", 767 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 768 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 769 | }, 770 | "side-channel": { 771 | "version": "1.0.4", 772 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 773 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 774 | "requires": { 775 | "call-bind": "^1.0.0", 776 | "get-intrinsic": "^1.0.2", 777 | "object-inspect": "^1.9.0" 778 | } 779 | }, 780 | "string_decoder": { 781 | "version": "1.1.1", 782 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 783 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 784 | "requires": { 785 | "safe-buffer": "~5.1.0" 786 | }, 787 | "dependencies": { 788 | "safe-buffer": { 789 | "version": "5.1.2", 790 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 791 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 792 | } 793 | } 794 | }, 795 | "superagent": { 796 | "version": "3.8.1", 797 | "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", 798 | "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", 799 | "requires": { 800 | "component-emitter": "^1.2.0", 801 | "cookiejar": "^2.1.0", 802 | "debug": "^3.1.0", 803 | "extend": "^3.0.0", 804 | "form-data": "^2.3.1", 805 | "formidable": "^1.1.1", 806 | "methods": "^1.1.1", 807 | "mime": "^1.4.1", 808 | "qs": "^6.5.1", 809 | "readable-stream": "^2.0.5" 810 | }, 811 | "dependencies": { 812 | "debug": { 813 | "version": "3.2.7", 814 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 815 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 816 | "requires": { 817 | "ms": "^2.1.1" 818 | } 819 | } 820 | } 821 | }, 822 | "tunnel": { 823 | "version": "0.0.6", 824 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 825 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" 826 | }, 827 | "util-deprecate": { 828 | "version": "1.0.2", 829 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 830 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 831 | } 832 | } 833 | } 834 | --------------------------------------------------------------------------------