-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update bundler to support spec v3 (#140)
- Loading branch information
Showing
13 changed files
with
9,793 additions
and
19,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Account Service | ||
version: 1.0.0 | ||
description: This service is in charge of processing user signupsA | ||
channels: | ||
userSignedup: | ||
address: user/signedup | ||
messages: | ||
userSignedUpMessage: | ||
$ref: '#/components/messages/UserSignedUp' | ||
test: | ||
address: /test | ||
messages: | ||
testMessage: | ||
$ref: '#/components/messages/TestMessage' | ||
operations: | ||
UserSignedUp: | ||
action: send | ||
channel: | ||
$ref: '#/channels/userSignedup' | ||
messages: | ||
- $ref: '#/components/messages/UserSignedUp' | ||
TestOpp: | ||
action: send | ||
channel: | ||
$ref: '#/channels/test' | ||
messages: | ||
- $ref: '#/components/messages/TestMessage' | ||
components: | ||
messages: | ||
TestMessage: | ||
payload: | ||
type: string | ||
UserSignedUp: | ||
payload: | ||
type: object | ||
properties: | ||
displayName: | ||
type: string | ||
description: Name of the user | ||
email: | ||
type: string | ||
format: email | ||
description: Email of the user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
asyncapi: 3.0.0 | ||
id: 'urn:zbos-mqtt-api' | ||
info: | ||
title: Audio | ||
version: 2.6.3 | ||
description: API for communication with ZBOS by Zora Robotics. | ||
contact: | ||
email: [email protected] | ||
defaultContentType: application/json | ||
channels: | ||
zbos/audio/player/start: | ||
address: zbos/audio/player/start | ||
messages: | ||
publish.message: | ||
payload: | ||
type: object | ||
properties: | ||
requestId: | ||
type: string | ||
url: | ||
type: string | ||
loop: | ||
type: boolean | ||
name: AudioOptions | ||
examples: | ||
- payload: | ||
requestId: '1' | ||
url: Url | ||
loop: true | ||
zbos/audio/player/stop: | ||
address: zbos/audio/player/stop | ||
messages: | ||
publish.message: | ||
$ref: '#/components/messages/emptyMessage' | ||
operations: | ||
zbos/audio/player/start.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/zbos~1audio~1player~1start' | ||
summary: Play media | ||
description: | | ||
Play specific media from audio options | ||
tags: | ||
- name: Audio | ||
description: All audio related topics. | ||
messages: | ||
- $ref: '#/channels/zbos~1audio~1player~1start/messages/publish.message' | ||
zbos/audio/player/stop.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/zbos~1audio~1player~1stop' | ||
summary: Stop media | ||
description: '' | ||
tags: | ||
- name: Audio | ||
description: All audio related topics. | ||
messages: | ||
- $ref: '#/channels/zbos~1audio~1player~1stop/messages/publish.message' | ||
components: | ||
messages: | ||
emptyMessage: | ||
payload: | ||
type: object | ||
name: EmptyMessage | ||
summary: Empty message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const bundle = require('@asyncapi/bundler') | ||
const {readFileSync, writeFileSync} = require('fs') | ||
|
||
async function main() { | ||
await singleFile() | ||
await multiFile() | ||
} | ||
|
||
|
||
async function singleFile(){ | ||
const document = await bundle([readFileSync('./main.yaml', 'utf-8')] ) | ||
|
||
writeFileSync('asyncapi.yaml', document.yml()) | ||
|
||
} | ||
|
||
async function multiFile(){ | ||
const document = await bundle(['./camera.yml', './audio.yml'].map( f => readFileSync(f, 'utf-8'))) | ||
writeFileSync('spec.yaml', document.yml()) | ||
} | ||
|
||
|
||
main().catch(e => console.error(e)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
asyncapi: 3.0.0 | ||
id: 'urn:zbos-mqtt-api' | ||
info: | ||
title: Camera | ||
version: 2.6.3 | ||
description: API for communication with ZBOS by Zora Robotics. | ||
contact: | ||
email: [email protected] | ||
defaultContentType: application/json | ||
channels: | ||
zbos/camera/picture/event: | ||
address: zbos/camera/picture/event | ||
messages: | ||
subscribe.message: | ||
payload: | ||
type: string | ||
name: String | ||
zbos/camera/picture/get: | ||
address: zbos/camera/picture/get | ||
messages: | ||
publish.message: | ||
$ref: '#/components/messages/keyMessage' | ||
operations: | ||
zbos/camera/picture/event.subscribe: | ||
action: send | ||
channel: | ||
$ref: '#/channels/zbos~1camera~1picture~1event' | ||
summary: 'event: Get picture' | ||
description: '' | ||
tags: | ||
- name: Camera | ||
description: All camera related topics. | ||
messages: | ||
- $ref: '#/channels/zbos~1camera~1picture~1event/messages/subscribe.message' | ||
zbos/camera/picture/get.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/zbos~1camera~1picture~1get' | ||
summary: Get picture | ||
description: '' | ||
tags: | ||
- name: Camera | ||
description: All camera related topics. | ||
messages: | ||
- $ref: '#/channels/zbos~1camera~1picture~1get/messages/publish.message' | ||
components: | ||
messages: | ||
keyMessage: | ||
payload: | ||
type: object | ||
properties: | ||
key: | ||
type: string | ||
description: Required random key | ||
name: KeyResult | ||
summary: Random key | ||
examples: | ||
- payload: | ||
key: ABCxyz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Account Service | ||
version: 1.0.0 | ||
description: This service is in charge of processing user signupsA | ||
channels: | ||
userSignedup: | ||
address: 'user/signedup' | ||
messages: | ||
userSignedUpMessage: | ||
$ref: './messages.yaml#/messages/UserSignedUp' | ||
test: | ||
address: '/test' | ||
messages: | ||
testMessage: | ||
$ref: '#/components/messages/TestMessage' | ||
operations: | ||
UserSignedUp: | ||
action: send | ||
channel: | ||
$ref: '#/channels/userSignedup' | ||
messages: | ||
- $ref: './messages.yaml#/messages/UserSignedUp' | ||
TestOpp: | ||
action: send | ||
channel: | ||
$ref: '#/channels/test' | ||
messages: | ||
- $ref: '#/components/messages/TestMessage' | ||
components: | ||
messages: | ||
TestMessage: | ||
payload: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
messages: | ||
UserSignedUp: | ||
payload: | ||
type: object | ||
properties: | ||
displayName: | ||
type: string | ||
description: Name of the user | ||
email: | ||
type: string | ||
format: email | ||
description: Email of the user | ||
UserLoggedIn: | ||
payload: | ||
type: object | ||
properties: | ||
id: string |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "v3", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@asyncapi/bundler": "../../" | ||
} | ||
} |
Oops, something went wrong.