@salesforce/core-bundle 8.2.7 → 8.2.9
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/index.d.ts +7 -0
- package/lib/index.js +395 -360
- package/package.json +4 -3
package/lib/index.d.ts
CHANGED
@@ -6159,6 +6159,13 @@ declare module '@salesforce/core-bundle/util/fileLocking' {
|
|
6159
6159
|
* See its documentation for details.
|
6160
6160
|
*/
|
6161
6161
|
export const lockInitSync: (filePath: string) => LockInitSyncResponse;
|
6162
|
+
/**
|
6163
|
+
* Poll until the file is unlocked.
|
6164
|
+
*
|
6165
|
+
* @param filePath file path to check
|
6166
|
+
*/
|
6167
|
+
export const pollUntilUnlock: (filePath: string) => Promise<void>;
|
6168
|
+
export const pollUntilUnlockSync: (filePath: string) => void;
|
6162
6169
|
export {};
|
6163
6170
|
|
6164
6171
|
}
|
package/lib/index.js
CHANGED
@@ -4629,7 +4629,7 @@ var require_package = __commonJS({
|
|
4629
4629
|
"package.json"(exports2, module2) {
|
4630
4630
|
module2.exports = {
|
4631
4631
|
name: "@salesforce/core-bundle",
|
4632
|
-
version: "8.2.
|
4632
|
+
version: "8.2.9",
|
4633
4633
|
description: "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
4634
4634
|
main: "lib/index",
|
4635
4635
|
types: "lib/index.d.ts",
|
@@ -4648,6 +4648,7 @@ var require_package = __commonJS({
|
|
4648
4648
|
lint: "wireit",
|
4649
4649
|
"lint-fix": "yarn sf-lint --fix",
|
4650
4650
|
test: "wireit",
|
4651
|
+
"test:nuts": 'mocha "test/**/*.nut.ts" --timeout 500000',
|
4651
4652
|
"test:only": "wireit",
|
4652
4653
|
"test:perf": "ts-node test/perf/logger/main.test.ts"
|
4653
4654
|
},
|
@@ -4665,7 +4666,7 @@ var require_package = __commonJS({
|
|
4665
4666
|
"messageTransformer/messageTransformer.ts"
|
4666
4667
|
],
|
4667
4668
|
dependencies: {
|
4668
|
-
"@jsforce/jsforce-node": "^3.
|
4669
|
+
"@jsforce/jsforce-node": "^3.4.0",
|
4669
4670
|
"@salesforce/kit": "^3.1.6",
|
4670
4671
|
"@salesforce/schemas": "^1.9.0",
|
4671
4672
|
"@salesforce/ts-types": "^2.0.10",
|
@@ -4763,7 +4764,7 @@ var require_package = __commonJS({
|
|
4763
4764
|
output: []
|
4764
4765
|
},
|
4765
4766
|
"test:only": {
|
4766
|
-
command: 'nyc mocha "test
|
4767
|
+
command: 'nyc mocha "test/unit/**/*.test.ts"',
|
4767
4768
|
env: {
|
4768
4769
|
FORCE_COLOR: "2"
|
4769
4770
|
},
|
@@ -12371,6 +12372,360 @@ var require_proper_lockfile = __commonJS({
|
|
12371
12372
|
}
|
12372
12373
|
});
|
12373
12374
|
|
12375
|
+
// node_modules/ts-retry-promise/dist/timeout.js
|
12376
|
+
var require_timeout = __commonJS({
|
12377
|
+
"node_modules/ts-retry-promise/dist/timeout.js"(exports2) {
|
12378
|
+
"use strict";
|
12379
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
12380
|
+
exports2.timeout = void 0;
|
12381
|
+
exports2.timeout = function(millies, f) {
|
12382
|
+
if (millies === "INFINITELY") {
|
12383
|
+
return f(function() {
|
12384
|
+
return false;
|
12385
|
+
});
|
12386
|
+
}
|
12387
|
+
var done = false;
|
12388
|
+
var doneF = function() {
|
12389
|
+
return done;
|
12390
|
+
};
|
12391
|
+
return new Promise(function(resolve, reject) {
|
12392
|
+
var timeoutRef = setTimeout(function() {
|
12393
|
+
done = true;
|
12394
|
+
reject(new Error("Timeout after " + millies + "ms"));
|
12395
|
+
}, millies);
|
12396
|
+
var result = f(doneF);
|
12397
|
+
result.then(function(r) {
|
12398
|
+
resolve(r);
|
12399
|
+
clearTimeout(timeoutRef);
|
12400
|
+
}, function(e) {
|
12401
|
+
reject(e);
|
12402
|
+
clearTimeout(timeoutRef);
|
12403
|
+
});
|
12404
|
+
});
|
12405
|
+
};
|
12406
|
+
}
|
12407
|
+
});
|
12408
|
+
|
12409
|
+
// node_modules/ts-retry-promise/dist/retry-promise.js
|
12410
|
+
var require_retry_promise = __commonJS({
|
12411
|
+
"node_modules/ts-retry-promise/dist/retry-promise.js"(exports2) {
|
12412
|
+
"use strict";
|
12413
|
+
var __extends2 = exports2 && exports2.__extends || /* @__PURE__ */ function() {
|
12414
|
+
var extendStatics2 = function(d, b) {
|
12415
|
+
extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
12416
|
+
d2.__proto__ = b2;
|
12417
|
+
} || function(d2, b2) {
|
12418
|
+
for (var p in b2)
|
12419
|
+
if (b2.hasOwnProperty(p))
|
12420
|
+
d2[p] = b2[p];
|
12421
|
+
};
|
12422
|
+
return extendStatics2(d, b);
|
12423
|
+
};
|
12424
|
+
return function(d, b) {
|
12425
|
+
extendStatics2(d, b);
|
12426
|
+
function __() {
|
12427
|
+
this.constructor = d;
|
12428
|
+
}
|
12429
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12430
|
+
};
|
12431
|
+
}();
|
12432
|
+
var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
12433
|
+
function adopt(value) {
|
12434
|
+
return value instanceof P ? value : new P(function(resolve) {
|
12435
|
+
resolve(value);
|
12436
|
+
});
|
12437
|
+
}
|
12438
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
12439
|
+
function fulfilled(value) {
|
12440
|
+
try {
|
12441
|
+
step(generator.next(value));
|
12442
|
+
} catch (e) {
|
12443
|
+
reject(e);
|
12444
|
+
}
|
12445
|
+
}
|
12446
|
+
function rejected(value) {
|
12447
|
+
try {
|
12448
|
+
step(generator["throw"](value));
|
12449
|
+
} catch (e) {
|
12450
|
+
reject(e);
|
12451
|
+
}
|
12452
|
+
}
|
12453
|
+
function step(result) {
|
12454
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
12455
|
+
}
|
12456
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
12457
|
+
});
|
12458
|
+
};
|
12459
|
+
var __generator2 = exports2 && exports2.__generator || function(thisArg, body) {
|
12460
|
+
var _ = { label: 0, sent: function() {
|
12461
|
+
if (t[0] & 1)
|
12462
|
+
throw t[1];
|
12463
|
+
return t[1];
|
12464
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
12465
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
12466
|
+
return this;
|
12467
|
+
}), g;
|
12468
|
+
function verb(n) {
|
12469
|
+
return function(v) {
|
12470
|
+
return step([n, v]);
|
12471
|
+
};
|
12472
|
+
}
|
12473
|
+
function step(op) {
|
12474
|
+
if (f)
|
12475
|
+
throw new TypeError("Generator is already executing.");
|
12476
|
+
while (_)
|
12477
|
+
try {
|
12478
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
12479
|
+
return t;
|
12480
|
+
if (y = 0, t)
|
12481
|
+
op = [op[0] & 2, t.value];
|
12482
|
+
switch (op[0]) {
|
12483
|
+
case 0:
|
12484
|
+
case 1:
|
12485
|
+
t = op;
|
12486
|
+
break;
|
12487
|
+
case 4:
|
12488
|
+
_.label++;
|
12489
|
+
return { value: op[1], done: false };
|
12490
|
+
case 5:
|
12491
|
+
_.label++;
|
12492
|
+
y = op[1];
|
12493
|
+
op = [0];
|
12494
|
+
continue;
|
12495
|
+
case 7:
|
12496
|
+
op = _.ops.pop();
|
12497
|
+
_.trys.pop();
|
12498
|
+
continue;
|
12499
|
+
default:
|
12500
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
12501
|
+
_ = 0;
|
12502
|
+
continue;
|
12503
|
+
}
|
12504
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
12505
|
+
_.label = op[1];
|
12506
|
+
break;
|
12507
|
+
}
|
12508
|
+
if (op[0] === 6 && _.label < t[1]) {
|
12509
|
+
_.label = t[1];
|
12510
|
+
t = op;
|
12511
|
+
break;
|
12512
|
+
}
|
12513
|
+
if (t && _.label < t[2]) {
|
12514
|
+
_.label = t[2];
|
12515
|
+
_.ops.push(op);
|
12516
|
+
break;
|
12517
|
+
}
|
12518
|
+
if (t[2])
|
12519
|
+
_.ops.pop();
|
12520
|
+
_.trys.pop();
|
12521
|
+
continue;
|
12522
|
+
}
|
12523
|
+
op = body.call(thisArg, _);
|
12524
|
+
} catch (e) {
|
12525
|
+
op = [6, e];
|
12526
|
+
y = 0;
|
12527
|
+
} finally {
|
12528
|
+
f = t = 0;
|
12529
|
+
}
|
12530
|
+
if (op[0] & 5)
|
12531
|
+
throw op[1];
|
12532
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
12533
|
+
}
|
12534
|
+
};
|
12535
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
12536
|
+
exports2.NotRetryableError = exports2.RetryError = exports2.notEmpty = exports2.customizeRetry = exports2.customizeDecorator = exports2.retryDecorator = exports2.retry = exports2.wait = exports2.defaultRetryConfig = void 0;
|
12537
|
+
var timeout_1 = require_timeout();
|
12538
|
+
var fixedBackoff = function(attempt, delay) {
|
12539
|
+
return delay;
|
12540
|
+
};
|
12541
|
+
var linearBackoff = function(attempt, delay) {
|
12542
|
+
return attempt * delay;
|
12543
|
+
};
|
12544
|
+
var exponentialBackoff = function(attempt, delay) {
|
12545
|
+
return Math.pow(delay, attempt);
|
12546
|
+
};
|
12547
|
+
exports2.defaultRetryConfig = {
|
12548
|
+
backoff: "FIXED",
|
12549
|
+
delay: 100,
|
12550
|
+
logger: function() {
|
12551
|
+
return void 0;
|
12552
|
+
},
|
12553
|
+
maxBackOff: 5 * 60 * 1e3,
|
12554
|
+
retries: 10,
|
12555
|
+
timeout: 60 * 1e3,
|
12556
|
+
until: function() {
|
12557
|
+
return true;
|
12558
|
+
},
|
12559
|
+
retryIf: function() {
|
12560
|
+
return true;
|
12561
|
+
}
|
12562
|
+
};
|
12563
|
+
function wait(ms) {
|
12564
|
+
return __awaiter2(this, void 0, void 0, function() {
|
12565
|
+
return __generator2(this, function(_a) {
|
12566
|
+
return [2, new Promise(function(resolve) {
|
12567
|
+
return setTimeout(resolve, ms);
|
12568
|
+
})];
|
12569
|
+
});
|
12570
|
+
});
|
12571
|
+
}
|
12572
|
+
exports2.wait = wait;
|
12573
|
+
function retry(f, config) {
|
12574
|
+
return __awaiter2(this, void 0, void 0, function() {
|
12575
|
+
var effectiveConfig;
|
12576
|
+
return __generator2(this, function(_a) {
|
12577
|
+
effectiveConfig = Object.assign({}, exports2.defaultRetryConfig, config);
|
12578
|
+
return [2, timeout_1.timeout(effectiveConfig.timeout, function(done) {
|
12579
|
+
return _retry(f, effectiveConfig, done);
|
12580
|
+
})];
|
12581
|
+
});
|
12582
|
+
});
|
12583
|
+
}
|
12584
|
+
exports2.retry = retry;
|
12585
|
+
function retryDecorator(func, config) {
|
12586
|
+
return function() {
|
12587
|
+
var args = [];
|
12588
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
12589
|
+
args[_i] = arguments[_i];
|
12590
|
+
}
|
12591
|
+
return retry(function() {
|
12592
|
+
return func.apply(void 0, args);
|
12593
|
+
}, config);
|
12594
|
+
};
|
12595
|
+
}
|
12596
|
+
exports2.retryDecorator = retryDecorator;
|
12597
|
+
function customizeDecorator(customConfig) {
|
12598
|
+
return function(args, config) {
|
12599
|
+
return retryDecorator(args, Object.assign({}, customConfig, config));
|
12600
|
+
};
|
12601
|
+
}
|
12602
|
+
exports2.customizeDecorator = customizeDecorator;
|
12603
|
+
function customizeRetry(customConfig) {
|
12604
|
+
return function(f, c) {
|
12605
|
+
var customized = Object.assign({}, customConfig, c);
|
12606
|
+
return retry(f, customized);
|
12607
|
+
};
|
12608
|
+
}
|
12609
|
+
exports2.customizeRetry = customizeRetry;
|
12610
|
+
function _retry(f, config, done) {
|
12611
|
+
return __awaiter2(this, void 0, void 0, function() {
|
12612
|
+
var lastError, delay, retries, i, result, error_1, millisToWait;
|
12613
|
+
return __generator2(this, function(_a) {
|
12614
|
+
switch (_a.label) {
|
12615
|
+
case 0:
|
12616
|
+
switch (config.backoff) {
|
12617
|
+
case "EXPONENTIAL":
|
12618
|
+
delay = exponentialBackoff;
|
12619
|
+
break;
|
12620
|
+
case "FIXED":
|
12621
|
+
delay = fixedBackoff;
|
12622
|
+
break;
|
12623
|
+
case "LINEAR":
|
12624
|
+
delay = linearBackoff;
|
12625
|
+
break;
|
12626
|
+
default:
|
12627
|
+
delay = config.backoff;
|
12628
|
+
}
|
12629
|
+
if (config.retries === "INFINITELY") {
|
12630
|
+
retries = Number.MAX_SAFE_INTEGER;
|
12631
|
+
} else {
|
12632
|
+
retries = config.retries;
|
12633
|
+
}
|
12634
|
+
i = 0;
|
12635
|
+
_a.label = 1;
|
12636
|
+
case 1:
|
12637
|
+
if (!(i <= retries))
|
12638
|
+
return [3, 8];
|
12639
|
+
_a.label = 2;
|
12640
|
+
case 2:
|
12641
|
+
_a.trys.push([2, 4, , 5]);
|
12642
|
+
return [4, f()];
|
12643
|
+
case 3:
|
12644
|
+
result = _a.sent();
|
12645
|
+
if (config.until(result)) {
|
12646
|
+
return [2, result];
|
12647
|
+
}
|
12648
|
+
config.logger("Until condition not met by " + result);
|
12649
|
+
return [3, 5];
|
12650
|
+
case 4:
|
12651
|
+
error_1 = _a.sent();
|
12652
|
+
if (!config.retryIf(error_1)) {
|
12653
|
+
throw error_1;
|
12654
|
+
}
|
12655
|
+
if (error_1.name === NotRetryableError.name) {
|
12656
|
+
throw new RetryError("Met not retryable error. Last error: " + error_1, error_1);
|
12657
|
+
}
|
12658
|
+
lastError = error_1;
|
12659
|
+
config.logger("Retry failed: " + error_1.message);
|
12660
|
+
return [3, 5];
|
12661
|
+
case 5:
|
12662
|
+
millisToWait = delay(i + 1, config.delay);
|
12663
|
+
return [4, wait(millisToWait > config.maxBackOff ? config.maxBackOff : millisToWait)];
|
12664
|
+
case 6:
|
12665
|
+
_a.sent();
|
12666
|
+
if (done()) {
|
12667
|
+
return [3, 8];
|
12668
|
+
}
|
12669
|
+
_a.label = 7;
|
12670
|
+
case 7:
|
12671
|
+
i++;
|
12672
|
+
return [3, 1];
|
12673
|
+
case 8:
|
12674
|
+
throw new RetryError("All retries failed. Last error: " + lastError, lastError);
|
12675
|
+
}
|
12676
|
+
});
|
12677
|
+
});
|
12678
|
+
}
|
12679
|
+
exports2.notEmpty = function(result) {
|
12680
|
+
if (Array.isArray(result)) {
|
12681
|
+
return result.length > 0;
|
12682
|
+
}
|
12683
|
+
return result !== null && result !== void 0;
|
12684
|
+
};
|
12685
|
+
var RetryError = (
|
12686
|
+
/** @class */
|
12687
|
+
function(_super) {
|
12688
|
+
__extends2(RetryError2, _super);
|
12689
|
+
function RetryError2(message, lastError) {
|
12690
|
+
var _this = _super.call(this, message) || this;
|
12691
|
+
_this.lastError = lastError;
|
12692
|
+
return _this;
|
12693
|
+
}
|
12694
|
+
return RetryError2;
|
12695
|
+
}(Error)
|
12696
|
+
);
|
12697
|
+
exports2.RetryError = RetryError;
|
12698
|
+
var BaseError = (
|
12699
|
+
/** @class */
|
12700
|
+
/* @__PURE__ */ function() {
|
12701
|
+
function BaseError2(message) {
|
12702
|
+
var args = [];
|
12703
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
12704
|
+
args[_i - 1] = arguments[_i];
|
12705
|
+
}
|
12706
|
+
this.message = message;
|
12707
|
+
Error.apply(this, args);
|
12708
|
+
}
|
12709
|
+
return BaseError2;
|
12710
|
+
}()
|
12711
|
+
);
|
12712
|
+
BaseError.prototype = new Error();
|
12713
|
+
var NotRetryableError = (
|
12714
|
+
/** @class */
|
12715
|
+
function(_super) {
|
12716
|
+
__extends2(NotRetryableError2, _super);
|
12717
|
+
function NotRetryableError2(message) {
|
12718
|
+
var _this = _super.call(this, message) || this;
|
12719
|
+
Object.defineProperty(_this, "name", { value: _this.constructor.name });
|
12720
|
+
return _this;
|
12721
|
+
}
|
12722
|
+
return NotRetryableError2;
|
12723
|
+
}(BaseError)
|
12724
|
+
);
|
12725
|
+
exports2.NotRetryableError = NotRetryableError;
|
12726
|
+
}
|
12727
|
+
});
|
12728
|
+
|
12374
12729
|
// lib/util/lockRetryOptions.js
|
12375
12730
|
var require_lockRetryOptions = __commonJS({
|
12376
12731
|
"lib/util/lockRetryOptions.js"(exports2) {
|
@@ -12422,10 +12777,12 @@ var require_fileLocking = __commonJS({
|
|
12422
12777
|
return result;
|
12423
12778
|
};
|
12424
12779
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
12425
|
-
exports2.lockInitSync = exports2.lockInit = void 0;
|
12780
|
+
exports2.pollUntilUnlockSync = exports2.pollUntilUnlock = exports2.lockInitSync = exports2.lockInit = void 0;
|
12426
12781
|
var fs = __importStar2(require("node:fs"));
|
12427
12782
|
var node_path_1 = require("node:path");
|
12428
12783
|
var proper_lockfile_1 = require_proper_lockfile();
|
12784
|
+
var kit_1 = require_lib2();
|
12785
|
+
var ts_retry_promise_1 = require_retry_promise();
|
12429
12786
|
var sfError_12 = require_sfError();
|
12430
12787
|
var logger_12 = require_logger();
|
12431
12788
|
var lockRetryOptions_1 = require_lockRetryOptions();
|
@@ -12489,6 +12846,32 @@ var require_fileLocking = __commonJS({
|
|
12489
12846
|
};
|
12490
12847
|
};
|
12491
12848
|
exports2.lockInitSync = lockInitSync;
|
12849
|
+
var pollUntilUnlock = async (filePath) => {
|
12850
|
+
try {
|
12851
|
+
await (0, ts_retry_promise_1.retryDecorator)(proper_lockfile_1.check, {
|
12852
|
+
timeout: kit_1.Duration.minutes(1).milliseconds,
|
12853
|
+
delay: 10,
|
12854
|
+
until: (locked) => locked === false,
|
12855
|
+
// don't retry errors (typically enoent or access on the lockfile, therefore not locked)
|
12856
|
+
retryIf: () => false
|
12857
|
+
})(filePath, lockRetryOptions_1.lockRetryOptions);
|
12858
|
+
} catch (e) {
|
12859
|
+
}
|
12860
|
+
};
|
12861
|
+
exports2.pollUntilUnlock = pollUntilUnlock;
|
12862
|
+
var pollUntilUnlockSync = (filePath) => {
|
12863
|
+
let counter = 0;
|
12864
|
+
let locked = true;
|
12865
|
+
while (locked && counter < 100) {
|
12866
|
+
try {
|
12867
|
+
locked = (0, proper_lockfile_1.checkSync)(filePath, lockRetryOptions_1.lockOptions);
|
12868
|
+
counter++;
|
12869
|
+
} catch {
|
12870
|
+
locked = false;
|
12871
|
+
}
|
12872
|
+
}
|
12873
|
+
};
|
12874
|
+
exports2.pollUntilUnlockSync = pollUntilUnlockSync;
|
12492
12875
|
}
|
12493
12876
|
});
|
12494
12877
|
|
@@ -14050,6 +14433,7 @@ var require_configFile = __commonJS({
|
|
14050
14433
|
try {
|
14051
14434
|
if (!this.hasRead || force) {
|
14052
14435
|
this.logger.debug(`Reading config file: ${this.getPath()} because ${!this.hasRead ? "hasRead is false" : "force parameter is true"}`);
|
14436
|
+
await (0, fileLocking_12.pollUntilUnlock)(this.getPath());
|
14053
14437
|
const obj = (0, kit_1.parseJsonMap)(await fs.promises.readFile(this.getPath(), "utf8"), this.getPath());
|
14054
14438
|
this.setContentsFromFileContents(obj, (await fs.promises.stat(this.getPath(), { bigint: true })).mtimeNs);
|
14055
14439
|
}
|
@@ -14078,6 +14462,7 @@ var require_configFile = __commonJS({
|
|
14078
14462
|
readSync(throwOnNotFound = false, force = false) {
|
14079
14463
|
try {
|
14080
14464
|
if (!this.hasRead || force) {
|
14465
|
+
(0, fileLocking_12.pollUntilUnlockSync)(this.getPath());
|
14081
14466
|
this.logger.debug(`Reading config file: ${this.getPath()}`);
|
14082
14467
|
const obj = (0, kit_1.parseJsonMap)(fs.readFileSync(this.getPath(), "utf8"));
|
14083
14468
|
this.setContentsFromFileContents(obj, fs.statSync(this.getPath(), { bigint: true }).mtimeNs);
|
@@ -33592,7 +33977,7 @@ var require_VERSION = __commonJS({
|
|
33592
33977
|
"node_modules/@jsforce/jsforce-node/lib/VERSION.js"(exports2) {
|
33593
33978
|
"use strict";
|
33594
33979
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
33595
|
-
exports2.default = "3.
|
33980
|
+
exports2.default = "3.4.0";
|
33596
33981
|
}
|
33597
33982
|
});
|
33598
33983
|
|
@@ -47503,11 +47888,12 @@ var require_registry = __commonJS({
|
|
47503
47888
|
Object.defineProperty(exports2, "EmptyRegistry", { enumerable: true, get: function() {
|
47504
47889
|
return empty_1.EmptyRegistry;
|
47505
47890
|
} });
|
47891
|
+
var logger_12 = require_logger2();
|
47506
47892
|
var registry;
|
47507
47893
|
try {
|
47508
47894
|
registry = process.env.JSFORCE_CONNECTION_REGISTRY === "sfdx" ? new sfdx_1.SfdxRegistry({}) : new file_1.FileRegistry({});
|
47509
47895
|
} catch (e) {
|
47510
|
-
|
47896
|
+
(0, logger_12.getLogger)("registry").error(e);
|
47511
47897
|
registry = new empty_1.EmptyRegistry();
|
47512
47898
|
}
|
47513
47899
|
exports2.default = registry;
|
@@ -62441,6 +62827,9 @@ var require_metadata = __commonJS({
|
|
62441
62827
|
includeDetails
|
62442
62828
|
}, schema_1.ApiSchemas.DeployResult);
|
62443
62829
|
}
|
62830
|
+
async cancelDeploy(id) {
|
62831
|
+
return this._invoke("cancelDeploy", { id });
|
62832
|
+
}
|
62444
62833
|
};
|
62445
62834
|
exports2.MetadataApi = MetadataApi;
|
62446
62835
|
var AsyncResultLocator = class extends events_1.EventEmitter {
|
@@ -85003,360 +85392,6 @@ var require_jsonwebtoken = __commonJS({
|
|
85003
85392
|
}
|
85004
85393
|
});
|
85005
85394
|
|
85006
|
-
// node_modules/ts-retry-promise/dist/timeout.js
|
85007
|
-
var require_timeout = __commonJS({
|
85008
|
-
"node_modules/ts-retry-promise/dist/timeout.js"(exports2) {
|
85009
|
-
"use strict";
|
85010
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
85011
|
-
exports2.timeout = void 0;
|
85012
|
-
exports2.timeout = function(millies, f) {
|
85013
|
-
if (millies === "INFINITELY") {
|
85014
|
-
return f(function() {
|
85015
|
-
return false;
|
85016
|
-
});
|
85017
|
-
}
|
85018
|
-
var done = false;
|
85019
|
-
var doneF = function() {
|
85020
|
-
return done;
|
85021
|
-
};
|
85022
|
-
return new Promise(function(resolve, reject) {
|
85023
|
-
var timeoutRef = setTimeout(function() {
|
85024
|
-
done = true;
|
85025
|
-
reject(new Error("Timeout after " + millies + "ms"));
|
85026
|
-
}, millies);
|
85027
|
-
var result = f(doneF);
|
85028
|
-
result.then(function(r) {
|
85029
|
-
resolve(r);
|
85030
|
-
clearTimeout(timeoutRef);
|
85031
|
-
}, function(e) {
|
85032
|
-
reject(e);
|
85033
|
-
clearTimeout(timeoutRef);
|
85034
|
-
});
|
85035
|
-
});
|
85036
|
-
};
|
85037
|
-
}
|
85038
|
-
});
|
85039
|
-
|
85040
|
-
// node_modules/ts-retry-promise/dist/retry-promise.js
|
85041
|
-
var require_retry_promise = __commonJS({
|
85042
|
-
"node_modules/ts-retry-promise/dist/retry-promise.js"(exports2) {
|
85043
|
-
"use strict";
|
85044
|
-
var __extends2 = exports2 && exports2.__extends || /* @__PURE__ */ function() {
|
85045
|
-
var extendStatics2 = function(d, b) {
|
85046
|
-
extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
85047
|
-
d2.__proto__ = b2;
|
85048
|
-
} || function(d2, b2) {
|
85049
|
-
for (var p in b2)
|
85050
|
-
if (b2.hasOwnProperty(p))
|
85051
|
-
d2[p] = b2[p];
|
85052
|
-
};
|
85053
|
-
return extendStatics2(d, b);
|
85054
|
-
};
|
85055
|
-
return function(d, b) {
|
85056
|
-
extendStatics2(d, b);
|
85057
|
-
function __() {
|
85058
|
-
this.constructor = d;
|
85059
|
-
}
|
85060
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
85061
|
-
};
|
85062
|
-
}();
|
85063
|
-
var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
85064
|
-
function adopt(value) {
|
85065
|
-
return value instanceof P ? value : new P(function(resolve) {
|
85066
|
-
resolve(value);
|
85067
|
-
});
|
85068
|
-
}
|
85069
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
85070
|
-
function fulfilled(value) {
|
85071
|
-
try {
|
85072
|
-
step(generator.next(value));
|
85073
|
-
} catch (e) {
|
85074
|
-
reject(e);
|
85075
|
-
}
|
85076
|
-
}
|
85077
|
-
function rejected(value) {
|
85078
|
-
try {
|
85079
|
-
step(generator["throw"](value));
|
85080
|
-
} catch (e) {
|
85081
|
-
reject(e);
|
85082
|
-
}
|
85083
|
-
}
|
85084
|
-
function step(result) {
|
85085
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
85086
|
-
}
|
85087
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
85088
|
-
});
|
85089
|
-
};
|
85090
|
-
var __generator2 = exports2 && exports2.__generator || function(thisArg, body) {
|
85091
|
-
var _ = { label: 0, sent: function() {
|
85092
|
-
if (t[0] & 1)
|
85093
|
-
throw t[1];
|
85094
|
-
return t[1];
|
85095
|
-
}, trys: [], ops: [] }, f, y, t, g;
|
85096
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
85097
|
-
return this;
|
85098
|
-
}), g;
|
85099
|
-
function verb(n) {
|
85100
|
-
return function(v) {
|
85101
|
-
return step([n, v]);
|
85102
|
-
};
|
85103
|
-
}
|
85104
|
-
function step(op) {
|
85105
|
-
if (f)
|
85106
|
-
throw new TypeError("Generator is already executing.");
|
85107
|
-
while (_)
|
85108
|
-
try {
|
85109
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
85110
|
-
return t;
|
85111
|
-
if (y = 0, t)
|
85112
|
-
op = [op[0] & 2, t.value];
|
85113
|
-
switch (op[0]) {
|
85114
|
-
case 0:
|
85115
|
-
case 1:
|
85116
|
-
t = op;
|
85117
|
-
break;
|
85118
|
-
case 4:
|
85119
|
-
_.label++;
|
85120
|
-
return { value: op[1], done: false };
|
85121
|
-
case 5:
|
85122
|
-
_.label++;
|
85123
|
-
y = op[1];
|
85124
|
-
op = [0];
|
85125
|
-
continue;
|
85126
|
-
case 7:
|
85127
|
-
op = _.ops.pop();
|
85128
|
-
_.trys.pop();
|
85129
|
-
continue;
|
85130
|
-
default:
|
85131
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
85132
|
-
_ = 0;
|
85133
|
-
continue;
|
85134
|
-
}
|
85135
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
85136
|
-
_.label = op[1];
|
85137
|
-
break;
|
85138
|
-
}
|
85139
|
-
if (op[0] === 6 && _.label < t[1]) {
|
85140
|
-
_.label = t[1];
|
85141
|
-
t = op;
|
85142
|
-
break;
|
85143
|
-
}
|
85144
|
-
if (t && _.label < t[2]) {
|
85145
|
-
_.label = t[2];
|
85146
|
-
_.ops.push(op);
|
85147
|
-
break;
|
85148
|
-
}
|
85149
|
-
if (t[2])
|
85150
|
-
_.ops.pop();
|
85151
|
-
_.trys.pop();
|
85152
|
-
continue;
|
85153
|
-
}
|
85154
|
-
op = body.call(thisArg, _);
|
85155
|
-
} catch (e) {
|
85156
|
-
op = [6, e];
|
85157
|
-
y = 0;
|
85158
|
-
} finally {
|
85159
|
-
f = t = 0;
|
85160
|
-
}
|
85161
|
-
if (op[0] & 5)
|
85162
|
-
throw op[1];
|
85163
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
85164
|
-
}
|
85165
|
-
};
|
85166
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
85167
|
-
exports2.NotRetryableError = exports2.RetryError = exports2.notEmpty = exports2.customizeRetry = exports2.customizeDecorator = exports2.retryDecorator = exports2.retry = exports2.wait = exports2.defaultRetryConfig = void 0;
|
85168
|
-
var timeout_1 = require_timeout();
|
85169
|
-
var fixedBackoff = function(attempt, delay) {
|
85170
|
-
return delay;
|
85171
|
-
};
|
85172
|
-
var linearBackoff = function(attempt, delay) {
|
85173
|
-
return attempt * delay;
|
85174
|
-
};
|
85175
|
-
var exponentialBackoff = function(attempt, delay) {
|
85176
|
-
return Math.pow(delay, attempt);
|
85177
|
-
};
|
85178
|
-
exports2.defaultRetryConfig = {
|
85179
|
-
backoff: "FIXED",
|
85180
|
-
delay: 100,
|
85181
|
-
logger: function() {
|
85182
|
-
return void 0;
|
85183
|
-
},
|
85184
|
-
maxBackOff: 5 * 60 * 1e3,
|
85185
|
-
retries: 10,
|
85186
|
-
timeout: 60 * 1e3,
|
85187
|
-
until: function() {
|
85188
|
-
return true;
|
85189
|
-
},
|
85190
|
-
retryIf: function() {
|
85191
|
-
return true;
|
85192
|
-
}
|
85193
|
-
};
|
85194
|
-
function wait(ms) {
|
85195
|
-
return __awaiter2(this, void 0, void 0, function() {
|
85196
|
-
return __generator2(this, function(_a) {
|
85197
|
-
return [2, new Promise(function(resolve) {
|
85198
|
-
return setTimeout(resolve, ms);
|
85199
|
-
})];
|
85200
|
-
});
|
85201
|
-
});
|
85202
|
-
}
|
85203
|
-
exports2.wait = wait;
|
85204
|
-
function retry(f, config) {
|
85205
|
-
return __awaiter2(this, void 0, void 0, function() {
|
85206
|
-
var effectiveConfig;
|
85207
|
-
return __generator2(this, function(_a) {
|
85208
|
-
effectiveConfig = Object.assign({}, exports2.defaultRetryConfig, config);
|
85209
|
-
return [2, timeout_1.timeout(effectiveConfig.timeout, function(done) {
|
85210
|
-
return _retry(f, effectiveConfig, done);
|
85211
|
-
})];
|
85212
|
-
});
|
85213
|
-
});
|
85214
|
-
}
|
85215
|
-
exports2.retry = retry;
|
85216
|
-
function retryDecorator(func, config) {
|
85217
|
-
return function() {
|
85218
|
-
var args = [];
|
85219
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
85220
|
-
args[_i] = arguments[_i];
|
85221
|
-
}
|
85222
|
-
return retry(function() {
|
85223
|
-
return func.apply(void 0, args);
|
85224
|
-
}, config);
|
85225
|
-
};
|
85226
|
-
}
|
85227
|
-
exports2.retryDecorator = retryDecorator;
|
85228
|
-
function customizeDecorator(customConfig) {
|
85229
|
-
return function(args, config) {
|
85230
|
-
return retryDecorator(args, Object.assign({}, customConfig, config));
|
85231
|
-
};
|
85232
|
-
}
|
85233
|
-
exports2.customizeDecorator = customizeDecorator;
|
85234
|
-
function customizeRetry(customConfig) {
|
85235
|
-
return function(f, c) {
|
85236
|
-
var customized = Object.assign({}, customConfig, c);
|
85237
|
-
return retry(f, customized);
|
85238
|
-
};
|
85239
|
-
}
|
85240
|
-
exports2.customizeRetry = customizeRetry;
|
85241
|
-
function _retry(f, config, done) {
|
85242
|
-
return __awaiter2(this, void 0, void 0, function() {
|
85243
|
-
var lastError, delay, retries, i, result, error_1, millisToWait;
|
85244
|
-
return __generator2(this, function(_a) {
|
85245
|
-
switch (_a.label) {
|
85246
|
-
case 0:
|
85247
|
-
switch (config.backoff) {
|
85248
|
-
case "EXPONENTIAL":
|
85249
|
-
delay = exponentialBackoff;
|
85250
|
-
break;
|
85251
|
-
case "FIXED":
|
85252
|
-
delay = fixedBackoff;
|
85253
|
-
break;
|
85254
|
-
case "LINEAR":
|
85255
|
-
delay = linearBackoff;
|
85256
|
-
break;
|
85257
|
-
default:
|
85258
|
-
delay = config.backoff;
|
85259
|
-
}
|
85260
|
-
if (config.retries === "INFINITELY") {
|
85261
|
-
retries = Number.MAX_SAFE_INTEGER;
|
85262
|
-
} else {
|
85263
|
-
retries = config.retries;
|
85264
|
-
}
|
85265
|
-
i = 0;
|
85266
|
-
_a.label = 1;
|
85267
|
-
case 1:
|
85268
|
-
if (!(i <= retries))
|
85269
|
-
return [3, 8];
|
85270
|
-
_a.label = 2;
|
85271
|
-
case 2:
|
85272
|
-
_a.trys.push([2, 4, , 5]);
|
85273
|
-
return [4, f()];
|
85274
|
-
case 3:
|
85275
|
-
result = _a.sent();
|
85276
|
-
if (config.until(result)) {
|
85277
|
-
return [2, result];
|
85278
|
-
}
|
85279
|
-
config.logger("Until condition not met by " + result);
|
85280
|
-
return [3, 5];
|
85281
|
-
case 4:
|
85282
|
-
error_1 = _a.sent();
|
85283
|
-
if (!config.retryIf(error_1)) {
|
85284
|
-
throw error_1;
|
85285
|
-
}
|
85286
|
-
if (error_1.name === NotRetryableError.name) {
|
85287
|
-
throw new RetryError("Met not retryable error. Last error: " + error_1, error_1);
|
85288
|
-
}
|
85289
|
-
lastError = error_1;
|
85290
|
-
config.logger("Retry failed: " + error_1.message);
|
85291
|
-
return [3, 5];
|
85292
|
-
case 5:
|
85293
|
-
millisToWait = delay(i + 1, config.delay);
|
85294
|
-
return [4, wait(millisToWait > config.maxBackOff ? config.maxBackOff : millisToWait)];
|
85295
|
-
case 6:
|
85296
|
-
_a.sent();
|
85297
|
-
if (done()) {
|
85298
|
-
return [3, 8];
|
85299
|
-
}
|
85300
|
-
_a.label = 7;
|
85301
|
-
case 7:
|
85302
|
-
i++;
|
85303
|
-
return [3, 1];
|
85304
|
-
case 8:
|
85305
|
-
throw new RetryError("All retries failed. Last error: " + lastError, lastError);
|
85306
|
-
}
|
85307
|
-
});
|
85308
|
-
});
|
85309
|
-
}
|
85310
|
-
exports2.notEmpty = function(result) {
|
85311
|
-
if (Array.isArray(result)) {
|
85312
|
-
return result.length > 0;
|
85313
|
-
}
|
85314
|
-
return result !== null && result !== void 0;
|
85315
|
-
};
|
85316
|
-
var RetryError = (
|
85317
|
-
/** @class */
|
85318
|
-
function(_super) {
|
85319
|
-
__extends2(RetryError2, _super);
|
85320
|
-
function RetryError2(message, lastError) {
|
85321
|
-
var _this = _super.call(this, message) || this;
|
85322
|
-
_this.lastError = lastError;
|
85323
|
-
return _this;
|
85324
|
-
}
|
85325
|
-
return RetryError2;
|
85326
|
-
}(Error)
|
85327
|
-
);
|
85328
|
-
exports2.RetryError = RetryError;
|
85329
|
-
var BaseError = (
|
85330
|
-
/** @class */
|
85331
|
-
/* @__PURE__ */ function() {
|
85332
|
-
function BaseError2(message) {
|
85333
|
-
var args = [];
|
85334
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
85335
|
-
args[_i - 1] = arguments[_i];
|
85336
|
-
}
|
85337
|
-
this.message = message;
|
85338
|
-
Error.apply(this, args);
|
85339
|
-
}
|
85340
|
-
return BaseError2;
|
85341
|
-
}()
|
85342
|
-
);
|
85343
|
-
BaseError.prototype = new Error();
|
85344
|
-
var NotRetryableError = (
|
85345
|
-
/** @class */
|
85346
|
-
function(_super) {
|
85347
|
-
__extends2(NotRetryableError2, _super);
|
85348
|
-
function NotRetryableError2(message) {
|
85349
|
-
var _this = _super.call(this, message) || this;
|
85350
|
-
Object.defineProperty(_this, "name", { value: _this.constructor.name });
|
85351
|
-
return _this;
|
85352
|
-
}
|
85353
|
-
return NotRetryableError2;
|
85354
|
-
}(BaseError)
|
85355
|
-
);
|
85356
|
-
exports2.NotRetryableError = NotRetryableError;
|
85357
|
-
}
|
85358
|
-
});
|
85359
|
-
|
85360
85395
|
// lib/status/pollingClient.js
|
85361
85396
|
var require_pollingClient = __commonJS({
|
85362
85397
|
"lib/status/pollingClient.js"(exports2) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salesforce/core-bundle",
|
3
|
-
"version": "8.2.
|
3
|
+
"version": "8.2.9",
|
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",
|
@@ -19,6 +19,7 @@
|
|
19
19
|
"lint": "wireit",
|
20
20
|
"lint-fix": "yarn sf-lint --fix",
|
21
21
|
"test": "wireit",
|
22
|
+
"test:nuts": "mocha \"test/**/*.nut.ts\" --timeout 500000",
|
22
23
|
"test:only": "wireit",
|
23
24
|
"test:perf": "ts-node test/perf/logger/main.test.ts"
|
24
25
|
},
|
@@ -36,7 +37,7 @@
|
|
36
37
|
"messageTransformer/messageTransformer.ts"
|
37
38
|
],
|
38
39
|
"dependencies": {
|
39
|
-
"@jsforce/jsforce-node": "^3.
|
40
|
+
"@jsforce/jsforce-node": "^3.4.0",
|
40
41
|
"@salesforce/kit": "^3.1.6",
|
41
42
|
"@salesforce/schemas": "^1.9.0",
|
42
43
|
"@salesforce/ts-types": "^2.0.10",
|
@@ -134,7 +135,7 @@
|
|
134
135
|
"output": []
|
135
136
|
},
|
136
137
|
"test:only": {
|
137
|
-
"command": "nyc mocha \"test
|
138
|
+
"command": "nyc mocha \"test/unit/**/*.test.ts\"",
|
138
139
|
"env": {
|
139
140
|
"FORCE_COLOR": "2"
|
140
141
|
},
|