@itentialopensource/adapter-dna_center 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +247 -0
- package/README.md +113 -470
- package/SUMMARY.md +9 -0
- package/TROUBLESHOOT.md +46 -0
- package/adapter.js +856 -57
- package/adapterBase.js +572 -279
- package/entities/.generic/action.json +110 -5
- package/entities/.generic/schema.json +6 -1
- package/entities/Sites/action.json +42 -0
- package/entities/Sites/schema.json +2 -0
- package/error.json +12 -0
- package/package.json +18 -13
- package/pronghorn.json +481 -79
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +382 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1651598418513.json +114 -0
- package/sampleProperties.json +4 -1
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +67 -2
- package/test/unit/adapterBaseTestUnit.js +33 -27
- package/test/unit/adapterTestUnit.js +776 -11
- 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/packModificationScript.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',
|
|
@@ -194,7 +197,7 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
// require the adapter that we are going to be using
|
|
197
|
-
const AdapterBase = require('../../adapterBase
|
|
200
|
+
const AdapterBase = require('../../adapterBase');
|
|
198
201
|
|
|
199
202
|
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
200
203
|
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
@@ -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();
|
|
@@ -814,12 +817,17 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
814
817
|
try {
|
|
815
818
|
assert.notEqual(0, expectedCapabilities.length);
|
|
816
819
|
assert.equal('.generic', expectedCapabilities[0].entity);
|
|
817
|
-
assert.equal(
|
|
820
|
+
assert.equal(10, expectedCapabilities[0].actions.length);
|
|
818
821
|
assert.equal('getGenerics', expectedCapabilities[0].actions[0]);
|
|
819
822
|
assert.equal('createGeneric', expectedCapabilities[0].actions[1]);
|
|
820
823
|
assert.equal('updateGeneric', expectedCapabilities[0].actions[2]);
|
|
821
824
|
assert.equal('patchGeneric', expectedCapabilities[0].actions[3]);
|
|
822
825
|
assert.equal('deleteGeneric', expectedCapabilities[0].actions[4]);
|
|
826
|
+
assert.equal('getGenericsNoBase', expectedCapabilities[0].actions[5]);
|
|
827
|
+
assert.equal('createGenericNoBase', expectedCapabilities[0].actions[6]);
|
|
828
|
+
assert.equal('updateGenericNoBase', expectedCapabilities[0].actions[7]);
|
|
829
|
+
assert.equal('patchGenericNoBase', expectedCapabilities[0].actions[8]);
|
|
830
|
+
assert.equal('deleteGenericNoBase', expectedCapabilities[0].actions[9]);
|
|
823
831
|
assert.equal('.system', expectedCapabilities[1].entity);
|
|
824
832
|
assert.equal(2, expectedCapabilities[1].actions.length);
|
|
825
833
|
assert.equal('getToken', expectedCapabilities[1].actions[0]);
|
|
@@ -840,12 +848,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
840
848
|
}).timeout(attemptTimeout);
|
|
841
849
|
});
|
|
842
850
|
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
describe('#updateAdapterConfiguration', () => {
|
|
846
|
-
it('should have a updateAdapterConfiguration function', (done) => {
|
|
851
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
852
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
847
853
|
try {
|
|
848
|
-
assert.equal(true, typeof a.
|
|
854
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
849
855
|
done();
|
|
850
856
|
} catch (error) {
|
|
851
857
|
log.error(`Test Failure: ${error}`);
|
|
@@ -854,7 +860,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
854
860
|
});
|
|
855
861
|
it('should return no updated if no changes are provided', (done) => {
|
|
856
862
|
try {
|
|
857
|
-
a.
|
|
863
|
+
a.iapUpdateAdapterConfiguration(null, null, null, null, null, (data, error) => {
|
|
858
864
|
try {
|
|
859
865
|
assert.equal('No configuration updates to make', data.response);
|
|
860
866
|
done();
|
|
@@ -870,10 +876,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
870
876
|
}).timeout(attemptTimeout);
|
|
871
877
|
it('should throw an error if missing configuration file', (done) => {
|
|
872
878
|
try {
|
|
873
|
-
a.
|
|
879
|
+
a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
874
880
|
try {
|
|
875
881
|
const displayE = 'configFile is required';
|
|
876
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
|
882
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
877
883
|
done();
|
|
878
884
|
} catch (err) {
|
|
879
885
|
log.error(`Test Failure: ${err}`);
|
|
@@ -887,10 +893,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
887
893
|
}).timeout(attemptTimeout);
|
|
888
894
|
it('if not package.json, entity is required', (done) => {
|
|
889
895
|
try {
|
|
890
|
-
a.
|
|
896
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
891
897
|
try {
|
|
892
898
|
const displayE = 'Unsupported Configuration Change or Missing Entity';
|
|
893
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
|
899
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
894
900
|
done();
|
|
895
901
|
} catch (err) {
|
|
896
902
|
log.error(`Test Failure: ${err}`);
|
|
@@ -904,10 +910,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
904
910
|
}).timeout(attemptTimeout);
|
|
905
911
|
it('if not package.json, type is required', (done) => {
|
|
906
912
|
try {
|
|
907
|
-
a.
|
|
913
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
|
|
908
914
|
try {
|
|
909
915
|
const displayE = 'type is required';
|
|
910
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
|
916
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
911
917
|
done();
|
|
912
918
|
} catch (err) {
|
|
913
919
|
log.error(`Test Failure: ${err}`);
|
|
@@ -921,10 +927,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
921
927
|
}).timeout(attemptTimeout);
|
|
922
928
|
it('if not package.json, entity must be valid', (done) => {
|
|
923
929
|
try {
|
|
924
|
-
a.
|
|
930
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
|
|
925
931
|
try {
|
|
926
932
|
const displayE = 'Incomplete Configuration Change: Invalid Entity - fakeEntity';
|
|
927
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
|
933
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
928
934
|
done();
|
|
929
935
|
} catch (err) {
|
|
930
936
|
log.error(`Test Failure: ${err}`);
|