@itentialopensource/adapter-amazon_route53 0.4.11 → 0.5.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 (44) hide show
  1. package/.eslintrc.js +1 -0
  2. package/AUTH.md +7 -7
  3. package/BROKER.md +4 -4
  4. package/CALLS.md +9 -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 +23 -11
  12. package/TROUBLESHOOT.md +10 -1
  13. package/UTILITIES.md +473 -0
  14. package/adapter.js +5 -5
  15. package/adapterBase.js +52 -16
  16. package/package.json +24 -28
  17. package/pronghorn.json +15 -13
  18. package/propertiesSchema.json +78 -17
  19. package/report/adapterInfo.json +7 -7
  20. package/report/updateReport1748555092110.json +120 -0
  21. package/sampleProperties.json +4 -0
  22. package/test/integration/adapterTestBasicGet.js +88 -54
  23. package/test/integration/adapterTestConnectivity.js +15 -16
  24. package/test/integration/adapterTestIntegration.js +12 -45
  25. package/test/unit/adapterBaseTestUnit.js +641 -39
  26. package/test/unit/adapterTestUnit.js +28 -61
  27. package/utils/adapterInfo.js +114 -164
  28. package/utils/argParser.js +44 -0
  29. package/utils/checkMigrate.js +77 -38
  30. package/utils/entitiesToDB.js +53 -42
  31. package/utils/logger.js +26 -0
  32. package/utils/modify.js +56 -55
  33. package/utils/mongoDbConnection.js +79 -0
  34. package/utils/mongoUtils.js +162 -0
  35. package/utils/taskMover.js +31 -32
  36. package/utils/tbScript.js +36 -172
  37. package/utils/tbUtils.js +84 -226
  38. package/utils/troubleshootingAdapter.js +68 -84
  39. package/utils/updateAdapterConfig.js +158 -0
  40. package/utils/addAuth.js +0 -94
  41. package/utils/artifactize.js +0 -146
  42. package/utils/basicGet.js +0 -50
  43. package/utils/packModificationScript.js +0 -35
  44. package/utils/patches2bundledDeps.js +0 -90
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-amazon_route53",
3
- "version": "0.4.11",
3
+ "version": "0.5.0",
4
4
  "description": "This adapter integrates with system described as: Amazon Route53.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Amazon AWS Route53",
7
7
  "wizardVersion": "2.44.7",
8
- "engineVersion": "1.68.2",
8
+ "engineVersion": "1.69.14",
9
9
  "adapterType": "http",
10
10
  "scripts": {
11
- "artifactize": "npm i && node utils/packModificationScript.js",
12
11
  "preinstall": "node utils/setup.js",
13
12
  "deinstall": "node utils/removeHooks.js",
14
13
  "lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js",
@@ -18,7 +17,6 @@
18
17
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
19
18
  "adapter:patches2bundled": "node utils/patches2bundledDeps.js",
20
19
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
21
- "adapter:install": "npm i && node utils/tbScript.js install",
22
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
23
21
  "adapter:findPath": "node utils/findPath.js",
24
22
  "adapter:migrate": "node utils/modify.js -m",
@@ -33,10 +31,9 @@
33
31
  },
