iobroker.rest-api 1.0.0 → 1.0.1
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 +5 -1
- package/io-package.json +13 -13
- package/lib/api/swagger/swagger.yaml +41 -18
- package/lib/rest-api.js +3 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -109,7 +109,6 @@ You cannot send POST request to commands via GUI.
|
|
|
109
109
|
- `checkFeatureSupported(feature)` - check if feature is supported by js-controller.
|
|
110
110
|
- `decrypt(encryptedText)` - decrypt string with system secret
|
|
111
111
|
- `encrypt(plainText)` - encrypt string with system secret
|
|
112
|
-
- `getAdapterInstances(adapterName)` - get objects of type "instance". You can define optionally adapterName
|
|
113
112
|
- `getAdapters(adapterName)` - get objects of type "adapter". You can define optionally adapterName
|
|
114
113
|
- `updateLicenses(login, password)` - read licenses from ioBroker.net portal
|
|
115
114
|
- `getCompactInstances()` - read list of instances with short information
|
|
@@ -127,6 +126,7 @@ You cannot send POST request to commands via GUI.
|
|
|
127
126
|
- `extendObject(id, obj)` - modify object by ID with JSON. (.e.g. `{"common":{"enabled": true}}`)
|
|
128
127
|
- `getForeignObjects(pattern, type)` - same as getObjects
|
|
129
128
|
- `getForeignStates(pattern)` - same as getStates
|
|
129
|
+
- `delObjects(id, options)` - delete objects by pattern
|
|
130
130
|
|
|
131
131
|
### Others
|
|
132
132
|
- `log(text, level[info])` - no answer - add log entry to ioBroker log
|
|
@@ -137,6 +137,7 @@ You cannot send POST request to commands via GUI.
|
|
|
137
137
|
- `getUserPermissions()` - read object with user permissions
|
|
138
138
|
- `getVersion()` - read adapter name and version
|
|
139
139
|
- `getAdapterName()` - read adapter name (always rest-api)
|
|
140
|
+
- `getAdapterInstances(adapterName)` - get objects of type "instance". You can define optionally adapterName
|
|
140
141
|
|
|
141
142
|
<!-- END -->
|
|
142
143
|
<!--
|
|
@@ -145,6 +146,9 @@ You cannot send POST request to commands via GUI.
|
|
|
145
146
|
-->
|
|
146
147
|
|
|
147
148
|
## Changelog
|
|
149
|
+
### 1.0.1 (2022-07-27)
|
|
150
|
+
* (bluefox) Increased the max size of body to 100Mb
|
|
151
|
+
|
|
148
152
|
### 1.0.0 (2022-05-19)
|
|
149
153
|
* (bluefox) Final release
|
|
150
154
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "rest-api",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.0.1": {
|
|
7
|
+
"en": "Increased the max size of body to 100Mb",
|
|
8
|
+
"de": "Erhöht die maximale Körpergröße auf 100Mb",
|
|
9
|
+
"ru": "Увеличение максимального размера тела до 100Мб",
|
|
10
|
+
"pt": "Aumento do tamanho máximo do corpo para 100Mb",
|
|
11
|
+
"nl": "Verhoog de maximale grootte van lichaam tot 100MB",
|
|
12
|
+
"fr": "Augmentation de la taille maximale du corps à 100Mb",
|
|
13
|
+
"it": "Aumentata la dimensione massima del corpo a 100Mb",
|
|
14
|
+
"es": "Aumento del tamaño máximo del cuerpo a 100Mb",
|
|
15
|
+
"pl": "Zwiększono maksymalną wielkość ciała do 100 Mb",
|
|
16
|
+
"zh-cn": "提高机构规模,使之达到100千兆瓦"
|
|
17
|
+
},
|
|
6
18
|
"1.0.0": {
|
|
7
19
|
"en": "Final release",
|
|
8
20
|
"de": "Endgültige Veröffentlichung",
|
|
@@ -74,18 +86,6 @@
|
|
|
74
86
|
"es": "Permitida la lectura de suscripciones vigentes",
|
|
75
87
|
"pl": "Umożliwił czytanie aktualnych subskrypcji",
|
|
76
88
|
"zh-cn": "允许阅读当前订阅"
|
|
77
|
-
},
|
|
78
|
-
"0.3.4": {
|
|
79
|
-
"en": "Corrected subscription",
|
|
80
|
-
"de": "Abonnement korrigiert",
|
|
81
|
-
"ru": "Исправлена подписка",
|
|
82
|
-
"pt": "Assinatura corrigida",
|
|
83
|
-
"nl": "Gecorrigeerd abonnement",
|
|
84
|
-
"fr": "Abonnement corrigé",
|
|
85
|
-
"it": "Abbonamento corretto",
|
|
86
|
-
"es": "Suscripción corregida",
|
|
87
|
-
"pl": "Poprawiona subskrypcja",
|
|
88
|
-
"zh-cn": "更正订阅"
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"title": "REST API",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
swagger: "2.0"
|
|
3
3
|
info:
|
|
4
4
|
description: "This is a REST server for ioBroker."
|
|
5
|
-
version: "1.0.
|
|
5
|
+
version: "1.0.1"
|
|
6
6
|
title: "ioBroker Swagger UI"
|
|
7
7
|
contact:
|
|
8
8
|
email: "admin@iobroker.net"
|
|
@@ -1604,23 +1604,6 @@ paths:
|
|
|
1604
1604
|
responses:
|
|
1605
1605
|
200:
|
|
1606
1606
|
description: "successful operation"
|
|
1607
|
-
/command/getAdapterInstances:
|
|
1608
|
-
get:
|
|
1609
|
-
tags:
|
|
1610
|
-
- "commands"
|
|
1611
|
-
summary: "get objects of type \"instance\". You can define optionally adapterName"
|
|
1612
|
-
produces:
|
|
1613
|
-
- "application/json"
|
|
1614
|
-
parameters:
|
|
1615
|
-
|
|
1616
|
-
- name: "adapterName"
|
|
1617
|
-
in: "query"
|
|
1618
|
-
description: ""
|
|
1619
|
-
type: "string"
|
|
1620
|
-
required: false
|
|
1621
|
-
responses:
|
|
1622
|
-
200:
|
|
1623
|
-
description: "successful operation"
|
|
1624
1607
|
/command/getAdapters:
|
|
1625
1608
|
get:
|
|
1626
1609
|
tags:
|
|
@@ -1917,6 +1900,29 @@ paths:
|
|
|
1917
1900
|
responses:
|
|
1918
1901
|
200:
|
|
1919
1902
|
description: "successful operation"
|
|
1903
|
+
/command/delObjects:
|
|
1904
|
+
get:
|
|
1905
|
+
tags:
|
|
1906
|
+
- "commands"
|
|
1907
|
+
summary: "delete objects by pattern"
|
|
1908
|
+
produces:
|
|
1909
|
+
- "application/json"
|
|
1910
|
+
parameters:
|
|
1911
|
+
|
|
1912
|
+
- name: "id"
|
|
1913
|
+
in: "query"
|
|
1914
|
+
description: ""
|
|
1915
|
+
type: "string"
|
|
1916
|
+
required: true
|
|
1917
|
+
|
|
1918
|
+
- name: "options"
|
|
1919
|
+
in: "query"
|
|
1920
|
+
description: "JSON object"
|
|
1921
|
+
type: "string"
|
|
1922
|
+
required: false
|
|
1923
|
+
responses:
|
|
1924
|
+
200:
|
|
1925
|
+
description: "successful operation"
|
|
1920
1926
|
# admin commands end
|
|
1921
1927
|
/command/log:
|
|
1922
1928
|
get:
|
|
@@ -2050,6 +2056,23 @@ paths:
|
|
|
2050
2056
|
responses:
|
|
2051
2057
|
200:
|
|
2052
2058
|
description: "successful operation"
|
|
2059
|
+
/command/getAdapterInstances:
|
|
2060
|
+
get:
|
|
2061
|
+
tags:
|
|
2062
|
+
- "commands"
|
|
2063
|
+
summary: "get objects of type \"instance\". You can define optionally adapterName"
|
|
2064
|
+
produces:
|
|
2065
|
+
- "application/json"
|
|
2066
|
+
parameters:
|
|
2067
|
+
|
|
2068
|
+
- name: "adapterName"
|
|
2069
|
+
in: "query"
|
|
2070
|
+
description: ""
|
|
2071
|
+
type: "string"
|
|
2072
|
+
required: false
|
|
2073
|
+
responses:
|
|
2074
|
+
200:
|
|
2075
|
+
description: "successful operation"
|
|
2053
2076
|
# commands stop
|
|
2054
2077
|
definitions:
|
|
2055
2078
|
State:
|
package/lib/rest-api.js
CHANGED
|
@@ -258,7 +258,9 @@ function SwaggerUI(_ignore, webSettings, adapter, instanceSettings, app, callbac
|
|
|
258
258
|
|
|
259
259
|
// enable cors only if standalone
|
|
260
260
|
!instanceSettings && this.app.use(cors());
|
|
261
|
-
this.app.use(bodyParser.json(
|
|
261
|
+
this.app.use(bodyParser.json({
|
|
262
|
+
limit: '100mb',
|
|
263
|
+
}));
|
|
262
264
|
|
|
263
265
|
const _options = {
|
|
264
266
|
appRoot: __dirname,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.rest-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "RESTful interface for ioBroker with GUI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@iobroker/adapter-core": "^2.6.0",
|
|
23
|
-
"@iobroker/socket-classes": "^0.
|
|
23
|
+
"@iobroker/socket-classes": "^0.5.0",
|
|
24
24
|
"axios": "^0.27.2",
|
|
25
25
|
"body-parser": "^1.20.0",
|
|
26
26
|
"cors": "^2.8.5",
|
|
27
27
|
"express": "^4.18.1",
|
|
28
28
|
"swagger-node-runner-fork": "^0.8.0",
|
|
29
|
-
"swagger-ui-express": "^4.
|
|
29
|
+
"swagger-ui-express": "^4.5.0",
|
|
30
30
|
"yamljs": "^0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"chai": "^4.3.6",
|
|
38
38
|
"eslint-plugin-eqeqeq-fix": "^1.0.3",
|
|
39
39
|
"eslint-plugin-only-warn": "^1.0.3",
|
|
40
|
-
"eslint-plugin-react": "^7.
|
|
40
|
+
"eslint-plugin-react": "^7.30.1",
|
|
41
41
|
"gulp": "^4.0.2",
|
|
42
42
|
"mocha": "^9.2.2"
|
|
43
43
|
},
|