@itentialopensource/adapter-meraki 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/adapterBase.js +111 -58
  3. package/package.json +2 -2
  4. package/refs?service=git-upload-pack +0 -0
  5. package/sampleProperties.json +17 -33
  6. package/test/unit/adapterBaseTestUnit.js +5 -5
  7. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/README.md +0 -59
  8. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/specificCallScript.js +0 -97
  9. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/update.js +0 -532
  10. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/adapter.js +0 -23535
  11. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AccessPolicies/action.json +0 -83
  12. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AccessPolicies/mockdatafiles/mockdata.json +0 -6002
  13. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AccessPolicies/schema.json +0 -245
  14. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Acls/action.json +0 -104
  15. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Acls/mockdatafiles/mockdata.json +0 -6002
  16. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Acls/schema.json +0 -245
  17. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AlertTypes/action.json +0 -23
  18. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AlertTypes/mockdatafiles/mockdata.json +0 -6002
  19. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AlertTypes/schema.json +0 -245
  20. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Alerts/action.json +0 -23
  21. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Alerts/mockdatafiles/mockdata.json +0 -6002
  22. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Alerts/schema.json +0 -245
  23. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AlternateManagementInterface/action.json +0 -84
  24. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AlternateManagementInterface/mockdatafiles/mockdata.json +0 -6002
  25. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/AlternateManagementInterface/schema.json +0 -245
  26. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ApnsCert/action.json +0 -23
  27. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ApnsCert/mockdatafiles/mockdata.json +0 -6002
  28. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ApnsCert/schema.json +0 -245
  29. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ApplicationUsage/action.json +0 -23
  30. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ApplicationUsage/mockdatafiles/mockdata.json +0 -6002
  31. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ApplicationUsage/schema.json +0 -245
  32. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Applications/action.json +0 -23
  33. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Applications/mockdatafiles/mockdata.json +0 -6002
  34. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Applications/schema.json +0 -245
  35. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Artifacts/action.json +0 -84
  36. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Artifacts/mockdatafiles/mockdata.json +0 -6002
  37. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Artifacts/schema.json +0 -245
  38. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Availabilities/action.json +0 -23
  39. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Availabilities/mockdatafiles/mockdata.json +0 -6002
  40. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Availabilities/schema.json +0 -245
  41. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BandwidthUsageHistory/action.json +0 -44
  42. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BandwidthUsageHistory/mockdatafiles/mockdata.json +0 -6002
  43. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BandwidthUsageHistory/schema.json +0 -245
  44. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Bgp/action.json +0 -43
  45. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Bgp/mockdatafiles/mockdata.json +0 -6002
  46. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Bgp/schema.json +0 -245
  47. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Billing/action.json +0 -43
  48. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Billing/mockdatafiles/mockdata.json +0 -6002
  49. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Billing/schema.json +0 -245
  50. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BonjourForwarding/action.json +0 -43
  51. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BonjourForwarding/mockdatafiles/mockdata.json +0 -6002
  52. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BonjourForwarding/schema.json +0 -245
  53. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByClient/action.json +0 -23
  54. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByClient/mockdatafiles/mockdata.json +0 -6002
  55. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByClient/schema.json +0 -245
  56. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByDevice/action.json +0 -65
  57. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByDevice/mockdatafiles/mockdata.json +0 -6002
  58. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByDevice/schema.json +0 -245
  59. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByEnergyUsage/action.json +0 -23
  60. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByEnergyUsage/mockdatafiles/mockdata.json +0 -6002
  61. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByEnergyUsage/schema.json +0 -245
  62. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BySwitch/action.json +0 -23
  63. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BySwitch/mockdatafiles/mockdata.json +0 -6002
  64. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/BySwitch/schema.json +0 -245
  65. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByUsage/action.json +0 -107
  66. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByUsage/mockdatafiles/mockdata.json +0 -6002
  67. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByUsage/schema.json +0 -245
  68. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByUtilization/action.json +0 -23
  69. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByUtilization/mockdatafiles/mockdata.json +0 -6002
  70. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ByUtilization/schema.json +0 -245
  71. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ChannelUtilization/action.json +0 -23
  72. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ChannelUtilization/mockdatafiles/mockdata.json +0 -6002
  73. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ChannelUtilization/schema.json +0 -245
  74. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ChannelUtilizationHistory/action.json +0 -23
  75. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ChannelUtilizationHistory/mockdatafiles/mockdata.json +0 -6002
  76. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ChannelUtilizationHistory/schema.json +0 -245
  77. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Claim/action.json +0 -22
  78. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Claim/mockdatafiles/mockdata.json +0 -6002
  79. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Claim/schema.json +0 -245
  80. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ClientCountHistory/action.json +0 -23
  81. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ClientCountHistory/mockdatafiles/mockdata.json +0 -6002
  82. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ClientCountHistory/schema.json +0 -245
  83. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ConfigTemplates/action.json +0 -63
  84. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ConfigTemplates/mockdatafiles/mockdata.json +0 -6002
  85. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ConfigTemplates/schema.json +0 -245
  86. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ConnectivityEvents/action.json +0 -23
  87. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ConnectivityEvents/mockdatafiles/mockdata.json +0 -6002
  88. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ConnectivityEvents/schema.json +0 -245
  89. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/CustomAnalytics/action.json +0 -43
  90. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/CustomAnalytics/mockdatafiles/mockdata.json +0 -6002
  91. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/CustomAnalytics/schema.json +0 -245
  92. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/CustomPerformanceClasses/action.json +0 -104
  93. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/CustomPerformanceClasses/mockdatafiles/mockdata.json +0 -6002
  94. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/CustomPerformanceClasses/schema.json +0 -245
  95. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/DataRateHistory/action.json +0 -23
  96. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/DataRateHistory/mockdatafiles/mockdata.json +0 -6002
  97. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/DataRateHistory/schema.json +0 -245
  98. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Devices/action.json +0 -43
  99. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Devices/mockdatafiles/mockdata.json +0 -6002
  100. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Devices/schema.json +0 -245
  101. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Dhcp/action.json +0 -84
  102. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Dhcp/mockdatafiles/mockdata.json +0 -6002
  103. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Dhcp/schema.json +0 -245
  104. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Features/action.json +0 -23
  105. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Features/mockdatafiles/mockdata.json +0 -6002
  106. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Features/schema.json +0 -245
  107. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/FirmwareUpgrades/action.json +0 -43
  108. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/FirmwareUpgrades/mockdatafiles/mockdata.json +0 -6002
  109. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/FirmwareUpgrades/schema.json +0 -245
  110. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Groups/action.json +0 -104
  111. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Groups/mockdatafiles/mockdata.json +0 -6002
  112. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Groups/schema.json +0 -245
  113. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/HealthByTime/action.json +0 -23
  114. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/HealthByTime/mockdatafiles/mockdata.json +0 -6002
  115. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/HealthByTime/schema.json +0 -245
  116. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/History/action.json +0 -23
  117. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/History/mockdatafiles/mockdata.json +0 -6002
  118. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/History/schema.json +0 -245
  119. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/IdentityPsks/action.json +0 -104
  120. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/IdentityPsks/mockdatafiles/mockdata.json +0 -6002
  121. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/IdentityPsks/schema.json +0 -245
  122. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Idps/action.json +0 -104
  123. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Idps/mockdatafiles/mockdata.json +0 -6002
  124. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Idps/schema.json +0 -245
  125. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Interfaces/action.json +0 -206
  126. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Interfaces/mockdatafiles/mockdata.json +0 -6002
  127. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Interfaces/schema.json +0 -245
  128. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Inventory/action.json +0 -42
  129. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Inventory/mockdatafiles/mockdata.json +0 -6002
  130. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Inventory/schema.json +0 -245
  131. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LatencyHistory/action.json +0 -23
  132. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LatencyHistory/mockdatafiles/mockdata.json +0 -6002
  133. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LatencyHistory/schema.json +0 -245
  134. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Latest/action.json +0 -23
  135. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Latest/mockdatafiles/mockdata.json +0 -6002
  136. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Latest/schema.json +0 -245
  137. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LinkLayer/action.json +0 -23
  138. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LinkLayer/mockdatafiles/mockdata.json +0 -6002
  139. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LinkLayer/schema.json +0 -245
  140. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LoginSecurity/action.json +0 -43
  141. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LoginSecurity/mockdatafiles/mockdata.json +0 -6002
  142. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/LoginSecurity/schema.json +0 -245
  143. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Me/action.json +0 -23
  144. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Me/mockdatafiles/mockdata.json +0 -6002
  145. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Me/schema.json +0 -245
  146. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MerakiAuthUsers/action.json +0 -62
  147. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MerakiAuthUsers/mockdatafiles/mockdata.json +0 -6002
  148. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MerakiAuthUsers/schema.json +0 -245
  149. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MeshStatuses/action.json +0 -23
  150. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MeshStatuses/mockdatafiles/mockdata.json +0 -6002
  151. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MeshStatuses/schema.json +0 -245
  152. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MqttBrokers/action.json +0 -104
  153. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MqttBrokers/mockdatafiles/mockdata.json +0 -6002
  154. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/MqttBrokers/schema.json +0 -245
  155. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Multicast/action.json +0 -43
  156. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Multicast/mockdatafiles/mockdata.json +0 -6002
  157. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Multicast/schema.json +0 -245
  158. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ObjectDetectionModels/action.json +0 -23
  159. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ObjectDetectionModels/mockdatafiles/mockdata.json +0 -6002
  160. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/ObjectDetectionModels/schema.json +0 -245
  161. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/OptIns/action.json +0 -104
  162. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/OptIns/mockdatafiles/mockdata.json +0 -6002
  163. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/OptIns/schema.json +0 -245
  164. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ospf/action.json +0 -43
  165. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ospf/mockdatafiles/mockdata.json +0 -6002
  166. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ospf/schema.json +0 -245
  167. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Overview/action.json +0 -107
  168. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Overview/mockdatafiles/mockdata.json +0 -6002
  169. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Overview/schema.json +0 -245
  170. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/PayloadTemplates/action.json +0 -104
  171. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/PayloadTemplates/mockdatafiles/mockdata.json +0 -6002
  172. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/PayloadTemplates/schema.json +0 -245
  173. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ping/action.json +0 -43
  174. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ping/mockdatafiles/mockdata.json +0 -6002
  175. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ping/schema.json +0 -245
  176. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/PingDevice/action.json +0 -43
  177. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/PingDevice/mockdatafiles/mockdata.json +0 -6002
  178. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/PingDevice/schema.json +0 -245
  179. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Policies/action.json +0 -104
  180. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Policies/mockdatafiles/mockdata.json +0 -6002
  181. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Policies/schema.json +0 -245
  182. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ports/action.json +0 -64
  183. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ports/mockdatafiles/mockdata.json +0 -6002
  184. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Ports/schema.json +0 -245
  185. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Profiles/action.json +0 -125
  186. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Profiles/mockdatafiles/mockdata.json +0 -6002
  187. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Profiles/schema.json +0 -245
  188. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/RendezvousPoints/action.json +0 -104
  189. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/RendezvousPoints/mockdatafiles/mockdata.json +0 -6002
  190. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/RendezvousPoints/schema.json +0 -245
  191. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Rollbacks/action.json +0 -22
  192. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Rollbacks/mockdatafiles/mockdata.json +0 -6002
  193. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Rollbacks/schema.json +0 -245
  194. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Rules/action.json +0 -43
  195. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Rules/mockdatafiles/mockdata.json +0 -6002
  196. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Rules/schema.json +0 -245
  197. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Saml/action.json +0 -43
  198. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Saml/mockdatafiles/mockdata.json +0 -6002
  199. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Saml/schema.json +0 -245
  200. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Schedules/action.json +0 -43
  201. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Schedules/mockdatafiles/mockdata.json +0 -6002
  202. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Schedules/schema.json +0 -245
  203. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Search/action.json +0 -23
  204. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Search/mockdatafiles/mockdata.json +0 -6002
  205. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Search/schema.json +0 -245
  206. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Seen/action.json +0 -23
  207. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Seen/mockdatafiles/mockdata.json +0 -6002
  208. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Seen/schema.json +0 -245
  209. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Sense/action.json +0 -43
  210. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Sense/mockdatafiles/mockdata.json +0 -6002
  211. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Sense/schema.json +0 -245
  212. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Settings/action.json +0 -289
  213. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Settings/mockdatafiles/mockdata.json +0 -6002
  214. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Settings/schema.json +0 -245
  215. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/SignalQualityHistory/action.json +0 -23
  216. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/SignalQualityHistory/mockdatafiles/mockdata.json +0 -6002
  217. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/SignalQualityHistory/schema.json +0 -245
  218. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/SingleLan/action.json +0 -43
  219. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/SingleLan/mockdatafiles/mockdata.json +0 -6002
  220. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/SingleLan/schema.json +0 -245
  221. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/StaticRoutes/action.json +0 -206
  222. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/StaticRoutes/mockdatafiles/mockdata.json +0 -6002
  223. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/StaticRoutes/schema.json +0 -245
  224. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Stats/action.json +0 -23
  225. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Stats/mockdatafiles/mockdata.json +0 -6002
  226. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Stats/schema.json +0 -245
  227. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Statuses/action.json +0 -148
  228. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Statuses/mockdatafiles/mockdata.json +0 -6002
  229. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Statuses/schema.json +0 -245
  230. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Subnets/action.json +0 -23
  231. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Subnets/mockdatafiles/mockdata.json +0 -6002
  232. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Subnets/schema.json +0 -245
  233. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/TrustedAccessConfigs/action.json +0 -23
  234. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/TrustedAccessConfigs/mockdatafiles/mockdata.json +0 -6002
  235. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/TrustedAccessConfigs/schema.json +0 -245
  236. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/TrustedServers/action.json +0 -83
  237. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/TrustedServers/mockdatafiles/mockdata.json +0 -6002
  238. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/TrustedServers/schema.json +0 -245
  239. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UplinkSelection/action.json +0 -43
  240. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UplinkSelection/mockdatafiles/mockdata.json +0 -6002
  241. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UplinkSelection/schema.json +0 -245
  242. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UsageHistories/action.json +0 -23
  243. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UsageHistories/mockdatafiles/mockdata.json +0 -6002
  244. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UsageHistories/schema.json +0 -245
  245. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UsageHistory/action.json +0 -44
  246. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UsageHistory/mockdatafiles/mockdata.json +0 -6002
  247. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UsageHistory/schema.json +0 -245
  248. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UserAccessDevices/action.json +0 -43
  249. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UserAccessDevices/mockdatafiles/mockdata.json +0 -6002
  250. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/UserAccessDevices/schema.json +0 -245
  251. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Vpn/action.json +0 -43
  252. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Vpn/mockdatafiles/mockdata.json +0 -6002
  253. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/Vpn/schema.json +0 -245
  254. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/VppAccounts/action.json +0 -44
  255. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/VppAccounts/mockdatafiles/mockdata.json +0 -6002
  256. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/VppAccounts/schema.json +0 -245
  257. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/WarmSpare/action.json +0 -43
  258. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/WarmSpare/mockdatafiles/mockdata.json +0 -6002
  259. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/WarmSpare/schema.json +0 -245
  260. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/WirelessProfiles/action.json +0 -145
  261. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/WirelessProfiles/mockdatafiles/mockdata.json +0 -6002
  262. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/entities/WirelessProfiles/schema.json +0 -245
  263. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/methods.json +0 -54908
  264. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/pronghorn.json +0 -11140
  265. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/test/integration/adapterTestIntegration.js +0 -7551
  266. package/adapter_modifications/archive/UPD-2022-09-13T20:59:22.909Z/updateFiles/components/test/unit/adapterTestUnit.js +0 -9592
  267. package/previousVersion.zip +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 1.0.3 [07-10-2023]
