@gapi/gcli 1.8.265 → 1.8.267
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/README-CLI.md +32 -0
- package/README.md +31 -2
- package/build.js +4 -0
- package/docs/changelog.d/2026-11-17-mq-triggers-yaml-queue-declare-mq-trigger-apply-and-queues-triggers.mq-in-lam.md +26 -0
- package/docs/features/README.md +1 -0
- package/docs/features/mq-triggers-yaml.md +39 -0
- package/package.json +1 -1
- package/release/index.js +847 -587
package/release/index.js
CHANGED
|
@@ -12248,7 +12248,7 @@ var require_of = __commonJS({
|
|
|
12248
12248
|
exports2.of = void 0;
|
|
12249
12249
|
var args_1 = require_args();
|
|
12250
12250
|
var from_1 = require_from();
|
|
12251
|
-
function
|
|
12251
|
+
function of19() {
|
|
12252
12252
|
var args = [];
|
|
12253
12253
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
12254
12254
|
args[_i] = arguments[_i];
|
|
@@ -12256,7 +12256,7 @@ var require_of = __commonJS({
|
|
|
12256
12256
|
var scheduler = args_1.popScheduler(args);
|
|
12257
12257
|
return from_1.from(args, scheduler);
|
|
12258
12258
|
}
|
|
12259
|
-
exports2.of =
|
|
12259
|
+
exports2.of = of19;
|
|
12260
12260
|
}
|
|
12261
12261
|
});
|
|
12262
12262
|
|
|
@@ -12391,7 +12391,7 @@ var require_lastValueFrom = __commonJS({
|
|
|
12391
12391
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12392
12392
|
exports2.lastValueFrom = void 0;
|
|
12393
12393
|
var EmptyError_1 = require_EmptyError();
|
|
12394
|
-
function
|
|
12394
|
+
function lastValueFrom63(source, config2) {
|
|
12395
12395
|
var hasConfig = typeof config2 === "object";
|
|
12396
12396
|
return new Promise(function(resolve2, reject) {
|
|
12397
12397
|
var _hasValue = false;
|
|
@@ -12414,7 +12414,7 @@ var require_lastValueFrom = __commonJS({
|
|
|
12414
12414
|
});
|
|
12415
12415
|
});
|
|
12416
12416
|
}
|
|
12417
|
-
exports2.lastValueFrom =
|
|
12417
|
+
exports2.lastValueFrom = lastValueFrom63;
|
|
12418
12418
|
}
|
|
12419
12419
|
});
|
|
12420
12420
|
|
|
@@ -12591,7 +12591,7 @@ var require_map = __commonJS({
|
|
|
12591
12591
|
exports2.map = void 0;
|
|
12592
12592
|
var lift_1 = require_lift();
|
|
12593
12593
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
12594
|
-
function
|
|
12594
|
+
function map32(project, thisArg) {
|
|
12595
12595
|
return lift_1.operate(function(source, subscriber) {
|
|
12596
12596
|
var index = 0;
|
|
12597
12597
|
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
|
|
@@ -12599,7 +12599,7 @@ var require_map = __commonJS({
|
|
|
12599
12599
|
}));
|
|
12600
12600
|
});
|
|
12601
12601
|
}
|
|
12602
|
-
exports2.map =
|
|
12602
|
+
exports2.map = map32;
|
|
12603
12603
|
}
|
|
12604
12604
|
});
|
|
12605
12605
|
|
|
@@ -13050,14 +13050,14 @@ var require_concat = __commonJS({
|
|
|
13050
13050
|
var concatAll_1 = require_concatAll();
|
|
13051
13051
|
var args_1 = require_args();
|
|
13052
13052
|
var from_1 = require_from();
|
|
13053
|
-
function
|
|
13053
|
+
function concat3() {
|
|
13054
13054
|
var args = [];
|
|
13055
13055
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
13056
13056
|
args[_i] = arguments[_i];
|
|
13057
13057
|
}
|
|
13058
13058
|
return concatAll_1.concatAll()(from_1.from(args, args_1.popScheduler(args)));
|
|
13059
13059
|
}
|
|
13060
|
-
exports2.concat =
|
|
13060
|
+
exports2.concat = concat3;
|
|
13061
13061
|
}
|
|
13062
13062
|
});
|
|
13063
13063
|
|
|
@@ -14276,13 +14276,13 @@ var require_catchError = __commonJS({
|
|
|
14276
14276
|
var innerFrom_1 = require_innerFrom();
|
|
14277
14277
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
14278
14278
|
var lift_1 = require_lift();
|
|
14279
|
-
function
|
|
14279
|
+
function catchError14(selector) {
|
|
14280
14280
|
return lift_1.operate(function(source, subscriber) {
|
|
14281
14281
|
var innerSub = null;
|
|
14282
14282
|
var syncUnsub = false;
|
|
14283
14283
|
var handledResult;
|
|
14284
14284
|
innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, function(err) {
|
|
14285
|
-
handledResult = innerFrom_1.innerFrom(selector(err,
|
|
14285
|
+
handledResult = innerFrom_1.innerFrom(selector(err, catchError14(selector)(source)));
|
|
14286
14286
|
if (innerSub) {
|
|
14287
14287
|
innerSub.unsubscribe();
|
|
14288
14288
|
innerSub = null;
|
|
@@ -14298,7 +14298,7 @@ var require_catchError = __commonJS({
|
|
|
14298
14298
|
}
|
|
14299
14299
|
});
|
|
14300
14300
|
}
|
|
14301
|
-
exports2.catchError =
|
|
14301
|
+
exports2.catchError = catchError14;
|
|
14302
14302
|
}
|
|
14303
14303
|
});
|
|
14304
14304
|
|
|
@@ -14354,12 +14354,12 @@ var require_toArray = __commonJS({
|
|
|
14354
14354
|
var arrReducer = function(arr, value) {
|
|
14355
14355
|
return arr.push(value), arr;
|
|
14356
14356
|
};
|
|
14357
|
-
function
|
|
14357
|
+
function toArray3() {
|
|
14358
14358
|
return lift_1.operate(function(source, subscriber) {
|
|
14359
14359
|
reduce_1.reduce(arrReducer, [])(source).subscribe(subscriber);
|
|
14360
14360
|
});
|
|
14361
14361
|
}
|
|
14362
|
-
exports2.toArray =
|
|
14362
|
+
exports2.toArray = toArray3;
|
|
14363
14363
|
}
|
|
14364
14364
|
});
|
|
14365
14365
|
|
|
@@ -14563,7 +14563,7 @@ var require_concat2 = __commonJS({
|
|
|
14563
14563
|
var concatAll_1 = require_concatAll();
|
|
14564
14564
|
var args_1 = require_args();
|
|
14565
14565
|
var from_1 = require_from();
|
|
14566
|
-
function
|
|
14566
|
+
function concat3() {
|
|
14567
14567
|
var args = [];
|
|
14568
14568
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14569
14569
|
args[_i] = arguments[_i];
|
|
@@ -14573,7 +14573,7 @@ var require_concat2 = __commonJS({
|
|
|
14573
14573
|
concatAll_1.concatAll()(from_1.from(__spreadArray2([source], __read2(args)), scheduler)).subscribe(subscriber);
|
|
14574
14574
|
});
|
|
14575
14575
|
}
|
|
14576
|
-
exports2.concat =
|
|
14576
|
+
exports2.concat = concat3;
|
|
14577
14577
|
}
|
|
14578
14578
|
});
|
|
14579
14579
|
|
|
@@ -16648,7 +16648,7 @@ var require_switchMap = __commonJS({
|
|
|
16648
16648
|
var innerFrom_1 = require_innerFrom();
|
|
16649
16649
|
var lift_1 = require_lift();
|
|
16650
16650
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
16651
|
-
function
|
|
16651
|
+
function switchMap53(project, resultSelector) {
|
|
16652
16652
|
return lift_1.operate(function(source, subscriber) {
|
|
16653
16653
|
var innerSubscriber = null;
|
|
16654
16654
|
var index = 0;
|
|
@@ -16672,7 +16672,7 @@ var require_switchMap = __commonJS({
|
|
|
16672
16672
|
}));
|
|
16673
16673
|
});
|
|
16674
16674
|
}
|
|
16675
|
-
exports2.switchMap =
|
|
16675
|
+
exports2.switchMap = switchMap53;
|
|
16676
16676
|
}
|
|
16677
16677
|
});
|
|
16678
16678
|
|
|
@@ -16792,7 +16792,7 @@ var require_tap = __commonJS({
|
|
|
16792
16792
|
var lift_1 = require_lift();
|
|
16793
16793
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
16794
16794
|
var identity_1 = require_identity();
|
|
16795
|
-
function
|
|
16795
|
+
function tap53(observerOrNext, error48, complete) {
|
|
16796
16796
|
var tapObserver = isFunction_1.isFunction(observerOrNext) || error48 || complete ? { next: observerOrNext, error: error48, complete } : observerOrNext;
|
|
16797
16797
|
return tapObserver ? lift_1.operate(function(source, subscriber) {
|
|
16798
16798
|
var _a2;
|
|
@@ -16821,7 +16821,7 @@ var require_tap = __commonJS({
|
|
|
16821
16821
|
}));
|
|
16822
16822
|
}) : identity_1.identity;
|
|
16823
16823
|
}
|
|
16824
|
-
exports2.tap =
|
|
16824
|
+
exports2.tap = tap53;
|
|
16825
16825
|
}
|
|
16826
16826
|
});
|
|
16827
16827
|
|
|
@@ -19972,7 +19972,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
19972
19972
|
}
|
|
19973
19973
|
return true;
|
|
19974
19974
|
}
|
|
19975
|
-
function
|
|
19975
|
+
function map32(obj, fn, contextObj) {
|
|
19976
19976
|
var res = {};
|
|
19977
19977
|
for (var key in obj) {
|
|
19978
19978
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -20462,7 +20462,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
20462
20462
|
exports2.isValidTimestamp = isValidTimestamp;
|
|
20463
20463
|
exports2.issuedAtTime = issuedAtTime;
|
|
20464
20464
|
exports2.jsonEval = jsonEval;
|
|
20465
|
-
exports2.map =
|
|
20465
|
+
exports2.map = map32;
|
|
20466
20466
|
exports2.querystring = querystring;
|
|
20467
20467
|
exports2.querystringDecode = querystringDecode;
|
|
20468
20468
|
exports2.safeGet = safeGet;
|
|
@@ -21755,7 +21755,7 @@ var require_index_node_cjs2 = __commonJS({
|
|
|
21755
21755
|
] = "First argument to `onLog` must be null or a function.", _a2);
|
|
21756
21756
|
var ERROR_FACTORY = new util2.ErrorFactory("app", "Firebase", ERRORS);
|
|
21757
21757
|
var name$1 = "@firebase/app";
|
|
21758
|
-
var
|
|
21758
|
+
var version3 = "0.6.4";
|
|
21759
21759
|
var name$2 = "@firebase/analytics";
|
|
21760
21760
|
var name$3 = "@firebase/auth";
|
|
21761
21761
|
var name$4 = "@firebase/database";
|
|
@@ -22010,17 +22010,17 @@ var require_index_node_cjs2 = __commonJS({
|
|
|
22010
22010
|
namespace[componentName]
|
|
22011
22011
|
) : null;
|
|
22012
22012
|
}
|
|
22013
|
-
function registerVersion(libraryKeyOrName,
|
|
22013
|
+
function registerVersion(libraryKeyOrName, version4, variant) {
|
|
22014
22014
|
var _a3;
|
|
22015
22015
|
var library = (_a3 = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a3 !== void 0 ? _a3 : libraryKeyOrName;
|
|
22016
22016
|
if (variant) {
|
|
22017
22017
|
library += "-" + variant;
|
|
22018
22018
|
}
|
|
22019
22019
|
var libraryMismatch = library.match(/\s|\//);
|
|
22020
|
-
var versionMismatch =
|
|
22020
|
+
var versionMismatch = version4.match(/\s|\//);
|
|
22021
22021
|
if (libraryMismatch || versionMismatch) {
|
|
22022
22022
|
var warning = [
|
|
22023
|
-
'Unable to register library "' + library + '" with version "' +
|
|
22023
|
+
'Unable to register library "' + library + '" with version "' + version4 + '":'
|
|
22024
22024
|
];
|
|
22025
22025
|
if (libraryMismatch) {
|
|
22026
22026
|
warning.push('library name "' + library + '" contains illegal characters (whitespace or "/")');
|
|
@@ -22029,7 +22029,7 @@ var require_index_node_cjs2 = __commonJS({
|
|
|
22029
22029
|
warning.push("and");
|
|
22030
22030
|
}
|
|
22031
22031
|
if (versionMismatch) {
|
|
22032
|
-
warning.push('version name "' +
|
|
22032
|
+
warning.push('version name "' + version4 + '" contains illegal characters (whitespace or "/")');
|
|
22033
22033
|
}
|
|
22034
22034
|
logger.warn(warning.join(" "));
|
|
22035
22035
|
return;
|
|
@@ -22037,7 +22037,7 @@ var require_index_node_cjs2 = __commonJS({
|
|
|
22037
22037
|
registerComponent(new component.Component(
|
|
22038
22038
|
library + "-version",
|
|
22039
22039
|
function() {
|
|
22040
|
-
return { library, version:
|
|
22040
|
+
return { library, version: version4 };
|
|
22041
22041
|
},
|
|
22042
22042
|
"VERSION"
|
|
22043
22043
|
/* VERSION */
|
|
@@ -22110,7 +22110,7 @@ var require_index_node_cjs2 = __commonJS({
|
|
|
22110
22110
|
"PRIVATE"
|
|
22111
22111
|
/* PRIVATE */
|
|
22112
22112
|
));
|
|
22113
|
-
firebase3.registerVersion(name$1,
|
|
22113
|
+
firebase3.registerVersion(name$1, version3, variant);
|
|
22114
22114
|
firebase3.registerVersion("fire-js", "");
|
|
22115
22115
|
}
|
|
22116
22116
|
firebase2.INTERNAL.extendNamespace({
|
|
@@ -24364,7 +24364,7 @@ var require_auth = __commonJS({
|
|
|
24364
24364
|
var b = a && (a[mf] ? "phone" : null);
|
|
24365
24365
|
if (b && a && a[nf]) {
|
|
24366
24366
|
K(this, "uid", a[nf]);
|
|
24367
|
-
K(this, "displayName", a[
|
|
24367
|
+
K(this, "displayName", a[of19] || null);
|
|
24368
24368
|
var c = null;
|
|
24369
24369
|
a[pf] && (c = new Date(a[pf]).toUTCString());
|
|
24370
24370
|
K(this, "enrollmentTime", c);
|
|
@@ -24382,7 +24382,7 @@ var require_auth = __commonJS({
|
|
|
24382
24382
|
}
|
|
24383
24383
|
return b;
|
|
24384
24384
|
}
|
|
24385
|
-
var
|
|
24385
|
+
var of19 = "displayName", pf = "enrolledAt", nf = "mfaEnrollmentId", mf = "phoneInfo";
|
|
24386
24386
|
function rf(a) {
|
|
24387
24387
|
lf.call(this, a);
|
|
24388
24388
|
K(this, "phoneNumber", a[mf]);
|
|
@@ -27763,7 +27763,7 @@ var require_auth = __commonJS({
|
|
|
27763
27763
|
var e2 = null, f3 = {};
|
|
27764
27764
|
if (d) {
|
|
27765
27765
|
d.uid && (f3[nf] = d.uid);
|
|
27766
|
-
d.displayName && (f3[
|
|
27766
|
+
d.displayName && (f3[of19] = d.displayName);
|
|
27767
27767
|
d.enrollmentTime && (f3[pf] = new Date(d.enrollmentTime).toISOString());
|
|
27768
27768
|
d.phoneNumber && (f3[mf] = d.phoneNumber);
|
|
27769
27769
|
try {
|
|
@@ -29878,7 +29878,7 @@ var require_buffer_list = __commonJS({
|
|
|
29878
29878
|
}
|
|
29879
29879
|
}, {
|
|
29880
29880
|
key: "concat",
|
|
29881
|
-
value: function
|
|
29881
|
+
value: function concat3(n) {
|
|
29882
29882
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
29883
29883
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
29884
29884
|
var p = this.head;
|
|
@@ -32896,7 +32896,7 @@ var require_buffer_list2 = __commonJS({
|
|
|
32896
32896
|
}
|
|
32897
32897
|
}, {
|
|
32898
32898
|
key: "concat",
|
|
32899
|
-
value: function
|
|
32899
|
+
value: function concat3(n) {
|
|
32900
32900
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
32901
32901
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
32902
32902
|
var p = this.head;
|
|
@@ -35484,16 +35484,16 @@ var require_encoder = __commonJS({
|
|
|
35484
35484
|
}
|
|
35485
35485
|
return bl(acc);
|
|
35486
35486
|
}
|
|
35487
|
-
function encodeMap(
|
|
35488
|
-
const acc = [getHeader(
|
|
35489
|
-
const keys = [...
|
|
35487
|
+
function encodeMap(map32, options, encode3) {
|
|
35488
|
+
const acc = [getHeader(map32.size, 128, 222)];
|
|
35489
|
+
const keys = [...map32.keys()];
|
|
35490
35490
|
if (!options.preferMap) {
|
|
35491
35491
|
if (keys.every((item) => typeof item === "string")) {
|
|
35492
35492
|
console.warn("Map with string only keys will be deserialized as an object!");
|
|
35493
35493
|
}
|
|
35494
35494
|
}
|
|
35495
35495
|
keys.forEach((key) => {
|
|
35496
|
-
acc.push(encode3(key), encode3(
|
|
35496
|
+
acc.push(encode3(key), encode3(map32.get(key)));
|
|
35497
35497
|
});
|
|
35498
35498
|
return bl(acc);
|
|
35499
35499
|
}
|
|
@@ -35988,8 +35988,8 @@ var require_index_cjs3 = __commonJS({
|
|
|
35988
35988
|
}
|
|
35989
35989
|
var firebase2 = _interopDefault(require_index_node_cjs2());
|
|
35990
35990
|
var name2 = "firebase";
|
|
35991
|
-
var
|
|
35992
|
-
firebase2.registerVersion(name2,
|
|
35991
|
+
var version3 = "7.14.6";
|
|
35992
|
+
firebase2.registerVersion(name2, version3, "app");
|
|
35993
35993
|
module2.exports = firebase2;
|
|
35994
35994
|
}
|
|
35995
35995
|
});
|
|
@@ -37522,6 +37522,25 @@ var init_gql_client = __esm({
|
|
|
37522
37522
|
variables: { projectId }
|
|
37523
37523
|
}).pipe((0, import_operators.map)((res) => res.listRabbitMqInstances));
|
|
37524
37524
|
}
|
|
37525
|
+
static declareQueue(id, projectId, payload) {
|
|
37526
|
+
return this.query({
|
|
37527
|
+
query: gql`
|
|
37528
|
+
mutation declareQueue(
|
|
37529
|
+
$id: String!
|
|
37530
|
+
$projectId: String!
|
|
37531
|
+
$payload: RabbitMqInputQueue!
|
|
37532
|
+
) {
|
|
37533
|
+
declareQueue(id: $id, projectId: $projectId, payload: $payload) {
|
|
37534
|
+
id
|
|
37535
|
+
name
|
|
37536
|
+
durable
|
|
37537
|
+
auto_delete
|
|
37538
|
+
}
|
|
37539
|
+
}
|
|
37540
|
+
`,
|
|
37541
|
+
variables: { id, projectId, payload }
|
|
37542
|
+
}).pipe((0, import_operators.map)((res) => res.declareQueue));
|
|
37543
|
+
}
|
|
37525
37544
|
static uninstallRabbitMq(id, projectId) {
|
|
37526
37545
|
return this.query({
|
|
37527
37546
|
query: gql`
|
|
@@ -39504,22 +39523,22 @@ var require_source_map_generator = __commonJS({
|
|
|
39504
39523
|
}, this);
|
|
39505
39524
|
};
|
|
39506
39525
|
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
39507
|
-
var
|
|
39526
|
+
var map32 = {
|
|
39508
39527
|
version: this._version,
|
|
39509
39528
|
sources: this._sources.toArray(),
|
|
39510
39529
|
names: this._names.toArray(),
|
|
39511
39530
|
mappings: this._serializeMappings()
|
|
39512
39531
|
};
|
|
39513
39532
|
if (this._file != null) {
|
|
39514
|
-
|
|
39533
|
+
map32.file = this._file;
|
|
39515
39534
|
}
|
|
39516
39535
|
if (this._sourceRoot != null) {
|
|
39517
|
-
|
|
39536
|
+
map32.sourceRoot = this._sourceRoot;
|
|
39518
39537
|
}
|
|
39519
39538
|
if (this._sourcesContents) {
|
|
39520
|
-
|
|
39539
|
+
map32.sourcesContent = this._generateSourcesContent(map32.sources, map32.sourceRoot);
|
|
39521
39540
|
}
|
|
39522
|
-
return
|
|
39541
|
+
return map32;
|
|
39523
39542
|
};
|
|
39524
39543
|
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
39525
39544
|
return JSON.stringify(this.toJSON());
|
|
@@ -39751,15 +39770,15 @@ var require_source_map_consumer = __commonJS({
|
|
|
39751
39770
|
if (typeof aSourceMap === "string") {
|
|
39752
39771
|
sourceMap = util2.parseSourceMapInput(aSourceMap);
|
|
39753
39772
|
}
|
|
39754
|
-
var
|
|
39773
|
+
var version3 = util2.getArg(sourceMap, "version");
|
|
39755
39774
|
var sources = util2.getArg(sourceMap, "sources");
|
|
39756
39775
|
var names = util2.getArg(sourceMap, "names", []);
|
|
39757
39776
|
var sourceRoot = util2.getArg(sourceMap, "sourceRoot", null);
|
|
39758
39777
|
var sourcesContent = util2.getArg(sourceMap, "sourcesContent", null);
|
|
39759
39778
|
var mappings = util2.getArg(sourceMap, "mappings");
|
|
39760
39779
|
var file2 = util2.getArg(sourceMap, "file", null);
|
|
39761
|
-
if (
|
|
39762
|
-
throw new Error("Unsupported version: " +
|
|
39780
|
+
if (version3 != this._version) {
|
|
39781
|
+
throw new Error("Unsupported version: " + version3);
|
|
39763
39782
|
}
|
|
39764
39783
|
if (sourceRoot) {
|
|
39765
39784
|
sourceRoot = util2.normalize(sourceRoot);
|
|
@@ -40064,10 +40083,10 @@ var require_source_map_consumer = __commonJS({
|
|
|
40064
40083
|
if (typeof aSourceMap === "string") {
|
|
40065
40084
|
sourceMap = util2.parseSourceMapInput(aSourceMap);
|
|
40066
40085
|
}
|
|
40067
|
-
var
|
|
40086
|
+
var version3 = util2.getArg(sourceMap, "version");
|
|
40068
40087
|
var sections = util2.getArg(sourceMap, "sections");
|
|
40069
|
-
if (
|
|
40070
|
-
throw new Error("Unsupported version: " +
|
|
40088
|
+
if (version3 != this._version) {
|
|
40089
|
+
throw new Error("Unsupported version: " + version3);
|
|
40071
40090
|
}
|
|
40072
40091
|
this._sources = new ArraySet();
|
|
40073
40092
|
this._names = new ArraySet();
|
|
@@ -40412,7 +40431,7 @@ var require_source_node = __commonJS({
|
|
|
40412
40431
|
line: 1,
|
|
40413
40432
|
column: 0
|
|
40414
40433
|
};
|
|
40415
|
-
var
|
|
40434
|
+
var map32 = new SourceMapGenerator(aArgs);
|
|
40416
40435
|
var sourceMappingActive = false;
|
|
40417
40436
|
var lastOriginalSource = null;
|
|
40418
40437
|
var lastOriginalLine = null;
|
|
@@ -40422,7 +40441,7 @@ var require_source_node = __commonJS({
|
|
|
40422
40441
|
generated.code += chunk;
|
|
40423
40442
|
if (original.source !== null && original.line !== null && original.column !== null) {
|
|
40424
40443
|
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
|
|
40425
|
-
|
|
40444
|
+
map32.addMapping({
|
|
40426
40445
|
source: original.source,
|
|
40427
40446
|
original: {
|
|
40428
40447
|
line: original.line,
|
|
@@ -40441,7 +40460,7 @@ var require_source_node = __commonJS({
|
|
|
40441
40460
|
lastOriginalName = original.name;
|
|
40442
40461
|
sourceMappingActive = true;
|
|
40443
40462
|
} else if (sourceMappingActive) {
|
|
40444
|
-
|
|
40463
|
+
map32.addMapping({
|
|
40445
40464
|
generated: {
|
|
40446
40465
|
line: generated.line,
|
|
40447
40466
|
column: generated.column
|
|
@@ -40458,7 +40477,7 @@ var require_source_node = __commonJS({
|
|
|
40458
40477
|
lastOriginalSource = null;
|
|
40459
40478
|
sourceMappingActive = false;
|
|
40460
40479
|
} else if (sourceMappingActive) {
|
|
40461
|
-
|
|
40480
|
+
map32.addMapping({
|
|
40462
40481
|
source: original.source,
|
|
40463
40482
|
original: {
|
|
40464
40483
|
line: original.line,
|
|
@@ -40477,9 +40496,9 @@ var require_source_node = __commonJS({
|
|
|
40477
40496
|
}
|
|
40478
40497
|
});
|
|
40479
40498
|
this.walkSourceContents(function(sourceFile, sourceContent) {
|
|
40480
|
-
|
|
40499
|
+
map32.setSourceContent(sourceFile, sourceContent);
|
|
40481
40500
|
});
|
|
40482
|
-
return { code: generated.code, map:
|
|
40501
|
+
return { code: generated.code, map: map32 };
|
|
40483
40502
|
};
|
|
40484
40503
|
exports2.SourceNode = SourceNode;
|
|
40485
40504
|
}
|
|
@@ -42819,7 +42838,7 @@ var require_typescript = __commonJS({
|
|
|
42819
42838
|
makeImport: () => makeImport,
|
|
42820
42839
|
makeStringLiteral: () => makeStringLiteral,
|
|
42821
42840
|
mangleScopedPackageName: () => mangleScopedPackageName,
|
|
42822
|
-
map: () =>
|
|
42841
|
+
map: () => map32,
|
|
42823
42842
|
mapAllOrFail: () => mapAllOrFail,
|
|
42824
42843
|
mapDefined: () => mapDefined,
|
|
42825
42844
|
mapDefinedIterator: () => mapDefinedIterator,
|
|
@@ -43145,7 +43164,7 @@ var require_typescript = __commonJS({
|
|
|
43145
43164
|
textSpansEqual: () => textSpansEqual,
|
|
43146
43165
|
textToKeywordObj: () => textToKeywordObj,
|
|
43147
43166
|
timestamp: () => timestamp,
|
|
43148
|
-
toArray: () =>
|
|
43167
|
+
toArray: () => toArray3,
|
|
43149
43168
|
toBuilderFileEmit: () => toBuilderFileEmit,
|
|
43150
43169
|
toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit,
|
|
43151
43170
|
toEditorSettings: () => toEditorSettings,
|
|
@@ -43243,7 +43262,7 @@ var require_typescript = __commonJS({
|
|
|
43243
43262
|
usingSingleLineStringWriter: () => usingSingleLineStringWriter,
|
|
43244
43263
|
utf16EncodeAsString: () => utf16EncodeAsString,
|
|
43245
43264
|
validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage,
|
|
43246
|
-
version: () =>
|
|
43265
|
+
version: () => version3,
|
|
43247
43266
|
versionMajorMinor: () => versionMajorMinor,
|
|
43248
43267
|
visitArray: () => visitArray,
|
|
43249
43268
|
visitCommaListElements: () => visitCommaListElements,
|
|
@@ -43267,7 +43286,7 @@ var require_typescript = __commonJS({
|
|
|
43267
43286
|
});
|
|
43268
43287
|
module3.exports = __toCommonJS2(typescript_exports);
|
|
43269
43288
|
var versionMajorMinor = "5.9";
|
|
43270
|
-
var
|
|
43289
|
+
var version3 = "5.9.3";
|
|
43271
43290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
43272
43291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
43273
43292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -43463,7 +43482,7 @@ var require_typescript = __commonJS({
|
|
|
43463
43482
|
function clear(array2) {
|
|
43464
43483
|
array2.length = 0;
|
|
43465
43484
|
}
|
|
43466
|
-
function
|
|
43485
|
+
function map32(array2, f3) {
|
|
43467
43486
|
let result;
|
|
43468
43487
|
if (array2 !== void 0) {
|
|
43469
43488
|
result = [];
|
|
@@ -44321,7 +44340,7 @@ var require_typescript = __commonJS({
|
|
|
44321
44340
|
function isArray(value) {
|
|
44322
44341
|
return Array.isArray(value);
|
|
44323
44342
|
}
|
|
44324
|
-
function
|
|
44343
|
+
function toArray3(value) {
|
|
44325
44344
|
return isArray(value) ? value : [value];
|
|
44326
44345
|
}
|
|
44327
44346
|
function isString(text) {
|
|
@@ -44992,7 +45011,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
44992
45011
|
}
|
|
44993
45012
|
Debug2.getFunctionName = getFunctionName;
|
|
44994
45013
|
function formatSymbol(symbol2) {
|
|
44995
|
-
return `{ name: ${unescapeLeadingUnderscores(symbol2.escapedName)}; flags: ${formatSymbolFlags(symbol2.flags)}; declarations: ${
|
|
45014
|
+
return `{ name: ${unescapeLeadingUnderscores(symbol2.escapedName)}; flags: ${formatSymbolFlags(symbol2.flags)}; declarations: ${map32(symbol2.declarations, (node) => formatSyntaxKind(node.kind))} }`;
|
|
44996
45015
|
}
|
|
44997
45016
|
Debug2.formatSymbol = formatSymbol;
|
|
44998
45017
|
function formatEnum(value = 0, enumObject, isFlags) {
|
|
@@ -45418,7 +45437,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
45418
45437
|
case 1:
|
|
45419
45438
|
return zipWith(
|
|
45420
45439
|
this.sources,
|
|
45421
|
-
this.targets ||
|
|
45440
|
+
this.targets || map32(this.sources, () => "any"),
|
|
45422
45441
|
(s2, t2) => `${s2.__debugTypeToString()} -> ${typeof t2 === "string" ? t2 : t2.__debugTypeToString()}`
|
|
45423
45442
|
).join(", ");
|
|
45424
45443
|
case 2:
|
|
@@ -46053,10 +46072,10 @@ ${lanes.join("\n")}
|
|
|
46053
46072
|
}
|
|
46054
46073
|
}
|
|
46055
46074
|
function formatDisjunction(alternatives) {
|
|
46056
|
-
return
|
|
46075
|
+
return map32(alternatives, formatAlternative).join(" || ") || "*";
|
|
46057
46076
|
}
|
|
46058
46077
|
function formatAlternative(comparators) {
|
|
46059
|
-
return
|
|
46078
|
+
return map32(comparators, formatComparator).join(" ");
|
|
46060
46079
|
}
|
|
46061
46080
|
function formatComparator(comparator) {
|
|
46062
46081
|
return `${comparator.operator}${comparator.operand}`;
|
|
@@ -63983,7 +64002,7 @@ ${lanes.join("\n")}
|
|
|
63983
64002
|
currentDirectory = normalizePath(currentDirectory);
|
|
63984
64003
|
const absolutePath = combinePaths(currentDirectory, path2);
|
|
63985
64004
|
return {
|
|
63986
|
-
includeFilePatterns:
|
|
64005
|
+
includeFilePatterns: map32(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`),
|
|
63987
64006
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
63988
64007
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
63989
64008
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -66493,7 +66512,7 @@ ${lanes.join("\n")}
|
|
|
66493
66512
|
if (isObjectBindingPattern(node)) {
|
|
66494
66513
|
return setOriginalNode(
|
|
66495
66514
|
setTextRange(
|
|
66496
|
-
factory2.createObjectLiteralExpression(
|
|
66515
|
+
factory2.createObjectLiteralExpression(map32(node.elements, convertToObjectAssignmentElement)),
|
|
66497
66516
|
node
|
|
66498
66517
|
),
|
|
66499
66518
|
node
|
|
@@ -66505,7 +66524,7 @@ ${lanes.join("\n")}
|
|
|
66505
66524
|
if (isArrayBindingPattern(node)) {
|
|
66506
66525
|
return setOriginalNode(
|
|
66507
66526
|
setTextRange(
|
|
66508
|
-
factory2.createArrayLiteralExpression(
|
|
66527
|
+
factory2.createArrayLiteralExpression(map32(node.elements, convertToArrayAssignmentElement)),
|
|
66509
66528
|
node
|
|
66510
66529
|
),
|
|
66511
66530
|
node
|
|
@@ -74327,7 +74346,7 @@ ${lanes.join("\n")}
|
|
|
74327
74346
|
if (some(helperNames)) {
|
|
74328
74347
|
helperNames.sort(compareStringsCaseSensitive);
|
|
74329
74348
|
const namedBindings = nodeFactory.createNamedImports(
|
|
74330
|
-
|
|
74349
|
+
map32(helperNames, (name2) => isFileLevelUniqueName(sourceFile, name2) ? nodeFactory.createImportSpecifier(
|
|
74331
74350
|
/*isTypeOnly*/
|
|
74332
74351
|
false,
|
|
74333
74352
|
/*propertyName*/
|
|
@@ -84511,7 +84530,7 @@ ${lanes.join("\n")}
|
|
|
84511
84530
|
const referencedFiles = context.referencedFiles;
|
|
84512
84531
|
const typeReferenceDirectives = context.typeReferenceDirectives;
|
|
84513
84532
|
const libReferenceDirectives = context.libReferenceDirectives;
|
|
84514
|
-
forEach(
|
|
84533
|
+
forEach(toArray3(entryOrList), (arg) => {
|
|
84515
84534
|
const { types: types3, lib, path: path2, ["resolution-mode"]: res, preserve: _preserve } = arg.arguments;
|
|
84516
84535
|
const preserve = _preserve === "true" ? true : void 0;
|
|
84517
84536
|
if (arg.arguments["no-default-lib"] === "true") {
|
|
@@ -84530,8 +84549,8 @@ ${lanes.join("\n")}
|
|
|
84530
84549
|
break;
|
|
84531
84550
|
}
|
|
84532
84551
|
case "amd-dependency": {
|
|
84533
|
-
context.amdDependencies =
|
|
84534
|
-
|
|
84552
|
+
context.amdDependencies = map32(
|
|
84553
|
+
toArray3(entryOrList),
|
|
84535
84554
|
(x2) => ({ name: x2.arguments.name, path: x2.arguments.path })
|
|
84536
84555
|
);
|
|
84537
84556
|
break;
|
|
@@ -84551,7 +84570,7 @@ ${lanes.join("\n")}
|
|
|
84551
84570
|
}
|
|
84552
84571
|
case "ts-nocheck":
|
|
84553
84572
|
case "ts-check": {
|
|
84554
|
-
forEach(
|
|
84573
|
+
forEach(toArray3(entryOrList), (entry) => {
|
|
84555
84574
|
if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) {
|
|
84556
84575
|
context.checkJsDirective = {
|
|
84557
84576
|
enabled: key === "ts-check",
|
|
@@ -86879,7 +86898,7 @@ ${lanes.join("\n")}
|
|
|
86879
86898
|
function convertToTSConfig(configParseResult, configFileName, host) {
|
|
86880
86899
|
var _a2, _b, _c;
|
|
86881
86900
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
|
|
86882
|
-
const files =
|
|
86901
|
+
const files = map32(
|
|
86883
86902
|
filter4(
|
|
86884
86903
|
configParseResult.fileNames,
|
|
86885
86904
|
!((_b = (_a2 = configParseResult.options.configFile) == null ? void 0 : _a2.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs) ? returnTrue : matchesSpecs(
|
|
@@ -86909,7 +86928,7 @@ ${lanes.join("\n")}
|
|
|
86909
86928
|
version: void 0
|
|
86910
86929
|
},
|
|
86911
86930
|
watchOptions: watchOptionMap && optionMapToObject(watchOptionMap),
|
|
86912
|
-
references:
|
|
86931
|
+
references: map32(configParseResult.projectReferences, (r2) => ({ ...r2, path: r2.originalPath ? r2.originalPath : "", originalPath: void 0 })),
|
|
86913
86932
|
files: length(files) ? files : void 0,
|
|
86914
86933
|
...((_c = configParseResult.options.configFile) == null ? void 0 : _c.configFileSpecs) ? {
|
|
86915
86934
|
include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs),
|
|
@@ -87199,8 +87218,8 @@ ${lanes.join("\n")}
|
|
|
87199
87218
|
if (!option) Debug.fail(`No option named ${settingName}?`);
|
|
87200
87219
|
const map210 = option.type instanceof Map ? option.type : void 0;
|
|
87201
87220
|
if (isArray(value)) {
|
|
87202
|
-
const
|
|
87203
|
-
return `[${value.map((v) => formatSingleValue(v,
|
|
87221
|
+
const map33 = "element" in option && option.element.type instanceof Map ? option.element.type : void 0;
|
|
87222
|
+
return `[${value.map((v) => formatSingleValue(v, map33)).join(", ")}]`;
|
|
87204
87223
|
} else {
|
|
87205
87224
|
return formatSingleValue(value, map210);
|
|
87206
87225
|
}
|
|
@@ -87598,7 +87617,7 @@ ${lanes.join("\n")}
|
|
|
87598
87617
|
const setPropertyInResultIfNotUndefined = (propertyName) => {
|
|
87599
87618
|
if (ownConfig.raw[propertyName]) return;
|
|
87600
87619
|
if (extendsRaw[propertyName]) {
|
|
87601
|
-
result[propertyName] =
|
|
87620
|
+
result[propertyName] = map32(extendsRaw[propertyName], (path2) => startsWithConfigDirTemplate(path2) || isRootedDiskPath(path2) ? path2 : combinePaths(
|
|
87602
87621
|
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))),
|
|
87603
87622
|
path2
|
|
87604
87623
|
));
|
|
@@ -87907,7 +87926,7 @@ ${lanes.join("\n")}
|
|
|
87907
87926
|
}
|
|
87908
87927
|
}
|
|
87909
87928
|
function convertJsonOptionOfListType(option, values, basePath, errors, propertyAssignment, valueExpression, sourceFile) {
|
|
87910
|
-
return filter4(
|
|
87929
|
+
return filter4(map32(values, (v, index) => convertJsonOption(option.element, v, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index], sourceFile)), (v) => option.listPreserveFalsyValues ? true : !!v);
|
|
87911
87930
|
}
|
|
87912
87931
|
var invalidTrailingRecursionPattern = /(?:^|\/)\*\*\/?$/;
|
|
87913
87932
|
var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/;
|
|
@@ -87947,7 +87966,7 @@ ${lanes.join("\n")}
|
|
|
87947
87966
|
".json"
|
|
87948
87967
|
/* Json */
|
|
87949
87968
|
));
|
|
87950
|
-
const includeFilePatterns =
|
|
87969
|
+
const includeFilePatterns = map32(getRegularExpressionsForWildcards(includes, basePath, "files"), (pattern) => `^${pattern}$`);
|
|
87951
87970
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, host.useCaseSensitiveFileNames)) : emptyArray;
|
|
87952
87971
|
}
|
|
87953
87972
|
const includeIndex = findIndex(jsonOnlyIncludeRegexes, (re) => re.test(file2));
|
|
@@ -88379,7 +88398,7 @@ ${lanes.join("\n")}
|
|
|
88379
88398
|
}
|
|
88380
88399
|
var typeScriptVersion;
|
|
88381
88400
|
function getPackageJsonTypesVersionsPaths(typesVersions) {
|
|
88382
|
-
if (!typeScriptVersion) typeScriptVersion = new Version(
|
|
88401
|
+
if (!typeScriptVersion) typeScriptVersion = new Version(version3);
|
|
88383
88402
|
for (const key in typesVersions) {
|
|
88384
88403
|
if (!hasProperty(typesVersions, key)) continue;
|
|
88385
88404
|
const keyRange = VersionRange.tryParse(key);
|
|
@@ -90027,7 +90046,7 @@ ${lanes.join("\n")}
|
|
|
90027
90046
|
false
|
|
90028
90047
|
);
|
|
90029
90048
|
if (state.traceEnabled) {
|
|
90030
|
-
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version,
|
|
90049
|
+
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version3, moduleName);
|
|
90031
90050
|
}
|
|
90032
90051
|
const pathPatterns = tryParsePatterns(versionPaths.paths);
|
|
90033
90052
|
const result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, pathPatterns, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);
|
|
@@ -90509,7 +90528,7 @@ ${lanes.join("\n")}
|
|
|
90509
90528
|
if (!startsWith(key, "types@")) return false;
|
|
90510
90529
|
const range = VersionRange.tryParse(key.substring("types@".length));
|
|
90511
90530
|
if (!range) return false;
|
|
90512
|
-
return range.test(
|
|
90531
|
+
return range.test(version3);
|
|
90513
90532
|
}
|
|
90514
90533
|
function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
90515
90534
|
return loadModuleFromNearestNodeModulesDirectoryWorker(
|
|
@@ -90645,7 +90664,7 @@ ${lanes.join("\n")}
|
|
|
90645
90664
|
const versionPaths = rest !== "" && packageInfo ? getVersionPathsOfPackageJsonInfo(packageInfo, state) : void 0;
|
|
90646
90665
|
if (versionPaths) {
|
|
90647
90666
|
if (state.traceEnabled) {
|
|
90648
|
-
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version,
|
|
90667
|
+
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version3, rest);
|
|
90649
90668
|
}
|
|
90650
90669
|
const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host);
|
|
90651
90670
|
const pathPatterns = tryParsePatterns(versionPaths.paths);
|
|
@@ -95247,7 +95266,7 @@ ${lanes.join("\n")}
|
|
|
95247
95266
|
}
|
|
95248
95267
|
const normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
|
|
95249
95268
|
const relativePaths = flatMap(normalizedSourcePaths, (sourcePath) => {
|
|
95250
|
-
return
|
|
95269
|
+
return map32(normalizedTargetPaths, (targetPath) => ensurePathIsNonModuleName(getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)));
|
|
95251
95270
|
});
|
|
95252
95271
|
const shortest = min(relativePaths, compareNumberOfDirectorySeparators);
|
|
95253
95272
|
if (!shortest) {
|
|
@@ -98292,7 +98311,7 @@ ${lanes.join("\n")}
|
|
|
98292
98311
|
const exportedSymbol = exports22 ? find(symbolsToArray(exports22), (symbol2) => !!getSymbolIfSameReference(symbol2, localSymbol)) : void 0;
|
|
98293
98312
|
const diagnostic = exportedSymbol ? error210(name2, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error210(name2, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
|
|
98294
98313
|
if (localSymbol.declarations) {
|
|
98295
|
-
addRelatedInfo(diagnostic, ...
|
|
98314
|
+
addRelatedInfo(diagnostic, ...map32(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
|
|
98296
98315
|
}
|
|
98297
98316
|
}
|
|
98298
98317
|
} else {
|
|
@@ -101073,7 +101092,7 @@ ${lanes.join("\n")}
|
|
|
101073
101092
|
const types3 = type.types;
|
|
101074
101093
|
const templateHead = factory.createTemplateHead(texts[0]);
|
|
101075
101094
|
const templateSpans = factory.createNodeArray(
|
|
101076
|
-
|
|
101095
|
+
map32(types3, (t2, i2) => factory.createTemplateLiteralTypeSpan(
|
|
101077
101096
|
typeToTypeNodeHelper(t2, context),
|
|
101078
101097
|
(i2 < types3.length - 1 ? factory.createTemplateMiddle : factory.createTemplateTail)(texts[i2 + 1])
|
|
101079
101098
|
))
|
|
@@ -101442,7 +101461,7 @@ ${lanes.join("\n")}
|
|
|
101442
101461
|
}
|
|
101443
101462
|
const abstractSignatures = filter4(resolved.constructSignatures, (signature) => !!(signature.flags & 4));
|
|
101444
101463
|
if (some(abstractSignatures)) {
|
|
101445
|
-
const types3 =
|
|
101464
|
+
const types3 = map32(abstractSignatures, getOrCreateTypeFromSignature);
|
|
101446
101465
|
const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
|
|
101447
101466
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
101448
101467
|
(context.flags & 2048 ? countWhere(resolved.properties, (p) => !(p.flags & 4194304)) : length(resolved.properties));
|
|
@@ -101660,7 +101679,7 @@ ${lanes.join("\n")}
|
|
|
101660
101679
|
const newComponents = filter4(indexInfo.components, (e2) => {
|
|
101661
101680
|
return !hasLateBindableName(e2);
|
|
101662
101681
|
});
|
|
101663
|
-
return
|
|
101682
|
+
return map32(newComponents, (e2) => {
|
|
101664
101683
|
trackComputedName(e2.name.expression, context2.enclosingDeclaration, context2);
|
|
101665
101684
|
return setTextRange2(
|
|
101666
101685
|
context2,
|
|
@@ -102469,7 +102488,7 @@ ${lanes.join("\n")}
|
|
|
102469
102488
|
const parameterDeclaration = getEffectiveParameterDeclaration(parameterSymbol);
|
|
102470
102489
|
const parameterType = getTypeOfSymbol(parameterSymbol);
|
|
102471
102490
|
const parameterTypeNode = serializeTypeForDeclaration(context, parameterDeclaration, parameterType, parameterSymbol);
|
|
102472
|
-
const modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ?
|
|
102491
|
+
const modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map32(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
|
|
102473
102492
|
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768;
|
|
102474
102493
|
const dotDotDotToken = isRest ? factory.createToken(
|
|
102475
102494
|
26
|
|
@@ -102667,7 +102686,7 @@ ${lanes.join("\n")}
|
|
|
102667
102686
|
let typeParameterNodes;
|
|
102668
102687
|
const targetSymbol = getTargetSymbol(symbol2);
|
|
102669
102688
|
if (targetSymbol.flags & (32 | 64 | 524288)) {
|
|
102670
|
-
typeParameterNodes = factory.createNodeArray(
|
|
102689
|
+
typeParameterNodes = factory.createNodeArray(map32(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol2), (tp) => typeParameterToDeclaration(tp, context)));
|
|
102671
102690
|
}
|
|
102672
102691
|
return typeParameterNodes;
|
|
102673
102692
|
}
|
|
@@ -102692,7 +102711,7 @@ ${lanes.join("\n")}
|
|
|
102692
102711
|
const params = getTypeParametersOfClassOrInterface(
|
|
102693
102712
|
parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol
|
|
102694
102713
|
);
|
|
102695
|
-
typeParameterNodes = mapToTypeNodes(
|
|
102714
|
+
typeParameterNodes = mapToTypeNodes(map32(params, (t2) => getMappedType(t2, nextSymbol.links.mapper)), context);
|
|
102696
102715
|
} else {
|
|
102697
102716
|
typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol2, context);
|
|
102698
102717
|
}
|
|
@@ -103515,7 +103534,7 @@ ${lanes.join("\n")}
|
|
|
103515
103534
|
}
|
|
103516
103535
|
function getNamesOfDeclaration(statement) {
|
|
103517
103536
|
if (isVariableStatement(statement)) {
|
|
103518
|
-
return filter4(
|
|
103537
|
+
return filter4(map32(statement.declarationList.declarations, getNameOfDeclaration), isIdentifierAndNotUndefined);
|
|
103519
103538
|
}
|
|
103520
103539
|
return filter4([getNameOfDeclaration(statement)], isIdentifierAndNotUndefined);
|
|
103521
103540
|
}
|
|
@@ -103541,7 +103560,7 @@ ${lanes.join("\n")}
|
|
|
103541
103560
|
void 0,
|
|
103542
103561
|
/*isTypeOnly*/
|
|
103543
103562
|
false,
|
|
103544
|
-
factory.createNamedExports(
|
|
103563
|
+
factory.createNamedExports(map32(flatMap(excessExports, (e2) => getNamesOfDeclaration(e2)), (id) => factory.createExportSpecifier(
|
|
103545
103564
|
/*isTypeOnly*/
|
|
103546
103565
|
false,
|
|
103547
103566
|
/*propertyName*/
|
|
@@ -103961,7 +103980,7 @@ ${lanes.join("\n")}
|
|
|
103961
103980
|
var _a22;
|
|
103962
103981
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol2);
|
|
103963
103982
|
const typeParams = getSymbolLinks(symbol2).typeParameters;
|
|
103964
|
-
const typeParamDecls =
|
|
103983
|
+
const typeParamDecls = map32(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
103965
103984
|
const jsdocAliasDecl = (_a22 = symbol2.declarations) == null ? void 0 : _a22.find(isJSDocTypeAlias);
|
|
103966
103985
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
103967
103986
|
const restoreFlags = saveRestoreFlags(context);
|
|
@@ -103992,7 +104011,7 @@ ${lanes.join("\n")}
|
|
|
103992
104011
|
context.approximateLength += 14 + internalSymbolName.length;
|
|
103993
104012
|
const interfaceType = getDeclaredTypeOfClassOrInterface(symbol2);
|
|
103994
104013
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol2);
|
|
103995
|
-
const typeParamDecls =
|
|
104014
|
+
const typeParamDecls = map32(localParams, (p) => typeParameterToDeclaration(p, context));
|
|
103996
104015
|
const baseTypes = getBaseTypes(interfaceType);
|
|
103997
104016
|
const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0;
|
|
103998
104017
|
const members = serializePropertySymbolsForClassOrInterface(
|
|
@@ -104305,7 +104324,7 @@ ${lanes.join("\n")}
|
|
|
104305
104324
|
addingDeclare = oldAddingDeclare;
|
|
104306
104325
|
const declarations = results;
|
|
104307
104326
|
results = oldResults;
|
|
104308
|
-
const defaultReplaced =
|
|
104327
|
+
const defaultReplaced = map32(declarations, (d) => isExportAssignment(d) && !d.isExportEquals && isIdentifier(d.expression) ? factory.createExportDeclaration(
|
|
104309
104328
|
/*modifiers*/
|
|
104310
104329
|
void 0,
|
|
104311
104330
|
/*isTypeOnly*/
|
|
@@ -104324,7 +104343,7 @@ ${lanes.join("\n")}
|
|
|
104324
104343
|
d,
|
|
104325
104344
|
32
|
|
104326
104345
|
/* Export */
|
|
104327
|
-
)) ?
|
|
104346
|
+
)) ? map32(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
104328
104347
|
fakespace = factory.updateModuleDeclaration(
|
|
104329
104348
|
fakespace,
|
|
104330
104349
|
fakespace.modifiers,
|
|
@@ -104372,7 +104391,7 @@ ${lanes.join("\n")}
|
|
|
104372
104391
|
}
|
|
104373
104392
|
return cleanup(factory.createExpressionWithTypeArguments(
|
|
104374
104393
|
expr,
|
|
104375
|
-
|
|
104394
|
+
map32(e2.typeArguments, (a) => syntacticNodeBuilder.tryReuseExistingTypeNode(context, a) || typeToTypeNodeHelper(getTypeFromTypeNode2(context, a), context))
|
|
104376
104395
|
));
|
|
104377
104396
|
function cleanup(result2) {
|
|
104378
104397
|
context.enclosingDeclaration = oldEnclosing;
|
|
@@ -104391,7 +104410,7 @@ ${lanes.join("\n")}
|
|
|
104391
104410
|
const oldEnclosing = context.enclosingDeclaration;
|
|
104392
104411
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
104393
104412
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol2);
|
|
104394
|
-
const typeParamDecls =
|
|
104413
|
+
const typeParamDecls = map32(localParams, (p) => typeParameterToDeclaration(p, context));
|
|
104395
104414
|
forEach(localParams, (p) => context.approximateLength += symbolName(p.symbol).length);
|
|
104396
104415
|
const classType = getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(symbol2));
|
|
104397
104416
|
const baseTypes = getBaseTypes(classType);
|
|
@@ -104402,7 +104421,7 @@ ${lanes.join("\n")}
|
|
|
104402
104421
|
const staticBaseType = isClass ? getBaseConstructorTypeOfClass(staticType) : anyType2;
|
|
104403
104422
|
context.approximateLength += (length(baseTypes) ? 8 : 0) + (length(implementsExpressions) ? 11 : 0);
|
|
104404
104423
|
const heritageClauses = [
|
|
104405
|
-
...!length(baseTypes) ? [] : [factory.createHeritageClause(96,
|
|
104424
|
+
...!length(baseTypes) ? [] : [factory.createHeritageClause(96, map32(baseTypes, (b) => serializeBaseType(b, staticBaseType, localName)))],
|
|
104406
104425
|
...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119, implementsExpressions)]
|
|
104407
104426
|
];
|
|
104408
104427
|
const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
|
|
@@ -105231,7 +105250,7 @@ ${lanes.join("\n")}
|
|
|
105231
105250
|
let typeArgs;
|
|
105232
105251
|
let reference;
|
|
105233
105252
|
if (t2.target && isSymbolAccessibleByFlags(t2.target.symbol, enclosingDeclaration, flags)) {
|
|
105234
|
-
typeArgs =
|
|
105253
|
+
typeArgs = map32(getTypeArguments(t2), (t22) => typeToTypeNodeHelper(t22, context));
|
|
105235
105254
|
reference = symbolToExpression(
|
|
105236
105255
|
t2.target.symbol,
|
|
105237
105256
|
context,
|
|
@@ -105695,7 +105714,7 @@ ${lanes.join("\n")}
|
|
|
105695
105714
|
}
|
|
105696
105715
|
function getTypeOfPrototypeProperty(prototype) {
|
|
105697
105716
|
const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
|
|
105698
|
-
return classType.typeParameters ? createTypeReference(classType,
|
|
105717
|
+
return classType.typeParameters ? createTypeReference(classType, map32(classType.typeParameters, (_2) => anyType2)) : classType;
|
|
105699
105718
|
}
|
|
105700
105719
|
function getTypeOfPropertyOfType(type, name2) {
|
|
105701
105720
|
const prop = getPropertyOfType(type, name2);
|
|
@@ -105743,7 +105762,7 @@ ${lanes.join("\n")}
|
|
|
105743
105762
|
if (source.flags & 1048576) {
|
|
105744
105763
|
return mapType2(source, (t2) => getRestType(t2, properties, symbol2));
|
|
105745
105764
|
}
|
|
105746
|
-
let omitKeyType = getUnionType(
|
|
105765
|
+
let omitKeyType = getUnionType(map32(properties, getLiteralTypeFromPropertyName));
|
|
105747
105766
|
const spreadableProperties = [];
|
|
105748
105767
|
const unspreadableToRestKeys = [];
|
|
105749
105768
|
for (const prop of getPropertiesOfType(source)) {
|
|
@@ -106469,9 +106488,9 @@ ${lanes.join("\n")}
|
|
|
106469
106488
|
if (elements.length === 0 || elements.length === 1 && restElement) {
|
|
106470
106489
|
return languageVersion >= 2 ? createIterableType(anyType2) : anyArrayType;
|
|
106471
106490
|
}
|
|
106472
|
-
const elementTypes =
|
|
106491
|
+
const elementTypes = map32(elements, (e2) => isOmittedExpression(e2) ? anyType2 : getTypeFromBindingElement(e2, includePatternInType, reportErrors2));
|
|
106473
106492
|
const minLength = findLastIndex(elements, (e2) => !(e2 === restElement || isOmittedExpression(e2) || hasDefaultValue(e2)), elements.length - 1) + 1;
|
|
106474
|
-
const elementFlags =
|
|
106493
|
+
const elementFlags = map32(
|
|
106475
106494
|
elements,
|
|
106476
106495
|
(e2, i2) => e2 === restElement ? 4 : i2 >= minLength ? 2 : 1
|
|
106477
106496
|
/* Required */
|
|
@@ -107153,7 +107172,7 @@ ${lanes.join("\n")}
|
|
|
107153
107172
|
}
|
|
107154
107173
|
function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) {
|
|
107155
107174
|
const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location);
|
|
107156
|
-
const typeArguments =
|
|
107175
|
+
const typeArguments = map32(typeArgumentNodes, getTypeFromTypeNode);
|
|
107157
107176
|
return sameMap(signatures, (sig) => some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments, isInJSFile(location)) : sig);
|
|
107158
107177
|
}
|
|
107159
107178
|
function getBaseConstructorTypeOfClass(type) {
|
|
@@ -107984,14 +108003,14 @@ ${lanes.join("\n")}
|
|
|
107984
108003
|
if (isTupleType(restType)) {
|
|
107985
108004
|
return [expandSignatureParametersWithTupleMembers(restType, restIndex, restSymbol)];
|
|
107986
108005
|
} else if (!skipUnionExpanding && restType.flags & 1048576 && every(restType.types, isTupleType)) {
|
|
107987
|
-
return
|
|
108006
|
+
return map32(restType.types, (t2) => expandSignatureParametersWithTupleMembers(t2, restIndex, restSymbol));
|
|
107988
108007
|
}
|
|
107989
108008
|
}
|
|
107990
108009
|
return [sig.parameters];
|
|
107991
108010
|
function expandSignatureParametersWithTupleMembers(restType, restIndex, restSymbol) {
|
|
107992
108011
|
const elementTypes = getTypeArguments(restType);
|
|
107993
108012
|
const associatedNames = getUniqAssociatedNamesFromTupleType(restType, restSymbol);
|
|
107994
|
-
const restParams =
|
|
108013
|
+
const restParams = map32(elementTypes, (t2, i2) => {
|
|
107995
108014
|
const name2 = associatedNames && associatedNames[i2] ? associatedNames[i2] : getParameterNameAtPosition(sig, restIndex + i2, restType);
|
|
107996
108015
|
const flags = restType.target.elementFlags[i2];
|
|
107997
108016
|
const checkFlags = flags & 12 ? 32768 : flags & 2 ? 16384 : 0;
|
|
@@ -108002,7 +108021,7 @@ ${lanes.join("\n")}
|
|
|
108002
108021
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
108003
108022
|
}
|
|
108004
108023
|
function getUniqAssociatedNamesFromTupleType(type, restSymbol) {
|
|
108005
|
-
const names =
|
|
108024
|
+
const names = map32(type.target.labeledElementDeclarations, (labeledElement, i2) => getTupleElementLabel(labeledElement, i2, type.target.elementFlags[i2], restSymbol));
|
|
108006
108025
|
if (names) {
|
|
108007
108026
|
const duplicates = [];
|
|
108008
108027
|
const uniqueNames = /* @__PURE__ */ new Set();
|
|
@@ -108173,7 +108192,7 @@ ${lanes.join("\n")}
|
|
|
108173
108192
|
if (signatures !== masterList) {
|
|
108174
108193
|
const signature = signatures[0];
|
|
108175
108194
|
Debug.assert(!!signature, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass");
|
|
108176
|
-
results = !!signature.typeParameters && some(results, (s2) => !!s2.typeParameters && !compareTypeParametersIdentical(signature.typeParameters, s2.typeParameters)) ? void 0 :
|
|
108195
|
+
results = !!signature.typeParameters && some(results, (s2) => !!s2.typeParameters && !compareTypeParametersIdentical(signature.typeParameters, s2.typeParameters)) ? void 0 : map32(results, (sig) => combineSignaturesOfUnionMembers(sig, signature));
|
|
108177
108196
|
if (!results) {
|
|
108178
108197
|
break;
|
|
108179
108198
|
}
|
|
@@ -108296,7 +108315,7 @@ ${lanes.join("\n")}
|
|
|
108296
108315
|
for (const info of sourceInfos) {
|
|
108297
108316
|
const indexType = info.keyType;
|
|
108298
108317
|
if (every(types3, (t2) => !!getIndexInfoOfType(t2, indexType))) {
|
|
108299
|
-
result.push(createIndexInfo(indexType, getUnionType(
|
|
108318
|
+
result.push(createIndexInfo(indexType, getUnionType(map32(types3, (t2) => getIndexTypeOfType(t2, indexType))), some(types3, (t2) => getIndexInfoOfType(t2, indexType).isReadonly)));
|
|
108300
108319
|
}
|
|
108301
108320
|
}
|
|
108302
108321
|
return result;
|
|
@@ -108304,12 +108323,12 @@ ${lanes.join("\n")}
|
|
|
108304
108323
|
return emptyArray;
|
|
108305
108324
|
}
|
|
108306
108325
|
function resolveUnionTypeMembers(type) {
|
|
108307
|
-
const callSignatures = getUnionSignatures(
|
|
108326
|
+
const callSignatures = getUnionSignatures(map32(type.types, (t2) => t2 === globalFunctionType ? [unknownSignature] : getSignaturesOfType(
|
|
108308
108327
|
t2,
|
|
108309
108328
|
0
|
|
108310
108329
|
/* Call */
|
|
108311
108330
|
)));
|
|
108312
|
-
const constructSignatures = getUnionSignatures(
|
|
108331
|
+
const constructSignatures = getUnionSignatures(map32(type.types, (t2) => getSignaturesOfType(
|
|
108313
108332
|
t2,
|
|
108314
108333
|
1
|
|
108315
108334
|
/* Construct */
|
|
@@ -108326,7 +108345,7 @@ ${lanes.join("\n")}
|
|
|
108326
108345
|
1
|
|
108327
108346
|
/* Construct */
|
|
108328
108347
|
).length > 0);
|
|
108329
|
-
const mixinFlags =
|
|
108348
|
+
const mixinFlags = map32(types3, isMixinConstructorType);
|
|
108330
108349
|
if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (b) => b)) {
|
|
108331
108350
|
const firstMixinIndex = mixinFlags.indexOf(
|
|
108332
108351
|
/*searchElement*/
|
|
@@ -108367,7 +108386,7 @@ ${lanes.join("\n")}
|
|
|
108367
108386
|
/* Construct */
|
|
108368
108387
|
);
|
|
108369
108388
|
if (signatures.length && mixinCount > 0) {
|
|
108370
|
-
signatures =
|
|
108389
|
+
signatures = map32(signatures, (s2) => {
|
|
108371
108390
|
const clone22 = cloneSignature(s2);
|
|
108372
108391
|
clone22.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s2), types3, mixinFlags, i2);
|
|
108373
108392
|
return clone22;
|
|
@@ -109156,7 +109175,7 @@ ${lanes.join("\n")}
|
|
|
109156
109175
|
return getBaseConstraint(getSubstitutionIntersection(t2));
|
|
109157
109176
|
}
|
|
109158
109177
|
if (isGenericTupleType(t2)) {
|
|
109159
|
-
const newElements =
|
|
109178
|
+
const newElements = map32(getElementTypes(t2), (v, i2) => {
|
|
109160
109179
|
const constraint = v.flags & 262144 && t2.target.elementFlags[i2] & 8 && getBaseConstraint(v) || v;
|
|
109161
109180
|
return constraint !== v && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
109162
109181
|
});
|
|
@@ -109592,7 +109611,7 @@ ${lanes.join("\n")}
|
|
|
109592
109611
|
}
|
|
109593
109612
|
}
|
|
109594
109613
|
}
|
|
109595
|
-
return applicableInfos ? createIndexInfo(unknownType2, getIntersectionType(
|
|
109614
|
+
return applicableInfos ? createIndexInfo(unknownType2, getIntersectionType(map32(applicableInfos, (info) => info.type)), reduceLeft(
|
|
109596
109615
|
applicableInfos,
|
|
109597
109616
|
(isReadonly, info) => isReadonly && info.isReadonly,
|
|
109598
109617
|
/*initial*/
|
|
@@ -109992,7 +110011,7 @@ ${lanes.join("\n")}
|
|
|
109992
110011
|
return errorType;
|
|
109993
110012
|
}
|
|
109994
110013
|
let type = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) : signature.compositeSignatures ? instantiateType(getUnionOrIntersectionType(
|
|
109995
|
-
|
|
110014
|
+
map32(signature.compositeSignatures, getReturnTypeOfSignature),
|
|
109996
110015
|
signature.compositeKind,
|
|
109997
110016
|
2
|
|
109998
110017
|
/* Subtype */
|
|
@@ -110131,7 +110150,7 @@ ${lanes.join("\n")}
|
|
|
110131
110150
|
function createCanonicalSignature(signature) {
|
|
110132
110151
|
return getSignatureInstantiation(
|
|
110133
110152
|
signature,
|
|
110134
|
-
|
|
110153
|
+
map32(signature.typeParameters, (tp) => tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp),
|
|
110135
110154
|
isInJSFile(signature.declaration)
|
|
110136
110155
|
);
|
|
110137
110156
|
}
|
|
@@ -110142,8 +110161,8 @@ ${lanes.join("\n")}
|
|
|
110142
110161
|
return signature.baseSignatureCache;
|
|
110143
110162
|
}
|
|
110144
110163
|
const typeEraser = createTypeEraser(typeParameters);
|
|
110145
|
-
const baseConstraintMapper = createTypeMapper(typeParameters,
|
|
110146
|
-
let baseConstraints =
|
|
110164
|
+
const baseConstraintMapper = createTypeMapper(typeParameters, map32(typeParameters, (tp) => getConstraintOfTypeParameter(tp) || unknownType2));
|
|
110165
|
+
let baseConstraints = map32(typeParameters, (tp) => instantiateType(tp, baseConstraintMapper) || unknownType2);
|
|
110147
110166
|
for (let i2 = 0; i2 < typeParameters.length - 1; i2++) {
|
|
110148
110167
|
baseConstraints = instantiateTypes(baseConstraints, baseConstraintMapper);
|
|
110149
110168
|
}
|
|
@@ -110413,7 +110432,7 @@ ${lanes.join("\n")}
|
|
|
110413
110432
|
return concatenate(type.target.outerTypeParameters, (_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
|
|
110414
110433
|
}
|
|
110415
110434
|
const node = type.node;
|
|
110416
|
-
const typeArguments = !node ? emptyArray : node.kind === 184 ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] :
|
|
110435
|
+
const typeArguments = !node ? emptyArray : node.kind === 184 ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] : map32(node.elements, getTypeFromTypeNode);
|
|
110417
110436
|
if (popTypeResolution()) {
|
|
110418
110437
|
type.resolvedTypeArguments ?? (type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments);
|
|
110419
110438
|
} else {
|
|
@@ -110819,7 +110838,7 @@ ${lanes.join("\n")}
|
|
|
110819
110838
|
return links.resolvedType;
|
|
110820
110839
|
}
|
|
110821
110840
|
function typeArgumentsFromTypeReferenceNode(node) {
|
|
110822
|
-
return
|
|
110841
|
+
return map32(node.typeArguments, getTypeFromTypeNode);
|
|
110823
110842
|
}
|
|
110824
110843
|
function getTypeFromTypeQueryNode(node) {
|
|
110825
110844
|
const links = getNodeLinks(node);
|
|
@@ -111292,8 +111311,8 @@ ${lanes.join("\n")}
|
|
|
111292
111311
|
if (elementType) {
|
|
111293
111312
|
return readonly2 ? globalReadonlyArrayType : globalArrayType;
|
|
111294
111313
|
}
|
|
111295
|
-
const elementFlags =
|
|
111296
|
-
return getTupleTargetType(elementFlags, readonly2,
|
|
111314
|
+
const elementFlags = map32(node.elements, getTupleElementFlags);
|
|
111315
|
+
return getTupleTargetType(elementFlags, readonly2, map32(node.elements, memberIfLabeledElementDeclaration));
|
|
111297
111316
|
}
|
|
111298
111317
|
function memberIfLabeledElementDeclaration(member) {
|
|
111299
111318
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
@@ -111366,7 +111385,7 @@ ${lanes.join("\n")}
|
|
|
111366
111385
|
void 0
|
|
111367
111386
|
);
|
|
111368
111387
|
} else {
|
|
111369
|
-
const elementTypes = node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] :
|
|
111388
|
+
const elementTypes = node.kind === 189 ? [getTypeFromTypeNode(node.elementType)] : map32(node.elements, getTypeFromTypeNode);
|
|
111370
111389
|
links.resolvedType = createNormalizedTypeReference(target, elementTypes);
|
|
111371
111390
|
}
|
|
111372
111391
|
}
|
|
@@ -111376,7 +111395,7 @@ ${lanes.join("\n")}
|
|
|
111376
111395
|
return isTypeOperatorNode(node) && node.operator === 148;
|
|
111377
111396
|
}
|
|
111378
111397
|
function createTupleType(elementTypes, elementFlags, readonly2 = false, namedMemberDeclarations = []) {
|
|
111379
|
-
const tupleTarget = getTupleTargetType(elementFlags ||
|
|
111398
|
+
const tupleTarget = getTupleTargetType(elementFlags || map32(
|
|
111380
111399
|
elementTypes,
|
|
111381
111400
|
(_2) => 1
|
|
111382
111401
|
/* Required */
|
|
@@ -111387,7 +111406,7 @@ ${lanes.join("\n")}
|
|
|
111387
111406
|
if (elementFlags.length === 1 && elementFlags[0] & 4) {
|
|
111388
111407
|
return readonly2 ? globalReadonlyArrayType : globalArrayType;
|
|
111389
111408
|
}
|
|
111390
|
-
const key =
|
|
111409
|
+
const key = map32(elementFlags, (f3) => f3 & 1 ? "#" : f3 & 2 ? "?" : f3 & 4 ? "." : "*").join() + (readonly2 ? "R" : "") + (some(namedMemberDeclarations, (node) => !!node) ? "," + map32(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : "");
|
|
111391
111410
|
let type = tupleTypes.get(key);
|
|
111392
111411
|
if (!type) {
|
|
111393
111412
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly2, namedMemberDeclarations));
|
|
@@ -111462,7 +111481,7 @@ ${lanes.join("\n")}
|
|
|
111462
111481
|
if (target.combinedFlags & 8) {
|
|
111463
111482
|
const unionIndex = findIndex(elementTypes, (t2, i2) => !!(target.elementFlags[i2] & 8 && t2.flags & (131072 | 1048576)));
|
|
111464
111483
|
if (unionIndex >= 0) {
|
|
111465
|
-
return checkCrossProductUnion(
|
|
111484
|
+
return checkCrossProductUnion(map32(elementTypes, (t2, i2) => target.elementFlags[i2] & 8 ? t2 : unknownType2)) ? mapType2(elementTypes[unionIndex], (t2) => createNormalizedTupleType(target, replaceElement(elementTypes, unionIndex, t2))) : errorType;
|
|
111466
111485
|
}
|
|
111467
111486
|
}
|
|
111468
111487
|
const expandedTypes = [];
|
|
@@ -111632,7 +111651,7 @@ ${lanes.join("\n")}
|
|
|
111632
111651
|
const source = types3[i2];
|
|
111633
111652
|
if (hasEmptyObject || source.flags & 469499904) {
|
|
111634
111653
|
if (source.flags & 262144 && getBaseConstraintOrType(source).flags & 1048576) {
|
|
111635
|
-
if (isTypeRelatedTo(source, getUnionType(
|
|
111654
|
+
if (isTypeRelatedTo(source, getUnionType(map32(types3, (t2) => t2 === source ? neverType2 : t2)), strictSubtypeRelation)) {
|
|
111636
111655
|
orderedRemoveItemAt(types3, i2);
|
|
111637
111656
|
}
|
|
111638
111657
|
continue;
|
|
@@ -111895,7 +111914,7 @@ ${lanes.join("\n")}
|
|
|
111895
111914
|
const links = getNodeLinks(node);
|
|
111896
111915
|
if (!links.resolvedType) {
|
|
111897
111916
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
111898
|
-
links.resolvedType = getUnionType(
|
|
111917
|
+
links.resolvedType = getUnionType(map32(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
111899
111918
|
}
|
|
111900
111919
|
return links.resolvedType;
|
|
111901
111920
|
}
|
|
@@ -112178,7 +112197,7 @@ ${lanes.join("\n")}
|
|
|
112178
112197
|
const links = getNodeLinks(node);
|
|
112179
112198
|
if (!links.resolvedType) {
|
|
112180
112199
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
112181
|
-
const types3 =
|
|
112200
|
+
const types3 = map32(node.types, getTypeFromTypeNode);
|
|
112182
112201
|
const emptyIndex = types3.length === 2 ? types3.indexOf(emptyTypeLiteralType) : -1;
|
|
112183
112202
|
const t2 = emptyIndex >= 0 ? types3[1 - emptyIndex] : unknownType2;
|
|
112184
112203
|
const noSupertypeReduction = !!(t2.flags & (4 | 8 | 64) || t2.flags & 134217728 && isPatternLiteralType(t2));
|
|
@@ -112287,8 +112306,8 @@ ${lanes.join("\n")}
|
|
|
112287
112306
|
}
|
|
112288
112307
|
function getLiteralTypeFromProperties(type, include, includeOrigin) {
|
|
112289
112308
|
const origin = includeOrigin && (getObjectFlags(type) & (3 | 4) || type.aliasSymbol) ? createOriginIndexType(type) : void 0;
|
|
112290
|
-
const propertyTypes =
|
|
112291
|
-
const indexKeyTypes =
|
|
112309
|
+
const propertyTypes = map32(getPropertiesOfType(type), (prop) => getLiteralTypeFromProperty(prop, include));
|
|
112310
|
+
const indexKeyTypes = map32(getIndexInfosOfType(type), (info) => info !== enumNumberIndexInfo && isKeyTypeIncluded(info.keyType, include) ? info.keyType === stringType2 && include & 8 ? stringOrNumberType : info.keyType : neverType2);
|
|
112292
112311
|
return getUnionType(
|
|
112293
112312
|
concatenate(propertyTypes, indexKeyTypes),
|
|
112294
112313
|
1,
|
|
@@ -112308,7 +112327,7 @@ ${lanes.join("\n")}
|
|
|
112308
112327
|
}
|
|
112309
112328
|
function getIndexType(type, indexFlags = 0) {
|
|
112310
112329
|
type = getReducedType(type);
|
|
112311
|
-
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 ? getIntersectionType(
|
|
112330
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 ? getIntersectionType(map32(type.types, (t2) => getIndexType(t2, indexFlags))) : type.flags & 2097152 ? getUnionType(map32(type.types, (t2) => getIndexType(t2, indexFlags))) : getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 ? neverType2 : type.flags & (1 | 131072) ? stringNumberSymbolType : getLiteralTypeFromProperties(
|
|
112312
112331
|
type,
|
|
112313
112332
|
(indexFlags & 2 ? 128 : 402653316) | (indexFlags & 1 ? 0 : 296 | 12288),
|
|
112314
112333
|
indexFlags === 0
|
|
@@ -112346,8 +112365,8 @@ ${lanes.join("\n")}
|
|
|
112346
112365
|
const links = getNodeLinks(node);
|
|
112347
112366
|
if (!links.resolvedType) {
|
|
112348
112367
|
links.resolvedType = getTemplateLiteralType(
|
|
112349
|
-
[node.head.text, ...
|
|
112350
|
-
|
|
112368
|
+
[node.head.text, ...map32(node.templateSpans, (span) => span.literal.text)],
|
|
112369
|
+
map32(node.templateSpans, (span) => getTypeFromTypeNode(span.type))
|
|
112351
112370
|
);
|
|
112352
112371
|
}
|
|
112353
112372
|
return links.resolvedType;
|
|
@@ -112378,7 +112397,7 @@ ${lanes.join("\n")}
|
|
|
112378
112397
|
return newTypes[0];
|
|
112379
112398
|
}
|
|
112380
112399
|
}
|
|
112381
|
-
const id = `${getTypeListId(newTypes)}|${
|
|
112400
|
+
const id = `${getTypeListId(newTypes)}|${map32(newTexts, (t2) => t2.length).join(",")}|${newTexts.join("")}`;
|
|
112382
112401
|
let type = templateLiteralTypes.get(id);
|
|
112383
112402
|
if (!type) {
|
|
112384
112403
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -112608,7 +112627,7 @@ ${lanes.join("\n")}
|
|
|
112608
112627
|
diagnostics.add(createDiagnosticForNode(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType2)));
|
|
112609
112628
|
return undefinedType2;
|
|
112610
112629
|
} else if (indexType.flags & (8 | 4)) {
|
|
112611
|
-
const types3 =
|
|
112630
|
+
const types3 = map32(objectType2.properties, (property) => {
|
|
112612
112631
|
return getTypeOfSymbol(property);
|
|
112613
112632
|
});
|
|
112614
112633
|
return getUnionType(append(types3, undefinedType2));
|
|
@@ -112769,13 +112788,13 @@ ${lanes.join("\n")}
|
|
|
112769
112788
|
}
|
|
112770
112789
|
function distributeIndexOverObjectType(objectType2, indexType, writing) {
|
|
112771
112790
|
if (objectType2.flags & 1048576 || objectType2.flags & 2097152 && !shouldDeferIndexType(objectType2)) {
|
|
112772
|
-
const types3 =
|
|
112791
|
+
const types3 = map32(objectType2.types, (t2) => getSimplifiedType(getIndexedAccessType(t2, indexType), writing));
|
|
112773
112792
|
return objectType2.flags & 2097152 || writing ? getIntersectionType(types3) : getUnionType(types3);
|
|
112774
112793
|
}
|
|
112775
112794
|
}
|
|
112776
112795
|
function distributeObjectOverIndexType(objectType2, indexType, writing) {
|
|
112777
112796
|
if (indexType.flags & 1048576) {
|
|
112778
|
-
const types3 =
|
|
112797
|
+
const types3 = map32(indexType.types, (t2) => getSimplifiedType(getIndexedAccessType(objectType2, t2), writing));
|
|
112779
112798
|
return writing ? getIntersectionType(types3) : getUnionType(types3);
|
|
112780
112799
|
}
|
|
112781
112800
|
}
|
|
@@ -113058,7 +113077,7 @@ ${lanes.join("\n")}
|
|
|
113058
113077
|
const newRoot = newType.root;
|
|
113059
113078
|
if (newRoot.outerTypeParameters) {
|
|
113060
113079
|
const typeParamMapper = combineTypeMappers(newType.mapper, newMapper);
|
|
113061
|
-
const typeArguments =
|
|
113080
|
+
const typeArguments = map32(newRoot.outerTypeParameters, (t2) => getMappedType(t2, typeParamMapper));
|
|
113062
113081
|
const newRootMapper = createTypeMapper(newRoot.outerTypeParameters, typeArguments);
|
|
113063
113082
|
const newCheckType = newRoot.isDistributive ? getMappedType(newRoot.checkType, newRootMapper) : void 0;
|
|
113064
113083
|
if (!newCheckType || newCheckType === newRoot.checkType || !(newCheckType.flags & (1048576 | 131072))) {
|
|
@@ -113719,7 +113738,7 @@ ${lanes.join("\n")}
|
|
|
113719
113738
|
}
|
|
113720
113739
|
function createBackreferenceMapper(context, index) {
|
|
113721
113740
|
const forwardInferences = context.inferences.slice(index);
|
|
113722
|
-
return createTypeMapper(
|
|
113741
|
+
return createTypeMapper(map32(forwardInferences, (i2) => i2.typeParameter), map32(forwardInferences, () => unknownType2));
|
|
113723
113742
|
}
|
|
113724
113743
|
function createOuterReturnMapper(context) {
|
|
113725
113744
|
return context.outerReturnMapper ?? (context.outerReturnMapper = mergeTypeMappers(context.returnMapper, cloneInferenceContext(context).mapper));
|
|
@@ -113750,7 +113769,7 @@ ${lanes.join("\n")}
|
|
|
113750
113769
|
function instantiateSignature(signature, mapper, eraseTypeParameters) {
|
|
113751
113770
|
let freshTypeParameters;
|
|
113752
113771
|
if (signature.typeParameters && !eraseTypeParameters) {
|
|
113753
|
-
freshTypeParameters =
|
|
113772
|
+
freshTypeParameters = map32(signature.typeParameters, cloneTypeParameter);
|
|
113754
113773
|
mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper);
|
|
113755
113774
|
for (const tp of freshTypeParameters) {
|
|
113756
113775
|
tp.mapper = mapper;
|
|
@@ -113822,7 +113841,7 @@ ${lanes.join("\n")}
|
|
|
113822
113841
|
}
|
|
113823
113842
|
if (typeParameters.length) {
|
|
113824
113843
|
const combinedMapper = combineTypeMappers(type.mapper, mapper);
|
|
113825
|
-
const typeArguments =
|
|
113844
|
+
const typeArguments = map32(typeParameters, (t2) => getMappedType(t2, combinedMapper));
|
|
113826
113845
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
113827
113846
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
113828
113847
|
const id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments);
|
|
@@ -113934,7 +113953,7 @@ ${lanes.join("\n")}
|
|
|
113934
113953
|
return instantiateMappedTupleType(t2, type, typeVariable, mapper);
|
|
113935
113954
|
}
|
|
113936
113955
|
if (isArrayOrTupleOrIntersection(t2)) {
|
|
113937
|
-
return getIntersectionType(
|
|
113956
|
+
return getIntersectionType(map32(t2.types, instantiateConstituent));
|
|
113938
113957
|
}
|
|
113939
113958
|
}
|
|
113940
113959
|
return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t2, mapper));
|
|
@@ -113949,12 +113968,12 @@ ${lanes.join("\n")}
|
|
|
113949
113968
|
const elementFlags = tupleType2.target.elementFlags;
|
|
113950
113969
|
const fixedLength = tupleType2.target.fixedLength;
|
|
113951
113970
|
const fixedMapper = fixedLength ? prependTypeMapping(typeVariable, tupleType2, mapper) : mapper;
|
|
113952
|
-
const newElementTypes =
|
|
113971
|
+
const newElementTypes = map32(getElementTypes(tupleType2), (type, i2) => {
|
|
113953
113972
|
const flags = elementFlags[i2];
|
|
113954
113973
|
return i2 < fixedLength ? instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i2), !!(flags & 2), fixedMapper) : flags & 8 ? instantiateType(mappedType, prependTypeMapping(typeVariable, type, mapper)) : getElementTypeOfArrayType(instantiateType(mappedType, prependTypeMapping(typeVariable, createArrayType(type), mapper))) ?? unknownType2;
|
|
113955
113974
|
});
|
|
113956
113975
|
const modifiers = getMappedTypeModifiers(mappedType);
|
|
113957
|
-
const newElementFlags = modifiers & 4 ?
|
|
113976
|
+
const newElementFlags = modifiers & 4 ? map32(elementFlags, (f3) => f3 & 1 ? 2 : f3) : modifiers & 8 ? map32(elementFlags, (f3) => f3 & 2 ? 1 : f3) : elementFlags;
|
|
113958
113977
|
const newReadonly = getModifiedReadonlyState(tupleType2.target.readonly, getMappedTypeModifiers(mappedType));
|
|
113959
113978
|
return contains(newElementTypes, errorType) ? errorType : createTupleType(newElementTypes, newElementFlags, newReadonly, tupleType2.target.labeledElementDeclarations);
|
|
113960
113979
|
}
|
|
@@ -114010,7 +114029,7 @@ ${lanes.join("\n")}
|
|
|
114010
114029
|
function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
114011
114030
|
const root = type.root;
|
|
114012
114031
|
if (root.outerTypeParameters) {
|
|
114013
|
-
const typeArguments =
|
|
114032
|
+
const typeArguments = map32(root.outerTypeParameters, (t2) => getMappedType(t2, mapper));
|
|
114014
114033
|
const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
114015
114034
|
let result = root.instantiations.get(id);
|
|
114016
114035
|
if (!result) {
|
|
@@ -114242,7 +114261,7 @@ ${lanes.join("\n")}
|
|
|
114242
114261
|
return result;
|
|
114243
114262
|
}
|
|
114244
114263
|
} else if (type.flags & 2097152) {
|
|
114245
|
-
return getIntersectionType(
|
|
114264
|
+
return getIntersectionType(map32(type.types, getTypeWithoutSignatures));
|
|
114246
114265
|
}
|
|
114247
114266
|
return type;
|
|
114248
114267
|
}
|
|
@@ -114398,7 +114417,7 @@ ${lanes.join("\n")}
|
|
|
114398
114417
|
}
|
|
114399
114418
|
const returnExpression = node.body;
|
|
114400
114419
|
const sourceReturn = getReturnTypeOfSignature(sourceSig);
|
|
114401
|
-
const targetReturn = getUnionType(
|
|
114420
|
+
const targetReturn = getUnionType(map32(targetSignatures, getReturnTypeOfSignature));
|
|
114402
114421
|
if (!checkTypeRelatedTo(
|
|
114403
114422
|
sourceReturn,
|
|
114404
114423
|
targetReturn,
|
|
@@ -117237,9 +117256,9 @@ ${lanes.join("\n")}
|
|
|
117237
117256
|
false
|
|
117238
117257
|
)) {
|
|
117239
117258
|
if (props.length > 5) {
|
|
117240
|
-
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2),
|
|
117259
|
+
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2), map32(props.slice(0, 4), (p) => symbolToString(p)).join(", "), props.length - 4);
|
|
117241
117260
|
} else {
|
|
117242
|
-
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2),
|
|
117261
|
+
reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2), map32(props, (p) => symbolToString(p)).join(", "));
|
|
117243
117262
|
}
|
|
117244
117263
|
if (shouldSkipElaboration && errorInfo) {
|
|
117245
117264
|
overrideNextErrorInfo++;
|
|
@@ -118816,7 +118835,7 @@ ${lanes.join("\n")}
|
|
|
118816
118835
|
return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable);
|
|
118817
118836
|
}
|
|
118818
118837
|
function cloneInferenceContext(context, extraFlags = 0) {
|
|
118819
|
-
return context && createInferenceContextWorker(
|
|
118838
|
+
return context && createInferenceContextWorker(map32(context.inferences, cloneInferenceInfo), context.signature, context.flags | extraFlags, context.compareTypes);
|
|
118820
118839
|
}
|
|
118821
118840
|
function createInferenceContextWorker(inferences, signature, flags, compareTypes) {
|
|
118822
118841
|
const context = {
|
|
@@ -118834,8 +118853,8 @@ ${lanes.join("\n")}
|
|
|
118834
118853
|
}
|
|
118835
118854
|
function makeFixingMapperForContext(context) {
|
|
118836
118855
|
return makeDeferredTypeMapper(
|
|
118837
|
-
|
|
118838
|
-
|
|
118856
|
+
map32(context.inferences, (i2) => i2.typeParameter),
|
|
118857
|
+
map32(context.inferences, (inference, i2) => () => {
|
|
118839
118858
|
if (!inference.isFixed) {
|
|
118840
118859
|
inferFromIntraExpressionSites(context);
|
|
118841
118860
|
clearCachedInferences(context.inferences);
|
|
@@ -118847,8 +118866,8 @@ ${lanes.join("\n")}
|
|
|
118847
118866
|
}
|
|
118848
118867
|
function makeNonFixingMapperForContext(context) {
|
|
118849
118868
|
return makeDeferredTypeMapper(
|
|
118850
|
-
|
|
118851
|
-
|
|
118869
|
+
map32(context.inferences, (i2) => i2.typeParameter),
|
|
118870
|
+
map32(context.inferences, (_2, i2) => () => {
|
|
118852
118871
|
return getInferredType(context, i2);
|
|
118853
118872
|
})
|
|
118854
118873
|
);
|
|
@@ -118908,7 +118927,7 @@ ${lanes.join("\n")}
|
|
|
118908
118927
|
}
|
|
118909
118928
|
function cloneInferredPartOfContext(context) {
|
|
118910
118929
|
const inferences = filter4(context.inferences, hasInferenceCandidates);
|
|
118911
|
-
return inferences.length ? createInferenceContextWorker(
|
|
118930
|
+
return inferences.length ? createInferenceContextWorker(map32(inferences, cloneInferenceInfo), context.signature, context.flags, context.compareTypes) : void 0;
|
|
118912
118931
|
}
|
|
118913
118932
|
function getMapperFromContext(context) {
|
|
118914
118933
|
return context && context.mapper;
|
|
@@ -118996,7 +119015,7 @@ ${lanes.join("\n")}
|
|
|
118996
119015
|
return createArrayType(elementType, isReadonlyArrayType(source));
|
|
118997
119016
|
}
|
|
118998
119017
|
if (isTupleType(source)) {
|
|
118999
|
-
const elementTypes =
|
|
119018
|
+
const elementTypes = map32(getElementTypes(source), (t2) => inferReverseMappedType(t2, target, constraint));
|
|
119000
119019
|
if (!every(elementTypes, (t2) => !!t2)) {
|
|
119001
119020
|
return void 0;
|
|
119002
119021
|
}
|
|
@@ -119166,7 +119185,7 @@ ${lanes.join("\n")}
|
|
|
119166
119185
|
return false;
|
|
119167
119186
|
}
|
|
119168
119187
|
function inferTypesFromTemplateLiteralType(source, target) {
|
|
119169
|
-
return source.flags & 128 ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 ? arrayIsEqualTo(source.texts, target.texts) ?
|
|
119188
|
+
return source.flags & 128 ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 ? arrayIsEqualTo(source.texts, target.texts) ? map32(source.types, (s2, i2) => {
|
|
119170
119189
|
return isTypeAssignableTo(getBaseConstraintOrType(s2), getBaseConstraintOrType(target.types[i2])) ? s2 : getStringLikeTypeForType(s2);
|
|
119171
119190
|
}) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0;
|
|
119172
119191
|
}
|
|
@@ -119630,8 +119649,8 @@ ${lanes.join("\n")}
|
|
|
119630
119649
|
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
|
|
119631
119650
|
return true;
|
|
119632
119651
|
}
|
|
119633
|
-
const propTypes =
|
|
119634
|
-
const indexTypes =
|
|
119652
|
+
const propTypes = map32(getPropertiesOfType(source), getTypeOfSymbol);
|
|
119653
|
+
const indexTypes = map32(getIndexInfosOfType(source), (info) => info !== enumNumberIndexInfo ? info.type : neverType2);
|
|
119635
119654
|
inferFromTypes(getUnionType(concatenate(propTypes, indexTypes)), getTemplateTypeFromMappedType(target));
|
|
119636
119655
|
return true;
|
|
119637
119656
|
}
|
|
@@ -120718,7 +120737,7 @@ ${lanes.join("\n")}
|
|
|
120718
120737
|
) : type;
|
|
120719
120738
|
}
|
|
120720
120739
|
function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
120721
|
-
return type.flags & 1048576 && aliasSymbol ? getUnionType(
|
|
120740
|
+
return type.flags & 1048576 && aliasSymbol ? getUnionType(map32(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) : mapType2(type, mapper);
|
|
120722
120741
|
}
|
|
120723
120742
|
function extractTypesOfKind(type, kind) {
|
|
120724
120743
|
return filterType(type, (t2) => (t2.flags & kind) !== 0);
|
|
@@ -121486,7 +121505,7 @@ ${lanes.join("\n")}
|
|
|
121486
121505
|
}
|
|
121487
121506
|
function getUnionOrEvolvingArrayType(types3, subtypeReduction) {
|
|
121488
121507
|
if (isEvolvingArrayTypeList(types3)) {
|
|
121489
|
-
return getEvolvingArrayType(getUnionType(
|
|
121508
|
+
return getEvolvingArrayType(getUnionType(map32(types3, getElementTypeOfEvolvingArrayType)));
|
|
121490
121509
|
}
|
|
121491
121510
|
const result = recombineUnknownType(getUnionType(sameMap(types3, finalizeEvolvingArrayType), subtypeReduction));
|
|
121492
121511
|
if (result !== declaredType && result.flags & declaredType.flags & 1048576 && arrayIsEqualTo(result.types, declaredType.types)) {
|
|
@@ -121580,7 +121599,7 @@ ${lanes.join("\n")}
|
|
|
121580
121599
|
function narrowTypeBySwitchOnDiscriminantProperty(type, access, data) {
|
|
121581
121600
|
if (data.clauseStart < data.clauseEnd && type.flags & 1048576 && getKeyPropertyName(type) === getAccessedPropertyName(access)) {
|
|
121582
121601
|
const clauseTypes = getSwitchClauseTypes(data.switchStatement).slice(data.clauseStart, data.clauseEnd);
|
|
121583
|
-
const candidate = getUnionType(
|
|
121602
|
+
const candidate = getUnionType(map32(clauseTypes, (t2) => getConstituentTypeForKeyType(type, t2) || unknownType2));
|
|
121584
121603
|
if (candidate !== unknownType2) {
|
|
121585
121604
|
return candidate;
|
|
121586
121605
|
}
|
|
@@ -122008,7 +122027,7 @@ ${lanes.join("\n")}
|
|
|
122008
122027
|
return filterType(type, (t2) => getTypeFacts(t2, notEqualFacts) === notEqualFacts);
|
|
122009
122028
|
}
|
|
122010
122029
|
const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
|
|
122011
|
-
return getUnionType(
|
|
122030
|
+
return getUnionType(map32(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType2));
|
|
122012
122031
|
}
|
|
122013
122032
|
function narrowTypeBySwitchOnTrue(type, { switchStatement, clauseStart, clauseEnd }) {
|
|
122014
122033
|
const defaultIndex = findIndex(
|
|
@@ -122043,7 +122062,7 @@ ${lanes.join("\n")}
|
|
|
122043
122062
|
return type;
|
|
122044
122063
|
}
|
|
122045
122064
|
const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
|
|
122046
|
-
return getUnionType(
|
|
122065
|
+
return getUnionType(map32(clauses, (clause) => clause.kind === 297 ? narrowType(
|
|
122047
122066
|
type,
|
|
122048
122067
|
clause.expression,
|
|
122049
122068
|
/*assumeTrue*/
|
|
@@ -122135,7 +122154,7 @@ ${lanes.join("\n")}
|
|
|
122135
122154
|
/* Construct */
|
|
122136
122155
|
);
|
|
122137
122156
|
if (constructSignatures.length) {
|
|
122138
|
-
return getUnionType(
|
|
122157
|
+
return getUnionType(map32(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature))));
|
|
122139
122158
|
}
|
|
122140
122159
|
return emptyObjectType;
|
|
122141
122160
|
}
|
|
@@ -124305,7 +124324,7 @@ ${lanes.join("\n")}
|
|
|
124305
124324
|
getMatchingUnionConstituentForObjectLiteral(contextualType, node) ?? discriminateTypeByDiscriminableItems(
|
|
124306
124325
|
contextualType,
|
|
124307
124326
|
concatenate(
|
|
124308
|
-
|
|
124327
|
+
map32(
|
|
124309
124328
|
filter4(node.properties, (p) => {
|
|
124310
124329
|
if (!p.symbol) {
|
|
124311
124330
|
return false;
|
|
@@ -124320,7 +124339,7 @@ ${lanes.join("\n")}
|
|
|
124320
124339
|
}),
|
|
124321
124340
|
(prop) => [() => getContextFreeTypeOfExpression(prop.kind === 304 ? prop.initializer : prop.name), prop.symbol.escapedName]
|
|
124322
124341
|
),
|
|
124323
|
-
|
|
124342
|
+
map32(
|
|
124324
124343
|
filter4(getPropertiesOfType(contextualType), (s2) => {
|
|
124325
124344
|
var _a2;
|
|
124326
124345
|
return !!(s2.flags & 16777216) && !!((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members) && !node.symbol.members.has(s2.escapedName) && isDiscriminantProperty(contextualType, s2.escapedName);
|
|
@@ -124342,11 +124361,11 @@ ${lanes.join("\n")}
|
|
|
124342
124361
|
discriminateTypeByDiscriminableItems(
|
|
124343
124362
|
contextualType,
|
|
124344
124363
|
concatenate(
|
|
124345
|
-
|
|
124364
|
+
map32(
|
|
124346
124365
|
filter4(node.properties, (p) => !!p.symbol && p.kind === 292 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
|
|
124347
124366
|
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
|
|
124348
124367
|
),
|
|
124349
|
-
|
|
124368
|
+
map32(
|
|
124350
124369
|
filter4(getPropertiesOfType(contextualType), (s2) => {
|
|
124351
124370
|
var _a2;
|
|
124352
124371
|
if (!(s2.flags & 16777216) || !((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members)) {
|
|
@@ -124405,13 +124424,13 @@ ${lanes.join("\n")}
|
|
|
124405
124424
|
}
|
|
124406
124425
|
if (type.flags & 1048576) {
|
|
124407
124426
|
return getUnionType(
|
|
124408
|
-
|
|
124427
|
+
map32(type.types, (t2) => instantiateInstantiableTypes(t2, mapper)),
|
|
124409
124428
|
0
|
|
124410
124429
|
/* None */
|
|
124411
124430
|
);
|
|
124412
124431
|
}
|
|
124413
124432
|
if (type.flags & 2097152) {
|
|
124414
|
-
return getIntersectionType(
|
|
124433
|
+
return getIntersectionType(map32(type.types, (t2) => instantiateInstantiableTypes(t2, mapper)));
|
|
124415
124434
|
}
|
|
124416
124435
|
return type;
|
|
124417
124436
|
}
|
|
@@ -125741,7 +125760,7 @@ ${lanes.join("\n")}
|
|
|
125741
125760
|
);
|
|
125742
125761
|
}
|
|
125743
125762
|
if (signatures.length === 0 && apparentElemType.flags & 1048576) {
|
|
125744
|
-
signatures = getUnionSignatures(
|
|
125763
|
+
signatures = getUnionSignatures(map32(apparentElemType.types, (t2) => getUninstantiatedJsxSignaturesOfType(t2, caller)));
|
|
125745
125764
|
}
|
|
125746
125765
|
return signatures;
|
|
125747
125766
|
}
|
|
@@ -127215,7 +127234,7 @@ ${lanes.join("\n")}
|
|
|
127215
127234
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
127216
127235
|
const isJavascript = isInJSFile(signature.declaration);
|
|
127217
127236
|
const typeParameters = signature.typeParameters;
|
|
127218
|
-
const typeArgumentTypes = fillMissingTypeArguments(
|
|
127237
|
+
const typeArgumentTypes = fillMissingTypeArguments(map32(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript);
|
|
127219
127238
|
let mapper;
|
|
127220
127239
|
for (let i2 = 0; i2 < typeArgumentNodes.length; i2++) {
|
|
127221
127240
|
Debug.assert(typeParameters[i2] !== void 0, "Should not call checkTypeArguments with too many type arguments");
|
|
@@ -127896,7 +127915,7 @@ ${lanes.join("\n")}
|
|
|
127896
127915
|
const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics);
|
|
127897
127916
|
Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
127898
127917
|
let chain = chainDiagnosticMessages(
|
|
127899
|
-
|
|
127918
|
+
map32(diags, createDiagnosticMessageChainFromDiagnostic),
|
|
127900
127919
|
Diagnostics.No_overload_matches_this_call
|
|
127901
127920
|
);
|
|
127902
127921
|
if (headMessage) {
|
|
@@ -132464,7 +132483,7 @@ ${lanes.join("\n")}
|
|
|
132464
132483
|
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, hasInferenceCandidates)) {
|
|
132465
132484
|
const uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);
|
|
132466
132485
|
const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);
|
|
132467
|
-
const inferences =
|
|
132486
|
+
const inferences = map32(context.inferences, (info) => createInferenceInfo(info.typeParameter));
|
|
132468
132487
|
applyToParameterTypes(instantiatedSignature, contextualSignature, (source, target) => {
|
|
132469
132488
|
inferTypes(
|
|
132470
132489
|
inferences,
|
|
@@ -133412,7 +133431,7 @@ ${lanes.join("\n")}
|
|
|
133412
133431
|
return getEffectiveTypeArguments2(node, typeParameters)[index];
|
|
133413
133432
|
}
|
|
133414
133433
|
function getEffectiveTypeArguments2(node, typeParameters) {
|
|
133415
|
-
return fillMissingTypeArguments(
|
|
133434
|
+
return fillMissingTypeArguments(map32(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(node));
|
|
133416
133435
|
}
|
|
133417
133436
|
function checkTypeArgumentConstraints(node, typeParameters) {
|
|
133418
133437
|
let typeArguments;
|
|
@@ -134058,7 +134077,7 @@ ${lanes.join("\n")}
|
|
|
134058
134077
|
return void 0;
|
|
134059
134078
|
}
|
|
134060
134079
|
const onfulfilledParameterType = getTypeWithFacts(
|
|
134061
|
-
getUnionType(
|
|
134080
|
+
getUnionType(map32(candidates, getTypeOfFirstParameterOfSignature)),
|
|
134062
134081
|
2097152
|
|
134063
134082
|
/* NEUndefinedOrNull */
|
|
134064
134083
|
);
|
|
@@ -134077,7 +134096,7 @@ ${lanes.join("\n")}
|
|
|
134077
134096
|
return void 0;
|
|
134078
134097
|
}
|
|
134079
134098
|
return typeAsPromise.promisedTypeOfPromise = getUnionType(
|
|
134080
|
-
|
|
134099
|
+
map32(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature),
|
|
134081
134100
|
2
|
|
134082
134101
|
/* Subtype */
|
|
134083
134102
|
);
|
|
@@ -136076,7 +136095,7 @@ ${lanes.join("\n")}
|
|
|
136076
136095
|
}
|
|
136077
136096
|
return noCache ? noIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);
|
|
136078
136097
|
}
|
|
136079
|
-
const iteratorType = getIntersectionType(
|
|
136098
|
+
const iteratorType = getIntersectionType(map32(validSignatures, getReturnTypeOfSignature));
|
|
136080
136099
|
const iterationTypes = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache) ?? noIterationTypes;
|
|
136081
136100
|
return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);
|
|
136082
136101
|
}
|
|
@@ -137295,7 +137314,7 @@ ${lanes.join("\n")}
|
|
|
137295
137314
|
error210(errorNode, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, memberInfo.typeName, first2(memberInfo.missedProperties), memberInfo.baseTypeName);
|
|
137296
137315
|
}
|
|
137297
137316
|
} else if (length(memberInfo.missedProperties) > 5) {
|
|
137298
|
-
const missedProperties =
|
|
137317
|
+
const missedProperties = map32(memberInfo.missedProperties.slice(0, 4), (prop) => `'${prop}'`).join(", ");
|
|
137299
137318
|
const remainingMissedProperties = length(memberInfo.missedProperties) - 4;
|
|
137300
137319
|
if (isClassExpression(errorNode)) {
|
|
137301
137320
|
error210(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more, memberInfo.baseTypeName, missedProperties, remainingMissedProperties);
|
|
@@ -137303,7 +137322,7 @@ ${lanes.join("\n")}
|
|
|
137303
137322
|
error210(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more, memberInfo.typeName, memberInfo.baseTypeName, missedProperties, remainingMissedProperties);
|
|
137304
137323
|
}
|
|
137305
137324
|
} else {
|
|
137306
|
-
const missedProperties =
|
|
137325
|
+
const missedProperties = map32(memberInfo.missedProperties, (prop) => `'${prop}'`).join(", ");
|
|
137307
137326
|
if (isClassExpression(errorNode)) {
|
|
137308
137327
|
error210(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1, memberInfo.baseTypeName, missedProperties);
|
|
137309
137328
|
} else {
|
|
@@ -139418,7 +139437,7 @@ ${lanes.join("\n")}
|
|
|
139418
139437
|
} else if (symbol2) {
|
|
139419
139438
|
const symbolLinks2 = getSymbolLinks(symbol2);
|
|
139420
139439
|
const declarationList = mapDefined(infos, (i2) => i2.declaration);
|
|
139421
|
-
const nodeListId =
|
|
139440
|
+
const nodeListId = map32(declarationList, getNodeId).join(",");
|
|
139422
139441
|
if (!symbolLinks2.filteredIndexSymbolCache) {
|
|
139423
139442
|
symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
|
|
139424
139443
|
}
|
|
@@ -140674,7 +140693,7 @@ ${lanes.join("\n")}
|
|
|
140674
140693
|
const newComponents = filter4(info.components, (e2) => {
|
|
140675
140694
|
return !hasLateBindableName(e2);
|
|
140676
140695
|
});
|
|
140677
|
-
result.push(...
|
|
140696
|
+
result.push(...map32(newComponents, (e2) => {
|
|
140678
140697
|
trackComputedName(e2.name.expression);
|
|
140679
140698
|
const mods = infoList === staticInfos ? [factory.createModifier(
|
|
140680
140699
|
126
|
|
@@ -142637,7 +142656,7 @@ ${lanes.join("\n")}
|
|
|
142637
142656
|
if (sourceProperties) {
|
|
142638
142657
|
const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);
|
|
142639
142658
|
if (sourcePropertiesFiltered) {
|
|
142640
|
-
const discriminated = discriminateTypeByDiscriminableItems(target,
|
|
142659
|
+
const discriminated = discriminateTypeByDiscriminableItems(target, map32(sourcePropertiesFiltered, (p) => [() => getTypeOfSymbol(p), p.escapedName]), isRelatedTo);
|
|
142641
142660
|
if (discriminated !== target) {
|
|
142642
142661
|
return discriminated;
|
|
142643
142662
|
}
|
|
@@ -145125,7 +145144,7 @@ ${lanes.join("\n")}
|
|
|
145125
145144
|
return node.kind === 308 ? transformSourceFile(node) : transformBundle(node);
|
|
145126
145145
|
}
|
|
145127
145146
|
function transformBundle(node) {
|
|
145128
|
-
return context.factory.createBundle(
|
|
145147
|
+
return context.factory.createBundle(map32(node.sourceFiles, transformSourceFile));
|
|
145129
145148
|
}
|
|
145130
145149
|
}
|
|
145131
145150
|
function getExportNeedsImportStarHelper(node) {
|
|
@@ -146074,7 +146093,7 @@ ${lanes.join("\n")}
|
|
|
146074
146093
|
}
|
|
146075
146094
|
function makeArrayAssignmentPattern(factory2, elements) {
|
|
146076
146095
|
Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement);
|
|
146077
|
-
return factory2.createArrayLiteralExpression(
|
|
146096
|
+
return factory2.createArrayLiteralExpression(map32(elements, factory2.converters.convertToArrayAssignmentElement));
|
|
146078
146097
|
}
|
|
146079
146098
|
function makeObjectBindingPattern(factory2, elements) {
|
|
146080
146099
|
Debug.assertEachNode(elements, isBindingElement);
|
|
@@ -146082,7 +146101,7 @@ ${lanes.join("\n")}
|
|
|
146082
146101
|
}
|
|
146083
146102
|
function makeObjectAssignmentPattern(factory2, elements) {
|
|
146084
146103
|
Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement);
|
|
146085
|
-
return factory2.createObjectLiteralExpression(
|
|
146104
|
+
return factory2.createObjectLiteralExpression(map32(elements, factory2.converters.convertToObjectAssignmentElement));
|
|
146086
146105
|
}
|
|
146087
146106
|
function makeBindingElement(factory2, name2) {
|
|
146088
146107
|
return factory2.createBindingElement(
|
|
@@ -147528,7 +147547,7 @@ ${lanes.join("\n")}
|
|
|
147528
147547
|
return setTextRange(
|
|
147529
147548
|
factory2.createExpressionStatement(
|
|
147530
147549
|
factory2.inlineExpressions(
|
|
147531
|
-
|
|
147550
|
+
map32(variables, transformInitializedVariable)
|
|
147532
147551
|
)
|
|
147533
147552
|
),
|
|
147534
147553
|
node
|
|
@@ -147734,7 +147753,7 @@ ${lanes.join("\n")}
|
|
|
147734
147753
|
currentNamespaceContainerName = localName;
|
|
147735
147754
|
const statements = [];
|
|
147736
147755
|
startLexicalEnvironment();
|
|
147737
|
-
const members =
|
|
147756
|
+
const members = map32(node.members, transformEnumMember);
|
|
147738
147757
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
147739
147758
|
addRange(statements, members);
|
|
147740
147759
|
currentNamespaceContainerName = savedCurrentNamespaceLocalName;
|
|
@@ -149645,7 +149664,7 @@ ${lanes.join("\n")}
|
|
|
149645
149664
|
if (isDecoratedClassDeclaration) {
|
|
149646
149665
|
Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
|
|
149647
149666
|
if (some(pendingExpressions)) {
|
|
149648
|
-
addRange(pendingStatements,
|
|
149667
|
+
addRange(pendingStatements, map32(pendingExpressions, factory2.createExpressionStatement));
|
|
149649
149668
|
}
|
|
149650
149669
|
if (some(staticPropertiesOrClassStaticBlocks)) {
|
|
149651
149670
|
addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, ((_b = node.emitNode) == null ? void 0 : _b.classThis) ?? factory2.getInternalName(node));
|
|
@@ -151434,13 +151453,13 @@ ${lanes.join("\n")}
|
|
|
151434
151453
|
}
|
|
151435
151454
|
const { false: decorators, true: metadata } = groupBy(allDecorators.decorators, isSyntheticMetadataDecorator);
|
|
151436
151455
|
const decoratorExpressions = [];
|
|
151437
|
-
addRange(decoratorExpressions,
|
|
151456
|
+
addRange(decoratorExpressions, map32(decorators, transformDecorator));
|
|
151438
151457
|
addRange(decoratorExpressions, flatMap(allDecorators.parameters, transformDecoratorsOfParameter));
|
|
151439
|
-
addRange(decoratorExpressions,
|
|
151458
|
+
addRange(decoratorExpressions, map32(metadata, transformDecorator));
|
|
151440
151459
|
return decoratorExpressions;
|
|
151441
151460
|
}
|
|
151442
151461
|
function addClassElementDecorationStatements(statements, node, isStatic2) {
|
|
151443
|
-
addRange(statements,
|
|
151462
|
+
addRange(statements, map32(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr)));
|
|
151444
151463
|
}
|
|
151445
151464
|
function isDecoratedClassElement(member, isStaticElement, parent2) {
|
|
151446
151465
|
return nodeOrChildIsDecorated(
|
|
@@ -153345,7 +153364,7 @@ ${lanes.join("\n")}
|
|
|
153345
153364
|
return void 0;
|
|
153346
153365
|
}
|
|
153347
153366
|
const decoratorExpressions = [];
|
|
153348
|
-
addRange(decoratorExpressions,
|
|
153367
|
+
addRange(decoratorExpressions, map32(allDecorators.decorators, transformDecorator));
|
|
153349
153368
|
return decoratorExpressions;
|
|
153350
153369
|
}
|
|
153351
153370
|
function transformDecorator(decorator) {
|
|
@@ -154018,7 +154037,7 @@ ${lanes.join("\n")}
|
|
|
154018
154037
|
}
|
|
154019
154038
|
return void 0;
|
|
154020
154039
|
}
|
|
154021
|
-
return factory2.inlineExpressions(
|
|
154040
|
+
return factory2.inlineExpressions(map32(variables, transformInitializedVariable));
|
|
154022
154041
|
}
|
|
154023
154042
|
function hoistVariableDeclarationList(node) {
|
|
154024
154043
|
forEach(node.declarations, hoistVariable);
|
|
@@ -157434,7 +157453,7 @@ ${lanes.join("\n")}
|
|
|
157434
157453
|
return target && target >= 5 ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children);
|
|
157435
157454
|
}
|
|
157436
157455
|
function transformJsxAttributesToProps(attrs, children) {
|
|
157437
|
-
const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(
|
|
157456
|
+
const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map32(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr)))));
|
|
157438
157457
|
if (children) {
|
|
157439
157458
|
props.push(children);
|
|
157440
157459
|
}
|
|
@@ -160723,7 +160742,7 @@ ${lanes.join("\n")}
|
|
|
160723
160742
|
/* NoHoisting */
|
|
160724
160743
|
)
|
|
160725
160744
|
);
|
|
160726
|
-
const part = factory2.createVariableDeclarationList(
|
|
160745
|
+
const part = factory2.createVariableDeclarationList(map32(currentState.loopOutParameters, createOutVariable));
|
|
160727
160746
|
return { functionName, containsYield, functionDeclaration, part };
|
|
160728
160747
|
}
|
|
160729
160748
|
function createFunctionForBodyOfIterationStatement(node, currentState, outerState) {
|
|
@@ -160851,7 +160870,7 @@ ${lanes.join("\n")}
|
|
|
160851
160870
|
loopFunctionExpressionName,
|
|
160852
160871
|
/*typeArguments*/
|
|
160853
160872
|
void 0,
|
|
160854
|
-
|
|
160873
|
+
map32(state.loopParameters, (p) => p.name)
|
|
160855
160874
|
);
|
|
160856
160875
|
const callResult = containsYield ? factory2.createYieldExpression(
|
|
160857
160876
|
factory2.createToken(
|
|
@@ -161429,7 +161448,7 @@ ${lanes.join("\n")}
|
|
|
161429
161448
|
return isSpreadElement(node) ? visitSpanOfSpreads : visitSpanOfNonSpreads;
|
|
161430
161449
|
}
|
|
161431
161450
|
function visitSpanOfSpreads(chunk) {
|
|
161432
|
-
return
|
|
161451
|
+
return map32(chunk, visitExpressionOfSpread);
|
|
161433
161452
|
}
|
|
161434
161453
|
function visitExpressionOfSpread(node) {
|
|
161435
161454
|
Debug.assertNode(node, isSpreadElement);
|
|
@@ -162001,7 +162020,7 @@ ${lanes.join("\n")}
|
|
|
162001
162020
|
return setSourceMapRange(
|
|
162002
162021
|
factory2.createExpressionStatement(
|
|
162003
162022
|
factory2.inlineExpressions(
|
|
162004
|
-
|
|
162023
|
+
map32(variables, transformInitializedVariable)
|
|
162005
162024
|
)
|
|
162006
162025
|
),
|
|
162007
162026
|
node
|
|
@@ -162559,7 +162578,7 @@ ${lanes.join("\n")}
|
|
|
162559
162578
|
const variables = getInitializedVariables(initializer3);
|
|
162560
162579
|
node = factory2.updateForStatement(
|
|
162561
162580
|
node,
|
|
162562
|
-
variables.length > 0 ? factory2.inlineExpressions(
|
|
162581
|
+
variables.length > 0 ? factory2.inlineExpressions(map32(variables, transformInitializedVariable)) : void 0,
|
|
162563
162582
|
visitNode3(node.condition, visitor, isExpression),
|
|
162564
162583
|
visitNode3(node.incrementor, visitor, isExpression),
|
|
162565
162584
|
visitIterationBody(node.statement, visitor, context)
|
|
@@ -165885,7 +165904,7 @@ ${lanes.join("\n")}
|
|
|
165885
165904
|
moduleBodyBlock
|
|
165886
165905
|
);
|
|
165887
165906
|
const moduleName = tryGetModuleNameFromFile(factory2, node, host, compilerOptions);
|
|
165888
|
-
const dependencies = factory2.createArrayLiteralExpression(
|
|
165907
|
+
const dependencies = factory2.createArrayLiteralExpression(map32(dependencyGroups, (dependencyGroup) => dependencyGroup.name));
|
|
165889
165908
|
const updated = setEmitFlags(
|
|
165890
165909
|
factory2.updateSourceFile(
|
|
165891
165910
|
node,
|
|
@@ -167615,7 +167634,7 @@ ${lanes.join("\n")}
|
|
|
167615
167634
|
return node.kind === 308 ? transformSourceFile(node) : transformBundle(node);
|
|
167616
167635
|
}
|
|
167617
167636
|
function transformBundle(node) {
|
|
167618
|
-
return context.factory.createBundle(
|
|
167637
|
+
return context.factory.createBundle(map32(node.sourceFiles, transformSourceFile));
|
|
167619
167638
|
}
|
|
167620
167639
|
}
|
|
167621
167640
|
function canProduceDiagnostics(node) {
|
|
@@ -168363,7 +168382,7 @@ ${lanes.join("\n")}
|
|
|
168363
168382
|
rawLibReferenceDirectives = [];
|
|
168364
168383
|
let hasNoDefaultLib = false;
|
|
168365
168384
|
const bundle = factory2.createBundle(
|
|
168366
|
-
|
|
168385
|
+
map32(node.sourceFiles, (sourceFile) => {
|
|
168367
168386
|
if (sourceFile.isDeclarationFile) return void 0;
|
|
168368
168387
|
hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib;
|
|
168369
168388
|
currentSourceFile = sourceFile;
|
|
@@ -168474,7 +168493,7 @@ ${lanes.join("\n")}
|
|
|
168474
168493
|
getLibReferences()
|
|
168475
168494
|
);
|
|
168476
168495
|
function collectFileReferences(sourceFile) {
|
|
168477
|
-
rawReferencedFiles = concatenate(rawReferencedFiles,
|
|
168496
|
+
rawReferencedFiles = concatenate(rawReferencedFiles, map32(sourceFile.referencedFiles, (f3) => [sourceFile, f3]));
|
|
168478
168497
|
rawTypeReferenceDirectives = concatenate(rawTypeReferenceDirectives, sourceFile.typeReferenceDirectives);
|
|
168479
168498
|
rawLibReferenceDirectives = concatenate(rawLibReferenceDirectives, sourceFile.libReferenceDirectives);
|
|
168480
168499
|
}
|
|
@@ -168688,7 +168707,7 @@ ${lanes.join("\n")}
|
|
|
168688
168707
|
)) {
|
|
168689
168708
|
return factory2.createNodeArray();
|
|
168690
168709
|
}
|
|
168691
|
-
const newParams =
|
|
168710
|
+
const newParams = map32(params, (p) => ensureParameter(p, modifierMask));
|
|
168692
168711
|
if (!newParams) {
|
|
168693
168712
|
return factory2.createNodeArray();
|
|
168694
168713
|
}
|
|
@@ -169440,7 +169459,7 @@ ${lanes.join("\n")}
|
|
|
169440
169459
|
void 0,
|
|
169441
169460
|
/*isTypeOnly*/
|
|
169442
169461
|
false,
|
|
169443
|
-
factory2.createNamedExports(
|
|
169462
|
+
factory2.createNamedExports(map32(exportMappings, ([gen, exp]) => {
|
|
169444
169463
|
return factory2.createExportSpecifier(
|
|
169445
169464
|
/*isTypeOnly*/
|
|
169446
169465
|
false,
|
|
@@ -169648,11 +169667,11 @@ ${lanes.join("\n")}
|
|
|
169648
169667
|
2
|
|
169649
169668
|
/* Const */
|
|
169650
169669
|
));
|
|
169651
|
-
const heritageClauses = factory2.createNodeArray(
|
|
169670
|
+
const heritageClauses = factory2.createNodeArray(map32(input.heritageClauses, (clause) => {
|
|
169652
169671
|
if (clause.token === 96) {
|
|
169653
169672
|
const oldDiag2 = getSymbolAccessibilityDiagnostic;
|
|
169654
169673
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
|
|
169655
|
-
const newClause = factory2.updateHeritageClause(clause,
|
|
169674
|
+
const newClause = factory2.updateHeritageClause(clause, map32(clause.types, (t2) => factory2.updateExpressionWithTypeArguments(t2, newId, visitNodes2(t2.typeArguments, visitDeclarationSubtree, isTypeNode))));
|
|
169656
169675
|
getSymbolAccessibilityDiagnostic = oldDiag2;
|
|
169657
169676
|
return newClause;
|
|
169658
169677
|
}
|
|
@@ -169814,7 +169833,7 @@ ${lanes.join("\n")}
|
|
|
169814
169833
|
}
|
|
169815
169834
|
function transformHeritageClauses(nodes) {
|
|
169816
169835
|
return factory2.createNodeArray(filter4(
|
|
169817
|
-
|
|
169836
|
+
map32(nodes, (clause) => factory2.updateHeritageClause(
|
|
169818
169837
|
clause,
|
|
169819
169838
|
visitNodes2(
|
|
169820
169839
|
factory2.createNodeArray(filter4(clause.types, (t2) => {
|
|
@@ -169936,7 +169955,7 @@ ${lanes.join("\n")}
|
|
|
169936
169955
|
const moduleKind = getEmitModuleKind(compilerOptions);
|
|
169937
169956
|
const useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
169938
169957
|
const transformers = [];
|
|
169939
|
-
addRange(transformers, customTransformers &&
|
|
169958
|
+
addRange(transformers, customTransformers && map32(customTransformers.before, wrapScriptTransformerFactory));
|
|
169940
169959
|
transformers.push(transformTypeScript);
|
|
169941
169960
|
if (compilerOptions.experimentalDecorators) {
|
|
169942
169961
|
transformers.push(transformLegacyDecorators);
|
|
@@ -169974,13 +169993,13 @@ ${lanes.join("\n")}
|
|
|
169974
169993
|
transformers.push(transformGenerators);
|
|
169975
169994
|
}
|
|
169976
169995
|
transformers.push(getModuleTransformer(moduleKind));
|
|
169977
|
-
addRange(transformers, customTransformers &&
|
|
169996
|
+
addRange(transformers, customTransformers && map32(customTransformers.after, wrapScriptTransformerFactory));
|
|
169978
169997
|
return transformers;
|
|
169979
169998
|
}
|
|
169980
169999
|
function getDeclarationTransformers(customTransformers) {
|
|
169981
170000
|
const transformers = [];
|
|
169982
170001
|
transformers.push(transformDeclarations);
|
|
169983
|
-
addRange(transformers, customTransformers &&
|
|
170002
|
+
addRange(transformers, customTransformers && map32(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory));
|
|
169984
170003
|
return transformers;
|
|
169985
170004
|
}
|
|
169986
170005
|
function wrapCustomTransformer(transformer) {
|
|
@@ -170654,7 +170673,7 @@ ${lanes.join("\n")}
|
|
|
170654
170673
|
emitSkipped = true;
|
|
170655
170674
|
return;
|
|
170656
170675
|
}
|
|
170657
|
-
const buildInfo = host.getBuildInfo() || { version:
|
|
170676
|
+
const buildInfo = host.getBuildInfo() || { version: version3 };
|
|
170658
170677
|
writeFile13(
|
|
170659
170678
|
host,
|
|
170660
170679
|
emitterDiagnostics,
|
|
@@ -175756,7 +175775,7 @@ ${lanes.join("\n")}
|
|
|
175756
175775
|
var _a2;
|
|
175757
175776
|
if (!host.realpath || ensureTrailingDirectorySeparator(toPath3(host.realpath(rootDir))) === rootDirPath) {
|
|
175758
175777
|
const resultFromHost = {
|
|
175759
|
-
files:
|
|
175778
|
+
files: map32(host.readDirectory(
|
|
175760
175779
|
rootDir,
|
|
175761
175780
|
/*extensions*/
|
|
175762
175781
|
void 0,
|
|
@@ -175855,7 +175874,7 @@ ${lanes.join("\n")}
|
|
|
175855
175874
|
function getFileSystemEntriesFromHost(dir, path2) {
|
|
175856
175875
|
if (rootSymLinkResult && path2 === rootDirPath) return rootSymLinkResult;
|
|
175857
175876
|
const result = {
|
|
175858
|
-
files:
|
|
175877
|
+
files: map32(host.readDirectory(
|
|
175859
175878
|
dir,
|
|
175860
175879
|
/*extensions*/
|
|
175861
175880
|
void 0,
|
|
@@ -181387,7 +181406,7 @@ ${lanes.join("\n")}
|
|
|
181387
181406
|
root: arrayFrom(rootFileNames, (r2) => relativeToBuildInfo(r2)),
|
|
181388
181407
|
errors: state.hasErrors ? true : void 0,
|
|
181389
181408
|
checkPending: state.checkPending,
|
|
181390
|
-
version:
|
|
181409
|
+
version: version3
|
|
181391
181410
|
};
|
|
181392
181411
|
return buildInfo2;
|
|
181393
181412
|
}
|
|
@@ -181419,7 +181438,7 @@ ${lanes.join("\n")}
|
|
|
181419
181438
|
// Actual value
|
|
181420
181439
|
errors: state.hasErrors ? true : void 0,
|
|
181421
181440
|
checkPending: state.checkPending,
|
|
181422
|
-
version:
|
|
181441
|
+
version: version3
|
|
181423
181442
|
};
|
|
181424
181443
|
return buildInfo2;
|
|
181425
181444
|
}
|
|
@@ -181516,7 +181535,7 @@ ${lanes.join("\n")}
|
|
|
181516
181535
|
latestChangedDtsFile,
|
|
181517
181536
|
errors: state.hasErrors ? true : void 0,
|
|
181518
181537
|
checkPending: state.checkPending,
|
|
181519
|
-
version:
|
|
181538
|
+
version: version3
|
|
181520
181539
|
};
|
|
181521
181540
|
return buildInfo;
|
|
181522
181541
|
function relativeToBuildInfoEnsuringAbsolutePath(path2) {
|
|
@@ -182169,7 +182188,7 @@ ${lanes.join("\n")}
|
|
|
182169
182188
|
let filePathsSetList;
|
|
182170
182189
|
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
182171
182190
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
182172
|
-
const changedFilesSet = new Set(
|
|
182191
|
+
const changedFilesSet = new Set(map32(buildInfo.changeFileSet, toFilePath));
|
|
182173
182192
|
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
182174
182193
|
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
182175
182194
|
const path2 = toFilePath(index + 1);
|
|
@@ -184194,7 +184213,7 @@ ${lanes.join("\n")}
|
|
|
184194
184213
|
if (!content) return void 0;
|
|
184195
184214
|
buildInfo = getBuildInfo(buildInfoPath, content);
|
|
184196
184215
|
}
|
|
184197
|
-
if (!buildInfo || buildInfo.version !==
|
|
184216
|
+
if (!buildInfo || buildInfo.version !== version3 || !isIncrementalBuildInfo(buildInfo)) return void 0;
|
|
184198
184217
|
return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
|
|
184199
184218
|
}
|
|
184200
184219
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
@@ -185897,7 +185916,7 @@ ${lanes.join("\n")}
|
|
|
185897
185916
|
};
|
|
185898
185917
|
}
|
|
185899
185918
|
const incrementalBuildInfo = isIncremental && isIncrementalBuildInfo(buildInfo) ? buildInfo : void 0;
|
|
185900
|
-
if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !==
|
|
185919
|
+
if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version3) {
|
|
185901
185920
|
return {
|
|
185902
185921
|
type: 14,
|
|
185903
185922
|
version: buildInfo.version
|
|
@@ -186716,7 +186735,7 @@ ${lanes.join("\n")}
|
|
|
186716
186735
|
Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
|
|
186717
186736
|
relName(state, configFileName),
|
|
186718
186737
|
status2.version,
|
|
186719
|
-
|
|
186738
|
+
version3
|
|
186720
186739
|
);
|
|
186721
186740
|
case 17:
|
|
186722
186741
|
return reportStatus(
|
|
@@ -186804,7 +186823,7 @@ ${lanes.join("\n")}
|
|
|
186804
186823
|
return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter4(optionDeclarations.concat(tscBuildOption), (v) => !!v.showInSimplifiedHelpView);
|
|
186805
186824
|
}
|
|
186806
186825
|
function printVersion(sys2) {
|
|
186807
|
-
sys2.write(getDiagnosticText(Diagnostics.Version_0,
|
|
186826
|
+
sys2.write(getDiagnosticText(Diagnostics.Version_0, version3) + sys2.newLine);
|
|
186808
186827
|
}
|
|
186809
186828
|
function createColors(sys2) {
|
|
186810
186829
|
const showColors = defaultIsPretty(sys2);
|
|
@@ -187056,7 +187075,7 @@ ${lanes.join("\n")}
|
|
|
187056
187075
|
}
|
|
187057
187076
|
function printEasyHelp(sys2, simpleOptions) {
|
|
187058
187077
|
const colors = createColors(sys2);
|
|
187059
|
-
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0,
|
|
187078
|
+
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version3)}`)];
|
|
187060
187079
|
output.push(colors.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
|
|
187061
187080
|
example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
|
187062
187081
|
example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
|
@@ -187103,7 +187122,7 @@ ${lanes.join("\n")}
|
|
|
187103
187122
|
}
|
|
187104
187123
|
}
|
|
187105
187124
|
function printAllHelp(sys2, compilerOptions, buildOptions, watchOptions) {
|
|
187106
|
-
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0,
|
|
187125
|
+
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version3)}`)];
|
|
187107
187126
|
output = [...output, ...generateSectionOptionsOutput(
|
|
187108
187127
|
sys2,
|
|
187109
187128
|
getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS),
|
|
@@ -187135,7 +187154,7 @@ ${lanes.join("\n")}
|
|
|
187135
187154
|
}
|
|
187136
187155
|
}
|
|
187137
187156
|
function printBuildHelp(sys2, buildOptions) {
|
|
187138
|
-
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0,
|
|
187157
|
+
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version3)}`)];
|
|
187139
187158
|
output = [...output, ...generateSectionOptionsOutput(
|
|
187140
187159
|
sys2,
|
|
187141
187160
|
getDiagnosticText(Diagnostics.BUILD_OPTIONS),
|
|
@@ -188094,7 +188113,7 @@ ${lanes.join("\n")}
|
|
|
188094
188113
|
return factory.createArrayTypeNode(visitNode3(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
188095
188114
|
}
|
|
188096
188115
|
if (isJSDocTypeLiteral(node)) {
|
|
188097
|
-
return factory.createTypeLiteralNode(
|
|
188116
|
+
return factory.createTypeLiteralNode(map32(node.jsDocPropertyTags, (t2) => {
|
|
188098
188117
|
const name2 = visitNode3(isIdentifier(t2.name) ? t2.name : t2.name.right, visitExistingNodeTreeSymbols, isIdentifier);
|
|
188099
188118
|
const overrideTypeNode = resolver.getJsDocPropertyOverride(context, node, t2);
|
|
188100
188119
|
return factory.createPropertySignature(
|
|
@@ -188160,7 +188179,7 @@ ${lanes.join("\n")}
|
|
|
188160
188179
|
} else {
|
|
188161
188180
|
return factory.createFunctionTypeNode(
|
|
188162
188181
|
visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration),
|
|
188163
|
-
|
|
188182
|
+
map32(node.parameters, (p, i2) => factory.createParameterDeclaration(
|
|
188164
188183
|
/*modifiers*/
|
|
188165
188184
|
void 0,
|
|
188166
188185
|
getEffectiveDotDotDotForParameter(p),
|
|
@@ -192443,7 +192462,7 @@ ${lanes.join("\n")}
|
|
|
192443
192462
|
return expression;
|
|
192444
192463
|
}
|
|
192445
192464
|
function mapOneOrMany(valueOrArray, f3, resultSelector = identity) {
|
|
192446
|
-
return valueOrArray ? isArray(valueOrArray) ? resultSelector(
|
|
192465
|
+
return valueOrArray ? isArray(valueOrArray) ? resultSelector(map32(valueOrArray, f3)) : f3(valueOrArray, 0) : void 0;
|
|
192447
192466
|
}
|
|
192448
192467
|
function firstOrOnly(valueOrArray) {
|
|
192449
192468
|
return isArray(valueOrArray) ? first2(valueOrArray) : valueOrArray;
|
|
@@ -194298,7 +194317,7 @@ ${lanes.join("\n")}
|
|
|
194298
194317
|
node.forEachChild((child) => {
|
|
194299
194318
|
const value = cb(child);
|
|
194300
194319
|
if (value !== void 0) {
|
|
194301
|
-
result.push(...
|
|
194320
|
+
result.push(...toArray3(value));
|
|
194302
194321
|
}
|
|
194303
194322
|
});
|
|
194304
194323
|
return result;
|
|
@@ -196377,7 +196396,7 @@ interface Symbol {
|
|
|
196377
196396
|
curCancellationToken = cancellationToken;
|
|
196378
196397
|
curSourceFile = sourceFile;
|
|
196379
196398
|
try {
|
|
196380
|
-
return
|
|
196399
|
+
return map32(primaryNavBarMenuItems(rootNavigationBarNode(sourceFile)), convertToPrimaryNavBarMenuItem);
|
|
196381
196400
|
} finally {
|
|
196382
196401
|
reset();
|
|
196383
196402
|
}
|
|
@@ -197030,7 +197049,7 @@ interface Symbol {
|
|
|
197030
197049
|
kindModifiers: getModifiers2(n.node),
|
|
197031
197050
|
spans: getSpans(n),
|
|
197032
197051
|
nameSpan: n.name && getNodeSpan(n.name),
|
|
197033
|
-
childItems:
|
|
197052
|
+
childItems: map32(n.children, convertToTree)
|
|
197034
197053
|
};
|
|
197035
197054
|
}
|
|
197036
197055
|
function convertToPrimaryNavBarMenuItem(n) {
|
|
@@ -197039,7 +197058,7 @@ interface Symbol {
|
|
|
197039
197058
|
kind: getNodeKind(n.node),
|
|
197040
197059
|
kindModifiers: getModifiers2(n.node),
|
|
197041
197060
|
spans: getSpans(n),
|
|
197042
|
-
childItems:
|
|
197061
|
+
childItems: map32(n.children, convertToSecondaryNavBarMenuItem) || emptyChildItemArray,
|
|
197043
197062
|
indent: n.indent,
|
|
197044
197063
|
bolded: false,
|
|
197045
197064
|
grayed: false
|
|
@@ -197850,7 +197869,7 @@ interface Symbol {
|
|
|
197850
197869
|
}
|
|
197851
197870
|
function collectTypeParameters(checker, selection, enclosingNode, file2) {
|
|
197852
197871
|
const result = [];
|
|
197853
|
-
const selectionArray =
|
|
197872
|
+
const selectionArray = toArray3(selection);
|
|
197854
197873
|
const selectionRange = { pos: selectionArray[0].getStart(file2), end: selectionArray[selectionArray.length - 1].end };
|
|
197855
197874
|
for (const t2 of selectionArray) {
|
|
197856
197875
|
if (visitor(t2)) return { typeParameters: void 0, affectedTextRange: void 0 };
|
|
@@ -197976,7 +197995,7 @@ interface Symbol {
|
|
|
197976
197995
|
}
|
|
197977
197996
|
function doTypedefChange(changes, context, file2, name2, info) {
|
|
197978
197997
|
var _a2;
|
|
197979
|
-
|
|
197998
|
+
toArray3(info.selection).forEach((typeNode) => {
|
|
197980
197999
|
setEmitFlags(
|
|
197981
198000
|
typeNode,
|
|
197982
198001
|
3072 | 4096
|
|
@@ -199267,12 +199286,12 @@ interface Symbol {
|
|
|
199267
199286
|
"args",
|
|
199268
199287
|
/*questionToken*/
|
|
199269
199288
|
void 0,
|
|
199270
|
-
factory.createUnionTypeNode(
|
|
199289
|
+
factory.createUnionTypeNode(map32(signatureDeclarations, convertSignatureParametersToTuple))
|
|
199271
199290
|
)
|
|
199272
199291
|
]);
|
|
199273
199292
|
}
|
|
199274
199293
|
function convertSignatureParametersToTuple(decl) {
|
|
199275
|
-
const members =
|
|
199294
|
+
const members = map32(decl.parameters, convertParameterToNamedTupleMember);
|
|
199276
199295
|
return setEmitFlags(
|
|
199277
199296
|
factory.createTupleTypeNode(members),
|
|
199278
199297
|
some(members, (m2) => !!length(getSyntheticLeadingComments(m2))) ? 0 : 1
|
|
@@ -199752,9 +199771,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199752
199771
|
}
|
|
199753
199772
|
function doChange5(sourceFile, program2, host, changes, functionDeclaration, groupedReferences) {
|
|
199754
199773
|
const signature = groupedReferences.signature;
|
|
199755
|
-
const newFunctionDeclarationParams =
|
|
199774
|
+
const newFunctionDeclarationParams = map32(createNewParameters(functionDeclaration, program2, host), (param) => getSynthesizedDeepClone(param));
|
|
199756
199775
|
if (signature) {
|
|
199757
|
-
const newSignatureParams =
|
|
199776
|
+
const newSignatureParams = map32(createNewParameters(signature, program2, host), (param) => getSynthesizedDeepClone(param));
|
|
199758
199777
|
replaceParameters(signature, newSignatureParams);
|
|
199759
199778
|
}
|
|
199760
199779
|
replaceParameters(functionDeclaration, newFunctionDeclarationParams);
|
|
@@ -199817,10 +199836,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199817
199836
|
function groupReferences(referenceEntries) {
|
|
199818
199837
|
const classReferences = { accessExpressions: [], typeUsages: [] };
|
|
199819
199838
|
const groupedReferences2 = { functionCalls: [], declarations: [], classReferences, valid: true };
|
|
199820
|
-
const functionSymbols =
|
|
199821
|
-
const classSymbols =
|
|
199839
|
+
const functionSymbols = map32(functionNames, getSymbolTargetAtLocation);
|
|
199840
|
+
const classSymbols = map32(classNames, getSymbolTargetAtLocation);
|
|
199822
199841
|
const isConstructor = isConstructorDeclaration(functionDeclaration);
|
|
199823
|
-
const contextualSymbols =
|
|
199842
|
+
const contextualSymbols = map32(functionNames, (name2) => getSymbolForContextualType(name2, checker));
|
|
199824
199843
|
for (const entry of referenceEntries) {
|
|
199825
199844
|
if (entry.kind === ts_FindAllReferences_exports.EntryKind.Span) {
|
|
199826
199845
|
groupedReferences2.valid = false;
|
|
@@ -200084,7 +200103,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200084
200103
|
const parameters = getRefactorableParameters(functionDeclaration.parameters);
|
|
200085
200104
|
const hasRestParameter2 = isRestParameter(last(parameters));
|
|
200086
200105
|
const nonRestArguments = hasRestParameter2 ? functionArguments.slice(0, parameters.length - 1) : functionArguments;
|
|
200087
|
-
const properties =
|
|
200106
|
+
const properties = map32(nonRestArguments, (arg, i2) => {
|
|
200088
200107
|
const parameterName = getParameterName(parameters[i2]);
|
|
200089
200108
|
const property = createPropertyOrShorthandAssignment(parameterName, arg);
|
|
200090
200109
|
suppressLeadingAndTrailingTrivia(property.name);
|
|
@@ -200107,7 +200126,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200107
200126
|
function createNewParameters(functionDeclaration, program2, host) {
|
|
200108
200127
|
const checker = program2.getTypeChecker();
|
|
200109
200128
|
const refactorableParameters = getRefactorableParameters(functionDeclaration.parameters);
|
|
200110
|
-
const bindingElements =
|
|
200129
|
+
const bindingElements = map32(refactorableParameters, createBindingElementFromParameterDeclaration);
|
|
200111
200130
|
const objectParameterName = factory.createObjectBindingPattern(bindingElements);
|
|
200112
200131
|
const objectParameterType = createParameterTypeNode(refactorableParameters);
|
|
200113
200132
|
let objectInitializer;
|
|
@@ -200162,7 +200181,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200162
200181
|
return element;
|
|
200163
200182
|
}
|
|
200164
200183
|
function createParameterTypeNode(parameters) {
|
|
200165
|
-
const members =
|
|
200184
|
+
const members = map32(parameters, createPropertySignatureFromParameterDeclaration);
|
|
200166
200185
|
const typeNode = addEmitFlags(
|
|
200167
200186
|
factory.createTypeLiteralNode(members),
|
|
200168
200187
|
1
|
|
@@ -200437,7 +200456,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200437
200456
|
i2 = newIndex - 1;
|
|
200438
200457
|
const isLast = i2 === nodes.length - 1;
|
|
200439
200458
|
if (isTemplateExpression(currentNode)) {
|
|
200440
|
-
const spans =
|
|
200459
|
+
const spans = map32(currentNode.templateSpans, (span, index) => {
|
|
200441
200460
|
copyExpressionComments(span);
|
|
200442
200461
|
const isLastSpan = index === currentNode.templateSpans.length - 1;
|
|
200443
200462
|
const text = span.literal.text + (isLastSpan ? subsequentText : "");
|
|
@@ -202064,8 +202083,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202064
202083
|
}
|
|
202065
202084
|
}
|
|
202066
202085
|
function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) {
|
|
202067
|
-
const variableAssignments =
|
|
202068
|
-
const writeAssignments =
|
|
202086
|
+
const variableAssignments = map32(exposedVariableDeclarations, (v) => factory.createShorthandPropertyAssignment(v.symbol.name));
|
|
202087
|
+
const writeAssignments = map32(writes, (w) => factory.createShorthandPropertyAssignment(w.symbol.name));
|
|
202069
202088
|
return variableAssignments === void 0 ? writeAssignments : writeAssignments === void 0 ? variableAssignments : variableAssignments.concat(writeAssignments);
|
|
202070
202089
|
}
|
|
202071
202090
|
function isReadonlyArray(v) {
|
|
@@ -203590,7 +203609,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
203590
203609
|
}
|
|
203591
203610
|
function displayPartsToString(displayParts) {
|
|
203592
203611
|
if (displayParts) {
|
|
203593
|
-
return
|
|
203612
|
+
return map32(displayParts, (displayPart2) => displayPart2.text).join("");
|
|
203594
203613
|
}
|
|
203595
203614
|
return "";
|
|
203596
203615
|
}
|
|
@@ -204953,7 +204972,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
204953
204972
|
const multiLineCommentStart = /(?:\/\*+\s*)/.source;
|
|
204954
204973
|
const anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\s|\*)*)/.source;
|
|
204955
204974
|
const preamble = "(" + anyNumberOfSpacesAndAsterisksAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")";
|
|
204956
|
-
const literals = "(?:" +
|
|
204975
|
+
const literals = "(?:" + map32(descriptors, (d) => "(" + escapeRegExp(d.text) + ")").join("|") + ")";
|
|
204957
204976
|
const endOfLineOrEndOfComment = /(?:$|\*\/)/.source;
|
|
204958
204977
|
const messageRemainder = /(?:.*?)/.source;
|
|
204959
204978
|
const messagePortion = "(" + literals + messageRemainder + ")";
|
|
@@ -205892,9 +205911,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
205892
205911
|
let declarations;
|
|
205893
205912
|
if (symbol2 && symbol2.declarations) {
|
|
205894
205913
|
const indices = indicesOf(symbol2.declarations);
|
|
205895
|
-
const keys =
|
|
205914
|
+
const keys = map32(symbol2.declarations, (decl) => ({ file: decl.getSourceFile().fileName, pos: decl.pos }));
|
|
205896
205915
|
indices.sort((a, b) => compareStringsCaseSensitive(keys[a].file, keys[b].file) || keys[a].pos - keys[b].pos);
|
|
205897
|
-
const sortedDeclarations =
|
|
205916
|
+
const sortedDeclarations = map32(indices, (i2) => symbol2.declarations[i2]);
|
|
205898
205917
|
let lastDecl;
|
|
205899
205918
|
for (const decl of sortedDeclarations) {
|
|
205900
205919
|
if (isValidCallHierarchyDeclaration(decl)) {
|
|
@@ -206030,7 +206049,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206030
206049
|
return { from: from16, fromSpans };
|
|
206031
206050
|
}
|
|
206032
206051
|
function convertCallSiteGroupToIncomingCall(program2, entries) {
|
|
206033
|
-
return createCallHierarchyIncomingCall(createCallHierarchyItem(program2, entries[0].declaration),
|
|
206052
|
+
return createCallHierarchyIncomingCall(createCallHierarchyItem(program2, entries[0].declaration), map32(entries, (entry) => createTextSpanFromRange(entry.range)));
|
|
206034
206053
|
}
|
|
206035
206054
|
function getIncomingCalls(program2, declaration, cancellationToken) {
|
|
206036
206055
|
if (isSourceFile(declaration) || isModuleDeclaration(declaration) || isClassStaticBlockDeclaration(declaration)) {
|
|
@@ -206216,7 +206235,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206216
206235
|
return { to, fromSpans };
|
|
206217
206236
|
}
|
|
206218
206237
|
function convertCallSiteGroupToOutgoingCall(program2, entries) {
|
|
206219
|
-
return createCallHierarchyOutgoingCall(createCallHierarchyItem(program2, entries[0].declaration),
|
|
206238
|
+
return createCallHierarchyOutgoingCall(createCallHierarchyItem(program2, entries[0].declaration), map32(entries, (entry) => createTextSpanFromRange(entry.range)));
|
|
206220
206239
|
}
|
|
206221
206240
|
function getOutgoingCalls(program2, declaration) {
|
|
206222
206241
|
if (declaration.flags & 33554432 || isMethodSignature(declaration)) {
|
|
@@ -206329,7 +206348,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206329
206348
|
function getFixes(context) {
|
|
206330
206349
|
const diagnostics = getDiagnostics(context);
|
|
206331
206350
|
const registrations = errorCodeToFixes.get(String(context.errorCode));
|
|
206332
|
-
return flatMap(registrations, (f3) =>
|
|
206351
|
+
return flatMap(registrations, (f3) => map32(f3.getCodeActions(context), removeFixIdIfFixAllUnavailable(f3, diagnostics)));
|
|
206333
206352
|
}
|
|
206334
206353
|
function getAllFixes(context) {
|
|
206335
206354
|
return fixIdToRegistration.get(cast(context.fixId, isString)).getAllCodeActions(context);
|
|
@@ -207165,7 +207184,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
207165
207184
|
}
|
|
207166
207185
|
}
|
|
207167
207186
|
function transformJSDocTypeLiteral(node) {
|
|
207168
|
-
const typeNode = factory.createTypeLiteralNode(
|
|
207187
|
+
const typeNode = factory.createTypeLiteralNode(map32(node.jsDocPropertyTags, (tag) => factory.createPropertySignature(
|
|
207169
207188
|
/*modifiers*/
|
|
207170
207189
|
void 0,
|
|
207171
207190
|
isIdentifier(tag.name) ? tag.name : tag.name.right,
|
|
@@ -208436,7 +208455,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
208436
208455
|
function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) {
|
|
208437
208456
|
const { declarationList } = statement;
|
|
208438
208457
|
let foundImport = false;
|
|
208439
|
-
const converted =
|
|
208458
|
+
const converted = map32(declarationList.declarations, (decl) => {
|
|
208440
208459
|
const { name: name2, initializer: initializer3 } = decl;
|
|
208441
208460
|
if (initializer3) {
|
|
208442
208461
|
if (isExportsOrModuleExportsOrAlias(sourceFile, initializer3)) {
|
|
@@ -211561,7 +211580,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
211561
211580
|
));
|
|
211562
211581
|
}
|
|
211563
211582
|
function createExportSpecifiers(names, allowTypeModifier) {
|
|
211564
|
-
return factory.createNodeArray(
|
|
211583
|
+
return factory.createNodeArray(map32(names, (n) => factory.createExportSpecifier(
|
|
211565
211584
|
allowTypeModifier && n.isTypeOnly,
|
|
211566
211585
|
/*propertyName*/
|
|
211567
211586
|
void 0,
|
|
@@ -212447,7 +212466,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212447
212466
|
const checker = context.program.getTypeChecker();
|
|
212448
212467
|
const jsxAttributesNode = info.parentDeclaration.attributes;
|
|
212449
212468
|
const hasSpreadAttribute = some(jsxAttributesNode.properties, isJsxSpreadAttribute);
|
|
212450
|
-
const attrs =
|
|
212469
|
+
const attrs = map32(info.attributes, (attr) => {
|
|
212451
212470
|
const value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info.parentDeclaration);
|
|
212452
212471
|
const name2 = factory.createIdentifier(attr.name);
|
|
212453
212472
|
const jsxAttribute = factory.createJsxAttribute(name2, factory.createJsxExpression(
|
|
@@ -212468,7 +212487,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212468
212487
|
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
|
|
212469
212488
|
const target = getEmitScriptTarget(context.program.getCompilerOptions());
|
|
212470
212489
|
const checker = context.program.getTypeChecker();
|
|
212471
|
-
const props =
|
|
212490
|
+
const props = map32(info.properties, (prop) => {
|
|
212472
212491
|
const initializer3 = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info.parentDeclaration);
|
|
212473
212492
|
return factory.createPropertyAssignment(createPropertyNameFromSymbol(prop, target, quotePreference, checker), initializer3);
|
|
212474
212493
|
});
|
|
@@ -212550,7 +212569,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212550
212569
|
return factory.createArrayLiteralExpression();
|
|
212551
212570
|
}
|
|
212552
212571
|
if (isObjectLiteralType(type)) {
|
|
212553
|
-
const props =
|
|
212572
|
+
const props = map32(checker.getPropertiesOfType(type), (prop) => {
|
|
212554
212573
|
const initializer3 = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration);
|
|
212555
212574
|
return factory.createPropertyAssignment(prop.name, initializer3);
|
|
212556
212575
|
});
|
|
@@ -212888,7 +212907,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212888
212907
|
}
|
|
212889
212908
|
}
|
|
212890
212909
|
function updateParameters(importAdder, scriptTarget, node, newParameters) {
|
|
212891
|
-
const parameters =
|
|
212910
|
+
const parameters = map32(node.parameters, (p) => factory.createParameterDeclaration(
|
|
212892
212911
|
p.modifiers,
|
|
212893
212912
|
p.dotDotDotToken,
|
|
212894
212913
|
p.name,
|
|
@@ -213466,7 +213485,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213466
213485
|
jsDocParameterTag.isNameFirst,
|
|
213467
213486
|
jsDocParameterTag.comment
|
|
213468
213487
|
);
|
|
213469
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost,
|
|
213488
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map32(tags, (t2) => t2 === jsDocParameterTag ? newJSDocParameterTag : t2)));
|
|
213470
213489
|
return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name2.getText(sourceFile), parameterName]);
|
|
213471
213490
|
}
|
|
213472
213491
|
function getInfo14(sourceFile, pos) {
|
|
@@ -213582,7 +213601,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213582
213601
|
const elements = token.parent.elements;
|
|
213583
213602
|
const diagnostic = [
|
|
213584
213603
|
elements.length > 1 ? Diagnostics.Remove_unused_declarations_for_Colon_0 : Diagnostics.Remove_unused_declaration_for_Colon_0,
|
|
213585
|
-
|
|
213604
|
+
map32(elements, (e2) => e2.getText(sourceFile)).join(", ")
|
|
213586
213605
|
];
|
|
213587
213606
|
return [
|
|
213588
213607
|
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t2) => deleteDestructuringElements(t2, sourceFile, token.parent)), diagnostic)
|
|
@@ -215543,7 +215562,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
215543
215562
|
));
|
|
215544
215563
|
}
|
|
215545
215564
|
} else {
|
|
215546
|
-
const paramTags =
|
|
215565
|
+
const paramTags = map32(inferences, ({ name: name2, typeNode, isOptional }) => factory.createJSDocParameterTag(
|
|
215547
215566
|
/*tagName*/
|
|
215548
215567
|
void 0,
|
|
215549
215568
|
name2,
|
|
@@ -216677,8 +216696,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
216677
216696
|
const isJs = isInJSFile(contextNode);
|
|
216678
216697
|
const { typeArguments, arguments: args, parent: parent2 } = call;
|
|
216679
216698
|
const contextualType = isJs ? void 0 : checker.getContextualType(call);
|
|
216680
|
-
const names =
|
|
216681
|
-
const instanceTypes = isJs ? [] :
|
|
216699
|
+
const names = map32(args, (arg) => isIdentifier(arg) ? arg.text : isPropertyAccessExpression(arg) && isIdentifier(arg.name) ? arg.name.text : void 0);
|
|
216700
|
+
const instanceTypes = isJs ? [] : map32(args, (arg) => checker.getTypeAtLocation(arg));
|
|
216682
216701
|
const { argumentTypeNodes, argumentTypeParameters } = getArgumentTypesAndTypeParameters(
|
|
216683
216702
|
checker,
|
|
216684
216703
|
importAdder,
|
|
@@ -216986,7 +217005,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
216986
217005
|
}
|
|
216987
217006
|
function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) {
|
|
216988
217007
|
if (length(signatures)) {
|
|
216989
|
-
const type = checker.getUnionType(
|
|
217008
|
+
const type = checker.getUnionType(map32(signatures, checker.getReturnTypeOfSignature));
|
|
216990
217009
|
return checker.typeToTypeNode(type, enclosingDeclaration, 1, 8, getNoopSymbolTrackerWithResolver(context));
|
|
216991
217010
|
}
|
|
216992
217011
|
}
|
|
@@ -218991,7 +219010,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
218991
219010
|
if (elements.length === 0) {
|
|
218992
219011
|
return void 0;
|
|
218993
219012
|
}
|
|
218994
|
-
const newClauses =
|
|
219013
|
+
const newClauses = map32(elements, (element) => factory.createCaseClause(element, []));
|
|
218995
219014
|
const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options);
|
|
218996
219015
|
const printer = createSnippetPrinter({
|
|
218997
219016
|
removeComments: true,
|
|
@@ -219001,7 +219020,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219001
219020
|
newLine: getNewLineKind(newLineChar)
|
|
219002
219021
|
});
|
|
219003
219022
|
const printNode = formatContext ? (node) => printer.printAndFormatNode(4, node, sourceFile, formatContext) : (node) => printer.printNode(4, node, sourceFile);
|
|
219004
|
-
const insertText =
|
|
219023
|
+
const insertText = map32(newClauses, (clause, i2) => {
|
|
219005
219024
|
if (preferences.includeCompletionsWithSnippetText) {
|
|
219006
219025
|
return `${printNode(clause)}$${i2 + 1}`;
|
|
219007
219026
|
}
|
|
@@ -224228,7 +224247,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
224228
224247
|
}
|
|
224229
224248
|
}
|
|
224230
224249
|
const checker = program2.getTypeChecker();
|
|
224231
|
-
return
|
|
224250
|
+
return map32(referenceEntries, (entry) => toImplementationLocation(entry, checker));
|
|
224232
224251
|
}
|
|
224233
224252
|
function getImplementationReferenceEntries(program2, cancellationToken, sourceFiles, node, position) {
|
|
224234
224253
|
if (node.kind === 308) {
|
|
@@ -224251,7 +224270,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
224251
224270
|
}
|
|
224252
224271
|
}
|
|
224253
224272
|
function findReferenceOrRenameEntries(program2, cancellationToken, sourceFiles, node, position, options, convertEntry) {
|
|
224254
|
-
return
|
|
224273
|
+
return map32(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program2, sourceFiles, cancellationToken, options)), (entry) => convertEntry(entry, node, program2.getTypeChecker()));
|
|
224255
224274
|
}
|
|
224256
224275
|
function getReferenceEntriesForNode(position, node, program2, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f3) => f3.fileName))) {
|
|
224257
224276
|
return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program2, sourceFiles, cancellationToken, options, sourceFilesSet));
|
|
@@ -226131,7 +226150,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
226131
226150
|
const staticBlocks = filter4(classDecl.members, isClassStaticBlockDeclaration);
|
|
226132
226151
|
const containerName = symbol22 ? typeChecker.symbolToString(symbol22, classDecl) : "";
|
|
226133
226152
|
const sourceFile2 = node.getSourceFile();
|
|
226134
|
-
return
|
|
226153
|
+
return map32(staticBlocks, (staticBlock) => {
|
|
226135
226154
|
let { pos } = moveRangePastModifiers(staticBlock);
|
|
226136
226155
|
pos = skipTrivia(sourceFile2.text, pos);
|
|
226137
226156
|
return createDefinitionInfoFromName(
|
|
@@ -226471,7 +226490,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
226471
226490
|
}
|
|
226472
226491
|
const withoutExpandos = filter4(filteredDeclarations, (d) => !isExpandoDeclaration(d));
|
|
226473
226492
|
const results = some(withoutExpandos) ? withoutExpandos : filteredDeclarations;
|
|
226474
|
-
return
|
|
226493
|
+
return map32(results, (declaration) => createDefinitionInfo(
|
|
226475
226494
|
declaration,
|
|
226476
226495
|
typeChecker,
|
|
226477
226496
|
symbol2,
|
|
@@ -227698,7 +227717,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
227698
227717
|
}
|
|
227699
227718
|
}
|
|
227700
227719
|
function getJSDocTagNameCompletions() {
|
|
227701
|
-
return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries =
|
|
227720
|
+
return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = map32(jsDocTagNames, (tagName) => {
|
|
227702
227721
|
return {
|
|
227703
227722
|
name: tagName,
|
|
227704
227723
|
kind: "keyword",
|
|
@@ -227709,7 +227728,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
227709
227728
|
}
|
|
227710
227729
|
var getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails;
|
|
227711
227730
|
function getJSDocTagCompletions() {
|
|
227712
|
-
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries =
|
|
227731
|
+
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = map32(jsDocTagNames, (tagName) => {
|
|
227713
227732
|
return {
|
|
227714
227733
|
name: `@${tagName}`,
|
|
227715
227734
|
kind: "keyword",
|
|
@@ -228541,7 +228560,7 @@ ${content}
|
|
|
228541
228560
|
return isString(moduleSpecifierText) && some(sourceFile.moduleAugmentations, (moduleName) => isStringLiteral(moduleName) && moduleName.text === moduleSpecifierText);
|
|
228542
228561
|
}
|
|
228543
228562
|
function getNewImportSpecifiers(namedImports) {
|
|
228544
|
-
return flatMap(namedImports, (namedImport) =>
|
|
228563
|
+
return flatMap(namedImports, (namedImport) => map32(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && moduleExportNameTextEscaped(importSpecifier.name) === moduleExportNameTextEscaped(importSpecifier.propertyName) ? factory.updateImportSpecifier(
|
|
228545
228564
|
importSpecifier,
|
|
228546
228565
|
importSpecifier.isTypeOnly,
|
|
228547
228566
|
/*propertyName*/
|
|
@@ -229707,7 +229726,7 @@ ${content}
|
|
|
229707
229726
|
/*meaning*/
|
|
229708
229727
|
void 0
|
|
229709
229728
|
) : emptyArray;
|
|
229710
|
-
const items =
|
|
229729
|
+
const items = map32(candidates, (candidateSignature) => getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile));
|
|
229711
229730
|
let selectedItemIndex = 0;
|
|
229712
229731
|
let itemsSeen = 0;
|
|
229713
229732
|
for (let i2 = 0; i2 < items.length; i2++) {
|
|
@@ -229767,7 +229786,7 @@ ${content}
|
|
|
229767
229786
|
), spacePart()];
|
|
229768
229787
|
function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {
|
|
229769
229788
|
const infos = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile);
|
|
229770
|
-
return
|
|
229789
|
+
return map32(infos, ({ isVariadic, parameters, prefix, suffix }) => {
|
|
229771
229790
|
const prefixDisplayParts = [...callTargetDisplayParts, ...prefix];
|
|
229772
229791
|
const suffixDisplayParts = [...suffix, ...returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker)];
|
|
229773
229792
|
const documentation = candidateSignature.getDocumentationComment(checker);
|
|
@@ -229805,7 +229824,7 @@ ${content}
|
|
|
229805
229824
|
const parameters = (typeParameters || emptyArray).map((t2) => createSignatureHelpParameterForTypeParameter(t2, checker, enclosingDeclaration, sourceFile, printer));
|
|
229806
229825
|
const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
|
|
229807
229826
|
return checker.getExpandedParameters(candidateSignature).map((paramList) => {
|
|
229808
|
-
const params = factory.createNodeArray([...thisParameter, ...
|
|
229827
|
+
const params = factory.createNodeArray([...thisParameter, ...map32(paramList, (param) => checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags))]);
|
|
229809
229828
|
const parameterParts = mapToDisplayParts((writer) => {
|
|
229810
229829
|
printer.writeList(2576, params, sourceFile, writer);
|
|
229811
229830
|
});
|
|
@@ -238322,7 +238341,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
238322
238341
|
makeImport: () => makeImport,
|
|
238323
238342
|
makeStringLiteral: () => makeStringLiteral,
|
|
238324
238343
|
mangleScopedPackageName: () => mangleScopedPackageName,
|
|
238325
|
-
map: () =>
|
|
238344
|
+
map: () => map32,
|
|
238326
238345
|
mapAllOrFail: () => mapAllOrFail,
|
|
238327
238346
|
mapDefined: () => mapDefined,
|
|
238328
238347
|
mapDefinedIterator: () => mapDefinedIterator,
|
|
@@ -238648,7 +238667,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
238648
238667
|
textSpansEqual: () => textSpansEqual,
|
|
238649
238668
|
textToKeywordObj: () => textToKeywordObj,
|
|
238650
238669
|
timestamp: () => timestamp,
|
|
238651
|
-
toArray: () =>
|
|
238670
|
+
toArray: () => toArray3,
|
|
238652
238671
|
toBuilderFileEmit: () => toBuilderFileEmit,
|
|
238653
238672
|
toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit,
|
|
238654
238673
|
toEditorSettings: () => toEditorSettings,
|
|
@@ -238746,7 +238765,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
238746
238765
|
usingSingleLineStringWriter: () => usingSingleLineStringWriter,
|
|
238747
238766
|
utf16EncodeAsString: () => utf16EncodeAsString,
|
|
238748
238767
|
validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage,
|
|
238749
|
-
version: () =>
|
|
238768
|
+
version: () => version3,
|
|
238750
238769
|
versionMajorMinor: () => versionMajorMinor,
|
|
238751
238770
|
visitArray: () => visitArray,
|
|
238752
238771
|
visitCommaListElements: () => visitCommaListElements,
|
|
@@ -238771,7 +238790,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
238771
238790
|
var enableDeprecationWarnings = true;
|
|
238772
238791
|
var typeScriptVersion2;
|
|
238773
238792
|
function getTypeScriptVersion() {
|
|
238774
|
-
return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(
|
|
238793
|
+
return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(version3));
|
|
238775
238794
|
}
|
|
238776
238795
|
function formatDeprecationMessage(name2, error210, errorAfter, since, message) {
|
|
238777
238796
|
let deprecationMessage = error210 ? "DeprecationError: " : "DeprecationWarning: ";
|
|
@@ -239280,7 +239299,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
239280
239299
|
this.sendResponse({
|
|
239281
239300
|
kind: EventBeginInstallTypes,
|
|
239282
239301
|
eventId: requestId,
|
|
239283
|
-
typingsInstallerVersion:
|
|
239302
|
+
typingsInstallerVersion: version3,
|
|
239284
239303
|
projectName: req.projectName
|
|
239285
239304
|
});
|
|
239286
239305
|
const scopedTypings = filteredTypings.map(typingsName);
|
|
@@ -239322,7 +239341,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
239322
239341
|
projectName: req.projectName,
|
|
239323
239342
|
packagesToInstall: scopedTypings,
|
|
239324
239343
|
installSuccess: ok,
|
|
239325
|
-
typingsInstallerVersion:
|
|
239344
|
+
typingsInstallerVersion: version3
|
|
239326
239345
|
};
|
|
239327
239346
|
this.sendResponse(response);
|
|
239328
239347
|
}
|
|
@@ -240997,7 +241016,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
240997
241016
|
if (!this.languageServiceEnabled) {
|
|
240998
241017
|
return this.getRootScriptInfos();
|
|
240999
241018
|
}
|
|
241000
|
-
return
|
|
241019
|
+
return map32(this.program.getSourceFiles(), (sourceFile) => {
|
|
241001
241020
|
const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath);
|
|
241002
241021
|
Debug.assert(!!scriptInfo, "getScriptInfo", () => `scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' / '${sourceFile.resolvedPath}' is missing.`);
|
|
241003
241022
|
return scriptInfo;
|
|
@@ -244361,7 +244380,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
244361
244380
|
configFileName: configFileName(),
|
|
244362
244381
|
projectType: project instanceof ExternalProject ? "external" : "configured",
|
|
244363
244382
|
languageServiceEnabled: project.languageServiceEnabled,
|
|
244364
|
-
version:
|
|
244383
|
+
version: version3
|
|
244365
244384
|
};
|
|
244366
244385
|
this.eventHandler({ eventName: ProjectInfoTelemetryEvent, data });
|
|
244367
244386
|
function configFileName() {
|
|
@@ -246488,7 +246507,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246488
246507
|
async enableRequestedPluginsWorker(pendingPlugins) {
|
|
246489
246508
|
Debug.assert(this.currentPluginEnablementPromise === void 0);
|
|
246490
246509
|
let sendProjectsUpdatedInBackgroundEvent = false;
|
|
246491
|
-
await Promise.all(
|
|
246510
|
+
await Promise.all(map32(pendingPlugins, async ([project, promises]) => {
|
|
246492
246511
|
const results = await Promise.all(promises);
|
|
246493
246512
|
if (project.isClosed() || isProjectDeferredClose(project)) {
|
|
246494
246513
|
this.logger.info(`Cancelling plugin enabling for ${project.getProjectName()} as it is ${project.isClosed() ? "closed" : "deferred close"}`);
|
|
@@ -246824,7 +246843,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246824
246843
|
reportsUnnecessary: diag2.reportsUnnecessary,
|
|
246825
246844
|
reportsDeprecated: diag2.reportsDeprecated,
|
|
246826
246845
|
source: diag2.source,
|
|
246827
|
-
relatedInformation:
|
|
246846
|
+
relatedInformation: map32(diag2.relatedInformation, formatRelatedInformation)
|
|
246828
246847
|
};
|
|
246829
246848
|
}
|
|
246830
246849
|
function formatRelatedInformation(info) {
|
|
@@ -246865,7 +246884,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246865
246884
|
reportsUnnecessary: diag2.reportsUnnecessary,
|
|
246866
246885
|
reportsDeprecated: diag2.reportsDeprecated,
|
|
246867
246886
|
source,
|
|
246868
|
-
relatedInformation:
|
|
246887
|
+
relatedInformation: map32(diag2.relatedInformation, formatRelatedInformation)
|
|
246869
246888
|
};
|
|
246870
246889
|
return includeFileName ? { ...common, fileName: diag2.file && diag2.file.fileName } : common;
|
|
246871
246890
|
}
|
|
@@ -247329,7 +247348,7 @@ ${json2}${newLine}`;
|
|
|
247329
247348
|
"status"
|
|
247330
247349
|
/* Status */
|
|
247331
247350
|
]: () => {
|
|
247332
|
-
const response = { version:
|
|
247351
|
+
const response = { version: version3 };
|
|
247333
247352
|
return this.requiredResponse(response);
|
|
247334
247353
|
},
|
|
247335
247354
|
[
|
|
@@ -247378,7 +247397,7 @@ ${json2}${newLine}`;
|
|
|
247378
247397
|
if (!result.some((p) => p.projectErrors && p.projectErrors.length !== 0)) {
|
|
247379
247398
|
return this.requiredResponse(result);
|
|
247380
247399
|
}
|
|
247381
|
-
const converted =
|
|
247400
|
+
const converted = map32(result, (p) => {
|
|
247382
247401
|
if (!p.projectErrors || p.projectErrors.length === 0) {
|
|
247383
247402
|
return p;
|
|
247384
247403
|
}
|
|
@@ -248450,7 +248469,7 @@ ${json2}${newLine}`;
|
|
|
248450
248469
|
this.event({
|
|
248451
248470
|
triggerFile: event.data.triggerFile,
|
|
248452
248471
|
configFile: event.data.configFileName,
|
|
248453
|
-
diagnostics:
|
|
248472
|
+
diagnostics: map32(event.data.diagnostics, (diagnostic) => formatDiagnosticToProtocol(
|
|
248454
248473
|
diagnostic,
|
|
248455
248474
|
/*includeFileName*/
|
|
248456
248475
|
true
|
|
@@ -248791,7 +248810,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248791
248810
|
concatenate(projectErrors, optionsErrors),
|
|
248792
248811
|
(diagnostic) => !!diagnostic.file && diagnostic.file.fileName === configFile
|
|
248793
248812
|
);
|
|
248794
|
-
return includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) :
|
|
248813
|
+
return includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) : map32(
|
|
248795
248814
|
diagnosticsForConfigFile,
|
|
248796
248815
|
(diagnostic) => formatDiagnosticToProtocol(
|
|
248797
248816
|
diagnostic,
|
|
@@ -248816,7 +248835,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248816
248835
|
// TODO: GH#18217
|
|
248817
248836
|
reportsUnnecessary: d.reportsUnnecessary,
|
|
248818
248837
|
reportsDeprecated: d.reportsDeprecated,
|
|
248819
|
-
relatedInformation:
|
|
248838
|
+
relatedInformation: map32(d.relatedInformation, formatRelatedInformation)
|
|
248820
248839
|
}));
|
|
248821
248840
|
}
|
|
248822
248841
|
getCompilerOptionsDiagnostics(args) {
|
|
@@ -248844,7 +248863,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248844
248863
|
endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length),
|
|
248845
248864
|
reportsUnnecessary: d.reportsUnnecessary,
|
|
248846
248865
|
reportsDeprecated: d.reportsDeprecated,
|
|
248847
|
-
relatedInformation:
|
|
248866
|
+
relatedInformation: map32(d.relatedInformation, formatRelatedInformation)
|
|
248848
248867
|
})
|
|
248849
248868
|
);
|
|
248850
248869
|
}
|
|
@@ -249751,7 +249770,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249751
249770
|
false
|
|
249752
249771
|
) })) : result.map((details) => ({
|
|
249753
249772
|
...details,
|
|
249754
|
-
codeActions:
|
|
249773
|
+
codeActions: map32(details.codeActions, (action) => this.mapCodeAction(action)),
|
|
249755
249774
|
documentation: this.mapDisplayParts(details.documentation, project),
|
|
249756
249775
|
tags: this.mapJSDocTagInfo(details.tags, project, useDisplayParts)
|
|
249757
249776
|
}));
|
|
@@ -249891,7 +249910,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249891
249910
|
this.projectService.closeClientFile(file2);
|
|
249892
249911
|
}
|
|
249893
249912
|
mapLocationNavigationBarItems(items, scriptInfo) {
|
|
249894
|
-
return
|
|
249913
|
+
return map32(items, (item) => ({
|
|
249895
249914
|
text: item.text,
|
|
249896
249915
|
kind: item.kind,
|
|
249897
249916
|
kindModifiers: item.kindModifiers,
|
|
@@ -249912,7 +249931,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249912
249931
|
kindModifiers: tree.kindModifiers,
|
|
249913
249932
|
spans: tree.spans.map((span) => toProtocolTextSpan(span, scriptInfo)),
|
|
249914
249933
|
nameSpan: tree.nameSpan && toProtocolTextSpan(tree.nameSpan, scriptInfo),
|
|
249915
|
-
childItems:
|
|
249934
|
+
childItems: map32(tree.childItems, (item) => this.toLocationNavigationTree(item, scriptInfo))
|
|
249916
249935
|
};
|
|
249917
249936
|
}
|
|
249918
249937
|
getNavigationTree(args, simplifiedResult) {
|
|
@@ -250184,7 +250203,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
250184
250203
|
}
|
|
250185
250204
|
applyCodeActionCommand(args) {
|
|
250186
250205
|
const commands2 = args.command;
|
|
250187
|
-
for (const command of
|
|
250206
|
+
for (const command of toArray3(commands2)) {
|
|
250188
250207
|
const { file: file2, project } = this.getFileAndProject(command);
|
|
250189
250208
|
project.getLanguageService().applyCodeActionCommand(command, this.getFormatOptions(file2)).then(
|
|
250190
250209
|
(_result) => {
|
|
@@ -250304,7 +250323,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
250304
250323
|
const { locations } = args;
|
|
250305
250324
|
const { file: file2, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args);
|
|
250306
250325
|
const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file2));
|
|
250307
|
-
return
|
|
250326
|
+
return map32(locations, (location) => {
|
|
250308
250327
|
const pos = this.getPosition(location, scriptInfo);
|
|
250309
250328
|
const selectionRange = languageService.getSmartSelectionRange(file2, pos);
|
|
250310
250329
|
return simplifiedResult ? this.mapSelectionRange(selectionRange, scriptInfo) : selectionRange;
|
|
@@ -253683,7 +253702,7 @@ function build(state, object3) {
|
|
|
253683
253702
|
}
|
|
253684
253703
|
return node2;
|
|
253685
253704
|
}
|
|
253686
|
-
const
|
|
253705
|
+
const map32 = tag.represent(object3);
|
|
253687
253706
|
const style = new Style();
|
|
253688
253707
|
style.tagged = !implicitTag;
|
|
253689
253708
|
const node = {
|
|
@@ -253693,7 +253712,7 @@ function build(state, object3) {
|
|
|
253693
253712
|
items: []
|
|
253694
253713
|
};
|
|
253695
253714
|
if (!state.noRefs) state.refs.set(object3, node);
|
|
253696
|
-
for (const [objectKey, objectValue] of
|
|
253715
|
+
for (const [objectKey, objectValue] of map32) {
|
|
253697
253716
|
const key = build(state, objectKey);
|
|
253698
253717
|
if (key === INVALID) continue;
|
|
253699
253718
|
const value = build(state, objectValue);
|
|
@@ -254514,9 +254533,9 @@ var init_js_yaml = __esm({
|
|
|
254514
254533
|
create: () => ({}),
|
|
254515
254534
|
identify: isPlainObject,
|
|
254516
254535
|
represent: (o) => {
|
|
254517
|
-
const
|
|
254518
|
-
for (const key of Object.keys(o))
|
|
254519
|
-
return
|
|
254536
|
+
const map32 = /* @__PURE__ */ new Map();
|
|
254537
|
+
for (const key of Object.keys(o)) map32.set(key, o[key]);
|
|
254538
|
+
return map32;
|
|
254520
254539
|
},
|
|
254521
254540
|
addPair: (container, key, value) => {
|
|
254522
254541
|
if (key !== null && typeof key === "object") return "object-based map does not support complex keys";
|
|
@@ -254541,9 +254560,9 @@ var init_js_yaml = __esm({
|
|
|
254541
254560
|
create: () => /* @__PURE__ */ new Set(),
|
|
254542
254561
|
identify: (data) => data instanceof Set,
|
|
254543
254562
|
represent: (data) => {
|
|
254544
|
-
const
|
|
254545
|
-
for (const key of data)
|
|
254546
|
-
return
|
|
254563
|
+
const map32 = /* @__PURE__ */ new Map();
|
|
254564
|
+
for (const key of data) map32.set(key, null);
|
|
254565
|
+
return map32;
|
|
254547
254566
|
},
|
|
254548
254567
|
addPair: (container, key, value) => {
|
|
254549
254568
|
if (value !== null) return "cannot resolve a set item";
|
|
@@ -254656,19 +254675,19 @@ var init_js_yaml = __esm({
|
|
|
254656
254675
|
identify: (data) => data instanceof Map || isPlainObject(data),
|
|
254657
254676
|
represent: (data) => {
|
|
254658
254677
|
if (data instanceof Map) return data;
|
|
254659
|
-
const
|
|
254678
|
+
const map32 = /* @__PURE__ */ new Map();
|
|
254660
254679
|
const obj = data;
|
|
254661
|
-
for (const key of Object.keys(obj))
|
|
254662
|
-
return
|
|
254680
|
+
for (const key of Object.keys(obj)) map32.set(key, obj[key]);
|
|
254681
|
+
return map32;
|
|
254663
254682
|
}
|
|
254664
254683
|
});
|
|
254665
254684
|
legacyMapTag = defineMappingTag("tag:yaml.org,2002:map", {
|
|
254666
254685
|
create: () => ({}),
|
|
254667
254686
|
identify: isPlainObject,
|
|
254668
254687
|
represent: (o) => {
|
|
254669
|
-
const
|
|
254670
|
-
for (const key of Object.keys(o))
|
|
254671
|
-
return
|
|
254688
|
+
const map32 = /* @__PURE__ */ new Map();
|
|
254689
|
+
for (const key of Object.keys(o)) map32.set(key, o[key]);
|
|
254690
|
+
return map32;
|
|
254672
254691
|
},
|
|
254673
254692
|
addPair: (container, key, value) => {
|
|
254674
254693
|
const normalizedKey = normalizeKey(key);
|
|
@@ -256181,40 +256200,40 @@ async function download(url2) {
|
|
|
256181
256200
|
}
|
|
256182
256201
|
return Buffer.from(await res.arrayBuffer());
|
|
256183
256202
|
}
|
|
256184
|
-
async function ensureTalosctl(
|
|
256185
|
-
if (!VERSION_RE.test(
|
|
256186
|
-
throw new Error(`Unknown Talos version "${
|
|
256203
|
+
async function ensureTalosctl(version3) {
|
|
256204
|
+
if (!VERSION_RE.test(version3)) {
|
|
256205
|
+
throw new Error(`Unknown Talos version "${version3}"`);
|
|
256187
256206
|
}
|
|
256188
256207
|
const onPath = await runBinary("talosctl", [
|
|
256189
256208
|
"version",
|
|
256190
256209
|
"--client",
|
|
256191
256210
|
"--short"
|
|
256192
256211
|
]);
|
|
256193
|
-
if (onPath.code === 0 && clientVersionOf(onPath.stdout) ===
|
|
256212
|
+
if (onPath.code === 0 && clientVersionOf(onPath.stdout) === version3) {
|
|
256194
256213
|
return "talosctl";
|
|
256195
256214
|
}
|
|
256196
256215
|
const asset = talosctlAssetName();
|
|
256197
256216
|
const dir = (0, import_path2.join)(mainDirectory, "bin");
|
|
256198
256217
|
const binary = (0, import_path2.join)(
|
|
256199
256218
|
dir,
|
|
256200
|
-
`talosctl-${
|
|
256219
|
+
`talosctl-${version3}${asset.endsWith(".exe") ? ".exe" : ""}`
|
|
256201
256220
|
);
|
|
256202
256221
|
if ((0, import_fs4.existsSync)(binary)) {
|
|
256203
256222
|
return binary;
|
|
256204
256223
|
}
|
|
256205
256224
|
Logger.info(
|
|
256206
|
-
`Downloading talosctl ${
|
|
256225
|
+
`Downloading talosctl ${version3} (${asset}, about 90 MB, once) from the Talos releases ...`
|
|
256207
256226
|
);
|
|
256208
|
-
const sums = (await download(`${RELEASES}/${
|
|
256227
|
+
const sums = (await download(`${RELEASES}/${version3}/sha256sum.txt`)).toString("utf8");
|
|
256209
256228
|
const expected = checksumFor(sums, asset);
|
|
256210
256229
|
if (!expected) {
|
|
256211
|
-
throw new Error(`The ${
|
|
256230
|
+
throw new Error(`The ${version3} release lists no checksum for ${asset}.`);
|
|
256212
256231
|
}
|
|
256213
|
-
const body = await download(`${RELEASES}/${
|
|
256232
|
+
const body = await download(`${RELEASES}/${version3}/${asset}`);
|
|
256214
256233
|
const actual = (0, import_crypto.createHash)("sha256").update(body).digest("hex");
|
|
256215
256234
|
if (actual !== expected) {
|
|
256216
256235
|
throw new Error(
|
|
256217
|
-
`Checksum mismatch for ${asset} ${
|
|
256236
|
+
`Checksum mismatch for ${asset} ${version3} - the download was not used.`
|
|
256218
256237
|
);
|
|
256219
256238
|
}
|
|
256220
256239
|
await (0, import_promises.mkdir)(dir, { recursive: true });
|
|
@@ -256222,7 +256241,7 @@ async function ensureTalosctl(version2) {
|
|
|
256222
256241
|
await (0, import_promises.writeFile)(partial2, body, { mode: 493 });
|
|
256223
256242
|
await (0, import_promises.chmod)(partial2, 493);
|
|
256224
256243
|
await (0, import_promises.rename)(partial2, binary);
|
|
256225
|
-
Logger.info(`talosctl ${
|
|
256244
|
+
Logger.info(`talosctl ${version3} saved to ${binary}`);
|
|
256226
256245
|
return binary;
|
|
256227
256246
|
}
|
|
256228
256247
|
var import_child_process2, import_crypto, import_fs4, import_promises, import_path2, RELEASES, VERSION_RE, clientVersionOf, runBinary;
|
|
@@ -256301,8 +256320,8 @@ var init_attach2 = __esm({
|
|
|
256301
256320
|
);
|
|
256302
256321
|
}
|
|
256303
256322
|
Logger.info(`Looking for the Talos installer at ${opts.nodeIp}:50000 ...`);
|
|
256304
|
-
let
|
|
256305
|
-
for (let i2 = 0; i2 < 12 && !
|
|
256323
|
+
let version3;
|
|
256324
|
+
for (let i2 = 0; i2 < 12 && !version3; i2++) {
|
|
256306
256325
|
const probe = await talosctl([
|
|
256307
256326
|
"-n",
|
|
256308
256327
|
opts.nodeIp,
|
|
@@ -256312,15 +256331,15 @@ var init_attach2 = __esm({
|
|
|
256312
256331
|
"-o",
|
|
256313
256332
|
"yaml"
|
|
256314
256333
|
]);
|
|
256315
|
-
|
|
256316
|
-
if (!
|
|
256334
|
+
version3 = probe.code === 0 ? serverTalosVersion(probe.stdout) : void 0;
|
|
256335
|
+
if (!version3) await sleep3(5e3);
|
|
256317
256336
|
}
|
|
256318
|
-
if (!
|
|
256337
|
+
if (!version3) {
|
|
256319
256338
|
throw new Error(
|
|
256320
256339
|
`No Talos installer answers at ${opts.nodeIp}:50000. Boot the machine from the Talos ${info.talosVersion ?? ""} ISO (${info.isoUrl ?? "https://github.com/siderolabs/talos/releases"}; ARM: ${info.isoUrlArm64 ?? "-"}) and run this from the same network.`
|
|
256321
256340
|
);
|
|
256322
256341
|
}
|
|
256323
|
-
Logger.info(`Machine runs the Talos ${
|
|
256342
|
+
Logger.info(`Machine runs the Talos ${version3} installer. Its disks:`);
|
|
256324
256343
|
const disks = await talosctl([
|
|
256325
256344
|
"-n",
|
|
256326
256345
|
opts.nodeIp,
|
|
@@ -256353,9 +256372,9 @@ var init_attach2 = __esm({
|
|
|
256353
256372
|
storage: opts.storage
|
|
256354
256373
|
})
|
|
256355
256374
|
);
|
|
256356
|
-
if (join_.talosVersion && join_.talosVersion !==
|
|
256375
|
+
if (join_.talosVersion && join_.talosVersion !== version3) {
|
|
256357
256376
|
Logger.warn(
|
|
256358
|
-
`The cluster runs Talos ${join_.talosVersion}, the machine booted ${
|
|
256377
|
+
`The cluster runs Talos ${join_.talosVersion}, the machine booted ${version3}. It installs ${join_.talosVersion} anyway; if the join fails, boot ${join_.isoUrl}.`
|
|
256359
256378
|
);
|
|
256360
256379
|
}
|
|
256361
256380
|
const dir = await (0, import_promises2.mkdtemp)((0, import_path3.join)((0, import_os3.tmpdir)(), "gcli-attach-"));
|
|
@@ -267732,9 +267751,9 @@ var require_form_data = __commonJS({
|
|
|
267732
267751
|
// ../../node_modules/stream-to/index.js
|
|
267733
267752
|
var require_stream_to = __commonJS({
|
|
267734
267753
|
"../../node_modules/stream-to/index.js"(exports2) {
|
|
267735
|
-
exports2.array =
|
|
267754
|
+
exports2.array = toArray3;
|
|
267736
267755
|
exports2.buffer = toBuffer;
|
|
267737
|
-
function
|
|
267756
|
+
function toArray3(stream, callback) {
|
|
267738
267757
|
var arr = [];
|
|
267739
267758
|
stream.on("data", onData);
|
|
267740
267759
|
stream.once("end", onEnd);
|
|
@@ -267759,7 +267778,7 @@ var require_stream_to = __commonJS({
|
|
|
267759
267778
|
return stream;
|
|
267760
267779
|
}
|
|
267761
267780
|
function toBuffer(stream, callback) {
|
|
267762
|
-
|
|
267781
|
+
toArray3(stream, function(err, arr) {
|
|
267763
267782
|
if (err || !arr)
|
|
267764
267783
|
callback(err);
|
|
267765
267784
|
else
|
|
@@ -269088,10 +269107,10 @@ var require_async3 = __commonJS({
|
|
|
269088
269107
|
return eachOfImplementation(coll, wrapAsync(iteratee), callback);
|
|
269089
269108
|
}
|
|
269090
269109
|
var eachOf$1 = awaitify(eachOf, 3);
|
|
269091
|
-
function
|
|
269110
|
+
function map32(coll, iteratee, callback) {
|
|
269092
269111
|
return _asyncMap(eachOf$1, coll, iteratee, callback);
|
|
269093
269112
|
}
|
|
269094
|
-
var map$1 = awaitify(
|
|
269113
|
+
var map$1 = awaitify(map32, 3);
|
|
269095
269114
|
var applyEach$1 = applyEach(map$1);
|
|
269096
269115
|
function eachOfSeries(coll, iteratee, callback) {
|
|
269097
269116
|
return eachOfLimit$2(coll, 1, iteratee, callback);
|
|
@@ -269669,10 +269688,10 @@ var require_async3 = __commonJS({
|
|
|
269669
269688
|
});
|
|
269670
269689
|
}
|
|
269671
269690
|
var concatLimit$1 = awaitify(concatLimit, 4);
|
|
269672
|
-
function
|
|
269691
|
+
function concat3(coll, iteratee, callback) {
|
|
269673
269692
|
return concatLimit$1(coll, Infinity, iteratee, callback);
|
|
269674
269693
|
}
|
|
269675
|
-
var concat$1 = awaitify(
|
|
269694
|
+
var concat$1 = awaitify(concat3, 3);
|
|
269676
269695
|
function concatSeries(coll, iteratee, callback) {
|
|
269677
269696
|
return concatLimit$1(coll, 1, iteratee, callback);
|
|
269678
269697
|
}
|
|
@@ -271560,7 +271579,7 @@ var require_BufferList2 = __commonJS({
|
|
|
271560
271579
|
}
|
|
271561
271580
|
return ret;
|
|
271562
271581
|
};
|
|
271563
|
-
BufferList.prototype.concat = function
|
|
271582
|
+
BufferList.prototype.concat = function concat3(n) {
|
|
271564
271583
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
271565
271584
|
if (this.length === 1) return this.head.data;
|
|
271566
271585
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
@@ -273901,8 +273920,8 @@ var require_lodash3 = __commonJS({
|
|
|
273901
273920
|
return apply(func, this, otherArgs);
|
|
273902
273921
|
};
|
|
273903
273922
|
}
|
|
273904
|
-
function getMapData(
|
|
273905
|
-
var data =
|
|
273923
|
+
function getMapData(map32, key) {
|
|
273924
|
+
var data = map32.__data__;
|
|
273906
273925
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
273907
273926
|
}
|
|
273908
273927
|
function getNative(object3, key) {
|
|
@@ -274306,8 +274325,8 @@ var require_lodash4 = __commonJS({
|
|
|
274306
274325
|
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop3 : function(values) {
|
|
274307
274326
|
return new Set2(values);
|
|
274308
274327
|
};
|
|
274309
|
-
function getMapData(
|
|
274310
|
-
var data =
|
|
274328
|
+
function getMapData(map32, key) {
|
|
274329
|
+
var data = map32.__data__;
|
|
274311
274330
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
274312
274331
|
}
|
|
274313
274332
|
function getNative(object3, key) {
|
|
@@ -274629,8 +274648,8 @@ var require_fs = __commonJS({
|
|
|
274629
274648
|
var fs3 = require("fs");
|
|
274630
274649
|
var origRealpath = fs3.realpath;
|
|
274631
274650
|
var origRealpathSync = fs3.realpathSync;
|
|
274632
|
-
var
|
|
274633
|
-
var ok = /^v[0-5]\./.test(
|
|
274651
|
+
var version3 = process.version;
|
|
274652
|
+
var ok = /^v[0-5]\./.test(version3);
|
|
274634
274653
|
var old = require_old();
|
|
274635
274654
|
function newError(er) {
|
|
274636
274655
|
return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
|
|
@@ -276362,7 +276381,7 @@ var require_buffer_list3 = __commonJS({
|
|
|
276362
276381
|
}
|
|
276363
276382
|
}, {
|
|
276364
276383
|
key: "concat",
|
|
276365
|
-
value: function
|
|
276384
|
+
value: function concat3(n) {
|
|
276366
276385
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
276367
276386
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
276368
276387
|
var p = this.head;
|
|
@@ -279704,7 +279723,7 @@ var require_buffer_list4 = __commonJS({
|
|
|
279704
279723
|
}
|
|
279705
279724
|
}, {
|
|
279706
279725
|
key: "concat",
|
|
279707
|
-
value: function
|
|
279726
|
+
value: function concat3(n) {
|
|
279708
279727
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
279709
279728
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
279710
279729
|
var p = this.head;
|
|
@@ -282476,7 +282495,7 @@ var require_buffer_list5 = __commonJS({
|
|
|
282476
282495
|
}
|
|
282477
282496
|
}, {
|
|
282478
282497
|
key: "concat",
|
|
282479
|
-
value: function
|
|
282498
|
+
value: function concat3(n) {
|
|
282480
282499
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
282481
282500
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
282482
282501
|
var p = this.head;
|
|
@@ -285713,7 +285732,7 @@ var require_buffer_list6 = __commonJS({
|
|
|
285713
285732
|
}
|
|
285714
285733
|
}, {
|
|
285715
285734
|
key: "concat",
|
|
285716
|
-
value: function
|
|
285735
|
+
value: function concat3(n) {
|
|
285717
285736
|
if (this.length === 0) return Buffer4.alloc(0);
|
|
285718
285737
|
var ret = Buffer4.allocUnsafe(n >>> 0);
|
|
285719
285738
|
var p = this.head;
|
|
@@ -289913,8 +289932,8 @@ var init_parseUtil = __esm({
|
|
|
289913
289932
|
}
|
|
289914
289933
|
let errorMessage = "";
|
|
289915
289934
|
const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
|
|
289916
|
-
for (const
|
|
289917
|
-
errorMessage =
|
|
289935
|
+
for (const map32 of maps) {
|
|
289936
|
+
errorMessage = map32(fullIssue, { data, defaultError: errorMessage }).message;
|
|
289918
289937
|
}
|
|
289919
289938
|
return {
|
|
289920
289939
|
...issueData,
|
|
@@ -290051,11 +290070,11 @@ function datetimeRegex(args) {
|
|
|
290051
290070
|
regex = `${regex}(${opts.join("|")})`;
|
|
290052
290071
|
return new RegExp(`^${regex}$`);
|
|
290053
290072
|
}
|
|
290054
|
-
function isValidIP(ip,
|
|
290055
|
-
if ((
|
|
290073
|
+
function isValidIP(ip, version3) {
|
|
290074
|
+
if ((version3 === "v4" || !version3) && ipv4Regex.test(ip)) {
|
|
290056
290075
|
return true;
|
|
290057
290076
|
}
|
|
290058
|
-
if ((
|
|
290077
|
+
if ((version3 === "v6" || !version3) && ipv6Regex.test(ip)) {
|
|
290059
290078
|
return true;
|
|
290060
290079
|
}
|
|
290061
290080
|
return false;
|
|
@@ -290082,11 +290101,11 @@ function isValidJWT(jwt2, alg) {
|
|
|
290082
290101
|
return false;
|
|
290083
290102
|
}
|
|
290084
290103
|
}
|
|
290085
|
-
function isValidCidr(ip,
|
|
290086
|
-
if ((
|
|
290104
|
+
function isValidCidr(ip, version3) {
|
|
290105
|
+
if ((version3 === "v4" || !version3) && ipv4CidrRegex.test(ip)) {
|
|
290087
290106
|
return true;
|
|
290088
290107
|
}
|
|
290089
|
-
if ((
|
|
290108
|
+
if ((version3 === "v6" || !version3) && ipv6CidrRegex.test(ip)) {
|
|
290090
290109
|
return true;
|
|
290091
290110
|
}
|
|
290092
290111
|
return false;
|
|
@@ -294541,10 +294560,10 @@ var init_regexes = __esm({
|
|
|
294541
294560
|
duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
294542
294561
|
extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
294543
294562
|
guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
294544
|
-
uuid = (
|
|
294545
|
-
if (!
|
|
294563
|
+
uuid = (version3) => {
|
|
294564
|
+
if (!version3)
|
|
294546
294565
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
294547
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${
|
|
294566
|
+
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version3}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
294548
294567
|
};
|
|
294549
294568
|
uuid4 = /* @__PURE__ */ uuid(4);
|
|
294550
294569
|
uuid6 = /* @__PURE__ */ uuid(6);
|
|
@@ -296436,19 +296455,19 @@ var init_schemas = __esm({
|
|
|
296436
296455
|
});
|
|
296437
296456
|
const disc = cached(() => {
|
|
296438
296457
|
const opts = def.options;
|
|
296439
|
-
const
|
|
296458
|
+
const map32 = /* @__PURE__ */ new Map();
|
|
296440
296459
|
for (const o of opts) {
|
|
296441
296460
|
const values = o._zod.propValues?.[def.discriminator];
|
|
296442
296461
|
if (!values || values.size === 0)
|
|
296443
296462
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
296444
296463
|
for (const v of values) {
|
|
296445
|
-
if (
|
|
296464
|
+
if (map32.has(v)) {
|
|
296446
296465
|
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
296447
296466
|
}
|
|
296448
|
-
|
|
296467
|
+
map32.set(v, o);
|
|
296449
296468
|
}
|
|
296450
296469
|
}
|
|
296451
|
-
return
|
|
296470
|
+
return map32;
|
|
296452
296471
|
});
|
|
296453
296472
|
inst._zod.parse = (payload, ctx) => {
|
|
296454
296473
|
const input = payload.value;
|
|
@@ -307069,9 +307088,9 @@ var init_schemas3 = __esm({
|
|
|
307069
307088
|
});
|
|
307070
307089
|
|
|
307071
307090
|
// ../../node_modules/zod/v4/classic/compat.js
|
|
307072
|
-
function setErrorMap(
|
|
307091
|
+
function setErrorMap(map32) {
|
|
307073
307092
|
config({
|
|
307074
|
-
customError:
|
|
307093
|
+
customError: map32
|
|
307075
307094
|
});
|
|
307076
307095
|
}
|
|
307077
307096
|
function getErrorMap2() {
|
|
@@ -307485,10 +307504,10 @@ function fromJSONSchema(schema, params) {
|
|
|
307485
307504
|
if (typeof schema === "boolean") {
|
|
307486
307505
|
return schema ? z.any() : z.never();
|
|
307487
307506
|
}
|
|
307488
|
-
const
|
|
307507
|
+
const version3 = detectVersion(schema, params?.defaultTarget);
|
|
307489
307508
|
const defs = schema.$defs || schema.definitions || {};
|
|
307490
307509
|
const ctx = {
|
|
307491
|
-
version:
|
|
307510
|
+
version: version3,
|
|
307492
307511
|
defs,
|
|
307493
307512
|
refs: /* @__PURE__ */ new Map(),
|
|
307494
307513
|
processing: /* @__PURE__ */ new Set(),
|
|
@@ -319696,8 +319715,8 @@ var init_streamableHttp = __esm({
|
|
|
319696
319715
|
throw error48;
|
|
319697
319716
|
}
|
|
319698
319717
|
}
|
|
319699
|
-
setProtocolVersion(
|
|
319700
|
-
this._protocolVersion =
|
|
319718
|
+
setProtocolVersion(version3) {
|
|
319719
|
+
this._protocolVersion = version3;
|
|
319701
319720
|
}
|
|
319702
319721
|
get protocolVersion() {
|
|
319703
319722
|
return this._protocolVersion;
|
|
@@ -320687,25 +320706,143 @@ var init_list5 = __esm({
|
|
|
320687
320706
|
}
|
|
320688
320707
|
});
|
|
320689
320708
|
|
|
320709
|
+
// src/commands/rabbitmq/resolve-broker.ts
|
|
320710
|
+
var resolveBroker, queuesToDeclare;
|
|
320711
|
+
var init_resolve_broker = __esm({
|
|
320712
|
+
"src/commands/rabbitmq/resolve-broker.ts"() {
|
|
320713
|
+
resolveBroker = (brokers, wanted) => {
|
|
320714
|
+
const all = brokers ?? [];
|
|
320715
|
+
if (!all.length) {
|
|
320716
|
+
throw new Error(
|
|
320717
|
+
"no-broker: this project has no RabbitMQ broker (see rabbitmq:create)"
|
|
320718
|
+
);
|
|
320719
|
+
}
|
|
320720
|
+
if (!wanted) {
|
|
320721
|
+
if (all.length > 1) {
|
|
320722
|
+
throw new Error(
|
|
320723
|
+
`broker-needed: the project has ${all.length} brokers (${all.map((b) => b.name).join(
|
|
320724
|
+
", "
|
|
320725
|
+
)}) - name one with --broker or \`broker:\` in lambforge.yaml`
|
|
320726
|
+
);
|
|
320727
|
+
}
|
|
320728
|
+
return all[0];
|
|
320729
|
+
}
|
|
320730
|
+
const matches = all.filter((b) => b.id === wanted || b.name === wanted);
|
|
320731
|
+
if (!matches.length) {
|
|
320732
|
+
throw new Error(
|
|
320733
|
+
`broker-not-found: no broker "${wanted}" (see rabbitmq:list)`
|
|
320734
|
+
);
|
|
320735
|
+
}
|
|
320736
|
+
if (matches.length > 1) {
|
|
320737
|
+
throw new Error(
|
|
320738
|
+
`broker-ambiguous: ${matches.length} brokers are named "${wanted}" - use the id (see rabbitmq:list)`
|
|
320739
|
+
);
|
|
320740
|
+
}
|
|
320741
|
+
return matches[0];
|
|
320742
|
+
};
|
|
320743
|
+
queuesToDeclare = (broker, names) => {
|
|
320744
|
+
const existing = new Set((broker.queues ?? []).map((q) => q?.name));
|
|
320745
|
+
return [...new Set(names)].filter((name2) => !existing.has(name2));
|
|
320746
|
+
};
|
|
320747
|
+
}
|
|
320748
|
+
});
|
|
320749
|
+
|
|
320750
|
+
// src/commands/rabbitmq/declare-queue.ts
|
|
320751
|
+
var declare_queue_exports = {};
|
|
320752
|
+
__export(declare_queue_exports, {
|
|
320753
|
+
default: () => declare_queue_default
|
|
320754
|
+
});
|
|
320755
|
+
var import_rxjs51, import_operators34, declare_queue_default;
|
|
320756
|
+
var init_declare_queue = __esm({
|
|
320757
|
+
"src/commands/rabbitmq/declare-queue.ts"() {
|
|
320758
|
+
import_rxjs51 = __toESM(require_cjs());
|
|
320759
|
+
import_operators34 = __toESM(require_operators());
|
|
320760
|
+
init_load_spec();
|
|
320761
|
+
init_helpers();
|
|
320762
|
+
init_gql_client();
|
|
320763
|
+
init_log();
|
|
320764
|
+
init_resolve_broker();
|
|
320765
|
+
declare_queue_default = (cmd) => (0, import_rxjs51.lastValueFrom)(
|
|
320766
|
+
parseProjectId(cmd.project).pipe(
|
|
320767
|
+
(0, import_operators34.switchMap)(
|
|
320768
|
+
(projectId) => (cmd.name?.length ? (0, import_rxjs51.of)({ names: cmd.name, broker: cmd.broker }) : loadSpec(cmd.spec).pipe(
|
|
320769
|
+
(0, import_operators34.map)((data) => ({
|
|
320770
|
+
names: data?.queues?.declare ?? [],
|
|
320771
|
+
broker: cmd.broker ?? data?.queues?.broker
|
|
320772
|
+
})),
|
|
320773
|
+
(0, import_operators34.catchError)(
|
|
320774
|
+
() => (0, import_rxjs51.of)({ names: [], broker: cmd.broker })
|
|
320775
|
+
)
|
|
320776
|
+
)).pipe(
|
|
320777
|
+
(0, import_operators34.switchMap)(({ names, broker }) => {
|
|
320778
|
+
if (!names.length) {
|
|
320779
|
+
throw new Error(
|
|
320780
|
+
"queue:declare needs --name (repeatable) or queues.declare in lambforge.yaml"
|
|
320781
|
+
);
|
|
320782
|
+
}
|
|
320783
|
+
return GraphqlClienAPI.listRabbitMqInstances(projectId).pipe(
|
|
320784
|
+
(0, import_operators34.map)((brokers) => resolveBroker(brokers, broker)),
|
|
320785
|
+
(0, import_operators34.switchMap)((target) => {
|
|
320786
|
+
const missing = queuesToDeclare(target, names);
|
|
320787
|
+
const skipped = names.filter((n) => !missing.includes(n));
|
|
320788
|
+
return (0, import_rxjs51.concat)(
|
|
320789
|
+
...missing.map(
|
|
320790
|
+
(name2) => GraphqlClienAPI.declareQueue(target.id, projectId, {
|
|
320791
|
+
name: name2,
|
|
320792
|
+
durable: true,
|
|
320793
|
+
auto_delete: false
|
|
320794
|
+
})
|
|
320795
|
+
)
|
|
320796
|
+
).pipe(
|
|
320797
|
+
(0, import_operators34.toArray)(),
|
|
320798
|
+
(0, import_operators34.map)(() => ({ broker: target.name, missing, skipped }))
|
|
320799
|
+
);
|
|
320800
|
+
})
|
|
320801
|
+
);
|
|
320802
|
+
})
|
|
320803
|
+
)
|
|
320804
|
+
),
|
|
320805
|
+
(0, import_operators34.tap)(({ broker, missing, skipped }) => {
|
|
320806
|
+
Logger.log("-------------------");
|
|
320807
|
+
Logger.log("[Action][declareQueue]");
|
|
320808
|
+
Logger.table([
|
|
320809
|
+
...missing.map((name2) => ({
|
|
320810
|
+
broker,
|
|
320811
|
+
queue: name2,
|
|
320812
|
+
result: "declared"
|
|
320813
|
+
})),
|
|
320814
|
+
...[...new Set(skipped)].map((name2) => ({
|
|
320815
|
+
broker,
|
|
320816
|
+
queue: name2,
|
|
320817
|
+
result: "exists"
|
|
320818
|
+
}))
|
|
320819
|
+
]);
|
|
320820
|
+
Logger.log("-------------------");
|
|
320821
|
+
})
|
|
320822
|
+
)
|
|
320823
|
+
);
|
|
320824
|
+
}
|
|
320825
|
+
});
|
|
320826
|
+
|
|
320690
320827
|
// src/commands/rabbitmq/delete.ts
|
|
320691
320828
|
var delete_exports2 = {};
|
|
320692
320829
|
__export(delete_exports2, {
|
|
320693
320830
|
default: () => delete_default2
|
|
320694
320831
|
});
|
|
320695
|
-
var
|
|
320832
|
+
var import_rxjs52, import_operators35, delete_default2;
|
|
320696
320833
|
var init_delete2 = __esm({
|
|
320697
320834
|
"src/commands/rabbitmq/delete.ts"() {
|
|
320698
|
-
|
|
320699
|
-
|
|
320835
|
+
import_rxjs52 = __toESM(require_cjs());
|
|
320836
|
+
import_operators35 = __toESM(require_operators());
|
|
320700
320837
|
init_helpers();
|
|
320701
320838
|
init_gql_client();
|
|
320702
320839
|
init_log();
|
|
320703
|
-
delete_default2 = (cmd) => (0,
|
|
320840
|
+
delete_default2 = (cmd) => (0, import_rxjs52.lastValueFrom)(
|
|
320704
320841
|
parseProjectId(cmd.project).pipe(
|
|
320705
|
-
(0,
|
|
320842
|
+
(0, import_operators35.switchMap)(
|
|
320706
320843
|
(projectId) => GraphqlClienAPI.uninstallRabbitMq(cmd.id, projectId)
|
|
320707
320844
|
),
|
|
320708
|
-
(0,
|
|
320845
|
+
(0, import_operators35.tap)((broker) => {
|
|
320709
320846
|
Logger.log("-------------------");
|
|
320710
320847
|
Logger.log("[Action][uninstallRabbitMq]");
|
|
320711
320848
|
Logger.table([broker]);
|
|
@@ -321765,11 +321902,11 @@ __export(start_exports2, {
|
|
|
321765
321902
|
default: () => start_default,
|
|
321766
321903
|
resolveRunner: () => resolveRunner
|
|
321767
321904
|
});
|
|
321768
|
-
var import_os6,
|
|
321905
|
+
var import_os6, import_rxjs53, RUNNER_VERSION, resolveRunner, start_default;
|
|
321769
321906
|
var init_start2 = __esm({
|
|
321770
321907
|
"src/commands/runner/start.ts"() {
|
|
321771
321908
|
import_os6 = require("os");
|
|
321772
|
-
|
|
321909
|
+
import_rxjs53 = __toESM(require_cjs());
|
|
321773
321910
|
init_gql_client();
|
|
321774
321911
|
init_log();
|
|
321775
321912
|
init_spec();
|
|
@@ -321790,7 +321927,7 @@ var init_start2 = __esm({
|
|
|
321790
321927
|
}
|
|
321791
321928
|
const name2 = cmd.name || (0, import_os6.hostname)();
|
|
321792
321929
|
Logger.info(`Registering this machine as local runner "${name2}"...`);
|
|
321793
|
-
const { runner, token } = await (0,
|
|
321930
|
+
const { runner, token } = await (0, import_rxjs53.lastValueFrom)(
|
|
321794
321931
|
GraphqlClienAPI.createLocalRunner(name2)
|
|
321795
321932
|
).catch((e2) => {
|
|
321796
321933
|
throw new Error(
|
|
@@ -321994,16 +322131,16 @@ var list_exports6 = {};
|
|
|
321994
322131
|
__export(list_exports6, {
|
|
321995
322132
|
default: () => list_default6
|
|
321996
322133
|
});
|
|
321997
|
-
var
|
|
322134
|
+
var import_rxjs54, import_operators36, list_default6;
|
|
321998
322135
|
var init_list6 = __esm({
|
|
321999
322136
|
"src/commands/runner/list.ts"() {
|
|
322000
|
-
|
|
322001
|
-
|
|
322137
|
+
import_rxjs54 = __toESM(require_cjs());
|
|
322138
|
+
import_operators36 = __toESM(require_operators());
|
|
322002
322139
|
init_gql_client();
|
|
322003
322140
|
init_log();
|
|
322004
|
-
list_default6 = () => (0,
|
|
322141
|
+
list_default6 = () => (0, import_rxjs54.lastValueFrom)(
|
|
322005
322142
|
GraphqlClienAPI.listLocalRunners().pipe(
|
|
322006
|
-
(0,
|
|
322143
|
+
(0, import_operators36.tap)((runners) => {
|
|
322007
322144
|
Logger.log("-------------------");
|
|
322008
322145
|
Logger.log("[Action][listLocalRunners]");
|
|
322009
322146
|
if (!runners?.length) {
|
|
@@ -322034,10 +322171,10 @@ __export(models_exports, {
|
|
|
322034
322171
|
default: () => models_default,
|
|
322035
322172
|
parseSelection: () => parseSelection
|
|
322036
322173
|
});
|
|
322037
|
-
var
|
|
322174
|
+
var import_rxjs55, isShown, parseSelection, models_default;
|
|
322038
322175
|
var init_models = __esm({
|
|
322039
322176
|
"src/commands/runner/models.ts"() {
|
|
322040
|
-
|
|
322177
|
+
import_rxjs55 = __toESM(require_cjs());
|
|
322041
322178
|
init_gql_client();
|
|
322042
322179
|
init_log();
|
|
322043
322180
|
init_config();
|
|
@@ -322067,11 +322204,11 @@ var init_models = __esm({
|
|
|
322067
322204
|
}
|
|
322068
322205
|
let runner;
|
|
322069
322206
|
if (selection) {
|
|
322070
|
-
runner = await (0,
|
|
322207
|
+
runner = await (0, import_rxjs55.lastValueFrom)(
|
|
322071
322208
|
GraphqlClienAPI.setLocalRunnerModels(runnerId, selection.models)
|
|
322072
322209
|
);
|
|
322073
322210
|
} else {
|
|
322074
|
-
const runners = await (0,
|
|
322211
|
+
const runners = await (0, import_rxjs55.lastValueFrom)(GraphqlClienAPI.listLocalRunners());
|
|
322075
322212
|
runner = runners.find((r2) => r2.id === runnerId);
|
|
322076
322213
|
}
|
|
322077
322214
|
if (!runner) {
|
|
@@ -322106,10 +322243,10 @@ var delete_exports3 = {};
|
|
|
322106
322243
|
__export(delete_exports3, {
|
|
322107
322244
|
default: () => delete_default3
|
|
322108
322245
|
});
|
|
322109
|
-
var
|
|
322246
|
+
var import_rxjs56, delete_default3;
|
|
322110
322247
|
var init_delete3 = __esm({
|
|
322111
322248
|
"src/commands/runner/delete.ts"() {
|
|
322112
|
-
|
|
322249
|
+
import_rxjs56 = __toESM(require_cjs());
|
|
322113
322250
|
init_gql_client();
|
|
322114
322251
|
init_log();
|
|
322115
322252
|
init_config();
|
|
@@ -322119,7 +322256,7 @@ var init_delete3 = __esm({
|
|
|
322119
322256
|
if (!runnerId) {
|
|
322120
322257
|
throw new Error("Specify the runner with --id (see `gcli runner:list`).");
|
|
322121
322258
|
}
|
|
322122
|
-
await (0,
|
|
322259
|
+
await (0, import_rxjs56.lastValueFrom)(GraphqlClienAPI.deleteLocalRunner(runnerId));
|
|
322123
322260
|
if (saved?.id === runnerId) {
|
|
322124
322261
|
await forgetRunner();
|
|
322125
322262
|
}
|
|
@@ -322135,10 +322272,10 @@ __export(start_exports3, {
|
|
|
322135
322272
|
});
|
|
322136
322273
|
async function start2(args) {
|
|
322137
322274
|
Logger.log("---------------------------------");
|
|
322138
|
-
return (0,
|
|
322275
|
+
return (0, import_rxjs57.lastValueFrom)(
|
|
322139
322276
|
loadSpec().pipe(
|
|
322140
|
-
(0,
|
|
322141
|
-
(config2) => (0,
|
|
322277
|
+
(0, import_operators37.switchMap)(
|
|
322278
|
+
(config2) => (0, import_rxjs57.of)({
|
|
322142
322279
|
watcher: (0, import_node_fs2.watch)(process.cwd(), {
|
|
322143
322280
|
recursive: true
|
|
322144
322281
|
}),
|
|
@@ -322159,7 +322296,7 @@ async function start2(args) {
|
|
|
322159
322296
|
outfile: args.outfile ?? config2?.options?.bundler?.outfile ?? "index.js",
|
|
322160
322297
|
startCommand: "node"
|
|
322161
322298
|
}).pipe(
|
|
322162
|
-
(0,
|
|
322299
|
+
(0, import_operators37.switchMap)(
|
|
322163
322300
|
({
|
|
322164
322301
|
child,
|
|
322165
322302
|
watcher,
|
|
@@ -322167,14 +322304,14 @@ async function start2(args) {
|
|
|
322167
322304
|
outfile,
|
|
322168
322305
|
startCommand,
|
|
322169
322306
|
ignorelist
|
|
322170
|
-
}) => (0,
|
|
322171
|
-
(0,
|
|
322307
|
+
}) => (0, import_rxjs57.from)(build_default(args)).pipe(
|
|
322308
|
+
(0, import_operators37.tap)(() => {
|
|
322172
322309
|
Logger.warn(
|
|
322173
322310
|
`\u{1F4E2} Starting script "${startCommand} ${outfile}"`
|
|
322174
322311
|
);
|
|
322175
322312
|
Logger.log("---------------------------------\n");
|
|
322176
322313
|
}),
|
|
322177
|
-
(0,
|
|
322314
|
+
(0, import_operators37.tap)(() => {
|
|
322178
322315
|
child = (0, import_node_child_process.spawn)(
|
|
322179
322316
|
startCommand,
|
|
322180
322317
|
["--disable-warning=DEP0040", outfile],
|
|
@@ -322184,14 +322321,14 @@ async function start2(args) {
|
|
|
322184
322321
|
}
|
|
322185
322322
|
);
|
|
322186
322323
|
}),
|
|
322187
|
-
(0,
|
|
322188
|
-
() => (0,
|
|
322189
|
-
(0,
|
|
322190
|
-
(0,
|
|
322191
|
-
(0,
|
|
322324
|
+
(0, import_operators37.tap)(
|
|
322325
|
+
() => (0, import_rxjs57.merge)(
|
|
322326
|
+
(0, import_rxjs57.fromEvent)(process, "SIGINT"),
|
|
322327
|
+
(0, import_rxjs57.fromEvent)(process, "SIGTERM"),
|
|
322328
|
+
(0, import_rxjs57.fromEvent)(process, "exit")
|
|
322192
322329
|
).pipe(
|
|
322193
|
-
(0,
|
|
322194
|
-
(0,
|
|
322330
|
+
(0, import_operators37.debounceTime)(100),
|
|
322331
|
+
(0, import_operators37.tap)(() => {
|
|
322195
322332
|
Logger.warn("\u26A0\uFE0F Main process shutting down");
|
|
322196
322333
|
watcher.close();
|
|
322197
322334
|
child.kill("SIGTERM");
|
|
@@ -322199,13 +322336,13 @@ async function start2(args) {
|
|
|
322199
322336
|
})
|
|
322200
322337
|
).subscribe()
|
|
322201
322338
|
),
|
|
322202
|
-
(0,
|
|
322203
|
-
() => (0,
|
|
322204
|
-
(0,
|
|
322339
|
+
(0, import_operators37.switchMap)(
|
|
322340
|
+
() => (0, import_rxjs57.fromEvent)(watcher, "change").pipe(
|
|
322341
|
+
(0, import_operators37.map)(([event, filename]) => ({
|
|
322205
322342
|
event,
|
|
322206
322343
|
filename
|
|
322207
322344
|
})),
|
|
322208
|
-
(0,
|
|
322345
|
+
(0, import_operators37.filter)(({ filename }) => {
|
|
322209
322346
|
if (!filename) {
|
|
322210
322347
|
return false;
|
|
322211
322348
|
}
|
|
@@ -322217,18 +322354,18 @@ async function start2(args) {
|
|
|
322217
322354
|
const rootDir = filename.split(/[/\\]/)[0];
|
|
322218
322355
|
return whitelist.has(rootDir);
|
|
322219
322356
|
}),
|
|
322220
|
-
(0,
|
|
322357
|
+
(0, import_operators37.debounceTime)(100)
|
|
322221
322358
|
)
|
|
322222
322359
|
),
|
|
322223
|
-
(0,
|
|
322360
|
+
(0, import_operators37.tap)((data) => {
|
|
322224
322361
|
Logger.log("\n---------------------------------");
|
|
322225
322362
|
Logger.log(
|
|
322226
322363
|
`\u27F3 Restarting due to change in: ${data.filename}`
|
|
322227
322364
|
);
|
|
322228
322365
|
child?.kill("SIGTERM");
|
|
322229
322366
|
}),
|
|
322230
|
-
(0,
|
|
322231
|
-
(0,
|
|
322367
|
+
(0, import_operators37.switchMap)(() => build_default(args)),
|
|
322368
|
+
(0, import_operators37.tap)(() => {
|
|
322232
322369
|
Logger.warn(
|
|
322233
322370
|
`\u{1F4E2} Starting script "${startCommand} ${outfile}"`
|
|
322234
322371
|
);
|
|
@@ -322249,13 +322386,13 @@ async function start2(args) {
|
|
|
322249
322386
|
)
|
|
322250
322387
|
);
|
|
322251
322388
|
}
|
|
322252
|
-
var import_node_child_process, import_node_fs2,
|
|
322389
|
+
var import_node_child_process, import_node_fs2, import_rxjs57, import_operators37;
|
|
322253
322390
|
var init_start3 = __esm({
|
|
322254
322391
|
"src/commands/start/start.ts"() {
|
|
322255
322392
|
import_node_child_process = require("node:child_process");
|
|
322256
322393
|
import_node_fs2 = require("node:fs");
|
|
322257
|
-
|
|
322258
|
-
|
|
322394
|
+
import_rxjs57 = __toESM(require_cjs());
|
|
322395
|
+
import_operators37 = __toESM(require_operators());
|
|
322259
322396
|
init_log();
|
|
322260
322397
|
init_build();
|
|
322261
322398
|
init_load_spec();
|
|
@@ -322267,25 +322404,25 @@ var create_cron_exports = {};
|
|
|
322267
322404
|
__export(create_cron_exports, {
|
|
322268
322405
|
default: () => create_cron_default
|
|
322269
322406
|
});
|
|
322270
|
-
var
|
|
322407
|
+
var import_rxjs58, import_operators38, create_cron_default;
|
|
322271
322408
|
var init_create_cron = __esm({
|
|
322272
322409
|
"src/commands/triggers/cron/create-cron.ts"() {
|
|
322273
|
-
|
|
322274
|
-
|
|
322410
|
+
import_rxjs58 = __toESM(require_cjs());
|
|
322411
|
+
import_operators38 = __toESM(require_operators());
|
|
322275
322412
|
init_helpers();
|
|
322276
322413
|
init_gql_client();
|
|
322277
322414
|
init_log();
|
|
322278
322415
|
init_load_spec();
|
|
322279
|
-
create_cron_default = (cmd) => (0,
|
|
322416
|
+
create_cron_default = (cmd) => (0, import_rxjs58.lastValueFrom)(
|
|
322280
322417
|
parseProjectId(cmd.project).pipe(
|
|
322281
|
-
(0,
|
|
322418
|
+
(0, import_operators38.switchMap)(
|
|
322282
322419
|
(projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
|
|
322283
|
-
(0,
|
|
322420
|
+
(0, import_operators38.switchMap)(
|
|
322284
322421
|
(data) => GraphqlClienAPI.getLambdaByName(
|
|
322285
322422
|
cmd?.lambdaName ?? data?.function?.name ?? data?.name,
|
|
322286
322423
|
projectId
|
|
322287
322424
|
).pipe(
|
|
322288
|
-
(0,
|
|
322425
|
+
(0, import_operators38.map)((lambda) => {
|
|
322289
322426
|
const fromSpec = data?.triggers?.time ?? data;
|
|
322290
322427
|
return {
|
|
322291
322428
|
lambdaName: lambda.name,
|
|
@@ -322298,8 +322435,8 @@ var init_create_cron = __esm({
|
|
|
322298
322435
|
)
|
|
322299
322436
|
)
|
|
322300
322437
|
),
|
|
322301
|
-
(0,
|
|
322302
|
-
({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0,
|
|
322438
|
+
(0, import_operators38.switchMap)(
|
|
322439
|
+
({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0, import_rxjs58.throwError)(
|
|
322303
322440
|
() => new Error(
|
|
322304
322441
|
"cron:create needs --cron and --triggerName (or triggers.time.cron / triggerName in lambforge.yaml)"
|
|
322305
322442
|
)
|
|
@@ -322307,9 +322444,9 @@ var init_create_cron = __esm({
|
|
|
322307
322444
|
lambdaId,
|
|
322308
322445
|
cron,
|
|
322309
322446
|
triggerName
|
|
322310
|
-
}).pipe((0,
|
|
322447
|
+
}).pipe((0, import_operators38.map)((data) => ({ ...data, lambdaName })))
|
|
322311
322448
|
),
|
|
322312
|
-
(0,
|
|
322449
|
+
(0, import_operators38.tap)((data) => {
|
|
322313
322450
|
const columns = [
|
|
322314
322451
|
"id",
|
|
322315
322452
|
"lambdaName",
|
|
@@ -322332,25 +322469,25 @@ var delete_cron_exports = {};
|
|
|
322332
322469
|
__export(delete_cron_exports, {
|
|
322333
322470
|
default: () => delete_cron_default
|
|
322334
322471
|
});
|
|
322335
|
-
var
|
|
322472
|
+
var import_rxjs59, import_operators39, delete_cron_default;
|
|
322336
322473
|
var init_delete_cron = __esm({
|
|
322337
322474
|
"src/commands/triggers/cron/delete-cron.ts"() {
|
|
322338
|
-
|
|
322339
|
-
|
|
322475
|
+
import_rxjs59 = __toESM(require_cjs());
|
|
322476
|
+
import_operators39 = __toESM(require_operators());
|
|
322340
322477
|
init_helpers();
|
|
322341
322478
|
init_gql_client();
|
|
322342
322479
|
init_log();
|
|
322343
322480
|
init_load_spec();
|
|
322344
|
-
delete_cron_default = (cmd) => (0,
|
|
322481
|
+
delete_cron_default = (cmd) => (0, import_rxjs59.lastValueFrom)(
|
|
322345
322482
|
parseProjectId(cmd.project).pipe(
|
|
322346
|
-
(0,
|
|
322483
|
+
(0, import_operators39.switchMap)(
|
|
322347
322484
|
(projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
|
|
322348
|
-
(0,
|
|
322485
|
+
(0, import_operators39.switchMap)(
|
|
322349
322486
|
(data) => GraphqlClienAPI.getLambdaByName(
|
|
322350
322487
|
cmd?.lambdaName ?? data?.function?.name ?? data?.name,
|
|
322351
322488
|
projectId
|
|
322352
322489
|
).pipe(
|
|
322353
|
-
(0,
|
|
322490
|
+
(0, import_operators39.map)((lambda) => ({
|
|
322354
322491
|
lambdaName: lambda.name,
|
|
322355
322492
|
lambdaId: lambda.id
|
|
322356
322493
|
}))
|
|
@@ -322358,12 +322495,12 @@ var init_delete_cron = __esm({
|
|
|
322358
322495
|
)
|
|
322359
322496
|
)
|
|
322360
322497
|
),
|
|
322361
|
-
(0,
|
|
322498
|
+
(0, import_operators39.switchMap)(
|
|
322362
322499
|
({ lambdaId, lambdaName }) => GraphqlClienAPI.deleteLambdaTimeTrigger(lambdaId).pipe(
|
|
322363
|
-
(0,
|
|
322500
|
+
(0, import_operators39.map)((data) => ({ ...data, lambdaName }))
|
|
322364
322501
|
)
|
|
322365
322502
|
),
|
|
322366
|
-
(0,
|
|
322503
|
+
(0, import_operators39.tap)((data) => {
|
|
322367
322504
|
const columns = [
|
|
322368
322505
|
"id",
|
|
322369
322506
|
"lambdaName",
|
|
@@ -322385,29 +322522,29 @@ var list_crons_exports = {};
|
|
|
322385
322522
|
__export(list_crons_exports, {
|
|
322386
322523
|
default: () => list_crons_default
|
|
322387
322524
|
});
|
|
322388
|
-
var
|
|
322525
|
+
var import_rxjs60, import_operators40, list_crons_default;
|
|
322389
322526
|
var init_list_crons = __esm({
|
|
322390
322527
|
"src/commands/triggers/cron/list-crons.ts"() {
|
|
322391
|
-
|
|
322392
|
-
|
|
322528
|
+
import_rxjs60 = __toESM(require_cjs());
|
|
322529
|
+
import_operators40 = __toESM(require_operators());
|
|
322393
322530
|
init_helpers();
|
|
322394
322531
|
init_gql_client();
|
|
322395
322532
|
init_log();
|
|
322396
|
-
list_crons_default = (cmd) => (0,
|
|
322533
|
+
list_crons_default = (cmd) => (0, import_rxjs60.lastValueFrom)(
|
|
322397
322534
|
parseProjectId(cmd.project).pipe(
|
|
322398
|
-
(0,
|
|
322399
|
-
(projectId) => (0,
|
|
322535
|
+
(0, import_operators40.switchMap)(
|
|
322536
|
+
(projectId) => (0, import_rxjs60.combineLatest)([
|
|
322400
322537
|
GraphqlClienAPI.listProjectTimeTriggers(projectId),
|
|
322401
322538
|
GraphqlClienAPI.listLambdas(projectId)
|
|
322402
322539
|
])
|
|
322403
322540
|
),
|
|
322404
|
-
(0,
|
|
322541
|
+
(0, import_operators40.map)(
|
|
322405
322542
|
([triggers, lambdas]) => triggers.map((v) => ({
|
|
322406
322543
|
lambdaName: lambdas.find((l) => l.id === v.lambdaId)?.name,
|
|
322407
322544
|
...v
|
|
322408
322545
|
}))
|
|
322409
322546
|
),
|
|
322410
|
-
(0,
|
|
322547
|
+
(0, import_operators40.tap)((data) => {
|
|
322411
322548
|
const columns = [
|
|
322412
322549
|
"id",
|
|
322413
322550
|
"triggerName",
|
|
@@ -322429,20 +322566,20 @@ var list_exports7 = {};
|
|
|
322429
322566
|
__export(list_exports7, {
|
|
322430
322567
|
default: () => list_default7
|
|
322431
322568
|
});
|
|
322432
|
-
var
|
|
322569
|
+
var import_rxjs61, import_operators41, list_default7;
|
|
322433
322570
|
var init_list7 = __esm({
|
|
322434
322571
|
"src/commands/triggers/message-queue/list.ts"() {
|
|
322435
|
-
|
|
322436
|
-
|
|
322572
|
+
import_rxjs61 = __toESM(require_cjs());
|
|
322573
|
+
import_operators41 = __toESM(require_operators());
|
|
322437
322574
|
init_helpers();
|
|
322438
322575
|
init_gql_client();
|
|
322439
322576
|
init_log();
|
|
322440
|
-
list_default7 = (cmd) => (0,
|
|
322577
|
+
list_default7 = (cmd) => (0, import_rxjs61.lastValueFrom)(
|
|
322441
322578
|
parseProjectId(cmd.project).pipe(
|
|
322442
|
-
(0,
|
|
322579
|
+
(0, import_operators41.switchMap)(
|
|
322443
322580
|
(projectId) => GraphqlClienAPI.listMessageQueueTriggers(projectId)
|
|
322444
322581
|
),
|
|
322445
|
-
(0,
|
|
322582
|
+
(0, import_operators41.tap)((triggers) => {
|
|
322446
322583
|
Logger.log("-------------------");
|
|
322447
322584
|
Logger.log("[Action][listMessageQueueTriggers]");
|
|
322448
322585
|
if (!triggers?.length) {
|
|
@@ -322473,11 +322610,11 @@ __export(save_exports, {
|
|
|
322473
322610
|
mergeOverExisting: () => mergeOverExisting,
|
|
322474
322611
|
toTriggerInput: () => toTriggerInput
|
|
322475
322612
|
});
|
|
322476
|
-
var
|
|
322613
|
+
var import_rxjs62, import_operators42, int2, toTriggerInput, mergeOverExisting, save_default;
|
|
322477
322614
|
var init_save = __esm({
|
|
322478
322615
|
"src/commands/triggers/message-queue/save.ts"() {
|
|
322479
|
-
|
|
322480
|
-
|
|
322616
|
+
import_rxjs62 = __toESM(require_cjs());
|
|
322617
|
+
import_operators42 = __toESM(require_operators());
|
|
322481
322618
|
init_helpers();
|
|
322482
322619
|
init_gql_client();
|
|
322483
322620
|
init_log();
|
|
@@ -322539,12 +322676,12 @@ var init_save = __esm({
|
|
|
322539
322676
|
)
|
|
322540
322677
|
);
|
|
322541
322678
|
};
|
|
322542
|
-
save_default = (mode, cmd) => (0,
|
|
322679
|
+
save_default = (mode, cmd) => (0, import_rxjs62.lastValueFrom)(
|
|
322543
322680
|
parseProjectId(cmd.project).pipe(
|
|
322544
|
-
(0,
|
|
322681
|
+
(0, import_operators42.switchMap)((projectId) => {
|
|
322545
322682
|
const changes = toTriggerInput(mode, cmd);
|
|
322546
|
-
const payload$ = mode === "create" ? (0,
|
|
322547
|
-
(0,
|
|
322683
|
+
const payload$ = mode === "create" ? (0, import_rxjs62.of)(changes) : GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
|
|
322684
|
+
(0, import_operators42.map)(
|
|
322548
322685
|
(triggers) => mergeOverExisting(
|
|
322549
322686
|
triggers.find((t2) => t2.name === cmd.name),
|
|
322550
322687
|
changes
|
|
@@ -322552,12 +322689,12 @@ var init_save = __esm({
|
|
|
322552
322689
|
)
|
|
322553
322690
|
);
|
|
322554
322691
|
return payload$.pipe(
|
|
322555
|
-
(0,
|
|
322692
|
+
(0, import_operators42.switchMap)(
|
|
322556
322693
|
(payload) => GraphqlClienAPI.saveMessageQueueTrigger(mode, projectId, payload)
|
|
322557
322694
|
)
|
|
322558
322695
|
);
|
|
322559
322696
|
}),
|
|
322560
|
-
(0,
|
|
322697
|
+
(0, import_operators42.tap)((trigger) => {
|
|
322561
322698
|
Logger.log("-------------------");
|
|
322562
322699
|
Logger.log(`[Action][${mode}MessageQueueTrigger]`);
|
|
322563
322700
|
Logger.table([
|
|
@@ -322576,25 +322713,134 @@ var init_save = __esm({
|
|
|
322576
322713
|
}
|
|
322577
322714
|
});
|
|
322578
322715
|
|
|
322716
|
+
// src/commands/triggers/message-queue/apply.ts
|
|
322717
|
+
var apply_exports2 = {};
|
|
322718
|
+
__export(apply_exports2, {
|
|
322719
|
+
applyMode: () => applyMode,
|
|
322720
|
+
default: () => apply_default2,
|
|
322721
|
+
yamlTriggerInput: () => yamlTriggerInput
|
|
322722
|
+
});
|
|
322723
|
+
var import_rxjs63, import_operators43, yamlTriggerInput, applyMode, apply_default2;
|
|
322724
|
+
var init_apply2 = __esm({
|
|
322725
|
+
"src/commands/triggers/message-queue/apply.ts"() {
|
|
322726
|
+
import_rxjs63 = __toESM(require_cjs());
|
|
322727
|
+
import_operators43 = __toESM(require_operators());
|
|
322728
|
+
init_load_spec();
|
|
322729
|
+
init_resolve_broker();
|
|
322730
|
+
init_helpers();
|
|
322731
|
+
init_gql_client();
|
|
322732
|
+
init_log();
|
|
322733
|
+
init_save();
|
|
322734
|
+
yamlTriggerInput = (trigger, defaults) => {
|
|
322735
|
+
if (!trigger?.name || !trigger.requestTopic) {
|
|
322736
|
+
throw new Error("triggers.mq: every entry needs `name` and `requestTopic`");
|
|
322737
|
+
}
|
|
322738
|
+
const lambdaName = trigger.lambda ?? defaults.lambda;
|
|
322739
|
+
if (!lambdaName) {
|
|
322740
|
+
throw new Error(
|
|
322741
|
+
`triggers.mq "${trigger.name}": no lambda - set \`lambda\` or \`function.name\``
|
|
322742
|
+
);
|
|
322743
|
+
}
|
|
322744
|
+
const input = {
|
|
322745
|
+
name: trigger.name,
|
|
322746
|
+
lambdaName,
|
|
322747
|
+
requestTopic: trigger.requestTopic,
|
|
322748
|
+
responseTopic: trigger.responseTopic,
|
|
322749
|
+
errorTopic: trigger.errorTopic,
|
|
322750
|
+
rabbitMqId: defaults.brokerId,
|
|
322751
|
+
maxRetries: trigger.maxRetries,
|
|
322752
|
+
coolDownPeriod: trigger.coolDownPeriod,
|
|
322753
|
+
pollingInterval: trigger.pollingInterval,
|
|
322754
|
+
minReplicaCount: trigger.minReplicas,
|
|
322755
|
+
maxReplicaCount: trigger.maxReplicas,
|
|
322756
|
+
threshold: trigger.threshold
|
|
322757
|
+
};
|
|
322758
|
+
return Object.fromEntries(
|
|
322759
|
+
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
322760
|
+
);
|
|
322761
|
+
};
|
|
322762
|
+
applyMode = (existing, name2) => existing.some((t2) => t2.name === name2) ? "update" : "create";
|
|
322763
|
+
apply_default2 = (cmd) => (0, import_rxjs63.lastValueFrom)(
|
|
322764
|
+
parseProjectId(cmd.project).pipe(
|
|
322765
|
+
(0, import_operators43.switchMap)(
|
|
322766
|
+
(projectId) => loadSpec(cmd.spec).pipe(
|
|
322767
|
+
(0, import_operators43.switchMap)((data) => {
|
|
322768
|
+
const triggers = data?.triggers?.mq ?? [];
|
|
322769
|
+
if (!triggers.length) {
|
|
322770
|
+
throw new Error(
|
|
322771
|
+
"mq-trigger:apply needs triggers.mq in lambforge.yaml"
|
|
322772
|
+
);
|
|
322773
|
+
}
|
|
322774
|
+
return GraphqlClienAPI.listRabbitMqInstances(projectId).pipe(
|
|
322775
|
+
(0, import_operators43.switchMap)(
|
|
322776
|
+
(brokers) => GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
|
|
322777
|
+
(0, import_operators43.switchMap)(
|
|
322778
|
+
(existing) => (0, import_rxjs63.concat)(
|
|
322779
|
+
...triggers.map((trigger) => {
|
|
322780
|
+
const input = yamlTriggerInput(trigger, {
|
|
322781
|
+
lambda: data?.function?.name ?? data?.name,
|
|
322782
|
+
brokerId: resolveBroker(
|
|
322783
|
+
brokers,
|
|
322784
|
+
trigger.broker ?? data?.queues?.broker
|
|
322785
|
+
).id
|
|
322786
|
+
});
|
|
322787
|
+
const mode = applyMode(existing ?? [], input.name);
|
|
322788
|
+
return GraphqlClienAPI.saveMessageQueueTrigger(
|
|
322789
|
+
mode,
|
|
322790
|
+
projectId,
|
|
322791
|
+
mode === "create" ? input : mergeOverExisting(
|
|
322792
|
+
existing.find((t2) => t2.name === input.name),
|
|
322793
|
+
input
|
|
322794
|
+
)
|
|
322795
|
+
).pipe((0, import_operators43.map)((saved) => ({ mode, saved })));
|
|
322796
|
+
})
|
|
322797
|
+
).pipe((0, import_operators43.toArray)())
|
|
322798
|
+
)
|
|
322799
|
+
)
|
|
322800
|
+
)
|
|
322801
|
+
);
|
|
322802
|
+
})
|
|
322803
|
+
)
|
|
322804
|
+
),
|
|
322805
|
+
(0, import_operators43.tap)((results) => {
|
|
322806
|
+
Logger.log("-------------------");
|
|
322807
|
+
Logger.log("[Action][applyMessageQueueTriggers]");
|
|
322808
|
+
Logger.table(
|
|
322809
|
+
results.map(({ mode, saved }) => ({
|
|
322810
|
+
name: saved.name,
|
|
322811
|
+
lambda: saved.lambdaName,
|
|
322812
|
+
requestTopic: saved.requestTopic,
|
|
322813
|
+
responseTopic: saved.responseTopic ?? "",
|
|
322814
|
+
errorTopic: saved.errorTopic ?? "",
|
|
322815
|
+
result: mode === "create" ? "created" : "updated"
|
|
322816
|
+
}))
|
|
322817
|
+
);
|
|
322818
|
+
Logger.log("-------------------");
|
|
322819
|
+
})
|
|
322820
|
+
)
|
|
322821
|
+
);
|
|
322822
|
+
}
|
|
322823
|
+
});
|
|
322824
|
+
|
|
322579
322825
|
// src/commands/triggers/message-queue/delete.ts
|
|
322580
322826
|
var delete_exports4 = {};
|
|
322581
322827
|
__export(delete_exports4, {
|
|
322582
322828
|
default: () => delete_default4
|
|
322583
322829
|
});
|
|
322584
|
-
var
|
|
322830
|
+
var import_rxjs64, import_operators44, delete_default4;
|
|
322585
322831
|
var init_delete4 = __esm({
|
|
322586
322832
|
"src/commands/triggers/message-queue/delete.ts"() {
|
|
322587
|
-
|
|
322588
|
-
|
|
322833
|
+
import_rxjs64 = __toESM(require_cjs());
|
|
322834
|
+
import_operators44 = __toESM(require_operators());
|
|
322589
322835
|
init_helpers();
|
|
322590
322836
|
init_gql_client();
|
|
322591
322837
|
init_log();
|
|
322592
|
-
delete_default4 = (cmd) => (0,
|
|
322838
|
+
delete_default4 = (cmd) => (0, import_rxjs64.lastValueFrom)(
|
|
322593
322839
|
parseProjectId(cmd.project).pipe(
|
|
322594
|
-
(0,
|
|
322840
|
+
(0, import_operators44.switchMap)(
|
|
322595
322841
|
(projectId) => GraphqlClienAPI.deleteMessageQueueTrigger(projectId, cmd.name)
|
|
322596
322842
|
),
|
|
322597
|
-
(0,
|
|
322843
|
+
(0, import_operators44.tap)((trigger) => {
|
|
322598
322844
|
Logger.log("-------------------");
|
|
322599
322845
|
Logger.log("[Action][deleteMessageQueueTrigger]");
|
|
322600
322846
|
Logger.info(
|
|
@@ -322699,12 +322945,12 @@ var init_definition = __esm({
|
|
|
322699
322945
|
});
|
|
322700
322946
|
|
|
322701
322947
|
// src/commands/workflow/helpers.ts
|
|
322702
|
-
var import_promises7,
|
|
322948
|
+
var import_promises7, import_rxjs65, import_operators45, resolveWorkflow, withProject, readWorkflowFile, writeTextFile, POLL_MS, followRun, printRunResult;
|
|
322703
322949
|
var init_helpers4 = __esm({
|
|
322704
322950
|
"src/commands/workflow/helpers.ts"() {
|
|
322705
322951
|
import_promises7 = require("fs/promises");
|
|
322706
|
-
|
|
322707
|
-
|
|
322952
|
+
import_rxjs65 = __toESM(require_cjs());
|
|
322953
|
+
import_operators45 = __toESM(require_operators());
|
|
322708
322954
|
init_helpers();
|
|
322709
322955
|
init_gql_client();
|
|
322710
322956
|
init_log();
|
|
@@ -322714,7 +322960,7 @@ var init_helpers4 = __esm({
|
|
|
322714
322960
|
throw new Error("--name is required (see workflow:list)");
|
|
322715
322961
|
}
|
|
322716
322962
|
return GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
322717
|
-
(0,
|
|
322963
|
+
(0, import_operators45.map)((workflows) => {
|
|
322718
322964
|
const workflow = workflows.find((w) => w.name === name2 || w.id === name2);
|
|
322719
322965
|
if (!workflow) {
|
|
322720
322966
|
throw new Error(
|
|
@@ -322725,30 +322971,30 @@ var init_helpers4 = __esm({
|
|
|
322725
322971
|
})
|
|
322726
322972
|
);
|
|
322727
322973
|
};
|
|
322728
|
-
withProject = (project, fn) => (0,
|
|
322974
|
+
withProject = (project, fn) => (0, import_rxjs65.lastValueFrom)(parseProjectId(project).pipe((0, import_operators45.switchMap)(fn)));
|
|
322729
322975
|
readWorkflowFile = (path2) => {
|
|
322730
322976
|
if (!path2) {
|
|
322731
322977
|
throw new Error("--file is required (a workflow YAML or JSON file)");
|
|
322732
322978
|
}
|
|
322733
|
-
return (0,
|
|
322979
|
+
return (0, import_rxjs65.from)((0, import_promises7.readFile)(path2, "utf8")).pipe((0, import_operators45.map)(parseWorkflowFile));
|
|
322734
322980
|
};
|
|
322735
|
-
writeTextFile = (path2, text) => (0,
|
|
322981
|
+
writeTextFile = (path2, text) => (0, import_rxjs65.from)((0, import_promises7.writeFile)(path2, text, "utf8"));
|
|
322736
322982
|
POLL_MS = 2e3;
|
|
322737
322983
|
followRun = (projectId, workflowId, runName) => {
|
|
322738
322984
|
let printed = 0;
|
|
322739
|
-
return (0,
|
|
322740
|
-
(0,
|
|
322985
|
+
return (0, import_rxjs65.timer)(0, POLL_MS).pipe(
|
|
322986
|
+
(0, import_operators45.switchMap)(
|
|
322741
322987
|
() => GraphqlClienAPI.getWorkflowRun(projectId, workflowId, runName)
|
|
322742
322988
|
),
|
|
322743
|
-
(0,
|
|
322989
|
+
(0, import_operators45.tap)((run2) => {
|
|
322744
322990
|
for (const e2 of newEvents(run2, printed)) {
|
|
322745
322991
|
Logger.log(formatEvent(e2));
|
|
322746
322992
|
printed = Math.max(printed, e2.seq);
|
|
322747
322993
|
}
|
|
322748
322994
|
}),
|
|
322749
|
-
(0,
|
|
322750
|
-
(0,
|
|
322751
|
-
(0,
|
|
322995
|
+
(0, import_operators45.filter)((run2) => isTerminal2(run2.phase)),
|
|
322996
|
+
(0, import_operators45.take)(1),
|
|
322997
|
+
(0, import_operators45.tap)(printRunResult)
|
|
322752
322998
|
);
|
|
322753
322999
|
};
|
|
322754
323000
|
printRunResult = (run2) => {
|
|
@@ -322771,10 +323017,10 @@ var list_exports8 = {};
|
|
|
322771
323017
|
__export(list_exports8, {
|
|
322772
323018
|
default: () => list_default8
|
|
322773
323019
|
});
|
|
322774
|
-
var
|
|
323020
|
+
var import_operators46, list_default8;
|
|
322775
323021
|
var init_list8 = __esm({
|
|
322776
323022
|
"src/commands/workflow/list.ts"() {
|
|
322777
|
-
|
|
323023
|
+
import_operators46 = __toESM(require_operators());
|
|
322778
323024
|
init_gql_client();
|
|
322779
323025
|
init_log();
|
|
322780
323026
|
init_definition();
|
|
@@ -322782,7 +323028,7 @@ var init_list8 = __esm({
|
|
|
322782
323028
|
list_default8 = (cmd) => withProject(
|
|
322783
323029
|
cmd.project,
|
|
322784
323030
|
(projectId) => GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
322785
|
-
(0,
|
|
323031
|
+
(0, import_operators46.tap)((workflows) => {
|
|
322786
323032
|
if (!workflows.length) {
|
|
322787
323033
|
Logger.info(
|
|
322788
323034
|
"No workflows yet. Draft one with workflow:generate, or write a file and workflow:apply it."
|
|
@@ -322809,18 +323055,18 @@ var get_exports2 = {};
|
|
|
322809
323055
|
__export(get_exports2, {
|
|
322810
323056
|
default: () => get_default2
|
|
322811
323057
|
});
|
|
322812
|
-
var
|
|
323058
|
+
var import_rxjs66, import_operators47, get_default2;
|
|
322813
323059
|
var init_get2 = __esm({
|
|
322814
323060
|
"src/commands/workflow/get.ts"() {
|
|
322815
|
-
|
|
322816
|
-
|
|
323061
|
+
import_rxjs66 = __toESM(require_cjs());
|
|
323062
|
+
import_operators47 = __toESM(require_operators());
|
|
322817
323063
|
init_log();
|
|
322818
323064
|
init_definition();
|
|
322819
323065
|
init_helpers4();
|
|
322820
323066
|
get_default2 = (cmd) => withProject(
|
|
322821
323067
|
cmd.project,
|
|
322822
323068
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
322823
|
-
(0,
|
|
323069
|
+
(0, import_operators47.switchMap)((w) => {
|
|
322824
323070
|
const text = toWorkflowYaml({
|
|
322825
323071
|
name: w.name,
|
|
322826
323072
|
description: w.description ?? void 0,
|
|
@@ -322828,10 +323074,10 @@ var init_get2 = __esm({
|
|
|
322828
323074
|
});
|
|
322829
323075
|
if (!cmd.out) {
|
|
322830
323076
|
Logger.log(text);
|
|
322831
|
-
return (0,
|
|
323077
|
+
return (0, import_rxjs66.of)(null);
|
|
322832
323078
|
}
|
|
322833
323079
|
return writeTextFile(cmd.out, text).pipe(
|
|
322834
|
-
(0,
|
|
323080
|
+
(0, import_operators47.tap)(() => Logger.info(`Wrote ${cmd.out}`))
|
|
322835
323081
|
);
|
|
322836
323082
|
})
|
|
322837
323083
|
)
|
|
@@ -322840,15 +323086,15 @@ var init_get2 = __esm({
|
|
|
322840
323086
|
});
|
|
322841
323087
|
|
|
322842
323088
|
// src/commands/workflow/apply.ts
|
|
322843
|
-
var
|
|
322844
|
-
__export(
|
|
323089
|
+
var apply_exports3 = {};
|
|
323090
|
+
__export(apply_exports3, {
|
|
322845
323091
|
applyWorkflow: () => applyWorkflow,
|
|
322846
|
-
default: () =>
|
|
323092
|
+
default: () => apply_default3
|
|
322847
323093
|
});
|
|
322848
|
-
var
|
|
322849
|
-
var
|
|
323094
|
+
var import_operators48, applyWorkflow, apply_default3;
|
|
323095
|
+
var init_apply3 = __esm({
|
|
322850
323096
|
"src/commands/workflow/apply.ts"() {
|
|
322851
|
-
|
|
323097
|
+
import_operators48 = __toESM(require_operators());
|
|
322852
323098
|
init_gql_client();
|
|
322853
323099
|
init_log();
|
|
322854
323100
|
init_helpers4();
|
|
@@ -322859,7 +323105,7 @@ var init_apply2 = __esm({
|
|
|
322859
323105
|
);
|
|
322860
323106
|
}
|
|
322861
323107
|
return GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
322862
|
-
(0,
|
|
323108
|
+
(0, import_operators48.switchMap)((workflows) => {
|
|
322863
323109
|
const existing = workflows.find((w) => w.name === file2.name);
|
|
322864
323110
|
return existing ? GraphqlClienAPI.updateWorkflow(projectId, existing.id, {
|
|
322865
323111
|
description: file2.description,
|
|
@@ -322871,17 +323117,17 @@ var init_apply2 = __esm({
|
|
|
322871
323117
|
clusterId: file2.clusterId
|
|
322872
323118
|
});
|
|
322873
323119
|
}),
|
|
322874
|
-
(0,
|
|
323120
|
+
(0, import_operators48.tap)(
|
|
322875
323121
|
(w) => Logger.info(
|
|
322876
323122
|
`Workflow ${w.name} saved (${Object.keys(w.definition?.states ?? {}).length} steps). Run it: gcli workflow:run --name ${w.name} --wait`
|
|
322877
323123
|
)
|
|
322878
323124
|
)
|
|
322879
323125
|
);
|
|
322880
323126
|
};
|
|
322881
|
-
|
|
323127
|
+
apply_default3 = (cmd) => withProject(
|
|
322882
323128
|
cmd.project,
|
|
322883
323129
|
(projectId) => readWorkflowFile(cmd.file).pipe(
|
|
322884
|
-
(0,
|
|
323130
|
+
(0, import_operators48.switchMap)(
|
|
322885
323131
|
(file2) => applyWorkflow(projectId, {
|
|
322886
323132
|
...file2,
|
|
322887
323133
|
name: cmd.name ?? file2.name,
|
|
@@ -322898,15 +323144,15 @@ var generate_exports = {};
|
|
|
322898
323144
|
__export(generate_exports, {
|
|
322899
323145
|
default: () => generate_default
|
|
322900
323146
|
});
|
|
322901
|
-
var import_promises8,
|
|
323147
|
+
var import_promises8, import_rxjs67, import_operators49, generate_default;
|
|
322902
323148
|
var init_generate = __esm({
|
|
322903
323149
|
"src/commands/workflow/generate.ts"() {
|
|
322904
323150
|
import_promises8 = require("fs/promises");
|
|
322905
|
-
|
|
322906
|
-
|
|
323151
|
+
import_rxjs67 = __toESM(require_cjs());
|
|
323152
|
+
import_operators49 = __toESM(require_operators());
|
|
322907
323153
|
init_gql_client();
|
|
322908
323154
|
init_log();
|
|
322909
|
-
|
|
323155
|
+
init_apply3();
|
|
322910
323156
|
init_definition();
|
|
322911
323157
|
init_helpers4();
|
|
322912
323158
|
generate_default = (cmd) => withProject(cmd.project, (projectId) => {
|
|
@@ -322915,26 +323161,26 @@ var init_generate = __esm({
|
|
|
322915
323161
|
'Describe the workflow: --description "charge the card with retries, then email the receipt"'
|
|
322916
323162
|
);
|
|
322917
323163
|
}
|
|
322918
|
-
const base$ = cmd.from ? (0,
|
|
322919
|
-
(0,
|
|
323164
|
+
const base$ = cmd.from ? (0, import_rxjs67.from)((0, import_promises8.readFile)(cmd.from, "utf8")).pipe((0, import_operators49.map)(parseWorkflowFile)) : cmd.name ? GraphqlClienAPI.listWorkflows(projectId).pipe(
|
|
323165
|
+
(0, import_operators49.switchMap)(
|
|
322920
323166
|
(workflows) => workflows.some((w) => w.name === cmd.name) ? resolveWorkflow(projectId, cmd.name).pipe(
|
|
322921
|
-
(0,
|
|
323167
|
+
(0, import_operators49.map)((w) => ({
|
|
322922
323168
|
name: w.name,
|
|
322923
323169
|
description: w.description ?? void 0,
|
|
322924
323170
|
definition: w.definition
|
|
322925
323171
|
}))
|
|
322926
|
-
) : (0,
|
|
323172
|
+
) : (0, import_rxjs67.of)(null)
|
|
322927
323173
|
)
|
|
322928
|
-
) : (0,
|
|
323174
|
+
) : (0, import_rxjs67.of)(null);
|
|
322929
323175
|
return base$.pipe(
|
|
322930
|
-
(0,
|
|
322931
|
-
(0,
|
|
323176
|
+
(0, import_operators49.tap)(() => Logger.info("Asking the AI for a draft...")),
|
|
323177
|
+
(0, import_operators49.switchMap)(
|
|
322932
323178
|
(base) => GraphqlClienAPI.generateWorkflowDraft(
|
|
322933
323179
|
projectId,
|
|
322934
323180
|
cmd.description,
|
|
322935
323181
|
base?.definition
|
|
322936
323182
|
).pipe(
|
|
322937
|
-
(0,
|
|
323183
|
+
(0, import_operators49.map)((draft) => ({
|
|
322938
323184
|
draft,
|
|
322939
323185
|
file: {
|
|
322940
323186
|
name: cmd.name ?? base?.name,
|
|
@@ -322944,19 +323190,19 @@ var init_generate = __esm({
|
|
|
322944
323190
|
}))
|
|
322945
323191
|
)
|
|
322946
323192
|
),
|
|
322947
|
-
(0,
|
|
323193
|
+
(0, import_operators49.tap)(({ draft }) => {
|
|
322948
323194
|
if (draft.explanation) Logger.log(draft.explanation);
|
|
322949
323195
|
(draft.warnings ?? []).filter(Boolean).forEach((w) => Logger.warn(`- ${w}`));
|
|
322950
323196
|
}),
|
|
322951
|
-
(0,
|
|
323197
|
+
(0, import_operators49.switchMap)(({ file: file2 }) => {
|
|
322952
323198
|
const text = toWorkflowYaml(file2);
|
|
322953
323199
|
const written$ = cmd.out ? writeTextFile(cmd.out, text).pipe(
|
|
322954
|
-
(0,
|
|
322955
|
-
) : (0,
|
|
323200
|
+
(0, import_operators49.tap)(() => Logger.info(`Wrote ${cmd.out}`))
|
|
323201
|
+
) : (0, import_rxjs67.of)(null).pipe((0, import_operators49.tap)(() => !cmd.apply && Logger.log(text)));
|
|
322956
323202
|
return written$.pipe(
|
|
322957
|
-
(0,
|
|
322958
|
-
() => cmd.apply ? applyWorkflow(projectId, file2) : (0,
|
|
322959
|
-
(0,
|
|
323203
|
+
(0, import_operators49.switchMap)(
|
|
323204
|
+
() => cmd.apply ? applyWorkflow(projectId, file2) : (0, import_rxjs67.of)(null).pipe(
|
|
323205
|
+
(0, import_operators49.tap)(
|
|
322960
323206
|
() => Logger.info(
|
|
322961
323207
|
cmd.out ? `Review it, then: gcli workflow:apply --file ${cmd.out}${file2.name ? "" : " --name <name>"}` : "Save it with -o <file>, or re-run with --apply --name <name>"
|
|
322962
323208
|
)
|
|
@@ -322975,24 +323221,24 @@ var validate_exports = {};
|
|
|
322975
323221
|
__export(validate_exports, {
|
|
322976
323222
|
default: () => validate_default
|
|
322977
323223
|
});
|
|
322978
|
-
var
|
|
323224
|
+
var import_operators50, validate_default;
|
|
322979
323225
|
var init_validate = __esm({
|
|
322980
323226
|
"src/commands/workflow/validate.ts"() {
|
|
322981
|
-
|
|
323227
|
+
import_operators50 = __toESM(require_operators());
|
|
322982
323228
|
init_gql_client();
|
|
322983
323229
|
init_log();
|
|
322984
323230
|
init_helpers4();
|
|
322985
323231
|
validate_default = (cmd) => withProject(
|
|
322986
323232
|
cmd.project,
|
|
322987
323233
|
(projectId) => readWorkflowFile(cmd.file).pipe(
|
|
322988
|
-
(0,
|
|
323234
|
+
(0, import_operators50.switchMap)(
|
|
322989
323235
|
(file2) => GraphqlClienAPI.validateWorkflow(
|
|
322990
323236
|
projectId,
|
|
322991
323237
|
file2.definition,
|
|
322992
323238
|
file2.clusterId
|
|
322993
323239
|
)
|
|
322994
323240
|
),
|
|
322995
|
-
(0,
|
|
323241
|
+
(0, import_operators50.tap)(
|
|
322996
323242
|
(v) => Logger.info(
|
|
322997
323243
|
`Valid. Calls: ${(v.functions ?? []).join(", ") || "no lambdas"}`
|
|
322998
323244
|
)
|
|
@@ -323007,18 +323253,18 @@ var delete_exports5 = {};
|
|
|
323007
323253
|
__export(delete_exports5, {
|
|
323008
323254
|
default: () => delete_default5
|
|
323009
323255
|
});
|
|
323010
|
-
var
|
|
323256
|
+
var import_operators51, delete_default5;
|
|
323011
323257
|
var init_delete5 = __esm({
|
|
323012
323258
|
"src/commands/workflow/delete.ts"() {
|
|
323013
|
-
|
|
323259
|
+
import_operators51 = __toESM(require_operators());
|
|
323014
323260
|
init_gql_client();
|
|
323015
323261
|
init_log();
|
|
323016
323262
|
init_helpers4();
|
|
323017
323263
|
delete_default5 = (cmd) => withProject(
|
|
323018
323264
|
cmd.project,
|
|
323019
323265
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323020
|
-
(0,
|
|
323021
|
-
(0,
|
|
323266
|
+
(0, import_operators51.switchMap)((w) => GraphqlClienAPI.deleteWorkflow(projectId, w.id)),
|
|
323267
|
+
(0, import_operators51.tap)((w) => Logger.info(`Deleted workflow ${w.name} and its runs`))
|
|
323022
323268
|
)
|
|
323023
323269
|
);
|
|
323024
323270
|
}
|
|
@@ -323029,28 +323275,28 @@ var run_exports = {};
|
|
|
323029
323275
|
__export(run_exports, {
|
|
323030
323276
|
default: () => run_default
|
|
323031
323277
|
});
|
|
323032
|
-
var import_promises9,
|
|
323278
|
+
var import_promises9, import_rxjs68, import_operators52, run_default;
|
|
323033
323279
|
var init_run = __esm({
|
|
323034
323280
|
"src/commands/workflow/run.ts"() {
|
|
323035
323281
|
import_promises9 = require("fs/promises");
|
|
323036
|
-
|
|
323037
|
-
|
|
323282
|
+
import_rxjs68 = __toESM(require_cjs());
|
|
323283
|
+
import_operators52 = __toESM(require_operators());
|
|
323038
323284
|
init_gql_client();
|
|
323039
323285
|
init_log();
|
|
323040
323286
|
init_definition();
|
|
323041
323287
|
init_helpers4();
|
|
323042
323288
|
run_default = (cmd) => withProject(
|
|
323043
323289
|
cmd.project,
|
|
323044
|
-
(projectId) => (cmd.inputFile ? (0,
|
|
323045
|
-
(0,
|
|
323046
|
-
(0,
|
|
323290
|
+
(projectId) => (cmd.inputFile ? (0, import_rxjs68.from)((0, import_promises9.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs68.of)(cmd.input)).pipe(
|
|
323291
|
+
(0, import_operators52.map)(parseRunInput),
|
|
323292
|
+
(0, import_operators52.switchMap)(
|
|
323047
323293
|
(input) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323048
|
-
(0,
|
|
323294
|
+
(0, import_operators52.switchMap)(
|
|
323049
323295
|
(w) => GraphqlClienAPI.startWorkflowRun(projectId, w.id, input).pipe(
|
|
323050
|
-
(0,
|
|
323051
|
-
(0,
|
|
323052
|
-
(run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0,
|
|
323053
|
-
(0,
|
|
323296
|
+
(0, import_operators52.tap)((run2) => Logger.info(`Started run ${run2.name}`)),
|
|
323297
|
+
(0, import_operators52.switchMap)(
|
|
323298
|
+
(run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0, import_rxjs68.of)(run2).pipe(
|
|
323299
|
+
(0, import_operators52.tap)(
|
|
323054
323300
|
() => Logger.info(
|
|
323055
323301
|
`Follow it: gcli workflow:status --name ${w.name} --run ${run2.name} --follow`
|
|
323056
323302
|
)
|
|
@@ -323126,10 +323372,10 @@ var runs_exports = {};
|
|
|
323126
323372
|
__export(runs_exports, {
|
|
323127
323373
|
default: () => runs_default
|
|
323128
323374
|
});
|
|
323129
|
-
var
|
|
323375
|
+
var import_operators53, runs_default;
|
|
323130
323376
|
var init_runs = __esm({
|
|
323131
323377
|
"src/commands/workflow/runs.ts"() {
|
|
323132
|
-
|
|
323378
|
+
import_operators53 = __toESM(require_operators());
|
|
323133
323379
|
init_gql_client();
|
|
323134
323380
|
init_log();
|
|
323135
323381
|
init_helpers4();
|
|
@@ -323137,14 +323383,14 @@ var init_runs = __esm({
|
|
|
323137
323383
|
runs_default = (cmd) => withProject(
|
|
323138
323384
|
cmd.project,
|
|
323139
323385
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323140
|
-
(0,
|
|
323386
|
+
(0, import_operators53.switchMap)(
|
|
323141
323387
|
(w) => GraphqlClienAPI.listWorkflowRuns(
|
|
323142
323388
|
projectId,
|
|
323143
323389
|
w.id,
|
|
323144
323390
|
cmd.limit ? Number(cmd.limit) : void 0
|
|
323145
323391
|
)
|
|
323146
323392
|
),
|
|
323147
|
-
(0,
|
|
323393
|
+
(0, import_operators53.tap)(
|
|
323148
323394
|
(runs) => runs.length ? Logger.table(
|
|
323149
323395
|
runs.map((r2) => ({
|
|
323150
323396
|
run: r2.name,
|
|
@@ -323166,10 +323412,10 @@ var status_exports2 = {};
|
|
|
323166
323412
|
__export(status_exports2, {
|
|
323167
323413
|
default: () => status_default2
|
|
323168
323414
|
});
|
|
323169
|
-
var
|
|
323415
|
+
var import_operators54, status_default2;
|
|
323170
323416
|
var init_status2 = __esm({
|
|
323171
323417
|
"src/commands/workflow/status.ts"() {
|
|
323172
|
-
|
|
323418
|
+
import_operators54 = __toESM(require_operators());
|
|
323173
323419
|
init_gql_client();
|
|
323174
323420
|
init_log();
|
|
323175
323421
|
init_definition();
|
|
@@ -323179,9 +323425,9 @@ var init_status2 = __esm({
|
|
|
323179
323425
|
throw new Error("--run is required (see workflow:runs)");
|
|
323180
323426
|
}
|
|
323181
323427
|
return resolveWorkflow(projectId, cmd.name).pipe(
|
|
323182
|
-
(0,
|
|
323428
|
+
(0, import_operators54.switchMap)(
|
|
323183
323429
|
(w) => cmd.follow ? followRun(projectId, w.id, cmd.run) : GraphqlClienAPI.getWorkflowRun(projectId, w.id, cmd.run).pipe(
|
|
323184
|
-
(0,
|
|
323430
|
+
(0, import_operators54.tap)((run2) => {
|
|
323185
323431
|
(run2.events ?? []).forEach((e2) => Logger.log(formatEvent(e2)));
|
|
323186
323432
|
printRunResult(run2);
|
|
323187
323433
|
})
|
|
@@ -323197,10 +323443,10 @@ var cancel_exports = {};
|
|
|
323197
323443
|
__export(cancel_exports, {
|
|
323198
323444
|
default: () => cancel_default
|
|
323199
323445
|
});
|
|
323200
|
-
var
|
|
323446
|
+
var import_operators55, cancel_default;
|
|
323201
323447
|
var init_cancel = __esm({
|
|
323202
323448
|
"src/commands/workflow/cancel.ts"() {
|
|
323203
|
-
|
|
323449
|
+
import_operators55 = __toESM(require_operators());
|
|
323204
323450
|
init_gql_client();
|
|
323205
323451
|
init_log();
|
|
323206
323452
|
init_helpers4();
|
|
@@ -323209,10 +323455,10 @@ var init_cancel = __esm({
|
|
|
323209
323455
|
throw new Error("--run is required (see workflow:runs)");
|
|
323210
323456
|
}
|
|
323211
323457
|
return resolveWorkflow(projectId, cmd.name).pipe(
|
|
323212
|
-
(0,
|
|
323458
|
+
(0, import_operators55.switchMap)(
|
|
323213
323459
|
(w) => GraphqlClienAPI.cancelWorkflowRun(projectId, w.id, cmd.run)
|
|
323214
323460
|
),
|
|
323215
|
-
(0,
|
|
323461
|
+
(0, import_operators55.tap)((run2) => Logger.info(`Run ${run2.name}: ${run2.phase}`))
|
|
323216
323462
|
);
|
|
323217
323463
|
});
|
|
323218
323464
|
}
|
|
@@ -323223,30 +323469,30 @@ var trigger_add_exports = {};
|
|
|
323223
323469
|
__export(trigger_add_exports, {
|
|
323224
323470
|
default: () => trigger_add_default
|
|
323225
323471
|
});
|
|
323226
|
-
var import_promises10,
|
|
323472
|
+
var import_promises10, import_rxjs69, import_operators56, trigger_add_default;
|
|
323227
323473
|
var init_trigger_add = __esm({
|
|
323228
323474
|
"src/commands/workflow/trigger-add.ts"() {
|
|
323229
323475
|
import_promises10 = require("fs/promises");
|
|
323230
|
-
|
|
323231
|
-
|
|
323476
|
+
import_rxjs69 = __toESM(require_cjs());
|
|
323477
|
+
import_operators56 = __toESM(require_operators());
|
|
323232
323478
|
init_gql_client();
|
|
323233
323479
|
init_log();
|
|
323234
323480
|
init_helpers4();
|
|
323235
323481
|
init_triggers();
|
|
323236
323482
|
trigger_add_default = (cmd) => withProject(
|
|
323237
323483
|
cmd.project,
|
|
323238
|
-
(projectId) => (cmd.inputFile ? (0,
|
|
323239
|
-
(0,
|
|
323240
|
-
(0,
|
|
323484
|
+
(projectId) => (cmd.inputFile ? (0, import_rxjs69.from)((0, import_promises10.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs69.of)(void 0)).pipe(
|
|
323485
|
+
(0, import_operators56.map)((inputText) => buildTriggerInput({ ...cmd, inputText })),
|
|
323486
|
+
(0, import_operators56.switchMap)(
|
|
323241
323487
|
(trigger) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323242
|
-
(0,
|
|
323488
|
+
(0, import_operators56.switchMap)(
|
|
323243
323489
|
(w) => GraphqlClienAPI.addWorkflowTrigger(projectId, w.id, trigger).pipe(
|
|
323244
|
-
(0,
|
|
323490
|
+
(0, import_operators56.map)((updated) => ({ before: w.triggers ?? [], updated }))
|
|
323245
323491
|
)
|
|
323246
323492
|
)
|
|
323247
323493
|
)
|
|
323248
323494
|
),
|
|
323249
|
-
(0,
|
|
323495
|
+
(0, import_operators56.tap)(({ before, updated }) => {
|
|
323250
323496
|
const added = (updated.triggers ?? []).find(
|
|
323251
323497
|
(t2) => !before.some((b) => b.id === t2.id)
|
|
323252
323498
|
);
|
|
@@ -323270,17 +323516,17 @@ var trigger_list_exports = {};
|
|
|
323270
323516
|
__export(trigger_list_exports, {
|
|
323271
323517
|
default: () => trigger_list_default
|
|
323272
323518
|
});
|
|
323273
|
-
var
|
|
323519
|
+
var import_operators57, trigger_list_default;
|
|
323274
323520
|
var init_trigger_list = __esm({
|
|
323275
323521
|
"src/commands/workflow/trigger-list.ts"() {
|
|
323276
|
-
|
|
323522
|
+
import_operators57 = __toESM(require_operators());
|
|
323277
323523
|
init_log();
|
|
323278
323524
|
init_helpers4();
|
|
323279
323525
|
init_triggers();
|
|
323280
323526
|
trigger_list_default = (cmd) => withProject(
|
|
323281
323527
|
cmd.project,
|
|
323282
323528
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323283
|
-
(0,
|
|
323529
|
+
(0, import_operators57.tap)(
|
|
323284
323530
|
(w) => w.triggers?.length ? Logger.table(w.triggers.map(triggerRow)) : Logger.info(
|
|
323285
323531
|
'No triggers. Add one with workflow:trigger:add --http or --cron "@daily".'
|
|
323286
323532
|
)
|
|
@@ -323295,10 +323541,10 @@ var trigger_remove_exports = {};
|
|
|
323295
323541
|
__export(trigger_remove_exports, {
|
|
323296
323542
|
default: () => trigger_remove_default
|
|
323297
323543
|
});
|
|
323298
|
-
var
|
|
323544
|
+
var import_operators58, trigger_remove_default;
|
|
323299
323545
|
var init_trigger_remove = __esm({
|
|
323300
323546
|
"src/commands/workflow/trigger-remove.ts"() {
|
|
323301
|
-
|
|
323547
|
+
import_operators58 = __toESM(require_operators());
|
|
323302
323548
|
init_gql_client();
|
|
323303
323549
|
init_log();
|
|
323304
323550
|
init_helpers4();
|
|
@@ -323306,14 +323552,14 @@ var init_trigger_remove = __esm({
|
|
|
323306
323552
|
trigger_remove_default = (cmd) => withProject(
|
|
323307
323553
|
cmd.project,
|
|
323308
323554
|
(projectId) => resolveWorkflow(projectId, cmd.name).pipe(
|
|
323309
|
-
(0,
|
|
323555
|
+
(0, import_operators58.switchMap)(
|
|
323310
323556
|
(w) => GraphqlClienAPI.removeWorkflowTrigger(
|
|
323311
323557
|
projectId,
|
|
323312
323558
|
w.id,
|
|
323313
323559
|
findTrigger(w.triggers, cmd.trigger).id
|
|
323314
323560
|
)
|
|
323315
323561
|
),
|
|
323316
|
-
(0,
|
|
323562
|
+
(0, import_operators58.tap)(
|
|
323317
323563
|
(w) => Logger.info(
|
|
323318
323564
|
`Trigger removed from ${w.name} (${w.triggers?.length ?? 0} left)`
|
|
323319
323565
|
)
|
|
@@ -324610,12 +324856,12 @@ __export(start_exports4, {
|
|
|
324610
324856
|
WORKSPACE_VERSION: () => WORKSPACE_VERSION,
|
|
324611
324857
|
default: () => start_default2
|
|
324612
324858
|
});
|
|
324613
|
-
var import_promises12, import_path7,
|
|
324859
|
+
var import_promises12, import_path7, import_rxjs70, WORKSPACE_VERSION, csv, resolveWorkspace, start_default2;
|
|
324614
324860
|
var init_start4 = __esm({
|
|
324615
324861
|
"src/commands/workspace/start.ts"() {
|
|
324616
324862
|
import_promises12 = require("fs/promises");
|
|
324617
324863
|
import_path7 = require("path");
|
|
324618
|
-
|
|
324864
|
+
import_rxjs70 = __toESM(require_cjs());
|
|
324619
324865
|
init_helpers();
|
|
324620
324866
|
init_gql_client();
|
|
324621
324867
|
init_log();
|
|
@@ -324645,7 +324891,7 @@ var init_start4 = __esm({
|
|
|
324645
324891
|
if (saved && (!cmd.project || cmd.project === saved.projectId)) {
|
|
324646
324892
|
return saved;
|
|
324647
324893
|
}
|
|
324648
|
-
const projectId = await (0,
|
|
324894
|
+
const projectId = await (0, import_rxjs70.lastValueFrom)(parseProjectId(cmd.project)).catch(
|
|
324649
324895
|
() => {
|
|
324650
324896
|
throw new Error(
|
|
324651
324897
|
"No project selected. Pass --project <projectId> or run `gcli project:use <projectId>` first."
|
|
@@ -324654,7 +324900,7 @@ var init_start4 = __esm({
|
|
|
324654
324900
|
);
|
|
324655
324901
|
const name2 = cmd.name || (0, import_path7.basename)(root);
|
|
324656
324902
|
Logger.info(`Registering ${root} as local workspace "${name2}"...`);
|
|
324657
|
-
const { workspace, token } = await (0,
|
|
324903
|
+
const { workspace, token } = await (0, import_rxjs70.lastValueFrom)(
|
|
324658
324904
|
GraphqlClienAPI.createLocalWorkspace(projectId, name2)
|
|
324659
324905
|
).catch((e2) => {
|
|
324660
324906
|
throw new Error(
|
|
@@ -324745,16 +324991,16 @@ var list_exports9 = {};
|
|
|
324745
324991
|
__export(list_exports9, {
|
|
324746
324992
|
default: () => list_default9
|
|
324747
324993
|
});
|
|
324748
|
-
var
|
|
324994
|
+
var import_rxjs71, list_default9;
|
|
324749
324995
|
var init_list9 = __esm({
|
|
324750
324996
|
"src/commands/workspace/list.ts"() {
|
|
324751
|
-
|
|
324997
|
+
import_rxjs71 = __toESM(require_cjs());
|
|
324752
324998
|
init_gql_client();
|
|
324753
324999
|
init_log();
|
|
324754
325000
|
init_config2();
|
|
324755
325001
|
list_default9 = async (cmd) => {
|
|
324756
325002
|
const [workspaces, saved] = await Promise.all([
|
|
324757
|
-
(0,
|
|
325003
|
+
(0, import_rxjs71.lastValueFrom)(GraphqlClienAPI.listLocalWorkspaces(cmd.project)),
|
|
324758
325004
|
readSavedWorkspaces()
|
|
324759
325005
|
]);
|
|
324760
325006
|
const onThisMachine = new Set(Object.values(saved).map((w) => w.id));
|
|
@@ -324788,11 +325034,11 @@ var delete_exports6 = {};
|
|
|
324788
325034
|
__export(delete_exports6, {
|
|
324789
325035
|
default: () => delete_default6
|
|
324790
325036
|
});
|
|
324791
|
-
var import_promises13,
|
|
325037
|
+
var import_promises13, import_rxjs72, delete_default6;
|
|
324792
325038
|
var init_delete6 = __esm({
|
|
324793
325039
|
"src/commands/workspace/delete.ts"() {
|
|
324794
325040
|
import_promises13 = require("fs/promises");
|
|
324795
|
-
|
|
325041
|
+
import_rxjs72 = __toESM(require_cjs());
|
|
324796
325042
|
init_gql_client();
|
|
324797
325043
|
init_log();
|
|
324798
325044
|
init_config2();
|
|
@@ -324804,7 +325050,7 @@ var init_delete6 = __esm({
|
|
|
324804
325050
|
"No workspace registered for this directory - pass --id (see `gcli workspace:list`)."
|
|
324805
325051
|
);
|
|
324806
325052
|
}
|
|
324807
|
-
await (0,
|
|
325053
|
+
await (0, import_rxjs72.lastValueFrom)(GraphqlClienAPI.deleteLocalWorkspace(workspaceId));
|
|
324808
325054
|
await forgetWorkspace({ id: workspaceId });
|
|
324809
325055
|
Logger.log(
|
|
324810
325056
|
`Local workspace ${workspaceId} deleted; its token no longer works.`
|
|
@@ -325272,6 +325518,16 @@ function registerRabbitMqCommands(program2) {
|
|
|
325272
325518
|
"Which private cluster to provision this broker on; omit for the shared cluster"
|
|
325273
325519
|
).action(lazy(() => Promise.resolve().then(() => (init_create3(), create_exports3)).then((m2) => m2.default)));
|
|
325274
325520
|
program2.command("rabbitmq:list").description("List every RabbitMQ broker for a project").option("-p, --project <project>").action(lazy(() => Promise.resolve().then(() => (init_list5(), list_exports5)).then((m2) => m2.default)));
|
|
325521
|
+
program2.command("queue:declare").description(
|
|
325522
|
+
"Declare queues on a RabbitMQ broker of the project (skips the ones it has)"
|
|
325523
|
+
).option("-p, --project <project>").option(
|
|
325524
|
+
"-n, --name <name>",
|
|
325525
|
+
"Queue name; repeat for several. Without it: queues.declare in lambforge.yaml",
|
|
325526
|
+
(value, all = []) => [...all, value]
|
|
325527
|
+
).option(
|
|
325528
|
+
"--broker <broker>",
|
|
325529
|
+
"Broker name or id (see rabbitmq:list); optional when the project has one"
|
|
325530
|
+
).option("-spec, --spec <spec>").action(lazy(() => Promise.resolve().then(() => (init_declare_queue(), declare_queue_exports)).then((m2) => m2.default)));
|
|
325275
325531
|
program2.command("rabbitmq:delete").description("Delete a RabbitMQ broker").option("-p, --project <project>").option("--id <id>", "Broker id (see rabbitmq:list)").action(lazy(() => Promise.resolve().then(() => (init_delete2(), delete_exports2)).then((m2) => m2.default)));
|
|
325276
325532
|
}
|
|
325277
325533
|
|
|
@@ -325390,6 +325646,9 @@ function registerMessageQueueTriggerCommands(program2) {
|
|
|
325390
325646
|
).action(
|
|
325391
325647
|
lazy(() => Promise.resolve().then(() => (init_save(), save_exports)).then((m2) => (cmd) => m2.default("update", cmd)))
|
|
325392
325648
|
);
|
|
325649
|
+
program2.command("mq-trigger:apply").description(
|
|
325650
|
+
"Create or update the message-queue triggers listed under triggers.mq in lambforge.yaml"
|
|
325651
|
+
).option("-p, --project <project>").option("-spec, --spec <spec>").action(lazy(() => Promise.resolve().then(() => (init_apply2(), apply_exports2)).then((m2) => m2.default)));
|
|
325393
325652
|
program2.command("mq-trigger:delete").description("Delete a message-queue trigger").option("-p, --project <project>").requiredOption("-n, --name <name>", "Trigger name").action(lazy(() => Promise.resolve().then(() => (init_delete4(), delete_exports4)).then((m2) => m2.default)));
|
|
325394
325653
|
}
|
|
325395
325654
|
|
|
@@ -325411,7 +325670,7 @@ function registerWorkflowCommands(program2) {
|
|
|
325411
325670
|
).option("--from <file>", "Change this workflow file instead").option("-o, --out <file>", "Write the draft YAML to this file").option("--apply", "Save the draft as the workflow (needs a name)").action(lazy(() => Promise.resolve().then(() => (init_generate(), generate_exports)).then((m2) => m2.default)));
|
|
325412
325671
|
program2.command("workflow:apply").description(
|
|
325413
325672
|
"Create or update a workflow from a YAML/JSON file (workflow: {name, description, definition})"
|
|
325414
|
-
).option("-p, --project <project>").option("-f, --file <file>", "Workflow file").option("-n, --name <name>", "Overrides workflow.name from the file").option("-d, --description <text>", "Overrides workflow.description").action(lazy(() => Promise.resolve().then(() => (
|
|
325673
|
+
).option("-p, --project <project>").option("-f, --file <file>", "Workflow file").option("-n, --name <name>", "Overrides workflow.name from the file").option("-d, --description <text>", "Overrides workflow.description").action(lazy(() => Promise.resolve().then(() => (init_apply3(), apply_exports3)).then((m2) => m2.default)));
|
|
325415
325674
|
program2.command("workflow:validate").description(
|
|
325416
325675
|
"Check a workflow file against the cluster (lambdas exist, graph is valid)"
|
|
325417
325676
|
).option("-p, --project <project>").option("-f, --file <file>", "Workflow file").action(lazy(() => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m2) => m2.default)));
|
|
@@ -325539,8 +325798,9 @@ if (!isWebContainer) {
|
|
|
325539
325798
|
} else {
|
|
325540
325799
|
}
|
|
325541
325800
|
}
|
|
325801
|
+
var version2 = true ? "1.8.266" : "development";
|
|
325542
325802
|
var main = (argv) => {
|
|
325543
|
-
import_commander.program.name("gcli").version(
|
|
325803
|
+
import_commander.program.name("gcli").version(version2);
|
|
325544
325804
|
commands.map((command) => command(import_commander.program));
|
|
325545
325805
|
import_commander.program.on("command:*", () => {
|
|
325546
325806
|
console.log();
|