@itentialopensource/adapter-redis_cloud 0.2.5 → 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.
package/metadata.json CHANGED
@@ -31,13 +31,25 @@
31
31
  "isDeprecated": false
32
32
  },
33
33
  "brokerSince": "",
34
+ "authMethods": [
35
+ {
36
+ "type": "API Key",
37
+ "subtypes": [],
38
+ "primary": true
39
+ }
40
+ ],
34
41
  "documentation": {
35
42
  "storeLink": "",
36
43
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-redis_cloud",
37
- "repoLink": "https://gitlab.com/itentialopensource/adapters/persistence/adapter-redis_cloud",
44
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-redis_cloud",
38
45
  "docLink": "",
39
46
  "demoLinks": [],
40
- "trainingLinks": [],
47
+ "trainingLinks": [
48
+ {
49
+ "title": "Itential Academy",
50
+ "link": "https://www.itential.com/itential-academy/"
51
+ }
52
+ ],
41
53
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
42
54
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
43
55
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-redis_cloud",
3
- "version": "0.2.5",
3
+ "version": "0.3.0",
4
4
  "description": "This adapter integrates with system described as: redisCloud.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.14",
7
+ "engineVersion": "1.67.20",
8
8
  "adapterType": "http",
9
9
  "scripts": {
10
10
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -15,7 +15,6 @@
15
15
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
16
16
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
17
17
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
18
- "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
19
18
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
20
19
  "adapter:install": "npm i && node utils/tbScript.js install",
21
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
@@ -44,17 +43,17 @@
44
43
  ],
45
44
  "license": "Apache-2.0",
46
45
  "engines": {
47
- "node": ">= 8.0.0",
46
+ "node": ">= 14.0.0",
48
47
  "npm": ">= 6.0.0"
49
48
  },
50
49
  "repository": {
51
50
  "type": "git",
52
- "url": "git@gitlab.com:itentialopensource/adapters/persistence/adapter-redis_cloud.git"
51
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-redis_cloud.git"
53
52
  },
54
53
  "author": "Itential",
55
- "homepage": "https://gitlab.com/itentialopensource/adapters/persistence/adapter-redis_cloud#readme",
54
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-redis_cloud#readme",
56
55
  "dependencies": {
57
- "@itentialopensource/adapter-utils": "^5.3.10",
56
+ "@itentialopensource/adapter-utils": "^5.5.0",
58
57
  "acorn": "^8.10.0",
59
58
  "ajv": "^8.12.0",
60
59
  "axios": "^1.6.8",
@@ -65,7 +64,6 @@
65
64
  "mocha": "^10.3.0",
66
65
  "mocha-param": "^2.0.1",
67
66
  "mongodb": "^4.16.0",
68
- "nyc": "^15.1.0",
69
67
  "ping": "^0.4.4",
70
68
  "prompts": "^2.4.2",
71
69
  "readline-sync": "^1.4.10",
@@ -945,6 +945,11 @@
945
945
  "devicebroker": {
946
946
  "type": "object",
947
947
  "properties": {
948
+ "enabled": {
949
+ "type": "boolean",
950
+ "description": "Whether or not the device broker calls have been mapped",
951
+ "default": false
952
+ },
948
953
  "getDevice": {
949
954
  "type": "array",
950
955
  "description": "Broker call(s) to getDevice",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.2.0",
3
- "configLines": 7686,
2
+ "version": "0.2.5",
3
+ "configLines": 7691,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 8008,
6
- "testLines": 7701,
6
+ "testLines": 7700,
7
7
  "testCases": 379,
8
- "totalCodeLines": 17492,
8
+ "totalCodeLines": 17491,
9
9
  "wfTasks": 95
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": 16
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": 21
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.5.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 78
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 344
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": 647
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": 3911
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 230
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2537
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 79
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": 7901
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 309
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -14,15 +14,16 @@
14
14
  "stub": true,
15
15
  "protocol": "https",
16
16
  "authentication": {
17
- "auth_method": "request_token",
17
+ "auth_method": "static_token",
18
18
  "username": "username",
19
19
  "password": "password",
20
- "token": "token",
20
+ "token": "accountKey",
21
+ "tokenp2": "userKey",
21
22
  "token_timeout": 1800000,
22
23
  "token_cache": "local",
23
24
  "invalid_token_error": 401,
24
- "auth_field": "header.headers.X-AUTH-TOKEN",
25
- "auth_field_format": "{token}",
25
+ "auth_field": ["header.headers.x-api-key", "header.headers.x-api-secret-key"],
26
+ "auth_field_format": ["{token}", "{tokenp2}"],
26
27
  "auth_logging": false,
27
28
  "client_id": "",
28
29
  "client_secret": "",
@@ -116,30 +117,32 @@
116
117
  }
117
118
  },
118
119
  "devicebroker": {
120
+ "enabled": false,
119
121
  "getDevice": [
120
122
  {
121
- "path": "/get/devices/{id}",
123
+ "path": "/not/mapped",
122
124
  "method": "GET",
123
125
  "query": {},
124
126
  "body": {},
125
127
  "headers": {},
126
128
  "handleFailure": "ignore",
127
129
  "requestFields": {
128
- "id": "name"
130
+ "insample": "{port}"
129
131
  },
130
132
  "responseDatakey": "",
131
133
  "responseFields": {
132
- "name": "host",
133
- "ostype": "os",
134
- "ostypePrefix": "system-",
135
- "ipaddress": "attributes.ipaddr",
136
- "port": "443"
134
+ "name": "{this}{||}{that}",
135
+ "ostype": "{osfield}",
136
+ "ostypePrefix": "meraki-",
137
+ "port": "{port}",
138
+ "ipaddress": "{ip_addr}",
139
+ "serial" : "{serial}"
137
140
  }
138
141
  }
139
142
  ],
140
143
  "getDevicesFiltered": [
141
144
  {
142
- "path": "/get/devices",
145
+ "path": "/not/mapped",
143
146
  "method": "GET",
144
147
  "pagination": {
145
148
  "offsetVar": "",
@@ -154,42 +157,44 @@
154
157
  "requestFields": {},
155
158
  "responseDatakey": "",
156
159
  "responseFields": {
157
- "name": "host",
158
- "ostype": "os",
159
- "ostypePrefix": "system-",
160
- "ipaddress": "attributes.ipaddr",
161
- "port": "443"
160
+ "name": "{this}{||}{that}",
161
+ "ostype": "{osfield}",
162
+ "ostypePrefix": "meraki-",
163
+ "port": "{port}",
164
+ "ipaddress": "{ip_addr}",
165
+ "serial" : "{serial}",
166
+ "id": "{myid}"
162
167
  }
163
168
  }
164
169
  ],
165
170
  "isAlive": [
166
171
  {
167
- "path": "/get/devices/{id}/status",
172
+ "path": "/not/mapped/{devID}",
168
173
  "method": "GET",
169
174
  "query": {},
170
175
  "body": {},
171
176
  "headers": {},
172
177
  "handleFailure": "ignore",
173
178
  "requestFields": {
174
- "id": "name"
179
+ "devID": "{id}"
175
180
  },
176
181
  "responseDatakey": "",
177
182
  "responseFields": {
178
- "status": "status",
179
- "statusValue": "online"
183
+ "status": "return2xx",
184
+ "statusValue": "AD.200"
180
185
  }
181
186
  }
182
187
  ],
183
188
  "getConfig": [
184
189
  {
185
- "path": "/get/devices/{id}/configPart1",
190
+ "path": "/not/mapped/{devID}",
186
191
  "method": "GET",
187
192
  "query": {},
188
193
  "body": {},
189
194
  "headers": {},
190
195
  "handleFailure": "ignore",
191
196
  "requestFields": {
192
- "id": "name"
197
+ "devID": "{id}"
193
198
  },
194
199
  "responseDatakey": "",
195
200
  "responseFields": {}
@@ -197,7 +202,7 @@
197
202
  ],
198
203
  "getCount": [
199
204
  {
200
- "path": "/get/devices",
205
+ "path": "/not/mapped",
201
206
  "method": "GET",
202
207
  "query": {},
203
208
  "body": {},
@@ -213,15 +218,15 @@
213
218
  "enabled": false,
214
219
  "entities": [
215
220
  {
216
- "entityType": "",
217
- "frequency": 1440,
221
+ "entityType": "device",
222
+ "frequency": 3600,
218
223
  "flushOnFail": false,
219
- "limit": 1000,
224
+ "limit": 10000,
220
225
  "retryAttempts": 5,
221
226
  "sort": true,
222
227
  "populate": [
223
228
  {
224
- "path": "",
229
+ "path": "/not/mapped",
225
230
  "method": "GET",
226
231
  "pagination": {
227
232
  "offsetVar": "",
@@ -235,7 +240,15 @@
235
240
  "handleFailure": "ignore",
236
241
  "requestFields": {},
237
242
  "responseDatakey": "",
238
- "responseFields": {}
243
+ "responseFields": {
244
+ "name": "{this}{||}{that}",
245
+ "ostype": "{osfield}",
246
+ "ostypePrefix": "meraki-",
247
+ "port": "{port}",
248
+ "ipaddress": "{ip_addr}",
249
+ "serial" : "{serial}",
250
+ "id": "{myid}"
251
+ }
239
252
  }
240
253
  ],
241
254
  "cachedTasks": [
@@ -46,6 +46,7 @@ samProps.ssl.accept_invalid_cert = false;
46
46
  if (samProps.request.attempt_timeout < 30000) {
47
47
  samProps.request.attempt_timeout = 30000;
48
48
  }
49
+ samProps.devicebroker.enabled = true;
49
50
  const attemptTimeout = samProps.request.attempt_timeout;
50
51
  const { stub } = samProps;
51
52
 
@@ -284,7 +284,6 @@ describe('[unit] Redis_cloud Adapter Test', () => {
284
284
  assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
285
285
  assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
286
286
  assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
287
- assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
288
287
  assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
289
288
  assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
290
289
  assert.equal('npm run deploy', packageDotJson.scripts.build);
@@ -321,7 +320,6 @@ describe('[unit] Redis_cloud Adapter Test', () => {
321
320
  assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
322
321
  assert.equal('^10.3.0', packageDotJson.dependencies.mocha);
323
322
  assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
324
- assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
325
323
  assert.equal('^0.4.4', packageDotJson.dependencies.ping);
326
324
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
327
325
  assert.equal('^7.5.3', packageDotJson.dependencies.semver);