├── .eslintignore ├── assets └── img │ ├── cupid.jpeg │ ├── mermaid.png │ ├── plantUML.png │ ├── reactFlow.png │ ├── defaultOutput.png │ └── readme-banner.png ├── .gitignore ├── lib ├── index.js ├── utils.js ├── getPlantUMLDiagram.js ├── getMermaidFlowchart.js ├── getReactFlowData.js └── appRelationsDiscovery.js ├── .github └── workflows │ ├── scripts │ ├── README.md │ └── mailchimp │ │ ├── package.json │ │ ├── index.js │ │ ├── htmlContent.js │ │ └── package-lock.json │ ├── coverall.yml │ ├── automerge-for-humans-remove-ready-to-merge-label-on-edit.yml │ ├── autoupdate.yml │ ├── bump.yml │ ├── automerge.yml │ ├── please-take-a-look-command.yml │ ├── lint-pr-title.yml │ ├── stale-issues-prs.yml │ ├── if-nodejs-version-bump.yml │ ├── automerge-orphans.yml │ ├── add-good-first-issue-labels.yml │ ├── help-command.yml │ ├── bounty-program-commands.yml │ ├── issues-prs-notifications.yml │ ├── if-nodejs-pr-testing.yml │ ├── automerge-for-humans-merging.yml │ ├── release-announcements.yml │ ├── welcome-first-time-contrib.yml │ ├── automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml │ ├── if-nodejs-release.yml │ └── notify-tsc-members-mention.yml ├── test ├── examples │ ├── common │ │ ├── schemas │ │ │ ├── user.yaml │ │ │ ├── flight.yaml │ │ │ └── segment.yaml │ │ └── messages │ │ │ ├── flight_queue.yaml │ │ │ └── flight_status.yaml │ └── flightService │ │ ├── notifier.yaml │ │ ├── subscriber.yaml │ │ └── monitor.yaml ├── testsUtil.js └── appRelationsDiscovery_test.js ├── CODEOWNERS ├── package.json ├── .eslintrc ├── CODE_OF_CONDUCT.md ├── API.md ├── CONTRIBUTING.md ├── README.md └── LICENSE /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | local 4 | .vscode 5 | .idea 6 | coverage 7 | *.DS_Store -------------------------------------------------------------------------------- /assets/img/cupid.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi-archived-repos/cupid/HEAD/assets/img/cupid.jpeg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | dist 3 | local 4 | .vscode 5 | .idea 6 | coverage 7 | *.DS_Store 8 | .nyc_output -------------------------------------------------------------------------------- /assets/img/mermaid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi-archived-repos/cupid/HEAD/assets/img/mermaid.png -------------------------------------------------------------------------------- /assets/img/plantUML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi-archived-repos/cupid/HEAD/assets/img/plantUML.png -------------------------------------------------------------------------------- /assets/img/reactFlow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi-archived-repos/cupid/HEAD/assets/img/reactFlow.png -------------------------------------------------------------------------------- /assets/img/defaultOutput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi-archived-repos/cupid/HEAD/assets/img/defaultOutput.png -------------------------------------------------------------------------------- /assets/img/readme-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi-archived-repos/cupid/HEAD/assets/img/readme-banner.png -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | const appRelationsDiscovery = require('./appRelationsDiscovery'); 2 | 3 | module.exports = appRelationsDiscovery; -------------------------------------------------------------------------------- /.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. -------------------------------------------------------------------------------- /test/examples/common/schemas/user.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | userName: 4 | type: string 5 | minimum: 1 6 | description: user name 7 | example: "John Smith" 8 | phoneNumber: 9 | type: string 10 | minimum: 5 11 | description: phone number where notifications will be received. 12 | example: "+13451235" 13 | -------------------------------------------------------------------------------- /.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 | } -------------------------------------------------------------------------------- /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 | * @arjungarg07 @magicmatatjahu @derberg @asyncapi-bot-eve -------------------------------------------------------------------------------- /test/examples/common/schemas/flight.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | carrierCode: 4 | type: string 5 | description: 2 to 3-character IATA carrier code 6 | example: "LH" 7 | flightNumber: 8 | type: integer 9 | minimum: 1 10 | description: 1 to 4-digit number of the flight 11 | example: "193" 12 | scheduledDepartureDate: 13 | type: string 14 | format: date-time 15 | description: scheduled departure date of the flight, local to the departure airport. 16 | example: "2020-10-20" 17 | -------------------------------------------------------------------------------- /test/examples/common/schemas/segment.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | iataCode: 4 | type: string 5 | description: 2 to 3-character IATA carrier code 6 | example: "MAD" 7 | scheduledDate: 8 | type: string 9 | format: date-time 10 | description: scheduled datetime of the flight, local to the airport. 11 | example: "2020-10-20 19:15" 12 | gate: 13 | type: string 14 | description: departure gate 15 | example: "2D" 16 | terminal: 17 | type: string 18 | description: airport terminal 19 | example: "4" 20 | -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | const parser = require('@asyncapi/parser'); 2 | 3 | /** 4 | * Validate and parse given array of AsyncAPI documents. 5 | * 6 | * @param {Array} asyncApiDocs unparsed AsyncAPI documents 7 | * @returns {Promise} parsed AsyncAPI documents 8 | */ 9 | 10 | function validate(asyncApiDocs) { 11 | return Promise.all(asyncApiDocs.map(async doc => { 12 | if (typeof doc === 'object' && typeof doc.ext === 'function' && doc.ext('x-parser-spec-parsed')) { 13 | return doc; 14 | } 15 | return parser.parse(doc); 16 | })); 17 | } 18 | 19 | module.exports = { validate }; 20 | -------------------------------------------------------------------------------- /.github/workflows/coverall.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master 5 | pull_request: 6 | types: [opened, reopened, synchronize, ready_for_review] 7 | name: Check test coverage 8 | jobs: 9 | build: 10 | name: Build 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v1 14 | - name: Setup Node.js 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: 14 18 | - name: npm install, run test 19 | run: | 20 | npm install 21 | npm run test 22 | - name: Coveralls 23 | uses: coverallsapp/github-action@v1.1.2 24 | with: 25 | github-token: ${{ secrets.GITHUB_TOKEN }} 26 | -------------------------------------------------------------------------------- /test/testsUtil.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const parser = require('@asyncapi/parser'); 4 | 5 | const examplesPath = './test/examples/flightService'; 6 | 7 | async function parseAsyncApiExamples(asyncApiDocs) { 8 | const docs = []; 9 | for (const doc of asyncApiDocs) { 10 | const parsedDoc = await parser.parse(doc); 11 | docs.push(parsedDoc); 12 | } 13 | return docs; 14 | } 15 | 16 | function getAsyncApiExamples() { 17 | const docs = []; 18 | const files = fs.readdirSync(examplesPath); 19 | for (const file of files) { 20 | const document_path = path.join('./examples/flightService', file); 21 | const asyncApiDoc = fs.readFileSync(path.resolve(__dirname, document_path),'utf8'); 22 | docs.push(asyncApiDoc); 23 | } 24 | return docs; 25 | } 26 | 27 | module.exports = {getAsyncApiExamples,parseAsyncApiExamples}; -------------------------------------------------------------------------------- /test/examples/flightService/notifier.yaml: -------------------------------------------------------------------------------- 1 | # Contributed by: Alvaro Navarro Link: https://github.com/amadeus4dev/amadeus-async-flight-status/ 2 | asyncapi: '2.0.0' 3 | info: 4 | title: Flight Notifier Service 5 | version: '1.0.0' 6 | description: | 7 | Recevies updates from a subscribed flight and notifies via Twilio API. 8 | license: 9 | name: Apache 2.0 10 | url: 'https://www.apache.org/licenses/LICENSE-2.0' 11 | servers: 12 | development: 13 | url: mqtt://localhost:1883 14 | protocol: mqtt 15 | channels: 16 | flight/update: 17 | description: | 18 | Receives updates from a subscribed flight 19 | publish: 20 | summary: Inform about the status of a subscribed flight 21 | message: 22 | $ref: '#/components/messages/flightStatus' 23 | components: 24 | messages: 25 | flightStatus: 26 | $ref: './test/examples/common/messages/flight_status.yaml' -------------------------------------------------------------------------------- /test/examples/flightService/subscriber.yaml: -------------------------------------------------------------------------------- 1 | # Contributed by: Alvaro Navarro Link: https://github.com/amadeus4dev/amadeus-async-flight-status/ 2 | asyncapi: '2.0.0' 3 | info: 4 | title: Flight Subscriber Service 5 | version: '1.0.0' 6 | description: | 7 | Allows users to subscribe events from a given flight 8 | license: 9 | name: Apache 2.0 10 | url: 'https://www.apache.org/licenses/LICENSE-2.0' 11 | servers: 12 | development: 13 | url: mqtt://localhost:1883 14 | protocol: mqtt 15 | channels: 16 | flight/queue: 17 | description: | 18 | queue flight in order to retrieve status 19 | subscribe: 20 | summary: Receive information about the flight that should be monitored for changes 21 | message: 22 | $ref: '#/components/messages/flightQueue' 23 | components: 24 | messages: 25 | flightQueue: 26 | $ref: './test/examples/common/messages/flight_queue.yaml' -------------------------------------------------------------------------------- /test/examples/common/messages/flight_queue.yaml: -------------------------------------------------------------------------------- 1 | summary: Requets to queue a flight to be monitored 2 | payload: 3 | type: object 4 | properties: 5 | flight: 6 | type: object 7 | properties: 8 | carrierCode: 9 | type: string 10 | description: 2 to 3-character IATA carrier code 11 | example: "LH" 12 | flightNumber: 13 | type: integer 14 | minimum: 1 15 | description: 1 to 4-digit number of the flight 16 | example: "193" 17 | scheduledDepartureDate: 18 | type: string 19 | format: date-time 20 | description: scheduled departure date of the flight, local to the departure airport. 21 | example: "2020-10-20" 22 | user: 23 | type: object 24 | properties: 25 | userName: 26 | type: string 27 | minimum: 1 28 | description: user name 29 | example: "John Smith" 30 | phoneNumber: 31 | type: string 32 | minimum: 5 33 | description: phone number where notifications will be received. 34 | example: "+13451235" 35 | 36 | -------------------------------------------------------------------------------- /lib/getPlantUMLDiagram.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Generates plantUML class diagram from default output syntax 3 | * 4 | * @param {Object} metrics Relations between AsyncAPI docs in default output syntax 5 | * @returns {String} class diagram following plantUML syntax 6 | */ 7 | function getPlantUMLDiagram(metrics) { 8 | let i=1; 9 | let plantUMLSyntax = ''; 10 | metrics.forEach((relations,server) => { 11 | const [url, protocol] = server.split(','); 12 | plantUMLSyntax+= `\nclass server${i} { \n url: ${url} \n protocol: ${protocol}\n}`; 13 | 14 | relations.forEach((operations, channel) => { 15 | operations.sub.forEach((metadata,subscriber) => { 16 | const service = subscriber.replace(/\s/g,''); 17 | plantUMLSyntax+=`\n${service} --|> server${i}:${channel}`; 18 | }); 19 | 20 | operations.pub.forEach((metadata,publisher) => { 21 | const service = publisher.replace(/\s/g,''); 22 | plantUMLSyntax+=`\nserver${i} --|> ${service}:${channel}`; 23 | }); 24 | }); 25 | i++; 26 | }); 27 | return `@startuml\ntitle Classes - Class Diagram\n${plantUMLSyntax}\n@enduml`; 28 | } 29 | 30 | module.exports = getPlantUMLDiagram; -------------------------------------------------------------------------------- /test/examples/flightService/monitor.yaml: -------------------------------------------------------------------------------- 1 | # Contributed by: Alvaro Navarro Link: https://github.com/amadeus4dev/amadeus-async-flight-status/ 2 | asyncapi: '2.0.0' 3 | info: 4 | title: Flight Monitor Service 5 | version: '1.0.0' 6 | description: | 7 | provides real-time flight schedule data including up-to-date departure and arrival times, 8 | terminal and gate information, flight duration and real-time delay status. 9 | license: 10 | name: Apache 2.0 11 | url: 'https://www.apache.org/licenses/LICENSE-2.0' 12 | servers: 13 | development: 14 | url: mqtt://localhost:1883 15 | protocol: mqtt 16 | channels: 17 | flight/update: 18 | description: | 19 | Provides updates from a subscribed flight 20 | subscribe: 21 | summary: Inform about the status of a subscribed flight 22 | message: 23 | $ref: '#/components/messages/flightStatus' 24 | flight/queue: 25 | description: | 26 | Queues a flight in order to retrieve status 27 | publish: 28 | summary: Subscribe about the status of a given flight 29 | message: 30 | $ref: '#/components/messages/flightQueue' 31 | components: 32 | messages: 33 | flightStatus: 34 | $ref: './test/examples/common/messages/flight_status.yaml' 35 | flightQueue: 36 | $ref: './test/examples/common/messages/flight_queue.yaml' -------------------------------------------------------------------------------- /.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@v6 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 | -------------------------------------------------------------------------------- /lib/getMermaidFlowchart.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Generates mermaid flowchart from default output syntax 3 | * 4 | * @param {Object} metrics Relations between AsyncAPI docs in default output syntax 5 | * @returns {String} Flowchart following mermaid syntax 6 | */ 7 | function getMermaidFlowchart(metrics) { 8 | const visitedServices = []; 9 | let i=1; 10 | let mermaidSyntax = ''; 11 | metrics.forEach((relations,server) => { 12 | const [url] = server.split(','); 13 | mermaidSyntax+=`\n server${i}[(${url})]`; 14 | 15 | relations.forEach((operations, channel) => { 16 | operations.sub.forEach((metadata,subscriber) => { 17 | const service = subscriber.replace(/\s/g,''); 18 | if (!visitedServices.includes(service)) { 19 | visitedServices.push(service); 20 | mermaidSyntax+=`\n${service}[${subscriber}]`; 21 | } 22 | mermaidSyntax+=`\n${service} -- ${channel} --> server${i}`; 23 | }); 24 | 25 | operations.pub.forEach((metadata,publisher) => { 26 | const service = publisher.replace(/\s/g,''); 27 | if (!visitedServices.includes(service)) { 28 | visitedServices.push(service); 29 | mermaidSyntax+=`\n${service}[${publisher}]`; 30 | } 31 | mermaidSyntax+=`\nserver${i} -- ${channel} --> ${service}`; 32 | }); 33 | }); 34 | i++; 35 | }); 36 | return `graph TD${mermaidSyntax}`; 37 | } 38 | 39 | module.exports = getMermaidFlowchart; -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /test/examples/common/messages/flight_status.yaml: -------------------------------------------------------------------------------- 1 | summary: Provides flight status on arrival and destination 2 | payload: 3 | type: object 4 | properties: 5 | user: 6 | type: object 7 | properties: 8 | userName: 9 | type: string 10 | minimum: 1 11 | description: user name 12 | example: "John Smith" 13 | phoneNumber: 14 | type: string 15 | minimum: 5 16 | description: phone number where notifications will be received. 17 | example: "+13451235" 18 | departure: 19 | type: object 20 | properties: 21 | iataCode: 22 | type: string 23 | description: 2 to 3-character IATA carrier code 24 | example: "MAD" 25 | scheduledDate: 26 | type: string 27 | format: date-time 28 | description: scheduled datetime of the flight, local to the airport. 29 | example: "2020-10-20 19:15" 30 | gate: 31 | type: string 32 | description: departure gate 33 | example: "2D" 34 | terminal: 35 | type: string 36 | description: airport terminal 37 | example: "4" 38 | arrival: 39 | type: object 40 | properties: 41 | iataCode: 42 | type: string 43 | description: 2 to 3-character IATA carrier code 44 | example: "MAD" 45 | scheduledDate: 46 | type: string 47 | format: date-time 48 | description: scheduled datetime of the flight, local to the airport. 49 | example: "2020-10-20 19:15" 50 | gate: 51 | type: string 52 | description: departure gate 53 | example: "2D" 54 | terminal: 55 | type: string 56 | description: airport terminal 57 | example: "4" 58 | -------------------------------------------------------------------------------- /.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@v2 24 | - name: Check if Node.js project and has package.json 25 | id: packagejson 26 | run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" 27 | - if: steps.packagejson.outputs.exists == 'true' 28 | name: Bumping latest version of this package in other repositories 29 | uses: derberg/npm-dependency-manager-for-your-github-org@v4 30 | with: 31 | github_token: ${{ secrets.GH_TOKEN }} 32 | committer_username: asyncapi-bot 33 | committer_email: info@asyncapi.io 34 | repos_to_ignore: html-template # this is temporary until react component releases 1.0, then it can be removed 35 | -------------------------------------------------------------------------------- /lib/getReactFlowData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Generates reactFlow nodes data from default output syntax 3 | * 4 | * @param {Object} metrics Relations between AsyncAPI docs in default output syntax 5 | * @returns {Array} reactFlow nodes data 6 | */ 7 | 8 | function getReactFlowData(metrics) { 9 | let i=1; 10 | let edgId = 1; 11 | const nodes = []; 12 | const visitedServices = []; 13 | metrics.forEach((relations,server) => { 14 | const url = server.split(','); 15 | const node = { id: `Server${i}`, data: { label: `${url}` }, position: { x: 250, y: 5 } }; 16 | nodes.push(node); 17 | relations.forEach((operations, channel) => { 18 | operations.sub.forEach((metadata,subscriber) => { 19 | const service = subscriber.replace(/\s/g,''); 20 | getNode(service,visitedServices,node,subscriber,nodes); 21 | const edge = { id: `edge${edgId}`, source: `${service}`, target: `Server${i}`, animated: true, label: `${channel}`, type: 'edgeType', arrowHeadType: 'arrowclosed'}; 22 | nodes.push(edge); 23 | edgId++; 24 | }); 25 | 26 | operations.pub.forEach((metadata,publisher) => { 27 | const service = publisher.replace(/\s/g,''); 28 | getNode(service,visitedServices,node,publisher,nodes); 29 | const edge = { id: `edge${edgId}`, source: `Server${i}`, target: `${service}`, animated: true, label: `${channel}`, type: 'edgeType', arrowHeadType: 'arrowclosed'}; 30 | nodes.push(edge); 31 | edgId++; 32 | }); 33 | }); 34 | i++; 35 | }); 36 | return nodes; 37 | } 38 | 39 | function getNode(service,visitedServices,node,operator,nodes) { 40 | if (!visitedServices.includes(service)) { 41 | visitedServices.push(service); 42 | node = { id: `${service}`, data: { label: `${operator}` }, position: { x: 100, y: 10 } }; 43 | nodes.push(node); 44 | } 45 | } 46 | 47 | module.exports = getReactFlowData; -------------------------------------------------------------------------------- /.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@v6 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@v6 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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@asyncapi/cupid", 3 | "version": "0.6.23", 4 | "description": "A library that focuses on finding and analyzing the relationships between AsyncAPI Documents too later output consolidated information about the system architecture. Output format should be customizable and available in different formats like uml, mermaid.js and other.", 5 | "main": "./lib/index.js", 6 | "scripts": { 7 | "test": "npm run test:lib", 8 | "lint": "eslint --max-warnings 0 --config .eslintrc .", 9 | "docs": "jsdoc2md \"lib/appRelationsDiscovery.js\" -f \"lib/**/*.js\" > API.md", 10 | "get:version": "echo $npm_package_version", 11 | "get:name": "echo $npm_package_name", 12 | "generate:readme:toc": "markdown-toc -i README.md", 13 | "generate:assets": "npm run docs && npm run generate:readme:toc", 14 | "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", 15 | "test:lib": "nyc --reporter=lcov --reporter=html --reporter=text --no-clean mocha --recursive", 16 | "release": "semantic-release" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/asyncapi/cupid.git" 21 | }, 22 | "author": "Arjun Garg ", 23 | "license": "Apache-2.0", 24 | "bugs": { 25 | "url": "https://github.com/asyncapi/cupid/issues" 26 | }, 27 | "homepage": "https://github.com/asyncapi/cupid#readme", 28 | "devDependencies": { 29 | "@semantic-release/commit-analyzer": "^8.0.1", 30 | "@semantic-release/github": "^7.2.3", 31 | "@semantic-release/npm": "^7.1.3", 32 | "@semantic-release/release-notes-generator": "^9.0.2", 33 | "chai": "^4.3.4", 34 | "chai-as-promised": "^7.1.1", 35 | "conventional-changelog-conventionalcommits": "^4.6.0", 36 | "eslint": "^7.28.0", 37 | "eslint-plugin-mocha": "^9.0.0", 38 | "eslint-plugin-security": "^1.4.0", 39 | "eslint-plugin-sonarjs": "^0.8.0-125", 40 | "jsdoc-to-markdown": "^7.0.1", 41 | "markdown-toc": "^1.2.0", 42 | "mocha": "^9.0.1", 43 | "nyc": "^15.1.0", 44 | "semantic-release": "^17.4.3" 45 | }, 46 | "dependencies": { 47 | "@asyncapi/parser": "^1.18.0" 48 | }, 49 | "publishConfig": { 50 | "access": "public" 51 | }, 52 | "release": { 53 | "branches": [ 54 | "master" 55 | ], 56 | "plugins": [ 57 | [ 58 | "@semantic-release/commit-analyzer", 59 | { 60 | "preset": "conventionalcommits" 61 | } 62 | ], 63 | [ 64 | "@semantic-release/release-notes-generator", 65 | { 66 | "preset": "conventionalcommits" 67 | } 68 | ], 69 | "@semantic-release/npm", 70 | "@semantic-release/github" 71 | ] 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /.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@99b6c709598e2b0d0841cd037aaf1ba07a4410bd #v5.2.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 | -------------------------------------------------------------------------------- /.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@v2 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 "::set-output name=exists::true" || echo "::set-output name=exists::false" 27 | - if: steps.packagejson.outputs.exists == 'true' 28 | name: Install dependencies 29 | run: npm install 30 | - if: steps.packagejson.outputs.exists == 'true' 31 | name: Assets generation 32 | run: npm run generate:assets 33 | - if: steps.packagejson.outputs.exists == 'true' 34 | name: Bump version in package.json 35 | # There is no need to substract "v" from the tag as version script handles it 36 | # 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 37 | # 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 38 | run: VERSION=${{github.event.release.tag_name}} npm run bump:version 39 | - if: steps.packagejson.outputs.exists == 'true' 40 | name: Create Pull Request with updated asset files including package.json 41 | uses: peter-evans/create-pull-request@v3 42 | with: 43 | token: ${{ secrets.GH_TOKEN }} 44 | commit-message: 'chore(release): ${{github.event.release.tag_name}}' 45 | committer: asyncapi-bot 46 | author: asyncapi-bot 47 | title: 'chore(release): ${{github.event.release.tag_name}}' 48 | body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})' 49 | branch: version-bump/${{github.event.release.tag_name}} -------------------------------------------------------------------------------- /.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@v3 18 | - name: Get list of orphans 19 | uses: actions/github-script@v6 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 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 56 | id: issuemarkdown 57 | with: 58 | markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})" 59 | - if: steps.orphans.outputs.found == 'true' 60 | name: Send info about orphan to slack 61 | uses: rtCamp/action-slack-notify@v2 62 | env: 63 | SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}} 64 | SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨 65 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 66 | MSG_MINIMAL: true -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | node: true 3 | es6: true 4 | mocha: true 5 | 6 | plugins: 7 | - sonarjs 8 | - mocha 9 | - security 10 | 11 | extends: 12 | - plugin:sonarjs/recommended 13 | - plugin:mocha/recommended 14 | - plugin:security/recommended 15 | 16 | parserOptions: 17 | ecmaVersion: 2018 18 | 19 | rules: 20 | # Ignore Rules 21 | strict: 0 22 | no-underscore-dangle: 0 23 | no-mixed-requires: 0 24 | no-process-exit: 0 25 | no-warning-comments: 0 26 | curly: 0 27 | no-multi-spaces: 0 28 | no-alert: 0 29 | consistent-return: 0 30 | consistent-this: [0, self] 31 | func-style: 0 32 | max-nested-callbacks: 0 33 | camelcase: 0 34 | 35 | # Warnings 36 | no-debugger: 1 37 | no-empty: 1 38 | no-invalid-regexp: 1 39 | no-unused-expressions: 1 40 | no-native-reassign: 1 41 | no-fallthrough: 1 42 | sonarjs/cognitive-complexity: 1 43 | 44 | # Errors 45 | eqeqeq: 2 46 | no-undef: 2 47 | no-dupe-keys: 2 48 | no-empty-character-class: 2 49 | no-self-compare: 2 50 | valid-typeof: 2 51 | no-unused-vars: [2, { "args": "none" }] 52 | handle-callback-err: 2 53 | no-shadow-restricted-names: 2 54 | no-new-require: 2 55 | no-mixed-spaces-and-tabs: 2 56 | block-scoped-var: 2 57 | no-else-return: 2 58 | no-throw-literal: 2 59 | no-void: 2 60 | radix: 2 61 | wrap-iife: [2, outside] 62 | no-shadow: 0 63 | no-use-before-define: [2, nofunc] 64 | no-path-concat: 2 65 | valid-jsdoc: [0, {requireReturn: false, requireParamDescription: false, requireReturnDescription: false}] 66 | 67 | # stylistic errors 68 | no-spaced-func: 2 69 | semi-spacing: 2 70 | quotes: [2, 'single'] 71 | key-spacing: [2, { beforeColon: false, afterColon: true }] 72 | indent: [2, 2] 73 | no-lonely-if: 2 74 | no-floating-decimal: 2 75 | brace-style: [2, 1tbs, { allowSingleLine: true }] 76 | comma-style: [2, last] 77 | no-multiple-empty-lines: [2, {max: 1}] 78 | no-nested-ternary: 2 79 | operator-assignment: [2, always] 80 | padded-blocks: [2, never] 81 | quote-props: [2, as-needed] 82 | keyword-spacing: [2, {'before': true, 'after': true, 'overrides': {}}] 83 | space-before-blocks: [2, always] 84 | array-bracket-spacing: [2, never] 85 | computed-property-spacing: [2, never] 86 | space-in-parens: [2, never] 87 | space-unary-ops: [2, {words: true, nonwords: false}] 88 | wrap-regex: 2 89 | linebreak-style: 0 90 | semi: [2, always] 91 | arrow-spacing: [2, {before: true, after: true}] 92 | no-class-assign: 2 93 | no-const-assign: 2 94 | no-dupe-class-members: 2 95 | no-this-before-super: 2 96 | no-var: 2 97 | object-shorthand: [2, always] 98 | prefer-arrow-callback: 2 99 | prefer-const: 2 100 | prefer-spread: 2 101 | prefer-template: 2 102 | 103 | overrides: 104 | - files: "test/**" 105 | rules: 106 | prefer-arrow-callback: 0 107 | sonarjs/no-duplicate-string: 0 108 | security/detect-object-injection: 0 109 | security/detect-non-literal-fs-filename: 0 -------------------------------------------------------------------------------- /.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/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@v6 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 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | - Using welcoming and inclusive language 12 | - Being respectful of differing viewpoints and experiences 13 | - Gracefully accepting constructive criticism 14 | - Focusing on what is best for the community 15 | - Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | - Trolling, insulting/derogatory comments, and personal or political attacks 21 | - Public or private harassment 22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | - Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at fmvilas@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /.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 && contains(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@v6 18 | with: 19 | github-token: ${{ secrets.GH_TOKEN }} 20 | script: | 21 | //Yes to add comment to PR the same endpoint is use that we use to create a comment in issue 22 | //For more details http://developer.github.com/v3/issues/comments/ 23 | //Also proved by this action https://github.com/actions-ecosystem/action-create-comment/blob/main/src/main.ts 24 | github.rest.issues.createComment({ 25 | issue_number: context.issue.number, 26 | owner: context.repo.owner, 27 | repo: context.repo.repo, 28 | body: `Hello, @${{ github.actor }}! 👋🏼 29 | 30 | I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! 31 | 32 | At the moment the following comments are supported in pull requests: 33 | 34 | - \`/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. 35 | - \`/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 36 | - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added 37 | - \`/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.` 38 | }) 39 | 40 | create_help_comment_issue: 41 | if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} 42 | runs-on: ubuntu-latest 43 | steps: 44 | - name: Add comment to Issue 45 | uses: actions/github-script@v6 46 | with: 47 | github-token: ${{ secrets.GH_TOKEN }} 48 | script: | 49 | github.rest.issues.createComment({ 50 | issue_number: context.issue.number, 51 | owner: context.repo.owner, 52 | repo: context.repo.repo, 53 | body: `Hello, @${{ github.actor }}! 👋🏼 54 | 55 | I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! 56 | 57 | At the moment the following comments are supported in issues: 58 | 59 | - \`/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\`. 60 | example: \`/gfi js\` or \`/good-first-issue ci-cd\`` 61 | }) -------------------------------------------------------------------------------- /lib/appRelationsDiscovery.js: -------------------------------------------------------------------------------- 1 | const getMermaidFlowchart = require('./getMermaidFlowchart'); 2 | const getPlantUMLDiagram = require('./getPlantUMLDiagram'); 3 | const getReactFlowData = require('./getReactFlowData'); 4 | const {validate} = require('./utils'); 5 | 6 | const supportedSyntax = ['default','mermaid','plantUML','reactFlow']; 7 | const defaultOptions = { 8 | syntax: 'default', 9 | }; 10 | 11 | /** 12 | * Validates and analyzes a list of AsyncAPI documents and get applications described by those files 13 | * 14 | * @param {String[]} asyncApiDocs An array of stringified AsyncAPI documents 15 | * @param {Object} [options] 16 | * @param {('default'|'mermaid'|'plantUML'|'reactFlow')} [options.syntax] syntax in which the relation will be generated. 17 | * @returns {Promise} Relations between documents 18 | */ 19 | // eslint-disable-next-line sonarjs/cognitive-complexity 20 | async function getRelations(asyncApiDocs, { syntax } = defaultOptions) { 21 | if (!Array.isArray(asyncApiDocs)) throw new Error('You must pass an array of AsyncApiDocuments on which you wish to discover the relations between'); 22 | if (!supportedSyntax.includes(syntax)) throw new Error('The given syntax is not supported'); 23 | 24 | let parsedAsyncApiDocs; 25 | try { 26 | parsedAsyncApiDocs = await validate(asyncApiDocs); 27 | } catch (e) { 28 | throw new Error(e); 29 | } 30 | const metrics = new Map(); 31 | 32 | parsedAsyncApiDocs.forEach(doc => { 33 | if (doc.hasServers()) { 34 | const servers = doc.servers(); 35 | 36 | for (const credentials of Object.values(servers)) { 37 | const slug = `${credentials.url()},${credentials.protocol()}`; 38 | let relation; 39 | if (metrics.has(slug)) { 40 | relation = metrics.get(slug); 41 | } else { 42 | relation = new Map(); 43 | metrics.set(slug,relation); 44 | } 45 | 46 | if (doc.hasChannels()) { 47 | doc.channelNames().forEach((channelName) => { 48 | let application; 49 | if (relation.has(channelName)) { 50 | application = relation.get(channelName); 51 | } else { 52 | application = { 53 | sub: new Map(), 54 | pub: new Map(), 55 | }; 56 | relation.set(channelName, application); 57 | } 58 | 59 | const channel = doc.channel(channelName); 60 | const title = doc.info().title(); 61 | 62 | if (channel.hasPublish()) { 63 | if (application.pub.has(title)) { 64 | throw new Error(`${title} is already publishing to ${channel}`); 65 | } 66 | application.pub.set(title,channel.json()); 67 | } 68 | if (channel.hasSubscribe()) { 69 | if (application.sub.has(title)) { 70 | throw new Error(`${title} is already subscribed to ${channel}`); 71 | } 72 | application.sub.set(title,channel.json()); 73 | } 74 | }); 75 | } 76 | } 77 | } 78 | }); 79 | switch (syntax) { 80 | case 'mermaid': 81 | return getMermaidFlowchart(metrics); 82 | case 'plantUML': 83 | return getPlantUMLDiagram(metrics); 84 | case 'reactFlow': 85 | return getReactFlowData(metrics); 86 | default: 87 | return metrics; 88 | } 89 | } 90 | 91 | module.exports = {getRelations}; 92 | -------------------------------------------------------------------------------- /API.md: -------------------------------------------------------------------------------- 1 | ## Functions 2 | 3 |
4 |
getRelations(asyncApiDocs, [options])Promise.<DiscoveredRelations>
5 |

