@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 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
@@ -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
@@ -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() !== 'FORM'
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() !== 'FORM'
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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-utils",
3
- "version": "4.48.1",
3
+ "version": "4.48.2",
4
4
  "description": "Itential Adapter Utility Libraries",
5
5
  "scripts": {
6
6
  "postinstall": "node utils/setup.js",