@itentialopensource/adapter-jenkins 0.3.3 → 0.4.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
@@ -26,20 +26,37 @@
26
26
  "isDeprecated": false
27
27
  },
28
28
  "brokerSince": "",
29
+ "authMethods": [
30
+ {
31
+ "type": "Personal Access Token",
32
+ "primary": true
33
+ }
34
+ ],
29
35
  "documentation": {
30
36
  "storeLink": "",
31
37
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-jenkins",
32
- "repoLink": "https://gitlab.com/itentialopensource/adapters/devops-netops/adapter-jenkins",
38
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-jenkins",
33
39
  "docLink": "https://docs.itential.com/opensource/docs/jenkins",
34
40
  "demoLinks": [],
35
- "trainingLinks": [],
41
+ "trainingLinks": [
42
+ {
43
+ "title": "Itential Academy",
44
+ "link": "https://www.itential.com/itential-academy/"
45
+ }
46
+ ],
36
47
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
37
48
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
38
49
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
39
50
  "webLink": "https://www.itential.com/adapters/jenkins/",
40
- "vendorLink": "",
41
- "productLink": "",
42
- "apiLinks": []
51
+ "vendorLink": "https://www.jenkins.io/",
52
+ "productLink": "https://www.jenkins.io/",
53
+ "apiLinks": [
54
+ {
55
+ "title": "API documents for Jenkins",
56
+ "link": "https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API",
57
+ "public": true
58
+ }
59
+ ]
43
60
  },
44
61
  "assets": [],
45
62
  "relatedItems": {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-jenkins",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "This adapter integrates with system described as: jenkins.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.14",
7
+ "engineVersion": "1.67.19",
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,15 +43,15 @@
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/devops-netops/adapter-jenkins.git"
51
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-jenkins.git"
53
52
  },
54
53
  "author": "Itential",
55
- "homepage": "https://gitlab.com/itentialopensource/adapters/devops-netops/adapter-jenkins#readme",
54
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-jenkins#readme",
56
55
  "dependencies": {
57
56
  "@itentialopensource/adapter-utils": "^5.3.10",
58
57
  "acorn": "^8.10.0",
@@ -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": 3045,
2
+ "version": "0.3.3",
3
+ "configLines": 3050,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 2506,
6
- "testLines": 3526,
6
+ "testLines": 3525,
7
7
  "testCases": 163,
8
- "totalCodeLines": 7815,
8
+ "totalCodeLines": 7814,
9
9
  "wfTasks": 30
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.3.10"
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": 1669
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": 604
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 14
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": 3726
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 93
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -113,30 +113,32 @@
113
113
  }
114
114
  },
115
115
  "devicebroker": {
116
+ "enabled": false,
116
117
  "getDevice": [
117
118
  {
118
- "path": "/get/devices/{id}",
119
+ "path": "/not/mapped",
119
120
  "method": "GET",
120
121
  "query": {},
121
122
  "body": {},
122
123
  "headers": {},
123
124
  "handleFailure": "ignore",
124
125
  "requestFields": {
125
- "id": "name"
126
+ "insample": "{port}"
126
127
  },
127
128
  "responseDatakey": "",
128
129
  "responseFields": {
129
- "name": "host",
130
- "ostype": "os",
131
- "ostypePrefix": "system-",
132
- "ipaddress": "attributes.ipaddr",
133
- "port": "443"
130
+ "name": "{this}{||}{that}",
131
+ "ostype": "{osfield}",
132
+ "ostypePrefix": "meraki-",
133
+ "port": "{port}",
134
+ "ipaddress": "{ip_addr}",
135
+ "serial" : "{serial}"
134
136
  }
135
137
  }
136
138
  ],
137
139
  "getDevicesFiltered": [
138
140
  {
139
- "path": "/get/devices",
141
+ "path": "/not/mapped",
140
142
  "method": "GET",
141
143
  "pagination": {
142
144
  "offsetVar": "",
@@ -151,42 +153,44 @@
151
153
  "requestFields": {},
152
154
  "responseDatakey": "",
153
155
  "responseFields": {
154
- "name": "host",
155
- "ostype": "os",
156
- "ostypePrefix": "system-",
157
- "ipaddress": "attributes.ipaddr",
158
- "port": "443"
156
+ "name": "{this}{||}{that}",
157
+ "ostype": "{osfield}",
158
+ "ostypePrefix": "meraki-",
159
+ "port": "{port}",
160
+ "ipaddress": "{ip_addr}",
161
+ "serial" : "{serial}",
162
+ "id": "{myid}"
159
163
  }
160
164
  }
161
165
  ],
162
166
  "isAlive": [
163
167
  {
164
- "path": "/get/devices/{id}/status",
168
+ "path": "/not/mapped/{devID}",
165
169
  "method": "GET",
166
170
  "query": {},
167
171
  "body": {},
168
172
  "headers": {},
169
173
  "handleFailure": "ignore",
170
174
  "requestFields": {
171
- "id": "name"
175
+ "devID": "{id}"
172
176
  },
173
177
  "responseDatakey": "",
174
178
  "responseFields": {
175
- "status": "status",
176
- "statusValue": "online"
179
+ "status": "return2xx",
180
+ "statusValue": "AD.200"
177
181
  }
178
182
  }
179
183
  ],
180
184
  "getConfig": [
181
185
  {
182
- "path": "/get/devices/{id}/configPart1",
186
+ "path": "/not/mapped/{devID}",
183
187
  "method": "GET",
184
188
  "query": {},
185
189
  "body": {},
186
190
  "headers": {},
187
191
  "handleFailure": "ignore",
188
192
  "requestFields": {
189
- "id": "name"
193
+ "devID": "{id}"
190
194
  },
191
195
  "responseDatakey": "",
192
196
  "responseFields": {}
@@ -194,7 +198,7 @@
194
198
  ],
195
199
  "getCount": [
196
200
  {
197
- "path": "/get/devices",
201
+ "path": "/not/mapped",
198
202
  "method": "GET",
199
203
  "query": {},
200
204
  "body": {},
@@ -210,15 +214,15 @@
210
214
  "enabled": false,
211
215
  "entities": [
212
216
  {
213
- "entityType": "",
214
- "frequency": 1440,
217
+ "entityType": "device",
218
+ "frequency": 3600,
215
219
  "flushOnFail": false,
216
- "limit": 1000,
220
+ "limit": 10000,
217
221
  "retryAttempts": 5,
218
222
  "sort": true,
219
223
  "populate": [
220
224
  {
221
- "path": "",
225
+ "path": "/not/mapped",
222
226
  "method": "GET",
223
227
  "pagination": {
224
228
  "offsetVar": "",
@@ -232,7 +236,15 @@
232
236
  "handleFailure": "ignore",
233
237
  "requestFields": {},
234
238
  "responseDatakey": "",
235
- "responseFields": {}
239
+ "responseFields": {
240
+ "name": "{this}{||}{that}",
241
+ "ostype": "{osfield}",
242
+ "ostypePrefix": "meraki-",
243
+ "port": "{port}",
244
+ "ipaddress": "{ip_addr}",
245
+ "serial" : "{serial}",
246
+ "id": "{myid}"
247
+ }
236
248
  }
237
249
  ],
238
250
  "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] Jenkins 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] Jenkins 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);