@asyncapi/converter 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +96 -21
  2. package/lib/convert.d.ts +3 -0
  3. package/lib/convert.js +192 -0
  4. package/lib/index.d.ts +2 -0
  5. package/lib/index.js +5 -212
  6. package/lib/interfaces.d.ts +6 -0
  7. package/lib/interfaces.js +2 -0
  8. package/lib/utils.d.ts +21 -0
  9. package/lib/utils.js +114 -0
  10. package/package.json +24 -12
  11. package/.github/workflows/add-good-first-issue-labels.yml +0 -68
  12. package/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +0 -54
  13. package/.github/workflows/automerge-for-humans-merging.yml +0 -32
  14. package/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml +0 -35
  15. package/.github/workflows/automerge-orphans.yml +0 -63
  16. package/.github/workflows/automerge.yml +0 -50
  17. package/.github/workflows/autoupdate.yml +0 -32
  18. package/.github/workflows/bump.yml +0 -33
  19. package/.github/workflows/help-command.yml +0 -43
  20. package/.github/workflows/if-go-pr-testing.yml +0 -68
  21. package/.github/workflows/if-nodejs-pr-testing.yml +0 -60
  22. package/.github/workflows/if-nodejs-release.yml +0 -85
  23. package/.github/workflows/if-nodejs-version-bump.yml +0 -48
  24. package/.github/workflows/issues-prs-notifications.yml +0 -72
  25. package/.github/workflows/lint-pr-title.yml +0 -22
  26. package/.github/workflows/notify-tsc-members-mention.yml +0 -142
  27. package/.github/workflows/release-announcements.yml +0 -76
  28. package/.github/workflows/sentiment-analysis.yml +0 -44
  29. package/.github/workflows/stale-issues-prs.yml +0 -42
  30. package/.github/workflows/welcome-first-time-contrib.yml +0 -83
  31. package/CODEOWNERS +0 -8
  32. package/cli.js +0 -66
  33. package/lib/helpers.js +0 -109
  34. package/test/index.js +0 -257
  35. package/test/input/1.0.0/streetlights.yml +0 -120
  36. package/test/input/1.1.0/streetlights.yml +0 -120
  37. package/test/input/1.2.0/gitter-streaming.yml +0 -140
  38. package/test/input/1.2.0/slack-rtm.yml +0 -876
  39. package/test/input/1.2.0/streetlights.yml +0 -120
  40. package/test/input/2.0.0/streetlights.json +0 -172
  41. package/test/input/2.0.0/streetlights.yml +0 -112
  42. package/test/input/2.0.0-rc1/streetlights.yml +0 -109
  43. package/test/input/2.0.0-rc2/streetlights.yml +0 -112
  44. package/test/input/2.1.0/streetlights.yml +0 -112
  45. package/test/input/2.2.0/streetlights.yml +0 -112
  46. package/test/output/2.0.0/gitter-streaming.yml +0 -137
  47. package/test/output/2.0.0/slack-rtm.yml +0 -879
  48. package/test/output/2.0.0/streetlights.yml +0 -112
  49. package/test/output/2.0.0-rc1/gitter-streaming.yml +0 -137
  50. package/test/output/2.0.0-rc1/slack-rtm.yml +0 -879
  51. package/test/output/2.0.0-rc1/streetlights.yml +0 -109
  52. package/test/output/2.0.0-rc2/gitter-streaming.yml +0 -137
  53. package/test/output/2.0.0-rc2/slack-rtm.yml +0 -879
  54. package/test/output/2.0.0-rc2/streetlights.yml +0 -112
  55. package/test/output/2.1.0/streetlights.json +0 -172
  56. package/test/output/2.1.0/streetlights.yml +0 -112
  57. package/test/output/2.2.0/streetlights.yml +0 -112
  58. package/test/output/2.3.0/streetlights.yml +0 -112