3
+
4
+ * Migrate adapter base to have broker changes
5
+
6
+ See merge request itentialopensource/adapters/sd-wan/adapter-meraki!25
7
+
8
+ ---
9
+
10
+ ## 1.0.2 [05-10-2023]
11
+
12
+ * Migrate adapter base to have broker changes
13
+
14
+ See merge request itentialopensource/adapters/sd-wan/adapter-meraki!25
15
+
16
+ ---
17
+
2
18
  ## 1.0.1 [04-04-2023]
3
19
 
4
20
  * Utils version has been updated in package.json, and the changes are being migrated to the adapter
package/adapterBase.js CHANGED
@@ -17,6 +17,8 @@ const jsonQuery = require('json-query');
17
17
  const EventEmitterCl = require('events').EventEmitter;
18
18
  const { execSync } = require('child_process');
19
19
 
20
+ const sampleProperties = require(`${__dirname}/sampleProperties.json`).properties;
21
+
20
22
  /* The schema validator */
21
23
  const AjvCl = require('ajv');
22
24
 
@@ -24,11 +26,14 @@ const AjvCl = require('ajv');
24
26
  const PropUtilCl = require('@itentialopensource/adapter-utils').PropertyUtility;
25
27
  const RequestHandlerCl = require('@itentialopensource/adapter-utils').RequestHandler;
