@5minds/node-red-openapi-generator 1.1.2
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/.github/workflows/build-and-publish.yaml +104 -0
- package/.prettierrc.json +6 -0
- package/LICENSE +177 -0
- package/README.md +173 -0
- package/package.json +39 -0
- package/readme_images/Capture_00.PNG +0 -0
- package/readme_images/Capture_01.PNG +0 -0
- package/readme_images/Capture_02.PNG +0 -0
- package/readme_images/Capture_03.PNG +0 -0
- package/readme_images/Capture_04.PNG +0 -0
- package/readme_images/Capture_Swagger_UI.PNG +0 -0
- package/swagger/locales/en-US/swagger.json +72 -0
- package/swagger/swagger-ui/swagger-ui.html +396 -0
- package/swagger/swagger.html +959 -0
- package/swagger/swagger.js +277 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Swagger UI</title>
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="swagger-ui.css" />
|
|
6
|
+
<style>
|
|
7
|
+
|
|
8
|
+
.dark-mode-toggle:hover {
|
|
9
|
+
background: #2563eb;
|
|
10
|
+
transform: translateY(-1px);
|
|
11
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Dark mode styles */
|
|
15
|
+
[data-theme="dark"] {
|
|
16
|
+
color-scheme: dark;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-theme="dark"] .swagger-ui {
|
|
20
|
+
color: #f8fafc;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Make ALL text bright and readable */
|
|
24
|
+
[data-theme="dark"] .swagger-ui *,
|
|
25
|
+
[data-theme="dark"] .swagger-ui p,
|
|
26
|
+
[data-theme="dark"] .swagger-ui span,
|
|
27
|
+
[data-theme="dark"] .swagger-ui div,
|
|
28
|
+
[data-theme="dark"] .swagger-ui label,
|
|
29
|
+
[data-theme="dark"] .swagger-ui td,
|
|
30
|
+
[data-theme="dark"] .swagger-ui th {
|
|
31
|
+
color: #f1f5f9 !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-theme="dark"] .swagger-ui .topbar {
|
|
35
|
+
background: #1e293b !important;
|
|
36
|
+
border-bottom: 1px solid #334155;
|
|
37
|
+
display: flex !important;
|
|
38
|
+
align-items: center !important;
|
|
39
|
+
justify-content: space-between !important;
|
|
40
|
+
padding: 10px 20px !important;
|
|
41
|
+
position: relative !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Make the Explore button more compact */
|
|
45
|
+
[data-theme="dark"] .swagger-ui .topbar .download-url-wrapper {
|
|
46
|
+
max-width: none !important;
|
|
47
|
+
flex-shrink: 1 !important;
|
|
48
|
+
margin-right: 120px !important; /* Space for toggle button */
|
|
49
|
+
overflow: visible !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-theme="dark"] .swagger-ui .topbar .download-url-wrapper .btn {
|
|
53
|
+
padding: 6px 12px !important;
|
|
54
|
+
font-size: 12px !important;
|
|
55
|
+
white-space: nowrap !important;
|
|
56
|
+
min-width: auto !important;
|
|
57
|
+
overflow: visible !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Adjust toggle button for smaller screens */
|
|
61
|
+
.dark-mode-toggle {
|
|
62
|
+
position: fixed;
|
|
63
|
+
top: 15px;
|
|
64
|
+
right: 15px;
|
|
65
|
+
z-index: 9999;
|
|
66
|
+
background: #3b82f6;
|
|
67
|
+
color: white;
|
|
68
|
+
border: none;
|
|
69
|
+
border-radius: 6px;
|
|
70
|
+
padding: 8px 12px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
|
74
|
+
transition: all 0.3s ease;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Responsive adjustments */
|
|
78
|
+
@media (max-width: 768px) {
|
|
79
|
+
[data-theme="dark"] .swagger-ui .topbar .download-url-wrapper {
|
|
80
|
+
margin-right: 100px !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-theme="dark"] .swagger-ui .topbar .download-url-wrapper .btn {
|
|
84
|
+
padding: 4px 8px !important;
|
|
85
|
+
font-size: 11px !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.dark-mode-toggle {
|
|
89
|
+
top: 12px;
|
|
90
|
+
right: 12px;
|
|
91
|
+
padding: 6px 8px;
|
|
92
|
+
font-size: 10px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-theme="dark"] .swagger-ui .info {
|
|
97
|
+
background: #1e293b;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[data-theme="dark"] .swagger-ui .info .title {
|
|
101
|
+
color: #f8fafc !important;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-theme="dark"] .swagger-ui .scheme-container {
|
|
105
|
+
display: none !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-theme="dark"] .swagger-ui .opblock-tag {
|
|
109
|
+
background: #334155 !important;
|
|
110
|
+
color: #f8fafc !important;
|
|
111
|
+
border-bottom: 1px solid #475569;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[data-theme="dark"] .swagger-ui .opblock {
|
|
115
|
+
background: #334155;
|
|
116
|
+
border: 1px solid #475569;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[data-theme="dark"] .swagger-ui .opblock .opblock-summary {
|
|
120
|
+
background: transparent;
|
|
121
|
+
border-bottom: 1px solid #475569;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-theme="dark"] .swagger-ui .opblock .opblock-summary-path {
|
|
125
|
+
color: #f8fafc !important;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-theme="dark"] .swagger-ui .opblock .opblock-summary-description {
|
|
129
|
+
color: #f8fafc !important;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[data-theme="dark"] .swagger-ui .opblock .opblock-section-header {
|
|
133
|
+
background: #475569;
|
|
134
|
+
color: #f8fafc !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[data-theme="dark"] .swagger-ui .opblock .opblock-section-header h4 {
|
|
138
|
+
color: #f8fafc !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
[data-theme="dark"] .swagger-ui .opblock-description-wrapper,
|
|
142
|
+
[data-theme="dark"] .swagger-ui .opblock-external-docs-wrapper,
|
|
143
|
+
[data-theme="dark"] .swagger-ui .opblock-title_normal,
|
|
144
|
+
[data-theme="dark"] .swagger-ui .opblock-description,
|
|
145
|
+
[data-theme="dark"] .swagger-ui .opblock-description p {
|
|
146
|
+
color: #f8fafc !important;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
[data-theme="dark"] .swagger-ui .parameter__name {
|
|
150
|
+
color: #f8fafc !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[data-theme="dark"] .swagger-ui .parameter__type {
|
|
154
|
+
color: #f1f5f9 !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
[data-theme="dark"] .swagger-ui table thead tr td,
|
|
158
|
+
[data-theme="dark"] .swagger-ui table thead tr th {
|
|
159
|
+
background: #475569;
|
|
160
|
+
color: #f8fafc !important;
|
|
161
|
+
border-color: #64748b;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
[data-theme="dark"] .swagger-ui table tbody tr td {
|
|
165
|
+
color: #f8fafc !important;
|
|
166
|
+
border-color: #475569;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
[data-theme="dark"] .swagger-ui .response-col_status {
|
|
170
|
+
color: #f8fafc !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-theme="dark"] .swagger-ui .response-col_description {
|
|
174
|
+
color: #f8fafc !important;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[data-theme="dark"] .swagger-ui .model-box {
|
|
178
|
+
background: #334155;
|
|
179
|
+
border: 1px solid #475569;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[data-theme="dark"] .swagger-ui .model .model-title {
|
|
183
|
+
color: #f1f5f9;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[data-theme="dark"] .swagger-ui .model-toggle {
|
|
187
|
+
background: #475569;
|
|
188
|
+
color: #f1f5f9;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-theme="dark"] .swagger-ui .model-toggle:hover {
|
|
192
|
+
background: #64748b;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
[data-theme="dark"] .swagger-ui input[type=email],
|
|
196
|
+
[data-theme="dark"] .swagger-ui input[type=file],
|
|
197
|
+
[data-theme="dark"] .swagger-ui input[type=password],
|
|
198
|
+
[data-theme="dark"] .swagger-ui input[type=search],
|
|
199
|
+
[data-theme="dark"] .swagger-ui input[type=text],
|
|
200
|
+
[data-theme="dark"] .swagger-ui textarea {
|
|
201
|
+
background: #475569;
|
|
202
|
+
color: #f1f5f9;
|
|
203
|
+
border: 1px solid #64748b;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-theme="dark"] .swagger-ui input[type=email]:focus,
|
|
207
|
+
[data-theme="dark"] .swagger-ui input[type=file]:focus,
|
|
208
|
+
[data-theme="dark"] .swagger-ui input[type=password]:focus,
|
|
209
|
+
[data-theme="dark"] .swagger-ui input[type=search]:focus,
|
|
210
|
+
[data-theme="dark"] .swagger-ui input[type=text]:focus,
|
|
211
|
+
[data-theme="dark"] .swagger-ui textarea:focus {
|
|
212
|
+
border-color: #3b82f6;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Keep dropdown readable with dark text on light background */
|
|
216
|
+
[data-theme="dark"] .swagger-ui select {
|
|
217
|
+
background: #f8fafc !important;
|
|
218
|
+
color: #1e293b !important;
|
|
219
|
+
border: 1px solid #64748b !important;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[data-theme="dark"] .swagger-ui .btn {
|
|
223
|
+
background: #3b82f6;
|
|
224
|
+
color: white;
|
|
225
|
+
border-color: #3b82f6;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
[data-theme="dark"] .swagger-ui .btn:hover {
|
|
229
|
+
background: #2563eb;
|
|
230
|
+
border-color: #2563eb;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
[data-theme="dark"] .swagger-ui .btn.cancel {
|
|
234
|
+
background: #64748b;
|
|
235
|
+
border-color: #64748b;
|
|
236
|
+
color: white;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
[data-theme="dark"] .swagger-ui .btn.cancel:hover {
|
|
240
|
+
background: #475569;
|
|
241
|
+
border-color: #475569;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
[data-theme="dark"] .swagger-ui .execute-wrapper {
|
|
245
|
+
background: #334155;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
[data-theme="dark"] .swagger-ui .responses-wrapper {
|
|
249
|
+
background: #334155;
|
|
250
|
+
border: 1px solid #475569;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
[data-theme="dark"] .swagger-ui .responses-wrapper .response-col_description {
|
|
254
|
+
color: #f8fafc !important;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
[data-theme="dark"] .swagger-ui code {
|
|
258
|
+
background: #475569;
|
|
259
|
+
color: #f8fafc !important;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
[data-theme="dark"] .swagger-ui .highlight-code {
|
|
263
|
+
background: #1e293b;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
[data-theme="dark"] .swagger-ui .highlight-code pre {
|
|
267
|
+
color: #f8fafc !important;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* HTTP method colors for dark mode */
|
|
271
|
+
[data-theme="dark"] .swagger-ui .opblock.opblock-get {
|
|
272
|
+
background: rgba(97, 175, 254, 0.1);
|
|
273
|
+
border-color: #61afff;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
[data-theme="dark"] .swagger-ui .opblock.opblock-post {
|
|
277
|
+
background: rgba(73, 204, 144, 0.1);
|
|
278
|
+
border-color: #49cc90;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
[data-theme="dark"] .swagger-ui .opblock.opblock-put {
|
|
282
|
+
background: rgba(252, 161, 48, 0.1);
|
|
283
|
+
border-color: #fca130;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
[data-theme="dark"] .swagger-ui .opblock.opblock-delete {
|
|
287
|
+
background: rgba(249, 62, 62, 0.1);
|
|
288
|
+
border-color: #f93e3e;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
[data-theme="dark"] .swagger-ui .opblock.opblock-patch {
|
|
292
|
+
background: rgba(80, 227, 194, 0.1);
|
|
293
|
+
border-color: #50e3c2;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Root background */
|
|
297
|
+
[data-theme="dark"] body {
|
|
298
|
+
background-color: #0f172a;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
[data-theme="dark"] .swagger-ui {
|
|
302
|
+
background-color: #0f172a;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* Smooth transitions */
|
|
306
|
+
html {
|
|
307
|
+
transition: color-scheme 0.3s ease;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
body {
|
|
311
|
+
transition: background-color 0.3s ease;
|
|
312
|
+
}
|
|
313
|
+
</style>
|
|
314
|
+
</head>
|
|
315
|
+
|
|
316
|
+
<body>
|
|
317
|
+
<button class="dark-mode-toggle" id="darkModeToggle">
|
|
318
|
+
🌙 Dark
|
|
319
|
+
</button>
|
|
320
|
+
|
|
321
|
+
<div id="swagger-ui"></div>
|
|
322
|
+
|
|
323
|
+
<script src="swagger-ui-bundle.js"></script>
|
|
324
|
+
<script src="swagger-ui-standalone-preset.js"></script>
|
|
325
|
+
<script>
|
|
326
|
+
// Dark mode functionality
|
|
327
|
+
class DarkModeManager {
|
|
328
|
+
constructor() {
|
|
329
|
+
this.button = document.getElementById('darkModeToggle');
|
|
330
|
+
this.init();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
init() {
|
|
334
|
+
// Check for saved theme preference or default to system preference
|
|
335
|
+
const savedTheme = localStorage.getItem('swagger-theme');
|
|
336
|
+
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
337
|
+
|
|
338
|
+
if (savedTheme) {
|
|
339
|
+
this.setTheme(savedTheme);
|
|
340
|
+
} else if (systemPrefersDark) {
|
|
341
|
+
this.setTheme('dark');
|
|
342
|
+
} else {
|
|
343
|
+
this.setTheme('light');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Listen for system theme changes
|
|
347
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
|
348
|
+
if (!localStorage.getItem('swagger-theme')) {
|
|
349
|
+
this.setTheme(e.matches ? 'dark' : 'light');
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// Button click handler
|
|
354
|
+
this.button.addEventListener('click', () => {
|
|
355
|
+
const currentTheme = document.documentElement.getAttribute('data-theme');
|
|
356
|
+
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
|
357
|
+
this.setTheme(newTheme);
|
|
358
|
+
localStorage.setItem('swagger-theme', newTheme);
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
setTheme(theme) {
|
|
363
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
364
|
+
this.updateButton(theme);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
updateButton(theme) {
|
|
368
|
+
if (theme === 'dark') {
|
|
369
|
+
this.button.innerHTML = '☀️ Light';
|
|
370
|
+
this.button.style.background = '#f59e0b';
|
|
371
|
+
} else {
|
|
372
|
+
this.button.innerHTML = '🌙 Dark';
|
|
373
|
+
this.button.style.background = '#3b82f6';
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
window.onload = function () {
|
|
379
|
+
// Initialize dark mode
|
|
380
|
+
new DarkModeManager();
|
|
381
|
+
|
|
382
|
+
// Initialize Swagger UI
|
|
383
|
+
const ui = SwaggerUIBundle({
|
|
384
|
+
url: '/http-api/swagger.json',
|
|
385
|
+
dom_id: '#swagger-ui',
|
|
386
|
+
deepLinking: true,
|
|
387
|
+
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
|
|
388
|
+
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
|
|
389
|
+
layout: 'StandaloneLayout',
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
window.ui = ui;
|
|
393
|
+
};
|
|
394
|
+
</script>
|
|
395
|
+
</body>
|
|
396
|
+
</html>
|