@itentialopensource/adapter-robustel 0.1.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 (54) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +205 -0
  4. package/CHANGELOG.md +17 -2
  5. package/CODE_OF_CONDUCT.md +12 -17
  6. package/CONTRIBUTING.md +3 -148
  7. package/ENHANCE.md +69 -0
  8. package/PROPERTIES.md +641 -0
  9. package/README.md +235 -576
  10. package/SUMMARY.md +9 -0
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +402 -573
  14. package/adapterBase.js +843 -419
  15. package/changelogs/changelog.md +16 -0
  16. package/entities/.generic/action.json +105 -0
  17. package/entities/.generic/schema.json +6 -1
  18. package/error.json +6 -0
  19. package/metadata.json +47 -0
  20. package/package.json +24 -24
  21. package/pronghorn.json +559 -148
  22. package/propertiesDecorators.json +14 -0
  23. package/propertiesSchema.json +842 -6
  24. package/refs?service=git-upload-pack +0 -0
  25. package/report/adapter-openapi.json +204 -0
  26. package/report/adapter-openapi.yaml +163 -0
  27. package/report/adapterInfo.json +10 -0
  28. package/report/updateReport1653173664637.json +120 -0
  29. package/report/updateReport1691507608338.json +120 -0
  30. package/report/updateReport1692202610637.json +120 -0
  31. package/report/updateReport1694462053440.json +120 -0
  32. package/report/updateReport1698421016757.json +120 -0
  33. package/sampleProperties.json +158 -5
  34. package/test/integration/adapterTestBasicGet.js +3 -5
  35. package/test/integration/adapterTestConnectivity.js +91 -42
  36. package/test/integration/adapterTestIntegration.js +269 -271
  37. package/test/unit/adapterBaseTestUnit.js +388 -308
  38. package/test/unit/adapterTestUnit.js +399 -260
  39. package/utils/adapterInfo.js +206 -0
  40. package/utils/addAuth.js +1 -1
  41. package/utils/artifactize.js +1 -1
  42. package/utils/checkMigrate.js +1 -1
  43. package/utils/entitiesToDB.js +12 -57
  44. package/utils/findPath.js +1 -1
  45. package/utils/methodDocumentor.js +273 -0
  46. package/utils/modify.js +13 -15
  47. package/utils/packModificationScript.js +1 -1
  48. package/utils/pre-commit.sh +5 -0
  49. package/utils/taskMover.js +309 -0
  50. package/utils/tbScript.js +123 -53
  51. package/utils/tbUtils.js +87 -49
  52. package/utils/testRunner.js +17 -17
  53. package/utils/troubleshootingAdapter.js +9 -6
  54. package/workflows/README.md +0 -3
