@itentialopensource/adapter-microsoft_graph 1.3.5 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ {
2
+ "ComplianceEntries": [
3
+ {
4
+ "name": "Compliance Summary",
5
+ "numInvalidProjects": 0,
6
+ "numValidProjects": 0
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,5 @@
1
+ ---------------------------------------------------------------------------------------------
2
+ **** Project Compliance Summary ****
3
+ 0 project(s) are not valid
4
+ 0 project(s) are valid
5
+ ---------------------------------------------------------------------------------------------
package/metadata.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "adapter-microsoft_graph",
3
3
  "webName": "Adapter for Integration to Microsoft Graph",
4
4
  "vendor": "Microsoft",
5
- "product": "Graph",
5
+ "product": "Microsoft Graph",
6
6
  "osVersion": [],
7
7
  "apiVersions": [
8
8
  "1.0"
@@ -44,13 +44,24 @@
44
44
  "isDeprecated": false
45
45
  },
46
46
  "brokerSince": "",
47
+ "authMethods": [
48
+ {
49
+ "type": "OAuth",
50
+ "primary": true
51
+ }
52
+ ],
47
53
  "documentation": {
48
54
  "storeLink": "",
49
55
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-microsoft_graph",
50
- "repoLink": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-microsoft_graph",
56
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-microsoft_graph",
51
57
  "docLink": "https://docs.itential.com/opensource/docs/microsoft-graph",
52
58
  "demoLinks": [],
53
- "trainingLinks": [],
59
+ "trainingLinks": [
60
+ {
61
+ "title": "Itential Academy",
62
+ "link": "https://www.itential.com/itential-academy/"
63
+ }
64
+ ],
54
65
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
55
66
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
56
67
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
@@ -73,5 +84,6 @@
73
84
  "workflowProjects": [],
74
85
  "transformationProjects": [],
75
86
  "exampleProjects": []
76
- }
87
+ },
88
+ "supportLevel": "community"
77
89
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-microsoft_graph",
3
- "version": "1.3.5",
3
+ "version": "1.4.1",
4
4
  "description": "This adapter integrates with system described as: microsoftGraph.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.10",
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,33 +43,32 @@
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/cloud/adapter-microsoft_graph.git"
51
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-microsoft_graph.git"
53
52
  },
54
53
  "author": "Itential",
55
- "homepage": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-microsoft_graph#readme",
54
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-microsoft_graph#readme",
56
55
  "dependencies": {
57
- "@itentialopensource/adapter-utils": "^5.3.10",
58
- "acorn": "^8.10.0",
59
- "ajv": "^8.12.0",
60
- "axios": "^1.6.8",
56
+ "@itentialopensource/adapter-utils": "^5.6.0",
57
+ "acorn": "^8.12.1",
58
+ "ajv": "^8.17.1",
59
+ "axios": "^1.7.2",
61
60
  "commander": "^11.0.0",
62
61
  "dns-lookup-promise": "^1.0.4",
63
- "fs-extra": "^11.1.1",
62
+ "fs-extra": "^11.2.0",
64
63
  "json-query": "^2.2.2",
65
- "mocha": "^10.3.0",
64
+ "mocha": "^10.7.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",
72
- "semver": "^7.5.3",
73
- "winston": "^3.9.0"
70
+ "semver": "^7.6.3",
71
+ "winston": "^3.13.1"
74
72
  },
75
73
  "devDependencies": {
76
74
  "chai": "^4.3.7",
@@ -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": "1.3.0",
3
- "configLines": 10911,
2
+ "version": "1.3.5",
3
+ "configLines": 10916,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 20170,
6
- "testLines": 15130,
6
+ "testLines": 15129,
7
7
  "testCases": 772,
8
- "totalCodeLines": 37083,
8
+ "totalCodeLines": 37082,
9
9
  "wfTasks": 228
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": 7688
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 491
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 6189
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 211
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": 15330
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 702
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -119,30 +119,32 @@
119
119
  }
120
120
  },
