@asyncapi/converter 0.9.0 → 0.10.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.
- package/README.md +23 -3
- package/lib/convert.d.ts +3 -0
- package/lib/convert.js +193 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -212
- package/lib/interfaces.d.ts +7 -0
- package/lib/interfaces.js +2 -0
- package/lib/utils.d.ts +21 -0
- package/lib/utils.js +114 -0
- package/package.json +21 -6
- package/.github/workflows/add-good-first-issue-labels.yml +0 -68
- package/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +0 -54
- package/.github/workflows/automerge-for-humans-merging.yml +0 -32
- package/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml +0 -35
- package/.github/workflows/automerge-orphans.yml +0 -63
- package/.github/workflows/automerge.yml +0 -50
- package/.github/workflows/autoupdate.yml +0 -32
- package/.github/workflows/bump.yml +0 -33
- package/.github/workflows/help-command.yml +0 -43
- package/.github/workflows/if-go-pr-testing.yml +0 -68
- package/.github/workflows/if-nodejs-pr-testing.yml +0 -60
- package/.github/workflows/if-nodejs-release.yml +0 -85
- package/.github/workflows/if-nodejs-version-bump.yml +0 -48
- package/.github/workflows/issues-prs-notifications.yml +0 -72
- package/.github/workflows/lint-pr-title.yml +0 -22
- package/.github/workflows/notify-tsc-members-mention.yml +0 -142
- package/.github/workflows/release-announcements.yml +0 -76
- package/.github/workflows/sentiment-analysis.yml +0 -44
- package/.github/workflows/stale-issues-prs.yml +0 -42
- package/.github/workflows/welcome-first-time-contrib.yml +0 -83
- package/CODEOWNERS +0 -8
- package/lib/helpers.js +0 -109
- package/test/index.js +0 -257
- package/test/input/1.0.0/streetlights.yml +0 -120
- package/test/input/1.1.0/streetlights.yml +0 -120
- package/test/input/1.2.0/gitter-streaming.yml +0 -140
- package/test/input/1.2.0/slack-rtm.yml +0 -876
- package/test/input/1.2.0/streetlights.yml +0 -120
- package/test/input/2.0.0/streetlights.json +0 -172
- package/test/input/2.0.0/streetlights.yml +0 -112
- package/test/input/2.0.0-rc1/streetlights.yml +0 -109
- package/test/input/2.0.0-rc2/streetlights.yml +0 -112
- package/test/input/2.1.0/streetlights.yml +0 -112
- package/test/input/2.2.0/streetlights.yml +0 -112
- package/test/output/2.0.0/gitter-streaming.yml +0 -137
- package/test/output/2.0.0/slack-rtm.yml +0 -879
- package/test/output/2.0.0/streetlights.yml +0 -112
- package/test/output/2.0.0-rc1/gitter-streaming.yml +0 -137
- package/test/output/2.0.0-rc1/slack-rtm.yml +0 -879
- package/test/output/2.0.0-rc1/streetlights.yml +0 -109
- package/test/output/2.0.0-rc2/gitter-streaming.yml +0 -137
- package/test/output/2.0.0-rc2/slack-rtm.yml +0 -879
- package/test/output/2.0.0-rc2/streetlights.yml +0 -112
- package/test/output/2.1.0/streetlights.json +0 -172
- package/test/output/2.1.0/streetlights.yml +0 -112
- package/test/output/2.2.0/streetlights.yml +0 -112
- package/test/output/2.3.0/streetlights.yml +0 -112
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
asyncapi: '1.2.0'
|
|
2
|
-
info:
|
|
3
|
-
title: Streetlights API
|
|
4
|
-
version: '1.0.0'
|
|
5
|
-
description: |
|
|
6
|
-
The Smartylighting Streetlights API allows you to remotely manage the city lights.
|
|
7
|
-
|
|
8
|
-
### Check out its awesome features:
|
|
9
|
-
|
|
10
|
-
* Turn a specific streetlight on/off 🌃
|
|
11
|
-
* Dim a specific streetlight 😎
|
|
12
|
-
* Receive real-time information about environmental lighting conditions 📈
|
|
13
|
-
license:
|
|
14
|
-
name: Apache 2.0
|
|
15
|
-
url: https://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
baseTopic: smartylighting.streetlights.1.0
|
|
17
|
-
|
|
18
|
-
servers:
|
|
19
|
-
- url: api.streetlights.smartylighting.com:{port}
|
|
20
|
-
scheme: mqtt
|
|
21
|
-
description: Test broker
|
|
22
|
-
variables:
|
|
23
|
-
port:
|
|
24
|
-
description: Secure connection (TLS) is available through port 8883.
|
|
25
|
-
default: '1883'
|
|
26
|
-
enum:
|
|
27
|
-
- '1883'
|
|
28
|
-
- '8883'
|
|
29
|
-
|
|
30
|
-
security:
|
|
31
|
-
- apiKey: []
|
|
32
|
-
|
|
33
|
-
topics:
|
|
34
|
-
event.{streetlightId}.lighting.measured:
|
|
35
|
-
parameters:
|
|
36
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
37
|
-
publish:
|
|
38
|
-
$ref: '#/components/messages/lightMeasured'
|
|
39
|
-
|
|
40
|
-
action.{streetlightId}.turn.on:
|
|
41
|
-
parameters:
|
|
42
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
43
|
-
subscribe:
|
|
44
|
-
$ref: '#/components/messages/turnOnOff'
|
|
45
|
-
|
|
46
|
-
action.{streetlightId}.turn.off:
|
|
47
|
-
parameters:
|
|
48
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
49
|
-
subscribe:
|
|
50
|
-
$ref: '#/components/messages/turnOnOff'
|
|
51
|
-
|
|
52
|
-
action.{streetlightId}.dim:
|
|
53
|
-
parameters:
|
|
54
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
55
|
-
subscribe:
|
|
56
|
-
$ref: '#/components/messages/dimLight'
|
|
57
|
-
|
|
58
|
-
components:
|
|
59
|
-
messages:
|
|
60
|
-
lightMeasured:
|
|
61
|
-
summary: Inform about environmental lighting conditions for a particular streetlight.
|
|
62
|
-
payload:
|
|
63
|
-
$ref: "#/components/schemas/lightMeasuredPayload"
|
|
64
|
-
turnOnOff:
|
|
65
|
-
summary: Command a particular streetlight to turn the lights on or off.
|
|
66
|
-
payload:
|
|
67
|
-
$ref: "#/components/schemas/turnOnOffPayload"
|
|
68
|
-
dimLight:
|
|
69
|
-
summary: Command a particular streetlight to dim the lights.
|
|
70
|
-
payload:
|
|
71
|
-
$ref: "#/components/schemas/dimLightPayload"
|
|
72
|
-
|
|
73
|
-
schemas:
|
|
74
|
-
lightMeasuredPayload:
|
|
75
|
-
type: object
|
|
76
|
-
properties:
|
|
77
|
-
lumens:
|
|
78
|
-
type: integer
|
|
79
|
-
minimum: 0
|
|
80
|
-
description: Light intensity measured in lumens.
|
|
81
|
-
sentAt:
|
|
82
|
-
$ref: "#/components/schemas/sentAt"
|
|
83
|
-
turnOnOffPayload:
|
|
84
|
-
type: object
|
|
85
|
-
properties:
|
|
86
|
-
command:
|
|
87
|
-
type: string
|
|
88
|
-
enum:
|
|
89
|
-
- on
|
|
90
|
-
- off
|
|
91
|
-
description: Whether to turn on or off the light.
|
|
92
|
-
sentAt:
|
|
93
|
-
$ref: "#/components/schemas/sentAt"
|
|
94
|
-
dimLightPayload:
|
|
95
|
-
type: object
|
|
96
|
-
properties:
|
|
97
|
-
percentage:
|
|
98
|
-
type: integer
|
|
99
|
-
description: Percentage to which the light should be dimmed to.
|
|
100
|
-
minimum: 0
|
|
101
|
-
maximum: 100
|
|
102
|
-
sentAt:
|
|
103
|
-
$ref: "#/components/schemas/sentAt"
|
|
104
|
-
sentAt:
|
|
105
|
-
type: string
|
|
106
|
-
format: date-time
|
|
107
|
-
description: Date and time when the message was sent.
|
|
108
|
-
|
|
109
|
-
securitySchemes:
|
|
110
|
-
apiKey:
|
|
111
|
-
type: apiKey
|
|
112
|
-
in: user
|
|
113
|
-
description: Provide your API key as the user and leave the password empty.
|
|
114
|
-
|
|
115
|
-
parameters:
|
|
116
|
-
streetlightId:
|
|
117
|
-
name: streetlightId
|
|
118
|
-
description: The ID of the streetlight.
|
|
119
|
-
schema:
|
|
120
|
-
type: string
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"asyncapi": "2.0.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.0.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,109 +0,0 @@
|
|
|
1
|
-
asyncapi: 2.0.0-rc1
|
|
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
|
-
- url: 'api.streetlights.smartylighting.com:{port}'
|
|
11
|
-
description: Test broker
|
|
12
|
-
variables:
|
|
13
|
-
port:
|
|
14
|
-
description: Secure connection (TLS) is available through port 8883.
|
|
15
|
-
default: '1883'
|
|
16
|
-
enum:
|
|
17
|
-
- '1883'
|
|
18
|
-
- '8883'
|
|
19
|
-
protocol: mqtt
|
|
20
|
-
security:
|
|
21
|
-
- apiKey: []
|
|
22
|
-
components:
|
|
23
|
-
messages:
|
|
24
|
-
lightMeasured:
|
|
25
|
-
summary: >-
|
|
26
|
-
Inform about environmental lighting conditions for a particular
|
|
27
|
-
streetlight.
|
|
28
|
-
payload:
|
|
29
|
-
$ref: '#/components/schemas/lightMeasuredPayload'
|
|
30
|
-
turnOnOff:
|
|
31
|
-
summary: Command a particular streetlight to turn the lights on or off.
|
|
32
|
-
payload:
|
|
33
|
-
$ref: '#/components/schemas/turnOnOffPayload'
|
|
34
|
-
dimLight:
|
|
35
|
-
summary: Command a particular streetlight to dim the lights.
|
|
36
|
-
payload:
|
|
37
|
-
$ref: '#/components/schemas/dimLightPayload'
|
|
38
|
-
schemas:
|
|
39
|
-
lightMeasuredPayload:
|
|
40
|
-
type: object
|
|
41
|
-
properties:
|
|
42
|
-
lumens:
|
|
43
|
-
type: integer
|
|
44
|
-
minimum: 0
|
|
45
|
-
description: Light intensity measured in lumens.
|
|
46
|
-
sentAt:
|
|
47
|
-
$ref: '#/components/schemas/sentAt'
|
|
48
|
-
turnOnOffPayload:
|
|
49
|
-
type: object
|
|
50
|
-
properties:
|
|
51
|
-
command:
|
|
52
|
-
type: string
|
|
53
|
-
enum:
|
|
54
|
-
- 'on'
|
|
55
|
-
- 'off'
|
|
56
|
-
description: Whether to turn on or off the light.
|
|
57
|
-
sentAt:
|
|
58
|
-
$ref: '#/components/schemas/sentAt'
|
|
59
|
-
dimLightPayload:
|
|
60
|
-
type: object
|
|
61
|
-
properties:
|
|
62
|
-
percentage:
|
|
63
|
-
type: integer
|
|
64
|
-
description: Percentage to which the light should be dimmed to.
|
|
65
|
-
minimum: 0
|
|
66
|
-
maximum: 100
|
|
67
|
-
sentAt:
|
|
68
|
-
$ref: '#/components/schemas/sentAt'
|
|
69
|
-
sentAt:
|
|
70
|
-
type: string
|
|
71
|
-
format: date-time
|
|
72
|
-
description: Date and time when the message was sent.
|
|
73
|
-
securitySchemes:
|
|
74
|
-
apiKey:
|
|
75
|
-
type: apiKey
|
|
76
|
-
in: user
|
|
77
|
-
description: Provide your API key as the user and leave the password empty.
|
|
78
|
-
parameters:
|
|
79
|
-
streetlightId:
|
|
80
|
-
name: streetlightId
|
|
81
|
-
description: The ID of the streetlight.
|
|
82
|
-
schema:
|
|
83
|
-
type: string
|
|
84
|
-
id: 'urn:streetlights.api'
|
|
85
|
-
channels:
|
|
86
|
-
'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
|
|
87
|
-
parameters:
|
|
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
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
95
|
-
subscribe:
|
|
96
|
-
message:
|
|
97
|
-
$ref: '#/components/messages/turnOnOff'
|
|
98
|
-
'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off':
|
|
99
|
-
parameters:
|
|
100
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
101
|
-
subscribe:
|
|
102
|
-
message:
|
|
103
|
-
$ref: '#/components/messages/turnOnOff'
|
|
104
|
-
'smartylighting/streetlights/1/0/action/{streetlightId}/dim':
|
|
105
|
-
parameters:
|
|
106
|
-
- $ref: '#/components/parameters/streetlightId'
|
|
107
|
-
subscribe:
|
|
108
|
-
message:
|
|
109
|
-
$ref: '#/components/messages/dimLight'
|
|
@@ -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'
|