@itentialopensource/adapter-robustel 0.1.1

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 (53) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/CHANGELOG.md +9 -0
  5. package/CODE_OF_CONDUCT.md +48 -0
  6. package/CONTRIBUTING.md +158 -0
  7. package/LICENSE +201 -0
  8. package/README.md +687 -0
  9. package/adapter.js +1660 -0
  10. package/adapterBase.js +1028 -0
  11. package/entities/.generic/action.json +109 -0
  12. package/entities/.generic/schema.json +23 -0
  13. package/entities/.system/action.json +50 -0
  14. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  15. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  16. package/entities/.system/schema.json +19 -0
  17. package/entities/.system/schemaTokenReq.json +53 -0
  18. package/entities/.system/schemaTokenResp.json +53 -0
  19. package/entities/Dashboard/action.json +46 -0
  20. package/entities/Dashboard/schema.json +20 -0
  21. package/entities/Device/action.json +87 -0
  22. package/entities/Device/schema.json +22 -0
  23. package/error.json +184 -0
  24. package/package.json +84 -0
  25. package/pronghorn.json +774 -0
  26. package/propertiesSchema.json +840 -0
  27. package/refs?service=git-upload-pack +0 -0
  28. package/report/Robustel.swagger-converted (3).json +204 -0
  29. package/report/creationReport.json +214 -0
  30. package/report/updateReport1645453224836.json +95 -0
  31. package/sampleProperties.json +106 -0
  32. package/test/integration/adapterTestBasicGet.js +85 -0
  33. package/test/integration/adapterTestConnectivity.js +93 -0
  34. package/test/integration/adapterTestIntegration.js +629 -0
  35. package/test/unit/adapterBaseTestUnit.js +944 -0
  36. package/test/unit/adapterTestUnit.js +1526 -0
  37. package/utils/addAuth.js +94 -0
  38. package/utils/artifactize.js +146 -0
  39. package/utils/basicGet.js +50 -0
  40. package/utils/checkMigrate.js +63 -0
  41. package/utils/entitiesToDB.js +224 -0
  42. package/utils/findPath.js +74 -0
  43. package/utils/modify.js +154 -0
  44. package/utils/packModificationScript.js +35 -0
  45. package/utils/patches2bundledDeps.js +90 -0
  46. package/utils/pre-commit.sh +27 -0
  47. package/utils/removeHooks.js +20 -0
  48. package/utils/setup.js +33 -0
  49. package/utils/tbScript.js +169 -0
  50. package/utils/tbUtils.js +451 -0
  51. package/utils/testRunner.js +298 -0
  52. package/utils/troubleshootingAdapter.js +190 -0
  53. package/workflows/README.md +3 -0
