@itentialopensource/adapter-meraki 0.7.3 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTH.md +40 -0
- package/CALLS.md +100 -0
- package/CHANGELOG.md +24 -0
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +247 -0
- package/README.md +113 -470
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +46 -0
- package/adapter.js +566 -59
- package/adapterBase.js +571 -278
- package/entities/.generic/action.json +5 -5
- package/error.json +12 -0
- package/package.json +18 -13
- package/pronghorn.json +273 -88
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +382 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1642739939352.json +95 -0
- package/report/updateReport1651511176919.json +115 -0
- package/sampleProperties.json +4 -1
- package/test/integration/adapterTestIntegration.js +10 -1
- package/test/unit/adapterBaseTestUnit.js +26 -25
- package/test/unit/adapterTestUnit.js +631 -10
- package/utils/addAuth.js +94 -0
- package/utils/basicGet.js +1 -14
- package/utils/entitiesToDB.js +224 -0
- package/utils/modify.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +14 -8
- package/utils/tbUtils.js +111 -19
- package/utils/troubleshootingAdapter.js +2 -26
@@ -61,7 +61,10 @@ global.pronghornProps = {
|
|
61
61
|
token_cache: 'local',
|
62
62
|
auth_field: 'header.headers.Authorization',
|
63
63
|
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
64
|
-
auth_logging: false
|
64
|
+
auth_logging: false,
|
65
|
+
client_id: '',
|
66
|
+
client_secret: '',
|
67
|
+
grant_type: ''
|
65
68
|
},
|
66
69
|
healthcheck: {
|
67
70
|
type: 'none',
|
@@ -314,8 +317,8 @@ describe('[unit] Adapter Base Test', () => {
|
|
314
317
|
});
|
315
318
|
it('should return a list of functions', (done) => {
|
316
319
|
const returnedFunctions = ['addEntityCache', 'capabilityResults', 'checkActionFiles', 'checkProperties', 'connect', 'encryptProperty',
|
317
|
-
'entityInList', '
|
318
|
-
'
|
320
|
+
'entityInList', 'getAllCapabilities', 'getAllFunctions', 'healthCheck', 'iapFindAdapterPath', 'iapGetAdapterQueue', 'iapGetAdapterWorkflowFunctions', 'iapMakeBrokerCall', 'iapMoveAdapterEntitiesToDB',
|
321
|
+
'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapSuspendAdapter', 'iapTroubleshootAdapter', 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'refreshProperties', 'addListener',
|
319
322
|
'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener',
|
320
323
|
'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|
321
324
|
try {
|
@@ -334,10 +337,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
334
337
|
}).timeout(attemptTimeout);
|
335
338
|
});
|
336
339
|
|
337
|
-
describe('#
|
338
|
-
it('should have a
|
340
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
341
|
+
it('should have a iapGetAdapterWorkflowFunctions function', (done) => {
|
339
342
|
try {
|
340
|
-
assert.equal(true, typeof a.
|
343
|
+
assert.equal(true, typeof a.iapGetAdapterWorkflowFunctions === 'function');
|
341
344
|
done();
|
342
345
|
} catch (error) {
|
343
346
|
log.error(`Test Failure: ${error}`);
|
@@ -346,7 +349,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
346
349
|
});
|
347
350
|
it('should retrieve workflow functions', (done) => {
|
348
351
|
try {
|
349
|
-
const expectedFunctions = a.
|
352
|
+
const expectedFunctions = a.iapGetAdapterWorkflowFunctions([]);
|
350
353
|
try {
|
351
354
|
assert.equal(0, expectedFunctions.length);
|
352
355
|
done();
|
@@ -423,10 +426,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
423
426
|
}).timeout(attemptTimeout);
|
424
427
|
});
|
425
428
|
|
426
|
-
describe('#
|
427
|
-
it('should have a
|
429
|
+
describe('#iapGetAdapterQueue', () => {
|
430
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
428
431
|
try {
|
429
|
-
assert.equal(true, typeof a.
|
432
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
430
433
|
done();
|
431
434
|
} catch (error) {
|
432
435
|
log.error(`Test Failure: ${error}`);
|
@@ -435,7 +438,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
435
438
|
});
|
436
439
|
it('should get information for all of the requests currently in the queue', (done) => {
|
437
440
|
try {
|
438
|
-
const expectedFunctions = a.
|
441
|
+
const expectedFunctions = a.iapGetAdapterQueue();
|
439
442
|
try {
|
440
443
|
assert.equal(0, expectedFunctions.length);
|
441
444
|
done();
|
@@ -840,12 +843,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
840
843
|
}).timeout(attemptTimeout);
|
841
844
|
});
|
842
845
|
|
843
|
-
|
844
|
-
|
845
|
-
describe('#updateAdapterConfiguration', () => {
|
846
|
-
it('should have a updateAdapterConfiguration function', (done) => {
|
846
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
847
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
847
848
|
try {
|
848
|
-
assert.equal(true, typeof a.
|
849
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
849
850
|
done();
|
850
851
|
} catch (error) {
|
851
852
|
log.error(`Test Failure: ${error}`);
|
@@ -854,7 +855,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
854
855
|
});
|
855
856
|
it('should return no updated if no changes are provided', (done) => {
|
856
857
|
try {
|
857
|
-
a.
|
858
|
+
a.iapUpdateAdapterConfiguration(null, null, null, null, null, (data, error) => {
|
858
859
|
try {
|
859
860
|
assert.equal('No configuration updates to make', data.response);
|
860
861
|
done();
|
@@ -870,10 +871,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
870
871
|
}).timeout(attemptTimeout);
|
871
872
|
it('should throw an error if missing configuration file', (done) => {
|
872
873
|
try {
|
873
|
-
a.
|
874
|
+
a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
|
874
875
|
try {
|
875
876
|
const displayE = 'configFile is required';
|
876
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
877
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
877
878
|
done();
|
878
879
|
} catch (err) {
|
879
880
|
log.error(`Test Failure: ${err}`);
|
@@ -887,10 +888,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
887
888
|
}).timeout(attemptTimeout);
|
888
889
|
it('if not package.json, entity is required', (done) => {
|
889
890
|
try {
|
890
|
-
a.
|
891
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
|
891
892
|
try {
|
892
893
|
const displayE = 'Unsupported Configuration Change or Missing Entity';
|
893
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
894
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
894
895
|
done();
|
895
896
|
} catch (err) {
|
896
897
|
log.error(`Test Failure: ${err}`);
|
@@ -904,10 +905,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
904
905
|
}).timeout(attemptTimeout);
|
905
906
|
it('if not package.json, type is required', (done) => {
|
906
907
|
try {
|
907
|
-
a.
|
908
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
|
908
909
|
try {
|
909
910
|
const displayE = 'type is required';
|
910
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
911
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
911
912
|
done();
|
912
913
|
} catch (err) {
|
913
914
|
log.error(`Test Failure: ${err}`);
|
@@ -921,10 +922,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
921
922
|
}).timeout(attemptTimeout);
|
922
923
|
it('if not package.json, entity must be valid', (done) => {
|
923
924
|
try {
|
924
|
-
a.
|
925
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
|
925
926
|
try {
|
926
927
|
const displayE = 'Incomplete Configuration Change: Invalid Entity - fakeEntity';
|
927
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
928
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
928
929
|
done();
|
929
930
|
} catch (err) {
|
930
931
|
log.error(`Test Failure: ${err}`);
|