@itentialopensource/adapter-meraki 0.7.0 → 0.8.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 (59) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +12 -12
  3. package/CHANGELOG.md +32 -0
  4. package/README.md +270 -68
  5. package/adapter.js +2786 -24
  6. package/adapterBase.js +544 -17
  7. package/entities/.generic/action.json +109 -0
  8. package/entities/.generic/schema.json +23 -0
  9. package/entities/.system/action.json +1 -1
  10. package/entities/CameraQualityRetentionProfiles/action.json +3 -0
  11. package/entities/ConnectivityMonitoringDestinations/action.json +1 -0
  12. package/entities/DashboardBrandingPolicies/action.json +4 -0
  13. package/entities/Floorplans/action.json +3 -0
  14. package/entities/Licenses/action.json +5 -0
  15. package/entities/LinkAggregations/action.json +3 -0
  16. package/entities/MGConnectivityMonitoringDestinations/action.json +1 -0
  17. package/entities/MGDHCPSettings/action.json +1 -0
  18. package/entities/MGLANSettings/action.json +1 -0
  19. package/entities/MGPortforwardingRules/action.json +1 -0
  20. package/entities/MGSubnetPoolSettings/action.json +1 -0
  21. package/entities/MGUplinkSettings/action.json +1 -0
  22. package/entities/MXVLANPorts/action.json +1 -0
  23. package/entities/MXWarmSpareSettings/action.json +2 -0
  24. package/entities/NetFlowSettings/action.json +1 -0
  25. package/entities/Switch settings/action.json +9 -0
  26. package/entities/SwitchACLs/action.json +1 -0
  27. package/entities/SwitchPortsSchedules/action.json +3 -0
  28. package/entities/TrafficAnalysisSettings/action.json +1 -0
  29. package/entities/WirelessSettings/action.json +1 -0
  30. package/error.json +6 -0
  31. package/package.json +45 -23
  32. package/pronghorn.json +586 -16
  33. package/propertiesSchema.json +84 -11
  34. package/refs?service=git-upload-pack +0 -0
  35. package/report/meraki-newcalls-OpenApi3Json.json +5460 -0
  36. package/report/updateReport1594225126093.json +95 -0
  37. package/report/updateReport1615384306128.json +95 -0
  38. package/report/updateReport1642739939352.json +95 -0
  39. package/sampleProperties.json +20 -5
  40. package/test/integration/adapterTestBasicGet.js +85 -0
  41. package/test/integration/adapterTestConnectivity.js +93 -0
  42. package/test/integration/adapterTestIntegration.js +30 -11
  43. package/test/unit/adapterBaseTestUnit.js +944 -0
  44. package/test/unit/adapterTestUnit.js +638 -12
  45. package/utils/addAuth.js +94 -0
  46. package/utils/artifactize.js +9 -14
  47. package/utils/basicGet.js +50 -0
  48. package/utils/checkMigrate.js +63 -0
  49. package/utils/entitiesToDB.js +224 -0
  50. package/utils/findPath.js +74 -0
  51. package/utils/modify.js +154 -0
  52. package/utils/packModificationScript.js +1 -1
  53. package/utils/patches2bundledDeps.js +90 -0
  54. package/utils/pre-commit.sh +1 -1
  55. package/utils/removeHooks.js +20 -0
  56. package/utils/tbScript.js +169 -0
  57. package/utils/tbUtils.js +451 -0
  58. package/utils/troubleshootingAdapter.js +190 -0
  59. package/gl-code-quality-report.json +0 -1
package/pronghorn.json CHANGED
@@ -8,6 +8,576 @@
8
8
  "admin"
9
9
  ],