121
121
  "devicebroker": {
122
+ "enabled": false,
122
123
  "getDevice": [
123
124
  {
124
- "path": "/get/devices/{id}",
125
+ "path": "/not/mapped",
125
126
  "method": "GET",
126
127
  "query": {},
127
128
  "body": {},
128
129
  "headers": {},
129
130
  "handleFailure": "ignore",
130
131
  "requestFields": {
131
- "id": "name"
132
+ "insample": "{port}"
132
133
  },
133
134
  "responseDatakey": "",
134
135
  "responseFields": {
135
- "name": "host",
136
- "ostype": "os",
137
- "ostypePrefix": "system-",
138
- "ipaddress": "attributes.ipaddr",
139
- "port": "443"
136
+ "name": "{this}{||}{that}",
137
+ "ostype": "{osfield}",
138
+ "ostypePrefix": "meraki-",
139
+ "port": "{port}",
140
+ "ipaddress": "{ip_addr}",
141
+ "serial" : "{serial}"
140
142
  }
141
143
  }
142
144
  ],
143
145
  "getDevicesFiltered": [
144
146
  {
145
- "path": "/get/devices",
147
+ "path": "/not/mapped",
146
148
  "method": "GET",
147
149
  "pagination": {
148
150
  "offsetVar": "",
@@ -157,42 +159,44 @@
157
159
  "requestFields": {},
158
160
  "responseDatakey": "",
159
161
  "responseFields": {
160
- "name": "host",
161
- "ostype": "os",
162
- "ostypePrefix": "system-",
163
- "ipaddress": "attributes.ipaddr",
164
- "port": "443"
162
+ "name": "{this}{||}{that}",
163
+ "ostype": "{osfield}",
164
+ "ostypePrefix": "meraki-",
165
+ "port": "{port}",
166
+ "ipaddress": "{ip_addr}",
167
+ "serial" : "{serial}",
168
+ "id": "{myid}"
165
169
  }
166
170
  }
167
171
  ],
168
172
  "isAlive": [
169
173
  {
170
- "path": "/get/devices/{id}/status",
174
+ "path": "/not/mapped/{devID}",
171
175
  "method": "GET",
172
176
  "query": {},
173
177
  "body": {},
174
178
  "headers": {},
175
179
  "handleFailure": "ignore",
176
180
  "requestFields": {
177
- "id": "name"
181
+ "devID": "{id}"
178
182
  },
179
183
  "responseDatakey": "",
180
184
  "responseFields": {
181
- "status": "status",
182
- "statusValue": "online"
185
+ "status": "return2xx",
186
+ "statusValue": "AD.200"
183
187
  }
184
188
  }
185
189
  ],
186
190
  "getConfig": [
187
191
  {
188
- "path": "/get/devices/{id}/configPart1",
192
+ "path": "/not/mapped/{devID}",
189
193
  "method": "GET",
190
194
  "query": {},
191
195
  "body": {},
192
196
  "headers": {},
193
197
  "handleFailure": "ignore",
194
198
  "requestFields": {
195
- "id": "name"
199
+ "devID": "{id}"
196
200
  },
197
201
  "responseDatakey": "",
198
202
  "responseFields": {}
@@ -200,7 +204,7 @@
200
204
  ],
201
205
  "getCount": [
202
206
  {
203
- "path": "/get/devices",
207
+ "path": "/not/mapped",
204
208
  "method": "GET",
205
209
  "query": {},
206
210
  "body": {},
@@ -216,15 +220,15 @@
216
220
  "enabled": false,
217
221
  "entities": [
218
222
  {
219
- "entityType": "",
220
- "frequency": 1440,
223
+ "entityType": "device",
224
+ "frequency": 3600,
221
225
  "flushOnFail": false,
222
- "limit": 1000,
226
+ "limit": 10000,
223
227
  "retryAttempts": 5,
224
228
  "sort": true,
225
229
  "populate": [
226
230
  {
227
- "path": "",
231
+ "path": "/not/mapped",
228
232
  "method": "GET",
229
233
  "pagination": {
230
234
  "offsetVar": "",
@@ -238,7 +242,15 @@
238
242
  "handleFailure": "ignore",
239
243
  "requestFields": {},
240
244
  "responseDatakey": "",
241
- "responseFields": {}
245
+ "responseFields": {
246
+ "name": "{this}{||}{that}",
247
+ "ostype": "{osfield}",
248
+ "ostypePrefix": "meraki-",
249
+ "port": "{port}",
250
+ "ipaddress": "{ip_addr}",
251
+ "serial" : "{serial}",
252
+ "id": "{myid}"
253
+ }
242
254
  }
243
255
  ],
244
256
  "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] Microsoft_graph 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);
@@ -315,17 +314,16 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
315
314
  assert.notEqual(undefined, packageDotJson.dependencies);
316
315
  assert.notEqual(null, packageDotJson.dependencies);
317
316
  assert.notEqual('', packageDotJson.dependencies);
318
- assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
319
- assert.equal('^1.6.8', packageDotJson.dependencies.axios);
317
+ assert.equal('^8.17.1', packageDotJson.dependencies.ajv);
318
+ assert.equal('^1.7.2', packageDotJson.dependencies.axios);
320
319
  assert.equal('^11.0.0', packageDotJson.dependencies.commander);
321
- assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
322
- assert.equal('^10.3.0', packageDotJson.dependencies.mocha);
320
+ assert.equal('^11.2.0', packageDotJson.dependencies['fs-extra']);
321
+ assert.equal('^10.7.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
- assert.equal('^7.5.3', packageDotJson.dependencies.semver);
328
- assert.equal('^3.9.0', packageDotJson.dependencies.winston);
325
+ assert.equal('^7.6.3', packageDotJson.dependencies.semver);
326
+ assert.equal('^3.13.1', packageDotJson.dependencies.winston);
329
327
  done();
330
328
  } catch (error) {
331
329
  log.error(`Test Failure: ${error}`);
@@ -563,7 +561,7 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
563
561
  log.error(`Adapter Exception: ${error}`);
564
562
  done(error);
565
563
  }
566
- });
564
+ }).timeout(attemptTimeout);
567
565
  });
568
566
 
569
567
  describe('propertiesSchema.json', () => {