@@ -1,112 +0,0 @@
1
- asyncapi: 2.0.0-rc2
2
- info:
3
- title: Streetlights API
4
- version: 1.0.0
5
- description: "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off \U0001F303\n* Dim a specific streetlight \U0001F60E\n* Receive real-time information about environmental lighting conditions \U0001F4C8\n"
6
- license:
7
- name: Apache 2.0
8
- url: 'https://www.apache.org/licenses/LICENSE-2.0'
9
- servers:
10
- default:
11
- url: 'api.streetlights.smartylighting.com:{port}'
12
- description: Test broker
13
- variables:
14
- port:
15
- description: Secure connection (TLS) is available through port 8883.
16
- default: '1883'
17
- enum:
18
- - '1883'
19
- - '8883'
20
- protocol: mqtt
21
- security:
22
- - apiKey: []
23
- components:
24
- messages:
25
- lightMeasured:
26
- summary: >-
27
- Inform about environmental lighting conditions for a particular
28
- streetlight.
29
- payload:
30
- $ref: '#/components/schemas/lightMeasuredPayload'
31
- turnOnOff:
32
- summary: Command a particular streetlight to turn the lights on or off.
33
- payload:
34
- $ref: '#/components/schemas/turnOnOffPayload'
35
- dimLight:
36
- summary: Command a particular streetlight to dim the lights.
37
- payload:
38
- $ref: '#/components/schemas/dimLightPayload'
39
- schemas:
40
- lightMeasuredPayload:
41
- type: object
42
- properties:
43
- lumens:
44
- type: integer
45
- minimum: 0
46
- description: Light intensity measured in lumens.
47
- sentAt:
48
- $ref: '#/components/schemas/sentAt'
49
- turnOnOffPayload:
50
- type: object
51
- properties:
52
- command:
53
- type: string
54
- enum:
55
- - 'on'
56
- - 'off'
57
- description: Whether to turn on or off the light.
58
- sentAt:
59
- $ref: '#/components/schemas/sentAt'
60
- dimLightPayload:
61
- type: object
62
- properties:
63
- percentage:
64
- type: integer
65
- description: Percentage to which the light should be dimmed to.
66
- minimum: 0
67
- maximum: 100
68
- sentAt:
69
- $ref: '#/components/schemas/sentAt'
70
- sentAt:
71
- type: string
72
- format: date-time
73
- description: Date and time when the message was sent.
74
- securitySchemes:
75
- apiKey:
76
- type: apiKey
77
- in: user
78
- description: Provide your API key as the user and leave the password empty.
79
- parameters:
80
- streetlightId:
81
- description: The ID of the streetlight.
82
- schema:
83
- type: string
84
- channels:
85
- 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
86
- parameters:
87
- streetlightId:
88
- $ref: '#/components/parameters/streetlightId'
89
- publish:
90
- message:
91
- $ref: '#/components/messages/lightMeasured'
92
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on':
93
- parameters:
94
- streetlightId:
95
- $ref: '#/components/parameters/streetlightId'
96
- subscribe:
97
- message:
98
- $ref: '#/components/messages/turnOnOff'
99
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off':
100
- parameters:
101
- streetlightId:
102
- $ref: '#/components/parameters/streetlightId'
103
- subscribe:
104
- message:
105
- $ref: '#/components/messages/turnOnOff'
106
- 'smartylighting/streetlights/1/0/action/{streetlightId}/dim':
107
- parameters:
108
- streetlightId:
109
- $ref: '#/components/parameters/streetlightId'
110
- subscribe:
111
- message:
112
- $ref: '#/components/messages/dimLight'
@@ -1,172 +0,0 @@
1
- {
2
- "asyncapi": "2.1.0",
3
- "info": {
4
- "title": "Streetlights API",
5
- "version": "1.0.0",
6
- "description": "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off 🌃\n* Dim a specific streetlight 😎\n* Receive real-time information about environmental lighting conditions 📈\n",
7
- "license": {
8
- "name": "Apache 2.0",
9
- "url": "https://www.apache.org/licenses/LICENSE-2.0"
10
- }
11
- },
12
- "servers": {
13
- "default": {
14
- "url": "api.streetlights.smartylighting.com:{port}",
15
- "description": "Test broker",
16
- "variables": {
17
- "port": {
18
- "description": "Secure connection (TLS) is available through port 8883.",
19
- "default": "1883",
20
- "enum": [
21
- "1883",
22
- "8883"
23
- ]
24
- }
25
- },
26
- "protocol": "mqtt",
27
- "security": [
28
- {
29
- "apiKey": []
30
- }
31
- ]
32
- }
33
- },
34
- "components": {
35
- "messages": {
36
- "lightMeasured": {
37
- "summary": "Inform about environmental lighting conditions for a particular streetlight.",
38
- "payload": {
39
- "$ref": "#/components/schemas/lightMeasuredPayload"
40
- }
41
- },
42
- "turnOnOff": {
43
- "summary": "Command a particular streetlight to turn the lights on or off.",
44
- "payload": {
45
- "$ref": "#/components/schemas/turnOnOffPayload"
46
- }
47
- },
48
- "dimLight": {
49
- "summary": "Command a particular streetlight to dim the lights.",
50
- "payload": {
51
- "$ref": "#/components/schemas/dimLightPayload"
52
- }
53
- }
54
- },
55
- "schemas": {
56
- "lightMeasuredPayload": {
57
- "type": "object",
58
- "properties": {
59
- "lumens": {
60
- "type": "integer",
61
- "minimum": 0,
62
- "description": "Light intensity measured in lumens."
63
- },
64
- "sentAt": {
65
- "$ref": "#/components/schemas/sentAt"
66
- }
67
- }
68
- },
69
- "turnOnOffPayload": {
70
- "type": "object",
71
- "properties": {
72
- "command": {
73
- "type": "string",
74
- "enum": [
75
- "on",
76
- "off"
77
- ],
78
- "description": "Whether to turn on or off the light."
79
- },
80
- "sentAt": {
81
- "$ref": "#/components/schemas/sentAt"
82
- }
83
- }
84
- },
85
- "dimLightPayload": {
86
- "type": "object",
87
- "properties": {
88
- "percentage": {
89
- "type": "integer",
90
- "description": "Percentage to which the light should be dimmed to.",
91
- "minimum": 0,
92
- "maximum": 100
93
- },
94
- "sentAt": {
95
- "$ref": "#/components/schemas/sentAt"
96
- }
97
- }
98
- },
99
- "sentAt": {
100
- "type": "string",
101
- "format": "date-time",
102
- "description": "Date and time when the message was sent."
103
- }
104
- },
105
- "securitySchemes": {
106
- "apiKey": {
107
- "type": "apiKey",
108
- "in": "user",
109
- "description": "Provide your API key as the user and leave the password empty."
110
- }
111
- },
112
- "parameters": {
113
- "streetlightId": {
114
- "name": "streetlightId",
115
- "description": "The ID of the streetlight.",
116
- "schema": {
117
- "type": "string"
118
- }
119
- }
120
- }
121
- },
122
- "channels": {
123
- "smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured": {
124
- "parameters": {
125
- "streetlightId": {
126
- "$ref": "#/components/parameters/streetlightId"
127
- }
128
- },
129
- "publish": {
130
- "message": {
131
- "$ref": "#/components/messages/lightMeasured"
132
- }
133
- }
134
- },
135
- "smartylighting/streetlights/1/0/action/{streetlightId}/turn/on": {
136
- "parameters": {
137
- "streetlightId": {
138
- "$ref": "#/components/parameters/streetlightId"
139
- }
140
- },
141
- "subscribe": {
142
- "message": {
143
- "$ref": "#/components/messages/turnOnOff"
144
- }
145
- }
146
- },
147
- "smartylighting/streetlights/1/0/action/{streetlightId}/turn/off": {
148
- "parameters": {
149
- "streetlightId": {
150
- "$ref": "#/components/parameters/streetlightId"
151
- }
152
- },
153
- "subscribe": {
154
- "message": {
155
- "$ref": "#/components/messages/turnOnOff"
156
- }
157
- }
158
- },
159
- "smartylighting/streetlights/1/0/action/{streetlightId}/dim": {
160
- "parameters": {
161
- "streetlightId": {
162
- "$ref": "#/components/parameters/streetlightId"
163
- }
164
- },
165
- "subscribe": {
166
- "message": {
167
- "$ref": "#/components/messages/dimLight"
168
- }
169
- }
170
- }
171
- }
172
- }
@@ -1,112 +0,0 @@
1
- asyncapi: 2.1.0
2
- info:
3
- title: Streetlights API
4
- version: 1.0.0
5
- description: "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off \U0001F303\n* Dim a specific streetlight \U0001F60E\n* Receive real-time information about environmental lighting conditions \U0001F4C8\n"
6
- license:
7
- name: Apache 2.0
8
- url: 'https://www.apache.org/licenses/LICENSE-2.0'
9
- servers:
10
- default:
11
- url: 'api.streetlights.smartylighting.com:{port}'
12
- description: Test broker
13
- variables:
14
- port:
15
- description: Secure connection (TLS) is available through port 8883.
16
- default: '1883'
17
- enum:
18
- - '1883'
19
- - '8883'
20
- protocol: mqtt
21
- security:
22
- - apiKey: []
23
- components:
24
- messages:
25
- lightMeasured:
26
- summary: >-
27
- Inform about environmental lighting conditions for a particular
28
- streetlight.
29
- payload:
30
- $ref: '#/components/schemas/lightMeasuredPayload'
31
- turnOnOff:
32
- summary: Command a particular streetlight to turn the lights on or off.
33
- payload:
34
- $ref: '#/components/schemas/turnOnOffPayload'
35
- dimLight:
36
- summary: Command a particular streetlight to dim the lights.
37
- payload:
38
- $ref: '#/components/schemas/dimLightPayload'
39
- schemas:
40
- lightMeasuredPayload:
41
- type: object
42
- properties:
43
- lumens:
44
- type: integer
45
- minimum: 0
46
- description: Light intensity measured in lumens.
47
- sentAt:
48
- $ref: '#/components/schemas/sentAt'
49
- turnOnOffPayload:
50
- type: object
51
- properties:
52
- command:
53
- type: string
54
- enum:
55
- - 'on'
56
- - 'off'
57
- description: Whether to turn on or off the light.
58
- sentAt:
59
- $ref: '#/components/schemas/sentAt'
60
- dimLightPayload:
61
- type: object
62
- properties:
63
- percentage:
64
- type: integer
65
- description: Percentage to which the light should be dimmed to.
66
- minimum: 0
67
- maximum: 100
68
- sentAt:
69
- $ref: '#/components/schemas/sentAt'
70
- sentAt:
71
- type: string
72
- format: date-time
73
- description: Date and time when the message was sent.
74
- securitySchemes:
75
- apiKey:
76
- type: apiKey
77
- in: user
78
- description: Provide your API key as the user and leave the password empty.
79
- parameters:
80
- streetlightId:
81
- description: The ID of the streetlight.
82
- schema:
83
- type: string
84
- channels:
85
- 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
86
- parameters:
87
- streetlightId:
88
- $ref: '#/components/parameters/streetlightId'
89
- publish:
90
- message:
91
- $ref: '#/components/messages/lightMeasured'
92
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on':
93
- parameters:
94
- streetlightId:
95
- $ref: '#/components/parameters/streetlightId'
96
- subscribe:
97
- message:
98
- $ref: '#/components/messages/turnOnOff'
99
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off':
100
- parameters:
101
- streetlightId:
102
- $ref: '#/components/parameters/streetlightId'
103
- subscribe:
104
- message:
105
- $ref: '#/components/messages/turnOnOff'
106
- 'smartylighting/streetlights/1/0/action/{streetlightId}/dim':
107
- parameters:
108
- streetlightId:
109
- $ref: '#/components/parameters/streetlightId'
110
- subscribe:
111
- message:
112
- $ref: '#/components/messages/dimLight'
@@ -1,112 +0,0 @@
1
- asyncapi: 2.2.0
2
- info:
3
- title: Streetlights API
4
- version: 1.0.0
5
- description: "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off \U0001F303\n* Dim a specific streetlight \U0001F60E\n* Receive real-time information about environmental lighting conditions \U0001F4C8\n"
6
- license:
7
- name: Apache 2.0
8
- url: 'https://www.apache.org/licenses/LICENSE-2.0'
9
- servers:
10
- default:
11
- url: 'api.streetlights.smartylighting.com:{port}'
12
- description: Test broker
13
- variables:
14
- port:
15
- description: Secure connection (TLS) is available through port 8883.
16
- default: '1883'
17
- enum:
18
- - '1883'
19
- - '8883'
20
- protocol: mqtt
21
- security:
22
- - apiKey: []
23
- components:
24
- messages:
25
- lightMeasured:
26
- summary: >-
27
- Inform about environmental lighting conditions for a particular
28
- streetlight.
29
- payload:
30
- $ref: '#/components/schemas/lightMeasuredPayload'
31
- turnOnOff:
32
- summary: Command a particular streetlight to turn the lights on or off.
33
- payload:
34
- $ref: '#/components/schemas/turnOnOffPayload'
35
- dimLight:
36
- summary: Command a particular streetlight to dim the lights.
37
- payload:
38
- $ref: '#/components/schemas/dimLightPayload'
39
- schemas:
40
- lightMeasuredPayload:
41
- type: object
42
- properties:
43
- lumens:
44
- type: integer
45
- minimum: 0
46
- description: Light intensity measured in lumens.
47
- sentAt:
48
- $ref: '#/components/schemas/sentAt'
49
- turnOnOffPayload:
50
- type: object
51
- properties:
52
- command:
53
- type: string
54
- enum:
55
- - 'on'
56
- - 'off'
57
- description: Whether to turn on or off the light.
58
- sentAt:
59
- $ref: '#/components/schemas/sentAt'
60
- dimLightPayload:
61
- type: object
62
- properties:
63
- percentage:
64
- type: integer
65
- description: Percentage to which the light should be dimmed to.
66
- minimum: 0
67
- maximum: 100
68
- sentAt:
69
- $ref: '#/components/schemas/sentAt'
70
- sentAt:
71
- type: string
72
- format: date-time
73
- description: Date and time when the message was sent.
74
- securitySchemes:
75
- apiKey:
76
- type: apiKey
77
- in: user
78
- description: Provide your API key as the user and leave the password empty.
79
- parameters:
80
- streetlightId:
81
- description: The ID of the streetlight.
82
- schema:
83
- type: string
84
- channels:
85
- 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
86
- parameters:
87
- streetlightId:
88
- $ref: '#/components/parameters/streetlightId'
89
- publish:
90
- message:
91
- $ref: '#/components/messages/lightMeasured'
92
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on':
93
- parameters:
94
- streetlightId:
95
- $ref: '#/components/parameters/streetlightId'
96
- subscribe:
97
- message:
98
- $ref: '#/components/messages/turnOnOff'
99
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off':
100
- parameters:
101
- streetlightId:
102
- $ref: '#/components/parameters/streetlightId'
103
- subscribe:
104
- message:
105
- $ref: '#/components/messages/turnOnOff'
106
- 'smartylighting/streetlights/1/0/action/{streetlightId}/dim':
107
- parameters:
108
- streetlightId:
109
- $ref: '#/components/parameters/streetlightId'
110
- subscribe:
111
- message:
112
- $ref: '#/components/messages/dimLight'
@@ -1,112 +0,0 @@
1
- asyncapi: 2.3.0
2
- info:
3
- title: Streetlights API
4
- version: 1.0.0
5
- description: "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off \U0001F303\n* Dim a specific streetlight \U0001F60E\n* Receive real-time information about environmental lighting conditions \U0001F4C8\n"
6
- license:
7
- name: Apache 2.0
8
- url: 'https://www.apache.org/licenses/LICENSE-2.0'
9
- servers:
10
- default:
11
- url: 'api.streetlights.smartylighting.com:{port}'
12
- description: Test broker
13
- variables:
14
- port:
15
- description: Secure connection (TLS) is available through port 8883.
16
- default: '1883'
17
- enum:
18
- - '1883'
19
- - '8883'
20
- protocol: mqtt
21
- security:
22
- - apiKey: []
23
- components:
24
- messages:
25
- lightMeasured:
26
- summary: >-
27
- Inform about environmental lighting conditions for a particular
28
- streetlight.
29
- payload:
30
- $ref: '#/components/schemas/lightMeasuredPayload'
31
- turnOnOff:
32
- summary: Command a particular streetlight to turn the lights on or off.
33
- payload:
34
- $ref: '#/components/schemas/turnOnOffPayload'
35
- dimLight:
36
- summary: Command a particular streetlight to dim the lights.
37
- payload:
38
- $ref: '#/components/schemas/dimLightPayload'
39
- schemas:
40
- lightMeasuredPayload:
41
- type: object
42
- properties:
43
- lumens:
44
- type: integer
45
- minimum: 0
46
- description: Light intensity measured in lumens.
47
- sentAt:
48
- $ref: '#/components/schemas/sentAt'
49
- turnOnOffPayload:
50
- type: object
51
- properties:
52
- command:
53
- type: string
54
- enum:
55
- - 'on'
56
- - 'off'
57
- description: Whether to turn on or off the light.
58
- sentAt:
59
- $ref: '#/components/schemas/sentAt'
60
- dimLightPayload:
61
- type: object
62
- properties:
63
- percentage:
64
- type: integer
65
- description: Percentage to which the light should be dimmed to.
66
- minimum: 0
67
- maximum: 100
68
- sentAt:
69
- $ref: '#/components/schemas/sentAt'
70
- sentAt:
71
- type: string
72
- format: date-time
73
- description: Date and time when the message was sent.
74
- securitySchemes:
75
- apiKey:
76
- type: apiKey
77
- in: user
78
- description: Provide your API key as the user and leave the password empty.
79
- parameters:
80
- streetlightId:
81
- description: The ID of the streetlight.
82
- schema:
83
- type: string
84
- channels:
85
- 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
86
- parameters:
87
- streetlightId:
88
- $ref: '#/components/parameters/streetlightId'
89
- publish:
90
- message:
91
- $ref: '#/components/messages/lightMeasured'
92
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on':
93
- parameters:
94
- streetlightId:
95
- $ref: '#/components/parameters/streetlightId'
96
- subscribe:
97
- message:
98
- $ref: '#/components/messages/turnOnOff'
99
- 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off':
100
- parameters:
101
- streetlightId:
102
- $ref: '#/components/parameters/streetlightId'
103
- subscribe:
104
- message:
105
- $ref: '#/components/messages/turnOnOff'
106
- 'smartylighting/streetlights/1/0/action/{streetlightId}/dim':
107
- parameters:
108
- streetlightId:
109
- $ref: '#/components/parameters/streetlightId'
110
- subscribe:
111
- message:
112
- $ref: '#/components/messages/dimLight'