@5minds/node-red-contrib-processcube-tools 1.1.0-feature-975857-mg4vqpai → 1.2.0-develop-2eb127-mg68t7xt
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.
|
@@ -112,6 +112,7 @@ module.exports = function (RED) {
|
|
|
112
112
|
const state = {
|
|
113
113
|
totalFolders: folders.length,
|
|
114
114
|
processedFolders: 0,
|
|
115
|
+
folderCount: {},
|
|
115
116
|
successes: 0,
|
|
116
117
|
failures: 0,
|
|
117
118
|
totalMails: 0,
|
|
@@ -168,6 +169,7 @@ module.exports = function (RED) {
|
|
|
168
169
|
payload: {
|
|
169
170
|
status: 'success',
|
|
170
171
|
total: state.totalMails,
|
|
172
|
+
folderCount: state.folderCount,
|
|
171
173
|
folders: folders.join(', '),
|
|
172
174
|
}
|
|
173
175
|
}]);
|
|
@@ -190,6 +192,8 @@ module.exports = function (RED) {
|
|
|
190
192
|
return startNextFolder();
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
state.folderCount[folder] = 0;
|
|
196
|
+
|
|
193
197
|
imap.search(['UNSEEN'], (err, results) => {
|
|
194
198
|
if (err) {
|
|
195
199
|
node.error(`Search failed in folder "${folder}": ${err.message}`);
|
|
@@ -236,6 +240,7 @@ module.exports = function (RED) {
|
|
|
236
240
|
content: att.content,
|
|
237
241
|
})),
|
|
238
242
|
};
|
|
243
|
+
state.folderCount[folder] = (state.folderCount[folder] || 0) + 1;
|
|
239
244
|
onMail(outMsg);
|
|
240
245
|
});
|
|
241
246
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@5minds/node-red-contrib-processcube-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-develop-2eb127-mg68t7xt",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node-RED tools nodes for ProcessCube",
|
|
6
6
|
"scripts": {
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
"nodes": {
|
|
39
39
|
"EmailReceiver": "email-receiver/email-receiver.js",
|
|
40
40
|
"EmailSender": "email-sender/email-sender.js",
|
|
41
|
-
"HtmlToText": "processcube-html-to-text/processcube-html-to-text.js"
|
|
42
|
-
"Swagger": "swagger/swagger.js"
|
|
41
|
+
"HtmlToText": "processcube-html-to-text/processcube-html-to-text.js"
|
|
43
42
|
},
|
|
44
43
|
"examples": "examples"
|
|
45
44
|
},
|
|
@@ -48,8 +47,7 @@
|
|
|
48
47
|
"mailparser": "^3.6.8",
|
|
49
48
|
"node-imap": "^0.9.6",
|
|
50
49
|
"nodemailer": "^7.0.6",
|
|
51
|
-
"utf7": "^1.0.2"
|
|
52
|
-
"swagger-ui-dist": "^5.29.0"
|
|
50
|
+
"utf7": "^1.0.2"
|
|
53
51
|
},
|
|
54
52
|
"devDependencies": {
|
|
55
53
|
"chai": "^4.3.4",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"swagger": {
|
|
3
|
-
"sidebar": {
|
|
4
|
-
"label": "swagger",
|
|
5
|
-
"name": "Swagger UI"
|
|
6
|
-
},
|
|
7
|
-
"label": {
|
|
8
|
-
"path": "Path",
|
|
9
|
-
"summary": "Summary",
|
|
10
|
-
"description": "Description",
|
|
11
|
-
"tags": "Tags",
|
|
12
|
-
"consumes": "Consumes",
|
|
13
|
-
"produces": "Produces",
|
|
14
|
-
"deprecated": "Deprecated",
|
|
15
|
-
"parameter": "parameter",
|
|
16
|
-
"parameters-help": "Parameters Help",
|
|
17
|
-
"response": "response",
|
|
18
|
-
"responses-help": "Responses Help",
|
|
19
|
-
"property": "property"
|
|
20
|
-
},
|
|
21
|
-
"placeholder": {
|
|
22
|
-
"tags": "Comma-separated list of Tags",
|
|
23
|
-
"consumes": "Comma-separated list of Mime Types",
|
|
24
|
-
"produces": "Comma-separated list of Mime Types"
|
|
25
|
-
},
|
|
26
|
-
"data-content": {
|
|
27
|
-
"summary": "A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.",
|
|
28
|
-
"description": "A verbose explanation of the operation behavior. GitHub Flavored Markup syntax can be used for rich text representation.",
|
|
29
|
-
"tags": "A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.",
|
|
30
|
-
"consumes": "A list of MIME types the operation can consume.",
|
|
31
|
-
"produces": "A list of MIME types the operation can produce.",
|
|
32
|
-
"deprecated": "Declares this operation to be deprecated. Usage of the declared operation should be refrained."
|
|
33
|
-
},
|
|
34
|
-
"content": {
|
|
35
|
-
"parameter-info": "<div style=\"max-width: 450px\"><p>A list of parameters that are applicable for this operation.</p><p>To add a parameter, click the <span class='btn btn-mini' id='node-config-input-add-parameter'><i class='fa fa-plus'></i> parameter</span> button.</p><p>There are four possible parameter types.</p><ul><li>Query - Parameters that are appended to the URL. For example, in /items?id=###, the query parameter is id.</li><li>Header - Custom headers that are expected as part of the request.</li><li>Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be one body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only.</li><li>Form - Used to describe the payload of an HTTP request when either application/x-www-form-urlencoded or multipart/form-data are used as the content type of the request (in Swagger's definition, the consumes property of an operation). This is the only parameter type that can be used to send files, thus supporting the file type.</li></ul></div>",
|
|
36
|
-
"response-info": "<div><p>The list of possible responses as they are returned from executing this operation.</p><p>You may supply responses for individual status codes, and/or a default response.</p><p>To add a parameter, click the <span class='btn btn-mini' id='node-config-input-add-parameter'><i class='fa fa-plus'></i> response</span> button.</p><p>If no responses are entered, a default response returning 'success' will be added for you.</p></div>",
|
|
37
|
-
"type": "The type of the attribute, limited to primitive types.",
|
|
38
|
-
"format": "The extending format for the previously mentioned type.",
|
|
39
|
-
"parameter-description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markup syntax can be used for rich text representation.",
|
|
40
|
-
"required": "Determines whether this parameter is mandatory.",
|
|
41
|
-
"response-description": "A brief description of the response. This could contain examples of use. GitHub Flavored Markup syntax can be used for rich text representation."
|
|
42
|
-
},
|
|
43
|
-
"tabs-label": {
|
|
44
|
-
"info": "Info",
|
|
45
|
-
"parameters": "Parameters",
|
|
46
|
-
"responses": "Responses",
|
|
47
|
-
"requestBody": "Request Body"
|
|
48
|
-
},
|
|
49
|
-
"text": {
|
|
50
|
-
"type": "Type",
|
|
51
|
-
"format": "Format",
|
|
52
|
-
"name": "Name",
|
|
53
|
-
"in": "in",
|
|
54
|
-
"path": "path",
|
|
55
|
-
"description": "Description",
|
|
56
|
-
"required": "Required?",
|
|
57
|
-
"properties": "Properties",
|
|
58
|
-
"file": "file",
|
|
59
|
-
"code": "Code",
|
|
60
|
-
"default": "Default"
|
|
61
|
-
},
|
|
62
|
-
"helpBox": {
|
|
63
|
-
"title": "I see you're lacking Swagger doc...",
|
|
64
|
-
"swaggerIntro": "Swagger is a simple yet powerful way to document your REST API.",
|
|
65
|
-
"swaggerInfo": "The Swagger plug-in dynamically generates Swagger documentation based on input provided when setting up your HTTP endpoint nodes.",
|
|
66
|
-
"swaggerInstructions0": "After building your REST APIs in the editor, click the HTTP endpoint node. You can then attach additional Swagger documentation to that node by clicking the add button next to Docs.",
|
|
67
|
-
"swaggerInstructions1": "You are able to add additional details on the types of inputs and outputs expected from your endpoint by quickly navigating through the screens and providing some information.",
|
|
68
|
-
"swaggerInstructions2": "Once your flow is deployed, this tab will be automatically populated by a visual representation of your API.",
|
|
69
|
-
"swaggerOutro": "You can then use this Swagger-UI tab to effortlessly test your APIs."
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,396 +0,0 @@
|
|
|
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>
|