@manyos/smileconnect-api 1.66.0 → 1.68.0
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/controller/scriptController.js +2 -0
- package/docs/configuration/config.md +7 -0
- package/docs/releases.md +8 -2
- package/docs/scripts.md +6 -0
- package/package.json +1 -1
- package/util/config.js +13 -9
|
@@ -8,6 +8,7 @@ const basePath = 'conf';
|
|
|
8
8
|
const basePathGlobalScripts = basePath + '/scripts';
|
|
9
9
|
const HttpsProxyAgent = require('https-proxy-agent');
|
|
10
10
|
const jsonwebtoken= require('jsonwebtoken');
|
|
11
|
+
const crypto = require('node:crypto');
|
|
11
12
|
|
|
12
13
|
const fetch = require('node-fetch');
|
|
13
14
|
const xmlParser = require('fast-xml-parser')
|
|
@@ -87,6 +88,7 @@ async function executeCode(code, requestData, params, logStream, executedByScrip
|
|
|
87
88
|
requestData,
|
|
88
89
|
params,
|
|
89
90
|
adapter,
|
|
91
|
+
crypto,
|
|
90
92
|
jsonwebtoken,
|
|
91
93
|
log: log.child({script: scriptId}, true),
|
|
92
94
|
clientId,
|
|
@@ -208,6 +208,13 @@ Sample:
|
|
|
208
208
|
|
|
209
209
|
*MAX_HTTP_SOCKETS=15*
|
|
210
210
|
|
|
211
|
+
### DOC_SERVERS
|
|
212
|
+
|
|
213
|
+
Array of Servers in JSON Format, that are used in the generated openapi specification.
|
|
214
|
+
|
|
215
|
+
Sample:
|
|
216
|
+
|
|
217
|
+
*DOC_SERVERS=[{"url":"https://smileconnect-dev.xyz.com", "description":"dev"}, {"url":"https://smileconnect.xyz.com", "description":"prod"}]*
|
|
211
218
|
|
|
212
219
|
# Event Manager
|
|
213
220
|
|
package/docs/releases.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
3
|
## API
|
|
4
|
-
### 1.
|
|
5
|
-
Add
|
|
4
|
+
### 1.68.0 - 23.04.24
|
|
5
|
+
Add configurable server names to openapi documentation
|
|
6
|
+
|
|
7
|
+
### 1.67.0 - 09.04.24
|
|
8
|
+
Add crypto & jsonweboken to scripts
|
|
6
9
|
|
|
7
10
|
### 1.65.2 - 01.03.24
|
|
8
11
|
Add foundation data to dynamic api spec
|
|
@@ -204,6 +207,9 @@ e.g.
|
|
|
204
207
|
*/v1/incidents?impersonateUser=abc123
|
|
205
208
|
|
|
206
209
|
## Event Manager
|
|
210
|
+
### 1.33.0 - 10.04.24
|
|
211
|
+
Add crypto & jsonweboken to scripts
|
|
212
|
+
|
|
207
213
|
### 1.31.0 - 18.07.23
|
|
208
214
|
Introduce advanced logging for events. Each event log record will contain details about the associated event. (e.g. Event Id, Ticketnumber, etc.)
|
|
209
215
|
|
package/docs/scripts.md
CHANGED
|
@@ -253,6 +253,12 @@ Manage JSON Web Token via the package *jsonwebtoken*
|
|
|
253
253
|
|
|
254
254
|
See https://www.npmjs.com/package/jsonwebtoken for details.
|
|
255
255
|
|
|
256
|
+
## crypto
|
|
257
|
+
|
|
258
|
+
Node Crypto Library
|
|
259
|
+
|
|
260
|
+
See https://nodejs.org/api/crypto.html for details.
|
|
261
|
+
|
|
256
262
|
## HttpsProxyAgent
|
|
257
263
|
|
|
258
264
|
Provides Proxy Access for fetch.
|
package/package.json
CHANGED
package/util/config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const fsPromises = require('fs').promises;
|
|
3
|
+
require('dotenv').config();
|
|
3
4
|
|
|
4
5
|
const path = require('path');
|
|
5
6
|
const log = require('@manyos/logger').setupLog('SMILEconnect', path.basename(__filename));
|
|
@@ -326,16 +327,19 @@ async function getDesignPackage(clientId) {
|
|
|
326
327
|
},
|
|
327
328
|
termsOfService: 'https://manyos.it'
|
|
328
329
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
330
|
+
let servers = []
|
|
331
|
+
|
|
332
|
+
if (process.env.DOC_SERVERS) {
|
|
333
|
+
try {
|
|
334
|
+
const doc_servers = JSON.parse(process.env.DOC_SERVERS);
|
|
335
|
+
if (doc_servers && Array.isArray(doc_servers)) {
|
|
336
|
+
servers = doc_servers;
|
|
337
|
+
}
|
|
338
|
+
} catch (error) {
|
|
339
|
+
log.error("Can't read server for openapi docs.", error);
|
|
337
340
|
}
|
|
338
|
-
|
|
341
|
+
}
|
|
342
|
+
|
|
339
343
|
const clientConfig = await getClientConfig(clientId)
|
|
340
344
|
const schemas = {}
|
|
341
345
|
let paths = {}
|