Validates and analyzes a list of AsyncAPI documents and get applications described by those files

6 |
7 |
getMermaidFlowchart(metrics)String
8 |

Generates mermaid flowchart from default output syntax

9 |
10 |
getPlantUMLDiagram(metrics)String
11 |

Generates plantUML class diagram from default output syntax

12 |
13 |
getReactFlowData(metrics)Array
14 |

Generates reactFlow nodes data from default output syntax

15 |
16 |
validate(asyncApiDocs)Promise.<Array>
17 |

Validate and parse given array of AsyncAPI documents.

18 |
19 |
20 | 21 | 22 | 23 | ## getRelations(asyncApiDocs, [options]) ⇒ Promise.<DiscoveredRelations> 24 | Validates and analyzes a list of AsyncAPI documents and get applications described by those files 25 | 26 | **Kind**: global function 27 | **Returns**: Promise.<DiscoveredRelations> - Relations between documents 28 | 29 | | Param | Type | Description | 30 | | --- | --- | --- | 31 | | asyncApiDocs | Array.<String> | An array of stringified AsyncAPI documents | 32 | | [options] | Object | | 33 | | [options.syntax] | 'default' \| 'mermaid' \| 'plantUML' \| 'reactFlow' | syntax in which the relation will be generated. | 34 | 35 | 36 | 37 | ## getMermaidFlowchart(metrics) ⇒ String 38 | Generates mermaid flowchart from default output syntax 39 | 40 | **Kind**: global function 41 | **Returns**: String - Flowchart following mermaid syntax 42 | 43 | | Param | Type | Description | 44 | | --- | --- | --- | 45 | | metrics | Object | Relations between AsyncAPI docs in default output syntax | 46 | 47 | 48 | 49 | ## getPlantUMLDiagram(metrics) ⇒ String 50 | Generates plantUML class diagram from default output syntax 51 | 52 | **Kind**: global function 53 | **Returns**: String - class diagram following plantUML syntax 54 | 55 | | Param | Type | Description | 56 | | --- | --- | --- | 57 | | metrics | Object | Relations between AsyncAPI docs in default output syntax | 58 | 59 | 60 | 61 | ## getReactFlowData(metrics) ⇒ Array 62 | Generates reactFlow nodes data from default output syntax 63 | 64 | **Kind**: global function 65 | **Returns**: Array - reactFlow nodes data 66 | 67 | | Param | Type | Description | 68 | | --- | --- | --- | 69 | | metrics | Object | Relations between AsyncAPI docs in default output syntax | 70 | 71 | 72 | 73 | ## validate(asyncApiDocs) ⇒ Promise.<Array> 74 | Validate and parse given array of AsyncAPI documents. 75 | 76 | **Kind**: global function 77 | **Returns**: Promise.<Array> - parsed AsyncAPI documents 78 | 79 | | Param | Type | Description | 80 | | --- | --- | --- | 81 | | asyncApiDocs | Array | unparsed AsyncAPI documents | 82 | 83 | -------------------------------------------------------------------------------- /.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 | jobs: 18 | guard-against-unauthorized-use: 19 | if: > 20 | github.actor != ('aeworxet' || 'thulieblack') && 21 | ( 22 | contains(github.event.comment.body, '/bounty' ) 23 | ) 24 | 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | - name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command 29 | uses: actions/github-script@v6 30 | 31 | with: 32 | github-token: ${{ secrets.GH_TOKEN }} 33 | script: | 34 | const commentText = `❌ @${{github.actor}} is not authorized to use the Bounty Program's commands. 35 | These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`; 36 | 37 | console.log(`❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command.`); 38 | github.rest.issues.createComment({ 39 | issue_number: context.issue.number, 40 | owner: context.repo.owner, 41 | repo: context.repo.repo, 42 | body: commentText 43 | }) 44 | 45 | add-label-bounty: 46 | if: > 47 | github.actor == ('aeworxet' || 'thulieblack') && 48 | ( 49 | contains(github.event.comment.body, '/bounty' ) 50 | ) 51 | 52 | runs-on: ubuntu-latest 53 | env: 54 | BOUNTY_PROGRAM_LABELS_JSON: | 55 | [ 56 | {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} 57 | ] 58 | 59 | steps: 60 | - name: Add label `bounty` 61 | uses: actions/github-script@v6 62 | 63 | with: 64 | github-token: ${{ secrets.GH_TOKEN }} 65 | script: | 66 | const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); 67 | let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({ 68 | owner: context.repo.owner, 69 | repo: context.repo.repo, 70 | }); 71 | 72 | LIST_OF_LABELS_FOR_REPO = LIST_OF_LABELS_FOR_REPO.data.map(key => key.name); 73 | 74 | if (!LIST_OF_LABELS_FOR_REPO.includes(BOUNTY_PROGRAM_LABELS[0].name)) { 75 | await github.rest.issues.createLabel({ 76 | owner: context.repo.owner, 77 | repo: context.repo.repo, 78 | name: BOUNTY_PROGRAM_LABELS[0].name, 79 | color: BOUNTY_PROGRAM_LABELS[0].color, 80 | description: BOUNTY_PROGRAM_LABELS[0].description 81 | }); 82 | } 83 | 84 | console.log('Adding label `bounty`...'); 85 | github.rest.issues.addLabels({ 86 | issue_number: context.issue.number, 87 | owner: context.repo.owner, 88 | repo: context.repo.repo, 89 | labels: [BOUNTY_PROGRAM_LABELS[0].name] 90 | }) 91 | -------------------------------------------------------------------------------- /.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: Checkout repository 24 | uses: actions/checkout@v3 25 | - name: Convert markdown to slack markdown for issue 26 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 27 | id: issuemarkdown 28 | with: 29 | markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" 30 | - name: Send info about issue 31 | uses: rtCamp/action-slack-notify@v2 32 | env: 33 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 34 | SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛 35 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 36 | MSG_MINIMAL: true 37 | 38 | pull_request: 39 | if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 40 | name: Notify slack on every new pull request 41 | runs-on: ubuntu-latest 42 | steps: 43 | - name: Checkout repository 44 | uses: actions/checkout@v3 45 | - name: Convert markdown to slack markdown for pull request 46 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 47 | id: prmarkdown 48 | with: 49 | markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" 50 | - name: Send info about pull request 51 | uses: rtCamp/action-slack-notify@v2 52 | env: 53 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 54 | SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪 55 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 56 | MSG_MINIMAL: true 57 | 58 | discussion: 59 | if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 60 | name: Notify slack on every new pull request 61 | runs-on: ubuntu-latest 62 | steps: 63 | - name: Checkout repository 64 | uses: actions/checkout@v3 65 | - name: Convert markdown to slack markdown for pull request 66 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 67 | id: discussionmarkdown 68 | with: 69 | markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" 70 | - name: Send info about pull request 71 | uses: rtCamp/action-slack-notify@v2 72 | env: 73 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 74 | SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬 75 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 76 | MSG_MINIMAL: true 77 | -------------------------------------------------------------------------------- /.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: Check package-lock version 53 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master 54 | id: lockversion 55 | - if: steps.packagejson.outputs.exists == 'true' 56 | name: Setup Node.js 57 | uses: actions/setup-node@v4 58 | with: 59 | node-version: "${{ steps.lockversion.outputs.version }}" 60 | - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' 61 | #npm cli 10 is buggy because of some cache issue 62 | name: Install npm cli 8 63 | shell: bash 64 | run: npm install -g npm@8.19.4 65 | - if: steps.packagejson.outputs.exists == 'true' 66 | name: Install dependencies 67 | shell: bash 68 | run: npm ci 69 | - if: steps.packagejson.outputs.exists == 'true' 70 | name: Test 71 | run: npm test --if-present 72 | - if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' 73 | #linting should run just one and not on all possible operating systems 74 | name: Run linter 75 | run: npm run lint --if-present 76 | - if: steps.packagejson.outputs.exists == 'true' 77 | name: Run release assets generation to make sure PR does not break it 78 | shell: bash 79 | run: npm run generate:assets --if-present 80 | -------------------------------------------------------------------------------- /.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 | if: github.event.pull_request.draft == false && (github.event.pull_request.user.login != 'asyncapi-bot' || github.event.pull_request.user.login != 'dependabot[bot]' || github.event.pull_request.user.login != 'dependabot-preview[bot]') #it runs only if PR actor is not a bot, at least not a bot that we know 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Get list of authors 25 | uses: sergeysova/jq-action@v2 26 | id: authors 27 | with: 28 | # This cmd does following (line by line): 29 | # 1. CURL querying the list of commits of the current PR via GH API. Why? Because the current event payload does not carry info about the commits. 30 | # 2. Iterates over the previous returned payload, and creates an array with the filtered results (see below) so we can work wit it later. An example of payload can be found in https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#webhook-payload-example-34. 31 | # 3. Grabs the data we need for adding the `Co-authored-by: ...` lines later and puts it into objects to be used later on. 32 | # 4. Filters the results by excluding the current PR sender. We don't need to add it as co-author since is the PR creator and it will become by default the main author. 33 | # 5. Removes repeated authors (authors can have more than one commit in the PR). 34 | # 6. Builds the `Co-authored-by: ...` lines with actual info. 35 | # 7. Transforms the array into plain text. Thanks to this, the actual stdout of this step can be used by the next Workflow step (wich is basically the automerge). 36 | cmd: | 37 | curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" "${{github.event.pull_request._links.commits.href}}?per_page=100" | 38 | jq -r '[.[] 39 | | {name: .commit.author.name, email: .commit.author.email, login: .author.login}] 40 | | map(select(.login != "${{github.event.pull_request.user.login}}")) 41 | | unique 42 | | map("Co-authored-by: " + .name + " <" + .email + ">") 43 | | join("\n")' 44 | multiline: true 45 | - name: Automerge PR 46 | uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 47 | env: 48 | GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" 49 | MERGE_LABELS: "!do-not-merge,ready-to-merge" 50 | MERGE_METHOD: "squash" 51 | # Using the output of the previous step (`Co-authored-by: ...` lines) as commit description. 52 | # 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 53 | MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})\n\n\n${{ steps.authors.outputs.value }}" 54 | MERGE_RETRIES: "20" 55 | MERGE_RETRY_SLEEP: "30000" 56 | -------------------------------------------------------------------------------- /.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@v3 19 | - name: Convert markdown to slack markdown for issue 20 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 21 | id: markdown 22 | with: 23 | markdown: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}" 24 | - name: Send info about release to Slack 25 | uses: rtCamp/action-slack-notify@v2 26 | env: 27 | SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }} 28 | SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱💪🍾🎂 29 | SLACK_MESSAGE: ${{steps.markdown.outputs.text}} 30 | MSG_MINIMAL: true 31 | 32 | twitter-announce: 33 | name: Twitter - notify on minor and major releases 34 | runs-on: ubuntu-latest 35 | steps: 36 | - name: Checkout repo 37 | uses: actions/checkout@v3 38 | - name: Get version of last and previous release 39 | uses: actions/github-script@v6 40 | id: versions 41 | with: 42 | github-token: ${{ secrets.GITHUB_TOKEN }} 43 | script: | 44 | const query = `query($owner:String!, $name:String!) { 45 | repository(owner:$owner, name:$name){ 46 | releases(first: 2, orderBy: {field: CREATED_AT, direction: DESC}) { 47 | nodes { 48 | name 49 | } 50 | } 51 | } 52 | }`; 53 | const variables = { 54 | owner: context.repo.owner, 55 | name: context.repo.repo 56 | }; 57 | const { repository: { releases: { nodes } } } = await github.graphql(query, variables); 58 | core.setOutput('lastver', nodes[0].name); 59 | // 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 60 | // We should tweet about the release no matter of the type as it is initial release 61 | if (nodes.length != 1) core.setOutput('previousver', nodes[1].name); 62 | - name: Identify release type 63 | id: releasetype 64 | # if previousver is not provided then this steps just logs information about missing version, no errors 65 | run: echo "type=$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" >> $GITHUB_OUTPUT 66 | - name: Get name of the person that is behind the newly released version 67 | id: author 68 | run: echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT 69 | - name: Publish information about the release to Twitter # tweet only if detected version change is not a patch 70 | # tweet goes out even if the type is not major or minor but "You need provide version number to compare." 71 | # 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 72 | if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same 73 | uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0 74 | with: 75 | twitter_status: "Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱💪🍾🎂\n\nThank you for the contribution ${{ steps.author.outputs.name }} ${{github.event.release.html_url}}" 76 | twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} 77 | twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} 78 | twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} 79 | twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} -------------------------------------------------------------------------------- /.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@v6 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://github.com/asyncapi/community/blob/master/recognize-contributors.md) document. 7 | 8 | ## Summary of the contribution flow 9 | 10 | The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate. 11 | 12 | ``` 13 | ┌───────────────────────┐ 14 | │ │ 15 | │ Open an issue │ 16 | │ (a bug report or a │ 17 | │ feature request) │ 18 | │ │ 19 | └───────────────────────┘ 20 | ⇩ 21 | ┌───────────────────────┐ 22 | │ │ 23 | │ Open a Pull Request │ 24 | │ (only after issue │ 25 | │ is approved) │ 26 | │ │ 27 | └───────────────────────┘ 28 | ⇩ 29 | ┌───────────────────────┐ 30 | │ │ 31 | │ Your changes will │ 32 | │ be merged and │ 33 | │ published on the next │ 34 | │ release │ 35 | │ │ 36 | └───────────────────────┘ 37 | ``` 38 | 39 | ## Code of Conduct 40 | 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. 41 | 42 | ## Our Development Process 43 | We use Github to host code, to track issues and feature requests, as well as accept pull requests. 44 | 45 | ## Issues 46 | [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://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster! 47 | 48 | ## Bug Reports and Feature Requests 49 | 50 | Please use our issues templates that provide you with hints on what information we need from you to help you out. 51 | 52 | ## Pull Requests 53 | 54 | **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://github.com/asyncapi/community/blob/master/git-workflow.md) used in our repositories. 55 | 56 | ## Conventional commits 57 | 58 | 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/). 59 | 60 | 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: 61 | 62 | - `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered. 63 | - `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered. 64 | - `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release. 65 | - `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release. 66 | - `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release. 67 | - `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release. 68 | 69 | What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: ` 70 | 71 | 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). 72 | 73 | Happy contributing :heart: 74 | 75 | ## License 76 | 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. 77 | 78 | ## References 79 | This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md). -------------------------------------------------------------------------------- /.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@v6 30 | with: 31 | github-token: ${{ secrets.GH_TOKEN }} 32 | script: | 33 | const prDetailsUrl = context.payload.issue.pull_request.url; 34 | const { data: pull } = await github.request(prDetailsUrl); 35 | const { draft: isDraft} = pull; 36 | if(!isDraft) { 37 | console.log('adding ready-to-merge label...'); 38 | github.rest.issues.addLabels({ 39 | issue_number: context.issue.number, 40 | owner: context.repo.owner, 41 | repo: context.repo.repo, 42 | labels: ['ready-to-merge'] 43 | }) 44 | } 45 | 46 | const { data: comparison } = 47 | await github.rest.repos.compareCommitsWithBasehead({ 48 | owner: pull.head.repo.owner.login, 49 | repo: pull.head.repo.name, 50 | basehead: `${pull.base.label}...${pull.head.label}`, 51 | }); 52 | if (comparison.behind_by !== 0 && pull.mergeable_state === 'behind') { 53 | console.log(`This branch is behind the target by ${comparison.behind_by} commits`) 54 | console.log('adding out-of-date comment...'); 55 | github.rest.issues.createComment({ 56 | issue_number: context.issue.number, 57 | owner: context.repo.owner, 58 | repo: context.repo.repo, 59 | body: `Hello, @${{ github.actor }}! 👋🏼 60 | This PR is not up to date with the base branch and can't be merged. 61 | Please update your branch manually with the latest version of the base branch. 62 | PRO-TIP: Add a comment to your PR with the text: \`/au\` or \`/autoupdate\` and our bot will take care of updating the branch in the future. 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. 63 | Thanks 😄` 64 | }) 65 | } 66 | 67 | add-do-not-merge-label: 68 | if: > 69 | github.event.issue.pull_request && 70 | github.event.issue.state != 'closed' && 71 | github.actor != 'asyncapi-bot' && 72 | ( 73 | contains(github.event.comment.body, '/do-not-merge') || 74 | contains(github.event.comment.body, '/dnm' ) 75 | ) 76 | runs-on: ubuntu-latest 77 | steps: 78 | - name: Add do-not-merge label 79 | uses: actions/github-script@v6 80 | with: 81 | github-token: ${{ secrets.GH_TOKEN }} 82 | script: | 83 | github.rest.issues.addLabels({ 84 | issue_number: context.issue.number, 85 | owner: context.repo.owner, 86 | repo: context.repo.repo, 87 | labels: ['do-not-merge'] 88 | }) 89 | add-autoupdate-label: 90 | if: > 91 | github.event.issue.pull_request && 92 | github.event.issue.state != 'closed' && 93 | github.actor != 'asyncapi-bot' && 94 | ( 95 | contains(github.event.comment.body, '/autoupdate') || 96 | contains(github.event.comment.body, '/au' ) 97 | ) 98 | runs-on: ubuntu-latest 99 | steps: 100 | - name: Add autoupdate label 101 | uses: actions/github-script@v6 102 | with: 103 | github-token: ${{ secrets.GH_TOKEN }} 104 | script: | 105 | github.rest.issues.addLabels({ 106 | issue_number: context.issue.number, 107 | owner: context.repo.owner, 108 | repo: context.repo.repo, 109 | labels: ['autoupdate'] 110 | }) 111 | -------------------------------------------------------------------------------- /.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 | 19 | jobs: 20 | 21 | test-nodejs: 22 | # We just check the message of first commit as there is always just one commit because we squash into one before merging 23 | # "commits" contains array of objects where one of the properties is commit "message" 24 | # Release workflow will be skipped if release conventional commits are not used 25 | if: | 26 | startsWith( github.repository, 'asyncapi/' ) && 27 | (startsWith( github.event.commits[0].message , 'fix:' ) || 28 | startsWith( github.event.commits[0].message, 'fix!:' ) || 29 | startsWith( github.event.commits[0].message, 'feat:' ) || 30 | startsWith( github.event.commits[0].message, 'feat!:' )) 31 | name: Test NodeJS release on ${{ matrix.os }} 32 | runs-on: ${{ matrix.os }} 33 | strategy: 34 | matrix: 35 | os: [ubuntu-latest, macos-latest, windows-latest] 36 | steps: 37 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 38 | run: | 39 | git config --global core.autocrlf false 40 | git config --global core.eol lf 41 | - name: Checkout repository 42 | uses: actions/checkout@v2 43 | - name: Check if Node.js project and has package.json 44 | id: packagejson 45 | run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" 46 | shell: bash 47 | - if: steps.packagejson.outputs.exists == 'true' 48 | name: Setup Node.js 49 | uses: actions/setup-node@v2 50 | with: 51 | node-version: 14 52 | cache: 'npm' 53 | cache-dependency-path: '**/package-lock.json' 54 | - if: steps.packagejson.outputs.exists == 'true' 55 | name: Install dependencies 56 | run: npm install 57 | - if: steps.packagejson.outputs.exists == 'true' 58 | name: Run test 59 | run: npm test 60 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 61 | name: Report workflow run status to Slack 62 | uses: 8398a7/action-slack@v3 63 | with: 64 | status: ${{ job.status }} 65 | fields: repo,action,workflow 66 | text: 'Release workflow failed in testing job' 67 | env: 68 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} 69 | 70 | release: 71 | needs: [test-nodejs] 72 | name: Publish to any of NPM, Github, and Docker Hub 73 | runs-on: ubuntu-latest 74 | steps: 75 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 76 | run: | 77 | git config --global core.autocrlf false 78 | git config --global core.eol lf 79 | - name: Checkout repository 80 | uses: actions/checkout@v2 81 | - name: Check if Node.js project and has package.json 82 | id: packagejson 83 | run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" 84 | - if: steps.packagejson.outputs.exists == 'true' 85 | name: Setup Node.js 86 | uses: actions/setup-node@v1 87 | with: 88 | node-version: 14 89 | - if: steps.packagejson.outputs.exists == 'true' 90 | name: Install dependencies 91 | run: npm install 92 | - if: steps.packagejson.outputs.exists == 'true' 93 | name: Publish to any of NPM, Github, and Docker Hub 94 | id: release 95 | env: 96 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 97 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 98 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 99 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 100 | GIT_AUTHOR_NAME: asyncapi-bot 101 | GIT_AUTHOR_EMAIL: info@asyncapi.io 102 | GIT_COMMITTER_NAME: asyncapi-bot 103 | GIT_COMMITTER_EMAIL: info@asyncapi.io 104 | run: npm run release 105 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 106 | name: Report workflow run status to Slack 107 | uses: 8398a7/action-slack@v3 108 | with: 109 | status: ${{ job.status }} 110 | fields: repo,action,workflow 111 | text: 'Release workflow failed in release job' 112 | env: 113 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![AsyncAPI Cupid](./assets/img/readme-banner.png)](https://www.asyncapi.com) 2 | 3 | [![Github license](https://img.shields.io/github/license/asyncapi/cupid)](https://github.com/asyncapi/cupid/blob/master/LICENSE) 4 | [![PR testing - if Node project](https://github.com/asyncapi/cupid/actions/workflows/if-nodejs-pr-testing.yml/badge.svg)](https://github.com/asyncapi/cupid/actions/workflows/if-nodejs-pr-testing.yml) 5 | [![npm](https://img.shields.io/npm/dw/@asyncapi/cupid)](https://www.npmjs.com/package/@asyncapi/cupid) 6 | [![Coverage Status](https://coveralls.io/repos/github/asyncapi/cupid/badge.svg?branch=master)](https://coveralls.io/repos/github/asyncapi/cupid/badge.svg?branch=master) 7 | 8 | 9 | 10 | 11 | 12 | - [Overview](#overview) 13 | - [Install](#install) 14 | - [Technical Details](#technical-details) 15 | - [API Documentation](#api-documentation) 16 | - [Usage](#usage) 17 | * [Node.js](#nodejs) 18 | * [Default Output Syntax](#default-output-syntax) 19 | - [Mermaid Flowchart](#mermaid-flowchart) 20 | * [Syntax](#syntax) 21 | * [Flowchart](#flowchart) 22 | - [PlantUML classDiagram](#plantuml-classdiagram) 23 | * [Syntax](#syntax-1) 24 | * [ClassDiagram](#classdiagram) 25 | - [React Flow Nodes](#react-flow--nodes) 26 | * [Syntax](#syntax-2) 27 | * [React Flow Nodes](#react-flow-nodes) 28 | * [Steps to visualize relations in React Flow](#steps-to-visualize-relations-in-react-flow) 29 | - [Develop](#develop) 30 | - [Contributing](#contributing) 31 | 32 | 33 | 34 | ## Overview 35 | An official library that focuses on finding and analyzing the relationships between AsyncAPI files to later output consolidated information about the system architecture. Output format would be customizable and available in different formats like PlantUML, mermaid.js, ReactFlow. 36 | ## Install 37 | 38 | ``` 39 | npm install @asyncapi/cupid 40 | ``` 41 | 42 | ## Technical Details 43 | This library takes AsyncAPI files as an array input for which the user wants to discover the relations between them. It then validates and parses the given array of AsyncAPI files and generates the output in desired passed syntax. In the process, for every different server, it assigns a slug having the server's URL and protocol and then maps channels with the same server. Following, it maps the service information with the channel's name as per if the service is subscribing/publishing to a given channel. The sub/pub Map of default output syntax provides the service name and the metadata of the service including but not limited to `description`, `payload`, `headers`, `bindings`, `extensions`. 44 | ## API Documentation 45 | 46 | See [API documentation](https://github.com/asyncapi/cupid/blob/master/API.md) for more example and full API reference information. 47 | 48 | 49 | ## Usage 50 | 51 | ### Node.js 52 | 53 | ```javascript 54 | const cupid = require('@asyncapi/cupid'); 55 | const path = require('path'); 56 | const fs = require('fs'); 57 | 58 | async function getAsyncApiExamples() { 59 | const docs = []; 60 | const files = [ 61 | ... 62 | ] 63 | for (const file of files) { 64 | const asyncApiDoc = fs.readFileSync(file, 'utf8'); 65 | docs.push(asyncApiDoc); 66 | } 67 | try { 68 | const mermaidFlowchart = await cupid.getRelations(docs,{syntax:'mermaid'}); 69 | console.log(mermaidFlowchart); 70 | } catch (error) { 71 | console.error(error); 72 | } 73 | } 74 | getAsyncApiExamples(); 75 | 76 | // For default output syntax 77 | const defaultOutput = cupid.getRelations(docs); 78 | 79 | // For mermaid Flowchart 80 | const mermaidFlowchart = cupid.getRelations(docs,{syntax:'mermaid'}); 81 | 82 | // For plantUML classDiagram 83 | const plantUMLClassDiagram = cupid.getRelations(docs,{syntax:'plantUML'}); 84 | 85 | // For reactFlow nodes 86 | const reactFlowNodes = cupid.getRelations(docs,{syntax:'reactFlow'}); 87 | ``` 88 | 89 | ### Default Output Syntax 90 | 91 | ```javascript 92 | Map(n) { 93 | '' => Map(m) { 94 | 'channel1' => { sub: [Map(1) {"" => ""}, ...], pub: [[Map(1) {"" => ""}, ...] }, 95 | 'channel2' => { sub: [[Map(1) {"" => ""}, ...], pub: [[Map(1) {"" => ""}, ...] } 96 | } 97 | } 98 | ``` 99 | ## Mermaid Flowchart 100 | ### Syntax 101 | Based on [Flight Notification Service](https://github.com/asyncapi/cupid/tree/master/test/examples) example. 102 | ``` 103 | graph TD 104 | server1[(mqtt://localhost:1883)] 105 | FlightMonitorService[Flight Monitor Service] 106 | FlightMonitorService -- flight/update --> server1 107 | FlightNotifierService[Flight Notifier Service] 108 | server1 -- flight/update --> FlightNotifierService 109 | FlightSubscriberService[Flight Subscriber Service] 110 | FlightSubscriberService -- flight/queue --> server1 111 | server1 -- flight/queue --> FlightMonitorService 112 | ``` 113 | 114 | ### Flowchart 115 | 116 | Mermaid Flowchart

