@manyos/smileconnect-api 1.67.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.
@@ -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.68.0 - 23.04.24
5
+ Add configurable server names to openapi documentation
6
+
4
7
  ### 1.67.0 - 09.04.24
5
- Add crypto to scripts
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.67.0",
3
+ "version": "1.68.0",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {
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
- const servers = [
330
- {
331
- url: "https://url123",
332
- description: "dev"
333
- },
334
- {
335
- url: "https://url12345",
336
- description: "prod"
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 = {}