@itentialopensource/adapter-salesforce 0.7.4 → 0.9.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.
Files changed (60) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +454 -0
  4. package/CHANGELOG.md +49 -29
  5. package/CODE_OF_CONDUCT.md +12 -17
  6. package/CONTRIBUTING.md +3 -148
  7. package/ENHANCE.md +69 -0
  8. package/PROPERTIES.md +641 -0
  9. package/README.md +239 -507
  10. package/SUMMARY.md +9 -0
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +423 -304
  14. package/adapterBase.js +854 -408
  15. package/changelogs/changelog.md +94 -0
  16. package/entities/.generic/action.json +110 -5
  17. package/entities/.generic/schema.json +6 -1
  18. package/entities/.system/action.json +4 -4
  19. package/entities/.system/schemaTokenReq.json +33 -4
  20. package/entities/.system/schemaTokenResp.json +1 -34
  21. package/error.json +12 -0
  22. package/metadata.json +49 -0
  23. package/package.json +28 -22
  24. package/pronghorn.json +691 -88
  25. package/propertiesDecorators.json +14 -0
  26. package/propertiesSchema.json +842 -6
  27. package/refs?service=git-upload-pack +0 -0
  28. package/report/adapter-openapi.json +1543 -0
  29. package/report/adapter-openapi.yaml +1201 -0
  30. package/report/adapterInfo.json +10 -0
  31. package/report/updateReport1653403992147.json +120 -0
  32. package/report/updateReport1691511372644.json +120 -0
  33. package/report/updateReport1692202876451.json +120 -0
  34. package/report/updateReport1694464610053.json +120 -0
  35. package/report/updateReport1698421735618.json +120 -0
  36. package/sampleProperties.json +156 -3
  37. package/test/integration/adapterTestBasicGet.js +4 -6
  38. package/test/integration/adapterTestConnectivity.js +91 -42
  39. package/test/integration/adapterTestIntegration.js +158 -104
  40. package/test/unit/adapterBaseTestUnit.js +393 -310
  41. package/test/unit/adapterTestUnit.js +833 -209
  42. package/utils/adapterInfo.js +206 -0
  43. package/utils/addAuth.js +94 -0
  44. package/utils/artifactize.js +1 -1
  45. package/utils/basicGet.js +1 -14
  46. package/utils/checkMigrate.js +1 -1
  47. package/utils/entitiesToDB.js +179 -0
  48. package/utils/findPath.js +1 -1
  49. package/utils/methodDocumentor.js +273 -0
  50. package/utils/modify.js +14 -16
  51. package/utils/packModificationScript.js +2 -2
  52. package/utils/patches2bundledDeps.js +90 -0
  53. package/utils/pre-commit.sh +5 -0
  54. package/utils/removeHooks.js +20 -0
  55. package/utils/taskMover.js +309 -0
  56. package/utils/tbScript.js +129 -53
  57. package/utils/tbUtils.js +152 -35
  58. package/utils/testRunner.js +17 -17
  59. package/utils/troubleshootingAdapter.js +10 -31
  60. package/workflows/README.md +0 -3
package/adapter.js CHANGED
@@ -82,10 +82,15 @@ class Salesforce extends AdapterBaseCl {
82
82
  }
83
83
 
84
84
  /**
85
- * @getWorkflowFunctions
85
+ * @iapGetAdapterWorkflowFunctions
86
86
  */
