@itentialopensource/adapter-f5_bigiq 0.5.7 → 0.6.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 (55) hide show
  1. package/.eslintrc.js +1 -0
  2. package/AUTH.md +4 -4
  3. package/BROKER.md +4 -4
  4. package/CALLS.md +621 -9
  5. package/ENHANCE.md +3 -3
  6. package/PROPERTIES.md +24 -9
  7. package/README.md +24 -23
  8. package/SUMMARY.md +2 -2
  9. package/SYSTEMINFO.md +1 -1
  10. package/TAB1.md +2 -2
  11. package/TAB2.md +9 -5
  12. package/TROUBLESHOOT.md +10 -1
  13. package/UTILITIES.md +473 -0
  14. package/adapter.js +11315 -5
  15. package/adapterBase.js +52 -16
  16. package/entities/BIGIPAuthentication/action.json +106 -0
  17. package/entities/BIGIPAuthentication/schema.json +23 -0
  18. package/entities/BIGIPConfigurationManagement/action.json +310 -0
  19. package/entities/BIGIPConfigurationManagement/schema.json +33 -0
  20. package/entities/BIGIPLocalTrafficManager/action.json +1042 -0
  21. package/entities/BIGIPLocalTrafficManager/schema.json +69 -0
  22. package/entities/BIGIPNetwork/action.json +432 -0
  23. package/entities/BIGIPNetwork/schema.json +39 -0
  24. package/entities/BIGIPSystem/action.json +209 -0
  25. package/entities/BIGIPSystem/schema.json +28 -0
  26. package/package.json +24 -28
  27. package/pronghorn.json +5973 -13
  28. package/propertiesSchema.json +68 -7
  29. package/report/adapterInfo.json +8 -8
  30. package/report/auto-adapter-openapi.json +20632 -0
  31. package/report/updateReport1748555375038.json +120 -0
  32. package/sampleProperties.json +4 -0
  33. package/test/integration/adapterTestBasicGet.js +88 -54
  34. package/test/integration/adapterTestConnectivity.js +15 -16
  35. package/test/integration/adapterTestIntegration.js +2597 -38
  36. package/test/unit/adapterBaseTestUnit.js +641 -39
  37. package/test/unit/adapterTestUnit.js +4822 -61
  38. package/utils/adapterInfo.js +114 -164
  39. package/utils/argParser.js +44 -0
  40. package/utils/checkMigrate.js +77 -38
  41. package/utils/entitiesToDB.js +53 -42
  42. package/utils/logger.js +26 -0
  43. package/utils/modify.js +56 -55
  44. package/utils/mongoDbConnection.js +79 -0
  45. package/utils/mongoUtils.js +162 -0
  46. package/utils/taskMover.js +31 -32
  47. package/utils/tbScript.js +36 -172
  48. package/utils/tbUtils.js +84 -226
  49. package/utils/troubleshootingAdapter.js +68 -84
  50. package/utils/updateAdapterConfig.js +158 -0
  51. package/utils/addAuth.js +0 -94
  52. package/utils/artifactize.js +0 -146
  53. package/utils/basicGet.js +0 -50
  54. package/utils/packModificationScript.js +0 -35
  55. package/utils/patches2bundledDeps.js +0 -90
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env node
2
- /* @copyright Itential, LLC 2019 */
3
-
4
- const path = require('path');
5
- const { spawnSync } = require('child_process');
6
- const fs = require('fs-extra');
7
- const { createBundle } = require('./artifactize');
8
-
9
- const nodeEntryPath = path.resolve('.');
10
- createBundle(nodeEntryPath).then((pathObj) => {
11
- const { bundlePath, bundledAdapterPath } = pathObj;
12
- const npmIgnorePath = path.join(bundledAdapterPath, '.npmignore');
13
- const adapterPackagePath = path.join(bundledAdapterPath, 'package.json');
14
- const artifactPackagePath = path.join(bundlePath, 'package.json');
15
-
16
- // remove node_modules from .npmIgnore so that node_modules are included in the resulting tar from npm pack
17
- let npmIgnoreString;
18
- if (fs.existsSync(npmIgnorePath)) {
19
- npmIgnoreString = fs.readFileSync(npmIgnorePath, 'utf8');
20
- npmIgnoreString = npmIgnoreString.replace('node_modules', '');
21
- npmIgnoreString = npmIgnoreString.replace('\n\n', '\n');
22
- fs.writeFileSync(npmIgnorePath, npmIgnoreString);
23
- }
24
-
25
- // add files to package so that node_modules are included in the resulting tar from npm pack
26
- const adapterPackage = fs.readJSONSync(adapterPackagePath);
27
- adapterPackage.files = ['*'];
28
- fs.writeJSONSync(artifactPackagePath, adapterPackage, { spaces: 2 });
29
- const npmResult = spawnSync('npm', ['pack', '-q', bundlePath], { cwd: path.resolve(bundlePath, '..') });
30
- if (npmResult.status === 0) {
31
- fs.removeSync(bundlePath);
32
- console.log('Bundle folder removed');
33
- }
34
- console.log('Script successful');
35
- });
@@ -1,90 +0,0 @@
1
- const fs = require('fs');
2
- const semverSatisfies = require('semver/functions/satisfies');
3
- const packageJson = require('../package.json');
4
-
5
- try {
6
- // pattern supplied by semver.org via https://regex101.com/r/vkijKf/1/ but removed gm from end to only match a single semver
7
- // const semverPat = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
8
- // pattern supplied by semver.org via https://regex101.com/r/Ly7O1x/3/ with following changes
9
- // removed P's from before capturing group names and
10
- // removed gm from end to only match a single semver
11
- // const semverPat = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
12
-
13
- const patches = (fs.existsSync('./patches')) ? fs.readdirSync('./patches', { withFileTypes: true }) : [];
14
- if (!patches.length) {
15
- console.error('\nno patches - nothing to do\n');
16
- process.exitCode = 1;
17
- }
18
-
19
- const dependencies = packageJson.dependencies || {};
20
- if (!Object.keys(dependencies).length) {
21
- console.error('\nno dependencies - nothing to do\n');
22
- process.exitCode = 1;
23
- }
24
-
25
- let changed = false;
26
- console.error('\nprocessing patches');
27
- const bundledDependencies = packageJson.bundledDependencies || packageJson.bundleDependencies || [];
28
-
29
- patches.forEach((patch) => {
30
- if (!patch.isFile()) {
31
- console.error(`${patch.name} skipped, is not a regular file`);
32
- return;
33
- }
34
- if (!patch.name.endsWith('.patch')) {
35
- console.error(`${patch.name} skipped, does not end with .patch`);
36
- return;
37
- }
38
- const splits = patch.name.slice(0, -6).split('+');
39
- if (splits.length > 4) {
40
- console.error(`${patch.name} skipped, does not follow the naming convention (cannot use '+' other than to separate scope/package/semver and at most once within semver)`);
41
- return;
42
- }
43
- const scope = splits[0][0] === '@' ? splits.shift() : null;
44
- const packageName = splits.shift();
45
- const semver = splits.join('+');
46
- // const { groups } = semver.match(semverPat);
47
- const file = scope ? `${scope}/${packageName}` : packageName;
48
- if (dependencies[file] && semverSatisfies(semver, dependencies[file])) {
49
- if (!bundledDependencies.includes(file)) {
50
- bundledDependencies.push(file);
51
- console.error(`added ${file} to bundledDependencies`);
52
- changed = true;
53
- } else {
54
- console.error(`bundledDependencies already has ${file}`);
55
- }
56
- } else {
57
- const depmsg = dependencies[file] ? `version mismatch (${dependencies[file]}) in dependencies` : 'not found in dependencies';
58
- console.error(`patch ${patch.name} ${depmsg}`);
59
- }
60
- });
61
-
62
- if (!packageJson.bundledDependencies && bundledDependencies.length) {
63
- delete packageJson.bundleDependencies;
64
- packageJson.bundledDependencies = bundledDependencies;
65
- console.error('renaming bundleDependencies to bundledDependencies');
66
- changed = true;
67
- }
68
- if (changed) {
69
- fs.writeFileSync('./package.json.new', JSON.stringify(packageJson, null, 2));
70
- console.error('wrote package.json.new');
71
- fs.renameSync('./package.json', './package.json.old');
72
- console.error('moved package.json to package.json.old');
73
- fs.renameSync('./package.json.new', './package.json');
74
- console.error('moved package.json.new to package.json');
75
- } else {
76
- console.error('no changes\n');
77
- process.exitCode = 1;
78
- }
79
- } catch (e) {
80
- if (e) {
81
- // caught error, exit with status 2 to signify abject failure
82
- console.error(`\ncaught exception - ${e}\n`);
83
- process.exitCode = 2;
84
- } else {
85
- // caught false, exit with status 1 to signify nothing done
86
- process.exitCode = 1;
87
- }
88
- } finally {
89
- console.error('done\n');
90
- }