@salesforce/core-bundle 8.0.3 → 8.0.5

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.
Files changed (2) hide show
  1. package/lib/index.js +76 -53
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -12088,7 +12088,7 @@ var require_package2 = __commonJS({
12088
12088
  "package.json"(exports2, module2) {
12089
12089
  module2.exports = {
12090
12090
  name: "@salesforce/core-bundle",
12091
- version: "8.0.3",
12091
+ version: "8.0.5",
12092
12092
  description: "Core libraries to interact with SFDX projects, orgs, and APIs.",
12093
12093
  main: "lib/index",
12094
12094
  types: "lib/index.d.ts",
@@ -12124,7 +12124,7 @@ var require_package2 = __commonJS({
12124
12124
  "messageTransformer/messageTransformer.ts"
12125
12125
  ],
12126
12126
  dependencies: {
12127
- "@jsforce/jsforce-node": "^3.2.0",
12127
+ "@jsforce/jsforce-node": "^3.2.1",
12128
12128
  "@salesforce/kit": "^3.1.6",
12129
12129
  "@salesforce/schemas": "^1.9.0",
12130
12130
  "@salesforce/ts-types": "^2.0.10",
@@ -31343,6 +31343,7 @@ var require_request = __commonJS({
31343
31343
  ...rrequest,
31344
31344
  ...input && /^(post|put|patch)$/i.test(request2.method) ? { body: input } : {},
31345
31345
  redirect: "manual",
31346
+ // @ts-expect-error - differing types of signal? this started abruptly
31346
31347
  signal: controller.signal,
31347
31348
  agent
31348
31349
  };
@@ -31350,7 +31351,7 @@ var require_request = __commonJS({
31350
31351
  const res2 = await (0, node_fetch_1.default)(url, fetchOpts);
31351
31352
  if (shouldRetryRequest(retryOpts.maxRetries, res2)) {
31352
31353
  logger.debug(`retrying for the ${retryCount + 1} time`);
31353
- logger.debug(`reason: statusCode match`);
31354
+ logger.debug("reason: statusCode match");
31354
31355
  await sleep(retryCount === 0 ? retryOpts.minTimeout : retryOpts.minTimeout * retryOpts.timeoutFactor ** retryCount);
31355
31356
  emitter.emit("retry", retryCount);
31356
31357
  retryCount++;
@@ -31358,18 +31359,18 @@ var require_request = __commonJS({
31358
31359
  }
31359
31360
  return res2;
31360
31361
  } catch (err) {
31361
- logger.debug(`Request failed`);
31362
+ logger.debug("Request failed");
31362
31363
  const error = err;
31363
31364
  if (error.name === "AbortError") {
31364
31365
  throw error;
31365
31366
  }
31366
31367
  if (shouldRetryRequest(retryOpts.maxRetries, error)) {
31367
31368
  logger.debug(`retrying for the ${retryCount + 1} time`);
31368
- logger.debug(`Error: ${error}`);
31369
+ logger.debug(`Error: ${err.message}`);
31369
31370
  await sleep(retryCount === 0 ? retryOpts.minTimeout : retryOpts.minTimeout * retryOpts.timeoutFactor ** retryCount);
31370
31371
  emitter.emit("retry", retryCount);
31371
31372
  retryCount++;
31372
- return await fetchWithRetries(maxRetry);
31373
+ return fetchWithRetries(maxRetry);
31373
31374
  }
31374
31375
  logger.debug("Skipping retry...");
31375
31376
  if (maxRetry === retryCount) {
@@ -31726,7 +31727,7 @@ var require_transport2 = __commonJS({
31726
31727
  httpRequest(req, _options = {}) {
31727
31728
  const xdProxyUrl = this._xdProxyUrl;
31728
31729
  const { url, body, ...rreq } = req;
31729
- const canonicalUrl = url.indexOf("/") === 0 ? baseUrl + url : url;
31730
+ const canonicalUrl = url.startsWith("/") ? baseUrl + url : url;
31730
31731
  const xdProxyReq = createXdProxyRequest({ ...rreq, url: canonicalUrl, body }, xdProxyUrl);
31731
31732
  return super.httpRequest(xdProxyReq, {
31732
31733
  followRedirect: (redirectUrl) => createXdProxyRequest({ ...rreq, method: "GET", url: redirectUrl }, xdProxyUrl)
@@ -31758,7 +31759,7 @@ var require_VERSION = __commonJS({
31758
31759
  "node_modules/@jsforce/jsforce-node/lib/VERSION.js"(exports2) {
31759
31760
  "use strict";
31760
31761
  Object.defineProperty(exports2, "__esModule", { value: true });
31761
- exports2.default = "2.0.0-beta.8";
31762
+ exports2.default = "3.2.1";
31762
31763
  }
31763
31764
  });
31764
31765
 
@@ -31857,8 +31858,7 @@ var require_oauth2 = __commonJS({
31857
31858
  */
31858
31859
  getAuthorizationUrl(params = {}) {
31859
31860
  if (this.codeVerifier) {
31860
- const codeChallenge = base64UrlEscape((0, crypto_1.createHash)("sha256").update(this.codeVerifier).digest("base64"));
31861
- params.code_challenge = codeChallenge;
31861
+ params.code_challenge = base64UrlEscape((0, crypto_1.createHash)("sha256").update(this.codeVerifier).digest("base64"));
31862
31862
  }
31863
31863
  const _params = {
31864
31864
  ...params,
@@ -31866,7 +31866,7 @@ var require_oauth2 = __commonJS({
31866
31866
  client_id: this.clientId,
31867
31867
  redirect_uri: this.redirectUri
31868
31868
  };
31869
- return this.authzServiceUrl + (this.authzServiceUrl.indexOf("?") >= 0 ? "&" : "?") + querystring_1.default.stringify(_params);
31869
+ return this.authzServiceUrl + (this.authzServiceUrl.includes("?") ? "&" : "?") + querystring_1.default.stringify(_params);
31870
31870
  }
31871
31871
  /**
31872
31872
  * OAuth2 Refresh Token Flow
@@ -32063,7 +32063,7 @@ var require_cache2 = __commonJS({
32063
32063
  */
32064
32064
  clear(key) {
32065
32065
  for (const k of Object.keys(this._entries)) {
32066
- if (!key || k.indexOf(key) === 0) {
32066
+ if (!key || k.startsWith(key)) {
32067
32067
  this._entries[k].clear();
32068
32068
  }
32069
32069
  }
@@ -42117,6 +42117,7 @@ var require_http_api = __commonJS({
42117
42117
  /**
42118
42118
  * @private
42119
42119
  */
42120
+ // eslint-disable-next-line @typescript-eslint/require-await
42120
42121
  async parseResponseBody(response) {
42121
42122
  const contentType = this.getResponseContentType(response) || "";
42122
42123
  const parseBody = /^(text|application)\/xml(;|$)/.test(contentType) ? parseXML : /^application\/json(;|$)/.test(contentType) ? parseJSON : /^text\/csv(;|$)/.test(contentType) ? csv_1.parseCSV : parseText;
@@ -42759,7 +42760,7 @@ var require_soql_builder = __commonJS({
42759
42760
  op = "$in";
42760
42761
  } else if (typeof value === "object" && value !== null) {
42761
42762
  for (const k of Object.keys(value)) {
42762
- if (k[0] === "$") {
42763
+ if (k.startsWith("$")) {
42763
42764
  op = k;
42764
42765
  _value = value[k];
42765
42766
  break;
@@ -42971,7 +42972,7 @@ var require_query = __commonJS({
42971
42972
  this._logger.debug(`config is locator: ${locator}`);
42972
42973
  this._locator = locator.includes("/") ? this.urlToLocator(locator) : locator;
42973
42974
  } else {
42974
- this._logger.debug(`config is QueryConfig: ${config}`);
42975
+ this._logger.debug(`config is QueryConfig: ${JSON.stringify(config)}`);
42975
42976
  const { fields, includes, sort, ..._config } = config;
42976
42977
  this._config = _config;
42977
42978
  this.select(fields);
@@ -43234,7 +43235,7 @@ var require_query = __commonJS({
43234
43235
  this.totalSize = data.totalSize;
43235
43236
  this.records = this.records?.concat(maxFetch - this.records.length > data.records.length ? data.records : data.records.slice(0, maxFetch - this.records.length));
43236
43237
  this._locator = data.nextRecordsUrl ? this.urlToLocator(data.nextRecordsUrl) : void 0;
43237
- this._finished = this._finished || data.done || !autoFetch || // this is what the response looks like when there are no results
43238
+ this._finished = this._finished || data.done || !autoFetch || this.records.length === maxFetch || // this is what the response looks like when there are no results
43238
43239
  data.records.length === 0 && data.done === void 0;
43239
43240
  const numRecords = data.records?.length ?? 0;
43240
43241
  let totalFetched = this.totalFetched;
@@ -44294,7 +44295,7 @@ var require_connection = __commonJS({
44294
44295
  }
44295
44296
  function parseSignedRequest(sr) {
44296
44297
  if (typeof sr === "string") {
44297
- if (sr[0] === "{") {
44298
+ if (sr.startsWith("{")) {
44298
44299
  return JSON.parse(sr);
44299
44300
  }
44300
44301
  const msg = sr.split(".").pop();
@@ -44423,6 +44424,9 @@ var require_connection = __commonJS({
44423
44424
  const { loginUrl, instanceUrl, version, oauth2, maxRequest, logLevel, proxyUrl, httpProxy } = config;
44424
44425
  this.loginUrl = loginUrl || defaultConnectionConfig.loginUrl;
44425
44426
  this.instanceUrl = instanceUrl || defaultConnectionConfig.instanceUrl;
44427
+ if (this.isLightningInstance()) {
44428
+ throw new Error("lightning URLs are not valid as instance URLs");
44429
+ }
44426
44430
  this.version = version || defaultConnectionConfig.version;
44427
44431
  this.oauth2 = oauth2 instanceof oauth2_1.default ? oauth2 : new oauth2_1.default({
44428
44432
  loginUrl: this.loginUrl,
@@ -44542,7 +44546,7 @@ var require_connection = __commonJS({
44542
44546
  */
44543
44547
  async login(username, password) {
44544
44548
  this._refreshDelegate = new session_refresh_delegate_1.default(this, createUsernamePasswordRefreshFn(username, password));
44545
- if (this.oauth2 && this.oauth2.clientId && this.oauth2.clientSecret) {
44549
+ if (this.oauth2?.clientId && this.oauth2.clientSecret) {
44546
44550
  return this.loginByOAuth2(username, password);
44547
44551
  }
44548
44552
  return this.loginBySoap(username, password);
@@ -44599,6 +44603,9 @@ var require_connection = __commonJS({
44599
44603
  const faultstring = m && m[1];
44600
44604
  throw new Error(faultstring || response.body);
44601
44605
  }
44606
+ if (response.body.match(/<passwordExpired>true<\/passwordExpired>/g)) {
44607
+ throw new Error("Unable to login because the used password has expired.");
44608
+ }
44602
44609
  this._logger.debug(`SOAP response = ${response.body}`);
44603
44610
  m = response.body.match(/<serverUrl>([^<]+)<\/serverUrl>/);
44604
44611
  const serverUrl = m && m[1];
@@ -44784,11 +44791,11 @@ var require_connection = __commonJS({
44784
44791
  * @private
44785
44792
  */
44786
44793
  _normalizeUrl(url) {
44787
- if (url[0] === "/") {
44788
- if (url.indexOf(this.instanceUrl + "/services/") === 0) {
44794
+ if (url.startsWith("/")) {
44795
+ if (url.startsWith(this.instanceUrl + "/services/")) {
44789
44796
  return url;
44790
44797
  }
44791
- if (url.indexOf("/services/") === 0) {
44798
+ if (url.startsWith("/services/")) {
44792
44799
  return this.instanceUrl + url;
44793
44800
  }
44794
44801
  return this._baseUrl() + url;
@@ -44894,13 +44901,13 @@ var require_connection = __commonJS({
44894
44901
  /** @private */
44895
44902
  async _createSingle(type2, record, options) {
44896
44903
  const { Id, type: rtype, attributes, ...rec } = record;
44897
- const sobjectType = type2 || attributes && attributes.type || rtype;
44904
+ const sobjectType = type2 || attributes?.type || rtype;
44898
44905
  if (!sobjectType) {
44899
44906
  throw new Error("No SObject Type defined in record");
44900
44907
  }
44901
44908
  const url = [this._baseUrl(), "sobjects", sobjectType].join("/");
44902
44909
  let contentType, body;
44903
- if (options && options.multipartFileFields) {
44910
+ if (options?.multipartFileFields) {
44904
44911
  const form = new form_data_1.default();
44905
44912
  Object.entries(options.multipartFileFields).forEach(([fieldName, fileDetails]) => {
44906
44913
  form.append(fieldName, Buffer.from(rec[fieldName], "base64"), fileDetails);
@@ -44950,7 +44957,7 @@ var require_connection = __commonJS({
44950
44957
  }
44951
44958
  const _records = records.map((record) => {
44952
44959
  const { Id, type: rtype, attributes, ...rec } = record;
44953
- const sobjectType = type2 || attributes && attributes.type || rtype;
44960
+ const sobjectType = type2 || attributes?.type || rtype;
44954
44961
  if (!sobjectType) {
44955
44962
  throw new Error("No SObject Type defined in record");
44956
44963
  }
@@ -44991,7 +44998,7 @@ var require_connection = __commonJS({
44991
44998
  if (!id) {
44992
44999
  throw new Error("Record id is not found in record.");
44993
45000
  }
44994
- const sobjectType = type2 || attributes && attributes.type || rtype;
45001
+ const sobjectType = type2 || attributes?.type || rtype;
44995
45002
  if (!sobjectType) {
44996
45003
  throw new Error("No SObject Type defined in record");
44997
45004
  }
@@ -45036,7 +45043,7 @@ var require_connection = __commonJS({
45036
45043
  if (!id) {
45037
45044
  throw new Error("Record id is not found in record.");
45038
45045
  }
45039
- const sobjectType = type2 || attributes && attributes.type || rtype;
45046
+ const sobjectType = type2 || attributes?.type || rtype;
45040
45047
  if (!sobjectType) {
45041
45048
  throw new Error("No SObject Type defined in record");
45042
45049
  }
@@ -45179,7 +45186,7 @@ var require_connection = __commonJS({
45179
45186
  * Get identity information of current user
45180
45187
  */
45181
45188
  async identity(options = {}) {
45182
- let url = this.userInfo && this.userInfo.url;
45189
+ let url = this.userInfo?.url;
45183
45190
  if (!url) {
45184
45191
  const res2 = await this.request({
45185
45192
  method: "GET",
@@ -45297,6 +45304,9 @@ var require_connection = __commonJS({
45297
45304
  * Module which manages process rules and approval processes
45298
45305
  */
45299
45306
  process = new process_1.default(this);
45307
+ isLightningInstance() {
45308
+ return this.instanceUrl.includes(".lightning.force.com") || this.instanceUrl.includes(".lightning.crmforce.mil") || this.instanceUrl.includes(".lightning.sfcrmapps.cn");
45309
+ }
45300
45310
  };
45301
45311
  exports2.Connection = Connection;
45302
45312
  exports2.default = Connection;
@@ -45324,6 +45334,7 @@ var require_base = __commonJS({
45324
45334
  _getConnections() {
45325
45335
  return this._registryConfig.connections || (this._registryConfig.connections = {});
45326
45336
  }
45337
+ // eslint-disable-next-line @typescript-eslint/require-await
45327
45338
  async getConnectionNames() {
45328
45339
  return Object.keys(this._getConnections());
45329
45340
  }
@@ -45349,6 +45360,7 @@ var require_base = __commonJS({
45349
45360
  }
45350
45361
  return connConfig_;
45351
45362
  }
45363
+ // eslint-disable-next-line @typescript-eslint/require-await
45352
45364
  async saveConnectionConfig(name, connConfig) {
45353
45365
  const connections = this._getConnections();
45354
45366
  const { oauth2, ...connConfig_ } = connConfig;
@@ -45373,23 +45385,28 @@ var require_base = __commonJS({
45373
45385
  }
45374
45386
  return null;
45375
45387
  }
45388
+ // eslint-disable-next-line @typescript-eslint/require-await
45376
45389
  async setDefaultConnection(name) {
45377
45390
  this._registryConfig["default"] = name;
45378
45391
  this._saveConfig();
45379
45392
  }
45393
+ // eslint-disable-next-line @typescript-eslint/require-await
45380
45394
  async removeConnectionConfig(name) {
45381
45395
  const connections = this._getConnections();
45382
45396
  delete connections[name];
45383
45397
  this._saveConfig();
45384
45398
  }
45399
+ // eslint-disable-next-line @typescript-eslint/require-await
45385
45400
  async getClientConfig(name) {
45386
45401
  const clients = this._getClients();
45387
45402
  const clientConfig = clients[name];
45388
45403
  return clientConfig && { ...clientConfig };
45389
45404
  }
45405
+ // eslint-disable-next-line @typescript-eslint/require-await
45390
45406
  async getClientNames() {
45391
45407
  return Object.keys(this._getClients());
45392
45408
  }
45409
+ // eslint-disable-next-line @typescript-eslint/require-await
45393
45410
  async registerClientConfig(name, clientConfig) {
45394
45411
  const clients = this._getClients();
45395
45412
  clients[name] = clientConfig;
@@ -45583,9 +45600,11 @@ var require_sfdx = __commonJS({
45583
45600
  async removeConnectionConfig(name) {
45584
45601
  await this._execCommand("force:org:delete", { u: name });
45585
45602
  }
45603
+ // eslint-disable-next-line @typescript-eslint/require-await
45586
45604
  async getClientConfig(_name) {
45587
45605
  return null;
45588
45606
  }
45607
+ // eslint-disable-next-line @typescript-eslint/require-await
45589
45608
  async getClientNames() {
45590
45609
  return [];
45591
45610
  }
@@ -49806,6 +49825,8 @@ var require_bulk = __commonJS({
49806
49825
  }
49807
49826
  } else if (res.state === "Completed") {
49808
49827
  this.retrieve();
49828
+ } else if (res.state === "NotProcessed") {
49829
+ this.emit("error", new Error("Job has been aborted"));
49809
49830
  } else {
49810
49831
  this.emit("inProgress", res);
49811
49832
  setTimeout(poll, interval);
@@ -49839,6 +49860,7 @@ var require_bulk = __commonJS({
49839
49860
  results = res.map((ret) => ({
49840
49861
  id: ret.Id || null,
49841
49862
  success: ret.Success === "true",
49863
+ created: ret.Created === "true",
49842
49864
  errors: ret.Error ? [ret.Error] : []
49843
49865
  }));
49844
49866
  }
@@ -49880,7 +49902,7 @@ var require_bulk = __commonJS({
49880
49902
  };
49881
49903
  }
49882
49904
  isSessionExpired(response) {
49883
- return response.statusCode === 400 && /<exceptionCode>InvalidSessionId<\/exceptionCode>/.test(response.body);
49905
+ return response.statusCode === 400 && response.body.includes("<exceptionCode>InvalidSessionId</exceptionCode>");
49884
49906
  }
49885
49907
  hasErrorInResponseBody(body) {
49886
49908
  return !!body.error;
@@ -50020,7 +50042,7 @@ var require_bulk2 = __commonJS({
50020
50042
  return Array.isArray(body) && typeof body[0] === "object" && "errorCode" in body[0];
50021
50043
  }
50022
50044
  isSessionExpired(response) {
50023
- return response.statusCode === 401 && /INVALID_SESSION_ID/.test(response.body);
50045
+ return response.statusCode === 401 && response.body.includes("INVALID_SESSION_ID");
50024
50046
  }
50025
50047
  parseError(body) {
50026
50048
  return {
@@ -50097,19 +50119,17 @@ var require_bulk2 = __commonJS({
50097
50119
  options.pollTimeout = this.pollTimeout;
50098
50120
  if (!options.pollInterval)
50099
50121
  options.pollInterval = this.pollInterval;
50100
- const job = this.createJob({
50101
- object: options.object,
50102
- operation: options.operation
50103
- });
50122
+ const { pollInterval, pollTimeout, input, ...createJobOpts } = options;
50123
+ const job = this.createJob(createJobOpts);
50104
50124
  try {
50105
50125
  await job.open();
50106
- await job.uploadData(options.input);
50126
+ await job.uploadData(input);
50107
50127
  await job.close();
50108
- await job.poll(options.pollInterval, options.pollTimeout);
50128
+ await job.poll(pollInterval, pollTimeout);
50109
50129
  return await job.getAllResults();
50110
50130
  } catch (error) {
50111
50131
  const err = error;
50112
- this.logger.error(`bulk load failed due to: ${err}`);
50132
+ this.logger.error(`bulk load failed due to: ${err.message}`);
50113
50133
  if (err.name !== "JobPollingTimeoutError") {
50114
50134
  job.delete().catch((ignored) => ignored);
50115
50135
  }
@@ -50122,7 +50142,7 @@ var require_bulk2 = __commonJS({
50122
50142
  * Default timeout: 10000ms
50123
50143
  *
50124
50144
  * @param soql SOQL query
50125
- * @param BulkV2PollingOptions options object
50145
+ * @param options
50126
50146
  *
50127
50147
  * @returns {RecordStream} - Record stream, convertible to a CSV data stream
50128
50148
  */
@@ -50145,7 +50165,7 @@ var require_bulk2 = __commonJS({
50145
50165
  queryRecordsStream.pipe(dataStream);
50146
50166
  } catch (error) {
50147
50167
  const err = error;
50148
- this.logger.error(`bulk query failed due to: ${err}`);
50168
+ this.logger.error(`bulk query failed due to: ${err.message}`);
50149
50169
  if (err.name !== "JobPollingTimeoutError") {
50150
50170
  queryJob.delete().catch((ignored) => ignored);
50151
50171
  }
@@ -50255,7 +50275,7 @@ var require_bulk2 = __commonJS({
50255
50275
  const jobId = this.id;
50256
50276
  const startTime = Date.now();
50257
50277
  const endTime = startTime + timeout;
50258
- this.logger.debug(`Start polling for job status`);
50278
+ this.logger.debug("Start polling for job status");
50259
50279
  this.logger.debug(`Polling options: timeout:${timeout}ms | interval: ${interval}ms.`);
50260
50280
  if (timeout === 0) {
50261
50281
  throw new JobPollingTimeoutError(`Skipping polling because of timeout = 0ms. Job Id = ${jobId}`, jobId);
@@ -50367,6 +50387,9 @@ var require_bulk2 = __commonJS({
50367
50387
  bulkJobUnprocessedRecords;
50368
50388
  error;
50369
50389
  jobInfo;
50390
+ /**
50391
+ *
50392
+ */
50370
50393
  constructor(conn, options) {
50371
50394
  super();
50372
50395
  this.connection = conn;
@@ -50499,7 +50522,7 @@ var require_bulk2 = __commonJS({
50499
50522
  if (timeout === 0) {
50500
50523
  throw new JobPollingTimeoutError(`Skipping polling because of timeout = 0ms. Job Id = ${jobId}`, jobId);
50501
50524
  }
50502
- this.logger.debug(`Start polling for job status`);
50525
+ this.logger.debug("Start polling for job status");
50503
50526
  this.logger.debug(`Polling options: timeout:${timeout}ms | interval: ${interval}ms.`);
50504
50527
  while (endTime > Date.now()) {
50505
50528
  try {
@@ -50948,11 +50971,11 @@ var require_chatter = __commonJS({
50948
50971
  * @private
50949
50972
  */
50950
50973
  _normalizeUrl(url) {
50951
- if (url.indexOf("/chatter/") === 0 || url.indexOf("/connect/") === 0) {
50974
+ if (url.startsWith("/chatter/") || url.startsWith("/connect/")) {
50952
50975
  return "/services/data/v" + this._conn.version + url;
50953
50976
  } else if (/^\/v[\d]+\.[\d]+\//.test(url)) {
50954
50977
  return "/services/data" + url;
50955
- } else if (url.indexOf("/services/") !== 0 && url[0] === "/") {
50978
+ } else if (!url.startsWith("/services/") && url.startsWith("/")) {
50956
50979
  return "/services/data/v" + this._conn.version + "/chatter" + url;
50957
50980
  } else {
50958
50981
  return url;
@@ -51065,7 +51088,7 @@ var require_soap = __commonJS({
51065
51088
  return Object.keys(schema_).reduce((o, k) => {
51066
51089
  const s = schema_[k];
51067
51090
  const v = obj[k];
51068
- const nillable2 = Array.isArray(s) && s.length === 2 && s[0] === "?" || (0, function_1.isMapObject)(s) && "?" in s || typeof s === "string" && s[0] === "?";
51091
+ const nillable2 = Array.isArray(s) && s.length === 2 && s[0] === "?" || (0, function_1.isMapObject)(s) && "?" in s || typeof s === "string" && s.startsWith("?");
51069
51092
  if (typeof v === "undefined" && nillable2) {
51070
51093
  return o;
51071
51094
  }
@@ -51075,7 +51098,7 @@ var require_soap = __commonJS({
51075
51098
  };
51076
51099
  }, obj);
51077
51100
  } else {
51078
- const nillable = typeof schema === "string" && schema[0] === "?";
51101
+ const nillable = typeof schema === "string" && schema.startsWith("?");
51079
51102
  const type2 = typeof schema === "string" ? nillable ? schema.substring(1) : schema : "any";
51080
51103
  switch (type2) {
51081
51104
  case "string":
@@ -51125,9 +51148,9 @@ var require_soap = __commonJS({
51125
51148
  if ((0, function_1.isMapObject)(value)) {
51126
51149
  for (const k of Object.keys(value)) {
51127
51150
  const v = value[k];
51128
- if (k[0] === "@") {
51151
+ if (k.startsWith("@")) {
51129
51152
  const kk = k.substring(1);
51130
- attrs.push(kk + '="' + v + '"');
51153
+ attrs.push(`${kk}="${v}"`);
51131
51154
  } else {
51132
51155
  elems.push(toXML(k, v));
51133
51156
  }
@@ -60592,7 +60615,7 @@ var require_metadata = __commonJS({
60592
60615
  async check() {
60593
60616
  const result = await this._promise;
60594
60617
  this._id = result.id;
60595
- return await this._meta.checkStatus(result.id);
60618
+ return this._meta.checkStatus(result.id);
60596
60619
  }
60597
60620
  /**
60598
60621
  * Polling until async call status becomes complete or error
@@ -80831,7 +80854,7 @@ var require_extension = __commonJS({
80831
80854
  if (message.ext && message.ext[REPLAY_FROM_KEY] == true) {
80832
80855
  this._extensionEnabled = true;
80833
80856
  }
80834
- } else if (message.channel === this._channel && message.data && message.data.event && message.data.event.replayId) {
80857
+ } else if (message.channel === this._channel && message.data?.event?.replayId) {
80835
80858
  this._replay = message.data.event.replayId;
80836
80859
  }
80837
80860
  callback(message);
@@ -80974,12 +80997,12 @@ var require_streaming = __commonJS({
80974
80997
  }
80975
80998
  /* @private */
80976
80999
  _createClient(forChannelName, extensions) {
80977
- const needsReplayFix = typeof forChannelName === "string" && forChannelName.indexOf("/u/") === 0;
81000
+ const needsReplayFix = typeof forChannelName === "string" && forChannelName.startsWith("/u/");
80978
81001
  const endpointUrl = [
80979
81002
  this._conn.instanceUrl,
80980
81003
  // special endpoint "/cometd/replay/xx.x" is only available in 36.0.
80981
81004
  // See https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_api_streaming_classic_replay.htm
80982
- "cometd" + (needsReplayFix === true && this._conn.version === "36.0" ? "/replay" : ""),
81005
+ "cometd" + (needsReplayFix && this._conn.version === "36.0" ? "/replay" : ""),
80983
81006
  this._conn.version
80984
81007
  ].join("/");
80985
81008
  const fayeClient = new faye_1.Client(endpointUrl, {});
@@ -80998,7 +81021,7 @@ var require_streaming = __commonJS({
80998
81021
  }
80999
81022
  /** @private **/
81000
81023
  _getFayeClient(channelName) {
81001
- const isGeneric = channelName.indexOf("/u/") === 0;
81024
+ const isGeneric = channelName.startsWith("/u/");
81002
81025
  const clientType = isGeneric ? "generic" : "pushTopic";
81003
81026
  if (!this._fayeClients[clientType]) {
81004
81027
  this._fayeClients[clientType] = this._createClient(channelName);
@@ -81023,7 +81046,7 @@ var require_streaming = __commonJS({
81023
81046
  * Subscribe topic/channel
81024
81047
  */
81025
81048
  subscribe(name, listener) {
81026
- const channelName = name.indexOf("/") === 0 ? name : "/topic/" + name;
81049
+ const channelName = name.startsWith("/") ? name : "/topic/" + name;
81027
81050
  const fayeClient = this._getFayeClient(channelName);
81028
81051
  return fayeClient.subscribe(channelName, listener);
81029
81052
  }
@@ -81031,7 +81054,7 @@ var require_streaming = __commonJS({
81031
81054
  * Unsubscribe topic
81032
81055
  */
81033
81056
  unsubscribe(name, subscription) {
81034
- const channelName = name.indexOf("/") === 0 ? name : "/topic/" + name;
81057
+ const channelName = name.startsWith("/") ? name : "/topic/" + name;
81035
81058
  const fayeClient = this._getFayeClient(channelName);
81036
81059
  fayeClient.unsubscribe(channelName, subscription);
81037
81060
  return this;
@@ -84617,7 +84640,7 @@ var require_config = __commonJS({
84617
84640
  const crypto = (0, ts_types_1.ensure)(this.crypto);
84618
84641
  this.forEach((key, value) => {
84619
84642
  if (this.getPropertyConfig(key).encrypted && (0, ts_types_1.isString)(value)) {
84620
- this.set(key, (0, ts_types_1.ensure)(encrypt ? crypto.encrypt(value) : crypto.decrypt(value)));
84643
+ super.set(key, (0, ts_types_1.ensure)(encrypt ? crypto.encrypt(value) : crypto.decrypt(value)));
84621
84644
  }
84622
84645
  });
84623
84646
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core-bundle",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "messageTransformer/messageTransformer.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@jsforce/jsforce-node": "^3.2.0",
39
+ "@jsforce/jsforce-node": "^3.2.1",
40
40
  "@salesforce/kit": "^3.1.6",
41
41
  "@salesforce/schemas": "^1.9.0",
42
42
  "@salesforce/ts-types": "^2.0.10",