@itentialopensource/adapter-meraki 1.0.4 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/AUTH.md +14 -18
- package/CALLS.md +3580 -22
- package/CHANGELOG.md +24 -0
- package/CONTRIBUTING.md +1 -160
- package/ENHANCE.md +2 -2
- package/README.md +32 -23
- package/SYSTEMINFO.md +15 -2
- package/adapter.js +164 -335
- package/adapterBase.js +494 -893
- package/changelogs/changelog.md +198 -0
- package/metadata.json +75 -0
- package/package.json +24 -24
- package/pronghorn.json +470 -138
- package/propertiesSchema.json +422 -31
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +5460 -0
- package/report/adapter-openapi.yaml +3774 -0
- package/report/adapterInfo.json +8 -8
- package/report/updateReport1690417926405.json +119 -0
- package/report/updateReport1692203092612.json +120 -0
- package/report/updateReport1694439659179.json +120 -0
- package/sampleProperties.json +86 -27
- package/test/integration/adapterTestBasicGet.js +1 -3
- package/test/integration/adapterTestConnectivity.js +90 -41
- package/test/integration/adapterTestIntegration.js +129 -1
- package/test/unit/adapterBaseTestUnit.js +387 -312
- package/test/unit/adapterTestUnit.js +336 -110
- package/utils/entitiesToDB.js +2 -2
- package/utils/methodDocumentor.js +260 -0
- package/utils/modify.js +12 -14
- package/utils/packModificationScript.js +1 -1
- package/utils/pre-commit.sh +2 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +89 -34
- package/utils/tbUtils.js +41 -21
- package/utils/troubleshootingAdapter.js +9 -6
- package/versions.json +0 -542
- package/workflows/README.md +0 -3
package/report/adapterInfo.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
|
-
"version": "
|
3
|
-
"configLines":
|
4
|
-
"scriptLines":
|
5
|
-
"codeLines":
|
6
|
-
"testLines":
|
7
|
-
"testCases":
|
8
|
-
"totalCodeLines":
|
9
|
-
"wfTasks":
|
2
|
+
"version": "1.2.0",
|
3
|
+
"configLines": 63054,
|
4
|
+
"scriptLines": 1783,
|
5
|
+
"codeLines": 53869,
|
6
|
+
"testLines": 43445,
|
7
|
+
"testCases": 2230,
|
8
|
+
"totalCodeLines": 99097,
|
9
|
+
"wfTasks": 611
|
10
10
|
}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
{
|
2
|
+
"errors": [
|
3
|
+
{
|
4
|
+
"propertiesSchemaJson": "propertiesSchema.json owner reporting - Create propertiesSchema caught: SyntaxError: Unexpected token } in JSON at position 2262"
|
5
|
+
}
|
6
|
+
],
|
7
|
+
"statistics": [
|
8
|
+
{
|
9
|
+
"owner": "errorJson",
|
10
|
+
"description": "New adapter errors available for use",
|
11
|
+
"value": 0
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"owner": "errorJson",
|
15
|
+
"description": "Adapter errors no longer available for use",
|
16
|
+
"value": 0
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"owner": "errorJson",
|
20
|
+
"description": "Adapter errors that have been updated (e.g. recommendation changes)",
|
21
|
+
"value": 31
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"owner": "packageJson",
|
25
|
+
"description": "Number of production dependencies",
|
26
|
+
"value": 17
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"owner": "packageJson",
|
30
|
+
"description": "Number of development dependencies",
|
31
|
+
"value": 7
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"owner": "packageJson",
|
35
|
+
"description": "Number of npm scripts",
|
36
|
+
"value": 22
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"owner": "packageJson",
|
40
|
+
"description": "Runtime Library dependency",
|
41
|
+
"value": "^5.0.5"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"owner": "markdown",
|
45
|
+
"description": "Number of lines in the README.md",
|
46
|
+
"value": 343
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"owner": "markdown",
|
50
|
+
"description": "Number of lines in the SUMMARY.md",
|
51
|
+
"value": 9
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"owner": "markdown",
|
55
|
+
"description": "Number of lines in the PROPERTIES.md",
|
56
|
+
"value": 642
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"owner": "markdown",
|
60
|
+
"description": "Number of lines in the TROUBLESHOOT.md",
|
61
|
+
"value": 48
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"owner": "markdown",
|
65
|
+
"description": "Number of lines in the ENHANCE.md",
|
66
|
+
"value": 70
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"owner": "markdown",
|
70
|
+
"description": "Number of lines in the BROKER.md",
|
71
|
+
"value": 70
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"owner": "unitTestJS",
|
75
|
+
"description": "Number of lines of code in unit tests",
|
76
|
+
"value": 24024
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"owner": "unitTestJS",
|
80
|
+
"description": "Number of unit tests",
|
81
|
+
"value": 1565
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"owner": "integrationTestJS",
|
85
|
+
"description": "Number of lines of code in integration tests",
|
86
|
+
"value": 18150
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"owner": "integrationTestJS",
|
90
|
+
"description": "Number of integration tests",
|
91
|
+
"value": 595
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"owner": "staticFile",
|
95
|
+
"description": "Number of lines of code in adapterBase.js",
|
96
|
+
"value": 1357
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"owner": "staticFile",
|
100
|
+
"description": "Number of static files added",
|
101
|
+
"value": 38
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"owner": "Overall",
|
105
|
+
"description": "Total lines of Code",
|
106
|
+
"value": 43531
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"owner": "Overall",
|
110
|
+
"description": "Total Tests",
|
111
|
+
"value": 2160
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"owner": "Overall",
|
115
|
+
"description": "Total Files",
|
116
|
+
"value": 6
|
117
|
+
}
|
118
|
+
]
|
119
|
+
}
|
@@ -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": 76
|
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": 24022
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"owner": "unitTestJS",
|
81
|
+
"description": "Number of unit tests",
|
82
|
+
"value": 1565
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"owner": "integrationTestJS",
|
86
|
+
"description": "Number of lines of code in integration tests",
|
87
|
+
"value": 18165
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"owner": "integrationTestJS",
|
91
|
+
"description": "Number of integration tests",
|
92
|
+
"value": 595
|
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": 43537
|
108
|
+
},
|
109
|
+
{
|
110
|
+
"owner": "Overall",
|
111
|
+
"description": "Total Tests",
|
112
|
+
"value": 2160
|
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": 76
|
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": 24028
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"owner": "unitTestJS",
|
81
|
+
"description": "Number of unit tests",
|
82
|
+
"value": 1565
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"owner": "integrationTestJS",
|
86
|
+
"description": "Number of lines of code in integration tests",
|
87
|
+
"value": 18165
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"owner": "integrationTestJS",
|
91
|
+
"description": "Number of integration tests",
|
92
|
+
"value": 595
|
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": 43646
|
108
|
+
},
|
109
|
+
{
|
110
|
+
"owner": "Overall",
|
111
|
+
"description": "Total Tests",
|
112
|
+
"value": 2160
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"owner": "Overall",
|
116
|
+
"description": "Total Files",
|
117
|
+
"value": 6
|
118
|
+
}
|
119
|
+
]
|
120
|
+
}
|
package/sampleProperties.json
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
"properties": {
|
5
5
|
"host": "api.meraki.com",
|
6
6
|
"port": 443,
|
7
|
+
"choosepath": "",
|
7
8
|
"base_path": "/api",
|
8
9
|
"version": "v1",
|
9
10
|
"cache_location": "none",
|
@@ -13,24 +14,39 @@
|
|
13
14
|
"stub": true,
|
14
15
|
"protocol": "https",
|
15
16
|
"authentication": {
|
16
|
-
"auth_method": "
|
17
|
+
"auth_method": "static_token",
|
17
18
|
"username": "username",
|
18
19
|
"password": "password",
|
19
|
-
"token": "",
|
20
|
+
"token": "<token>",
|
20
21
|
"token_timeout": 1800000,
|
21
22
|
"token_cache": "local",
|
22
23
|
"invalid_token_error": 401,
|
23
|
-
"auth_field": "header.headers.
|
24
|
-
"auth_field_format": "
|
24
|
+
"auth_field": "header.headers.X-Cisco-Meraki-API-Key",
|
25
|
+
"auth_field_format": "{token}",
|
25
26
|
"auth_logging": false,
|
26
27
|
"client_id": "",
|
27
28
|
"client_secret": "",
|
28
|
-
"grant_type": ""
|
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
|
+
]
|
29
44
|
},
|
30
45
|
"healthcheck": {
|
31
46
|
"type": "none",
|
32
47
|
"frequency": 300000,
|
33
|
-
"query_object": {}
|
48
|
+
"query_object": {},
|
49
|
+
"addlHeaders": {}
|
34
50
|
},
|
35
51
|
"throttle": {
|
36
52
|
"throttle_enabled": false,
|
@@ -102,14 +118,17 @@
|
|
102
118
|
{
|
103
119
|
"path": "/organizations/{orgID}/devices",
|
104
120
|
"method": "GET",
|
105
|
-
"query": {
|
121
|
+
"query": {
|
122
|
+
"networkID": "networkID",
|
123
|
+
"serial": "serial"
|
124
|
+
},
|
106
125
|
"body": {},
|
107
126
|
"headers": {},
|
108
127
|
"handleFailure": "ignore",
|
109
128
|
"requestFields": {
|
110
|
-
"networkID": "
|
111
|
-
"serial": "
|
112
|
-
"orgID": "
|
129
|
+
"networkID": "port",
|
130
|
+
"serial": "name",
|
131
|
+
"orgID": "orgID"
|
113
132
|
},
|
114
133
|
"responseDatakey": "",
|
115
134
|
"responseFields": {
|
@@ -125,6 +144,12 @@
|
|
125
144
|
{
|
126
145
|
"path": "/organizations/{orgID}/devices",
|
127
146
|
"method": "GET",
|
147
|
+
"pagination": {
|
148
|
+
"offsetVar": "",
|
149
|
+
"limitVar": "",
|
150
|
+
"incrementBy": "limit",
|
151
|
+
"requestLocation": "query"
|
152
|
+
},
|
128
153
|
"query": {},
|
129
154
|
"body": {},
|
130
155
|
"headers": {},
|
@@ -139,7 +164,7 @@
|
|
139
164
|
"ostypePrefix": "meraki-",
|
140
165
|
"port": "networkId",
|
141
166
|
"ipaddress": "mac",
|
142
|
-
"orgID": "
|
167
|
+
"orgID": "orgID"
|
143
168
|
}
|
144
169
|
}
|
145
170
|
],
|
@@ -153,8 +178,8 @@
|
|
153
178
|
"handleFailure": "ignore",
|
154
179
|
"requestFields": {
|
155
180
|
"networkID": "port",
|
156
|
-
"serial": "
|
157
|
-
"orgID": "
|
181
|
+
"serial": "name",
|
182
|
+
"orgID": "orgID"
|
158
183
|
},
|
159
184
|
"responseDatakey": "",
|
160
185
|
"responseFields": {
|
@@ -173,8 +198,8 @@
|
|
173
198
|
"handleFailure": "ignore",
|
174
199
|
"requestFields": {
|
175
200
|
"networkID": "port",
|
176
|
-
"serial": "
|
177
|
-
"orgID": "
|
201
|
+
"serial": "name",
|
202
|
+
"orgID": "orgID"
|
178
203
|
},
|
179
204
|
"responseDatakey": "",
|
180
205
|
"responseFields": {}
|
@@ -193,19 +218,53 @@
|
|
193
218
|
},
|
194
219
|
"responseDatakey": "",
|
195
220
|
"responseFields": {}
|
196
|
-
}
|
221
|
+
}
|
222
|
+
]
|
223
|
+
},
|
224
|
+
"cache": {
|
225
|
+
"enabled": false,
|
226
|
+
"entities": [
|
197
227
|
{
|
198
|
-
"
|
199
|
-
"
|
200
|
-
"
|
201
|
-
"
|
202
|
-
"
|
203
|
-
"
|
204
|
-
"
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
228
|
+
"entityType": "device",
|
229
|
+
"frequency": 3600,
|
230
|
+
"flushOnFail": false,
|
231
|
+
"limit": 10000,
|
232
|
+
"retryAttempts": 5,
|
233
|
+
"sort": true,
|
234
|
+
"populate": [
|
235
|
+
{
|
236
|
+
"path": "/organizations/{orgID}/devices",
|
237
|
+
"method": "GET",
|
238
|
+
"pagination": {
|
239
|
+
"offsetVar": "",
|
240
|
+
"limitVar": "",
|
241
|
+
"incrementBy": "limit",
|
242
|
+
"requestLocation": "query"
|
243
|
+
},
|
244
|
+
"query": {},
|
245
|
+
"body": {},
|
246
|
+
"headers": {},
|
247
|
+
"handleFailure": "ignore",
|
248
|
+
"requestFields": {
|
249
|
+
"orgID": "1076949"
|
250
|
+
},
|
251
|
+
"responseDatakey": "",
|
252
|
+
"responseFields": {
|
253
|
+
"serial": "serial",
|
254
|
+
"model": "model",
|
255
|
+
"networkId": "networkId",
|
256
|
+
"mac": "mac",
|
257
|
+
"orgID": "orgID"
|
258
|
+
}
|
259
|
+
}
|
260
|
+
],
|
261
|
+
"cachedTasks": [
|
262
|
+
{
|
263
|
+
"name": "",
|
264
|
+
"filterField": "",
|
265
|
+
"filterLoc": ""
|
266
|
+
}
|
267
|
+
]
|
209
268
|
}
|
210
269
|
]
|
211
270
|
}
|
@@ -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
|
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
|
};
|