@itentialopensource/adapter-utils 4.44.7 → 4.45.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/CHANGELOG.md CHANGED
@@ -1,4 +1,54 @@
1
1
 
2
+ ## 4.45.0 [12-08-2021]
3
+
4
+ * changes for uriOptions and not encoding query params
5
+
6
+ Closes ADAPT-1866
7
+
8
+ See merge request itentialopensource/adapter-utils!227
9
+
10
+ ---
11
+
12
+ ## 4.44.11 [10-25-2021]
13
+
14
+ * change to the npm registry url
15
+
16
+ Closes ADAPT-1793
17
+
18
+ See merge request itentialopensource/adapter-utils!224
19
+
20
+ ---
21
+
22
+ ## 4.44.10 [10-25-2021]
23
+
24
+ * fixes for dbUtils, proxy, misspelling
25
+
26
+ Closes ADAPT-1019
27
+
28
+ See merge request itentialopensource/adapter-utils!223
29
+
30
+ ---
31
+
32
+ ## 4.44.9 [09-14-2021]
33
+
34
+ * Refactor storage handling
35
+
36
+ Closes ADAPT-870
37
+
38
+ See merge request itentialopensource/adapter-utils!222
39
+
40
+ ---
41
+
42
+ ## 4.44.8 [08-29-2021]
43
+
44
+ * fix this call where there is no this
45
+
46
+ Closes ADAPT-880
47
+
48
+ See merge request itentialopensource/adapter-utils!221
49
+
50
+ ---
51
+
2
52
  ## 4.44.7 [08-29-2021]
3
53
 
4
54
  * changes to fix async issues in getEntitiesSchema
@@ -640,7 +640,7 @@ function makeRequest(request, entitySchema, callProperties, startTrip, attempt,
640
640
  } else if (proxyEnabled) {
641
641
  let proxy = `${proxyProtocol}://${proxyHost}:${proxyPort}`;
642
642
  if (proxyUser && proxyPassword) {
643
- proxy = `${callProperties.proxy.protocol}://${proxyUser}:${proxyPassword}@${callProperties.proxy.host}:${callProperties.proxy.port}`;
643
+ proxy = `${proxyProtocol}://${proxyUser}:${proxyPassword}@${proxyHost}:${proxyPort}`;
644
644
  }
645
645
  request.header.agent = new HttpsProxyAgent(proxy);
646
646
 
@@ -1494,7 +1494,7 @@ function buildTokenRequest(reqPath, reqBody, callProperties, callback) {
1494
1494
 
1495
1495
  try {
1496
1496
  // Get the entity schema from the file system
1497
- return this.propUtilInst.getEntitySchema('.system', 'getToken', this.dbUtil, (tokenSchema, healthError) => {
1497
+ return propUtilInst.getEntitySchema('.system', 'getToken', this.dbUtil, (tokenSchema, healthError) => {
1498
1498
  if (healthError || !tokenSchema || Object.keys(tokenSchema).length === 0) {
1499
1499
  log.debug(`${origin}: Using adapter properties for token information`);
1500
1500
  tokenSchema = null;
@@ -1760,6 +1760,20 @@ function buildTokenRequest(reqPath, reqBody, callProperties, callback) {
1760
1760
  }
1761
1761
  }
1762
1762
 
1763
+ // only add global options if there are global options to add
1764
+ if (globalRequest && globalRequest.uriOptions
1765
+ && Object.keys(globalRequest.uriOptions).length > 0) {
1766
+ const optionString = querystring.stringify(globalRequest.uriOptions);
1767
+
1768
+ // if no query paramters yet - start with ?
1769
+ if (options.path.indexOf('?') < 0) {
1770
+ options.path += `?${optionString}`;
1771
+ } else {
1772
+ // if already have query parameters, add on to end
1773
+ options.path += `&${optionString}`;
1774
+ }
1775
+ }
1776
+
1763
1777
  // remove the path vars from the reqBody
1764
1778
  const actReqBody = Object.assign({}, reqBody);
1765
1779
  if (actReqBody && actReqBody.uriPathVars) {