@asyncapi-actions-test/trusted-publishing-test_asyncapi-cli 4.1.3
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/LICENSE +201 -0
- package/README.md +117 -0
- package/assets/create-template/templates/default/asyncapi.yaml +34 -0
- package/assets/create-template/templates/default/package-lock.json +4062 -0
- package/assets/create-template/templates/default/package.json +10 -0
- package/assets/create-template/templates/default/readme.md +4 -0
- package/assets/create-template/templates/default/template/index.js +11 -0
- package/assets/examples/adeo-kafka-request-reply-asyncapi.yml +298 -0
- package/assets/examples/anyof-asyncapi.yml +36 -0
- package/assets/examples/application-headers-asyncapi.yml +86 -0
- package/assets/examples/correlation-id-asyncapi.yml +180 -0
- package/assets/examples/default-example.json +51 -0
- package/assets/examples/default-example.yaml +31 -0
- package/assets/examples/examples.json +82 -0
- package/assets/examples/gitter-streaming-asyncapi.yml +178 -0
- package/assets/examples/kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml +388 -0
- package/assets/examples/kraken-websocket-request-reply-multiple-channels-asyncapi.yml +394 -0
- package/assets/examples/mercure-asyncapi.yml +58 -0
- package/assets/examples/not-asyncapi.yml +29 -0
- package/assets/examples/oneof-asyncapi.yml +57 -0
- package/assets/examples/operation-security-asyncapi.yml +117 -0
- package/assets/examples/rpc-client-asyncapi.yml +72 -0
- package/assets/examples/rpc-server-asyncapi.yml +69 -0
- package/assets/examples/simple-asyncapi.yml +31 -0
- package/assets/examples/slack-rtm-asyncapi.yml +982 -0
- package/assets/examples/streetlights-kafka-asyncapi.yml +199 -0
- package/assets/examples/streetlights-mqtt-asyncapi.yml +253 -0
- package/assets/examples/streetlights-operation-security-asyncapi.yml +240 -0
- package/assets/examples/tutorial.yml +41 -0
- package/assets/examples/websocket-gemini-asyncapi.yml +301 -0
- package/assets/logo.png +0 -0
- package/assets/server-api.png +0 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +12 -0
- package/bin/run.cmd +3 -0
- package/bin/run_bin +13 -0
- package/bin/run_bin.cmd +3 -0
- package/lib/apps/api/app.d.ts +15 -0
- package/lib/apps/api/app.js +91 -0
- package/lib/apps/api/configs/development.json +16 -0
- package/lib/apps/api/configs/production.json +16 -0
- package/lib/apps/api/configs/test.json +16 -0
- package/lib/apps/api/constants.d.ts +1 -0
- package/lib/apps/api/constants.js +4 -0
- package/lib/apps/api/controllers/bundle.controller.d.ts +7 -0
- package/lib/apps/api/controllers/bundle.controller.js +44 -0
- package/lib/apps/api/controllers/convert.controller.d.ts +11 -0
- package/lib/apps/api/controllers/convert.controller.js +69 -0
- package/lib/apps/api/controllers/diff.controller.d.ts +7 -0
- package/lib/apps/api/controllers/diff.controller.js +42 -0
- package/lib/apps/api/controllers/docs.controller.d.ts +6 -0
- package/lib/apps/api/controllers/docs.controller.js +24 -0
- package/lib/apps/api/controllers/generate.controller.d.ts +22 -0
- package/lib/apps/api/controllers/generate.controller.js +174 -0
- package/lib/apps/api/controllers/help.controller.d.ts +6 -0
- package/lib/apps/api/controllers/help.controller.js +101 -0
- package/lib/apps/api/controllers/parse.controller.d.ts +10 -0
- package/lib/apps/api/controllers/parse.controller.js +35 -0
- package/lib/apps/api/controllers/validate.controller.d.ts +10 -0
- package/lib/apps/api/controllers/validate.controller.js +50 -0
- package/lib/apps/api/controllers/version.controller.d.ts +8 -0
- package/lib/apps/api/controllers/version.controller.js +69 -0
- package/lib/apps/api/exceptions/problem.exception.d.ts +14 -0
- package/lib/apps/api/exceptions/problem.exception.js +10 -0
- package/lib/apps/api/index.d.ts +10 -0
- package/lib/apps/api/index.js +23 -0
- package/lib/apps/api/middlewares/logger.middleware.d.ts +2 -0
- package/lib/apps/api/middlewares/logger.middleware.js +12 -0
- package/lib/apps/api/middlewares/problem.middleware.d.ts +6 -0
- package/lib/apps/api/middlewares/problem.middleware.js +27 -0
- package/lib/apps/api/middlewares/validation.middleware.d.ts +12 -0
- package/lib/apps/api/middlewares/validation.middleware.js +245 -0
- package/lib/apps/api/server.d.ts +3 -0
- package/lib/apps/api/server.js +19 -0
- package/lib/apps/cli/commands/bundle.d.ts +15 -0
- package/lib/apps/cli/commands/bundle.js +75 -0
- package/lib/apps/cli/commands/config/analytics.d.ts +11 -0
- package/lib/apps/cli/commands/config/analytics.js +61 -0
- package/lib/apps/cli/commands/config/auth/add.d.ts +13 -0
- package/lib/apps/cli/commands/config/auth/add.js +68 -0
- package/lib/apps/cli/commands/config/context/add.d.ts +13 -0
- package/lib/apps/cli/commands/config/context/add.js +46 -0
- package/lib/apps/cli/commands/config/context/current.d.ts +8 -0
- package/lib/apps/cli/commands/config/context/current.js +37 -0
- package/lib/apps/cli/commands/config/context/edit.d.ts +12 -0
- package/lib/apps/cli/commands/config/context/edit.js +44 -0
- package/lib/apps/cli/commands/config/context/index.d.ts +5 -0
- package/lib/apps/cli/commands/config/context/index.js +16 -0
- package/lib/apps/cli/commands/config/context/init.d.ts +12 -0
- package/lib/apps/cli/commands/config/context/init.js +31 -0
- package/lib/apps/cli/commands/config/context/list.d.ts +8 -0
- package/lib/apps/cli/commands/config/context/list.js +36 -0
- package/lib/apps/cli/commands/config/context/remove.d.ts +11 -0
- package/lib/apps/cli/commands/config/context/remove.js +39 -0
- package/lib/apps/cli/commands/config/context/use.d.ts +11 -0
- package/lib/apps/cli/commands/config/context/use.js +40 -0
- package/lib/apps/cli/commands/config/index.d.ts +5 -0
- package/lib/apps/cli/commands/config/index.js +16 -0
- package/lib/apps/cli/commands/config/versions.d.ts +8 -0
- package/lib/apps/cli/commands/config/versions.js +56 -0
- package/lib/apps/cli/commands/convert.d.ts +21 -0
- package/lib/apps/cli/commands/convert.js +85 -0
- package/lib/apps/cli/commands/diff.d.ts +36 -0
- package/lib/apps/cli/commands/diff.js +335 -0
- package/lib/apps/cli/commands/format.d.ts +18 -0
- package/lib/apps/cli/commands/format.js +97 -0
- package/lib/apps/cli/commands/generate/client.d.ts +30 -0
- package/lib/apps/cli/commands/generate/client.js +94 -0
- package/lib/apps/cli/commands/generate/fromTemplate.d.ts +29 -0
- package/lib/apps/cli/commands/generate/fromTemplate.js +91 -0
- package/lib/apps/cli/commands/generate/index.d.ts +5 -0
- package/lib/apps/cli/commands/generate/index.js +15 -0
- package/lib/apps/cli/commands/generate/models.d.ts +16 -0
- package/lib/apps/cli/commands/generate/models.js +166 -0
- package/lib/apps/cli/commands/new/file.d.ts +16 -0
- package/lib/apps/cli/commands/new/file.js +180 -0
- package/lib/apps/cli/commands/new/index.d.ts +5 -0
- package/lib/apps/cli/commands/new/index.js +15 -0
- package/lib/apps/cli/commands/new/template.d.ts +18 -0
- package/lib/apps/cli/commands/new/template.js +102 -0
- package/lib/apps/cli/commands/optimize.d.ts +41 -0
- package/lib/apps/cli/commands/optimize.js +289 -0
- package/lib/apps/cli/commands/pretty.d.ts +12 -0
- package/lib/apps/cli/commands/pretty.js +70 -0
- package/lib/apps/cli/commands/start/api.d.ts +11 -0
- package/lib/apps/cli/commands/start/api.js +23 -0
- package/lib/apps/cli/commands/start/index.d.ts +5 -0
- package/lib/apps/cli/commands/start/index.js +15 -0
- package/lib/apps/cli/commands/start/preview.d.ts +17 -0
- package/lib/apps/cli/commands/start/preview.js +41 -0
- package/lib/apps/cli/commands/start/studio.d.ts +16 -0
- package/lib/apps/cli/commands/start/studio.js +94 -0
- package/lib/apps/cli/commands/validate.d.ts +23 -0
- package/lib/apps/cli/commands/validate.js +95 -0
- package/lib/apps/cli/internal/args/generate.args.d.ts +3 -0
- package/lib/apps/cli/internal/args/generate.args.js +10 -0
- package/lib/apps/cli/internal/base/BaseGeneratorCommand.d.ts +42 -0
- package/lib/apps/cli/internal/base/BaseGeneratorCommand.js +119 -0
- package/lib/apps/cli/internal/base.d.ts +20 -0
- package/lib/apps/cli/internal/base.js +173 -0
- package/lib/apps/cli/internal/flags/bundle.flags.d.ts +7 -0
- package/lib/apps/cli/internal/flags/bundle.flags.js +26 -0
- package/lib/apps/cli/internal/flags/config/analytics.flags.d.ts +6 -0
- package/lib/apps/cli/internal/flags/config/analytics.flags.js +24 -0
- package/lib/apps/cli/internal/flags/config/context.flags.d.ts +4 -0
- package/lib/apps/cli/internal/flags/config/context.flags.js +16 -0
- package/lib/apps/cli/internal/flags/convert.flags.d.ts +7 -0
- package/lib/apps/cli/internal/flags/convert.flags.js +32 -0
- package/lib/apps/cli/internal/flags/diff.flags.d.ts +13 -0
- package/lib/apps/cli/internal/flags/diff.flags.js +29 -0
- package/lib/apps/cli/internal/flags/format.flags.d.ts +6 -0
- package/lib/apps/cli/internal/flags/format.flags.js +22 -0
- package/lib/apps/cli/internal/flags/generate/clients.flags.d.ts +16 -0
- package/lib/apps/cli/internal/flags/generate/clients.flags.js +8 -0
- package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.d.ts +16 -0
- package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.js +8 -0
- package/lib/apps/cli/internal/flags/generate/models.flags.d.ts +1 -0
- package/lib/apps/cli/internal/flags/generate/models.flags.js +14 -0
- package/lib/apps/cli/internal/flags/generate/sharedFlags.d.ts +16 -0
- package/lib/apps/cli/internal/flags/generate/sharedFlags.js +57 -0
- package/lib/apps/cli/internal/flags/global.flags.d.ts +4 -0
- package/lib/apps/cli/internal/flags/global.flags.js +18 -0
- package/lib/apps/cli/internal/flags/new/file.flags.d.ts +8 -0
- package/lib/apps/cli/internal/flags/new/file.flags.js +20 -0
- package/lib/apps/cli/internal/flags/new/template.flags.d.ts +7 -0
- package/lib/apps/cli/internal/flags/new/template.flags.js +28 -0
- package/lib/apps/cli/internal/flags/optimize.flags.d.ts +21 -0
- package/lib/apps/cli/internal/flags/optimize.flags.js +51 -0
- package/lib/apps/cli/internal/flags/parser.flags.d.ts +10 -0
- package/lib/apps/cli/internal/flags/parser.flags.js +28 -0
- package/lib/apps/cli/internal/flags/pretty.flags.d.ts +3 -0
- package/lib/apps/cli/internal/flags/pretty.flags.js +13 -0
- package/lib/apps/cli/internal/flags/proxy.flags.d.ts +4 -0
- package/lib/apps/cli/internal/flags/proxy.flags.js +17 -0
- package/lib/apps/cli/internal/flags/start/api.flags.d.ts +5 -0
- package/lib/apps/cli/internal/flags/start/api.flags.js +20 -0
- package/lib/apps/cli/internal/flags/start/preview.flags.d.ts +9 -0
- package/lib/apps/cli/internal/flags/start/preview.flags.js +32 -0
- package/lib/apps/cli/internal/flags/start/studio.flags.d.ts +7 -0
- package/lib/apps/cli/internal/flags/start/studio.flags.js +25 -0
- package/lib/apps/cli/internal/flags/validate.flags.d.ts +11 -0
- package/lib/apps/cli/internal/flags/validate.flags.js +22 -0
- package/lib/apps/cli/internal/globals.d.ts +10 -0
- package/lib/apps/cli/internal/globals.js +46 -0
- package/lib/apps/cli/internal/hooks/command_not_found/myhook.d.ts +4 -0
- package/lib/apps/cli/internal/hooks/command_not_found/myhook.js +85 -0
- package/lib/domains/models/Context.d.ts +21 -0
- package/lib/domains/models/Context.js +321 -0
- package/lib/domains/models/Preview.d.ts +2 -0
- package/lib/domains/models/Preview.js +227 -0
- package/lib/domains/models/SpecificationFile.d.ts +40 -0
- package/lib/domains/models/SpecificationFile.js +295 -0
- package/lib/domains/models/Studio.d.ts +2 -0
- package/lib/domains/models/Studio.js +182 -0
- package/lib/domains/models/generate/ClientLanguages.d.ts +12 -0
- package/lib/domains/models/generate/ClientLanguages.js +17 -0
- package/lib/domains/models/generate/Flags.d.ts +9 -0
- package/lib/domains/models/generate/Flags.js +2 -0
- package/lib/domains/services/archiver.service.d.ts +17 -0
- package/lib/domains/services/archiver.service.js +53 -0
- package/lib/domains/services/base.service.d.ts +6 -0
- package/lib/domains/services/base.service.js +26 -0
- package/lib/domains/services/config.service.d.ts +42 -0
- package/lib/domains/services/config.service.js +95 -0
- package/lib/domains/services/convert.service.d.ts +12 -0
- package/lib/domains/services/convert.service.js +65 -0
- package/lib/domains/services/generator.service.d.ts +15 -0
- package/lib/domains/services/generator.service.js +75 -0
- package/lib/domains/services/validation.service.d.ts +54 -0
- package/lib/domains/services/validation.service.js +375 -0
- package/lib/errors/context-error.d.ts +26 -0
- package/lib/errors/context-error.js +71 -0
- package/lib/errors/diff-error.d.ts +9 -0
- package/lib/errors/diff-error.js +27 -0
- package/lib/errors/generator-error.d.ts +3 -0
- package/lib/errors/generator-error.js +11 -0
- package/lib/errors/specification-file.d.ts +18 -0
- package/lib/errors/specification-file.js +65 -0
- package/lib/errors/validation-error.d.ts +11 -0
- package/lib/errors/validation-error.js +55 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +11 -0
- package/lib/interfaces/index.d.ts +87 -0
- package/lib/interfaces/index.js +7 -0
- package/lib/utils/ajv.d.ts +2 -0
- package/lib/utils/ajv.js +18 -0
- package/lib/utils/app-openapi.d.ts +4 -0
- package/lib/utils/app-openapi.js +28 -0
- package/lib/utils/generate/flags.d.ts +2 -0
- package/lib/utils/generate/flags.js +14 -0
- package/lib/utils/generate/mapBaseUrl.d.ts +6 -0
- package/lib/utils/generate/mapBaseUrl.js +34 -0
- package/lib/utils/generate/parseParams.d.ts +3 -0
- package/lib/utils/generate/parseParams.js +58 -0
- package/lib/utils/generate/prompts.d.ts +4 -0
- package/lib/utils/generate/prompts.js +77 -0
- package/lib/utils/generate/registry.d.ts +2 -0
- package/lib/utils/generate/registry.js +30 -0
- package/lib/utils/generate/watcher.d.ts +51 -0
- package/lib/utils/generate/watcher.js +230 -0
- package/lib/utils/logger.d.ts +6 -0
- package/lib/utils/logger.js +33 -0
- package/lib/utils/retrieve-language.d.ts +1 -0
- package/lib/utils/retrieve-language.js +9 -0
- package/lib/utils/scoreCalculator.d.ts +2 -0
- package/lib/utils/scoreCalculator.js +22 -0
- package/lib/utils/temp-dir.d.ts +2 -0
- package/lib/utils/temp-dir.js +26 -0
- package/oclif.manifest.json +2137 -0
- package/openapi.yaml +713 -0
- package/package.json +203 -0
- package/scripts/enableAutoComplete.js +160 -0
- package/scripts/fetch-asyncapi-example.js +126 -0
- package/scripts/generateTypesForGenerateCommand.js +40 -0
- package/scripts/releasePackagesRename.js +88 -0
- package/scripts/updateUsageDocs.js +73 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
asyncapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Streetlights Kafka 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
|
+
defaultContentType: application/json
|
|
10
|
+
servers:
|
|
11
|
+
scram-connections:
|
|
12
|
+
host: 'test.mykafkacluster.org:18092'
|
|
13
|
+
protocol: kafka-secure
|
|
14
|
+
description: Test broker secured with scramSha256
|
|
15
|
+
security:
|
|
16
|
+
- $ref: '#/components/securitySchemes/saslScram'
|
|
17
|
+
tags:
|
|
18
|
+
- name: 'env:test-scram'
|
|
19
|
+
description: >-
|
|
20
|
+
This environment is meant for running internal tests through
|
|
21
|
+
scramSha256
|
|
22
|
+
- name: 'kind:remote'
|
|
23
|
+
description: This server is a remote server. Not exposed by the application
|
|
24
|
+
- name: 'visibility:private'
|
|
25
|
+
description: This resource is private and only available to certain users
|
|
26
|
+
mtls-connections:
|
|
27
|
+
host: 'test.mykafkacluster.org:28092'
|
|
28
|
+
protocol: kafka-secure
|
|
29
|
+
description: Test broker secured with X509
|
|
30
|
+
security:
|
|
31
|
+
- $ref: '#/components/securitySchemes/certs'
|
|
32
|
+
tags:
|
|
33
|
+
- name: 'env:test-mtls'
|
|
34
|
+
description: This environment is meant for running internal tests through mtls
|
|
35
|
+
- name: 'kind:remote'
|
|
36
|
+
description: This server is a remote server. Not exposed by the application
|
|
37
|
+
- name: 'visibility:private'
|
|
38
|
+
description: This resource is private and only available to certain users
|
|
39
|
+
channels:
|
|
40
|
+
lightingMeasured:
|
|
41
|
+
address: 'smartylighting.streetlights.1.0.event.{streetlightId}.lighting.measured'
|
|
42
|
+
messages:
|
|
43
|
+
lightMeasured:
|
|
44
|
+
$ref: '#/components/messages/lightMeasured'
|
|
45
|
+
description: The topic on which measured values may be produced and consumed.
|
|
46
|
+
parameters:
|
|
47
|
+
streetlightId:
|
|
48
|
+
$ref: '#/components/parameters/streetlightId'
|
|
49
|
+
lightTurnOn:
|
|
50
|
+
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.turn.on'
|
|
51
|
+
messages:
|
|
52
|
+
turnOn:
|
|
53
|
+
$ref: '#/components/messages/turnOnOff'
|
|
54
|
+
parameters:
|
|
55
|
+
streetlightId:
|
|
56
|
+
$ref: '#/components/parameters/streetlightId'
|
|
57
|
+
lightTurnOff:
|
|
58
|
+
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.turn.off'
|
|
59
|
+
messages:
|
|
60
|
+
turnOff:
|
|
61
|
+
$ref: '#/components/messages/turnOnOff'
|
|
62
|
+
parameters:
|
|
63
|
+
streetlightId:
|
|
64
|
+
$ref: '#/components/parameters/streetlightId'
|
|
65
|
+
lightsDim:
|
|
66
|
+
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.dim'
|
|
67
|
+
messages:
|
|
68
|
+
dimLight:
|
|
69
|
+
$ref: '#/components/messages/dimLight'
|
|
70
|
+
parameters:
|
|
71
|
+
streetlightId:
|
|
72
|
+
$ref: '#/components/parameters/streetlightId'
|
|
73
|
+
operations:
|
|
74
|
+
receiveLightMeasurement:
|
|
75
|
+
action: receive
|
|
76
|
+
channel:
|
|
77
|
+
$ref: '#/channels/lightingMeasured'
|
|
78
|
+
summary: >-
|
|
79
|
+
Inform about environmental lighting conditions of a particular
|
|
80
|
+
streetlight.
|
|
81
|
+
traits:
|
|
82
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
83
|
+
messages:
|
|
84
|
+
- $ref: '#/channels/lightingMeasured/messages/lightMeasured'
|
|
85
|
+
turnOn:
|
|
86
|
+
action: send
|
|
87
|
+
channel:
|
|
88
|
+
$ref: '#/channels/lightTurnOn'
|
|
89
|
+
traits:
|
|
90
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
91
|
+
messages:
|
|
92
|
+
- $ref: '#/channels/lightTurnOn/messages/turnOn'
|
|
93
|
+
turnOff:
|
|
94
|
+
action: send
|
|
95
|
+
channel:
|
|
96
|
+
$ref: '#/channels/lightTurnOff'
|
|
97
|
+
traits:
|
|
98
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
99
|
+
messages:
|
|
100
|
+
- $ref: '#/channels/lightTurnOff/messages/turnOff'
|
|
101
|
+
dimLight:
|
|
102
|
+
action: send
|
|
103
|
+
channel:
|
|
104
|
+
$ref: '#/channels/lightsDim'
|
|
105
|
+
traits:
|
|
106
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
107
|
+
messages:
|
|
108
|
+
- $ref: '#/channels/lightsDim/messages/dimLight'
|
|
109
|
+
components:
|
|
110
|
+
messages:
|
|
111
|
+
lightMeasured:
|
|
112
|
+
name: lightMeasured
|
|
113
|
+
title: Light measured
|
|
114
|
+
summary: >-
|
|
115
|
+
Inform about environmental lighting conditions of a particular
|
|
116
|
+
streetlight.
|
|
117
|
+
contentType: application/json
|
|
118
|
+
traits:
|
|
119
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
120
|
+
payload:
|
|
121
|
+
$ref: '#/components/schemas/lightMeasuredPayload'
|
|
122
|
+
turnOnOff:
|
|
123
|
+
name: turnOnOff
|
|
124
|
+
title: Turn on/off
|
|
125
|
+
summary: Command a particular streetlight to turn the lights on or off.
|
|
126
|
+
traits:
|
|
127
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
128
|
+
payload:
|
|
129
|
+
$ref: '#/components/schemas/turnOnOffPayload'
|
|
130
|
+
dimLight:
|
|
131
|
+
name: dimLight
|
|
132
|
+
title: Dim light
|
|
133
|
+
summary: Command a particular streetlight to dim the lights.
|
|
134
|
+
traits:
|
|
135
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
136
|
+
payload:
|
|
137
|
+
$ref: '#/components/schemas/dimLightPayload'
|
|
138
|
+
schemas:
|
|
139
|
+
lightMeasuredPayload:
|
|
140
|
+
type: object
|
|
141
|
+
properties:
|
|
142
|
+
lumens:
|
|
143
|
+
type: integer
|
|
144
|
+
minimum: 0
|
|
145
|
+
description: Light intensity measured in lumens.
|
|
146
|
+
sentAt:
|
|
147
|
+
$ref: '#/components/schemas/sentAt'
|
|
148
|
+
turnOnOffPayload:
|
|
149
|
+
type: object
|
|
150
|
+
properties:
|
|
151
|
+
command:
|
|
152
|
+
type: string
|
|
153
|
+
enum:
|
|
154
|
+
- 'on'
|
|
155
|
+
- 'off'
|
|
156
|
+
description: Whether to turn on or off the light.
|
|
157
|
+
sentAt:
|
|
158
|
+
$ref: '#/components/schemas/sentAt'
|
|
159
|
+
dimLightPayload:
|
|
160
|
+
type: object
|
|
161
|
+
properties:
|
|
162
|
+
percentage:
|
|
163
|
+
type: integer
|
|
164
|
+
description: Percentage to which the light should be dimmed to.
|
|
165
|
+
minimum: 0
|
|
166
|
+
maximum: 100
|
|
167
|
+
sentAt:
|
|
168
|
+
$ref: '#/components/schemas/sentAt'
|
|
169
|
+
sentAt:
|
|
170
|
+
type: string
|
|
171
|
+
format: date-time
|
|
172
|
+
description: Date and time when the message was sent.
|
|
173
|
+
securitySchemes:
|
|
174
|
+
saslScram:
|
|
175
|
+
type: scramSha256
|
|
176
|
+
description: Provide your username and password for SASL/SCRAM authentication
|
|
177
|
+
certs:
|
|
178
|
+
type: X509
|
|
179
|
+
description: Download the certificate files from service provider
|
|
180
|
+
parameters:
|
|
181
|
+
streetlightId:
|
|
182
|
+
description: The ID of the streetlight.
|
|
183
|
+
messageTraits:
|
|
184
|
+
commonHeaders:
|
|
185
|
+
headers:
|
|
186
|
+
type: object
|
|
187
|
+
properties:
|
|
188
|
+
my-app-header:
|
|
189
|
+
type: integer
|
|
190
|
+
minimum: 0
|
|
191
|
+
maximum: 100
|
|
192
|
+
operationTraits:
|
|
193
|
+
kafka:
|
|
194
|
+
bindings:
|
|
195
|
+
kafka:
|
|
196
|
+
clientId:
|
|
197
|
+
type: string
|
|
198
|
+
enum:
|
|
199
|
+
- my-app-id
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
asyncapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Streetlights MQTT 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
|
+
defaultContentType: application/json
|
|
10
|
+
servers:
|
|
11
|
+
production:
|
|
12
|
+
host: 'test.mosquitto.org:{port}'
|
|
13
|
+
protocol: mqtt
|
|
14
|
+
description: Test broker
|
|
15
|
+
variables:
|
|
16
|
+
port:
|
|
17
|
+
description: Secure connection (TLS) is available through port 8883.
|
|
18
|
+
default: '1883'
|
|
19
|
+
enum:
|
|
20
|
+
- '1883'
|
|
21
|
+
- '8883'
|
|
22
|
+
security:
|
|
23
|
+
- $ref: '#/components/securitySchemes/apiKey'
|
|
24
|
+
- type: oauth2
|
|
25
|
+
description: Flows to support OAuth 2.0
|
|
26
|
+
flows:
|
|
27
|
+
implicit:
|
|
28
|
+
authorizationUrl: 'https://authserver.example/auth'
|
|
29
|
+
availableScopes:
|
|
30
|
+
'streetlights:on': Ability to switch lights on
|
|
31
|
+
'streetlights:off': Ability to switch lights off
|
|
32
|
+
'streetlights:dim': Ability to dim the lights
|
|
33
|
+
password:
|
|
34
|
+
tokenUrl: 'https://authserver.example/token'
|
|
35
|
+
availableScopes:
|
|
36
|
+
'streetlights:on': Ability to switch lights on
|
|
37
|
+
'streetlights:off': Ability to switch lights off
|
|
38
|
+
'streetlights:dim': Ability to dim the lights
|
|
39
|
+
clientCredentials:
|
|
40
|
+
tokenUrl: 'https://authserver.example/token'
|
|
41
|
+
availableScopes:
|
|
42
|
+
'streetlights:on': Ability to switch lights on
|
|
43
|
+
'streetlights:off': Ability to switch lights off
|
|
44
|
+
'streetlights:dim': Ability to dim the lights
|
|
45
|
+
authorizationCode:
|
|
46
|
+
authorizationUrl: 'https://authserver.example/auth'
|
|
47
|
+
tokenUrl: 'https://authserver.example/token'
|
|
48
|
+
refreshUrl: 'https://authserver.example/refresh'
|
|
49
|
+
availableScopes:
|
|
50
|
+
'streetlights:on': Ability to switch lights on
|
|
51
|
+
'streetlights:off': Ability to switch lights off
|
|
52
|
+
'streetlights:dim': Ability to dim the lights
|
|
53
|
+
scopes:
|
|
54
|
+
- 'streetlights:on'
|
|
55
|
+
- 'streetlights:off'
|
|
56
|
+
- 'streetlights:dim'
|
|
57
|
+
- $ref: '#/components/securitySchemes/openIdConnectWellKnown'
|
|
58
|
+
tags:
|
|
59
|
+
- name: 'env:production'
|
|
60
|
+
description: This environment is meant for production use case
|
|
61
|
+
- name: 'kind:remote'
|
|
62
|
+
description: This server is a remote server. Not exposed by the application
|
|
63
|
+
- name: 'visibility:public'
|
|
64
|
+
description: This resource is public and available to everyone
|
|
65
|
+
channels:
|
|
66
|
+
lightingMeasured:
|
|
67
|
+
address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
|
|
68
|
+
messages:
|
|
69
|
+
lightMeasured:
|
|
70
|
+
$ref: '#/components/messages/lightMeasured'
|
|
71
|
+
description: The topic on which measured values may be produced and consumed.
|
|
72
|
+
parameters:
|
|
73
|
+
streetlightId:
|
|
74
|
+
$ref: '#/components/parameters/streetlightId'
|
|
75
|
+
lightTurnOn:
|
|
76
|
+
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on'
|
|
77
|
+
messages:
|
|
78
|
+
turnOn:
|
|
79
|
+
$ref: '#/components/messages/turnOnOff'
|
|
80
|
+
parameters:
|
|
81
|
+
streetlightId:
|
|
82
|
+
$ref: '#/components/parameters/streetlightId'
|
|
83
|
+
lightTurnOff:
|
|
84
|
+
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off'
|
|
85
|
+
messages:
|
|
86
|
+
turnOff:
|
|
87
|
+
$ref: '#/components/messages/turnOnOff'
|
|
88
|
+
parameters:
|
|
89
|
+
streetlightId:
|
|
90
|
+
$ref: '#/components/parameters/streetlightId'
|
|
91
|
+
lightsDim:
|
|
92
|
+
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/dim'
|
|
93
|
+
messages:
|
|
94
|
+
dimLight:
|
|
95
|
+
$ref: '#/components/messages/dimLight'
|
|
96
|
+
parameters:
|
|
97
|
+
streetlightId:
|
|
98
|
+
$ref: '#/components/parameters/streetlightId'
|
|
99
|
+
operations:
|
|
100
|
+
receiveLightMeasurement:
|
|
101
|
+
action: receive
|
|
102
|
+
channel:
|
|
103
|
+
$ref: '#/channels/lightingMeasured'
|
|
104
|
+
summary: >-
|
|
105
|
+
Inform about environmental lighting conditions of a particular
|
|
106
|
+
streetlight.
|
|
107
|
+
traits:
|
|
108
|
+
- $ref: '#/components/operationTraits/mqtt'
|
|
109
|
+
messages:
|
|
110
|
+
- $ref: '#/channels/lightingMeasured/messages/lightMeasured'
|
|
111
|
+
turnOn:
|
|
112
|
+
action: send
|
|
113
|
+
channel:
|
|
114
|
+
$ref: '#/channels/lightTurnOn'
|
|
115
|
+
traits:
|
|
116
|
+
- $ref: '#/components/operationTraits/mqtt'
|
|
117
|
+
messages:
|
|
118
|
+
- $ref: '#/channels/lightTurnOn/messages/turnOn'
|
|
119
|
+
turnOff:
|
|
120
|
+
action: send
|
|
121
|
+
channel:
|
|
122
|
+
$ref: '#/channels/lightTurnOff'
|
|
123
|
+
traits:
|
|
124
|
+
- $ref: '#/components/operationTraits/mqtt'
|
|
125
|
+
messages:
|
|
126
|
+
- $ref: '#/channels/lightTurnOff/messages/turnOff'
|
|
127
|
+
dimLight:
|
|
128
|
+
action: send
|
|
129
|
+
channel:
|
|
130
|
+
$ref: '#/channels/lightsDim'
|
|
131
|
+
traits:
|
|
132
|
+
- $ref: '#/components/operationTraits/mqtt'
|
|
133
|
+
messages:
|
|
134
|
+
- $ref: '#/channels/lightsDim/messages/dimLight'
|
|
135
|
+
components:
|
|
136
|
+
messages:
|
|
137
|
+
lightMeasured:
|
|
138
|
+
name: lightMeasured
|
|
139
|
+
title: Light measured
|
|
140
|
+
summary: >-
|
|
141
|
+
Inform about environmental lighting conditions of a particular
|
|
142
|
+
streetlight.
|
|
143
|
+
contentType: application/json
|
|
144
|
+
traits:
|
|
145
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
146
|
+
payload:
|
|
147
|
+
$ref: '#/components/schemas/lightMeasuredPayload'
|
|
148
|
+
turnOnOff:
|
|
149
|
+
name: turnOnOff
|
|
150
|
+
title: Turn on/off
|
|
151
|
+
summary: Command a particular streetlight to turn the lights on or off.
|
|
152
|
+
traits:
|
|
153
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
154
|
+
payload:
|
|
155
|
+
$ref: '#/components/schemas/turnOnOffPayload'
|
|
156
|
+
dimLight:
|
|
157
|
+
name: dimLight
|
|
158
|
+
title: Dim light
|
|
159
|
+
summary: Command a particular streetlight to dim the lights.
|
|
160
|
+
traits:
|
|
161
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
162
|
+
payload:
|
|
163
|
+
$ref: '#/components/schemas/dimLightPayload'
|
|
164
|
+
schemas:
|
|
165
|
+
lightMeasuredPayload:
|
|
166
|
+
type: object
|
|
167
|
+
properties:
|
|
168
|
+
lumens:
|
|
169
|
+
type: integer
|
|
170
|
+
minimum: 0
|
|
171
|
+
description: Light intensity measured in lumens.
|
|
172
|
+
sentAt:
|
|
173
|
+
$ref: '#/components/schemas/sentAt'
|
|
174
|
+
turnOnOffPayload:
|
|
175
|
+
type: object
|
|
176
|
+
properties:
|
|
177
|
+
command:
|
|
178
|
+
type: string
|
|
179
|
+
enum:
|
|
180
|
+
- 'on'
|
|
181
|
+
- 'off'
|
|
182
|
+
description: Whether to turn on or off the light.
|
|
183
|
+
sentAt:
|
|
184
|
+
$ref: '#/components/schemas/sentAt'
|
|
185
|
+
dimLightPayload:
|
|
186
|
+
type: object
|
|
187
|
+
properties:
|
|
188
|
+
percentage:
|
|
189
|
+
type: integer
|
|
190
|
+
description: Percentage to which the light should be dimmed to.
|
|
191
|
+
minimum: 0
|
|
192
|
+
maximum: 100
|
|
193
|
+
sentAt:
|
|
194
|
+
$ref: '#/components/schemas/sentAt'
|
|
195
|
+
sentAt:
|
|
196
|
+
type: string
|
|
197
|
+
format: date-time
|
|
198
|
+
description: Date and time when the message was sent.
|
|
199
|
+
securitySchemes:
|
|
200
|
+
apiKey:
|
|
201
|
+
type: apiKey
|
|
202
|
+
in: user
|
|
203
|
+
description: Provide your API key as the user and leave the password empty.
|
|
204
|
+
supportedOauthFlows:
|
|
205
|
+
type: oauth2
|
|
206
|
+
description: Flows to support OAuth 2.0
|
|
207
|
+
flows:
|
|
208
|
+
implicit:
|
|
209
|
+
authorizationUrl: 'https://authserver.example/auth'
|
|
210
|
+
availableScopes:
|
|
211
|
+
'streetlights:on': Ability to switch lights on
|
|
212
|
+
'streetlights:off': Ability to switch lights off
|
|
213
|
+
'streetlights:dim': Ability to dim the lights
|
|
214
|
+
password:
|
|
215
|
+
tokenUrl: 'https://authserver.example/token'
|
|
216
|
+
availableScopes:
|
|
217
|
+
'streetlights:on': Ability to switch lights on
|
|
218
|
+
'streetlights:off': Ability to switch lights off
|
|
219
|
+
'streetlights:dim': Ability to dim the lights
|
|
220
|
+
clientCredentials:
|
|
221
|
+
tokenUrl: 'https://authserver.example/token'
|
|
222
|
+
availableScopes:
|
|
223
|
+
'streetlights:on': Ability to switch lights on
|
|
224
|
+
'streetlights:off': Ability to switch lights off
|
|
225
|
+
'streetlights:dim': Ability to dim the lights
|
|
226
|
+
authorizationCode:
|
|
227
|
+
authorizationUrl: 'https://authserver.example/auth'
|
|
228
|
+
tokenUrl: 'https://authserver.example/token'
|
|
229
|
+
refreshUrl: 'https://authserver.example/refresh'
|
|
230
|
+
availableScopes:
|
|
231
|
+
'streetlights:on': Ability to switch lights on
|
|
232
|
+
'streetlights:off': Ability to switch lights off
|
|
233
|
+
'streetlights:dim': Ability to dim the lights
|
|
234
|
+
openIdConnectWellKnown:
|
|
235
|
+
type: openIdConnect
|
|
236
|
+
openIdConnectUrl: 'https://authserver.example/.well-known'
|
|
237
|
+
parameters:
|
|
238
|
+
streetlightId:
|
|
239
|
+
description: The ID of the streetlight.
|
|
240
|
+
messageTraits:
|
|
241
|
+
commonHeaders:
|
|
242
|
+
headers:
|
|
243
|
+
type: object
|
|
244
|
+
properties:
|
|
245
|
+
my-app-header:
|
|
246
|
+
type: integer
|
|
247
|
+
minimum: 0
|
|
248
|
+
maximum: 100
|
|
249
|
+
operationTraits:
|
|
250
|
+
mqtt:
|
|
251
|
+
bindings:
|
|
252
|
+
mqtt:
|
|
253
|
+
qos: 1
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
asyncapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Streetlights Kafka 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
|
+
defaultContentType: application/json
|
|
10
|
+
servers:
|
|
11
|
+
test:
|
|
12
|
+
host: 'test.mykafkacluster.org:8092'
|
|
13
|
+
protocol: kafka-secure
|
|
14
|
+
description: Test broker
|
|
15
|
+
security:
|
|
16
|
+
- $ref: '#/components/securitySchemes/saslScram'
|
|
17
|
+
test_oauth:
|
|
18
|
+
host: 'test.mykafkacluster.org:8093'
|
|
19
|
+
protocol: kafka-secure
|
|
20
|
+
description: Test port for oauth
|
|
21
|
+
security:
|
|
22
|
+
- type: oauth2
|
|
23
|
+
description: The oauth security descriptions
|
|
24
|
+
flows:
|
|
25
|
+
clientCredentials:
|
|
26
|
+
tokenUrl: 'https://example.com/api/oauth/dialog'
|
|
27
|
+
availableScopes:
|
|
28
|
+
'streetlights:read': Scope required for subscribing to channel
|
|
29
|
+
'streetlights:write': Scope required for publishing to channel
|
|
30
|
+
scopes:
|
|
31
|
+
- 'streetlights:write'
|
|
32
|
+
- 'streetlights:read'
|
|
33
|
+
channels:
|
|
34
|
+
lightingMeasured:
|
|
35
|
+
address: 'smartylighting.streetlights.1.0.event.{streetlightId}.lighting.measured'
|
|
36
|
+
messages:
|
|
37
|
+
lightMeasured:
|
|
38
|
+
$ref: '#/components/messages/lightMeasured'
|
|
39
|
+
description: The topic on which measured values may be produced and consumed.
|
|
40
|
+
servers:
|
|
41
|
+
- $ref: '#/servers/test'
|
|
42
|
+
parameters:
|
|
43
|
+
streetlightId:
|
|
44
|
+
$ref: '#/components/parameters/streetlightId'
|
|
45
|
+
lightTurnOn:
|
|
46
|
+
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.turn.on'
|
|
47
|
+
messages:
|
|
48
|
+
turnOn:
|
|
49
|
+
$ref: '#/components/messages/turnOnOff'
|
|
50
|
+
servers:
|
|
51
|
+
- $ref: '#/servers/test_oauth'
|
|
52
|
+
parameters:
|
|
53
|
+
streetlightId:
|
|
54
|
+
$ref: '#/components/parameters/streetlightId'
|
|
55
|
+
lightTurnOff:
|
|
56
|
+
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.turn.off'
|
|
57
|
+
messages:
|
|
58
|
+
turnOff:
|
|
59
|
+
$ref: '#/components/messages/turnOnOff'
|
|
60
|
+
servers:
|
|
61
|
+
- $ref: '#/servers/test_oauth'
|
|
62
|
+
parameters:
|
|
63
|
+
streetlightId:
|
|
64
|
+
$ref: '#/components/parameters/streetlightId'
|
|
65
|
+
lightsDim:
|
|
66
|
+
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.dim'
|
|
67
|
+
messages:
|
|
68
|
+
dimLight:
|
|
69
|
+
$ref: '#/components/messages/dimLight'
|
|
70
|
+
servers:
|
|
71
|
+
- $ref: '#/servers/test_oauth'
|
|
72
|
+
parameters:
|
|
73
|
+
streetlightId:
|
|
74
|
+
$ref: '#/components/parameters/streetlightId'
|
|
75
|
+
operations:
|
|
76
|
+
receiveLightMeasurement:
|
|
77
|
+
action: receive
|
|
78
|
+
channel:
|
|
79
|
+
$ref: '#/channels/lightingMeasured'
|
|
80
|
+
summary: >-
|
|
81
|
+
Inform about environmental lighting conditions of a particular
|
|
82
|
+
streetlight.
|
|
83
|
+
traits:
|
|
84
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
85
|
+
messages:
|
|
86
|
+
- $ref: '#/channels/lightingMeasured/messages/lightMeasured'
|
|
87
|
+
turnOn:
|
|
88
|
+
action: send
|
|
89
|
+
channel:
|
|
90
|
+
$ref: '#/channels/lightTurnOn'
|
|
91
|
+
security:
|
|
92
|
+
- type: oauth2
|
|
93
|
+
description: The oauth security descriptions
|
|
94
|
+
flows:
|
|
95
|
+
clientCredentials:
|
|
96
|
+
tokenUrl: 'https://example.com/api/oauth/dialog'
|
|
97
|
+
availableScopes:
|
|
98
|
+
'streetlights:read': Scope required for subscribing to channel
|
|
99
|
+
'streetlights:write': Scope required for publishing to channel
|
|
100
|
+
scopes:
|
|
101
|
+
- 'streetlights:read'
|
|
102
|
+
traits:
|
|
103
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
104
|
+
messages:
|
|
105
|
+
- $ref: '#/channels/lightTurnOn/messages/turnOn'
|
|
106
|
+
turnOff:
|
|
107
|
+
action: send
|
|
108
|
+
channel:
|
|
109
|
+
$ref: '#/channels/lightTurnOff'
|
|
110
|
+
security:
|
|
111
|
+
- type: oauth2
|
|
112
|
+
description: The oauth security descriptions
|
|
113
|
+
flows:
|
|
114
|
+
clientCredentials:
|
|
115
|
+
tokenUrl: 'https://example.com/api/oauth/dialog'
|
|
116
|
+
availableScopes:
|
|
117
|
+
'streetlights:read': Scope required for subscribing to channel
|
|
118
|
+
'streetlights:write': Scope required for publishing to channel
|
|
119
|
+
scopes:
|
|
120
|
+
- 'streetlights:read'
|
|
121
|
+
traits:
|
|
122
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
123
|
+
messages:
|
|
124
|
+
- $ref: '#/channels/lightTurnOff/messages/turnOff'
|
|
125
|
+
dimLight:
|
|
126
|
+
action: send
|
|
127
|
+
channel:
|
|
128
|
+
$ref: '#/channels/lightsDim'
|
|
129
|
+
security:
|
|
130
|
+
- type: oauth2
|
|
131
|
+
description: The oauth security descriptions
|
|
132
|
+
flows:
|
|
133
|
+
clientCredentials:
|
|
134
|
+
tokenUrl: 'https://example.com/api/oauth/dialog'
|
|
135
|
+
availableScopes:
|
|
136
|
+
'streetlights:read': Scope required for subscribing to channel
|
|
137
|
+
'streetlights:write': Scope required for publishing to channel
|
|
138
|
+
scopes:
|
|
139
|
+
- 'streetlights:read'
|
|
140
|
+
traits:
|
|
141
|
+
- $ref: '#/components/operationTraits/kafka'
|
|
142
|
+
messages:
|
|
143
|
+
- $ref: '#/channels/lightsDim/messages/dimLight'
|
|
144
|
+
components:
|
|
145
|
+
messages:
|
|
146
|
+
lightMeasured:
|
|
147
|
+
name: lightMeasured
|
|
148
|
+
title: Light measured
|
|
149
|
+
summary: >-
|
|
150
|
+
Inform about environmental lighting conditions of a particular
|
|
151
|
+
streetlight.
|
|
152
|
+
contentType: application/json
|
|
153
|
+
traits:
|
|
154
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
155
|
+
payload:
|
|
156
|
+
$ref: '#/components/schemas/lightMeasuredPayload'
|
|
157
|
+
turnOnOff:
|
|
158
|
+
name: turnOnOff
|
|
159
|
+
title: Turn on/off
|
|
160
|
+
summary: Command a particular streetlight to turn the lights on or off.
|
|
161
|
+
traits:
|
|
162
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
163
|
+
payload:
|
|
164
|
+
$ref: '#/components/schemas/turnOnOffPayload'
|
|
165
|
+
dimLight:
|
|
166
|
+
name: dimLight
|
|
167
|
+
title: Dim light
|
|
168
|
+
summary: Command a particular streetlight to dim the lights.
|
|
169
|
+
traits:
|
|
170
|
+
- $ref: '#/components/messageTraits/commonHeaders'
|
|
171
|
+
payload:
|
|
172
|
+
$ref: '#/components/schemas/dimLightPayload'
|
|
173
|
+
schemas:
|
|
174
|
+
lightMeasuredPayload:
|
|
175
|
+
type: object
|
|
176
|
+
properties:
|
|
177
|
+
lumens:
|
|
178
|
+
type: integer
|
|
179
|
+
minimum: 0
|
|
180
|
+
description: Light intensity measured in lumens.
|
|
181
|
+
sentAt:
|
|
182
|
+
$ref: '#/components/schemas/sentAt'
|
|
183
|
+
turnOnOffPayload:
|
|
184
|
+
type: object
|
|
185
|
+
properties:
|
|
186
|
+
command:
|
|
187
|
+
type: string
|
|
188
|
+
enum:
|
|
189
|
+
- 'on'
|
|
190
|
+
- 'off'
|
|
191
|
+
description: Whether to turn on or off the light.
|
|
192
|
+
sentAt:
|
|
193
|
+
$ref: '#/components/schemas/sentAt'
|
|
194
|
+
dimLightPayload:
|
|
195
|
+
type: object
|
|
196
|
+
properties:
|
|
197
|
+
percentage:
|
|
198
|
+
type: integer
|
|
199
|
+
description: Percentage to which the light should be dimmed to.
|
|
200
|
+
minimum: 0
|
|
201
|
+
maximum: 100
|
|
202
|
+
sentAt:
|
|
203
|
+
$ref: '#/components/schemas/sentAt'
|
|
204
|
+
sentAt:
|
|
205
|
+
type: string
|
|
206
|
+
format: date-time
|
|
207
|
+
description: Date and time when the message was sent.
|
|
208
|
+
securitySchemes:
|
|
209
|
+
saslScram:
|
|
210
|
+
type: scramSha256
|
|
211
|
+
description: Provide your username and password for SASL/SCRAM authentication
|
|
212
|
+
streetlights_auth:
|
|
213
|
+
type: oauth2
|
|
214
|
+
description: The oauth security descriptions
|
|
215
|
+
flows:
|
|
216
|
+
clientCredentials:
|
|
217
|
+
tokenUrl: 'https://example.com/api/oauth/dialog'
|
|
218
|
+
availableScopes:
|
|
219
|
+
'streetlights:read': Scope required for subscribing to channel
|
|
220
|
+
'streetlights:write': Scope required for publishing to channel
|
|
221
|
+
parameters:
|
|
222
|
+
streetlightId:
|
|
223
|
+
description: The ID of the streetlight.
|
|
224
|
+
messageTraits:
|
|
225
|
+
commonHeaders:
|
|
226
|
+
headers:
|
|
227
|
+
type: object
|
|
228
|
+
properties:
|
|
229
|
+
my-app-header:
|
|
230
|
+
type: integer
|
|
231
|
+
minimum: 0
|
|
232
|
+
maximum: 100
|
|
233
|
+
operationTraits:
|
|
234
|
+
kafka:
|
|
235
|
+
bindings:
|
|
236
|
+
kafka:
|
|
237
|
+
clientId:
|
|
238
|
+
type: string
|
|
239
|
+
enum:
|
|
240
|
+
- my-app-id
|