@itentialopensource/adapter-servicenow 2.6.1 → 2.6.2

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/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ ## 2.6.2 [09-11-2023]
3
+
4
+ * more meta changes
5
+
6
+ See merge request itentialopensource/adapters/itsm-testing/adapter-servicenow!25
7
+
8
+ ---
9
+
2
10
  ## 2.6.1 [09-05-2023]
3
11
 
4
12
  * metadata changes
package/adapterBase.js CHANGED
@@ -1027,6 +1027,24 @@ class AdapterBase extends EventEmitterCl {
1027
1027
  return this.requestHandlerInst.hasEntities(entityType, entityList, callback);
1028
1028
  }
1029
1029
 
1030
+ /**
1031
+ * @summary Determines if this adapter supports any in a list of entities
1032
+ *
1033
+ * @function hasEntitiesAuth
1034
+ * @param {String} entityType - the entity type to check for
1035
+ * @param {Array} entityList - the list of entities we are looking for
1036
+ * @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
1037
+ *
1038
+ * @param {Callback} callback - A map where the entity is the key and the
1039
+ * value is true or false
1040
+ */
1041
+ hasEntitiesAuth(entityType, entityList, callOptions, callback) {
1042
+ const origin = `${this.id}-adapterBase-hasEntitiesAuth`;
1043
+ log.trace(origin);
1044
+
1045
+ return this.requestHandlerInst.hasEntitiesAuth(entityType, entityList, callOptions, callback);
1046
+ }
1047
+
1030
1048
  /**
1031
1049
  * @summary Get Appliance that match the deviceName
1032
1050
  *
@@ -1043,6 +1061,23 @@ class AdapterBase extends EventEmitterCl {
1043
1061
  return this.requestHandlerInst.getDevice(deviceName, callback);
1044
1062
  }
1045
1063
 
1064
+ /**
1065
+ * @summary Get Appliance that match the deviceName
1066
+ *
1067
+ * @function getDeviceAuth
1068
+ * @param {String} deviceName - the deviceName to find (required)
1069
+ * @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
1070
+ *
1071
+ * @param {getCallback} callback - a callback function to return the result
1072
+ * (appliance) or the error
1073
+ */
1074
+ getDeviceAuth(deviceName, callOptions, callback) {
1075
+ const origin = `${this.id}-adapterBase-getDeviceAuth`;
1076
+ log.trace(origin);
1077
+
1078
+ return this.requestHandlerInst.getDeviceAuth(deviceName, callOptions, callback);
1079
+ }
1080
+
1046
1081
  /**
1047
1082
  * @summary Get Appliances that match the filter
1048
1083
  *
@@ -1059,6 +1094,23 @@ class AdapterBase extends EventEmitterCl {
1059
1094
  return this.requestHandlerInst.getDevicesFiltered(options, callback);
1060
1095
  }
1061
1096
 
1097
+ /**
1098
+ * @summary Get Appliances that match the filter
1099
+ *
1100
+ * @function getDevicesFilteredAuth
1101
+ * @param {Object} options - the data to use to filter the appliances (optional)
1102
+ * @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
1103
+ *
1104
+ * @param {getCallback} callback - a callback function to return the result
1105
+ * (appliances) or the error
1106
+ */
1107
+ getDevicesFilteredAuth(options, callOptions, callback) {
1108
+ const origin = `${this.id}-adapterBase-getDevicesFilteredAuth`;
1109
+ log.trace(origin);
1110
+
1111
+ return this.requestHandlerInst.getDevicesFilteredAuth(options, callOptions, callback);
1112
+ }
1113
+
1062
1114
  /**
1063
1115
  * @summary Gets the status for the provided appliance
1064
1116
  *
@@ -1075,6 +1127,23 @@ class AdapterBase extends EventEmitterCl {
1075
1127
  return this.requestHandlerInst.isAlive(deviceName, callback);
1076
1128
  }
1077
1129
 
1130
+ /**
1131
+ * @summary Gets the status for the provided appliance
1132
+ *
1133
+ * @function isAliveAuth
1134
+ * @param {String} deviceName - the deviceName of the appliance. (required)
1135
+ * @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
1136
+ *
1137
+ * @param {configCallback} callback - callback function to return the result
1138
+ * (appliance isAliveAuth) or the error
1139
+ */
1140
+ isAliveAuth(deviceName, callOptions, callback) {
1141
+ const origin = `${this.id}-adapterBase-isAliveAuth`;
1142
+ log.trace(origin);
1143
+
1144
+ return this.requestHandlerInst.isAliveAuth(deviceName, callOptions, callback);
1145
+ }
1146
+
1078
1147
  /**
1079
1148
  * @summary Gets a config for the provided Appliance
1080
1149
  *
@@ -1092,6 +1161,24 @@ class AdapterBase extends EventEmitterCl {
1092
1161
  return this.requestHandlerInst.getConfig(deviceName, format, callback);
1093
1162
  }
1094
1163
 
1164
+ /**
1165
+ * @summary Gets a config for the provided Appliance
1166
+ *
1167
+ * @function getConfigAuth
1168
+ * @param {String} deviceName - the deviceName of the appliance. (required)
1169
+ * @param {String} format - the desired format of the config. (optional)
1170
+ * @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
1171
+ *
1172
+ * @param {configCallback} callback - callback function to return the result
1173
+ * (appliance config) or the error
1174
+ */
1175
+ getConfigAuth(deviceName, format, callOptions, callback) {
1176
+ const origin = `${this.id}-adapterBase-getConfigAuth`;
1177
+ log.trace(origin);
1178
+
1179
+ return this.requestHandlerInst.getConfigAuth(deviceName, format, callOptions, callback);
1180
+ }
1181
+
1095
1182
  /**
1096
1183
  * @summary Gets the device count from the system
1097
1184
  *
@@ -1107,6 +1194,22 @@ class AdapterBase extends EventEmitterCl {
1107
1194
  return this.requestHandlerInst.iapGetDeviceCount(callback);
1108
1195
  }
1109
1196
 
1197
+ /**
1198
+ * @summary Gets the device count from the system
1199
+ *
1200
+ * @function iapGetDeviceCountAuth
1201
+ * @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
1202
+ *
1203
+ * @param {getCallback} callback - callback function to return the result
1204
+ * (count) or the error
1205
+ */
1206
+ iapGetDeviceCountAuth(callOptions, callback) {
1207
+ const origin = `${this.id}-adapterBase-iapGetDeviceCountAuth`;
1208
+ log.trace(origin);
1209
+
1210
+ return this.requestHandlerInst.iapGetDeviceCountAuth(callOptions, callback);
1211
+ }
1212
+
1110
1213
  /* ********************************************** */
