@manyos/smileconnect-api 1.65.0 → 1.65.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/docs/releases.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Release Notes
2
2
 
3
3
  ## API
4
- ### 1.65.0 - 01.03.24
4
+ ### 1.65.1 - 01.03.24
5
5
  Add foundation data to dynamic api spec
6
6
 
7
7
  ### 1.64.8 - 26.10.23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.65.0",
3
+ "version": "1.65.1",
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
@@ -340,19 +340,8 @@ async function getDesignPackage(clientId) {
340
340
  const schemas = {}
341
341
  let paths = {}
342
342
 
343
- const ticketKeys = Object.keys(ticketConfig);
344
- ticketKeys.push("organisation");
345
- ticketKeys.push("supportGroup");
346
- ticketKeys.push("person");
347
-
348
- ticketKeys.push("changeTemplate");
349
- ticketKeys.push("incidentTemplate");
350
- ticketKeys.push("problemTemplate");
351
- ticketKeys.push("workOrderTemplate");
352
- ticketKeys.push("taskTemplate");
353
-
354
343
  //generate docs for normal tickets
355
- const keys = ticketKeys;
344
+ const keys = Object.keys(ticketConfig);
356
345
 
357
346
  for (let x=0; x<keys.length; x++) {
358
347
  const key = keys[x]
@@ -376,6 +365,40 @@ async function getDesignPackage(clientId) {
376
365
  }
377
366
  }
378
367
 
368
+ //foundation data & templates
369
+ const foundationKeys = [
370
+ {
371
+ type: "organisation",
372
+ path: "/v1/organisation",
373
+ name: "Organisation",
374
+ form: CONSTANTS.FORM_ORGANISATION
375
+ },
376
+ {
377
+ type: "supportGroup",
378
+ path: "/v1/supportgroups",
379
+ name: "Support Group",
380
+ form: CONSTANTS.FORM_SUPPORTGROUP
381
+ },
382
+ {
383
+ type: "person",
384
+ path: "/v1/persons",
385
+ name: "Person",
386
+ form: CONSTANTS.FORM_PEOPLE
387
+ }
388
+ ];
389
+
390
+ for (let x=0; x<foundationKeys.length; x++) {
391
+ const key = foundationKeys[x]
392
+ const orgConfig = clientConfig[key.type];
393
+ if (orgConfig) {
394
+ if (orgConfig.fields && orgConfig.fields.length > 0) {
395
+ const mapping = getDeprecatedMappingAsCustom(key.type);
396
+ schemas[key.type] = await getObjectSchema(orgConfig.fields, mapping, key.form);
397
+ paths = {...paths, ...await getPathDef(key.name, key.path, key.type, false, true, true)}
398
+ }
399
+ }
400
+ }
401
+
379
402
 
380
403
  //generate docs for custom Forms
381
404
  const customFormMappings = await getCustomFormMapping()
@@ -681,7 +704,7 @@ const ticketConfig = {
681
704
  "requestIdField": "Sys-Problem Investigation ID",
682
705
  "requestType": "problem",
683
706
  "ticketIdField": "Problem Investigation ID",
684
- businessServiceReconIdField: "ServiceCI_ReconID",
707
+ "businessServiceReconIdField": "ServiceCI_ReconID",
685
708
  "requestTypeWorkLog": "problemWorklog",
686
709
  "requestTemplate": "problemTemplate",
687
710
  "baseURI": "/v1/problems",