@itentialopensource/adapter-microsoft_office365 0.2.6 → 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/AUTH.md CHANGED
@@ -30,7 +30,7 @@ you can leave all of the other properties in the authentication section, they wi
30
30
  4. Restart the adapter. If your properties were set correctly, the adapter should go online.
31
31
 
32
32
  ### Troubleshooting
33
- - Make sure you copied over the correct username and password.
33
+ - Make sure you copied over the correct credentials.
34
34
  - Turn on debug level logs for the adapter in IAP Admin Essentials.
35
35
  - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
36
36
  - Investigate the logs - in particular:
package/BROKER.md CHANGED
@@ -22,18 +22,25 @@ Below is an example of how you may set up the properties for this call.
22
22
  {
23
23
  "path": "/{org}/get/devices",
24
24
  "method": "GET",
25
+ "pagination": {
26
+ "offsetVar": "",
27
+ "limitVar": "",
28
+ "incrementBy": "limit",
29
+ "requestLocation": "query"
30
+ },
25
31
  "query": {},
26
32
  "body": {},
27
33
  "headers": {},
28
34
  "handleFailure": "ignore",
35
+ "responseDataKey": "",
29
36
  "requestFields": {
30
37
  "org": "555"
31
38
  },
32
39
  "responseFields": {
33
- "name": "host",
34
- "ostype": "os",
40
+ "name": "{hostField}",
41
+ "ostype": "{osField}",
35
42
  "ostypePrefix": "system-",
36
- "ipaddress": "attributes.ipaddr",
43
+ "ipaddress": "{attributes.ipaddr}",
37
44
  "port": "443"
38
45
  }
39
46
  },
@@ -44,16 +51,17 @@ Below is an example of how you may set up the properties for this call.
44
51
  "body": {},
45
52
  "headers": {},
46
53
  "handleFailure": "ignore",
54
+ "responseDataKey": "",
47
55
  "requestFields": {
48
56
  "org": "777"
49
57
  },
50
58
  "responseFields": {
51
- "name": "host",
52
- "ostype": "os",
59
+ "name": "{hostField}",
60
+ "ostype": "{osField}",
53
61
  "ostypePrefix": "system-",
54
- "ipaddress": "attributes.ipaddr",
62
+ "ipaddress": "{attributes.ipaddr}",
55
63
  "port": "443",
56
- "myorg": "org"
64
+ "myorg": "{orgField}"
57
65
  }
58
66
  }
59
67
  ]
@@ -88,12 +96,13 @@ Below is an example of how you may set up the properties for this call.
88
96
  "headers": {},
89
97
  "handleFailure": "ignore",
90
98
  "statusValue": "online",
99
+ "responseDataKey": "",
91
100
  "requestFields": {
92
- "org": "myorg",
93
- "id": "name"
101
+ "org": "{myorg}",
102
+ "id": "{name}"
94
103
  },
95
104
  "responseFields": {
96
- "status": "status"
105
+ "status": "{status}"
97
106
  }
98
107
  }
99
108
  ]
@@ -129,9 +138,10 @@ Below is an example of how you may set up the properties for this call.
129
138
  "body": {},
130
139
  "headers": {},
131
140
  "handleFailure": "ignore",
141
+ "responseDataKey": "",
132
142
  "requestFields": {
133
- "org": "myorg",
134
- "id": "name"
143
+ "org": "{myorg}",
144
+ "id": "{name}"
135
145
  }
136
146
  "responseFields": {}
137
147
  },
@@ -142,8 +152,9 @@ Below is an example of how you may set up the properties for this call.
142
152
  "body": {},
143
153
  "headers": {},
144
154
  "handleFailure": "ignore",
155
+ "responseDataKey": "",
145
156
  "requestFields": {
146
- "org": "myorg"
157
+ "org": "{myorg}"
147
158
  }
148
159
  "responseFields": {}
149
160
  }
@@ -178,17 +189,18 @@ Below is an example of how you may set up the properties for this call.
178
189
  "body": {},
179
190
  "headers": {},
180
191
  "handleFailure": "ignore",
192
+ "responseDataKey": "",
181
193
  "requestFields": {
182
- "org": "myorg",
183
- "id": "name"
194
+ "org": "{myorg}",
195
+ "id": "{name}"
184
196
  },
185
197
  "responseFields": {
186
- "name": "host",
187
- "ostype": "os",
198
+ "name": "{hostField}",
199
+ "ostype": "{osField}",
188
200
  "ostypePrefix": "system-",
189
- "ipaddress": "attributes.ipaddr",
201
+ "ipaddress": "{attributes.ipaddr}",
190
202
  "port": "443",
191
- "myorg": "org"
203
+ "myorg": "{orgField}"
192
204
  }
193
205
  }
194
206
  ]
package/CALLS.md CHANGED
@@ -152,6 +152,49 @@ These are adapter methods that are used for adapter caching. If configured, the
152
152
 
153
153
  These are adapter methods that are used to integrate to IAP Brokers. This adapter currently supports the following broker calls.
