@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.
@@ -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.js');
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', 'findPath', 'getAllCapabilities', 'getAllFunctions', 'getQueue', 'getWorkflowFunctions', 'healthCheck',
318
- 'refreshProperties', 'runBasicGet', 'runConnectivity', 'runHealthcheck', 'suspend', 'troubleshoot', 'unsuspend', 'updateAdapterConfiguration', 'addListener',
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('#getWorkflowFunctions', () => {
338
- it('should have a getWorkflowFunctions function', (done) => {
340
+ describe('#iapGetAdapterWorkflowFunctions', () => {
341
+ it('should have a iapGetAdapterWorkflowFunctions function', (done) => {
339
342
  try {
340
- assert.equal(true, typeof a.getWorkflowFunctions === 'function');
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.getWorkflowFunctions([]);
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('#getQueue', () => {
427
- it('should have a getQueue function', (done) => {
429
+ describe('#iapGetAdapterQueue', () => {
430
+ it('should have a iapGetAdapterQueue function', (done) => {
428
431
  try {
429
- assert.equal(true, typeof a.getQueue === 'function');
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.getQueue();
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(5, expectedCapabilities[0].actions.length);
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
- // const returnedFunctions = ['updateAdapterConfiguration'];
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.updateAdapterConfiguration === 'function');
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.updateAdapterConfiguration(null, null, null, null, null, (data, error) => {
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.updateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
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-updateAdapterConfiguration', displayE);
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.updateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
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-updateAdapterConfiguration', displayE);
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.updateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
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-updateAdapterConfiguration', displayE);
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.updateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
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-updateAdapterConfiguration', displayE);
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}`);