@hpcc-js/comms 3.12.0 → 3.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/comms",
3
- "version": "3.12.0",
3
+ "version": "3.12.1",
4
4
  "description": "hpcc-js - Communications",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.cjs",
@@ -74,7 +74,7 @@
74
74
  "wsdl-all": "npm-run-all --aggregate-output -c --serial build --parallel wsdl-*"
75
75
  },
76
76
  "dependencies": {
77
- "@hpcc-js/util": "^3.4.2",
77
+ "@hpcc-js/util": "^3.4.3",
78
78
  "@xmldom/xmldom": "0.9.8",
79
79
  "abort-controller": "3.0.0",
80
80
  "node-fetch": "3.3.2",
@@ -112,5 +112,5 @@
112
112
  "esp",
113
113
  "HPCC-Platform"
114
114
  ],
115
- "gitHead": "5e5fc8d746e6a42c58da2ec4f55f2f7cbaeff611"
115
+ "gitHead": "0289b8552e19395a8da9b70a154821cf70ce42e7"
116
116
  }
package/src/connection.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { join, promiseTimeout, scopedLogger } from "@hpcc-js/util";
1
+ import { join, promiseTimeout, scopedLogger, utf8ToBase64 } from "@hpcc-js/util";
2
2
 
3
3
  const logger = scopedLogger("comms/connection.ts");
4
4
 
@@ -137,7 +137,7 @@ export function jsonp(opts: IOptions, action: string, request: any = {}, respons
137
137
  }
138
138
 
139
139
  function authHeader(opts: IOptions): object {
140
- return opts.userID ? { Authorization: `Basic ${btoa(`${opts.userID}:${opts.password}`)}` } : {};
140
+ return opts.userID ? { Authorization: `Basic ${utf8ToBase64(`${opts.userID}:${opts.password}`)}` } : {};
141
141
  }
142
142
 
143
143
  // _omitMap is a workaround for older HPCC-Platform instances without credentials ---
@@ -1,5 +1,4 @@
1
1
  export * from "./__package__.ts";
2
-
3
2
  export * from "./services/fileSpray.ts";
4
3
  export * from "./services/wsAccess.ts";
5
4
  export * from "./services/wsAccount.ts";
package/src/index.node.ts CHANGED
@@ -7,6 +7,7 @@ root.DOMParser = DOMParser;
7
7
  import fetch, { Headers, Request, Response, } from "node-fetch";
8
8
 
9
9
  import * as https from "node:https";
10
+ import { Buffer } from "node:buffer";
10
11
  import { Agent, setGlobalDispatcher } from "undici";
11
12
 
12
13
  if (typeof root.fetch === "undefined") {
@@ -57,14 +58,6 @@ root.fetch.__trustwaveAgent = new https.Agent({
57
58
  ca: globalCA + trustwave
58
59
  });
59
60
 
60
- // btoa polyfill ---
61
- import { Buffer } from "node:buffer";
62
- if (typeof root.btoa === "undefined") {
63
- root.btoa = function (str: string) {
64
- return Buffer.from(str || "", "utf8").toString("base64");
65
- };
66
- }
67
-
68
61
  export * from "./index.common.ts";
69
62
 
70
63
  // Client Tools ---