154
154
 
155
+ <table border="1" class="bordered-table">
156
+ <tr>
157
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
158
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
159
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
160
+ </tr>
161
+ <tr>
162
+ <td style="padding:15px">hasEntities(entityType, entityList, callback)</td>
163
+ <td style="padding:15px">This call is utilized by the IAP Device Broker to determine if the adapter has a specific entity and item of the entity.</td>
164
+ <td style="padding:15px">No</td>
165
+ </tr>
166
+ <tr>
167
+ <td style="padding:15px">getDevice(deviceName, callback)</td>
168
+ <td style="padding:15px">This call returns the details of the requested device.</td>
169
+ <td style="padding:15px">No</td>
170
+ </tr>
171
+ <tr>
172
+ <td style="padding:15px">getDevicesFiltered(options, callback)</td>
173
+ <td style="padding:15px">This call returns the list of devices that match the criteria provided in the options filter.</td>
174
+ <td style="padding:15px">No</td>
175
+ </tr>
176
+ <tr>
177
+ <td style="padding:15px">isAlive(deviceName, callback)</td>
178
+ <td style="padding:15px">This call returns whether the device status is active</td>
179
+ <td style="padding:15px">No</td>
180
+ </tr>
181
+ <tr>
182
+ <td style="padding:15px">getConfig(deviceName, format, callback)</td>
183
+ <td style="padding:15px">This call returns the configuration for the selected device.</td>
184
+ <td style="padding:15px">No</td>
185
+ </tr>
186
+ <tr>
187
+ <td style="padding:15px">iapGetDeviceCount(callback)</td>
188
+ <td style="padding:15px">This call returns the count of devices.</td>
189
+ <td style="padding:15px">No</td>
190
+ </tr>
191
+ </table>
192
+ <br>
193
+
194
+ ### Specific Adapter Calls
195
+
196
+ Specific adapter calls are built based on the API of the Microsoft Office 365. The Adapter Builder creates the proper method comments for generating JS-DOC for the adapter. This is the best way to get information on the calls.
197
+
155
198
  <table border="1" class="bordered-table">
156
199
  <tr>
157
200
  <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 0.3.0 [07-05-2024]
3
+
4
+ * Minor/2024 auto migration
5
+
6
+ See merge request itentialopensource/adapters/itsm-testing/adapter-microsoft_office365!9
7
+
8
+ ---
9
+
10
+ ## 0.2.7 [03-27-2024]
11
+
12
+ * Changes made at 2024.03.27_14:04PM
13
+
14
+ See merge request itentialopensource/adapters/itsm-testing/adapter-microsoft_office365!8
15
+
16
+ ---
17
+
2
18
  ## 0.2.6 [03-21-2024]
3
19
 
4
20
  * Changes made at 2024.03.21_14:40PM
package/PROPERTIES.md CHANGED
@@ -97,6 +97,7 @@ This section defines **all** the properties that are available for the adapter,
97
97
  }
98
98
  },