87
- getWorkflowFunctions(inIgnore) {
88
- let myIgnore = [];
87
+ iapGetAdapterWorkflowFunctions(inIgnore) {
88
+ let myIgnore = [
89
+ 'healthCheck',
90
+ 'iapGetAdapterWorkflowFunctions',
91
+ 'hasEntities',
92
+ 'getAuthorization'
93
+ ];
89
94
  if (!inIgnore && Array.isArray(inIgnore)) {
90
95
  myIgnore = inIgnore;
91
96
  } else if (!inIgnore && typeof inIgnore === 'string') {
@@ -96,52 +101,44 @@ class Salesforce extends AdapterBaseCl {
96
101
  // you can add specific methods that you do not want to be workflow functions to ignore like below
97
102
  // myIgnore.push('myMethodNotInWorkflow');
98
103
 
99
- return super.getWorkflowFunctions(myIgnore);
104
+ return super.iapGetAdapterWorkflowFunctions(myIgnore);
100
105
  }
101
106
 
102
107
  /**
103
- * updateAdapterConfiguration is used to update any of the adapter configuration files. This
108
+ * iapUpdateAdapterConfiguration is used to update any of the adapter configuration files. This
104
109
  * allows customers to make changes to adapter configuration without having to be on the
105
110
  * file system.
106
111
  *
107
- * @function updateAdapterConfiguration
112
+ * @function iapUpdateAdapterConfiguration
108
113
  * @param {string} configFile - the name of the file being updated (required)
109
114
  * @param {Object} changes - an object containing all of the changes = formatted like the configuration file (required)
110
115
  * @param {string} entity - the entity to be changed, if an action, schema or mock data file (optional)
111
116
  * @param {string} type - the type of entity file to change, (action, schema, mock) (optional)
112
117
  * @param {string} action - the action to be changed, if an action, schema or mock data file (optional)
118
+ * @param {boolean} replace - true to replace entire mock data, false to merge/append
113
119
  * @param {Callback} callback - The results of the call
114
120
  */
115
- updateAdapterConfiguration(configFile, changes, entity, type, action, callback) {
116
- const origin = `${this.id}-adapter-updateAdapterConfiguration`;
121
+ iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, replace, callback) {
122
+ const meth = 'adapter-iapUpdateAdapterConfiguration';
123
+ const origin = `${this.id}-${meth}`;
117
124
  log.trace(origin);
118
- super.updateAdapterConfiguration(configFile, changes, entity, type, action, callback);
119
- }
120
125
 
121
- /**
122
- * See if the API path provided is found in this adapter
123
- *
124
- * @function findPath
125
- * @param {string} apiPath - the api path to check on
126
- * @param {Callback} callback - The results of the call
127
- */
128
- findPath(apiPath, callback) {
129
- const origin = `${this.id}-adapter-findPath`;
130
- log.trace(origin);
131
- super.findPath(apiPath, callback);
126
+ super.iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, replace, callback);
132
127
  }
133
128
 
134
129
  /**
135
130
  * @summary Suspends adapter
136
131
  *
137
- * @function suspend
132
+ * @function iapSuspendAdapter
138
133
  * @param {Callback} callback - callback function
139
134
  */
140
- suspend(mode, callback) {
141
- const origin = `${this.id}-adapter-suspend`;
135
+ iapSuspendAdapter(mode, callback) {
136
+ const meth = 'adapter-iapSuspendAdapter';
137
+ const origin = `${this.id}-${meth}`;
142
138
  log.trace(origin);
139
+
143
140
  try {
144
- return super.suspend(mode, callback);
141
+ return super.iapSuspendAdapter(mode, callback);
145
142
  } catch (error) {
146
143
  log.error(`${origin}: ${error}`);
147
144
  return callback(null, error);
@@ -151,14 +148,16 @@ class Salesforce extends AdapterBaseCl {
151
148
  /**
152
149
  * @summary Unsuspends adapter
153
150
  *
154
- * @function unsuspend
151
+ * @function iapUnsuspendAdapter
155
152
  * @param {Callback} callback - callback function
156
153
  */
157
- unsuspend(callback) {
158
- const origin = `${this.id}-adapter-unsuspend`;
154
+ iapUnsuspendAdapter(callback) {
155
+ const meth = 'adapter-iapUnsuspendAdapter';
156
+ const origin = `${this.id}-${meth}`;
159
157
  log.trace(origin);
158
+
160
159
  try {
161
- return super.unsuspend(callback);
160
+ return super.iapUnsuspendAdapter(callback);
162
161
  } catch (error) {
163
162
  log.error(`${origin}: ${error}`);
164
163
  return callback(null, error);
@@ -166,31 +165,51 @@ class Salesforce extends AdapterBaseCl {
166
165
  }
167
166
 
168
167
  /**
169
- * @summary Get the Adaoter Queue
168
+ * @summary Get the Adapter Queue
170
169
  *
171
- * @function getQueue
170
+ * @function iapGetAdapterQueue
172
171
  * @param {Callback} callback - callback function
173
172
  */
174
- getQueue(callback) {
175
- const origin = `${this.id}-adapter-getQueue`;
173
+ iapGetAdapterQueue(callback) {
174
+ const meth = 'adapter-iapGetAdapterQueue';
175
+ const origin = `${this.id}-${meth}`;
176
176
  log.trace(origin);
177
- return super.getQueue(callback);
177
+
178
+ return super.iapGetAdapterQueue(callback);
179
+ }
180
+
181
+ /* SCRIPT CALLS */
182
+ /**
183
+ * See if the API path provided is found in this adapter
184
+ *
185
+ * @function iapFindAdapterPath
186
+ * @param {string} apiPath - the api path to check on
187
+ * @param {Callback} callback - The results of the call
188
+ */
189
+ iapFindAdapterPath(apiPath, callback) {
190
+ const meth = 'adapter-iapFindAdapterPath';
191
+ const origin = `${this.id}-${meth}`;
192
+ log.trace(origin);
193
+
194
+ super.iapFindAdapterPath(apiPath, callback);
178
195
  }
179
196
 
180
197
  /**
181
198
  * @summary Runs troubleshoot scripts for adapter
182
199
  *
183
- * @function troubleshoot
200
+ * @function iapTroubleshootAdapter
184
201
  * @param {Object} props - the connection, healthcheck and authentication properties
185
202
  *
186
203
  * @param {boolean} persistFlag - whether the adapter properties should be updated
187
204
  * @param {Callback} callback - The results of the call
188
205
  */
189
- troubleshoot(props, persistFlag, callback) {
190
- const origin = `${this.id}-adapter-troubleshoot`;
206
+ iapTroubleshootAdapter(props, persistFlag, callback) {
207
+ const meth = 'adapter-iapTroubleshootAdapter';
208
+ const origin = `${this.id}-${meth}`;
191
209
  log.trace(origin);
210
+
192
211
  try {
193
- return super.troubleshoot(props, persistFlag, this, callback);
212
+ return super.iapTroubleshootAdapter(props, persistFlag, this, callback);
194
213
  } catch (error) {
195
214
  log.error(`${origin}: ${error}`);
196
215
  return callback(null, error);
@@ -200,15 +219,17 @@ class Salesforce extends AdapterBaseCl {
200
219
  /**
201
220
  * @summary runs healthcheck script for adapter
202
221
  *
203
- * @function runHealthcheck
222
+ * @function iapRunAdapterHealthcheck
204
223
  * @param {Adapter} adapter - adapter instance to troubleshoot
205
224
  * @param {Callback} callback - callback function
206
225
  */
207
- runHealthcheck(callback) {
208
- const origin = `${this.id}-adapter-runHealthcheck`;
226
+ iapRunAdapterHealthcheck(callback) {
227
+ const meth = 'adapter-iapRunAdapterHealthcheck';
228
+ const origin = `${this.id}-${meth}`;
209
229
  log.trace(origin);
230
+
210
231
  try {
211
- return super.runHealthcheck(this, callback);
232
+ return super.iapRunAdapterHealthcheck(this, callback);
212
233
  } catch (error) {
213
234
  log.error(`${origin}: ${error}`);
214
235
  return callback(null, error);
@@ -218,14 +239,16 @@ class Salesforce extends AdapterBaseCl {
218
239
  /**
219
240
  * @summary runs connectivity check script for adapter
220
241
  *
221
- * @function runConnectivity
242
+ * @function iapRunAdapterConnectivity
222
243
  * @param {Callback} callback - callback function
223
244
  */
224
- runConnectivity(callback) {
225
- const origin = `${this.id}-adapter-runConnectivity`;
245
+ iapRunAdapterConnectivity(callback) {
246
+ const meth = 'adapter-iapRunAdapterConnectivity';
247
+ const origin = `${this.id}-${meth}`;
226
248
  log.trace(origin);
249
+
227
250
  try {
228
- return super.runConnectivity(callback);
251
+ return super.iapRunAdapterConnectivity(callback);
229
252
  } catch (error) {
230
253
  log.error(`${origin}: ${error}`);
231
254
  return callback(null, error);
@@ -235,14 +258,16 @@ class Salesforce extends AdapterBaseCl {
235
258
  /**
236
259
  * @summary runs basicGet script for adapter
237
260
  *
238
- * @function runBasicGet
261
+ * @function iapRunAdapterBasicGet
239
262
  * @param {Callback} callback - callback function
240
263
  */
241
- runBasicGet(callback) {
242
- const origin = `${this.id}-adapter-runBasicGet`;
264
+ iapRunAdapterBasicGet(callback) {
265
+ const meth = 'adapter-iapRunAdapterBasicGet';
266
+ const origin = `${this.id}-${meth}`;
243
267
  log.trace(origin);
268
+
244
269
  try {
245
- return super.runBasicGet(callback);
270
+ return super.iapRunAdapterBasicGet(callback);
246
271
  } catch (error) {
247
272
  log.error(`${origin}: ${error}`);
248
273
  return callback(null, error);
@@ -250,171 +275,275 @@ class Salesforce extends AdapterBaseCl {
250
275
  }
251
276
 
252
277
  /**
253
- * @summary Determines if this adapter supports the specific entity
278
+ * @summary moves entites into Mongo DB
254
279
  *
255
- * @function hasEntity
256
- * @param {String} entityType - the entity type to check for
257
- * @param {String/Array} entityId - the specific entity we are looking for
280
+ * @function iapMoveAdapterEntitiesToDB
281
+ * @param {getCallback} callback - a callback function to return the result (Generics)
282
+ * or the error
283
+ */
284
+ iapMoveAdapterEntitiesToDB(callback) {
285
+ const meth = 'adapter-iapMoveAdapterEntitiesToDB';
286
+ const origin = `${this.id}-${meth}`;
287
+ log.trace(origin);
288
+
289
+ try {
290
+ return super.iapMoveAdapterEntitiesToDB(callback);
291
+ } catch (err) {
292
+ log.error(`${origin}: ${err}`);
293
+ return callback(null, err);
294
+ }
295
+ }
296
+
297
+ /**
298
+ * @summary Deactivate adapter tasks
299
+ *
300
+ * @function iapDeactivateTasks
258
301
  *
259
- * @param {Callback} callback - An array of whether the adapter can has the
260
- * desired capability or an error
302
+ * @param {Array} tasks - List of tasks to deactivate
303
+ * @param {Callback} callback
261
304
  */
262
- hasEntity(entityType, entityId, callback) {
263
- const origin = `${this.id}-adapter-hasEntity`;
305
+ iapDeactivateTasks(tasks, callback) {
306
+ const meth = 'adapter-iapDeactivateTasks';
307
+ const origin = `${this.id}-${meth}`;
264
308
  log.trace(origin);
265
309
 
266
- // Make the call -
267
- // verifyCapability(entityType, actionType, entityId, callback)
268
- return this.verifyCapability(entityType, null, entityId, callback);
310
+ try {
311
+ return super.iapDeactivateTasks(tasks, callback);
312
+ } catch (err) {
313
+ log.error(`${origin}: ${err}`);
314
+ return callback(null, err);
315
+ }
269
316
  }
270
317
 
271
318
  /**
272
- * @summary Provides a way for the adapter to tell north bound integrations
273
- * whether the adapter supports type, action and specific entity
319
+ * @summary Activate adapter tasks that have previously been deactivated
320
+ *
321
+ * @function iapActivateTasks
322
+ *
323
+ * @param {Array} tasks - List of tasks to activate
324
+ * @param {Callback} callback
325
+ */
326
+ iapActivateTasks(tasks, callback) {
327
+ const meth = 'adapter-iapActivateTasks';
328
+ const origin = `${this.id}-${meth}`;
329
+ log.trace(origin);
330
+
331
+ try {
332
+ return super.iapActivateTasks(tasks, callback);
333
+ } catch (err) {
334
+ log.error(`${origin}: ${err}`);
335
+ return callback(null, err);
336
+ }
337
+ }
338
+
339
+ /* CACHE CALLS */
340
+ /**
341
+ * @summary Populate the cache for the given entities
342
+ *
343
+ * @function iapPopulateEntityCache
344
+ * @param {String/Array of Strings} entityType - the entity type(s) to populate
345
+ * @param {Callback} callback - whether the cache was updated or not for each entity type
274
346
  *
275
- * @function verifyCapability
347
+ * @returns status of the populate
348
+ */
349
+ iapPopulateEntityCache(entityTypes, callback) {
350
+ const meth = 'adapter-iapPopulateEntityCache';
351
+ const origin = `${this.id}-${meth}`;
352
+ log.trace(origin);
353
+
354
+ try {
355
+ return super.iapPopulateEntityCache(entityTypes, callback);
356
+ } catch (err) {
357
+ log.error(`${origin}: ${err}`);
358
+ return callback(null, err);
359
+ }
360
+ }
361
+
362
+ /**
363
+ * @summary Retrieves data from cache for specified entity type
364
+ *
365
+ * @function iapRetrieveEntitiesCache
366
+ * @param {String} entityType - entity of which to retrieve
367
+ * @param {Object} options - settings of which data to return and how to return it
368
+ * @param {Callback} callback - the data if it was retrieved
369
+ */
370
+ iapRetrieveEntitiesCache(entityType, options, callback) {
371
+ const meth = 'adapter-iapCheckEiapRetrieveEntitiesCachentityCached';
372
+ const origin = `${this.id}-${meth}`;
373
+ log.trace(origin);
374
+
375
+ try {
376
+ return super.iapRetrieveEntitiesCache(entityType, options, callback);
377
+ } catch (err) {
378
+ log.error(`${origin}: ${err}`);
379
+ return callback(null, err);
380
+ }
381
+ }
382
+
383
+ /* BROKER CALLS */
384
+ /**
385
+ * @summary Determines if this adapter supports any in a list of entities
386
+ *
387
+ * @function hasEntities
276
388
  * @param {String} entityType - the entity type to check for
277
- * @param {String} actionType - the action type to check for
278
- * @param {String/Array} entityId - the specific entity we are looking for
279
- *
280
- * @param {Callback} callback - An array of whether the adapter can has the
281
- * desired capability or an error
282
- */
283
- verifyCapability(entityType, actionType, entityId, callback) {
284
- const meth = 'adapterBase-verifyCapability';
285
- const origin = `${this.id}-${meth}`;
286
- log.trace(origin);
287
-
288
- // if caching
289
- if (this.caching) {
290
- // Make the call - verifyCapability(entityType, actionType, entityId, callback)
291
- return this.requestHandlerInst.verifyCapability(entityType, actionType, entityId, (results, error) => {
292
- if (error) {
293
- return callback(null, error);
294
- }
295
-
296
- // if the cache needs to be updated, update and try again
297
- if (results && results[0] === 'needupdate') {
298
- switch (entityType) {
299
- case 'template_entity': {
300
- // if the cache is invalid, update the cache
301
- return this.getEntities(null, null, null, null, (data, err) => {
302
- if (err) {
303
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Could not update entity: $VARIABLE$, cache', [entityType], null, null, null);
304
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
305
- return callback(null, errorObj);
306
- }
307
-
308
- // need to check the cache again since it has been updated
309
- return this.requestHandlerInst.verifyCapability(entityType, actionType, entityId, (vcapable, verror) => {
310
- if (verror) {
311
- return callback(null, verror);
312
- }
313
-
314
- return this.capabilityResults(vcapable, callback);
315
- });
316
- });
317
- }
318
- default: {
319
- // unsupported entity type
320
- const result = [false];
321
-
322
- // put false in array for all entities
323
- if (Array.isArray(entityId)) {
324
- for (let e = 1; e < entityId.length; e += 1) {
325
- result.push(false);
326
- }
327
- }
328
-
329
- return callback(result);
330
- }
331
- }
332
- }
333
-
334
- // return the results
335
- return this.capabilityResults(results, callback);
336
- });
389
+ * @param {Array} entityList - the list of entities we are looking for
390
+ *
391
+ * @param {Callback} callback - A map where the entity is the key and the
392
+ * value is true or false
393
+ */
394
+ hasEntities(entityType, entityList, callback) {
395
+ const meth = 'adapter-hasEntities';
396
+ const origin = `${this.id}-${meth}`;
397
+ log.trace(origin);
398
+
399
+ try {
400
+ return super.hasEntities(entityType, entityList, callback);
401
+ } catch (err) {
402
+ log.error(`${origin}: ${err}`);
403
+ return callback(null, err);
337
404
  }
405
+ }
338
406
 
339
- // if no entity id
340
- if (!entityId) {
341
- // need to check the cache again since it has been updated
342
- return this.requestHandlerInst.verifyCapability(entityType, actionType, null, (vcapable, verror) => {
343
- if (verror) {
344
- return callback(null, verror);
345
- }
407
+ /**
408
+ * @summary Get Appliance that match the deviceName
409
+ *
410
+ * @function getDevice
411
+ * @param {String} deviceName - the deviceName to find (required)
412
+ *
413
+ * @param {getCallback} callback - a callback function to return the result
414
+ * (appliance) or the error
415
+ */
416
+ getDevice(deviceName, callback) {
417
+ const meth = 'adapter-getDevice';
418
+ const origin = `${this.id}-${meth}`;
419
+ log.trace(origin);
346
420
 
347
- return this.capabilityResults(vcapable, callback);
348
- });
421
+ try {
422
+ return super.getDevice(deviceName, callback);
423
+ } catch (err) {
424
+ log.error(`${origin}: ${err}`);
425
+ return callback(null, err);
349
426
  }
427
+ }
350
428
 
351
- // if not caching
352
- switch (entityType) {
353
- case 'template_entity': {
354
- // need to get the entities to check
355
- return this.getEntities(null, null, null, null, (data, err) => {
356
- if (err) {
357
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Could not update entity: $VARIABLE$, cache', [entityType], null, null, null);
358
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
359
- return callback(null, errorObj);
360
- }
361
-
362
- // need to check the cache again since it has been updated
363
- return this.requestHandlerInst.verifyCapability(entityType, actionType, null, (vcapable, verror) => {
364
- if (verror) {
365
- return callback(null, verror);
366
- }
367
-
368
- // is the entity in the list?
369
- const isEntity = this.entityInList(entityId, data.response, callback);
370
- const res = [];
371
-
372
- // not found
373
- for (let i = 0; i < isEntity.length; i += 1) {
374
- if (vcapable) {
375
- res.push(isEntity[i]);
376
- } else {
377
- res.push(false);
378
- }
379
- }
380
-
381
- return callback(res);
382
- });
383
- });
384
- }
385
- default: {
386
- // unsupported entity type
387
- const result = [false];
429
+ /**
430
+ * @summary Get Appliances that match the filter
431
+ *
432
+ * @function getDevicesFiltered
433
+ * @param {Object} options - the data to use to filter the appliances (optional)
434
+ *
435
+ * @param {getCallback} callback - a callback function to return the result
436
+ * (appliances) or the error
437
+ */
438
+ getDevicesFiltered(options, callback) {
439
+ const meth = 'adapter-getDevicesFiltered';
440
+ const origin = `${this.id}-${meth}`;
441
+ log.trace(origin);
388
442
 
389
- // put false in array for all entities
390
- if (Array.isArray(entityId)) {
391
- for (let e = 1; e < entityId.length; e += 1) {
392
- result.push(false);
393
- }
394
- }
443
+ try {
444
+ return super.getDevicesFiltered(options, callback);
445
+ } catch (err) {
446
+ log.error(`${origin}: ${err}`);
447
+ return callback(null, err);
448
+ }
449
+ }
395
450
 
396
- return callback(result);
397
- }
451
+ /**
452
+ * @summary Gets the status for the provided appliance
453
+ *
454
+ * @function isAlive
455
+ * @param {String} deviceName - the deviceName of the appliance. (required)
456
+ *
457
+ * @param {configCallback} callback - callback function to return the result
458
+ * (appliance isAlive) or the error
459
+ */
460
+ isAlive(deviceName, callback) {
461
+ const meth = 'adapter-isAlive';
462
+ const origin = `${this.id}-${meth}`;
463
+ log.trace(origin);
464
+
465
+ try {
466
+ return super.isAlive(deviceName, callback);
467
+ } catch (err) {
468
+ log.error(`${origin}: ${err}`);
469
+ return callback(null, err);
398
470
  }
399
471
  }
400
472
 
401
473
  /**
402
- * @summary Updates the cache for all entities by call the get All entity method
474
+ * @summary Gets a config for the provided Appliance
403
475
  *
404
- * @function updateEntityCache
476
+ * @function getConfig
477
+ * @param {String} deviceName - the deviceName of the appliance. (required)
478
+ * @param {String} format - the desired format of the config. (optional)
405
479
  *
480
+ * @param {configCallback} callback - callback function to return the result
481
+ * (appliance config) or the error
406
482
  */
407
- updateEntityCache() {
408
- const origin = `${this.id}-adapter-updateEntityCache`;
483
+ getConfig(deviceName, format, callback) {
484
+ const meth = 'adapter-getConfig';
485
+ const origin = `${this.id}-${meth}`;
409
486
  log.trace(origin);
410
487
 
411
- if (this.caching) {
412
- // if the cache is invalid, update the cache
413
- this.getEntities(null, null, null, null, (data, err) => {
414
- if (err) {
415
- log.trace(`${origin}: Could not load template_entity into cache - ${err}`);
416
- }
417
- });
488
+ try {
489
+ return super.getConfig(deviceName, format, callback);
490
+ } catch (err) {
491
+ log.error(`${origin}: ${err}`);
492
+ return callback(null, err);
493
+ }
494
+ }
495
+
496
+ /**
497
+ * @summary Gets the device count from the system
498
+ *
499
+ * @function iapGetDeviceCount
500
+ *
501
+ * @param {getCallback} callback - callback function to return the result
502
+ * (count) or the error
503
+ */
504
+ iapGetDeviceCount(callback) {
505
+ const meth = 'adapter-iapGetDeviceCount';
506
+ const origin = `${this.id}-${meth}`;
507
+ log.trace(origin);
508
+
509
+ try {
510
+ return super.iapGetDeviceCount(callback);
511
+ } catch (err) {
512
+ log.error(`${origin}: ${err}`);
513
+ return callback(null, err);
514
+ }
515
+ }
516
+
517
+ /* GENERIC ADAPTER REQUEST - allows extension of adapter without new calls being added */
518
+ /**
519
+ * Makes the requested generic call
520
+ *
521
+ * @function iapExpandedGenericAdapterRequest
522
+ * @param {Object} metadata - metadata for the call (optional).
523
+ * Can be a stringified Object.
524
+ * @param {String} uriPath - the path of the api call - do not include the host, port, base path or version (optional)
525
+ * @param {String} restMethod - the rest method (GET, POST, PUT, PATCH, DELETE) (optional)
526
+ * @param {Object} pathVars - the parameters to be put within the url path (optional).
527
+ * Can be a stringified Object.
528
+ * @param {Object} queryData - the parameters to be put on the url (optional).
529
+ * Can be a stringified Object.
530
+ * @param {Object} requestBody - the body to add to the request (optional).
531
+ * Can be a stringified Object.
532
+ * @param {Object} addlHeaders - additional headers to be put on the call (optional).
533
+ * Can be a stringified Object.
534
+ * @param {getCallback} callback - a callback function to return the result (Generics)
535
+ * or the error
536
+ */
537
+ iapExpandedGenericAdapterRequest(metadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback) {
538
+ const meth = 'adapter-iapExpandedGenericAdapterRequest';
539
+ const origin = `${this.id}-${meth}`;
540
+ log.trace(origin);
541
+
542
+ try {
543
+ return super.iapExpandedGenericAdapterRequest(metadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback);
544
+ } catch (err) {
545
+ log.error(`${origin}: ${err}`);
546
+ return callback(null, err);
418
547
  }
419
548
  }
420
549
 
@@ -438,94 +567,84 @@ class Salesforce extends AdapterBaseCl {
438
567
  const origin = `${this.id}-${meth}`;
439
568
  log.trace(origin);
440
569
 
441
- if (this.suspended && this.suspendMode === 'error') {
442
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
443
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
444
- return callback(null, errorObj);
570
+ try {
571
+ return super.genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback);
572
+ } catch (err) {
573
+ log.error(`${origin}: ${err}`);
574
+ return callback(null, err);
445
575
  }
576
+ }
446
577
 
447
- /* HERE IS WHERE YOU VALIDATE DATA */
448
- if (uriPath === undefined || uriPath === null || uriPath === '') {
449
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['uriPath'], null, null, null);
450
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
451
- return callback(null, errorObj);
452
- }
453
- if (restMethod === undefined || restMethod === null || restMethod === '') {
454
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['restMethod'], null, null, null);
455
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
456
- return callback(null, errorObj);
457
- }
578
+ /**
579
+ * Makes the requested generic call with no base path or version
580
+ *
581
+ * @function genericAdapterRequestNoBasePath
582
+ * @param {String} uriPath - the path of the api call - do not include the host, port, base path or version (required)
583
+ * @param {String} restMethod - the rest method (GET, POST, PUT, PATCH, DELETE) (required)
584
+ * @param {Object} queryData - the parameters to be put on the url (optional).
585
+ * Can be a stringified Object.
586
+ * @param {Object} requestBody - the body to add to the request (optional).
587
+ * Can be a stringified Object.
588
+ * @param {Object} addlHeaders - additional headers to be put on the call (optional).
589
+ * Can be a stringified Object.
590
+ * @param {getCallback} callback - a callback function to return the result (Generics)
591
+ * or the error
592
+ */
593
+ genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) {
594
+ const meth = 'adapter-genericAdapterRequestNoBasePath';
595
+ const origin = `${this.id}-${meth}`;
596
+ log.trace(origin);
458
597
 
459
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
460
- // remove any leading / and split the uripath into path variables
461
- let myPath = uriPath;
462
- while (myPath.indexOf('/') === 0) {
463
- myPath = myPath.substring(1);
598
+ try {
599
+ return super.genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback);
600
+ } catch (err) {
601
+ log.error(`${origin}: ${err}`);
602
+ return callback(null, err);
464
603
  }
465
- const pathVars = myPath.split('/');
466
- const queryParamsAvailable = queryData;
467
- const queryParams = {};
468
- const bodyVars = requestBody;
604
+ }
469
605
 
470
- // loop in template. long callback arg name to avoid identifier conflicts
471
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
472
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
473
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
474
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
475
- }
476
- });
606
+ /* INVENTORY CALLS */
607
+ /**
608
+ * @summary run the adapter lint script to return the results.
609
+ *
610
+ * @function iapRunAdapterLint
611
+ * @param {Callback} callback - callback function
612
+ */
613
+ iapRunAdapterLint(callback) {
614
+ const meth = 'adapter-iapRunAdapterLint';
615
+ const origin = `${this.id}-${meth}`;
616
+ log.trace(origin);
477
617
 
478
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
479
- const reqObj = {
480
- payload: bodyVars,
481
- uriPathVars: pathVars,
482
- uriQuery: queryParams,
483
- uriOptions: {}
484
- };
485
- // add headers if provided
486
- if (addlHeaders) {
487
- reqObj.addlHeaders = addlHeaders;
488
- }
618
+ return super.iapRunAdapterLint(callback);
619
+ }
489
620
 
490
- // determine the call and return flag
491
- let action = 'getGenerics';
492
- let returnF = true;
493
- if (restMethod.toUpperCase() === 'POST') {
494
- action = 'createGeneric';
495
- } else if (restMethod.toUpperCase() === 'PUT') {
496
- action = 'updateGeneric';
497
- } else if (restMethod.toUpperCase() === 'PATCH') {
498
- action = 'patchGeneric';
499
- } else if (restMethod.toUpperCase() === 'DELETE') {
500
- action = 'deleteGeneric';
501
- returnF = false;
502
- }
621
+ /**
622
+ * @summary run the adapter test scripts (baseunit and unit) to return the results.
623
+ * can not run integration as there can be implications with that.
624
+ *
625
+ * @function iapRunAdapterTests
626
+ * @param {Callback} callback - callback function
627
+ */
628
+ iapRunAdapterTests(callback) {
629
+ const meth = 'adapter-iapRunAdapterTests';
630
+ const origin = `${this.id}-${meth}`;
631
+ log.trace(origin);
503
632
 
504
- try {
505
- // Make the call -
506
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
507
- return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
508
- // if we received an error or their is no response on the results
509
- // return an error
510
- if (irReturnError) {
511
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
512
- return callback(null, irReturnError);
513
- }
514
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
515
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['genericAdapterRequest'], null, null, null);
516
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
517
- return callback(null, errorObj);
518
- }
633
+ return super.iapRunAdapterTests(callback);
634
+ }
519
635
 
520
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
521
- // return the response
522
- return callback(irReturnData, null);
523
- });
524
- } catch (ex) {
525
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
526
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
527
- return callback(null, errorObj);
528
- }
636
+ /**
637
+ * @summary provide inventory information abbout the adapter
638
+ *
639
+ * @function iapGetAdapterInventory
640
+ * @param {Callback} callback - callback function
641
+ */
642
+ iapGetAdapterInventory(callback) {
643
+ const meth = 'adapter-iapGetAdapterInventory';
644
+ const origin = `${this.id}-${meth}`;
645
+ log.trace(origin);
646
+
647
+ return super.iapGetAdapterInventory(callback);
529
648
  }
530
649
 
531
650
  /**
@@ -583,7 +702,7 @@ class Salesforce extends AdapterBaseCl {
583
702
  // loop in template. long callback arg name to avoid identifier conflicts
584
703
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
585
704
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
586
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
705
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
587
706
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
588
707
  }
589
708
  });
@@ -659,7 +778,7 @@ class Salesforce extends AdapterBaseCl {
659
778
  // loop in template. long callback arg name to avoid identifier conflicts
660
779
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
661
780
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
662
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
781
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
663
782
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
664
783
  }
665
784
  });
@@ -734,7 +853,7 @@ class Salesforce extends AdapterBaseCl {
734
853
  // loop in template. long callback arg name to avoid identifier conflicts
735
854
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
736
855
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
737
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
856
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
738
857
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
739
858
  }
740
859
  });
@@ -803,7 +922,7 @@ class Salesforce extends AdapterBaseCl {
803
922
  // loop in template. long callback arg name to avoid identifier conflicts
804
923
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
805
924
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
806
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
925
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
807
926
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
808
927
  }
809
928
  });
@@ -872,7 +991,7 @@ class Salesforce extends AdapterBaseCl {
872
991
  // loop in template. long callback arg name to avoid identifier conflicts
873
992
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
874
993
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
875
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
994
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
876
995
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
877
996
  }
878
997
  });
@@ -941,7 +1060,7 @@ class Salesforce extends AdapterBaseCl {
941
1060
  // loop in template. long callback arg name to avoid identifier conflicts
942
1061
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
943
1062
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
944
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1063
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
945
1064
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
946
1065
  }
947
1066
  });
@@ -1018,7 +1137,7 @@ class Salesforce extends AdapterBaseCl {
1018
1137
  // loop in template. long callback arg name to avoid identifier conflicts
1019
1138
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1020
1139
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1021
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1140
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1022
1141
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1023
1142
  }
1024
1143
  });
@@ -1093,7 +1212,7 @@ class Salesforce extends AdapterBaseCl {
1093
1212
  // loop in template. long callback arg name to avoid identifier conflicts
1094
1213
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1095
1214
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1096
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1215
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1097
1216
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1098
1217
  }
1099
1218
  });
@@ -1162,7 +1281,7 @@ class Salesforce extends AdapterBaseCl {
1162
1281
  // loop in template. long callback arg name to avoid identifier conflicts
1163
1282
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1164
1283
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1165
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1284
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1166
1285
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1167
1286
  }
1168
1287
  });
@@ -1231,7 +1350,7 @@ class Salesforce extends AdapterBaseCl {
1231
1350
  // loop in template. long callback arg name to avoid identifier conflicts
1232
1351
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1233
1352
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1234
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1353
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1235
1354
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1236
1355
  }
1237
1356
  });
@@ -1301,7 +1420,7 @@ class Salesforce extends AdapterBaseCl {
1301
1420
  // loop in template. long callback arg name to avoid identifier conflicts
1302
1421
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1303
1422
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1304
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1423
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1305
1424
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1306
1425
  }
1307
1426
  });
@@ -1375,7 +1494,7 @@ class Salesforce extends AdapterBaseCl {
1375
1494
  // loop in template. long callback arg name to avoid identifier conflicts
1376
1495
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1377
1496
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1378
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1497
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1379
1498
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1380
1499
  }
1381
1500
  });
@@ -1447,7 +1566,7 @@ class Salesforce extends AdapterBaseCl {
1447
1566
  // loop in template. long callback arg name to avoid identifier conflicts
1448
1567
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1449
1568
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1450
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1569
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1451
1570
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1452
1571
  }
1453
1572
  });
@@ -1521,7 +1640,7 @@ class Salesforce extends AdapterBaseCl {
1521
1640
  // loop in template. long callback arg name to avoid identifier conflicts
1522
1641
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1523
1642
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1524
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1643
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1525
1644
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1526
1645
  }
1527
1646
  });
@@ -1590,7 +1709,7 @@ class Salesforce extends AdapterBaseCl {
1590
1709
  // loop in template. long callback arg name to avoid identifier conflicts
1591
1710
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1592
1711
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1593
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1712
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1594
1713
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1595
1714
  }
1596
1715
  });
@@ -1659,7 +1778,7 @@ class Salesforce extends AdapterBaseCl {
1659
1778
  // loop in template. long callback arg name to avoid identifier conflicts
1660
1779
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1661
1780
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1662
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1781
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1663
1782
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1664
1783
  }
1665
1784
  });
@@ -1733,7 +1852,7 @@ class Salesforce extends AdapterBaseCl {
1733
1852
  // loop in template. long callback arg name to avoid identifier conflicts
1734
1853
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1735
1854
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1736
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1855
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1737
1856
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1738
1857
  }
1739
1858
  });
@@ -1825,7 +1944,7 @@ Return all instances and associated incidents
1825
1944
  // loop in template. long callback arg name to avoid identifier conflicts
1826
1945
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1827
1946
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1828
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1947
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1829
1948
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1830
1949
  }
1831
1950
  });
@@ -1929,7 +2048,7 @@ Status Enums
1929
2048
  // loop in template. long callback arg name to avoid identifier conflicts
1930
2049
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1931
2050
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1932
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2051
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1933
2052
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1934
2053
  }
1935
2054
  });
@@ -2050,7 +2169,7 @@ Status Enums
2050
2169
  // loop in template. long callback arg name to avoid identifier conflicts
2051
2170
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2052
2171
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2053
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2172
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2054
2173
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2055
2174
  }
2056
2175
  });
@@ -2171,7 +2290,7 @@ Status Enums:
2171
2290
  // loop in template. long callback arg name to avoid identifier conflicts
2172
2291
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2173
2292
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2174
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2293
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2175
2294
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2176
2295
  }
2177
2296
  });
@@ -2256,7 +2375,7 @@ Status Enums:
2256
2375
  // loop in template. long callback arg name to avoid identifier conflicts
2257
2376
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2258
2377
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2259
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2378
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2260
2379
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2261
2380
  }
2262
2381
  });
@@ -2330,7 +2449,7 @@ Status Enums:
2330
2449
  // loop in template. long callback arg name to avoid identifier conflicts
2331
2450
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2332
2451
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2333
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2452
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2334
2453
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2335
2454
  }
2336
2455
  });
@@ -2455,7 +2574,7 @@ Status Enums:
2455
2574
  // loop in template. long callback arg name to avoid identifier conflicts
2456
2575
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2457
2576
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2458
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2577
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2459
2578
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2460
2579
  }
2461
2580
  });
@@ -2530,7 +2649,7 @@ Status Enums:
2530
2649
  // loop in template. long callback arg name to avoid identifier conflicts
2531
2650
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2532
2651
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2533
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2652
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2534
2653
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2535
2654
  }
2536
2655
  });
@@ -2600,7 +2719,7 @@ Status Enums:
2600
2719
  // loop in template. long callback arg name to avoid identifier conflicts
2601
2720
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2602
2721
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2603
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2722
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2604
2723
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2605
2724
  }
2606
2725
  });
@@ -2670,7 +2789,7 @@ Status Enums:
2670
2789
  // loop in template. long callback arg name to avoid identifier conflicts
2671
2790
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2672
2791
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2673
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2792
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2674
2793
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2675
2794
  }
2676
2795
  });
@@ -2745,7 +2864,7 @@ Status Enums:
2745
2864
  // loop in template. long callback arg name to avoid identifier conflicts
2746
2865
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2747
2866
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2748
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2867
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2749
2868
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2750
2869
  }
2751
2870
  });
@@ -2819,7 +2938,7 @@ Status Enums:
2819
2938
  // loop in template. long callback arg name to avoid identifier conflicts
2820
2939
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2821
2940
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2822
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2941
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2823
2942
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2824
2943
  }
2825
2944
  });
@@ -2894,7 +3013,7 @@ Status Enums:
2894
3013
  // loop in template. long callback arg name to avoid identifier conflicts
2895
3014
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2896
3015
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2897
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3016
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2898
3017
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2899
3018
  }
2900
3019
  });
@@ -2975,7 +3094,7 @@ Status Enums:
2975
3094
  // loop in template. long callback arg name to avoid identifier conflicts
2976
3095
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2977
3096
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2978
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3097
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2979
3098
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2980
3099
  }
2981
3100
  });
@@ -3061,7 +3180,7 @@ Status Enums:
3061
3180
  // loop in template. long callback arg name to avoid identifier conflicts
3062
3181
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3063
3182
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3064
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3183
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3065
3184
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3066
3185
  }
3067
3186
  });
@@ -3147,7 +3266,7 @@ Status Enums:
3147
3266
  // loop in template. long callback arg name to avoid identifier conflicts
3148
3267
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3149
3268
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3150
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3269
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3151
3270
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3152
3271
  }
3153
3272
  });
@@ -3233,7 +3352,7 @@ Status Enums:
3233
3352
  // loop in template. long callback arg name to avoid identifier conflicts
3234
3353
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3235
3354
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3236
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3355
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3237
3356
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3238
3357
  }
3239
3358
  });
@@ -3307,7 +3426,7 @@ Status Enums:
3307
3426
  // loop in template. long callback arg name to avoid identifier conflicts
3308
3427
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3309
3428
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3310
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3429
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3311
3430
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3312
3431
  }
3313
3432
  });
@@ -3433,7 +3552,7 @@ Status Enums:
3433
3552
  // loop in template. long callback arg name to avoid identifier conflicts
3434
3553
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3435
3554
  if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3436
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3555
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3437
3556
  queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3438
3557
  }
3439
3558
  });