Binary file
@@ -0,0 +1,204 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "description": "Robustel NMS REST API",
5
+ "version": "1.0.0",
6
+ "title": "Robustel",
7
+ "termsOfService": "http://swagger.io/terms/",
8
+ "contact": {
9
+ "email": "apiteam@swagger.io"
10
+ },
11
+ "license": {
12
+ "name": "Apache 2.0",
13
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
14
+ }
15
+ },
16
+ "servers": [
17
+ {
18
+ "url": "https://locahost/"
19
+ }
20
+ ],
21
+ "security": [],
22
+ "paths": {
23
+ "/dashboard/deviceTotal": {
24
+ "get": {
25
+ "parameters": [],
26
+ "tags": [
27
+ "Dashboard"
28
+ ],
29
+ "operationId": "getDeviceTotal",
30
+ "summary": "Get Device Total",
31
+ "description": "Get Device Total from Dashboard",
32
+ "responses": {
33
+ "200": {
34
+ "description": "successful operation"
35
+ },
36
+ "400": {
37
+ "description": "failed operation"
38
+ }
39
+ }
40
+ }
41
+ },
42
+ "/dashboard/networkTotal": {
43
+ "get": {
44
+ "parameters": [],
45
+ "tags": [
46
+ "Dashboard"
47
+ ],
48
+ "operationId": "getNetworkTotal",
49
+ "summary": "Get Network Total",
50
+ "description": "Get Network Total from Dashboard",
51
+ "responses": {
52
+ "200": {
53
+ "description": "successful operation"
54
+ },
55
+ "400": {
56
+ "description": "failed operation"
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "/device/devices/{serialNumber}": {
62
+ "get": {
63
+ "parameters": [
64
+ {
65
+ "name": "serialNumber",
66
+ "in": "path",
67
+ "description": "serial number",
68
+ "required": true,
69
+ "schema": {
70
+ "type": "string"
71
+ }
72
+ }
73
+ ],
74
+ "tags": [
75
+ "Device"
76
+ ],
77
+ "operationId": "getDeviceDetails",
78
+ "summary": "Get Device Details",
79
+ "description": "Get Device Details from Device Tree",
80
+ "responses": {
81
+ "200": {
82
+ "description": "successful operation"
83
+ },
84
+ "400": {
85
+ "description": "failed operation"
86
+ }
87
+ }
88
+ }
89
+ },
90
+ "/devices/{serialNumber}/firmwares": {
91
+ "get": {
92
+ "parameters": [
93
+ {
94
+ "name": "serialNumber",
95
+ "in": "path",
96
+ "description": "device serial number",
97
+ "required": true,
98
+ "schema": {
99
+ "type": "string"
100
+ }
101
+ }
102
+ ],
103
+ "tags": [
104
+ "Device"
105
+ ],
106
+ "operationId": "getDeviceFirmwareList",
107
+ "summary": "Get Device Firmware List",
108
+ "description": "Get Device Firmware List",
109
+ "responses": {
110
+ "200": {
111
+ "description": "successful operation"
112
+ },
113
+ "400": {
114
+ "description": "failed operation"
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "/devices/{serialNumber}": {
120
+ "put": {
121
+ "parameters": [
122
+ {
123
+ "in": "path",
124
+ "name": "serialNumber",
125
+ "description": "device serial number",
126
+ "required": true,
127
+ "schema": "string"
128
+ }
129
+ ],
130
+ "requestBody": {
131
+ "description": "{ \t\"commandType\": \"UpgradeFirmware\", \t\"softwareVersionId\": \"e8c886ba5ff4415a9ca88f79bd11cdec\" } {\"commandType\": \"GenerateConfigFile\"}",
132
+ "required": true,
133
+ "content": {
134
+ "*/*": {
135
+ "schema": {
136
+ "type": "object"
137
+ }
138
+ }
139
+ }
140
+ },
141
+ "tags": [
142
+ "Device"
143
+ ],
144
+ "operationId": "runCommandOnDevice",
145
+ "summary": "Run Command on Device",
146
+ "description": "Run Command on Device",
147
+ "responses": {
148
+ "200": {
149
+ "description": "successful operation"
150
+ },
151
+ "400": {
152
+ "description": "failed operation"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "/command/{commandId}": {
158
+ "get": {
159
+ "parameters": [
160
+ {
161
+ "name": "commandId",
162
+ "in": "path",
163
+ "description": "commandId",
164
+ "required": true,
165
+ "schema": {
166
+ "type": "string"
167
+ }
168
+ }
169
+ ],
170
+ "tags": [
171
+ "Device"
172
+ ],
173
+ "operationId": "getFirmwareUpdateResult",
174
+ "summary": "Get Firmware Update Result",
175
+ "description": "Get Firmware Update Result using commandId",
176
+ "responses": {
177
+ "200": {
178
+ "description": "successful operation"
179
+ },
180
+ "400": {
181
+ "description": "failed operation"
182
+ }
183
+ }
184
+ }
185
+ }
186
+ },
187
+ "externalDocs": {
188
+ "description": "Find out more about the OpenAPI Initiative",
189
+ "url": "https://www.openapis.org/"
190
+ },
191
+ "tags": [
192
+ {
193
+ "name": "Device",
194
+ "description": "Device Group"
195
+ },
196
+ {
197
+ "name": "Dashboard",
198
+ "description": "Dashboard Group"
199
+ }
200
+ ],
201
+ "components": {
202
+ "securitySchemes": {}
203
+ }
204
+ }
@@ -0,0 +1,214 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "Standard adapter errors available for use",
7
+ "value": 30
8
+ },
9
+ {
10
+ "owner": "packageJson",
11
+ "description": "Number of production dependencies",
12
+ "value": 13
13
+ },
14
+ {
15
+ "owner": "packageJson",
16
+ "description": "Number of development dependencies",
17
+ "value": 7
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of npm scripts",
22
+ "value": 23
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Runtime Library dependency",
27
+ "value": "^4.44.11"
28
+ },
29
+ {
30
+ "owner": "propertiesSchemaJson",
31
+ "description": "Adapter properties defined in the propertiesSchema file",
32
+ "value": 64
33
+ },
34
+ {
35
+ "owner": "adapterJS",
36
+ "description": "Lines of code generated in adapter.js",
37
+ "value": 1060
38
+ },
39
+ {
40
+ "owner": "adapterJS",
41
+ "description": "Number of Functions added to adapter.js",
42
+ "value": 6
43
+ },
44
+ {
45
+ "owner": "pronghornJson",
46
+ "description": "Number of Methods added to pronghorn.json",
47
+ "value": 6
48
+ },
49
+ {
50
+ "owner": "readmeMd",
51
+ "description": "Number of lines in the README.md",
52
+ "value": 688
53
+ },
54
+ {
55
+ "owner": "unitTestJS",
56
+ "description": "Number of lines of code in unit tests",
57
+ "value": 1425
58
+ },
59
+ {
60
+ "owner": "unitTestJS",
61
+ "description": "Number of unit tests",
62
+ "value": 58
63
+ },
64
+ {
65
+ "owner": "integrationTestJS",
66
+ "description": "Number of lines of code in integration tests",
67
+ "value": 627
68
+ },
69
+ {
70
+ "owner": "integrationTestJS",
71
+ "description": "Number of integration tests",
72
+ "value": 12
73
+ },
74
+ {
75
+ "owner": "actionJson",
76
+ "description": "Number of actions for Dashboard entity",
77
+ "value": 2
78
+ },
79
+ {
80
+ "owner": "actionJson",
81
+ "description": "Number of actions for Device entity",
82
+ "value": 4
83
+ },
84
+ {
85
+ "owner": "actionJson",
86
+ "description": "Total number of actions",
87
+ "value": 6
88
+ },
89
+ {
90
+ "owner": "actionJson",
91
+ "description": "Total number of entities",
92
+ "value": 2
93
+ },
94
+ {
95
+ "owner": "schemaJson",
96
+ "description": "Number of schemas for Dashboard entity",
97
+ "value": 1
98
+ },
99
+ {
100
+ "owner": "schemaJson",
101
+ "description": "Number of schemas for Device entity",
102
+ "value": 1
103
+ },
104
+ {
105
+ "owner": "schemaJson",
106
+ "description": "Total number of schemas",
107
+ "value": 2
108
+ },
109
+ {
110
+ "owner": "mockdata",
111
+ "description": "Number of mock data files for Dashboard entity",
112
+ "value": 0
113
+ },
114
+ {
115
+ "owner": "mockdata",
116
+ "description": "Number of mock data files for Device entity",
117
+ "value": 0
118
+ },
119
+ {
120
+ "owner": "mockdata",
121
+ "description": "Total number of mock data files",
122
+ "value": 0
123
+ },
124
+ {
125
+ "owner": "actionJson",
126
+ "description": "Number of actions for .system entity",
127
+ "value": 2
128
+ },
129
+ {
130
+ "owner": "schemaJson",
131
+ "description": "Number of schemas for .system entity",
132
+ "value": 3
133
+ },
134
+ {
135
+ "owner": "mockdata",
136
+ "description": "Number of mock data files for .system entity",
137
+ "value": 2
138
+ },
139
+ {
140
+ "owner": "System",
141
+ "description": "System entity files",
142
+ "value": 6
143
+ },
144
+ {
145
+ "owner": "usecases",
146
+ "description": "Number of workflows",
147
+ "value": 0
148
+ },
149
+ {
150
+ "owner": "staticFile",
151
+ "description": "Number of lines of code in adapterBase.js",
152
+ "value": 1029
153
+ },
154
+ {
155
+ "owner": "staticFile",
156
+ "description": "Number of static files added",
157
+ "value": 35
158
+ },
159
+ {
160
+ "owner": "Overall",
161
+ "description": "Total lines of Code",
162
+ "value": 4141
163
+ },
164
+ {
165
+ "owner": "Overall",
166
+ "description": "Total Tests",
167
+ "value": 70
168
+ },
169
+ {
170
+ "owner": "Overall",
171
+ "description": "Total Files",
172
+ "value": 53
173
+ }
174
+ ],
175
+ "apiParsingReport": {
176
+ "no_mockdata": [
177
+ {
178
+ "fnName": "getDeviceTotal",
179
+ "method": "get",
180
+ "path": "/dashboard/deviceTotal"
181
+ },
182
+ {
183
+ "fnName": "getNetworkTotal",
184
+ "method": "get",
185
+ "path": "/dashboard/networkTotal"
186
+ },
187
+ {
188
+ "fnName": "getDeviceDetails",
189
+ "method": "get",
190
+ "path": "/device/devices/{serialNumber}"
191
+ },
192
+ {
193
+ "fnName": "getDeviceFirmwareList",
194
+ "method": "get",
195
+ "path": "/devices/{serialNumber}/firmwares"
196
+ },
197
+ {
198
+ "fnName": "runCommandOnDevice",
199
+ "method": "put",
200
+ "path": "/devices/{serialNumber}"
201
+ },
202
+ {
203
+ "fnName": "getFirmwareUpdateResult",
204
+ "method": "get",
205
+ "path": "/command/{commandId}"
206
+ }
207
+ ],
208
+ "errors": [],
209
+ "warnings": [],
210
+ "callsTotal": 6,
211
+ "callsConverted": 6,
212
+ "no_mockdata_num": 6
213
+ }
214
+ }
@@ -0,0 +1,95 @@
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": 30
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 13
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 7
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 23
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^4.44.11"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 64
43
+ },
44
+ {
45
+ "owner": "readmeMd",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 688
48
+ },
49
+ {
50
+ "owner": "unitTestJS",
51
+ "description": "Number of lines of code in unit tests",
52
+ "value": 1527
53
+ },
54
+ {
55
+ "owner": "unitTestJS",
56
+ "description": "Number of unit tests",
57
+ "value": 66
58
+ },
59
+ {
60
+ "owner": "integrationTestJS",
61
+ "description": "Number of lines of code in integration tests",
62
+ "value": 627
63
+ },
64
+ {
65
+ "owner": "integrationTestJS",
66
+ "description": "Number of integration tests",
67
+ "value": 12
68
+ },
69
+ {
70
+ "owner": "staticFile",
71
+ "description": "Number of lines of code in adapterBase.js",
72
+ "value": 1029
73
+ },
74
+ {
75
+ "owner": "staticFile",
76
+ "description": "Number of static files added",
77
+ "value": 34
78
+ },
79
+ {
80
+ "owner": "Overall",
81
+ "description": "Total lines of Code",
82
+ "value": 3183
83
+ },
84
+ {
85
+ "owner": "Overall",
86
+ "description": "Total Tests",
87
+ "value": 78
88
+ },
89
+ {
90
+ "owner": "Overall",
91
+ "description": "Total Files",
92
+ "value": 6
93
+ }
94
+ ]
95
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "id": "Adapter-robustel",
3
+ "type": "Robustel",
4
+ "properties": {
5
+ "host": "rcms-cloud.robustel.net",
6
+ "port": 443,
7
+ "base_path": "/api/link",
8
+ "version": "",
9
+ "cache_location": "none",
10
+ "encode_pathvars": true,
11
+ "save_metric": true,
12
+ "stub": false,
13
+ "protocol": "https",
14
+ "authentication": {
15
+ "auth_method": "no_authentication",
16
+ "username": "username",
17
+ "password": "password",
18
+ "token": "token",
19
+ "token_timeout": 600000,
20
+ "token_cache": "local",
21
+ "invalid_token_error": 401,
22
+ "auth_field": "header.headers.Authorization",
23
+ "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
24
+ "auth_logging": false,
25
+ "client_id": "",
26
+ "client_secret": "",
27
+ "grant_type": ""
28
+ },
29
+ "healthcheck": {
30
+ "type": "none",
31
+ "frequency": 60000,
32
+ "query_object": {}
33
+ },
34
+ "throttle": {
35
+ "throttle_enabled": false,
36
+ "number_pronghorns": 1,
37
+ "sync_async": "sync",
38
+ "max_in_queue": 1000,
39
+ "concurrent_max": 1,
40
+ "expire_timeout": 0,
41
+ "avg_runtime": 200,
42
+ "priorities": [
43
+ {
44
+ "value": 0,
45
+ "percent": 100
46
+ }
47
+ ]
48
+ },
49
+ "request": {
50
+ "number_redirects": 0,
51
+ "number_retries": 3,
52
+ "limit_retry_error": [
53
+ 0
54
+ ],
55
+ "failover_codes": [],
56
+ "attempt_timeout": 5000,
57
+ "global_request": {
58
+ "payload": {},
59
+ "uriOptions": {},
60
+ "addlHeaders": {},
61
+ "authData": {}
62
+ },
63
+ "healthcheck_on_timeout": true,
64
+ "return_raw": false,
65
+ "archiving": false,
66
+ "return_request": false
67
+ },
68
+ "proxy": {
69
+ "enabled": false,
70
+ "host": "",
71
+ "port": 1,
72
+ "protocol": "http",
73
+ "username": "",
74
+ "password": ""
75
+ },
76
+ "ssl": {
77
+ "ecdhCurve": "",
78
+ "enabled": false,
79
+ "accept_invalid_cert": false,
80
+ "ca_file": "",
81
+ "key_file": "",
82
+ "cert_file": "",
83
+ "secure_protocol": "",
84
+ "ciphers": ""
85
+ },
86
+ "mongo": {
87
+ "host": "",
88
+ "port": 0,
89
+ "database": "",
90
+ "username": "",
91
+ "password": "",
92
+ "replSet": "",
93
+ "db_ssl": {
94
+ "enabled": false,
95
+ "accept_invalid_cert": false,
96
+ "ca_file": "",
97
+ "key_file": "",
98
+ "cert_file": ""
99
+ }
100
+ }
101
+ },
102
+ "groups": [],
103
+ "brokers": [],
104
+ "logLevel": "none",
105
+ "timeout": 120000
106
+ }