34
32
  "keywords": [
35
33
  "Itential",
36
- "IAP",
34
+ "Itential Platform",
37
35
  "Automation",
38
36
  "Integration",
39
- "App-Artifacts",
40
37
  "Adapter",
41
38
  "Cloud",
42
39
  "Amazon",
@@ -55,30 +52,29 @@
55
52
  "author": "Itential",
56
53
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-amazon_route53#readme",
57
54
  "dependencies": {
58
- "@itentialopensource/adapter-utils": "^5.10.9",
59
- "acorn": "^8.14.0",
60
- "ajv": "^8.17.1",
61
- "axios": "^1.8.2",
62
- "commander": "^11.0.0",
63
- "dns-lookup-promise": "^1.0.4",
64
- "fs-extra": "^11.2.0",
65
- "json-query": "^2.2.2",
66
- "mocha": "^10.8.2",
67
- "mocha-param": "^2.0.1",
68
- "mongodb": "^4.17.2",
69
- "ping": "^0.4.4",
70
- "prompts": "^2.4.2",
71
- "readline-sync": "^1.4.10",
72
- "semver": "^7.6.3",
73
- "winston": "^3.17.0"
55
+ "@itentialopensource/adapter-utils": "5.10.16",
56
+ "acorn": "8.14.1",
57
+ "ajv": "8.17.1",
58
+ "axios": "1.9.0",
59
+ "commander": "11.1.0",
60
+ "fs-extra": "11.3.0",
61
+ "json-query": "2.2.2",
62
+ "mocha": "10.8.2",
63
+ "mocha-param": "2.0.1",
64
+ "mongodb": "4.17.2",
65
+ "ping": "0.4.4",
66
+ "prompts": "2.4.2",
67
+ "readline-sync": "1.4.10",
68
+ "semver": "7.7.2",
69
+ "winston": "3.17.0"
74
70
  },
75
71
  "devDependencies": {
76
- "chai": "^4.3.7",
77
- "eslint": "^8.44.0",
78
- "eslint-config-airbnb-base": "^15.0.0",
79
- "eslint-plugin-import": "^2.27.5",
80
- "eslint-plugin-json": "^3.1.0",
81
- "testdouble": "^3.18.0"
72
+ "chai": "4.5.0",
73
+ "eslint": "8.57.0",
74
+ "eslint-config-airbnb-base": "15.0.0",
75
+ "eslint-plugin-import": "2.31.0",
76
+ "eslint-plugin-json": "3.1.0",
77
+ "testdouble": "3.18.0"
82
78
  },
83
79
  "private": false
84
80
  }
package/pronghorn.json CHANGED
@@ -226,16 +226,6 @@
226
226
  "title": "props",
227
227
  "type": "object"
228
228
  }
229
- },
230
- {
231
- "name": "persistFlag",
232
- "type": "boolean",
233
- "info": "Whether the input properties should be saved",
234
- "required": true,
235
- "schema": {
236
- "title": "persistFlag",
237
- "type": "boolean"
238
- }
239
229
  }
240
230
  ],
241
231
  "output": {
@@ -306,7 +296,19 @@
306
296
  "name": "iapRunAdapterBasicGet",
307
297
  "summary": "Runs basicGet script for adapter",
308
298
  "description": "Runs basicGet script for adapter",
309
- "input": [],
299
+ "input": [
300
+ {
301
+ "name": "maxCalls",
302
+ "required": false,
303
+ "type": "number",
304
+ "info": "How many GET endpoints to test (defaults to 5)",
305
+ "schema": {
306
+ "title": "maxCalls",
307
+ "type": "number",
308
+ "default": 5
309
+ }
310
+ }
311
+ ],
310
312
  "output": {
311
313
  "name": "result",
312
314
  "type": "object",
@@ -327,8 +329,8 @@
327
329
  },
328
330
  {
329
331
  "name": "iapMoveAdapterEntitiesToDB",
330
- "summary": "Moves entities from an adapter into the IAP database",
331
- "description": "Moves entities from an adapter into the IAP database",
332
+ "summary": "Moves entities from an adapter into the Itential Platform database",
333
+ "description": "Moves entities from an adapter into the Itential Platform database",
332
334
  "input": [],
333
335
  "output": {
334
336
  "name": "res",
@@ -74,7 +74,7 @@
74
74
  "boolean",
75
75
  "string"
76
76
  ],
77
- "description": "When true the metrics collected by the adapter will be stored in mongo or in the adapter. If a full path is provided, metrics will be saved in the path provided.",
77
+ "description": "When true the metrics collected by the adapter will be stored in mongo or on the filesystem",
78
78
  "default": false
79
79
  },
80
80
  "stub": {
@@ -221,7 +221,7 @@
221
221
  "description": "How long a token is valid (in milliseconds), -1 (always get token), 0 use expiration returned with token",
222
222
  "default": -1,
223
223
  "minimum": -1,
224
- "maximum": 86400000
224
+ "maximum": 3600000
225
225
  },
226
226
  "token_cache": {
227
227
  "type": "string",
@@ -512,7 +512,7 @@
512
512
  "type": "integer",
513
513
  "description": "How often the healthcheck should run (in milliseconds).",
514
514
  "default": 300000,
515
- "minimum": 30000,
515
+ "minimum": 60000,
516
516
  "maximum": 3600000
517
517
  },
518
518
  "protocol": {
@@ -854,6 +854,14 @@
854
854
  "security/ca.pem"
855
855
  ]
856
856
  },
