@itentialopensource/adapter-128technology 0.2.1 → 0.3.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 (43) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +12 -12
  3. package/CHANGELOG.md +32 -0
  4. package/README.md +246 -65
  5. package/adapter.js +12003 -20
  6. package/adapterBase.js +529 -9
  7. package/entities/.generic/action.json +109 -0
  8. package/entities/.generic/schema.json +23 -0
  9. package/entities/.system/action.json +1 -0
  10. package/entities/Analytics/action.json +2 -0
  11. package/entities/Asset/action.json +1 -0
  12. package/entities/Authenticate/action.json +1 -0
  13. package/entities/Config/action.json +505 -0
  14. package/entities/Plugins/action.json +2 -0
  15. package/entities/Router/action.json +1 -0
  16. package/entities/Stats/action.json +1037 -0
  17. package/error.json +6 -0
  18. package/package.json +41 -19
  19. package/pronghorn.json +571 -1
  20. package/propertiesSchema.json +56 -4
  21. package/refs?service=git-upload-pack +0 -0
  22. package/report/updateReport1593633611696.json +95 -0
  23. package/report/updateReport1614264802205.json +95 -0
  24. package/report/updateReport1642429912446.json +95 -0
  25. package/sampleProperties.json +14 -5
  26. package/test/integration/adapterTestBasicGet.js +85 -0
  27. package/test/integration/adapterTestConnectivity.js +93 -0
  28. package/test/integration/adapterTestIntegration.js +21 -8
  29. package/test/unit/adapterBaseTestUnit.js +944 -0
  30. package/test/unit/adapterTestUnit.js +632 -12
  31. package/utils/addAuth.js +94 -0
  32. package/utils/artifactize.js +0 -1
  33. package/utils/basicGet.js +50 -0
  34. package/utils/checkMigrate.js +63 -0
  35. package/utils/entitiesToDB.js +224 -0
  36. package/utils/findPath.js +74 -0
  37. package/utils/modify.js +154 -0
  38. package/utils/packModificationScript.js +1 -1
  39. package/utils/patches2bundledDeps.js +90 -0
  40. package/utils/removeHooks.js +20 -0
  41. package/utils/tbScript.js +169 -0
  42. package/utils/tbUtils.js +451 -0
  43. package/utils/troubleshootingAdapter.js +190 -0
@@ -13,7 +13,10 @@ const winston = require('winston');
13
13
  const { expect } = require('chai');
14
14
  const { use } = require('chai');
15
15
  const td = require('testdouble');
16
+ const util = require('util');
17
+ const pronghorn = require('../../pronghorn.json');
16
18
 
19
+ pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
17
20
  const anything = td.matchers.anything();
18
21
 
19
22
  // stub and attemptTimeout are used throughout the code so set them here
@@ -49,6 +52,7 @@ global.pronghornProps = {
49
52
  base_path: '/',
50
53
  version: 'v1',
51
54
  cache_location: 'none',
55
+ encode_pathvars: true,
52
56
  save_metric: false,
53
57
  stub,
54
58
  protocol,
@@ -61,11 +65,16 @@ global.pronghornProps = {
61
65
  token_timeout: -1,
62
66
  token_cache: 'local',
63
67
  auth_field: 'header.headers.Authorization',
64
- auth_field_format: 'Basic {b64}{username}:{password}{/b64}'
68
+ auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
69
+ auth_logging: false,
70
+ client_id: '',
71
+ client_secret: '',
72
+ grant_type: ''
65
73
  },
66
74
  healthcheck: {
67
75
  type: 'startup',
68
- frequency: 60000
76
+ frequency: 60000,
77
+ query_object: {}
69
78
  },
70
79
  throttle: {
71
80
  throttle_enabled: false,
@@ -96,13 +105,16 @@ global.pronghornProps = {
96
105
  },
97
106
  healthcheck_on_timeout: true,
98
107
  return_raw: true,
99
- archiving: false
108
+ archiving: false,
109
+ return_request: false
100
110
  },
101
111
  proxy: {
102
112
  enabled: false,
103
113
  host: '',
104
114
  port: 1,
105
- protocol: 'http'
115
+ protocol: 'http',
116
+ username: '',
117
+ password: ''
106
118
  },
107
119
  ssl: {
108
120
  ecdhCurve: '',
@@ -303,14 +315,13 @@ function saveMockData(entityName, actionName, descriptor, responseData) {
303
315
  return false;
304
316
  }
305
317
 
306
-
307
318
  // require the adapter that we are going to be using
308
- const Technology128 = require('../../adapter.js');
319
+ const Technology = require('../../adapter');
309
320
 
310
321
  // begin the testing - these should be pretty well defined between the describe and the it!
311
322
  describe('[integration] 128technology Adapter Test', () => {
312
- describe('128technology Class Tests', () => {
313
- const a = new Technology128(
323
+ describe('Technology Class Tests', () => {
324
+ const a = new Technology(
314
325
  pronghornProps.adapterProps.adapters[0].id,
315
326
  pronghornProps.adapterProps.adapters[0].properties
316
327
  );
@@ -336,6 +347,8 @@ describe('[integration] 128technology Adapter Test', () => {
336
347
  try {
337
348
  assert.notEqual(null, a);
338
349
  assert.notEqual(undefined, a);
350
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
351
+ assert.equal(checkId, a.id);
339
352
  assert.notEqual(null, a.allProps);
340
353
  const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
341
354
  assert.equal(check, a.healthcheckType);