99
99
  "devicebroker": {
100
+ "enabled": false,
100
101
  "getDevice": [
101
102
  {
102
103
  "path": "/call/to/get/device/details",
@@ -580,6 +581,10 @@ The device broker section defines the properties used integrate MicrosoftOffice3
580
581
  <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
581
582
  <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
582
583
  </tr>
584
+ <tr>
585
+ <td style="padding:15px">enabled</td>
586
+ <td style="padding:15px">Whether or not the device broker calls have been mapped.</td>
587
+ </tr>
583
588
  <tr>
584
589
  <td style="padding:15px">getDevice</td>
585
590
  <td style="padding:15px">The array of calls used to get device details for the broker</td>
package/README.md CHANGED
@@ -4,29 +4,49 @@
4
4
 
5
5
  Some of the page links in this document and links to other GitLab files do not work in Confluence however, the information is available in other sections of the Confluence material.
6
6
 
7
- - [Overview](./SUMMARY.md)
8
- - [Versioning](#versioning)
9
- - [Supported IAP Versions](#supported-iap-versions)
10
- - [Getting Started](#getting-started)
11
- - [Helpful Background Information](#helpful-background-information)
12
- - [Prerequisites](#prerequisites)
13
- - [How to Install](#how-to-install)
14
- - [Testing](#testing)
15
- - [Configuration](./PROPERTIES.md)
16
- - [Using this Adapter](./CALLS.md)
7
+ - [Specific to this Adapter](#specific-to-this-adapter)
17
8
  - [Authentication](./AUTH.md)
18
- - [Additional Information](#additional-information)
19
- - [Enhancements](./ENHANCE.md)
20
- - [Contributing](./CONTRIBUTING.md)
21
- - [Helpful Links](#helpful-links)
22
- - [Node Scripts](#node-scripts)
23
- - [Troubleshoot](./TROUBLESHOOT.md)
24
- - [License and Maintainers](#license-and-maintainers)
25
- - [Product License](#product-license)
9
+ - [Sample Properties](./sampleProperties.json)
10
+ - [Available Calls](./CALLS.md)
11
+ - [Swagger](./report/adapter-openapi.json)
12
+ - [Generic Adapter Information](#generic-adapter-information)
13
+ - [Overview](./SUMMARY.md)
14
+ - [Versioning](#versioning)
15
+ - [Supported IAP Versions](#supported-iap-versions)
16
+ - [Getting Started](#getting-started)
17
+ - [Helpful Background Information](#helpful-background-information)
18
+ - [Prerequisites](#prerequisites)
19
+ - [How to Install](#how-to-install)
20
+ - [Testing](#testing)
21
+ - [Configuration](./PROPERTIES.md)
22
+ - [Additional Information](#additional-information)
23
+ - [Enhancements](./ENHANCE.md)
24
+ - [Contributing](./CONTRIBUTING.md)
25
+ - [Helpful Links](#helpful-links)
26
+ - [Node Scripts](#node-scripts)
27
+ - [Troubleshoot](./TROUBLESHOOT.md)
28
+ - [License and Maintainers](#license-and-maintainers)
29
+ - [Product License](#product-license)
30
+
31
+
32
+ ## Specific to this Adapter
26
33
 
27
- ## [Overview](./SUMMARY.md)
34
+ ### [Authentication](./AUTH.md)
35
+
36
+ ### [Sample Properties](./sampleProperties.json)
37
+
38
+ <a href="./sampleProperties.json" target="_blank">Sample Properties</a> can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
39
+
40
+ ### [Available Calls](./CALLS.md)
41
+
42
+ ### [Swagger](./report/adapter-openapi.json)
43
+
44
+
45
+ ## Generic Adapter Information
28
46
 
29
- ## Versioning
47
+ ### [Overview](./SUMMARY.md)
48
+
49
+ ### Versioning
30
50
 
31
51
  Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the IAP GUI on the System page. All Itential opensource adapters can be found in the <a href="https://gitlab.com/itentialopensource/adapters" target="_blank">Itential OpenSource Repository</a>.
32
52
 
@@ -34,7 +54,7 @@ Any release prior to 1.0.0 is a pre-release. Initial builds of adapters are gene
34
54
 
35
55
  Release notes can be viewed in CHANGELOG.md.
36
56
 
37
- ## Supported IAP Versions
57
+ ### Supported IAP Versions
38
58
 
39
59
  Itential Product adapters are built for particular versions of IAP and packaged with the versions they work with.
40
60
 
@@ -42,11 +62,11 @@ Itential opensource adapter as well as custom adapters built with the Itential A
42
62
 
43
63
  Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on IAP or the IAP database schema and so it is possible these scripts could stop working in different versions of IAP. If you notify Itential of any issues, the Adapter Team will attempt to fix the scripts for newer releases of IAP.
44
64
 
45
- ## Getting Started
65
+ ### Getting Started
46
66
 
47
67
  These instructions will help you get a copy of the project on your local machine for development and testing. Reading this section is also helpful for deployments as it provides you with pertinent information on prerequisites and properties.
48
68
 
49
- ### Helpful Background Information
69
+ #### Helpful Background Information
50
70
 
51
71
  There is <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter documentation available on the Itential Documentation Site</a>. This documentation includes information and examples that are helpful for:
52
72
 
@@ -67,7 +87,7 @@ Troubleshooting an Adapter
67
87
  Others will be added over time.
68
88
  Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
69
89
 
70
- ### Prerequisites
90
+ #### Prerequisites
71
91
 
72
92
  The following is a list of required packages for installation on the system the adapter will run on:
73
93
 
@@ -154,7 +174,7 @@ eslint-plugin-json
154
174
  testdouble
155
175
  ```
156
176
 
157
- ### How to Install
177
+ #### How to Install
158
178
 
159
179
  1. Set up the name space location in your IAP node_modules.
160
180
 
@@ -167,8 +187,8 @@ if the @itentialopensource directory does not exist, create it:
167
187
  2. Clone/unzip/tar the adapter into your IAP environment.
168
188
 
169
189
  ```bash
170
- cd \@itentialopensource
171
- git clone git@gitlab.com:\@itentialopensource/adapters/adapter-microsoft_office365
190
+ cd @itentialopensource
191
+ git clone git@gitlab.com:@itentialopensource/adapters/adapter-microsoft_office365
172
192
  or
173
193
  unzip adapter-microsoft_office365.zip
174
194
  or
@@ -196,30 +216,11 @@ systemctl restart pronghorn
196
216
 
197
217
  7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
198
218
 
199
-
200
- For an easier install of the adapter use npm run adapter:install, it will install the adapter in IAP. Please note that it can be dependent on where the adapter is installed and on the version of IAP so it is subject to fail. If using this, you can replace step 3-5 above with these:
201
-
202
- 3. Install adapter dependencies and check the adapter.
203
-
204
- ```bash
205
- cd adapter-microsoft_office365
206
- npm run adapter:install
207
- ```
208
-
209
- 4. Restart IAP
210
-
211
- ```bash
212
- systemctl restart pronghorn
213
- ```
214
-
215
- 5. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
216
-
217
-
218
- ### Testing
219
+ #### Testing
219
220
 
220
221
  Mocha is generally used to test all Itential Opensource Adapters. There are unit tests as well as integration tests performed. Integration tests can generally be run as standalone using mock data and running the adapter in stub mode, or as integrated. When running integrated, every effort is made to prevent environmental failures, however there is still a possibility.
221
222
 
222
- #### Unit Testing
223
+ ##### Unit Testing
223
224
 
224
225
  Unit Testing includes testing basic adapter functionality as well as error conditions that are triggered in the adapter prior to any integration. There are two ways to run unit tests. The prefered method is to use the testRunner script; however, both methods are provided here.
225
226
 
@@ -232,7 +233,7 @@ npm run test:baseunit
232
233
 
233
234
  To add new unit tests, edit the `test/unit/adapterTestUnit.js` file. The tests that are already in this file should provide guidance for adding additional tests.
234
235
 
235
- #### Integration Testing - Standalone
236
+ ##### Integration Testing - Standalone
236
237
 
237
238
  Standalone Integration Testing requires mock data to be provided with the entities. If this data is not provided, standalone integration testing will fail. When the adapter is set to run in stub mode (setting the stub property to true), the adapter will run through its code up to the point of making the request. It will then retrieve the mock data and return that as if it had received that data as the response from MicrosoftOffice365. It will then translate the data so that the adapter can return the expected response to the rest of the Itential software. Standalone is the default integration test.
238
239
 
@@ -247,7 +248,7 @@ npm run test:integration
247
248
 
248
249
  To add new integration tests, edit the `test/integration/adapterTestIntegration.js` file. The tests that are already in this file should provide guidance for adding additional tests.
249
250
 
250
- #### Integration Testing
251
+ ##### Integration Testing
251
252
 
252
253
  Integration Testing requires connectivity to MicrosoftOffice365. By using the testRunner script it prevents you from having to edit the integration test. It also resets the integration test after the test is complete so that credentials are not saved in the file.
253
254
 
@@ -263,23 +264,19 @@ Test should also be written to clean up after themselves. However, it is importa
263
264
 
264
265
  > **Reminder**: Do not check in code with actual credentials to systems.
265
266
 
266
- ## [Configuration](./PROPERTIES.md)
267
-
268
- ## [Using this Adapter](./CALLS.md)
269
-
270
- ### [Authentication](./AUTH.md)
267
+ ### [Configuration](./PROPERTIES.md)
271
268
 
272
- ## Additional Information
269
+ ### Additional Information
273
270
 
274
- ### [Enhancements](./ENHANCE.md)
271
+ #### [Enhancements](./ENHANCE.md)
275
272
 
276
- ### [Contributing](./CONTRIBUTING.md)
273
+ #### [Contributing](./CONTRIBUTING.md)
277
274
 
278
- ### Helpful Links
275
+ #### Helpful Links
279
276
 
280
277
  <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a>
281
278
 
282
- ### Node Scripts
279
+ #### Node Scripts
283
280
 
284
281
  There are several node scripts that now accompany the adapter. These scripts are provided to make several activities easier. Many of these scripts can have issues with different versions of IAP as they have dependencies on IAP and Mongo. If you have issues with the scripts please report them to the Itential Adapter Team. Each of these scripts are described below.
285
282
 
@@ -331,9 +328,9 @@ There are several node scripts that now accompany the adapter. These scripts are
331
328
  </table>
332
329
  <br>
333
330
 
334
- ## [Troubleshoot](./TROUBLESHOOT.md)
331
+ ### [Troubleshoot](./TROUBLESHOOT.md)
335
332
 
336
- ## License and Maintainers
333
+ ### License and Maintainers
337
334
 
338
335
  ```text
339
336
  Itential Product Adapters are maintained by the Itential Product Team.
@@ -341,6 +338,6 @@ Itential OpenSource Adapters are maintained by the Itential Adapter Team and the
341
338
  Custom Adapters are maintained by other sources.
342
339
  ```
343
340
 
344
- ## Product License
341
+ ### Product License
345
342
 
346
343
  [Apache 2.0](./LICENSE)
package/SYSTEMINFO.md CHANGED
@@ -12,9 +12,10 @@ We classify Microsoft Office 365 into the ITSM or Service Management domain as M
12
12
 
13
13
  ## Why Integrate
14
14
  The Microsoft Office 365 adapter from Itential is used to integrate the Itential Automation Platform (IAP) with Microsoft Office 365.
15
- With this adapter you have the ability to perform operations with Microsoft Office 365 such as:
15
+ With this adapter you have the ability to perform operations with Microsoft Office 365 on items such as:
16
16
 
17
- - Manages user and group access to Microsoft Office 365.
17
+ - Groups
18
+ - Users
18
19
 
19
20
  ## Additional Product Documentation
20
21
  The [API documents for Microsoft Office 365](https://learn.microsoft.com/en-us/previous-versions/office/office-365-api/)
package/TAB1.md ADDED
@@ -0,0 +1,12 @@
1
+ # Overview
2
+
3
+ This adapter is used to integrate the Itential Automation Platform (IAP) with the MicrosoftOffice365 System. The API that was used to build the adapter for MicrosoftOffice365 is usually available in the report directory of this adapter. The adapter utilizes the MicrosoftOffice365 API to provide the integrations that are deemed pertinent to IAP. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
4
+
5
+ ## Details
6
+ The Microsoft Office 365 adapter from Itential is used to integrate the Itential Automation Platform (IAP) with Microsoft Office 365.
7
+ With this adapter you have the ability to perform operations with Microsoft Office 365 on items such as:
8
+
9
+ - Groups
10
+ - Users
11
+
12
+ For further technical details on how to install and use this adapter, please click the Technical Documentation tab.
package/TAB2.md ADDED
@@ -0,0 +1,324 @@
1
+ # Microsoft Office 365
2
+
3
+ ## Table of Contents
4
+
5
+ - [Specific Adapter Information](#specific-adapter-information)
6
+ - [Authentication](#authentication)
7
+ - [Sample Properties](#sample-properties)
8
+ - [Swagger](#swagger)
9
+ - [Generic Adapter Information](#generic-adapter-information)
10
+
11
+ ## Specific Adapter Information
12
+ ### Authentication
13
+
14
+ This document will go through the steps for authenticating the Microsoft Office 365 adapter with the authentication methods we have worked with in the past. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
15
+
16
+ Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
17
+
18
+ #### OAuth Authentication
19
+ The Microsoft Office 365 adapter authenticates with a OAuth Authentication.
20
+
21
+ STEPS
22
+ 1. Ensure you have access to a Microsoft Office 365 and that it is running
23
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
24
+ 3. Use the properties below for the ```properties.authentication``` field
25
+ ```json
26
+ "authentication": {
27
+ "auth_method": "request_token",
28
+ "token_timeout": 600000,
29
+ "token_cache": "local",
30
+ "invalid_token_error": 401,
31
+ "auth_field": "header.headers.Authorization",
32
+ "auth_field_format": "Bearer {token}",
33
+ "auth_logging": false,
34
+ "tenant_id": "<tenant_id>",
35
+ "client_id": "<client_id>",
36
+ "grant_type": "client_credentials",
37
+ "client_secret": "<client_secret>"
38
+ }
39
+ ```
40
+ you can leave all of the other properties in the authentication section, they will not be used for OAuth Authentication.<br>
41
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
42
+
43
+ #### Troubleshooting
44
+ - Make sure you copied over the correct credentials.
45
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
46
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
47
+ - Investigate the logs - in particular:
48
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
49
+ - The FULL BODY log to make sure the payload is accurate.
50
+ - The CALL RETURN log to see what the other system is telling us.
51
+ - Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
52
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
53
+
54
+ ### Sample Properties
55
+
56
+ Sample Properties can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
57
+
58
+ ```json
59
+ "properties": {
60
+ "host": "graph.microsoft.com",
61
+ "port": 443,
62
+ "choosepath": "",
63
+ "base_path": "",
64
+ "version": "v1.0",
65
+ "cache_location": "none",
66
+ "encode_pathvars": true,
67
+ "encode_queryvars": true,
68
+ "save_metric": false,
69
+ "stub": true,
70
+ "protocol": "https",
71
+ "authentication": {
72
+ "auth_method": "request_token",
73
+ "username": "username",
74
+ "password": "password",
75
+ "token": "token",
76
+ "token_timeout": 600000,
77
+ "token_cache": "local",
78
+ "invalid_token_error": 401,
79
+ "auth_field": "header.headers.Authorization",
80
+ "auth_field_format": "Bearer {token}",
81
+ "auth_logging": false,
82
+ "tenant_id": "replace_tenant_id",
83
+ "client_id": "replace_client_id",
84
+ "grant_type": "client_credentials",
85
+ "client_secret": "replace_client_secret",
86
+ "sensitive": [],
87
+ "sso": {
88
+ "protocol": "",
89
+ "host": "",
90
+ "port": 0
91
+ },
92
+ "multiStepAuthCalls": [
93
+ {
94
+ "name": "",
95
+ "requestFields": {},
96
+ "responseFields": {},
97
+ "successfullResponseCode": 200
98
+ }
99
+ ]
100
+ },
101
+ "healthcheck": {
102
+ "type": "none",
103
+ "frequency": 60000,
104
+ "query_object": {},
105
+ "addlHeaders": {}
106
+ },
107
+ "throttle": {
108
+ "throttle_enabled": false,
109
+ "number_pronghorns": 1,
110
+ "sync_async": "sync",
111
+ "max_in_queue": 1000,
112
+ "concurrent_max": 1,
113
+ "expire_timeout": 0,
114
+ "avg_runtime": 200,
115
+ "priorities": [
116
+ {
117
+ "value": 0,
118
+ "percent": 100
119
+ }
120
+ ]
121
+ },
122
+ "request": {
123
+ "number_redirects": 0,
124
+ "number_retries": 3,
125
+ "limit_retry_error": [
126
+ 0
127
+ ],
128
+ "failover_codes": [],
129
+ "attempt_timeout": 5000,
130
+ "global_request": {
131
+ "payload": {},
132
+ "uriOptions": {},
133
+ "addlHeaders": {},
134
+ "authData": {}
135
+ },
136
+ "healthcheck_on_timeout": true,
137
+ "return_raw": false,
138
+ "archiving": false,
139
+ "return_request": false
140
+ },
141
+ "proxy": {
142
+ "enabled": false,
143
+ "host": "",
144
+ "port": 1,
145
+ "protocol": "http",
146
+ "username": "",
147
+ "password": ""
148
+ },
149
+ "ssl": {
150
+ "ecdhCurve": "",
151
+ "enabled": false,
152
+ "accept_invalid_cert": false,
153
+ "ca_file": "",
154
+ "key_file": "",
155
+ "cert_file": "",
156
+ "secure_protocol": "",
157
+ "ciphers": ""
158
+ },
159
+ "mongo": {
160
+ "host": "",
161
+ "port": 0,
162
+ "database": "",
163
+ "username": "",
164
+ "password": "",
165
+ "replSet": "",
166
+ "db_ssl": {
167
+ "enabled": false,
168
+ "accept_invalid_cert": false,
169
+ "ca_file": "",
170
+ "key_file": "",
171
+ "cert_file": ""
172
+ }
173
+ },
174
+ "devicebroker": {
175
+ "enabled": false,
176
+ "getDevice": [
177
+ {
178
+ "path": "/not/mapped",
179
+ "method": "GET",
180
+ "query": {},
181
+ "body": {},
182
+ "headers": {},
183
+ "handleFailure": "ignore",
184
+ "requestFields": {
185
+ "insample": "{port}"
186
+ },
187
+ "responseDatakey": "",
188
+ "responseFields": {
189
+ "name": "{this}{||}{that}",
190
+ "ostype": "{osfield}",
191
+ "ostypePrefix": "meraki-",
192
+ "port": "{port}",
193
+ "ipaddress": "{ip_addr}",
194
+ "serial": "{serial}"
195
+ }
196
+ }
197
+ ],
198
+ "getDevicesFiltered": [
199
+ {
200
+ "path": "/not/mapped",
201
+ "method": "GET",
202
+ "pagination": {
203
+ "offsetVar": "",
204
+ "limitVar": "",
205
+ "incrementBy": "limit",
206
+ "requestLocation": "query"
207
+ },
208
+ "query": {},
209
+ "body": {},
210
+ "headers": {},
211
+ "handleFailure": "ignore",
212
+ "requestFields": {},
213
+ "responseDatakey": "",
214
+ "responseFields": {
215
+ "name": "{this}{||}{that}",
216
+ "ostype": "{osfield}",
217
+ "ostypePrefix": "meraki-",
218
+ "port": "{port}",
219
+ "ipaddress": "{ip_addr}",
220
+ "serial": "{serial}",
221
+ "id": "{myid}"
222
+ }
223
+ }
224
+ ],
225
+ "isAlive": [
226
+ {
227
+ "path": "/not/mapped/{devID}",
228
+ "method": "GET",
229
+ "query": {},
230
+ "body": {},
231
+ "headers": {},
232
+ "handleFailure": "ignore",
233
+ "requestFields": {
234
+ "devID": "{id}"
235
+ },
236
+ "responseDatakey": "",
237
+ "responseFields": {
238
+ "status": "return2xx",
239
+ "statusValue": "AD.200"
240
+ }
241
+ }
242
+ ],
243
+ "getConfig": [
244
+ {
245
+ "path": "/not/mapped/{devID}",
246
+ "method": "GET",
247
+ "query": {},
248
+ "body": {},
249
+ "headers": {},
250
+ "handleFailure": "ignore",
251
+ "requestFields": {
252
+ "devID": "{id}"
253
+ },
254
+ "responseDatakey": "",
255
+ "responseFields": {}
256
+ }
257
+ ],
258
+ "getCount": [
259
+ {
260
+ "path": "/not/mapped",
261
+ "method": "GET",
262
+ "query": {},
263
+ "body": {},
264
+ "headers": {},
265
+ "handleFailure": "ignore",
266
+ "requestFields": {},
267
+ "responseDatakey": "",
268
+ "responseFields": {}
269
+ }
270
+ ]
271
+ },
272
+ "cache": {
273
+ "enabled": false,
274
+ "entities": [
275
+ {
276
+ "entityType": "device",
277
+ "frequency": 3600,
278
+ "flushOnFail": false,
279
+ "limit": 10000,
280
+ "retryAttempts": 5,
281
+ "sort": true,
282
+ "populate": [
283
+ {
284
+ "path": "/not/mapped",
285
+ "method": "GET",
286
+ "pagination": {
287
+ "offsetVar": "",
288
+ "limitVar": "",
289
+ "incrementBy": "limit",
290
+ "requestLocation": "query"
291
+ },
292
+ "query": {},
293
+ "body": {},
294
+ "headers": {},
295
+ "handleFailure": "ignore",
296
+ "requestFields": {},
297
+ "responseDatakey": "",
298
+ "responseFields": {
299
+ "name": "{this}{||}{that}",
300
+ "ostype": "{osfield}",
301
+ "ostypePrefix": "meraki-",
302
+ "port": "{port}",
303
+ "ipaddress": "{ip_addr}",
304
+ "serial": "{serial}",
305
+ "id": "{myid}"
306
+ }
307
+ }
308
+ ],
309
+ "cachedTasks": [
310
+ {
311
+ "name": "",
312
+ "filterField": "",
313
+ "filterLoc": ""
314
+ }
315
+ ]
316
+ }
317
+ ]
318
+ }
319
+ }
320
+ ```
321
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/itsm-testing/adapter-microsoft_office365/-/blob/master/report/adapter-openapi.json)
322
+
323
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/itsm-testing/adapter-microsoft_office365/-/blob/master/README.md)
324
+
package/metadata.json CHANGED
@@ -31,13 +31,24 @@
31
31
  "isDeprecated": false
32
32
  },
33
33
  "brokerSince": "",
34
+ "authMethods": [
35
+ {
36
+ "type": "OAuth",
37
+ "primary": true
38
+ }
39
+ ],
34
40
  "documentation": {
35
41
  "storeLink": "",
36
42
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-microsoft_office365",
37
- "repoLink": "https://gitlab.com/itentialopensource/adapters/itsm-testing/adapter-microsoft_office365",
43
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-microsoft_office365",
38
44
  "docLink": "",
39
45
  "demoLinks": [],
40
- "trainingLinks": [],
46
+ "trainingLinks": [
47
+ {
48
+ "title": "Itential Academy",
49
+ "link": "https://www.itential.com/itential-academy/"
50
+ }
51
+ ],
41
52
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
42
53
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
43
54
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-microsoft_office365",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "description": "This adapter integrates with system described as: odataServiceForNamespaceMicrosoft.graph.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Microsoft Office 365",
7
7
  "wizardVersion": "2.44.7",
8
- "engineVersion": "1.67.10",
8
+ "engineVersion": "1.67.19",
9
9
  "adapterType": "http",
10
10
  "scripts": {
11
11
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -16,7 +16,6 @@
16
16
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
17
17
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
18
18
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
19
- "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
20
19
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
21
20
  "adapter:install": "npm i && node utils/tbScript.js install",
22
21
  "adapter:checkMigrate": "node utils/checkMigrate.js",
@@ -46,20 +45,20 @@
46
45
  ],
47
46
  "license": "Apache-2.0",
48
47
  "engines": {
49
- "node": ">= 8.0.0",
48
+ "node": ">= 14.0.0",
50
49
  "npm": ">= 6.0.0"
51
50
  },
52
51
  "repository": {
53
52
  "type": "git",
54
- "url": "git@gitlab.com:itentialopensource/adapters/itsm-testing/adapter-microsoft_office365.git"
53
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-microsoft_office365.git"
55
54
  },
56
55
  "author": "Itential",
57
- "homepage": "https://gitlab.com/itentialopensource/adapters/itsm-testing/adapter-microsoft_office365#readme",
56
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-microsoft_office365#readme",
58
57
  "dependencies": {
59
- "@itentialopensource/adapter-utils": "^5.3.8",
58
+ "@itentialopensource/adapter-utils": "^5.3.10",
60
59
  "acorn": "^8.10.0",
61
60
  "ajv": "^8.12.0",
62
- "axios": "^1.6.7",
61
+ "axios": "^1.6.8",
63
62
  "commander": "^11.0.0",
64
63
  "dns-lookup-promise": "^1.0.4",
65
64
  "fs-extra": "^11.1.1",
@@ -67,7 +66,6 @@
67
66
  "mocha": "^10.3.0",
68
67
  "mocha-param": "^2.0.1",
69
68
  "mongodb": "^4.16.0",
70
- "nyc": "^15.1.0",
71
69
  "ping": "^0.4.4",
72
70
  "prompts": "^2.4.2",
73
71
  "readline-sync": "^1.4.10",
@@ -943,6 +943,11 @@
943
943
  "devicebroker": {
944
944
  "type": "object",
945
945
  "properties": {
946
+ "enabled": {
947
+ "type": "boolean",
948
+ "description": "Whether or not the device broker calls have been mapped",
949
+ "default": false
950
+ },
946
951
  "getDevice": {
947
952
  "type": "array",
948
953
  "description": "Broker call(s) to getDevice",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.2.1",
3
- "configLines": 3280,
2
+ "version": "0.2.7",
3
+ "configLines": 3285,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 3012,
6
- "testLines": 3783,
6
+ "testLines": 3782,
7
7
  "testCases": 177,
8
- "totalCodeLines": 8578,
8
+ "totalCodeLines": 8577,
9
9
  "wfTasks": 35
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": 1797
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 88
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 733
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 19
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": 3983
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 107
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -117,30 +117,32 @@
117
117
  }
118
118
  },
119
119
  "devicebroker": {
120
+ "enabled": false,
120
121
  "getDevice": [
121
122
  {
122
- "path": "/get/devices/{id}",
123
+ "path": "/not/mapped",
123
124
  "method": "GET",
124
125
  "query": {},
125
126
  "body": {},
126
127
  "headers": {},
127
128
  "handleFailure": "ignore",
128
129
  "requestFields": {
129
- "id": "name"
130
+ "insample": "{port}"
130
131
  },
131
132
  "responseDatakey": "",
132
133
  "responseFields": {
133
- "name": "host",
134
- "ostype": "os",
135
- "ostypePrefix": "system-",
136
- "ipaddress": "attributes.ipaddr",
137
- "port": "443"
134
+ "name": "{this}{||}{that}",
135
+ "ostype": "{osfield}",
136
+ "ostypePrefix": "meraki-",
137
+ "port": "{port}",
138
+ "ipaddress": "{ip_addr}",
139
+ "serial" : "{serial}"
138
140
  }
139
141
  }
140
142
  ],
141
143
  "getDevicesFiltered": [
142
144
  {
143
- "path": "/get/devices",
145
+ "path": "/not/mapped",
144
146
  "method": "GET",
145
147
  "pagination": {
146
148
  "offsetVar": "",
@@ -155,42 +157,44 @@
155
157
  "requestFields": {},
156
158
  "responseDatakey": "",
157
159
  "responseFields": {
158
- "name": "host",
159
- "ostype": "os",
160
- "ostypePrefix": "system-",
161
- "ipaddress": "attributes.ipaddr",
162
- "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}"
163
167
  }
164
168
  }
165
169
  ],
166
170
  "isAlive": [
167
171
  {
168
- "path": "/get/devices/{id}/status",
172
+ "path": "/not/mapped/{devID}",
169
173
  "method": "GET",
170
174
  "query": {},
171
175
  "body": {},
172
176
  "headers": {},
173
177
  "handleFailure": "ignore",
174
178
  "requestFields": {
175
- "id": "name"
179
+ "devID": "{id}"
176
180
  },
177
181
  "responseDatakey": "",
178
182
  "responseFields": {
179
- "status": "status",
180
- "statusValue": "online"
183
+ "status": "return2xx",
184
+ "statusValue": "AD.200"
181
185
  }
182
186
  }
183
187
  ],
184
188
  "getConfig": [
185
189
  {
186
- "path": "/get/devices/{id}/configPart1",
190
+ "path": "/not/mapped/{devID}",
187
191
  "method": "GET",
188
192
  "query": {},
189
193
  "body": {},
190
194
  "headers": {},
191
195
  "handleFailure": "ignore",
192
196
  "requestFields": {
193
- "id": "name"
197
+ "devID": "{id}"
194
198
  },
195
199
  "responseDatakey": "",
196
200
  "responseFields": {}
@@ -198,7 +202,7 @@
198
202
  ],
199
203
  "getCount": [
200
204
  {
201
- "path": "/get/devices",
205
+ "path": "/not/mapped",
202
206
  "method": "GET",
203
207
  "query": {},
204
208
  "body": {},
@@ -214,15 +218,15 @@
214
218
  "enabled": false,
215
219
  "entities": [
216
220
  {
217
- "entityType": "",
218
- "frequency": 1440,
221
+ "entityType": "device",
222
+ "frequency": 3600,
219
223
  "flushOnFail": false,
220
- "limit": 1000,
224
+ "limit": 10000,
221
225
  "retryAttempts": 5,
222
226
  "sort": true,
223
227
  "populate": [
224
228
  {
225
- "path": "",
229
+ "path": "/not/mapped",
226
230
  "method": "GET",
227
231
  "pagination": {
228
232
  "offsetVar": "",
@@ -236,7 +240,15 @@
236
240
  "handleFailure": "ignore",
237
241
  "requestFields": {},
238
242
  "responseDatakey": "",
239
- "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
+ }
240
252
  }
241
253
  ],
242
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] MicrosoftOffice365 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);
@@ -316,12 +315,11 @@ describe('[unit] MicrosoftOffice365 Adapter Test', () => {
316
315
  assert.notEqual(null, packageDotJson.dependencies);
317
316
  assert.notEqual('', packageDotJson.dependencies);
318
317
  assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
319
- assert.equal('^1.6.7', packageDotJson.dependencies.axios);
318
+ assert.equal('^1.6.8', packageDotJson.dependencies.axios);
320
319
  assert.equal('^11.0.0', packageDotJson.dependencies.commander);
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);