26
28
 
29
+ const TransUtilCl = require(path.join(__dirname, 'node_modules/@itentialopensource/adapter-utils/lib/translatorUtil.js'));
30
+
27
31
  const entitiesToDB = require(path.join(__dirname, 'utils/entitiesToDB'));
28
32
  const troubleshootingAdapter = require(path.join(__dirname, 'utils/troubleshootingAdapter'));
29
33
  const tbUtils = require(path.join(__dirname, 'utils/tbUtils'));
30
34
 
31
35
  let propUtil = null;
36
+ let transUtil = null;
32
37
  let choosepath = null;
33
38
 
34
39
  /*
@@ -102,7 +107,7 @@ function updateSchema(entityPath, configFile, changes) {
102
107
  /*
103
108
  * INTERNAL FUNCTION: update the mock data file
104
109
  */
105
- function updateMock(mockPath, configFile, changes) {
110
+ function updateMock(mockPath, configFile, changes, replace) {
106
111
  // if the mock file does not exist - create it
107
112
  const mockFile = path.join(mockPath, `/${configFile}`);
108
113
  if (!fs.existsSync(mockFile)) {
@@ -114,7 +119,11 @@ function updateMock(mockPath, configFile, changes) {
114
119
  let mock = require(path.resolve(mockPath, configFile));
115
120
 
116
121
  // merge the changes into the mock file
117
- mock = propUtil.mergeProperties(changes, mock);
122
+ if (replace === true) {
123
+ mock = changes;
124
+ } else {
125
+ mock = propUtil.mergeProperties(changes, mock);
126
+ }
118
127
 
119
128
  fs.writeFileSync(mockFile, JSON.stringify(mock, null, 2));
120
129
  return null;
@@ -167,6 +176,28 @@ function getDataFromSources(loopField, sources) {
167
176
  return fieldValue;
168
177
  }
169
178
 
179
+ /*
180
+ * INTERNAL FUNCTION: update allprops device broker array with service config and sample props
181
+ */
182
+ function getDeviceBrokerArray(sampleProps, allProps) {
183
+ const brokerCallsArr = ['getDevice', 'getDevicesFiltered', 'isAlive', 'getConfig', 'getCount'];
184
+ const deviceBroker = allProps.devicebroker;
185
+ for (let i = 0; i < brokerCallsArr.length; i += 1) {
186
+ if (!allProps.devicebroker || !allProps.devicebroker[brokerCallsArr[i]] || allProps.devicebroker[brokerCallsArr[i]].length === 0 || !allProps.devicebroker[brokerCallsArr[i]][0].path) {
187
+ // if not in service config check sample props
188
+ if (!sampleProps.devicebroker || !sampleProps.devicebroker[brokerCallsArr[i]] || sampleProps.devicebroker[brokerCallsArr[i]].length === 0 || !sampleProps.devicebroker[brokerCallsArr[i]][0].path) {
189
+ deviceBroker[brokerCallsArr[i]] = [];
190
+ } else {
191
+ log.info('Updating device broker with sample props');
192
+ deviceBroker[brokerCallsArr[i]] = sampleProps.devicebroker[brokerCallsArr[i]];
193
+ }
194
+ }
195
+ }
196
+
197
+ log.info('Device broker array', JSON.stringify(deviceBroker, null, 3));
198
+ return deviceBroker;
199
+ }
200
+
170
201
  /* GENERAL ADAPTER FUNCTIONS THESE SHOULD NOT BE DIRECTLY MODIFIED */
171
202
  /* IF YOU NEED MODIFICATIONS, REDEFINE THEM IN adapter.js!!! */
172
203
  class AdapterBase extends EventEmitterCl {
@@ -186,6 +217,10 @@ class AdapterBase extends EventEmitterCl {
186
217
  this.id = prongid;
187
218
  this.propUtilInst = new PropUtilCl(prongid, __dirname);
188
219
  propUtil = this.propUtilInst;
220
+ this.transUtilInst = new TransUtilCl(prongid, this.propUtilInst);
221
+ transUtil = this.transUtilInst;
222
+ this.transUtilInst = new TransUtilCl(prongid, this.propUtilInst);
223
+ transUtil = this.transUtilInst;
189
224
  this.initProps = properties;
190
225
  this.alive = false;
191
226
  this.healthy = false;
@@ -198,6 +233,8 @@ class AdapterBase extends EventEmitterCl {
198
233
 
199
234
  // set up the properties I care about
200
235
  this.refreshProperties(properties);
236
+ // update deviceBroker based on service config and sample props
237
+ this.allProps.devicebroker = getDeviceBrokerArray(sampleProperties, this.allProps);
201
238
 
202
239
  // Instantiate the other components for this Adapter
203
240
  this.requestHandlerInst = new RequestHandlerCl(this.id, this.allProps, __dirname);
@@ -380,9 +417,15 @@ class AdapterBase extends EventEmitterCl {
380
417
  this.emit('OFFLINE', { id: this.id });
381
418
  this.emit('DEGRADED', { id: this.id });
382
419
  this.healthy = false;
383
- log.error(`${origin}: HEALTH CHECK - Error ${error}`);
384
- } else {
420
+ if (typeof error === 'object') {
421
+ log.error(`${origin}: HEALTH CHECK - Error ${JSON.stringify(error)}`);
422
+ } else {
423
+ log.error(`${origin}: HEALTH CHECK - Error ${error}`);
424
+ }
425
+ } else if (typeof error === 'object') {
385
426
  // still log but set the level to trace
427
+ log.trace(`${origin}: HEALTH CHECK - Still Errors ${JSON.stringify(error)}`);
428
+ } else {
386
429
  log.trace(`${origin}: HEALTH CHECK - Still Errors ${error}`);
387
430
  }
388
431
 
@@ -528,16 +571,17 @@ class AdapterBase extends EventEmitterCl {
528
571
  * @param {string} entity - the entity to be changed, if an action, schema or mock data file (optional)
529
572
  * @param {string} type - the type of entity file to change, (action, schema, mock) (optional)
530
573
  * @param {string} action - the action to be changed, if an action, schema or mock data file (optional)
574
+ * @param {boolean} replace - true to replace entire mock data, false to merge/append (optional)
531
575
  * @param {Callback} callback - The results of the call
532
576
  */
533
- iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback) {
577
+ iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, replace, callback) {
534
578
  const meth = 'adapterBase-iapUpdateAdapterConfiguration';
535
579
  const origin = `${this.id}-${meth}`;
536
580
  log.trace(origin);
537
581
 
538
582
  // verify the parameters are valid
539
583
  if (changes === undefined || changes === null || typeof changes !== 'object'
540
- || Object.keys(changes).length === 0) {
584
+ || Object.keys(changes).length === 0) {
541
585
  const result = {
542
586
  response: 'No configuration updates to make'
543
587
  };
@@ -622,8 +666,14 @@ class AdapterBase extends EventEmitterCl {
622
666
  if (!fs.existsSync(mpath)) {
623
667
  fs.mkdirSync(mpath);
624
668
  }
669
+ // this means we are changing a mock data file so replace is required
670
+ if (replace === undefined || replace === null || replace === '') {
671
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['replace'], null, null, null);
672
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
673
+ return callback(null, errorObj);
674
+ }
675
+ const mres = updateMock(mpath, configFile, changes, replace);
625
676
 
626
- const mres = updateMock(mpath, configFile, changes);
627
677
  if (mres) {
628
678
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Incomplete Configuration Change: ${mres}`, [], null, null, null);
629
679
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
@@ -854,7 +904,7 @@ class AdapterBase extends EventEmitterCl {
854
904
  if (result) {
855
905
  return callback(result);
856
906
  }
857
- return callback(null, result);
907
+ return callback(null, 'Healthcheck failed');
858
908
  } catch (error) {
859
909
  return callback(null, error);
860
910
  }
@@ -869,8 +919,7 @@ class AdapterBase extends EventEmitterCl {
869
919
  */
870
920
  async iapRunAdapterConnectivity(callback) {
871
921
  try {
872
- const { serviceItem } = await tbUtils.getAdapterConfig();
873
- const { host } = serviceItem.properties.properties;
922
+ const { host } = this.allProps;
874
923
  const result = tbUtils.runConnectivity(host, false);
875
924
  if (result.failCount > 0) {
876
925
  return callback(null, result);
@@ -941,7 +990,7 @@ class AdapterBase extends EventEmitterCl {
941
990
  const entityIds = [];
942
991
 
943
992
  if (entities && Object.hasOwnProperty.call(entities, 'response')
944
- && Array.isArray(entities.response)) {
993
+ && Array.isArray(entities.response)) {
945
994
  for (let e = 0; e < entities.response.length; e += 1) {
946
995
  entityIds.push(entities.response[e][key]);
947
996
  }
@@ -1178,75 +1227,73 @@ class AdapterBase extends EventEmitterCl {
1178
1227
  uriMethod = callProps.method;
1179
1228
  }
1180
1229
  if (callProps.query) {
1181
- callQuery = callProps.query;
1182
-
1230
+ callQuery = { ...callProps.query };
1183
1231
  // go through the query params to check for variable values
1184
1232
  const cpKeys = Object.keys(callQuery);
1185
1233
  for (let cp = 0; cp < cpKeys.length; cp += 1) {
1186
- if (callQuery[cpKeys[cp]].startsWith('{') && callQuery[cpKeys[cp]].endsWith('}')) {
1187
- // make any necessary changes to the query params
1188
- if (devResp !== null && callProps.requestFields && Object.keys(callProps.requestFields).length > 0) {
1189
- const rqKeys = Object.keys(callProps.requestFields);
1190
-
1191
- // get the field from the provided device
1192
- for (let rq = 0; rq < rqKeys.length; rq += 1) {
1193
- if (cpKeys[cp] === rqKeys[rq]) {
1194
- const fieldValue = getDataFromSources(callProps.requestFields[rqKeys[rq]], devResp);
1195
-
1196
- // put the value into the query - if it has been specified in the query
1197
- callQuery[cpKeys[cp]] = fieldValue;
1198
- }
1234
+ // if (callQuery[cpKeys[cp]].startsWith('{') && callQuery[cpKeys[cp]].endsWith('}')) {
1235
+ // make any necessary changes to the query params
1236
+ if (devResp !== null && callProps.requestFields && Object.keys(callProps.requestFields).length > 0) {
1237
+ const rqKeys = Object.keys(callProps.requestFields);
1238
+
1239
+ // get the field from the provided device
1240
+ for (let rq = 0; rq < rqKeys.length; rq += 1) {
1241
+ if (callQuery[cpKeys[cp]] === rqKeys[rq]) {
1242
+ const fieldValue = getDataFromSources(callProps.requestFields[rqKeys[rq]], devResp);
1243
+ // put the value into the query - if it has been specified in the query
1244
+ callQuery[cpKeys[cp]] = fieldValue;
1199
1245
  }
1200
1246
  }
1201
1247
  }
1248
+ // }
1202
1249
  }
1203
1250
  }
1204
1251
  if (callProps.body) {
1205
- callBody = callProps.body;
1252
+ callBody = { ...callProps.body };
1206
1253
 
1207
1254
  // go through the body fields to check for variable values
1208
1255
  const cbKeys = Object.keys(callBody);
1209
1256
  for (let cb = 0; cb < cbKeys.length; cb += 1) {
1210
- if (callBody[cbKeys[cb]].startsWith('{') && callBody[cbKeys[cb]].endsWith('}')) {
1211
- // make any necessary changes to the query params
1212
- if (devResp !== null && callProps.requestFields && Object.keys(callProps.requestFields).length > 0) {
1213
- const rqKeys = Object.keys(callProps.requestFields);
1214
-
1215
- // get the field from the provided device
1216
- for (let rq = 0; rq < rqKeys.length; rq += 1) {
1217
- if (cbKeys[cb] === rqKeys[rq]) {
1218
- const fieldValue = getDataFromSources(callProps.requestFields[rqKeys[rq]], devResp);
1219
-
1220
- // put the value into the query - if it has been specified in the query
1221
- callBody[cbKeys[cb]] = fieldValue;
1222
- }
1257
+ // if (callBody[cbKeys[cb]].startsWith('{') && callBody[cbKeys[cb]].endsWith('}')) {
1258
+ // make any necessary changes to the query params
1259
+ if (devResp !== null && callProps.requestFields && Object.keys(callProps.requestFields).length > 0) {
1260
+ const rqKeys = Object.keys(callProps.requestFields);
1261
+
1262
+ // get the field from the provided device
1263
+ for (let rq = 0; rq < rqKeys.length; rq += 1) {
1264
+ if (callBody[cbKeys[cb]] === rqKeys[rq]) {
1265
+ const fieldValue = getDataFromSources(callProps.requestFields[rqKeys[rq]], devResp);
1266
+
1267
+ // put the value into the query - if it has been specified in the query
1268
+ callBody[cbKeys[cb]] = fieldValue;
1223
1269
  }
1224
1270
  }
1225
1271
  }
1272
+ // }
1226
1273
  }
1227
1274
  }
1228
1275
  if (callProps.headers) {
1229
- callHeaders = callProps.headers;
1276
+ callHeaders = { ...callProps.headers };
1230
1277
 
1231
1278
  // go through the body fields to check for variable values
1232
1279
  const chKeys = Object.keys(callHeaders);
1233
1280
  for (let ch = 0; ch < chKeys.length; ch += 1) {
1234
- if (callHeaders[chKeys[ch]].startsWith('{') && callHeaders[chKeys[ch]].endsWith('}')) {
1235
- // make any necessary changes to the query params
1236
- if (devResp !== null && callProps.requestFields && Object.keys(callProps.requestFields).length > 0) {
1237
- const rqKeys = Object.keys(callProps.requestFields);
1238
-
1239
- // get the field from the provided device
1240
- for (let rq = 0; rq < rqKeys.length; rq += 1) {
1241
- if (chKeys[ch] === rqKeys[rq]) {
1242
- const fieldValue = getDataFromSources(callProps.requestFields[rqKeys[rq]], devResp);
1243
-
1244
- // put the value into the query - if it has been specified in the query
1245
- callHeaders[chKeys[ch]] = fieldValue;
1246
- }
1281
+ // if (callHeaders[chKeys[ch]].startsWith('{') && callHeaders[chKeys[ch]].endsWith('}')) {
1282
+ // make any necessary changes to the query params
1283
+ if (devResp !== null && callProps.requestFields && Object.keys(callProps.requestFields).length > 0) {
1284
+ const rqKeys = Object.keys(callProps.requestFields);
1285
+
1286
+ // get the field from the provided device
1287
+ for (let rq = 0; rq < rqKeys.length; rq += 1) {
1288
+ if (callHeaders[chKeys[ch]] === rqKeys[rq]) {
1289
+ const fieldValue = getDataFromSources(callProps.requestFields[rqKeys[rq]], devResp);
1290
+
1291
+ // put the value into the query - if it has been specified in the query
1292
+ callHeaders[chKeys[ch]] = fieldValue;
1247
1293
  }
1248
1294
  }
1249
1295
  }
1296
+ // }
1250
1297
  }
1251
1298
  }
1252
1299
  if (callProps.handleFailure) {
@@ -1445,7 +1492,7 @@ class AdapterBase extends EventEmitterCl {
1445
1492
  // Perform component calls here.
1446
1493
  callPromises.push(
1447
1494
  new Promise((resolve, reject) => {
1448
- this.iapMakeBrokerCall('getDevice', this.allProps.devicebroker.getDevice[i], [devs.list[0]], null, (callRet, callErr) => {
1495
+ this.iapMakeBrokerCall('getDevice', this.allProps.devicebroker.getDevice[i], [devs.list[0]], [deviceName], (callRet, callErr) => {
1449
1496
  // return an error
1450
1497
  if (callErr) {
1451
1498
  reject(callErr);
@@ -1726,7 +1773,13 @@ class AdapterBase extends EventEmitterCl {
1726
1773
  return Promise.all(callPromises).then((results) => {
1727
1774
  let myResult = {};
1728
1775
  results.forEach((result) => {
1729
- myResult = { ...myResult, ...result };
1776
+ if (typeof result === 'string') {
1777
+ myResult = { ...myResult, result };
1778
+ } else if (Array.isArray(result)) {
1779
+ myResult = result[0];
1780
+ } else {
1781
+ myResult = { ...myResult, ...result };
1782
+ }
1730
1783
  });
1731
1784
 
1732
1785
  // return the result
@@ -1771,7 +1824,7 @@ class AdapterBase extends EventEmitterCl {
1771
1824
  // Perform component calls here.
1772
1825
  callPromises.push(
1773
1826
  new Promise((resolve, reject) => {
1774
- this.iapMakeBrokerCall('getCount', this.allProps.devicebroker.getCount[i], null, null, (callRet, callErr) => {
1827
+ this.iapMakeBrokerCall('getCount', this.allProps.devicebroker.getCount[i], [{ fake: 'fakedata' }], null, (callRet, callErr) => {
1775
1828
  // return an error
1776
1829
  if (callErr) {
1777
1830
  reject(callErr);
@@ -1792,7 +1845,7 @@ class AdapterBase extends EventEmitterCl {
1792
1845
  });
1793
1846
 
1794
1847
  // return the result
1795
- return callback({ count: myResult.length });
1848
+ return callback({ count: Object.keys(myResult).length });
1796
1849
  });
1797
1850
  } catch (ex) {
1798
1851
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-meraki",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "This adapter integrates with system described as: merakiDashboardApi.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Meraki",
@@ -53,7 +53,7 @@
53
53
  "author": "Itential",
54
54
  "homepage": "https://gitlab.com/itentialopensource/adapters/sd-wan/adapter-meraki#readme",
55
55
  "dependencies": {
56
- "@itentialopensource/adapter-utils": "^4.48.10",
56
+ "@itentialopensource/adapter-utils": "^4.49.0",
57
57
  "ajv": "^6.12.0",
58
58
  "axios": "^0.21.0",
59
59
  "commander": "^2.20.0",
Binary file
@@ -107,9 +107,9 @@
107
107
  "headers": {},
108
108
  "handleFailure": "ignore",
109
109
  "requestFields": {
110
- "networkID": "port",
111
- "serial": "name",
112
- "orgID": "orgID"
110
+ "networkID": "627126248111459727",
111
+ "serial": "Q4AB-J4J8-6BJR",
112
+ "orgID": "1076949"
113
113
  },
114
114
  "responseDatakey": "",
115
115
  "responseFields": {
@@ -130,7 +130,7 @@
130
130
  "headers": {},
131
131
  "handleFailure": "ignore",
132
132
  "requestFields": {
133
- "orgID": "549236"
133
+ "orgID": "1076949"
134
134
  },
135
135
  "responseDatakey": "",
136
136
  "responseFields": {
@@ -139,27 +139,7 @@
139
139
  "ostypePrefix": "meraki-",
140
140
  "port": "networkId",
141
141
  "ipaddress": "mac",
142
- "orgID": "549236"
143
- }
144
- },
145
- {
146
- "path": "/organizations/{orgID}/devices",
147
- "method": "GET",
148
- "query": {},
149
- "body": {},
150
- "headers": {},
151
- "handleFailure": "ignore",
152
- "requestFields": {
153
- "orgID": "681155"
154
- },
155
- "responseDatakey": "",
156
- "responseFields": {
157
- "name": "serial",
158
- "ostype": "model",
159
- "ostypePrefix": "meraki-",
160
- "port": "networkId",
161
- "ipaddress": "mac",
162
- "orgID": "681155"
142
+ "orgID": "1076949"
163
143
  }
164
144
  }
165
145
  ],
@@ -173,8 +153,8 @@
173
153
  "handleFailure": "ignore",
174
154
  "requestFields": {
175
155
  "networkID": "port",
176
- "serial": "name",
177
- "orgID": "orgID"
156
+ "serial": "Q4AB-J4J8-6BJR",
157
+ "orgID": "1076949"
178
158
  },
179
159
  "responseDatakey": "",
180
160
  "responseFields": {
@@ -193,8 +173,8 @@
193
173
  "handleFailure": "ignore",
194
174
  "requestFields": {
195
175
  "networkID": "port",
196
- "serial": "name",
197
- "orgID": "orgID"
176
+ "serial": "Q4AB-J4J8-6BJR",
177
+ "orgID": "1076949"
198
178
  },
199
179
  "responseDatakey": "",
200
180
  "responseFields": {}
@@ -202,24 +182,28 @@
202
182
  ],
203
183
  "getCount": [
204
184
  {
205
- "path": "/organizations/549236/devices",
185
+ "path": "/organizations/{orgID}/devices",
206
186
  "method": "GET",
207
187
  "query": {},
208
188
  "body": {},
209
189
  "headers": {},
210
190
  "handleFailure": "ignore",
211
- "requestFields": {},
191
+ "requestFields": {
192
+ "orgID": "1076949"
193
+ },
212
194
  "responseDatakey": "",
213
195
  "responseFields": {}
214
196
  },
215
197
  {
216
- "path": "/organizations/681155/devices",
198
+ "path": "/organizations/{orgID}/devices",
217
199
  "method": "GET",
218
200
  "query": {},
219
201
  "body": {},
220
202
  "headers": {},
221
203
  "handleFailure": "ignore",
222
- "requestFields": {},
204
+ "requestFields": {
205
+ "orgID": "1076949"
206
+ },
223
207
  "responseDatakey": "",
224
208
  "responseFields": {}
225
209
  }
@@ -862,7 +862,7 @@ describe('[unit] Adapter Base Test', () => {
862
862
  });
863
863
  it('should return no updated if no changes are provided', (done) => {
864
864
  try {
865
- a.iapUpdateAdapterConfiguration(null, null, null, null, null, (data, error) => {
865
+ a.iapUpdateAdapterConfiguration(null, null, null, null, null, null, (data, error) => {
866
866
  try {
867
867
  assert.equal('No configuration updates to make', data.response);
868
868
  done();
@@ -878,7 +878,7 @@ describe('[unit] Adapter Base Test', () => {
878
878
  }).timeout(attemptTimeout);
879
879
  it('should throw an error if missing configuration file', (done) => {
880
880
  try {
881
- a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
881
+ a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, null, (data, error) => {
882
882
  try {
883
883
  const displayE = 'configFile is required';
884
884
  runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
@@ -895,7 +895,7 @@ describe('[unit] Adapter Base Test', () => {
895
895
  }).timeout(attemptTimeout);
896
896
  it('if not package.json, entity is required', (done) => {
897
897
  try {
898
- a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
898
+ a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, null, (data, error) => {
899
899
  try {
900
900
  const displayE = 'Unsupported Configuration Change or Missing Entity';
901
901
  runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
@@ -912,7 +912,7 @@ describe('[unit] Adapter Base Test', () => {
912
912
  }).timeout(attemptTimeout);
913
913
  it('if not package.json, type is required', (done) => {
914
914
  try {
915
- a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
915
+ a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, null, (data, error) => {
916
916
  try {
917
917
  const displayE = 'type is required';
918
918
  runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
@@ -929,7 +929,7 @@ describe('[unit] Adapter Base Test', () => {
929
929
  }).timeout(attemptTimeout);
930
930
  it('if not package.json, entity must be valid', (done) => {
931
931
  try {
932
- a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
932
+ a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, null, (data, error) => {
933
933
  try {
934
934
  const displayE = 'Incomplete Configuration Change: Invalid Entity - fakeEntity';
935
935
  runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
@@ -1,59 +0,0 @@
1
- # Update
2
-
3
- This update script will update an adapter by appending or updating API calls selected for modification.
4
-
5
- Calls can be selected for change within an adapter by providing a specification document to the Update Tool in the adapter-engine and choosing which calls to modify via the CLI or adapter-wizard (to be implemented in later versions).
6
-
7
- Ability to properly delete API calls via this update script will be implemented in the future.
8
-
9
- ## Usage
10
-
11
- Navigate to the directory of the adapter you want to update. If necessary, move an adapter-modifications folder generated by the Update Tool into the adapter directory.
12
-
13
- ```
14
- cd adapter_modifications
15
-
16
- node update.js {sub-directory name}
17
- ```
18
-
19
- The second argument in the above command should be identical to the name of a immediate sub-directory within adapter-modifications. The provided directory should contain the components required to update a certain adapter.
20
-
21
- The name of this folder is initialized based on the specification document you provide as input to the Update Tool. If you rename that folder, you will need to reflect that change in the given command argument.
22
-
23
- Running this command will update the adapter and run unit and integration tests. If updated correctly, the adapter should pass all tests.
24
-
25
- In order to pass all tests, note that adapter names should be formatted as: 'adapter-name'. Names such as 'adapter-name-test' or similar will cause the tests to error at this point in time.
26
-
27
- ## Directory Structure
28
-
29
- A sub-directory within adapter-modifications should have the following file structure:
30
-
31
- ```
32
- {name of sub-directory}
33
- -- components
34
- -- adapter.js
35
- -- entities
36
- -- {entity name}
37
- -- schema.json
38
- -- action.json
39
- -- mockdatafiles
40
- -- mockdata.json
41
- -- pronghorn.json
42
- -- test
43
- -- unit
44
- -- adapterTestUnit.js
45
- -- integration
46
- -- adapterTestIntegration.js
47
- ```
48
-
49
- Each of these files contains the changes to their adapter equivalents that are enacted when an adapter is updated.
50
-
51
- Note that depending on how many calls are being updated, the number of sub-directories within entities/ will vary. Each entity sub-directory will have its own action.json, schema.json, and mockdatafiles/ directory.
52
-
53
- ## Linting
54
-
55
- If this is an adapter built prior to update capabilities being added (9/2020) you may need to add a line to the .eslintignore (adapter_modifications/*) to ignore any lint errors in the update files. These files have lint errors because they are parital js files.
56
-
57
- ## Testing
58
-
59
- Refer to the adapter's README file to perform unit and integration tests post-update. Integration tests can be performed in standalone or integrated mode.