@itentialopensource/adapter-utils 4.48.1 → 4.48.2
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 +10 -0
- package/lib/connectorRest.js +11 -0
- package/lib/propertyUtil.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
## 4.48.2 [10-04-2022]
|
|
3
|
+
|
|
4
|
+
* Changes to have token data passed in url instead of body
|
|
5
|
+
|
|
6
|
+
Closes ADAPT-2404
|
|
7
|
+
|
|
8
|
+
See merge request itentialopensource/adapter-utils!239
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
2
12
|
## 4.48.1 [09-22-2022]
|
|
3
13
|
|
|
4
14
|
* Add capability to send base64 and buffer in formData
|
package/lib/connectorRest.js
CHANGED
|
@@ -1988,6 +1988,17 @@ function buildTokenRequest(reqPath, reqBody, callProperties, callback) {
|
|
|
1988
1988
|
bodyString = JSON.stringify(tokenEntity);
|
|
1989
1989
|
} else if (tokenSchema.requestDatatype && tokenSchema.requestDatatype.toUpperCase() === 'URLENCODE') {
|
|
1990
1990
|
bodyString = querystring.stringify(tokenEntity);
|
|
1991
|
+
} else if (tokenSchema.requestDatatype && tokenSchema.requestDatatype.toUpperCase() === 'URLQUERY') {
|
|
1992
|
+
// if the datatype is URLQUERY need to put into the query on the request
|
|
1993
|
+
bodyString = querystring.stringify(tokenEntity);
|
|
1994
|
+
|
|
1995
|
+
// append to the path
|
|
1996
|
+
if (options.path.indexOf('?') < 0) {
|
|
1997
|
+
options.path = `${options.path}?${bodyString}`;
|
|
1998
|
+
} else {
|
|
1999
|
+
options.path = `${options.path}&${bodyString}`;
|
|
2000
|
+
}
|
|
2001
|
+
bodyString = '{}';
|
|
1991
2002
|
}
|
|
1992
2003
|
|
|
1993
2004
|
// if there is a body, set the content length of the body and add it to
|
package/lib/propertyUtil.js
CHANGED
|
@@ -326,8 +326,8 @@ class AdapterPropertyUtil {
|
|
|
326
326
|
|
|
327
327
|
// need to make sure we have supported datatypes - PLAIN is best if not supported - no translation or encoding
|
|
328
328
|
if (entitySchema.requestDatatype.toUpperCase() !== 'JSON' && entitySchema.requestDatatype.toUpperCase() !== 'XML'
|
|
329
|
-
&& entitySchema.requestDatatype.toUpperCase() !== 'URLENCODE' && entitySchema.requestDatatype.toUpperCase() !== '
|
|
330
|
-
&& entitySchema.requestDatatype.toUpperCase() !== 'JSON2XML') {
|
|
329
|
+
&& entitySchema.requestDatatype.toUpperCase() !== 'URLENCODE' && entitySchema.requestDatatype.toUpperCase() !== 'URLQUERY'
|
|
330
|
+
&& entitySchema.requestDatatype.toUpperCase() !== 'FORM' && entitySchema.requestDatatype.toUpperCase() !== 'JSON2XML') {
|
|
331
331
|
entitySchema.requestDatatype = 'PLAIN';
|
|
332
332
|
}
|
|
333
333
|
if (entitySchema.responseDatatype.toUpperCase() !== 'JSON' && entitySchema.responseDatatype.toUpperCase() !== 'XML'
|
|
@@ -761,8 +761,8 @@ class AdapterPropertyUtil {
|
|
|
761
761
|
|
|
762
762
|
// need to make sure we have supported datatypes - PLAIN is best if not supported - no translation or encoding
|
|
763
763
|
if (entitySchema.requestDatatype.toUpperCase() !== 'JSON' && entitySchema.requestDatatype.toUpperCase() !== 'XML'
|
|
764
|
-
&& entitySchema.requestDatatype.toUpperCase() !== 'URLENCODE' && entitySchema.requestDatatype.toUpperCase() !== '
|
|
765
|
-
&& entitySchema.requestDatatype.toUpperCase() !== 'JSON2XML') {
|
|
764
|
+
&& entitySchema.requestDatatype.toUpperCase() !== 'URLENCODE' && entitySchema.requestDatatype.toUpperCase() !== 'URLQUERY'
|
|
765
|
+
&& entitySchema.requestDatatype.toUpperCase() !== 'FORM' && entitySchema.requestDatatype.toUpperCase() !== 'JSON2XML') {
|
|
766
766
|
entitySchema.requestDatatype = 'PLAIN';
|
|
767
767
|
}
|
|
768
768
|
if (entitySchema.responseDatatype.toUpperCase() !== 'JSON' && entitySchema.responseDatatype.toUpperCase() !== 'XML'
|