1111
1214
  /* */
1112
1215
  /* EXPOSES GENERIC HANDLER */
package/metadata.json CHANGED
@@ -32,14 +32,13 @@
32
32
  "type": "Adapter",
33
33
  "domains": [
34
34
  "Inventory",
35
- "Discovery",
35
+ "Discovery & Topology",
36
36
  "ITSM"
37
37
  ],
38
38
  "tags": [
39
39
  "Change Management",
40
- "ITSM",
41
40
  "Incidents",
42
- "Request"
41
+ "Service Request"
43
42
  ],
44
43
  "useCases": [
45
44
  "Create Change Management Request",
@@ -98,6 +97,7 @@
98
97
  "name": "ServiceNow - Now Platform - REST",
99
98
  "webName": "Project with workflows for the Now Platform from ServiceNow",
100
99
  "overview": "Project with workflows for the Now Platform from ServiceNow",
100
+ "isDependency": false,
101
101
  "versions": [
102
102
  "^0.0.5"
103
103
  ],
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-servicenow",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "This adapter integrates with system described as: servicenowMadrid.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "ServiceNow",
7
7
  "wizardVersion": "2.44.7",
8
- "engineVersion": "1.67.5",
8
+ "engineVersion": "1.67.7",
9
9
  "adapterType": "http",
10
10
  "scripts": {
11
11
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -55,12 +55,12 @@
55
55
  "author": "Itential",
56
56
  "homepage": "https://gitlab.com/itentialopensource/adapters/itsm-testing/adapter-servicenow#readme",
57
57
  "dependencies": {
58
- "@itentialopensource/adapter-utils": "^5.1.0",
58
+ "@itentialopensource/adapter-utils": "^5.1.7",
59
+ "acorn": "^8.10.0",
59
60
  "ajv": "^8.12.0",
60
61
  "axios": "^1.4.0",
61
62
  "commander": "^11.0.0",
62
63
  "dns-lookup-promise": "^1.0.4",
63
- "esprima": "^4.0.1",
64
64
  "fs-extra": "^11.1.1",
65
65
  "json-query": "^2.2.2",
66
66
  "mocha": "^10.2.0",
@@ -1063,6 +1063,38 @@
1063
1063
  "description": "The method of the call to getDevicesFiltered",
1064
1064
  "default": "GET"
1065
1065
  },
1066
+ "pagination": {
1067
+ "type": "object",
1068
+ "description": "todo",
1069
+ "properties": {
1070
+ "offsetVar": {
1071
+ "type": "string",
1072
+ "description": "Name of variable that defines how to go to next set of results"
1073
+ },
1074
+ "limitVar": {
1075
+ "type": "string",
1076
+ "description": "Name of variable that defines the max results returned in a request"
1077
+ },
1078
+ "incrementBy": {
1079
+ "type": "string",
1080
+ "enum": [
1081
+ "limit",
1082
+ "page"
1083
+ ],
1084
+ "description": "How to incremenet offset. Default limit",
1085
+ "default": "limit"
1086
+ },
1087
+ "requestLocation": {
1088
+ "type": "string",
1089
+ "enum": [
1090
+ "query",
1091
+ "body"
1092
+ ],
1093
+ "description": "Where in request the pagination data goes",
1094
+ "default": "query"
1095
+ }
1096
+ }
1097
+ },
1066
1098
  "query": {
1067
1099
  "type": "object",
1068
1100
  "description": "The json object with query parameters of the call to getDevicesFiltered",
@@ -1487,6 +1519,38 @@
1487
1519
  "description": "The method of the call to getDevice",
1488
1520
  "default": "GET"
1489
1521
  },
1522
+ "pagination": {
1523
+ "type": "object",
1524
+ "description": "todo",
1525
+ "properties": {
1526
+ "offsetVar": {
1527
+ "type": "string",
1528
+ "description": "Name of variable that defines how to go to next set of results"
1529
+ },
1530
+ "limitVar": {
1531
+ "type": "string",
1532
+ "description": "Name of variable that defines the max results returned in a request"
1533
+ },
1534
+ "incrementBy": {
1535
+ "type": "string",
1536
+ "enum": [
1537
+ "limit",
1538
+ "page"
1539
+ ],
1540
+ "description": "How to incremenet offset. Default limit",
1541
+ "default": "limit"
1542
+ },
1543
+ "requestLocation": {
1544
+ "type": "string",
1545
+ "enum": [
1546
+ "query",
1547
+ "body"
1548
+ ],
1549
+ "description": "Where in request the pagination data goes",
1550
+ "default": "query"
1551
+ }
1552
+ }
1553
+ },
1490
1554
  "query": {
1491
1555
  "type": "object",
1492
1556
  "description": "The json object with query parameters of the call to getDevice",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "2.6.0",
3
- "configLines": 8328,
2
+ "version": "2.6.1",
3
+ "configLines": 8392,
4
4
  "scriptLines": 1783,
5
- "codeLines": 12818,
6
- "testLines": 11854,
5
+ "codeLines": 12921,
6
+ "testLines": 11859,
7
7
  "testCases": 613,
8
- "totalCodeLines": 26455,
8
+ "totalCodeLines": 26563,
9
9
  "wfTasks": 165
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 17
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.1.7"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 76
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 347
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 6378
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 395
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 4229
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 148
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 12060
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 543
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -142,6 +142,12 @@
142
142
  {
143
143
  "path": "/get/devices",
144
144
  "method": "GET",
145
+ "pagination": {
146
+ "offsetVar": "",
147
+ "limitVar": "",
148
+ "incrementBy": "limit",
149
+ "requestLocation": "query"
150
+ },
145
151
  "query": {},
146
152
  "body": {},
147
153
  "headers": {},
@@ -218,6 +224,12 @@
218
224
  {
219
225
  "path": "",
220
226
  "method": "GET",
227
+ "pagination": {
228
+ "offsetVar": "",
229
+ "limitVar": "",
230
+ "incrementBy": "limit",
231
+ "requestLocation": "query"
232
+ },
221
233
  "query": {},
222
234
  "body": {},
223
235
  "headers": {},
@@ -391,12 +391,12 @@ describe('[unit] Adapter Base Test', () => {
391
391
  });
392
392
  it('should return a list of functions', (done) => {
393
393
  const returnedFunctions = ['checkActionFiles', 'checkProperties', 'connect', 'encryptProperty', 'genericAdapterRequest', 'genericAdapterRequestNoBasePath',
394
- 'getAllFunctions', 'getConfig', 'getDevice', 'getDevicesFiltered', 'hasEntities', 'healthCheck', 'iapActivateTasks', 'iapDeactivateTasks',
395
- 'iapExpandedGenericAdapterRequest', 'iapFindAdapterPath', 'iapGetAdapterInventory', 'iapGetAdapterQueue', 'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount',
396
- 'iapMoveAdapterEntitiesToDB', 'iapPopulateEntityCache', 'iapRetrieveEntitiesCache', 'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck',
397
- 'iapRunAdapterLint', 'iapRunAdapterTests', 'iapSuspendAdapter', 'iapTroubleshootAdapter', 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration',
398
- 'isAlive', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'off', 'on', 'once',
399
- 'prependListener', 'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
394
+ 'getAllFunctions', 'getConfig', 'getConfigAuth', 'getDevice', 'getDeviceAuth', 'getDevicesFiltered', 'getDevicesFilteredAuth', 'hasEntities', 'hasEntitiesAuth',
395
+ 'healthCheck', 'iapActivateTasks', 'iapDeactivateTasks', 'iapExpandedGenericAdapterRequest', 'iapFindAdapterPath', 'iapGetAdapterInventory', 'iapGetAdapterQueue',
396
+ 'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount', 'iapGetDeviceCountAuth', 'iapMoveAdapterEntitiesToDB', 'iapPopulateEntityCache', 'iapRetrieveEntitiesCache',
397
+ 'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapRunAdapterLint', 'iapRunAdapterTests', 'iapSuspendAdapter', 'iapTroubleshootAdapter',
398
+ 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'isAliveAuth', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners',
399
+ 'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener', 'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
400
400
  try {
401
401
  const expectedFunctions = a.getAllFunctions();
402
402
  try {
@@ -887,6 +887,8 @@ describe('[unit] Servicenow Adapter Test', () => {
887
887
  assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
888
888
  assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
889
889
  assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
890
+ assert.notEqual(undefined, sampleDotJson.properties.cache);
891
+ assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
890
892
  done();
891
893
  } catch (error) {
892
894
  log.error(`Test Failure: ${error}`);
@@ -1453,6 +1455,9 @@ describe('[unit] Servicenow Adapter Test', () => {
1453
1455
  try {
1454
1456
  const metadataDotJson = require('../../metadata.json');
1455
1457
  assert.equal('adapter-servicenow', metadataDotJson.name);
1458
+ assert.notEqual(undefined, metadataDotJson.webName);
1459
+ assert.notEqual(null, metadataDotJson.webName);
1460
+ assert.notEqual('', metadataDotJson.webName);
1456
1461
  assert.equal('Adapter', metadataDotJson.type);
1457
1462
  done();
1458
1463
  } catch (error) {
@@ -3,7 +3,7 @@
3
3
  /* eslint no-param-reassign:warn */
4
4
 
5
5
  const fs = require('fs-extra');
6
- const esprima = require('esprima');
6
+ const acorn = require('acorn');
7
7
 
8
8
  // Getting the base directory:
9
9
  let adaptdir = __dirname;
@@ -44,18 +44,38 @@ function getPathFromEntity(entity, funcName) {
44
44
  const actionJSON = require(entityPath);
45
45
  actionJSON.actions.forEach((action) => {
46
46
  if (action.name === funcName) {
47
- epath = action.entitypath;
47
+ if (typeof action.entitypath === 'object') {
48
+ epath = '';
49
+ const keys = Object.keys(action.entitypath);
50
+ for (let k = 0; k < keys.length; k += 1) {
51
+ epath += `${keys[k]}:${action.entitypath[keys[k]]} <br /> `;
52
+ }
53
+ epath = epath.substring(0, epath.length - 8);
54
+ } else {
55
+ epath = action.entitypath;
56
+ }
48
57
  }
49
58
  });
50
59
  }
51
60
  return epath;
52
61
  }
53
62
 
63
+ function recurseCallExpressions(statement, callList) {
64
+ // Recursively finds all CallExpressions in the syntax tree
65
+ if (statement.type === 'CallExpression') callList.push(statement);
66
+ const keys = Object.keys(statement);
67
+ for (let k = 0; k < keys.length; k += 1) {
68
+ if (typeof statement[keys[k]] === 'object' && statement[keys[k]] !== null) {
69
+ recurseCallExpressions(statement[keys[k]], callList);
70
+ }
71
+ }
72
+ }
73
+
54
74
  function readFileUsingLib(filename, descriptionObj, workflowObj, functionList) {
55
75
  // read the file
56
76
  const aFile = fs.readFileSync(filename, 'utf8');
57
77
  // parsing the file to get the function and class declarations.
58
- const aFileFuncArgs = esprima.parseScript(aFile);
78
+ const aFileFuncArgs = acorn.parse(aFile, { ecmaVersion: 2020 });
59
79
 
60
80
  // Looping through all the declarations parsed:
61
81
  aFileFuncArgs.body.forEach((e) => {
@@ -76,25 +96,40 @@ function readFileUsingLib(filename, descriptionObj, workflowObj, functionList) {
76
96
  });
77
97
 
78
98
  // Getting the entity for the method:
79
- let entity;
80
- method.value.body.body.forEach((statementType) => {
81
- if (statementType.type === 'TryStatement') {
82
- entity = statementType.block.body[0].argument.arguments[0].value;
83
- }
99
+ const callList = [];
100
+ method.value.body.body.forEach((statement) => {
101
+ recurseCallExpressions(statement, callList);
84
102
  });
85
- const entityPath = getPathFromEntity(entity, funcName);
86
-
87
- // Creating and storing the object for the method.
88
- if (entityPath !== undefined) {
89
- functionList.push(
90
- createObjectForFunction(
91
- funcName,
92
- funcArgs,
93
- entityPath,
94
- descriptionObj[funcName],
95
- workflowObj[funcName]
96
- )
97
- );
103
+ const requests = [];
104
+ for (let i = 0; i < callList.length; i += 1) {
105
+ if (callList[i].callee.property && callList[i].callee.property.name === 'identifyRequest') {
106
+ requests.push(callList[i]);
107
+ }
108
+ }
109
+ if (requests.length > 0) {
110
+ const expr = requests[0];
111
+ if (expr.arguments.length < 2) {
112
+ throw new Error(`Bad inputs in method ${funcName}`);
113
+ }
114
+ const entity = expr.arguments[0].value;
115
+ const actionName = expr.arguments[1].value;
116
+ if (expr !== undefined && (expr.arguments[0].type !== 'Literal' || expr.arguments[1].type !== 'Literal')) {
117
+ throw new Error(`Bad inputs in method ${funcName}`);
118
+ }
119
+ const entityPath = getPathFromEntity(entity, actionName);
120
+
121
+ // Creating and storing the object for the method.
122
+ if (entityPath !== undefined) {
123
+ functionList.push(
124
+ createObjectForFunction(
125
+ funcName,
126
+ funcArgs,
127
+ entityPath,
128
+ descriptionObj[funcName],
129
+ workflowObj[funcName]
130
+ )
131
+ );
132
+ }
98
133
  }
99
134
  });
100
135
  }
@@ -109,7 +144,7 @@ function readJSONFile(filename, descriptionObj, workflowObj) {
109
144
  methodArray.forEach((methodName) => {
110
145
  // Getting the method description and workflow:
111
146
  const funcName = methodName.name;
112
- descriptionObj[funcName] = methodName.description;
147
+ descriptionObj[funcName] = methodName.summary ? methodName.summary : methodName.description;
113
148
  workflowObj[funcName] = methodName.task ? 'Yes' : 'No';
114
149
  });
115
150
  }