@itentialopensource/adapter-utils 4.45.2 → 4.45.5
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/CHANGELOG.md +28 -0
- package/lib/connectorRest.js +9 -1
- package/lib/dbUtil.js +9 -1
- package/package.json +3 -3
- package/schemas/propertiesSchema.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
|
|
2
|
+
## 4.45.5 [05-14-2022]
|
|
3
|
+
|
|
4
|
+
* handle missing token data in mockdata
|
|
5
|
+
|
|
6
|
+
Closes ADAPT-2048
|
|
7
|
+
|
|
8
|
+
See merge request itentialopensource/adapter-utils!231
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 4.45.4 [05-01-2022]
|
|
13
|
+
|
|
14
|
+
* fix xml mockdata
|
|
15
|
+
|
|
16
|
+
Closes ADAPT-2033
|
|
17
|
+
|
|
18
|
+
See merge request itentialopensource/adapter-utils!230
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 4.45.3 [12-13-2021]
|
|
23
|
+
|
|
24
|
+
* move preinstall to postinstall
|
|
25
|
+
|
|
26
|
+
See merge request itentialopensource/adapter-utils!229
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
2
30
|
## 4.45.2 [12-09-2021]
|
|
3
31
|
|
|
4
32
|
* change for sending content-length with empty token body
|
package/lib/connectorRest.js
CHANGED
|
@@ -1135,6 +1135,14 @@ function getToken(reqPath, options, tokenSchema, bodyString, callProperties, cal
|
|
|
1135
1135
|
translated = tokenResp.response;
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
1138
|
+
// since this is a stub, make sure we have what we need
|
|
1139
|
+
if (!translated.token) {
|
|
1140
|
+
translated.token = 'garbagetoken';
|
|
1141
|
+
}
|
|
1142
|
+
if (!translated.tokenp2) {
|
|
1143
|
+
translated.tokenp2 = 'garbagetoken';
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1138
1146
|
// if what we got back is an array, just return the first element
|
|
1139
1147
|
// should only have one token!!!
|
|
1140
1148
|
if (translated && Array.isArray(translated)) {
|
|
@@ -1153,7 +1161,7 @@ function getToken(reqPath, options, tokenSchema, bodyString, callProperties, cal
|
|
|
1153
1161
|
// do not make the call to return a token if the request is actually
|
|
1154
1162
|
// to get a token. Getting a token to get a token -- that should go
|
|
1155
1163
|
// direct to make request
|
|
1156
|
-
return callback({ token: 'faketoken' });
|
|
1164
|
+
return callback({ token: 'faketoken', tokenp2: 'faketoken' });
|
|
1157
1165
|
}
|
|
1158
1166
|
|
|
1159
1167
|
log.debug(`${origin}: OPTIONS: ${JSON.stringify(options)}`);
|
package/lib/dbUtil.js
CHANGED
|
@@ -79,8 +79,16 @@ function getFromJson(fileName, filter) {
|
|
|
79
79
|
fs.readdirSync(`${entityDir}/${retEntity}/mockdatafiles`).forEach((file) => {
|
|
80
80
|
if (file.split('.').pop() === 'json') {
|
|
81
81
|
const mockpath = `${entityDir}/${retEntity}/mockdatafiles/${file}`;
|
|
82
|
-
|
|
82
|
+
let data = {};
|
|
83
|
+
try {
|
|
84
|
+
data = JSON.parse(fs.readFileSync(mockpath));
|
|
85
|
+
} catch (ex) {
|
|
86
|
+
log.warn(`could not parse mockdata file ${file}, using empty object!`);
|
|
87
|
+
}
|
|
83
88
|
mockdatafiles[mockpath.split('/').pop()] = data;
|
|
89
|
+
} else if (file.split('.').pop() === 'xml') {
|
|
90
|
+
const mockpath = `${entityDir}/${retEntity}/mockdatafiles/${file}`;
|
|
91
|
+
mockdatafiles[mockpath.split('/').pop()] = fs.readFileSync(mockpath);
|
|
84
92
|
}
|
|
85
93
|
});
|
|
86
94
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itentialopensource/adapter-utils",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.5",
|
|
4
4
|
"description": "Itential Adapter Utility Libraries",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"
|
|
6
|
+
"postinstall": "node utils/setup.js",
|
|
7
7
|
"lint": "eslint . --ext .json --ext .js",
|
|
8
8
|
"lint:errors": "eslint --quiet . --ext .json --ext .js",
|
|
9
9
|
"test:unit": "mocha test/unit/lib/requestHandlerTest.js --LOG=error && mocha test/unit/lib/restHandlerTest.js --LOG=error && mocha test/unit/lib/propertyUtilTest.js --LOG=error && mocha test/unit/lib/translatorUtilTest.js --LOG=error && mocha test/unit/lib/dbUtilTest.js --LOG=debug",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"async-lock": "1.2.0",
|
|
30
30
|
"cookie": "^0.4.0",
|
|
31
31
|
"crypto-js": "^3.1.9-1",
|
|
32
|
-
"ejs": "^
|
|
32
|
+
"ejs": "^3.1.7",
|
|
33
33
|
"form-data": "^2.5.1",
|
|
34
34
|
"fs-extra": "^8.1.0",
|
|
35
35
|
"https-proxy-agent": "^2.2.1",
|