10
10
  "methods": [
11
+ {
12
+ "name": "updateAdapterConfiguration",
13
+ "summary": "Updates the adapter configuration",
14
+ "description": "Updates the adapter configuration file with the provided changes",
15
+ "input": [
16
+ {
17
+ "name": "configFile",
18
+ "type": "string",
19
+ "info": "The name of the file to change",
20
+ "required": true,
21
+ "schema": {
22
+ "title": "configFile",
23
+ "type": "string"
24
+ }
25
+ },
26
+ {
27
+ "name": "changes",
28
+ "type": "object",
29
+ "info": "JSON object containing the configuration changes",
30
+ "required": true,
31
+ "schema": {
32
+ "title": "changes",
33
+ "type": "object"
34
+ }
35
+ },
36
+ {
37
+ "name": "entity",
38
+ "type": "string",
39
+ "info": "The entity in which the changes are being made",
40
+ "required": false,
41
+ "schema": {
42
+ "title": "entity",
43
+ "type": "string"
44
+ }
45
+ },
46
+ {
47
+ "name": "type",
48
+ "type": "string",
49
+ "info": "The type of file to change - action, schema, or mock",
50
+ "required": false,
51
+ "schema": {
52
+ "title": "type",
53
+ "type": "string"
54
+ }
55
+ },
56
+ {
57
+ "name": "action",
58
+ "type": "string",
59
+ "info": "The action to be changed",
60
+ "required": false,
61
+ "schema": {
62
+ "title": "action",
63
+ "type": "string"
64
+ }
65
+ }
66
+ ],
67
+ "output": {
68
+ "name": "result",
69
+ "type": "object",
70
+ "description": "A JSON Object containing status, code and the result",
71
+ "schema": {
72
+ "title": "result",
73
+ "type": "object"
74
+ }
75
+ },
76
+ "roles": [
77
+ "admin"
78
+ ],
79
+ "route": {
80
+ "verb": "POST",
81
+ "path": "/updateAdapterConfiguration"
82
+ },
83
+ "task": true
84
+ },
85
+ {
86
+ "name": "findPath",
87
+ "summary": "Provides the ability to see if a particular API path is supported by the adapter",
88
+ "description": "Provides the ability to see if a particular API path is supported by the adapter",
89
+ "input": [
90
+ {
91
+ "name": "apiPath",
92
+ "type": "string",
93
+ "info": "The API Path you want to check - make sure to not include base path and version",
94
+ "description": "The API Path you want to check - make sure to not include base path and version",
95
+ "schema": {
96
+ "title": "apiPath",
97
+ "type": "string"
98
+ },
99
+ "required": true
100
+ }
101
+ ],
102
+ "output": {
103
+ "name": "result",
104
+ "type": "object",
105
+ "description": "A JSON Object containing the result",
106
+ "schema": {
107
+ "title": "result",
108
+ "type": "object"
109
+ }
110
+ },
111
+ "roles": [
112
+ "admin"
113
+ ],
114
+ "route": {
115
+ "verb": "POST",
116
+ "path": "/findPath"
117
+ },
118
+ "task": true
119
+ },
120
+ {
121
+ "name": "troubleshoot",
122
+ "summary": "Runs troubleshoot script for adapter",
123
+ "description": "Runs troubleshoot script for adapter",
124
+ "input": [
125
+ {
126
+ "name": "props",
127
+ "type": "object",
128
+ "info": "Object containing configuration, healthcheck and auth properties {'connProps':{'host': 'api.service.com', 'base_path': '/', 'protocol': 'http', 'port': 443, 'version': 'v1'},'healthCheckEndpoint': '/healthcheck', 'auth': {'auth_method': 'no authentication', 'username': 'username', 'password': 'password'}}",
129
+ "required": true,
130
+ "schema": {
131
+ "title": "props",
132
+ "type": "object"
133
+ }
134
+ },
135
+ {
136
+ "name": "persistFlag",
137
+ "type": "boolean",
138
+ "info": "Whether the input properties should be saved",
139
+ "required": true
140
+ }
141
+ ],
142
+ "output": {
143
+ "name": "result",
144
+ "type": "object",
145
+ "description": "A JSON Object containing the test results",
146
+ "schema": {
147
+ "title": "result",
148
+ "type": "object"
149
+ }
150
+ },
151
+ "roles": [
152
+ "admin"
153
+ ],
154
+ "route": {
155
+ "verb": "POST",
156
+ "path": "/troubleshoot"
157
+ },
158
+ "task": true
159
+ },
160
+ {
161
+ "name": "runHealthcheck",
162
+ "summary": "Runs healthcheck script for adapter",
163
+ "description": "Runs healthcheck script for adapter",
164
+ "input": [],
165
+ "output": {
166
+ "name": "result",
167
+ "type": "boolean",
168
+ "description": "Whether healthcheck passed or failed"
169
+ },
170
+ "roles": [
171
+ "admin"
172
+ ],
173
+ "route": {
174
+ "verb": "POST",
175
+ "path": "/runHealthcheck"
176
+ },
177
+ "task": true
178
+ },
179
+ {
180
+ "name": "runConnectivity",
181
+ "summary": "Runs connectivity check script for adapter",
182
+ "description": "Runs connectivity check script for adapter",
183
+ "input": [],
184
+ "output": {
185
+ "name": "result",
186
+ "type": "object",
187
+ "description": "A JSON Object containing the test results",
188
+ "schema": {
189
+ "title": "result",
190
+ "type": "object"
191
+ }
192
+ },
193
+ "roles": [
194
+ "admin"
195
+ ],
196
+ "route": {
197
+ "verb": "POST",
198
+ "path": "/runConnectivity"
199
+ },
200
+ "task": true
201
+ },
202
+ {
203
+ "name": "runBasicGet",
204
+ "summary": "Runs basicGet script for adapter",
205
+ "description": "Runs basicGet script for adapter",
206
+ "input": [],
207
+ "output": {
208
+ "name": "result",
209
+ "type": "object",
210
+ "description": "A JSON Object containing the test results",
211
+ "schema": {
212
+ "title": "result",
213
+ "type": "object"
214
+ }
215
+ },
216
+ "roles": [
217
+ "admin"
218
+ ],
219
+ "route": {
220
+ "verb": "POST",
221
+ "path": "/runBasicGet"
222
+ },
223
+ "task": true
224
+ },
225
+ {
226
+ "name": "suspend",
227
+ "summary": "Suspends the adapter",
228
+ "description": "Suspends the adapter",
229
+ "input": [
230
+ {
231
+ "name": "mode",
232
+ "type": "enum",
233
+ "enumerals": [
234
+ "pause",
235
+ "error"
236
+ ],
237
+ "info": "How incoming requests are handled. Defaults to 'pause'",
238
+ "description": "How incoming requests are handled. Defaults to 'pause'",
239
+ "schema": {
240
+ "title": "mode",
241
+ "type": "string"
242
+ },
243
+ "required": false
244
+ }
245
+ ],
246
+ "output": {
247
+ "name": "result",
248
+ "type": "object",
249
+ "description": "A JSON Object containing the adapter suspended status",
250
+ "schema": {
251
+ "title": "result",
252
+ "type": "object"
253
+ }
254
+ },
255
+ "roles": [
256
+ "admin"
257
+ ],
258
+ "route": {
259
+ "verb": "POST",
260
+ "path": "/suspend"
261
+ },
262
+ "task": true
263
+ },
264
+ {
265
+ "name": "unsuspend",
266
+ "summary": "Unsuspends the adapter",
267
+ "description": "Unsuspends the adapter",
268
+ "input": [],
269
+ "output": {
270
+ "name": "result",
271
+ "type": "object",
272
+ "description": "A JSON Object containing the adapter suspended status",
273
+ "schema": {
274
+ "title": "result",
275
+ "type": "object"
276
+ }
277
+ },
278
+ "roles": [
279
+ "admin"
280
+ ],
281
+ "route": {
282
+ "verb": "POST",
283
+ "path": "/unsuspend"
284
+ },
285
+ "task": true
286
+ },
287
+ {
288
+ "name": "getQueue",
289
+ "summary": "Return the requests that are waiting in the queue if throttling is enabled",
290
+ "description": "Return the requests that are waiting in the queue if throttling is enabled",
291
+ "input": [],
292
+ "output": {
293
+ "name": "result",
294
+ "type": "object",
295
+ "description": "A JSON Object containing the adapter queue",
296
+ "schema": {
297
+ "title": "result",
298
+ "type": "object"
299
+ }
300
+ },
301
+ "roles": [
302
+ "admin"
303
+ ],
304
+ "route": {
305
+ "verb": "POST",
306
+ "path": "/getQueue"
307
+ },
308
+ "task": true
309
+ },
310
+ {
311
+ "name": "genericAdapterRequest",
312
+ "summary": "Makes the requested generic call",
313
+ "description": "Makes the requested generic call",
314
+ "input": [
315
+ {
316
+ "name": "uriPath",
317
+ "type": "string",
318
+ "info": "the path of the api call - do not include the host, port, base path or version",
319
+ "description": "the path of the api call",
320
+ "schema": {
321
+ "title": "uriPath",
322
+ "type": "string"
323
+ },
324
+ "required": true
325
+ },
326
+ {
327
+ "name": "restMethod",
328
+ "type": "string",
329
+ "info": "the rest method (GET, POST, PUT, PATCH, DELETE)",
330
+ "description": "the rest method (GET, POST, PUT, PATCH, DELETE)",
331
+ "schema": {
332
+ "title": "restMethod",
333
+ "type": "string"
334
+ },
335
+ "required": true
336
+ },
337
+ {
338
+ "name": "queryData",
339
+ "type": "object",
340
+ "info": "the query parameters to be put on the url (optional)",
341
+ "description": "the query parameters to be put on the url (optional)",
342
+ "schema": {
343
+ "title": "queryData",
344
+ "type": "object"
345
+ },
346
+ "required": false
347
+ },
348
+ {
349
+ "name": "requestBody",
350
+ "type": "object",
351
+ "info": "the payload to be sent with the request (optional)",
352
+ "description": "the payload to be sent with the request (optional)",
353
+ "schema": {
354
+ "title": "requestBody",
355
+ "type": "object"
356
+ },
357
+ "required": false
358
+ },
359
+ {
360
+ "name": "addlHeaders",
361
+ "type": "object",
362
+ "info": "additional headers to be put on the call (optional)",
363
+ "description": "additional headers to be put on the call (optional)",
364
+ "schema": {
365
+ "title": "addlHeaders",
366
+ "type": "object"
367
+ },
368
+ "required": false
369
+ }
370
+ ],
371
+ "output": {
372
+ "name": "result",
373
+ "type": "object",
374
+ "description": "A JSON Object containing status, code and the result",
375
+ "schema": {
376
+ "title": "result",
377
+ "type": "object"
378
+ }
379
+ },
380
+ "roles": [
381
+ "admin"
382
+ ],
383
+ "route": {
384
+ "verb": "POST",
385
+ "path": "/genericAdapterRequest"
386
+ },
387
+ "task": true
388
+ },
389
+ {
390
+ "name": "moveEntitiesToDB",
391
+ "summary": "Moves entities from an adapter into the IAP database",
392
+ "description": "Moves entities from an adapter into the IAP database",
393
+ "input": [],
394
+ "output": {
395
+ "name": "res",
396
+ "type": "object",
397
+ "description": "A JSON Object containing status, code and the response from the mongo transaction",
398
+ "schema": {
399
+ "title": "res",
400
+ "type": "object"
401
+ }
402
+ },
403
+ "roles": [
404
+ "admin"
405
+ ],
406
+ "route": {
407
+ "verb": "POST",
408
+ "path": "/moveEntitiesToDB"
409
+ },
410
+ "task": true
411
+ },
412
+ {
413
+ "name": "getDevice",
414
+ "summary": "Get the Appliance",
415
+ "description": "Get the Appliance",
416
+ "input": [
417
+ {
418
+ "name": "deviceName",
419
+ "type": "string",
420
+ "info": "An Appliance Device Name",
421
+ "required": true,
422
+ "schema": {
423
+ "title": "deviceName",
424
+ "type": "string"
425
+ }
426
+ }
427
+ ],
428
+ "output": {
429
+ "name": "result",
430
+ "type": "object",
431
+ "description": "A JSON Object containing status, code and the result",
432
+ "schema": {
433
+ "title": "result",
434
+ "type": "object"
435
+ }
436
+ },
437
+ "roles": [
438
+ "admin"
439
+ ],
440
+ "route": {
441
+ "verb": "POST",
442
+ "path": "/getDevice"
443
+ },
444
+ "task": false
445
+ },
446
+ {
447
+ "name": "getDevicesFiltered",
448
+ "summary": "Get Appliances that match the filter",
449
+ "description": "Get Appliances that match the filter",
450
+ "input": [
451
+ {
452
+ "name": "options",
453
+ "type": "object",
454
+ "info": "options - e.g. { 'start': 1, 'limit': 20, 'filter': { 'name': 'abc123' } }",
455
+ "required": true,
456
+ "schema": {
457
+ "title": "options",
458
+ "type": "object"
459
+ }
460
+ }
461
+ ],
462
+ "output": {
463
+ "name": "result",
464
+ "type": "array",
465
+ "description": "A JSON Object containing status, code and the result",
466
+ "schema": {
467
+ "title": "result",
468
+ "type": "array"
469
+ }
470
+ },
471
+ "roles": [
472
+ "admin"
473
+ ],
474
+ "route": {
475
+ "verb": "POST",
476
+ "path": "/getDevicesFiltered"
477
+ },
478
+ "task": false
479
+ },
480
+ {
481
+ "name": "isAlive",
482
+ "summary": "Checks the status for the provided Appliance",
483
+ "description": "Checks the status for the provided Appliance",
484
+ "input": [
485
+ {
486
+ "name": "deviceName",
487
+ "type": "string",
488
+ "info": "An Appliance Device Name",
489
+ "required": true,
490
+ "schema": {
491
+ "title": "deviceName",
492
+ "type": "string"
493
+ }
494
+ }
495
+ ],
496
+ "output": {
497
+ "name": "result",
498
+ "type": "boolean",
499
+ "description": "A JSON Object containing status, code and the result",
500
+ "schema": {
501
+ "title": "result",
502
+ "type": "boolean"
503
+ }
504
+ },
505
+ "roles": [
506
+ "admin"
507
+ ],
508
+ "route": {
509
+ "verb": "POST",
510
+ "path": "/isAlive"
511
+ },
512
+ "task": false
513
+ },
514
+ {
515
+ "name": "getConfig",
516
+ "summary": "Gets a config for the provided Appliance",
517
+ "description": "Gets a config for the provided Appliance",
518
+ "input": [
519
+ {
520
+ "name": "deviceName",
521
+ "type": "string",
522
+ "info": "An Appliance Device Name",
523
+ "required": true,
524
+ "schema": {
525
+ "title": "deviceName",
526
+ "type": "string"
527
+ }
528
+ },
529
+ {
530
+ "name": "format",
531
+ "type": "string",
532
+ "info": "The format to be returned - this is ignored as we always return json",
533
+ "required": false,
534
+ "schema": {
535
+ "title": "format",
536
+ "type": "string"
537
+ }
538
+ }
539
+ ],
540
+ "output": {
541
+ "name": "result",
542
+ "type": "object",
543
+ "description": "A JSON Object containing status, code and the result",
544
+ "schema": {
545
+ "title": "result",
546
+ "type": "object"
547
+ }
548
+ },
549
+ "roles": [
550
+ "admin"
551
+ ],
552
+ "route": {
553
+ "verb": "POST",
554
+ "path": "/getConfig"
555
+ },
556
+ "task": false
557
+ },
558
+ {
559
+ "name": "getCount",
560
+ "summary": "Gets a device count from the system",
561
+ "description": "Gets a device count from the system",
562
+ "input": [],
563
+ "output": {
564
+ "name": "result",
565
+ "type": "object",
566
+ "description": "A JSON Object containing status, code and the result",
567
+ "schema": {
568
+ "title": "result",
569
+ "type": "object"
570
+ }
571
+ },
572
+ "roles": [
573
+ "admin"
574
+ ],
575
+ "route": {
576
+ "verb": "POST",
577
+ "path": "/getCount"
578
+ },
579
+ "task": false
580
+ },
11
581
  {
12
582
  "name": "createOrganizationActionBatch",
13
583
  "summary": "Create an action batch",
@@ -13714,12 +14284,12 @@
13714
14284
  "input": [
13715
14285
  {
13716
14286
  "name": "body",
13717
- "type": "string",
13718
- "info": "body: string",
14287
+ "type": "object",
14288
+ "info": "object",
13719
14289
  "required": false,
13720
14290
  "schema": {
13721
14291
  "title": "body",
13722
- "type": "string"
14292
+ "type": "object"
13723
14293
  }
13724
14294
  },
13725
14295
  {
@@ -13778,12 +14348,12 @@
13778
14348
  },
13779
14349
  {
13780
14350
  "name": "body",
13781
- "type": "string",
13782
- "info": "body: string",
14351
+ "type": "object",
14352
+ "info": "object",
13783
14353
  "required": false,
13784
14354
  "schema": {
13785
14355
  "title": "body",
13786
- "type": "string"
14356
+ "type": "object"
13787
14357
  }
13788
14358
  }
13789
14359
  ],
@@ -13822,12 +14392,12 @@
13822
14392
  },
13823
14393
  {
13824
14394
  "name": "body",
13825
- "type": "string",
13826
- "info": "body: string",
14395
+ "type": "object",
14396
+ "info": "object",
13827
14397
  "required": false,
13828
14398
  "schema": {
13829
14399
  "title": "body",
13830
- "type": "string"
14400
+ "type": "object"
13831
14401
  }
13832
14402
  }
13833
14403
  ],
@@ -13856,12 +14426,12 @@
13856
14426
  "input": [
13857
14427
  {
13858
14428
  "name": "body",
13859
- "type": "string",
13860
- "info": "body: string",
14429
+ "type": "object",
14430
+ "info": "object",
13861
14431
  "required": false,
13862
14432
  "schema": {
13863
14433
  "title": "body",
13864
- "type": "string"
14434
+ "type": "object"
13865
14435
  }
13866
14436
  },
13867
14437
  {
@@ -13900,12 +14470,12 @@
13900
14470
  "input": [
13901
14471
  {
13902
14472
  "name": "body",
13903
- "type": "string",
13904
- "info": "body: string",
14473
+ "type": "object",
14474
+ "info": "object",
13905
14475
  "required": false,
13906
14476
  "schema": {
13907
14477
  "title": "body",
13908
- "type": "string"
14478
+ "type": "object"
13909
14479
  }
13910
14480
  },
13911
14481
  {
@@ -15915,4 +16485,4 @@
15915
16485
  }
15916
16486
  ],
15917
16487
  "views": []
15918
- }
16488
+ }