857
+ "ca_file_content": {
858
+ "type": "string",
859
+ "description": "The content of the CA file used for SSL",
860
+ "default": "",
861
+ "examples": [
862
+ "-----BEGIN CERTIFICATE-----"
863
+ ]
864
+ },
857
865
  "key_file": {
858
866
  "type": "string",
859
867
  "description": "The fully qualified path name to the key file used for SSL",
@@ -943,32 +951,48 @@
943
951
  "mongo": {
944
952
  "type": "object",
945
953
  "properties": {
954
+ "url": {
955
+ "type": "string",
956
+ "description": "Mongo's complete connection URL. This property overrides host, port, database, username, password and replSet settings.",
957
+ "examples": [
958
+ "mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]",
959
+ "mongodb+srv://[username:password@]cluster0.xxxxx.mongodb.net/[defaultauthdb][?options]",
960
+ "mongodb+srv://cluster0.xxxxx.mongodb.net/[defaultauthdb][?options]"
961
+ ]
962
+ },
946
963
  "host": {
947
964
  "type": "string",
948
- "description": "host where mongo database can be found",
965
+ "description": "Host information for the Mongo server",
949
966
  "default": "",
950
967
  "examples": [
951
- "localhost"
968
+ "localhost",
969
+ "cluster0.xxxxx.mongodb.net",
970
+ "my-cluster.example.com"
952
971
  ]
953
972
  },
954
973
  "port": {
955
974
  "type": "integer",
956
- "description": "port on which to connect to the mongo database",
975
+ "description": "Port information for the Mongo server. Not used when using mongodb+srv:// protocol",
957
976
  "default": 443,
958
977
  "minimum": 0,
959
978
  "maximum": 65535
960
979
  },
961
980
  "database": {
962
981
  "type": "string",
963
- "description": "The name of the database to store adapter information in",
982
+ "description": "The database for the adapter to use for its data.",
964
983
  "default": "",
965
984
  "examples": [
966
985
  "adapter-xyz"
967
986
  ]
968
987
  },
988
+ "dbAuth": {
989
+ "type": "boolean",
990
+ "description": "Whether to use authentication for MongoDB connection. Default is false.",
991
+ "default": false
992
+ },
969
993
  "username": {
970
994
  "type": "string",
971
- "description": "The user to connect to the database with",
995
+ "description": "If credentials are required to access Mongo, this is the user to login as.",
972
996
  "default": "",
973
997
  "examples": [
974
998
  "username"
@@ -976,7 +1000,7 @@
976
1000
  },
977
1001
  "password": {
978
1002
  "type": "string",
979
- "description": "The password to connect to the database with",
1003
+ "description": "If credentials are required to access Mongo, this is the password to login with.",
980
1004
  "default": "",
981
1005
  "examples": [
982
1006
  "password"
@@ -984,12 +1008,17 @@
984
1008
  },
985
1009
  "replSet": {
986
1010
  "type": "string",
987
- "description": "The replica set for the database",
1011
+ "description": "If the database is set up to use replica sets, define it here so it can be added to the database connection. Not used when using mongodb+srv:// protocol",
988
1012
  "default": "",
989
1013
  "examples": [
990
1014
  "my_repolica_set"
991
1015
  ]
992
1016
  },
1017
+ "addSrv": {
1018
+ "type": "boolean",
1019
+ "description": "Whether the connection requires the mongodb+srv:// protocol. If true, uses mongodb+srv:// protocol. Note: mongodb+srv:// can also be used for non-Atlas deployments that support DNS SRV records",
1020
+ "default": false
1021
+ },
993
1022
  "db_ssl": {
994
1023
  "type": "object",
995
1024
  "description": "SSL for mongo database connection",
@@ -1030,6 +1059,38 @@
1030
1059
  }
1031
1060
  }
1032
1061
  }
1062
+ },
1063
+ "dependencies": {
1064
+ "dbAuth": {
1065
+ "oneOf": [
1066
+ {
1067
+ "properties": {
1068
+ "dbAuth": {
1069
+ "const": false
1070
+ }
1071
+ }
1072
+ },
1073
+ {
1074
+ "properties": {
1075
+ "dbAuth": {
1076
+ "const": true
1077
+ },
1078
+ "username": {
1079
+ "type": "string",
1080
+ "minLength": 1
1081
+ },
1082
+ "password": {
1083
+ "type": "string",
1084
+ "minLength": 1
1085
+ }
1086
+ },
1087
+ "required": [
1088
+ "username",
1089
+ "password"
1090
+ ]
1091
+ }
1092
+ ]
1093
+ }
1033
1094
  }
1034
1095
  },
1035
1096
  "devicebroker": {
@@ -1615,12 +1676,12 @@
1615
1676
  "properties": {
1616
1677
  "path": {
1617
1678
  "type": "string",
1618
- "description": "The fully qualified path of the call to populate the cache (e.g. /rest/api/devices)",
1679
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
1619
1680
  "default": ""
1620
1681
  },
1621
1682
  "method": {
1622
1683
  "type": "string",
1623
- "description": "The method of the call to populate the cache",
1684
+ "description": "The method of the call to getDevice",
1624
1685
  "default": "GET"
1625
1686
  },
1626
1687
  "pagination": {
@@ -1657,7 +1718,7 @@
1657
1718
  },
1658
1719
  "query": {
1659
1720
  "type": "object",
1660
- "description": "The json object with query parameters of the call to populate the cache",
1721
+ "description": "The json object with query parameters of the call to getDevice",
1661
1722
  "additionalProperties": {
1662
1723
  "type": [
1663
1724
  "string",
@@ -1667,7 +1728,7 @@
1667
1728
  },
1668
1729
  "body": {
1669
1730
  "type": "object",
1670
- "description": "The json object with body of the call to populate the cache",
1731
+ "description": "The json object with body of the call to getDevice",
1671
1732
  "additionalProperties": {
1672
1733
  "type": [
1673
1734
  "string",
@@ -1677,7 +1738,7 @@
1677
1738
  },
1678
1739
  "headers": {
1679
1740
  "type": "object",
1680
- "description": "The json object with headers of the call to populate the cache",
1741
+ "description": "The json object with headers of the call to getDevice",
1681
1742
  "additionalProperties": {
1682
1743
  "type": [
1683
1744
  "string",
@@ -1696,7 +1757,7 @@
1696
1757
  },
1697
1758
  "requestFields": {
1698
1759
  "type": "object",
1699
- "description": "The json object with response fields of the call to populate the cache",
1760
+ "description": "The json object with response fields of the call to getDevice",
1700
1761
  "additionalProperties": {
1701
1762
  "type": [
1702
1763
  "string",
@@ -1712,7 +1773,7 @@
1712
1773
  },
1713
1774
  "responseFields": {
1714
1775
  "type": "object",
1715
- "description": "The json object with response fields of the call to populate the cache",
1776
+ "description": "The json object with response fields of the call to getDevice",
1716
1777
  "additionalProperties": {
1717
1778
  "type": [
1718
1779
  "string",
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.4.9",
3
- "configLines": 9948,
4
- "scriptLines": 1783,
5
- "codeLines": 9292,
6
- "testLines": 6920,
7
- "testCases": 353,
8
- "totalCodeLines": 17995,
2
+ "version": "0.4.11",
3
+ "configLines": 11993,
4
+ "scriptLines": 2498,
5
+ "codeLines": 9328,
6
+ "testLines": 7489,
7
+ "testCases": 366,
8
+ "totalCodeLines": 19315,
9
9
  "wfTasks": 153
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 15
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 19
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "5.10.16"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 85
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 345
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 662
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 57
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 3551
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 209
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2075
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 73
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1489
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 37
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 7115
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 282
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -109,18 +109,22 @@
109
109
  "enabled": false,
110
110
  "accept_invalid_cert": false,
111
111
  "ca_file": "",
112
+ "ca_file_content": "",
112
113
  "key_file": "",
113
114
  "cert_file": "",
114
115
  "secure_protocol": "",
115
116
  "ciphers": ""
116
117
  },
117
118
  "mongo": {
119
+ "url": "",
118
120
  "host": "",
119
121
  "port": 0,
120
122
  "database": "",
123
+ "dbAuth": false,
121
124
  "username": "",
122
125
  "password": "",
123
126
  "replSet": "",
127
+ "addSrv": false,
124
128
  "db_ssl": {
125
129
  "enabled": false,
126
130
  "accept_invalid_cert": false,