@jsforce/jsforce-node 3.8.0 → 3.8.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/lib/VERSION.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "3.8.0";
1
+ declare const _default: "3.8.2";
2
2
  export default _default;
package/lib/VERSION.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '3.8.0';
3
+ exports.default = '3.8.2';
package/lib/soap.js CHANGED
@@ -11,6 +11,7 @@ exports.SOAP = exports.castTypeUsingSchema = void 0;
11
11
  const http_api_1 = __importDefault(require("./http-api"));
12
12
  const function_1 = require("./util/function");
13
13
  const get_body_size_1 = require("./util/get-body-size");
14
+ const jwt_1 = require("./util/jwt");
14
15
  /**
15
16
  *
16
17
  */
@@ -180,6 +181,11 @@ class SOAP extends http_api_1.default {
180
181
  _xmlns;
181
182
  constructor(conn, options) {
182
183
  super(conn, options);
184
+ if (this._conn.accessToken && (0, jwt_1.isJWTToken)(this._conn.accessToken)) {
185
+ // We need to block SOAP requests with JWT tokens because the response is:
186
+ // statusCode=500 | body="INVALID_SESSION_ID" (xml), which triggers session refresh and enters in an infinite loop
187
+ throw new Error('SOAP API does not support JWT-based access tokens. You must disable the "Issue JSON Web Token (JWT)-based access tokens" setting in your Connected App or External Client App');
188
+ }
183
189
  this._endpointUrl = options.endpointUrl;
184
190
  this._xmlns = options.xmlns || 'urn:partner.soap.sforce.com';
185
191
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Checks if a given access token is a JWT.
3
+ *
4
+ * @param {string} accessToken - The access token to check
5
+ * @returns {boolean} True if the token is a valid JWT token, false otherwise.
6
+ */
7
+ export declare function isJWTToken(accessToken: string): boolean;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isJWTToken = void 0;
4
+ /**
5
+ * Checks if a given access token is a JWT.
6
+ *
7
+ * @param {string} accessToken - The access token to check
8
+ * @returns {boolean} True if the token is a valid JWT token, false otherwise.
9
+ */
10
+ function isJWTToken(accessToken) {
11
+ const parts = accessToken.split('.');
12
+ if (parts.length !== 3)
13
+ return false;
14
+ const header = parts[0];
15
+ try {
16
+ JSON.parse(atob(header));
17
+ return true;
18
+ }
19
+ catch (err) {
20
+ return false;
21
+ }
22
+ }
23
+ exports.isJWTToken = isJWTToken;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "database.com"
11
11
  ],
12
12
  "homepage": "http://github.com/jsforce/jsforce",
13
- "version": "3.8.0",
13
+ "version": "3.8.2",
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "git://github.com/jsforce/jsforce.git"
@@ -206,12 +206,12 @@
206
206
  "xml2js": "^0.6.2"
207
207
  },
208
208
  "devDependencies": {
209
- "@babel/cli": "^7.24.8",
209
+ "@babel/cli": "^7.27.0",
210
210
  "@babel/core": "^7.26.10",
211
- "@babel/plugin-transform-runtime": "^7.24.7",
212
- "@babel/preset-env": "^7.22.20",
213
- "@babel/preset-typescript": "^7.23.0",
214
- "@babel/register": "^7.22.15",
211
+ "@babel/plugin-transform-runtime": "^7.26.10",
212
+ "@babel/preset-env": "^7.26.9",
213
+ "@babel/preset-typescript": "^7.27.0",
214
+ "@babel/register": "^7.25.9",
215
215
  "@types/inquirer": "^6.5.0",
216
216
  "@types/jest": "^29.5.5",
217
217
  "@types/multistream": "^2.1.1",
@@ -262,7 +262,7 @@
262
262
  "util": "^0.12.5",
263
263
  "webpack": "^5.97.1",
264
264
  "webpack-cli": "^5.0.2",
265
- "wireit": "^0.14.7",
265
+ "wireit": "^0.14.12",
266
266
  "zx": "^7.2.3"
267
267
  },
268
268
  "overrides": {