Skip to content

Commit 84eb7c2

Browse files
chore: updating project metadata (#669)
* chore: updating project metadata Signed-off-by: Pawel Psztyc <[email protected]> * test: add tests for APIC-571 and APIC-559 * test: add test for APIC-570 * test: add test for APIC-562 * chore(models): add anyOf async api * test: add test for APIC-561 * chore(models): add streetlights.yaml * test: add test for APIC-560 * chore(deps): regenerate package-lock.json Co-authored-by: Francisco Di Giandomenico <[email protected]>
1 parent 7160f1d commit 84eb7c2

File tree

19 files changed

+5666
-5324
lines changed

19 files changed

+5666
-5324
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"cSpell.words": [
3+
"Apic",
4+
"RAML's",
5+
"Tyit",
6+
"apiserverchanged",
7+
"tryit"
8+
]
9+
}

demo/apis.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
"models/async-api/async-api.yaml": "ASYNC 2.0",
1717
"models/APIC-553/APIC-553.raml": "RAML 1.0",
1818
"models/APIC-554/APIC-554.raml": "RAML 1.0",
19-
"models/APIC-557/APIC-557.yaml": "OAS 3.0"
19+
"models/APIC-557/APIC-557.yaml": "OAS 3.0",
20+
"models/APIC-538/APIC-538.raml": "RAML 1.0",
21+
"models/anyOf/anyOf.yaml": "ASYNC 2.0",
22+
"models/streetlights/streetlights.yaml": "ASYNC 2.0"
2023
}

demo/element/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class ApicApplication extends DemoBase {
2525
['APIC-553', 'APIC-553'],
2626
['APIC-557', 'APIC-557'],
2727
['APIC-558', 'APIC-558'],
28+
['anyOf', 'AnyOf'],
29+
['streetlights', 'Streetlights'],
2830
];
2931

3032
this.toggleConsoleMenu = this.toggleConsoleMenu.bind(this);

demo/models/APIC-538/APIC-538.raml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#%RAML 1.0
2+
title: APIC-538
3+
version: v1
4+
baseUri: http://domain.com/
5+
6+
securitySchemes:
7+
oauth_2_0:
8+
type: OAuth 2.0
9+
settings:
10+
accessTokenUri: http://api.domain.com/oauth2/token
11+
authorizationUri: http://api.domain.com/oauth2/auth
12+
authorizationGrants: ["authorization_code"]
13+
14+
/test:
15+
securedBy: [oauth_2_0]
16+
get:
17+
responses:
18+
200:
19+
body:
20+
application/json:

demo/models/anyOf/anyOf.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
asyncapi: '2.0.0'
2+
info:
3+
title: AnyOf example
4+
version: '1.0.0'
5+
6+
channels:
7+
test:
8+
publish:
9+
message:
10+
$ref: '#/components/messages/testMessages'
11+
12+
components:
13+
messages:
14+
testMessages:
15+
payload:
16+
anyOf: # anyOf in payload schema
17+
- $ref: "#/components/schemas/objectWithKey"
18+
- $ref: "#/components/schemas/objectWithKey2"
19+
testMessage1:
20+
payload:
21+
$ref: "#/components/schemas/objectWithKey2"
22+
23+
schemas:
24+
objectWithKey:
25+
type: object
26+
properties:
27+
key:
28+
type: string
29+
additionalProperties: false
30+
objectWithKey2:
31+
type: object
32+
properties:
33+
key2:
34+
type: number
35+
prop:
36+
type: boolean
37+

