@manyos/smileconnect-api 1.71.1 → 1.71.3

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/docs/_sidebar.md CHANGED
@@ -28,6 +28,7 @@
28
28
  - How-Tos
29
29
 
30
30
  - [Authentication](howto/token)
31
+ - [Add additional Adapter](howto/additonalAdapter)
31
32
  - [Incident Requests](howto/incidents)
32
33
  - [Handle Worklogs](howto/worklogs)
33
34
  - [Handle Attachments](howto/attachments)
package/docs/adapter.md CHANGED
@@ -99,12 +99,35 @@ The query used in the form. e.g. 'Remedy Login ID' = "Allen"
99
99
 
100
100
  The fields to be returned by the query. e.g. "Full Name, Remedy Login ID, First Name, Last Name, Department"
101
101
 
102
+ * options (optional object of additional options):
103
+
104
+ Currently supported:
105
+
106
+ * limit: max entries that should be returned. Can be contrained by limit settings of the adapter. (limitMax)
107
+
108
+ * offset: optional offset to be used together with limit for chunking.
109
+
110
+ * sort: an object that describes how the return records should be sorted. Each field can be sorted ascending (1) or descending (-1).
111
+
112
+ * countOnly: optional boolean. If set to *true* only the count of records will be returned.
113
+
102
114
  Full example:
103
115
  ```javascript
116
+ const options = {
117
+ "limit": 5,
118
+ "offset": 5,
119
+ "sort": {
120
+ "Last Name": 1,
121
+ "First Name": -1
122
+ }
123
+ }
124
+
104
125
  const result = await adapter.remedy.search(
105
126
  "CTM:People",
106
127
  "'Remedy Login ID' = \"Allen\"",
107
- "Full Name, Remedy Login ID, First Name, Last Name, Department");
128
+ "Full Name, Remedy Login ID, First Name, Last Name, Department",
129
+ options
130
+ );
108
131
  ```
109
132
 
110
133
  Will return an object with a data array and some meta data.
@@ -675,4 +698,4 @@ Returns an object with an array translated sentences. e.g.
675
698
  {"detected_source_language":"DE","text":"Good morning. Hope to see you soon! Many greetings, Robert"}
676
699
  ]
677
700
  }
678
- ```
701
+ ```
@@ -0,0 +1,41 @@
1
+ # Add additonal adapter
2
+
3
+ You can have multiple instances of each adapter. In this guide we'll show you how to add additional remedy adapter.
4
+
5
+ While the first adapter is automatically deployed when you install SMILEconnect, additional adapters need to be added to the adapter configuration manually.
6
+
7
+ 1. Add a new Block to your [adapter configuration](../adapter.md) (below adapter remedy2 was added).
8
+
9
+ Configuration example:
10
+ ```javascript
11
+ const adapterParams = {
12
+ remedy: {
13
+ type: "remedy",
14
+ arServer: env.AR_SERVER,
15
+ arUser: env.AR_USER,
16
+ arPassword: env.AR_PASSWORD,
17
+ arPort: env.AR_PORT,
18
+ rapiUri: env.RAPI_URL,
19
+ cacheTime: env.AR_CACHE_TTL,
20
+ limitDefault: env.LIMIT_DEFAULT || 100,
21
+ limitMax: env.LIMIT_MAX
22
+ },
23
+ remedy2: {
24
+ type: "remedy",
25
+ arServer: env.AR_SERVER2,
26
+ arUser: env.AR_USER2,
27
+ arPassword: env.AR_PASSWORD2,
28
+ arPort: env.AR_PORT2,
29
+ rapiUri: env.RAPI_URL,
30
+ cacheTime: env.AR_CACHE_TTL,
31
+ limitDefault: env.LIMIT_DEFAULT || 100,
32
+ limitMax: env.LIMIT_MAX
33
+ }
34
+ };
35
+ // noinspection JSAnnotator
36
+ return adapterParams;
37
+ ```
38
+
39
+ 2. Add the needed configuration values (e.g. AR_SERVER2, AR_PASSWORD2, ...) to your API secret.
40
+
41
+ **Note:** Any change of the Adapter configuration requires a restart / redeployment of SMILEconnect.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.71.1",
3
+ "version": "1.71.3",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {
package/util/config.js CHANGED
@@ -561,7 +561,7 @@ async function getPathDef(objectName, baseUri, schema, isSubTicket, suppressUpda
561
561
  summary: `Update an object of type ${objectName}`,
562
562
  description: "A single object is returned in the data attribute",
563
563
  parameters: [],
564
- responses: await getApiResponse(schema, false)
564
+ responses: await getApiResponse(schema, true)
565
565
  }
566
566
  }
567
567