117 | 118 | **[View in online editor](https://mermaid-js.github.io/mermaid-live-editor/edit#eyJjb2RlIjoiZ3JhcGggVERcbiBzZXJ2ZXIxWyhtcXR0Oi8vbG9jYWxob3N0OjE4ODMpXVxuRmxpZ2h0TW9uaXRvclNlcnZpY2VbRmxpZ2h0IE1vbml0b3IgU2VydmljZV1cbkZsaWdodE1vbml0b3JTZXJ2aWNlIC0tIGZsaWdodC91cGRhdGUgLS0-IHNlcnZlcjFcbkZsaWdodE5vdGlmaWVyU2VydmljZVtGbGlnaHQgTm90aWZpZXIgU2VydmljZV1cbnNlcnZlcjEgLS0gZmxpZ2h0L3VwZGF0ZSAtLT4gRmxpZ2h0Tm90aWZpZXJTZXJ2aWNlXG5GbGlnaHRTdWJzY3JpYmVyU2VydmljZVtGbGlnaHQgU3Vic2NyaWJlciBTZXJ2aWNlXVxuRmxpZ2h0U3Vic2NyaWJlclNlcnZpY2UgLS0gZmxpZ2h0L3F1ZXVlIC0tPiBzZXJ2ZXIxXG5zZXJ2ZXIxIC0tIGZsaWdodC9xdWV1ZSAtLT4gRmxpZ2h0TW9uaXRvclNlcnZpY2UiLCJtZXJtYWlkIjoie1xuICBcInRoZW1lXCI6IFwiZGVmYXVsdFwiXG59IiwidXBkYXRlRWRpdG9yIjp0cnVlLCJhdXRvU3luYyI6dHJ1ZSwidXBkYXRlRGlhZ3JhbSI6dHJ1ZX0)** 119 | ## PlantUML classDiagram 120 | 121 | ### Syntax 122 | Based on FlightService example. 123 | ``` 124 | @startuml 125 | title Classes - Class Diagram 126 | 127 | class server1 { 128 | url: mqtt://localhost:1883 129 | protocol: mqtt 130 | } 131 | FlightMonitorService --|> server1:flight/update 132 | server1 --|> FlightNotifierService:flight/update 133 | FlightSubscriberService --|> server1:flight/queue 134 | server1 --|> FlightMonitorService:flight/queue 135 | @enduml 136 | ``` 137 | ### ClassDiagram 138 | 139 | PlantUML classDiagram

140 | 141 | **[View in online editor](https://www.planttext.com/?text=VP3D3e8m3CVlVOgz02742zd1a6YywOKd6AF0aa6Xwxoexou1EM2CjpRz_JzIA88ObjXx42SUrScR432eP9tKsPcMJGzWbpKWtv4pzL2W8dkj-ab4fwadQtn7GNIMvuVvE389MVeGy8ABTsqdLngS49UpZREeakHvt3nrin1f76iZ25lIWgpY6ubh76xgBy7AbB4Abbs5VpEcYF5dnBxV7YzmgET7lG40)** 142 | ## React Flow Nodes 143 | 144 | ### Syntax 145 | Based on FlightService example. 146 | ```javascript 147 | [ 148 | { 149 | id: 'Server1', 150 | data: { label: 'mqtt://localhost:1883,mqtt' }, 151 | position: { x: 250, y: 5 } 152 | }, 153 | { 154 | id: 'FlightMonitorService', 155 | data: { label: 'Flight Monitor Service' }, 156 | position: { x: 100, y: 10 } 157 | }, 158 | { 159 | id: 'edge1', 160 | source: 'FlightMonitorService', 161 | target: 'Server1', 162 | animated: true, 163 | label: 'flight/update', 164 | type: 'edgeType', 165 | arrowHeadType: 'arrowclosed' 166 | }, 167 | { 168 | id: 'FlightNotifierService', 169 | data: { label: 'Flight Notifier Service' }, 170 | position: { x: 100, y: 10 } 171 | }, 172 | { 173 | id: 'edge2', 174 | source: 'Server1', 175 | target: 'FlightNotifierService', 176 | animated: true, 177 | label: 'flight/update', 178 | type: 'edgeType', 179 | arrowHeadType: 'arrowclosed' 180 | }, 181 | { 182 | id: 'FlightSubscriberService', 183 | data: { label: 'Flight Subscriber Service' }, 184 | position: { x: 100, y: 10 } 185 | }, 186 | { 187 | id: 'edge3', 188 | source: 'FlightSubscriberService', 189 | target: 'Server1', 190 | animated: true, 191 | label: 'flight/queue', 192 | type: 'edgeType', 193 | arrowHeadType: 'arrowclosed' 194 | }, 195 | { 196 | id: 'edge4', 197 | source: 'Server1', 198 | target: 'FlightMonitorService', 199 | animated: true, 200 | label: 'flight/queue', 201 | type: 'edgeType', 202 | arrowHeadType: 'arrowclosed' 203 | } 204 | ] 205 | ``` 206 | ### React Flow Nodes 207 | 208 | reactFlow Nodes

209 | 210 | ### Steps to visualize relations in React Flow 211 | 212 | 1. Setup a react project in which you want to display reactFlow nodes. 213 | 2. Install `@asyncapi/cupid` into the project. 214 | 3. Make a react component for the example. 215 | 216 | **Example** 217 | ```javascript 218 | import React from 'react'; 219 | import ReactFlow from 'react-flow-renderer'; 220 | import cupid from '@asyncapi/cupid'; 221 | import {getAsyncApiExamples} from './utils'; // function for reading AsyncAPI files 222 | 223 | const docs = getAsyncApiExamples(); 224 | const elements = cupid.getRelations(docs,{syntax:'reactFlow'}); 225 | 226 | export default () => ( 227 |
228 | 229 |
230 | ); 231 | ``` 232 | 233 | ## Develop 234 | 235 | 1. Clone the project `git clone https://github.com/asyncapi/cupid.git` 236 | 2. Install the dependencies `npm i` 237 | 3. For a quick overview you can run tests by `npm test`. You can also contribute to provide more different syntax outputs to visualize the relations. 238 | 4. Write code and tests. 239 | 5. Make sure all tests pass `npm test` 240 | 6. Make sure code is well formatted and secure `npm run lint` 241 | 242 | 243 | ## Contributing 244 | 245 | Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) guide. 246 | -------------------------------------------------------------------------------- /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. 202 | -------------------------------------------------------------------------------- /.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@v3 36 | - name: Setup Node.js 37 | uses: actions/setup-node@v3 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 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 47 | id: issuemarkdown 48 | with: 49 | markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" 50 | - name: Send info about issue 51 | uses: rtCamp/action-slack-notify@v2 52 | env: 53 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 54 | SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘 55 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 56 | MSG_MINIMAL: true 57 | ######### 58 | # Handling Mailchimp notifications 59 | ######### 60 | - name: Install deps 61 | run: npm install 62 | working-directory: ./.github/workflows/scripts/mailchimp 63 | - name: Send email with MailChimp 64 | uses: actions/github-script@v6 65 | env: 66 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 67 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 68 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 69 | with: 70 | script: | 71 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 72 | sendEmail('${{github.event.issue.html_url}}', '${{github.event.issue.title}}'); 73 | 74 | pull_request: 75 | if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members') 76 | name: TSC notification on every new pull request 77 | runs-on: ubuntu-latest 78 | steps: 79 | - name: Checkout repository 80 | uses: actions/checkout@v3 81 | - name: Setup Node.js 82 | uses: actions/setup-node@v3 83 | with: 84 | node-version: 16 85 | cache: 'npm' 86 | cache-dependency-path: '**/package-lock.json' 87 | ######### 88 | # Handling Slack notifications 89 | ######### 90 | - name: Convert markdown to slack markdown 91 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 92 | id: prmarkdown 93 | with: 94 | markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" 95 | - name: Send info about pull request 96 | uses: rtCamp/action-slack-notify@v2 97 | env: 98 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 99 | SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘 100 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 101 | MSG_MINIMAL: true 102 | ######### 103 | # Handling Mailchimp notifications 104 | ######### 105 | - name: Install deps 106 | run: npm install 107 | working-directory: ./.github/workflows/scripts/mailchimp 108 | - name: Send email with MailChimp 109 | uses: actions/github-script@v6 110 | env: 111 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 112 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 113 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 114 | with: 115 | script: | 116 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 117 | sendEmail('${{github.event.pull_request.html_url}}', '${{github.event.pull_request.title}}'); 118 | 119 | discussion: 120 | if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members') 121 | name: TSC notification on every new discussion 122 | runs-on: ubuntu-latest 123 | steps: 124 | - name: Checkout repository 125 | uses: actions/checkout@v3 126 | - name: Setup Node.js 127 | uses: actions/setup-node@v3 128 | with: 129 | node-version: 16 130 | cache: 'npm' 131 | cache-dependency-path: '**/package-lock.json' 132 | ######### 133 | # Handling Slack notifications 134 | ######### 135 | - name: Convert markdown to slack markdown 136 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 137 | id: discussionmarkdown 138 | with: 139 | markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" 140 | - name: Send info about pull request 141 | uses: rtCamp/action-slack-notify@v2 142 | env: 143 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 144 | SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘 145 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 146 | MSG_MINIMAL: true 147 | ######### 148 | # Handling Mailchimp notifications 149 | ######### 150 | - name: Install deps 151 | run: npm install 152 | working-directory: ./.github/workflows/scripts/mailchimp 153 | - name: Send email with MailChimp 154 | uses: actions/github-script@v6 155 | env: 156 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 157 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 158 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 159 | with: 160 | script: | 161 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 162 | sendEmail('${{github.event.discussion.html_url}}', '${{github.event.discussion.title}}'); 163 | 164 | issue_comment: 165 | if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }} 166 | name: TSC notification on every new comment in issue 167 | runs-on: ubuntu-latest 168 | steps: 169 | - name: Checkout repository 170 | uses: actions/checkout@v3 171 | - name: Setup Node.js 172 | uses: actions/setup-node@v3 173 | with: 174 | node-version: 16 175 | cache: 'npm' 176 | cache-dependency-path: '**/package-lock.json' 177 | ######### 178 | # Handling Slack notifications 179 | ######### 180 | - name: Convert markdown to slack markdown 181 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 182 | id: issuemarkdown 183 | with: 184 | markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 185 | - name: Send info about issue comment 186 | uses: rtCamp/action-slack-notify@v2 187 | env: 188 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 189 | SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘 190 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 191 | MSG_MINIMAL: true 192 | ######### 193 | # Handling Mailchimp notifications 194 | ######### 195 | - name: Install deps 196 | run: npm install 197 | working-directory: ./.github/workflows/scripts/mailchimp 198 | - name: Send email with MailChimp 199 | uses: actions/github-script@v6 200 | env: 201 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 202 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 203 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 204 | with: 205 | script: | 206 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 207 | sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}'); 208 | 209 | pr_comment: 210 | if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') 211 | name: TSC notification on every new comment in pr 212 | runs-on: ubuntu-latest 213 | steps: 214 | - name: Checkout repository 215 | uses: actions/checkout@v3 216 | - name: Setup Node.js 217 | uses: actions/setup-node@v3 218 | with: 219 | node-version: 16 220 | cache: 'npm' 221 | cache-dependency-path: '**/package-lock.json' 222 | ######### 223 | # Handling Slack notifications 224 | ######### 225 | - name: Convert markdown to slack markdown 226 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 227 | id: prmarkdown 228 | with: 229 | markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 230 | - name: Send info about PR comment 231 | uses: rtCamp/action-slack-notify@v2 232 | env: 233 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 234 | SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘 235 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 236 | MSG_MINIMAL: true 237 | ######### 238 | # Handling Mailchimp notifications 239 | ######### 240 | - name: Install deps 241 | run: npm install 242 | working-directory: ./.github/workflows/scripts/mailchimp 243 | - name: Send email with MailChimp 244 | uses: actions/github-script@v6 245 | env: 246 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 247 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 248 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 249 | with: 250 | script: | 251 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 252 | sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}'); 253 | 254 | discussion_comment: 255 | if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members') 256 | name: TSC notification on every new comment in discussion 257 | runs-on: ubuntu-latest 258 | steps: 259 | - name: Checkout repository 260 | uses: actions/checkout@v3 261 | - name: Setup Node.js 262 | uses: actions/setup-node@v3 263 | with: 264 | node-version: 16 265 | cache: 'npm' 266 | cache-dependency-path: '**/package-lock.json' 267 | ######### 268 | # Handling Slack notifications 269 | ######### 270 | - name: Convert markdown to slack markdown 271 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 272 | id: discussionmarkdown 273 | with: 274 | markdown: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 275 | - name: Send info about discussion comment 276 | uses: rtCamp/action-slack-notify@v2 277 | env: 278 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 279 | SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘 280 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 281 | MSG_MINIMAL: true 282 | ######### 283 | # Handling Mailchimp notifications 284 | ######### 285 | - name: Install deps 286 | run: npm install 287 | working-directory: ./.github/workflows/scripts/mailchimp 288 | - name: Send email with MailChimp 289 | uses: actions/github-script@v6 290 | env: 291 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 292 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 293 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 294 | with: 295 | script: | 296 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 297 | sendEmail('${{github.event.comment.html_url}}', '${{github.event.discussion.title}}'); 298 | -------------------------------------------------------------------------------- /test/appRelationsDiscovery_test.js: -------------------------------------------------------------------------------- 1 | const chai = require('chai'); 2 | const chaiAsPromised = require('chai-as-promised'); 3 | 4 | const expect = chai.expect; 5 | chai.use(chaiAsPromised); 6 | 7 | const {getRelations} = require('../lib/appRelationsDiscovery'); 8 | const {getAsyncApiExamples,parseAsyncApiExamples} = require('./testsUtil'); 9 | 10 | const outputMermaid = 'graph TD\n server1[(mqtt://localhost:1883)]\nFlightMonitorService[Flight Monitor Service]\nFlightMonitorService -- flight/update --> server1\nFlightNotifierService[Flight Notifier Service]\nserver1 -- flight/update --> FlightNotifierService\nFlightSubscriberService[Flight Subscriber Service]\nFlightSubscriberService -- flight/queue --> server1\nserver1 -- flight/queue --> FlightMonitorService'; 11 | const outputPlantUML = '@startuml\ntitle Classes - Class Diagram\n\nclass server1 { \n url: mqtt://localhost:1883 \n protocol: mqtt\n}\nFlightMonitorService --|> server1:flight/update\nserver1 --|> FlightNotifierService:flight/update\nFlightSubscriberService --|> server1:flight/queue\nserver1 --|> FlightMonitorService:flight/queue\n@enduml'; 12 | const outputReactFlow = [{ id: 'Server1', data: { label: 'mqtt://localhost:1883,mqtt' }, position: { x: 250, y: 5 } }, { id: 'FlightMonitorService', data: { label: 'Flight Monitor Service' }, position: { x: 100, y: 10 } }, { id: 'edge1', source: 'FlightMonitorService', target: 'Server1', animated: true, label: 'flight/update', type: 'edgeType', arrowHeadType: 'arrowclosed' }, { id: 'FlightNotifierService', data: { label: 'Flight Notifier Service' }, position: { x: 100, y: 10 } }, { id: 'edge2', source: 'Server1', target: 'FlightNotifierService', animated: true, label: 'flight/update', type: 'edgeType', arrowHeadType: 'arrowclosed' }, { id: 'FlightSubscriberService', data: { label: 'Flight Subscriber Service' }, position: { x: 100, y: 10 } }, { id: 'edge3', source: 'FlightSubscriberService', target: 'Server1', animated: true, label: 'flight/queue', type: 'edgeType', arrowHeadType: 'arrowclosed' }, { id: 'edge4', source: 'Server1', target: 'FlightMonitorService', animated: true, label: 'flight/queue', type: 'edgeType', arrowHeadType: 'arrowclosed'}]; 13 | const flightUpdateSubData = new Map(Object.entries({'Flight Monitor Service': {description: 'Provides updates from a subscribed flight\n',subscribe: {summary: 'Inform about the status of a subscribed flight',message: {summary: 'Provides flight status on arrival and destination',payload: {type: 'object',properties: {user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith','x-parser-schema-id': ''},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235','x-parser-schema-id': ''}},'x-parser-schema-id': ''},departure: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD','x-parser-schema-id': ''},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15','x-parser-schema-id': ''},gate: {type: 'string',description: 'departure gate',example: '2D','x-parser-schema-id': ''},terminal: {type: 'string',description: 'airport terminal',example: '4','x-parser-schema-id': ''}},'x-parser-schema-id': ''},arrival: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD','x-parser-schema-id': ''},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15','x-parser-schema-id': ''},gate: {type: 'string',description: 'departure gate',example: '2D','x-parser-schema-id': ''},terminal: {type: 'string',description: 'airport terminal',example: '4','x-parser-schema-id': ''}},'x-parser-schema-id': ''}},'x-parser-schema-id': ''},'x-parser-original-schema-format': 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-original-payload': {type: 'object',properties: {user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith'},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235'}}},departure: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD'},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15'},gate: {type: 'string',description: 'departure gate',example: '2D'},terminal: {type: 'string',description: 'airport terminal',example: '4'}}},arrival: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD'},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15'},gate: {type: 'string',description: 'departure gate',example: '2D'},terminal: {type: 'string',description: 'airport terminal',example: '4'}}}}},schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-message-parsed': true,'x-parser-message-name': 'flightStatus'}}}})); 14 | const flightUpdatePubData = new Map(Object.entries({'Flight Notifier Service': {description: 'Receives updates from a subscribed flight\n',publish: {summary: 'Inform about the status of a subscribed flight',message: {summary: 'Provides flight status on arrival and destination',payload: {type: 'object',properties: {user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith','x-parser-schema-id': ''},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235','x-parser-schema-id': ''}},'x-parser-schema-id': ''},departure: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD','x-parser-schema-id': ''},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15','x-parser-schema-id': ''},gate: {type: 'string',description: 'departure gate',example: '2D','x-parser-schema-id': ''},terminal: {type: 'string',description: 'airport terminal',example: '4','x-parser-schema-id': ''}},'x-parser-schema-id': ''},arrival: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD','x-parser-schema-id': ''},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15','x-parser-schema-id': ''},gate: {type: 'string',description: 'departure gate',example: '2D','x-parser-schema-id': ''},terminal: {type: 'string',description: 'airport terminal',example: '4','x-parser-schema-id': ''}},'x-parser-schema-id': ''}},'x-parser-schema-id': ''},'x-parser-original-schema-format': 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-original-payload': {type: 'object',properties: {user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith'},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235'}}},departure: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD'},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15'},gate: {type: 'string',description: 'departure gate',example: '2D'},terminal: {type: 'string',description: 'airport terminal',example: '4'}}},arrival: {type: 'object',properties: {iataCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'MAD'},scheduledDate: {type: 'string',format: 'date-time',description: 'scheduled datetime of the flight, local to the airport.',example: '2020-10-20 19:15'},gate: {type: 'string',description: 'departure gate',example: '2D'},terminal: {type: 'string',description: 'airport terminal',example: '4'}}}}},schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-message-parsed': true,'x-parser-message-name': 'flightStatus'}}}})); 15 | const flightQueueSubData = new Map(Object.entries({'Flight Subscriber Service': {description: 'queue flight in order to retrieve status\n',subscribe: {summary: 'Receive information about the flight that should be monitored for changes',message: {summary: 'Requets to queue a flight to be monitored',payload: {type: 'object',properties: {flight: {type: 'object',properties: {carrierCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'LH','x-parser-schema-id': ''},flightNumber: {type: 'integer',minimum: 1,description: '1 to 4-digit number of the flight',example: '193','x-parser-schema-id': ''},scheduledDepartureDate: {type: 'string',format: 'date-time',description: 'scheduled departure date of the flight, local to the departure airport.',example: '2020-10-20','x-parser-schema-id': ''}},'x-parser-schema-id': ''},user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith','x-parser-schema-id': ''},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235','x-parser-schema-id': ''}},'x-parser-schema-id': ''}},'x-parser-schema-id': ''},'x-parser-original-schema-format': 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-original-payload': {type: 'object',properties: {flight: {type: 'object',properties: {carrierCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'LH'},flightNumber: {type: 'integer',minimum: 1,description: '1 to 4-digit number of the flight',example: '193'},scheduledDepartureDate: {type: 'string',format: 'date-time',description: 'scheduled departure date of the flight, local to the departure airport.',example: '2020-10-20'}}},user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith'},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235'}}}}},schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-message-parsed': true,'x-parser-message-name': 'flightQueue'}}}})); 16 | const flightQueuePubData = new Map(Object.entries({'Flight Monitor Service': {description: 'Queues a flight in order to retrieve status\n',publish: {summary: 'Subscribe about the status of a given flight',message: {summary: 'Requets to queue a flight to be monitored',payload: {type: 'object',properties: {flight: {type: 'object',properties: {carrierCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'LH','x-parser-schema-id': ''},flightNumber: {type: 'integer',minimum: 1,description: '1 to 4-digit number of the flight',example: '193','x-parser-schema-id': ''},scheduledDepartureDate: {type: 'string',format: 'date-time',description: 'scheduled departure date of the flight, local to the departure airport.',example: '2020-10-20','x-parser-schema-id': ''}},'x-parser-schema-id': ''},user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith','x-parser-schema-id': ''},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235','x-parser-schema-id': ''}},'x-parser-schema-id': ''}},'x-parser-schema-id': ''},'x-parser-original-schema-format': 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-original-payload': {type: 'object',properties: {flight: {type: 'object',properties: {carrierCode: {type: 'string',description: '2 to 3-character IATA carrier code',example: 'LH'},flightNumber: {type: 'integer',minimum: 1,description: '1 to 4-digit number of the flight',example: '193'},scheduledDepartureDate: {type: 'string',format: 'date-time',description: 'scheduled departure date of the flight, local to the departure airport.',example: '2020-10-20'}}},user: {type: 'object',properties: {userName: {type: 'string',minimum: 1,description: 'user name',example: 'John Smith'},phoneNumber: {type: 'string',minimum: 5,description: 'phone number where notifications will be received.',example: '+13451235'}}}}},schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0','x-parser-message-parsed': true,'x-parser-message-name': 'flightQueue'}}}})); 17 | 18 | describe('appRelationDiscovery', function() { 19 | let flightServiceDocs; 20 | let correctSlug; 21 | let slugOutput; 22 | let parsedSlugOutput; 23 | let output; 24 | let correctChannelUpdate; 25 | let correctChannelQueue; 26 | let parsedDocs; 27 | let parsedOutput; 28 | 29 | before(async function() { 30 | flightServiceDocs = getAsyncApiExamples(); 31 | parsedDocs = await parseAsyncApiExamples(flightServiceDocs); 32 | output = await getRelations(flightServiceDocs); 33 | parsedOutput = await getRelations(parsedDocs); 34 | correctSlug = 'mqtt://localhost:1883,mqtt'; 35 | slugOutput = output.get(correctSlug); 36 | parsedSlugOutput = parsedOutput.get(correctSlug); 37 | correctChannelUpdate = 'flight/update'; 38 | correctChannelQueue = 'flight/queue'; 39 | }); 40 | it('should return correct slug', function() { 41 | expect(output).to.have.key(correctSlug); 42 | expect(parsedOutput).to.have.key(correctSlug); 43 | }); 44 | 45 | it('should return correct channels', function() { 46 | expect(slugOutput).to.have.all.keys(correctChannelUpdate, correctChannelQueue); 47 | expect(parsedSlugOutput).to.have.all.keys(correctChannelUpdate, correctChannelQueue); 48 | }); 49 | 50 | it('should return correct subscriber data for flight/update channel', async function() { 51 | const updateChannelOutput = slugOutput.get(correctChannelUpdate); 52 | const updateChannelParsedOutput = parsedSlugOutput.get(correctChannelUpdate); 53 | const correctSubOperation = 'Flight Monitor Service'; 54 | expect(updateChannelOutput.sub.get(correctSubOperation)).to.deep.equal(flightUpdateSubData.get(correctSubOperation)); 55 | expect(updateChannelParsedOutput.sub.get(correctSubOperation)).to.deep.equal(flightUpdateSubData.get(correctSubOperation)); 56 | }); 57 | 58 | it('should return correct publisher data for flight/update channel', async function() { 59 | const updateChannelOutput = slugOutput.get(correctChannelUpdate); 60 | const updateChannelParsedOutput = parsedSlugOutput.get(correctChannelUpdate); 61 | const correctPubOperation = 'Flight Notifier Service'; 62 | expect(updateChannelOutput.pub.get(correctPubOperation)).to.deep.equal(flightUpdatePubData.get(correctPubOperation)); 63 | expect(updateChannelParsedOutput.pub.get(correctPubOperation)).to.deep.equal(flightUpdatePubData.get(correctPubOperation)); 64 | }); 65 | 66 | it('should return correct subscriber data for flight/queue channel', async function() { 67 | const queueChannelOutput = slugOutput.get(correctChannelQueue); 68 | const queueChannelParsedOutput = parsedSlugOutput.get(correctChannelQueue); 69 | const correctSubOperation = 'Flight Subscriber Service'; 70 | expect(queueChannelOutput.sub.get(correctSubOperation)).to.deep.equal(flightQueueSubData.get(correctSubOperation)); 71 | expect(queueChannelParsedOutput.sub.get(correctSubOperation)).to.deep.equal(flightQueueSubData.get(correctSubOperation)); 72 | }); 73 | 74 | it('should return correct publisher data for flight/queue channel', async function() { 75 | const queueChannelOutput = slugOutput.get(correctChannelQueue); 76 | const queueChannelParsedOutput = parsedSlugOutput.get(correctChannelQueue); 77 | const correctPubOperation = 'Flight Monitor Service'; 78 | expect(queueChannelOutput.pub.get(correctPubOperation)).to.deep.equal(flightQueuePubData.get(correctPubOperation)); 79 | expect(queueChannelParsedOutput.pub.get(correctPubOperation)).to.deep.equal(flightQueuePubData.get(correctPubOperation)); 80 | }); 81 | 82 | it('should return the correct mermaid syntax', async function() { 83 | const testOutput = await getRelations(flightServiceDocs,{syntax: 'mermaid'}); 84 | const testParsedOutput = await getRelations(parsedDocs,{syntax: 'mermaid'}); 85 | expect(testOutput).to.be.equal(outputMermaid); 86 | expect(testParsedOutput).to.be.equal(outputMermaid); 87 | }); 88 | 89 | it('should return the correct plantUML syntax', async function() { 90 | const testOutput = await getRelations(flightServiceDocs,{syntax: 'plantUML'}); 91 | const testParsedOutput = await getRelations(parsedDocs,{syntax: 'plantUML'}); 92 | expect(testOutput).to.be.equal(outputPlantUML); 93 | expect(testParsedOutput).to.be.equal(outputPlantUML); 94 | }); 95 | 96 | it('should return the correct reactFlow elements array', async function() { 97 | const testOutput = await getRelations(flightServiceDocs,{syntax: 'reactFlow'}); 98 | const testParsedOutput = await getRelations(parsedDocs,{syntax: 'reactFlow'}); 99 | expect(testOutput).to.be.deep.equal(outputReactFlow); 100 | expect(testParsedOutput).to.be.deep.equal(outputReactFlow); 101 | }); 102 | }); 103 | -------------------------------------------------------------------------------- /.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/combined-stream": { 60 | "version": "1.0.8", 61 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 62 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 63 | "dependencies": { 64 | "delayed-stream": "~1.0.0" 65 | }, 66 | "engines": { 67 | "node": ">= 0.8" 68 | } 69 | }, 70 | "node_modules/component-emitter": { 71 | "version": "1.3.0", 72 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 73 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" 74 | }, 75 | "node_modules/cookiejar": { 76 | "version": "2.1.3", 77 | "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", 78 | "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" 79 | }, 80 | "node_modules/core-util-is": { 81 | "version": "1.0.3", 82 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 83 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 84 | }, 85 | "node_modules/delayed-stream": { 86 | "version": "1.0.0", 87 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 88 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 89 | "engines": { 90 | "node": ">=0.4.0" 91 | } 92 | }, 93 | "node_modules/dotenv": { 94 | "version": "8.6.0", 95 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", 96 | "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", 97 | "engines": { 98 | "node": ">=10" 99 | } 100 | }, 101 | "node_modules/extend": { 102 | "version": "3.0.2", 103 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 104 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 105 | }, 106 | "node_modules/form-data": { 107 | "version": "2.5.1", 108 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", 109 | "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", 110 | "dependencies": { 111 | "asynckit": "^0.4.0", 112 | "combined-stream": "^1.0.6", 113 | "mime-types": "^2.1.12" 114 | }, 115 | "engines": { 116 | "node": ">= 0.12" 117 | } 118 | }, 119 | "node_modules/formidable": { 120 | "version": "1.2.6", 121 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", 122 | "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==", 123 | "deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau", 124 | "funding": { 125 | "url": "https://ko-fi.com/tunnckoCore/commissions" 126 | } 127 | }, 128 | "node_modules/function-bind": { 129 | "version": "1.1.1", 130 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 131 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 132 | }, 133 | "node_modules/get-intrinsic": { 134 | "version": "1.1.1", 135 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 136 | "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 137 | "dependencies": { 138 | "function-bind": "^1.1.1", 139 | "has": "^1.0.3", 140 | "has-symbols": "^1.0.1" 141 | }, 142 | "funding": { 143 | "url": "https://github.com/sponsors/ljharb" 144 | } 145 | }, 146 | "node_modules/has": { 147 | "version": "1.0.3", 148 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 149 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 150 | "dependencies": { 151 | "function-bind": "^1.1.1" 152 | }, 153 | "engines": { 154 | "node": ">= 0.4.0" 155 | } 156 | }, 157 | "node_modules/has-symbols": { 158 | "version": "1.0.3", 159 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 160 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 161 | "engines": { 162 | "node": ">= 0.4" 163 | }, 164 | "funding": { 165 | "url": "https://github.com/sponsors/ljharb" 166 | } 167 | }, 168 | "node_modules/inherits": { 169 | "version": "2.0.4", 170 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 171 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 172 | }, 173 | "node_modules/isarray": { 174 | "version": "1.0.0", 175 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 176 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 177 | }, 178 | "node_modules/methods": { 179 | "version": "1.1.2", 180 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 181 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", 182 | "engines": { 183 | "node": ">= 0.6" 184 | } 185 | }, 186 | "node_modules/mime": { 187 | "version": "1.6.0", 188 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 189 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 190 | "bin": { 191 | "mime": "cli.js" 192 | }, 193 | "engines": { 194 | "node": ">=4" 195 | } 196 | }, 197 | "node_modules/mime-db": { 198 | "version": "1.52.0", 199 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 200 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 201 | "engines": { 202 | "node": ">= 0.6" 203 | } 204 | }, 205 | "node_modules/mime-types": { 206 | "version": "2.1.35", 207 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 208 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 209 | "dependencies": { 210 | "mime-db": "1.52.0" 211 | }, 212 | "engines": { 213 | "node": ">= 0.6" 214 | } 215 | }, 216 | "node_modules/ms": { 217 | "version": "2.1.3", 218 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 219 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 220 | }, 221 | "node_modules/object-inspect": { 222 | "version": "1.12.0", 223 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", 224 | "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", 225 | "funding": { 226 | "url": "https://github.com/sponsors/ljharb" 227 | } 228 | }, 229 | "node_modules/process-nextick-args": { 230 | "version": "2.0.1", 231 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 232 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 233 | }, 234 | "node_modules/qs": { 235 | "version": "6.10.3", 236 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", 237 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", 238 | "dependencies": { 239 | "side-channel": "^1.0.4" 240 | }, 241 | "engines": { 242 | "node": ">=0.6" 243 | }, 244 | "funding": { 245 | "url": "https://github.com/sponsors/ljharb" 246 | } 247 | }, 248 | "node_modules/readable-stream": { 249 | "version": "2.3.7", 250 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 251 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 252 | "dependencies": { 253 | "core-util-is": "~1.0.0", 254 | "inherits": "~2.0.3", 255 | "isarray": "~1.0.0", 256 | "process-nextick-args": "~2.0.0", 257 | "safe-buffer": "~5.1.1", 258 | "string_decoder": "~1.1.1", 259 | "util-deprecate": "~1.0.1" 260 | } 261 | }, 262 | "node_modules/readable-stream/node_modules/safe-buffer": { 263 | "version": "5.1.2", 264 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 265 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 266 | }, 267 | "node_modules/side-channel": { 268 | "version": "1.0.4", 269 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 270 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 271 | "dependencies": { 272 | "call-bind": "^1.0.0", 273 | "get-intrinsic": "^1.0.2", 274 | "object-inspect": "^1.9.0" 275 | }, 276 | "funding": { 277 | "url": "https://github.com/sponsors/ljharb" 278 | } 279 | }, 280 | "node_modules/string_decoder": { 281 | "version": "1.1.1", 282 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 283 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 284 | "dependencies": { 285 | "safe-buffer": "~5.1.0" 286 | } 287 | }, 288 | "node_modules/string_decoder/node_modules/safe-buffer": { 289 | "version": "5.1.2", 290 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 291 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 292 | }, 293 | "node_modules/superagent": { 294 | "version": "3.8.1", 295 | "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", 296 | "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", 297 | "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 .", 298 | "dependencies": { 299 | "component-emitter": "^1.2.0", 300 | "cookiejar": "^2.1.0", 301 | "debug": "^3.1.0", 302 | "extend": "^3.0.0", 303 | "form-data": "^2.3.1", 304 | "formidable": "^1.1.1", 305 | "methods": "^1.1.1", 306 | "mime": "^1.4.1", 307 | "qs": "^6.5.1", 308 | "readable-stream": "^2.0.5" 309 | }, 310 | "engines": { 311 | "node": ">= 4.0" 312 | } 313 | }, 314 | "node_modules/superagent/node_modules/debug": { 315 | "version": "3.2.7", 316 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 317 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 318 | "dependencies": { 319 | "ms": "^2.1.1" 320 | } 321 | }, 322 | "node_modules/tunnel": { 323 | "version": "0.0.6", 324 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 325 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 326 | "engines": { 327 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 328 | } 329 | }, 330 | "node_modules/util-deprecate": { 331 | "version": "1.0.2", 332 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 333 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 334 | } 335 | }, 336 | "dependencies": { 337 | "@actions/core": { 338 | "version": "1.6.0", 339 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", 340 | "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", 341 | "requires": { 342 | "@actions/http-client": "^1.0.11" 343 | } 344 | }, 345 | "@actions/http-client": { 346 | "version": "1.0.11", 347 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", 348 | "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", 349 | "requires": { 350 | "tunnel": "0.0.6" 351 | } 352 | }, 353 | "@mailchimp/mailchimp_marketing": { 354 | "version": "3.0.74", 355 | "resolved": "https://registry.npmjs.org/@mailchimp/mailchimp_marketing/-/mailchimp_marketing-3.0.74.tgz", 356 | "integrity": "sha512-039iu4GRr7wpXqweBLuS05wvOBtPxSa31cjxgftBYSt7031f0sHEi8Up2DicfbSuQK0AynPDeVyuxrb31Lx+yQ==", 357 | "requires": { 358 | "dotenv": "^8.2.0", 359 | "superagent": "3.8.1" 360 | } 361 | }, 362 | "asynckit": { 363 | "version": "0.4.0", 364 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 365 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 366 | }, 367 | "call-bind": { 368 | "version": "1.0.2", 369 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 370 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 371 | "requires": { 372 | "function-bind": "^1.1.1", 373 | "get-intrinsic": "^1.0.2" 374 | } 375 | }, 376 | "combined-stream": { 377 | "version": "1.0.8", 378 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 379 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 380 | "requires": { 381 | "delayed-stream": "~1.0.0" 382 | } 383 | }, 384 | "component-emitter": { 385 | "version": "1.3.0", 386 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 387 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" 388 | }, 389 | "cookiejar": { 390 | "version": "2.1.3", 391 | "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", 392 | "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" 393 | }, 394 | "core-util-is": { 395 | "version": "1.0.3", 396 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 397 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 398 | }, 399 | "delayed-stream": { 400 | "version": "1.0.0", 401 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 402 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 403 | }, 404 | "dotenv": { 405 | "version": "8.6.0", 406 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", 407 | "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==" 408 | }, 409 | "extend": { 410 | "version": "3.0.2", 411 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 412 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 413 | }, 414 | "form-data": { 415 | "version": "2.5.1", 416 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", 417 | "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", 418 | "requires": { 419 | "asynckit": "^0.4.0", 420 | "combined-stream": "^1.0.6", 421 | "mime-types": "^2.1.12" 422 | } 423 | }, 424 | "formidable": { 425 | "version": "1.2.6", 426 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", 427 | "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==" 428 | }, 429 | "function-bind": { 430 | "version": "1.1.1", 431 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 432 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 433 | }, 434 | "get-intrinsic": { 435 | "version": "1.1.1", 436 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 437 | "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 438 | "requires": { 439 | "function-bind": "^1.1.1", 440 | "has": "^1.0.3", 441 | "has-symbols": "^1.0.1" 442 | } 443 | }, 444 | "has": { 445 | "version": "1.0.3", 446 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 447 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 448 | "requires": { 449 | "function-bind": "^1.1.1" 450 | } 451 | }, 452 | "has-symbols": { 453 | "version": "1.0.3", 454 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 455 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" 456 | }, 457 | "inherits": { 458 | "version": "2.0.4", 459 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 460 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 461 | }, 462 | "isarray": { 463 | "version": "1.0.0", 464 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 465 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 466 | }, 467 | "methods": { 468 | "version": "1.1.2", 469 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 470 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 471 | }, 472 | "mime": { 473 | "version": "1.6.0", 474 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 475 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 476 | }, 477 | "mime-db": { 478 | "version": "1.52.0", 479 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 480 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" 481 | }, 482 | "mime-types": { 483 | "version": "2.1.35", 484 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 485 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 486 | "requires": { 487 | "mime-db": "1.52.0" 488 | } 489 | }, 490 | "ms": { 491 | "version": "2.1.3", 492 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 493 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 494 | }, 495 | "object-inspect": { 496 | "version": "1.12.0", 497 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", 498 | "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" 499 | }, 500 | "process-nextick-args": { 501 | "version": "2.0.1", 502 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 503 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 504 | }, 505 | "qs": { 506 | "version": "6.10.3", 507 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", 508 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", 509 | "requires": { 510 | "side-channel": "^1.0.4" 511 | } 512 | }, 513 | "readable-stream": { 514 | "version": "2.3.7", 515 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 516 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 517 | "requires": { 518 | "core-util-is": "~1.0.0", 519 | "inherits": "~2.0.3", 520 | "isarray": "~1.0.0", 521 | "process-nextick-args": "~2.0.0", 522 | "safe-buffer": "~5.1.1", 523 | "string_decoder": "~1.1.1", 524 | "util-deprecate": "~1.0.1" 525 | }, 526 | "dependencies": { 527 | "safe-buffer": { 528 | "version": "5.1.2", 529 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 530 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 531 | } 532 | } 533 | }, 534 | "side-channel": { 535 | "version": "1.0.4", 536 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 537 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 538 | "requires": { 539 | "call-bind": "^1.0.0", 540 | "get-intrinsic": "^1.0.2", 541 | "object-inspect": "^1.9.0" 542 | } 543 | }, 544 | "string_decoder": { 545 | "version": "1.1.1", 546 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 547 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 548 | "requires": { 549 | "safe-buffer": "~5.1.0" 550 | }, 551 | "dependencies": { 552 | "safe-buffer": { 553 | "version": "5.1.2", 554 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 555 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 556 | } 557 | } 558 | }, 559 | "superagent": { 560 | "version": "3.8.1", 561 | "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", 562 | "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", 563 | "requires": { 564 | "component-emitter": "^1.2.0", 565 | "cookiejar": "^2.1.0", 566 | "debug": "^3.1.0", 567 | "extend": "^3.0.0", 568 | "form-data": "^2.3.1", 569 | "formidable": "^1.1.1", 570 | "methods": "^1.1.1", 571 | "mime": "^1.4.1", 572 | "qs": "^6.5.1", 573 | "readable-stream": "^2.0.5" 574 | }, 575 | "dependencies": { 576 | "debug": { 577 | "version": "3.2.7", 578 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 579 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 580 | "requires": { 581 | "ms": "^2.1.1" 582 | } 583 | } 584 | } 585 | }, 586 | "tunnel": { 587 | "version": "0.0.6", 588 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 589 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" 590 | }, 591 | "util-deprecate": { 592 | "version": "1.0.2", 593 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 594 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 595 | } 596 | } 597 | } --------------------------------------------------------------------------------