demo/models/async-api/async-api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ channels:
1717
message:
1818
$ref: '#/components/messages/hello-msg'
1919
goodbye:
20-
publish:
20+
subscribe:
2121
message:
2222
$ref: '#/components/messages/goodbye-msg'
2323
components:
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
asyncapi: 2.0.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+
17+
servers:
18+
production:
19+
url: api.streetlights.smartylighting.com:{port}
20+
protocol: 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+
security:
30+
- apiKey: []
31+
- supportedOauthFlows:
32+
- streetlights:on
33+
- streetlights:off
34+
- streetlights:dim
35+
- openIdConnectWellKnown: []
36+
37+
defaultContentType: application/json
38+
39+
channels:
40+
smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured:
41+
description: The topic on which measured values may be produced and consumed.
42+
parameters:
43+
streetlightId:
44+
$ref: '#/components/parameters/streetlightId'
45+
subscribe:
46+
summary: Receive information about environmental lighting conditions of a particular streetlight.
47+
operationId: receiveLightMeasurement
48+
traits:
49+
- $ref: '#/components/operationTraits/kafka'
50+
message:
51+
$ref: '#/components/messages/lightMeasured'
52+
53+
smartylighting/streetlights/1/0/action/{streetlightId}/turn/on:
54+
parameters:
55+
streetlightId:
56+
$ref: '#/components/parameters/streetlightId'
57+
publish:
58+
operationId: turnOn
59+
traits:
60+
- $ref: '#/components/operationTraits/kafka'
61+
message:
62+
$ref: '#/components/messages/turnOnOff'
63+
64+
smartylighting/streetlights/1/0/action/{streetlightId}/turn/off:
65+
parameters:
66+
streetlightId:
67+
$ref: '#/components/parameters/streetlightId'
68+
publish:
69+
operationId: turnOff
70+
traits:
71+
- $ref: '#/components/operationTraits/kafka'
72+
message:
73+
$ref: '#/components/messages/turnOnOff'
74+
75+
smartylighting/streetlights/1/0/action/{streetlightId}/dim:
76+
parameters:
77+
streetlightId:
78+
$ref: '#/components/parameters/streetlightId'
79+
publish:
80+
operationId: dimLight
81+
traits:
82+
- $ref: '#/components/operationTraits/kafka'
83+
message:
84+
$ref: '#/components/messages/dimLight'
85+
86+
components:
87+
messages:
88+
lightMeasured:
89+
name: lightMeasured
90+
title: Light measured
91+
summary: Inform about environmental lighting conditions for a particular streetlight.
92+
contentType: application/json
93+
traits:
94+
- $ref: '#/components/messageTraits/commonHeaders'
95+
payload:
96+
$ref: "#/components/schemas/lightMeasuredPayload"
97+
turnOnOff:
98+
name: turnOnOff
99+
title: Turn on/off
100+
summary: Command a particular streetlight to turn the lights on or off.
101+
traits:
102+
- $ref: '#/components/messageTraits/commonHeaders'
103+
payload:
104+
$ref: "#/components/schemas/turnOnOffPayload"
105+
dimLight:
106+
name: dimLight
107+
title: Dim light
108+
summary: Command a particular streetlight to dim the lights.
109+
traits:
110+
- $ref: '#/components/messageTraits/commonHeaders'
111+
payload:
112+
$ref: "#/components/schemas/dimLightPayload"
113+
114+
schemas:
115+
lightMeasuredPayload:
116+
type: object
117+
properties:
118+
lumens:
119+
type: integer
120+
minimum: 0
121+
description: Light intensity measured in lumens.
122+
sentAt:
123+
$ref: "#/components/schemas/sentAt"
124+
turnOnOffPayload:
125+
type: object
126+
properties:
127+
command:
128+
type: string
129+
enum:
130+
- on
131+
- off
132+
description: Whether to turn on or off the light.
133+
sentAt:
134+
$ref: "#/components/schemas/sentAt"
135+
dimLightPayload:
136+
type: object
137+
properties:
138+
percentage:
139+
type: integer
140+
description: Percentage to which the light should be dimmed to.
141+
minimum: 0
142+
maximum: 100
143+
sentAt:
144+
$ref: "#/components/schemas/sentAt"
145+
sentAt:
146+
type: string
147+
format: date-time
148+
description: Date and time when the message was sent.
149+
150+
securitySchemes:
151+
apiKey:
152+
type: apiKey
153+
in: user
154+
description: Provide your API key as the user and leave the password empty.
155+
supportedOauthFlows:
156+
type: oauth2
157+
description: Flows to support OAuth 2.0
158+
flows:
159+
implicit:
160+
authorizationUrl: 'https://authserver.example/auth'
161+
scopes:
162+
'streetlights:on': Ability to switch lights on
163+
'streetlights:off': Ability to switch lights off
164+
'streetlights:dim': Ability to dim the lights
165+
password:
166+
tokenUrl: 'https://authserver.example/token'
167+
scopes:
168+
'streetlights:on': Ability to switch lights on
169+
'streetlights:off': Ability to switch lights off
170+
'streetlights:dim': Ability to dim the lights
171+
clientCredentials:
172+
tokenUrl: 'https://authserver.example/token'
173+
scopes:
174+
'streetlights:on': Ability to switch lights on
175+
'streetlights:off': Ability to switch lights off
176+
'streetlights:dim': Ability to dim the lights
177+
authorizationCode:
178+
authorizationUrl: 'https://authserver.example/auth'
179+
tokenUrl: 'https://authserver.example/token'
180+
refreshUrl: 'https://authserver.example/refresh'
181+
scopes:
182+
'streetlights:on': Ability to switch lights on
183+
'streetlights:off': Ability to switch lights off
184+
'streetlights:dim': Ability to dim the lights
185+
openIdConnectWellKnown:
186+
type: openIdConnect
187+
openIdConnectUrl: 'https://authserver.example/.well-known'
188+
189+
parameters:
190+
streetlightId:
191+
description: The ID of the streetlight.
192+
schema:
193+
type: string
194+
195+
messageTraits:
196+
commonHeaders:
197+
headers:
198+
type: object
199+
properties:
200+
my-app-header:
201+
type: integer
202+
minimum: 0
203+
maximum: 100
204+
205+
operationTraits:
206+
kafka:
207+
bindings:
208+
kafka:
209+
clientId: my-app-id

demo/themed/anypoint.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ class ApicApplication extends DemoBase {
1616
['google-drive-api', 'Google Drive API'],
1717
['httpbin', 'HTTPbin API'],
1818
['data-type-fragment', 'RAML data type fragment'],
19-
['demo-api', 'Demo API']
19+
['demo-api', 'Demo API'],
20+
['APIC-538', 'APIC-538'],
2021
];
2122
}
2223

2324
demoTemplate() {
2425
return html`<api-console-app
25-
app
26-
redirecturi="https://auth.advancedrestclient.com/oauth-popup.html"
27-
oauth2clientid="821776164331-rserncqpdsq32lmbf5cfeolgcoujb6fm.apps.googleusercontent.com"
26+
redirectUri="https://auth.advancedrestclient.com/oauth-popup.html"
27+
oauth2ClientId="821776164331-rserncqpdsq32lmbf5cfeolgcoujb6fm.apps.googleusercontent.com"
2828
compatibility>
2929
<anypoint-icon-button
3030
slot="toolbar"

0 commit comments

Comments
 (0)