@@ -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": 17
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": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.1.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 79
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 343
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": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
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": 1660
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 79
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 628
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 15
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1350
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 3638
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 94
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -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": 17
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": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.1.7"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 79
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 347
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": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
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": 1666
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 79
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 628
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 15
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 3747
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 94
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -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": 17
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": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.3.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 80
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 347
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": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
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": 1666
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 79
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 628
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 15
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 3747
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 94
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -4,11 +4,13 @@
4
4
  "properties": {
5
5
  "host": "rcms-cloud.robustel.net",
6
6
  "port": 443,
7
+ "choosepath": "",
7
8
  "base_path": "/api/link",
8
9
  "version": "",
9
10
  "cache_location": "none",
10
11
  "encode_pathvars": true,
11
- "save_metric": true,
12
+ "encode_queryvars": true,
13
+ "save_metric": false,
12
14
  "stub": false,
13
15
  "protocol": "https",
14
16
  "authentication": {
@@ -22,14 +24,32 @@
22
24
  "auth_field": "header.headers.Authorization",
23
25
  "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
24
26
  "auth_logging": false,
25
- "client_id": "",
26
- "client_secret": "",
27
- "grant_type": ""
27
+ "client_id": "id",
28
+ "client_secret": "secret",
29
+ "grant_type": "",
30
+ "sensitive": [],
31
+ "sso": {
32
+ "protocol": "",
33
+ "host": "",
34
+ "port": 0
35
+ },
36
+ "multiStepAuthCalls": [
37
+ {
38
+ "name": "",
39
+ "requestFields": {},
40
+ "responseFields": {},
41
+ "successfullResponseCode": 200
42
+ }
43
+ ],
44
+ "api_version": "1.0",
45
+ "signature_version": "1.0",
46
+ "unique_code": "unique_code"
28
47
  },
29
48
  "healthcheck": {
30
49
  "type": "none",
31
50
  "frequency": 60000,
32
- "query_object": {}
51
+ "query_object": {},
52
+ "addlHeaders": {}
33
53
  },
34
54
  "throttle": {
35
55
  "throttle_enabled": false,
@@ -97,6 +117,139 @@
97
117
  "key_file": "",
98
118
  "cert_file": ""
99
119
  }
120
+ },
121
+ "devicebroker": {
122
+ "getDevice": [
123
+ {
124
+ "path": "/get/devices/{id}",
125
+ "method": "GET",
126
+ "query": {},
127
+ "body": {},
128
+ "headers": {},
129
+ "handleFailure": "ignore",
130
+ "requestFields": {
131
+ "id": "name"
132
+ },
133
+ "responseDatakey": "",
134
+ "responseFields": {
135
+ "name": "host",
136
+ "ostype": "os",
137
+ "ostypePrefix": "system-",
138
+ "ipaddress": "attributes.ipaddr",
139
+ "port": "443"
140
+ }
141
+ }
142
+ ],
143
+ "getDevicesFiltered": [
144
+ {
145
+ "path": "/get/devices",
146
+ "method": "GET",
147
+ "pagination": {
148
+ "offsetVar": "",
149
+ "limitVar": "",
150
+ "incrementBy": "limit",
151
+ "requestLocation": "query"
152
+ },
153
+ "query": {},
154
+ "body": {},
155
+ "headers": {},
156
+ "handleFailure": "ignore",
157
+ "requestFields": {},
158
+ "responseDatakey": "",
159
+ "responseFields": {
160
+ "name": "host",
161
+ "ostype": "os",
162
+ "ostypePrefix": "system-",
163
+ "ipaddress": "attributes.ipaddr",
164
+ "port": "443"
165
+ }
166
+ }
167
+ ],
168
+ "isAlive": [
169
+ {
170
+ "path": "/get/devices/{id}/status",
171
+ "method": "GET",
172
+ "query": {},
173
+ "body": {},
174
+ "headers": {},
175
+ "handleFailure": "ignore",
176
+ "requestFields": {
177
+ "id": "name"
178
+ },
179
+ "responseDatakey": "",
180
+ "responseFields": {
181
+ "status": "status",
182
+ "statusValue": "online"
183
+ }
184
+ }
185
+ ],
186
+ "getConfig": [
187
+ {
188
+ "path": "/get/devices/{id}/configPart1",
189
+ "method": "GET",
190
+ "query": {},
191
+ "body": {},
192
+ "headers": {},
193
+ "handleFailure": "ignore",
194
+ "requestFields": {
195
+ "id": "name"
196
+ },
197
+ "responseDatakey": "",
198
+ "responseFields": {}
199
+ }
200
+ ],
201
+ "getCount": [
202
+ {
203
+ "path": "/get/devices",
204
+ "method": "GET",
205
+ "query": {},
206
+ "body": {},
207
+ "headers": {},
208
+ "handleFailure": "ignore",
209
+ "requestFields": {},
210
+ "responseDatakey": "",
211
+ "responseFields": {}
212
+ }
213
+ ]
214
+ },
215
+ "cache": {
216
+ "enabled": false,
217
+ "entities": [
218
+ {
219
+ "entityType": "",
220
+ "frequency": 1440,
221
+ "flushOnFail": false,
222
+ "limit": 1000,
223
+ "retryAttempts": 5,
224
+ "sort": true,
225
+ "populate": [
226
+ {
227
+ "path": "",
228
+ "method": "GET",
229
+ "pagination": {
230
+ "offsetVar": "",
231
+ "limitVar": "",
232
+ "incrementBy": "limit",
233
+ "requestLocation": "query"
234
+ },
235
+ "query": {},
236
+ "body": {},
237
+ "headers": {},
238
+ "handleFailure": "ignore",
239
+ "requestFields": {},
240
+ "responseDatakey": "",
241
+ "responseFields": {}
242
+ }
243
+ ],
244
+ "cachedTasks": [
245
+ {
246
+ "name": "",
247
+ "filterField": "",
248
+ "filterLoc": ""
249
+ }
250
+ ]
251
+ }
252
+ ]
100
253
  }
101
254
  },
102
255
  "groups": [],
@@ -7,9 +7,9 @@
7
7
  /* eslint import/no-dynamic-require: warn */
8
8
  /* eslint import/no-unresolved: warn */
9
9
 
10
- const mocha = require('mocha');
11
10
  const path = require('path');
12
11
  const assert = require('assert');
12
+ const mocha = require('mocha');
13
13
  const itParam = require('mocha-param');
14
14
 
15
15
  const utils = require('../../utils/tbUtils');
@@ -18,12 +18,10 @@ const { name } = require('../../package.json');
18
18
  const { methods } = require('../../pronghorn.json');
19
19
 
20
20
  const getPronghornProps = (iapDir) => {
21
- const { Discovery } = require('@itential/itential-utils');
22
21
  console.log('Retrieving properties.json file...');
23
22
  const rawProps = require(path.join(iapDir, 'properties.json'));
24
23
  console.log('Decrypting properties...');
25
- const discovery = new Discovery();
26
- const pronghornProps = utils.decryptProperties(rawProps, path.join(__dirname, '..'), discovery);
24
+ const pronghornProps = utils.decryptProperties(rawProps, iapDir);
27
25
  console.log('Found properties.\n');
28
26
  return pronghornProps;
29
27
  };
@@ -34,7 +32,7 @@ describe('[integration] Adapter BasicGET Test', () => {
34
32
  context('Testing GET calls without query parameters', () => {
35
33
  before(async () => {
36
34
  const iapDir = path.join(__dirname, '../../../../../');
37
- if (!utils.withinIAP(iapDir)) {
35
+ if (!utils.areWeUnderIAPinstallationDirectory()) {
38
36
  const sampleProperties = require('../../sampleProperties.json');
39
37
  const adapter = { properties: sampleProperties };
40
38
  a = basicGet.getAdapterInstance(adapter);